Skip to content

Commit 2c4fe8b

Browse files
committed
Add service identifiers to GlobalConfig's list of identifiers outside of autoload
1 parent 87fff65 commit 2c4fe8b

File tree

5 files changed

+11
-4
lines changed

5 files changed

+11
-4
lines changed

build_tools/aws-sdk-code-generator/lib/aws-sdk-code-generator/views/service_module.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,14 @@ class ServiceModule < View
1010
# @option options [required, String] :prefix
1111
def initialize(options)
1212
@service = options.fetch(:service)
13+
@service_identifier = @service.identifier
1314
@prefix = options.fetch(:prefix)
1415
@codegenerated_plugins = options.fetch(:codegenerated_plugins) || []
1516
end
1617

18+
# @return [String]
19+
attr_reader :service_identifier
20+
1721
# @return [String|nil]
1822
def generated_src_warning
1923
return if @service.protocol == 'api-gateway'
@@ -108,7 +112,7 @@ def auto_load(path, class_name, is_plugin = false)
108112
}
109113
end
110114

111-
def service_identifier
115+
def prefix
112116
@prefix
113117
end
114118

build_tools/aws-sdk-code-generator/templates/client_class.mustache

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
require '{{.}}'
88
{{/plugin_requires}}
99

10-
Aws::Plugins::GlobalConfiguration.add_identifier(:{{service_identifier}})
11-
1210
module {{module_name}}
1311
# An API client for {{service_name}}. To construct a client, you need to configure a `:region` and `:credentials`.
1412
#

build_tools/aws-sdk-code-generator/templates/service_module.mustache

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ require '{{.}}'
1717
{{/requires}}
1818
{{/require_core_guard?}}
1919

20+
Aws::Plugins::GlobalConfiguration.add_identifier(:{{service_identifier}})
21+
2022
# This module provides support for {{full_name}}. This module is available in the
2123
# `{{gem_name}}` gem.
2224
#
@@ -63,4 +65,4 @@ module {{module_name}}
6365

6466
end
6567

66-
require_relative '{{service_identifier}}/customizations'
68+
require_relative '{{prefix}}/customizations'

gems/aws-sdk-core/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Unreleased Changes
22
------------------
33

4+
* Issue - Add service identifiers to GlobalConfig's list of identifiers outside of autoload (#3113).
5+
46
3.208.0 (2024-09-23)
57
------------------
68

gems/aws-sdk-core/lib/aws-sdk-core/plugins.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ module Aws
66
module Plugins
77
autoload :BearerAuthorization, 'aws-sdk-core/plugins/bearer_authorization'
88
autoload :SignatureV4, 'aws-sdk-core/plugins/signature_v4'
9+
autoload :GlobalConfiguration, 'aws-sdk-core/plugins/global_configuration'
910
end
1011
end

0 commit comments

Comments
 (0)