Skip to content

Commit

Permalink
Add service identifiers to GlobalConfig's list of identifiers outside…
Browse files Browse the repository at this point in the history
… of autoload
  • Loading branch information
alextwoods committed Sep 24, 2024
1 parent 87fff65 commit 2c4fe8b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,14 @@ class ServiceModule < View
# @option options [required, String] :prefix
def initialize(options)
@service = options.fetch(:service)
@service_identifier = @service.identifier
@prefix = options.fetch(:prefix)
@codegenerated_plugins = options.fetch(:codegenerated_plugins) || []
end

# @return [String]
attr_reader :service_identifier

This comment has been minimized.

Copy link
@mullermp

mullermp Sep 24, 2024

Contributor

You could have made this a method that just returns @service.identifier

This comment has been minimized.

Copy link
@alextwoods

alextwoods Sep 25, 2024

Author Contributor

yeah, on both of these I was just following existing patterns and trying to keep changes small.


# @return [String|nil]
def generated_src_warning
return if @service.protocol == 'api-gateway'
Expand Down Expand Up @@ -108,7 +112,7 @@ def auto_load(path, class_name, is_plugin = false)
}
end

def service_identifier
def prefix

This comment has been minimized.

Copy link
@mullermp

mullermp Sep 24, 2024

Contributor

This could be an attr_reader

@prefix
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
require '{{.}}'
{{/plugin_requires}}

Aws::Plugins::GlobalConfiguration.add_identifier(:{{service_identifier}})

module {{module_name}}
# An API client for {{service_name}}. To construct a client, you need to configure a `:region` and `:credentials`.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ require '{{.}}'
{{/requires}}
{{/require_core_guard?}}

Aws::Plugins::GlobalConfiguration.add_identifier(:{{service_identifier}})

# This module provides support for {{full_name}}. This module is available in the
# `{{gem_name}}` gem.
#
Expand Down Expand Up @@ -63,4 +65,4 @@ module {{module_name}}

end

require_relative '{{service_identifier}}/customizations'
require_relative '{{prefix}}/customizations'
2 changes: 2 additions & 0 deletions gems/aws-sdk-core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
Unreleased Changes
------------------

* Issue - Add service identifiers to GlobalConfig's list of identifiers outside of autoload (#3113).

3.208.0 (2024-09-23)
------------------

Expand Down
1 change: 1 addition & 0 deletions gems/aws-sdk-core/lib/aws-sdk-core/plugins.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ module Aws
module Plugins
autoload :BearerAuthorization, 'aws-sdk-core/plugins/bearer_authorization'
autoload :SignatureV4, 'aws-sdk-core/plugins/signature_v4'
autoload :GlobalConfiguration, 'aws-sdk-core/plugins/global_configuration'
end
end

0 comments on commit 2c4fe8b

Please sign in to comment.