aws-sdk-code-generator 0.4.0.pre → 0.6.0.pre
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/aws-sdk-code-generator/api.rb +2 -1
- data/lib/aws-sdk-code-generator/client_constructor.rb +2 -1
- data/lib/aws-sdk-code-generator/client_operation_documentation.rb +2 -1
- data/lib/aws-sdk-code-generator/client_operation_list.rb +4 -0
- data/lib/aws-sdk-code-generator/code_builder.rb +54 -2
- data/lib/aws-sdk-code-generator/endpoint_parameter.rb +190 -0
- data/lib/aws-sdk-code-generator/eventstream_example.rb +34 -34
- data/lib/aws-sdk-code-generator/gem_builder.rb +3 -5
- data/lib/aws-sdk-code-generator/helper.rb +11 -1
- data/lib/aws-sdk-code-generator/plugin_list.rb +5 -2
- data/lib/aws-sdk-code-generator/rbs/error_list.rb +38 -0
- data/lib/aws-sdk-code-generator/rbs/keyword_argument_builder.rb +159 -0
- data/lib/aws-sdk-code-generator/rbs/method_signature.rb +11 -0
- data/lib/aws-sdk-code-generator/rbs/resource_action.rb +39 -0
- data/lib/aws-sdk-code-generator/rbs/resource_association.rb +50 -0
- data/lib/aws-sdk-code-generator/rbs/resource_batch_action.rb +59 -0
- data/lib/aws-sdk-code-generator/rbs/resource_client_request.rb +40 -0
- data/lib/aws-sdk-code-generator/rbs/waiter.rb +53 -0
- data/lib/aws-sdk-code-generator/rbs.rb +40 -0
- data/lib/aws-sdk-code-generator/resource_batch_action_code.rb +3 -1
- data/lib/aws-sdk-code-generator/resource_client_request.rb +3 -1
- data/lib/aws-sdk-code-generator/resource_waiter.rb +6 -5
- data/lib/aws-sdk-code-generator/service.rb +85 -16
- data/lib/aws-sdk-code-generator/views/async_client_class.rb +5 -1
- data/lib/aws-sdk-code-generator/views/client_api_module.rb +58 -16
- data/lib/aws-sdk-code-generator/views/client_class.rb +5 -1
- data/lib/aws-sdk-code-generator/views/endpoint_parameters_class.rb +6 -50
- data/lib/aws-sdk-code-generator/views/endpoint_provider_class.rb +9 -0
- data/lib/aws-sdk-code-generator/views/endpoints_module.rb +18 -124
- data/lib/aws-sdk-code-generator/views/endpoints_plugin.rb +46 -4
- data/lib/aws-sdk-code-generator/views/errors_module.rb +21 -0
- data/lib/aws-sdk-code-generator/views/event_streams_module.rb +7 -1
- data/lib/aws-sdk-code-generator/views/features/smoke.rb +100 -23
- data/lib/aws-sdk-code-generator/views/features/step_definitions.rb +1 -4
- data/lib/aws-sdk-code-generator/views/gemspec.rb +13 -3
- data/lib/aws-sdk-code-generator/views/rbs/client_class.rb +172 -0
- data/lib/aws-sdk-code-generator/views/rbs/errors_module.rb +28 -0
- data/lib/aws-sdk-code-generator/views/rbs/resource_class.rb +95 -0
- data/lib/aws-sdk-code-generator/views/rbs/root_resource_class.rb +30 -0
- data/lib/aws-sdk-code-generator/views/rbs/types_module.rb +257 -0
- data/lib/aws-sdk-code-generator/views/rbs/waiters_module.rb +22 -0
- data/lib/aws-sdk-code-generator/views/resource_class.rb +22 -0
- data/lib/aws-sdk-code-generator/views/root_resource_class.rb +19 -0
- data/lib/aws-sdk-code-generator/views/service_module.rb +41 -27
- data/lib/aws-sdk-code-generator/views/spec/endpoint_provider_spec_class.rb +25 -12
- data/lib/aws-sdk-code-generator/views/types_module.rb +34 -11
- data/lib/aws-sdk-code-generator.rb +29 -1
- data/templates/async_client_class.mustache +6 -1
- data/templates/client_api_module.mustache +14 -0
- data/templates/client_class.mustache +10 -47
- data/templates/endpoint_parameters_class.mustache +16 -13
- data/templates/endpoints_module.mustache +19 -11
- data/templates/endpoints_plugin.mustache +38 -20
- data/templates/errors_module.mustache +5 -0
- data/templates/features/smoke.mustache +11 -15
- data/templates/features/step_definitions.mustache +0 -5
- data/templates/gemspec.mustache +5 -2
- data/templates/rbs/client_class.mustache +39 -0
- data/templates/rbs/errors_module.mustache +17 -0
- data/templates/rbs/resource_class.mustache +71 -0
- data/templates/rbs/root_resource_class.mustache +26 -0
- data/templates/rbs/types_module.mustache +37 -0
- data/templates/rbs/waiters_module.mustache +17 -0
- data/templates/resource_class.mustache +8 -1
- data/templates/root_resource_class.mustache +5 -0
- data/templates/service_module.mustache +13 -3
- data/templates/spec/endpoint_provider_spec_class.mustache +11 -1
- data/templates/types_module.mustache +4 -0
- metadata +27 -7
- data/lib/aws-sdk-code-generator/views/features/smoke_step_definitions.rb +0 -26
- data/templates/features/smoke_step_definitions.mustache +0 -31
@@ -83,13 +83,18 @@ module {{module_name}}
|
|
83
83
|
# @api private
|
84
84
|
def build_request(operation_name, params = {})
|
85
85
|
handlers = @handlers.for(operation_name)
|
86
|
+
tracer = config.telemetry_provider.tracer_provider.tracer(
|
87
|
+
Aws::Telemetry.module_to_tracer_name('{{module_name}}')
|
88
|
+
)
|
86
89
|
context = Seahorse::Client::RequestContext.new(
|
87
90
|
operation_name: operation_name,
|
88
91
|
operation: config.api.operation(operation_name),
|
89
92
|
client: self,
|
90
93
|
params: params,
|
91
94
|
http_response: Seahorse::Client::Http::AsyncResponse.new,
|
92
|
-
config: config
|
95
|
+
config: config,
|
96
|
+
tracer: tracer
|
97
|
+
)
|
93
98
|
context[:gem_name] = '{{gem_name}}'
|
94
99
|
context[:gem_version] = '{{gem_version}}'
|
95
100
|
Seahorse::Client::Request.new(handlers, context)
|
@@ -3,6 +3,7 @@
|
|
3
3
|
{{#generated_src_warning}}
|
4
4
|
{{generated_src_warning}}
|
5
5
|
{{/generated_src_warning}}
|
6
|
+
|
6
7
|
module {{module_name}}
|
7
8
|
# @api private
|
8
9
|
module ClientApi
|
@@ -51,6 +52,13 @@ module {{module_name}}
|
|
51
52
|
{{/http_checksum}}
|
52
53
|
}
|
53
54
|
{{/http_checksum}}
|
55
|
+
{{#request_compression}}
|
56
|
+
o.request_compression = {
|
57
|
+
{{#request_compression}}
|
58
|
+
{{{key}}} => {{{value}}},
|
59
|
+
{{/request_compression}}
|
60
|
+
}
|
61
|
+
{{/request_compression}}
|
54
62
|
{{#deprecated}}
|
55
63
|
o.deprecated = true
|
56
64
|
{{/deprecated}}
|
@@ -70,6 +78,12 @@ module {{module_name}}
|
|
70
78
|
{{#authtype}}
|
71
79
|
o['authtype'] = "{{.}}"
|
72
80
|
{{/authtype}}
|
81
|
+
{{#unsigned_payload}}
|
82
|
+
o['unsignedPayload'] = true
|
83
|
+
{{/unsigned_payload}}
|
84
|
+
{{#auth}}
|
85
|
+
o['auth'] = {{&auth}}
|
86
|
+
{{/auth}}
|
73
87
|
{{#endpoint_trait}}
|
74
88
|
o.endpoint_pattern = {
|
75
89
|
{{#endpoint_pattern}}
|
@@ -7,8 +7,6 @@
|
|
7
7
|
require '{{.}}'
|
8
8
|
{{/plugin_requires}}
|
9
9
|
|
10
|
-
Aws::Plugins::GlobalConfiguration.add_identifier(:{{service_identifier}})
|
11
|
-
|
12
10
|
module {{module_name}}
|
13
11
|
# An API client for {{service_name}}. To construct a client, you need to configure a `:region` and `:credentials`.
|
14
12
|
#
|
@@ -37,52 +35,12 @@ module {{module_name}}
|
|
37
35
|
{{#client_constructor}}
|
38
36
|
# @overload initialize(options)
|
39
37
|
# @param [Hash] options
|
40
|
-
{{>documentation}}
|
41
|
-
# @option options [URI::HTTP,String] :http_proxy A proxy to send
|
42
|
-
# requests through. Formatted like 'http://proxy.com:123'.
|
43
|
-
#
|
44
|
-
# @option options [Float] :http_open_timeout (15) The number of
|
45
|
-
# seconds to wait when opening a HTTP session before raising a
|
46
|
-
# `Timeout::Error`.
|
47
|
-
#
|
48
|
-
# @option options [Float] :http_read_timeout (60) The default
|
49
|
-
# number of seconds to wait for response data. This value can
|
50
|
-
# safely be set per-request on the session.
|
51
|
-
#
|
52
|
-
# @option options [Float] :http_idle_timeout (5) The number of
|
53
|
-
# seconds a connection is allowed to sit idle before it is
|
54
|
-
# considered stale. Stale connections are closed and removed
|
55
|
-
# from the pool before making a request.
|
56
|
-
#
|
57
|
-
# @option options [Float] :http_continue_timeout (1) The number of
|
58
|
-
# seconds to wait for a 100-continue response before sending the
|
59
|
-
# request body. This option has no effect unless the request has
|
60
|
-
# "Expect" header set to "100-continue". Defaults to `nil` which
|
61
|
-
# disables this behaviour. This value can safely be set per
|
62
|
-
# request on the session.
|
63
38
|
#
|
64
|
-
# @option options [
|
65
|
-
#
|
66
|
-
#
|
67
|
-
# @option options [Boolean] :http_wire_trace (false) When `true`,
|
68
|
-
# HTTP debug output will be sent to the `:logger`.
|
69
|
-
#
|
70
|
-
# @option options [Boolean] :ssl_verify_peer (true) When `true`,
|
71
|
-
# SSL peer certificates are verified when establishing a
|
72
|
-
# connection.
|
73
|
-
#
|
74
|
-
# @option options [String] :ssl_ca_bundle Full path to the SSL
|
75
|
-
# certificate authority bundle file that should be used when
|
76
|
-
# verifying peer certificates. If you do not pass
|
77
|
-
# `:ssl_ca_bundle` or `:ssl_ca_directory` the the system default
|
78
|
-
# will be used if available.
|
79
|
-
#
|
80
|
-
# @option options [String] :ssl_ca_directory Full path of the
|
81
|
-
# directory that contains the unbundled SSL certificate
|
82
|
-
# authority files for verifying peer certificates. If you do
|
83
|
-
# not pass `:ssl_ca_bundle` or `:ssl_ca_directory` the the
|
84
|
-
# system default will be used if available.
|
39
|
+
# @option options [Array<Seahorse::Client::Plugin>] :plugins ([]])
|
40
|
+
# A list of plugins to apply to the client. Each plugin is either a
|
41
|
+
# class name or an instance of a plugin class.
|
85
42
|
#
|
43
|
+
{{>documentation}}
|
86
44
|
{{/client_constructor}}
|
87
45
|
def initialize(*args)
|
88
46
|
super
|
@@ -139,13 +97,18 @@ module {{module_name}}
|
|
139
97
|
end
|
140
98
|
end
|
141
99
|
{{/authorizer?}}
|
100
|
+
tracer = config.telemetry_provider.tracer_provider.tracer(
|
101
|
+
Aws::Telemetry.module_to_tracer_name('{{module_name}}')
|
102
|
+
)
|
142
103
|
context = Seahorse::Client::RequestContext.new(
|
143
104
|
operation_name: operation_name,
|
144
105
|
operation: config.api.operation(operation_name),{{#authorizer?}}
|
145
106
|
authorizer: authorizer,{{/authorizer?}}
|
146
107
|
client: self,
|
147
108
|
params: params,
|
148
|
-
config: config
|
109
|
+
config: config,
|
110
|
+
tracer: tracer
|
111
|
+
)
|
149
112
|
context[:gem_name] = '{{gem_name}}'
|
150
113
|
context[:gem_version] = '{{gem_version}}'
|
151
114
|
Seahorse::Client::Request.new(handlers, context)
|
@@ -11,7 +11,7 @@ module {{module_name}}
|
|
11
11
|
{{/parameters}}
|
12
12
|
EndpointParameters = Struct.new(
|
13
13
|
{{#parameters}}
|
14
|
-
:{{
|
14
|
+
:{{key}},
|
15
15
|
{{/parameters}}
|
16
16
|
{{^parameters}}
|
17
17
|
nil
|
@@ -23,28 +23,31 @@ module {{module_name}}
|
|
23
23
|
class << self
|
24
24
|
PARAM_MAP = {
|
25
25
|
{{#parameters}}
|
26
|
-
'{{name}}' => :{{
|
26
|
+
'{{name}}' => :{{key}},
|
27
27
|
{{/parameters}}
|
28
28
|
}.freeze
|
29
29
|
end
|
30
30
|
|
31
31
|
def initialize(options = {})
|
32
32
|
{{#parameters}}
|
33
|
-
self[:{{
|
33
|
+
self[:{{key}}] = options[:{{key}}]
|
34
34
|
{{#default?}}
|
35
|
-
{{
|
36
|
-
self[:{{underscore_name}}] = {{default}} if self[:{{underscore_name}}].nil?
|
37
|
-
{{/boolean_default?}}
|
38
|
-
{{^boolean_default?}}
|
39
|
-
self[:{{underscore_name}}] ||= '{{default}}' if self[:{{underscore_name}}].nil?
|
40
|
-
{{/boolean_default?}}
|
35
|
+
self[:{{key}}] = {{{default}}} if self[:{{key}}].nil?
|
41
36
|
{{/default?}}
|
42
|
-
{{#
|
43
|
-
if self[:{{
|
44
|
-
raise ArgumentError, "Missing required EndpointParameter: :{{
|
37
|
+
{{#validate_required?}}
|
38
|
+
if self[:{{key}}].nil?
|
39
|
+
raise ArgumentError, "Missing required EndpointParameter: :{{key}}"
|
45
40
|
end
|
46
|
-
{{/
|
41
|
+
{{/validate_required?}}
|
47
42
|
{{/parameters}}
|
48
43
|
end
|
44
|
+
|
45
|
+
def self.create(config, options={})
|
46
|
+
new({
|
47
|
+
{{#config_parameters}}
|
48
|
+
{{key}}: {{{value}}},
|
49
|
+
{{/config_parameters}}
|
50
|
+
}.merge(options))
|
51
|
+
end
|
49
52
|
end
|
50
53
|
end
|
@@ -5,29 +5,37 @@
|
|
5
5
|
{{/generated_src_warning}}
|
6
6
|
|
7
7
|
module {{module_name}}
|
8
|
+
# @api private
|
8
9
|
module Endpoints
|
9
10
|
|
10
11
|
{{#endpoint_classes}}
|
11
12
|
class {{name}}
|
12
13
|
def self.build(context)
|
13
|
-
{{
|
14
|
-
|
15
|
-
endpoint = context.config.endpoint.to_s
|
16
|
-
end
|
17
|
-
{{/has_endpoint_built_in?}}
|
18
|
-
{{module_name}}::EndpointParameters.new(
|
14
|
+
{{module_name}}::EndpointParameters.create(
|
15
|
+
context.config,
|
19
16
|
{{#parameters}}
|
20
|
-
{{#static_string?}}
|
21
|
-
{{key}}: "{{{value}}}",
|
22
|
-
{{/static_string?}}
|
23
|
-
{{^static_string?}}
|
24
17
|
{{key}}: {{{value}}},
|
25
|
-
{{/static_string?}}
|
26
18
|
{{/parameters}}
|
27
19
|
)
|
28
20
|
end
|
29
21
|
end
|
30
22
|
|
31
23
|
{{/endpoint_classes}}
|
24
|
+
|
25
|
+
def self.parameters_for_operation(context)
|
26
|
+
{{#operation_specific_parameters?}}
|
27
|
+
{{module_name}}::EndpointParameters.create(context.config)
|
28
|
+
{{/operation_specific_parameters?}}
|
29
|
+
{{^operation_specific_parameters?}}
|
30
|
+
case context.operation_name
|
31
|
+
{{#endpoint_classes}}
|
32
|
+
when :{{operation}}
|
33
|
+
{{name}}.build(context)
|
34
|
+
{{/endpoint_classes}}
|
35
|
+
else
|
36
|
+
{{module_name}}::EndpointParameters.create(context.config)
|
37
|
+
end
|
38
|
+
{{/operation_specific_parameters?}}
|
39
|
+
end
|
32
40
|
end
|
33
41
|
end
|
@@ -10,11 +10,12 @@ module {{module_name}}
|
|
10
10
|
option(
|
11
11
|
:endpoint_provider,
|
12
12
|
doc_type: '{{module_name}}::EndpointProvider',
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
rbs_type: 'untyped',
|
14
|
+
docstring: <<~DOCS) do |_cfg|
|
15
|
+
The endpoint provider used to resolve endpoints. Any object that responds to
|
16
|
+
`#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
|
17
|
+
`{{module_name}}::EndpointParameters`.
|
18
|
+
DOCS
|
18
19
|
{{module_name}}::EndpointProvider.new
|
19
20
|
end
|
20
21
|
|
@@ -22,31 +23,57 @@ module {{module_name}}
|
|
22
23
|
option(
|
23
24
|
:{{name}},
|
24
25
|
doc_type: '{{doc_type}}',
|
25
|
-
|
26
|
-
|
26
|
+
docstring: <<~DOCS) do |cfg|
|
27
|
+
{{{docstring}}}
|
28
|
+
DOCS
|
29
|
+
{{{default}}}
|
30
|
+
end
|
27
31
|
|
28
32
|
{{/endpoint_options}}
|
29
33
|
# @api private
|
30
34
|
class Handler < Seahorse::Client::Handler
|
31
35
|
def call(context)
|
32
|
-
# If endpoint was discovered, do not resolve or apply the endpoint.
|
33
36
|
unless context[:discovered_endpoint]
|
34
|
-
params = parameters_for_operation(context)
|
37
|
+
params = {{module_name}}::Endpoints.parameters_for_operation(context)
|
35
38
|
endpoint = context.config.endpoint_provider.resolve_endpoint(params)
|
36
39
|
|
37
40
|
context.http_request.endpoint = endpoint.url
|
38
41
|
apply_endpoint_headers(context, endpoint.headers)
|
42
|
+
|
43
|
+
context[:endpoint_params] = params
|
44
|
+
context[:endpoint_properties] = endpoint.properties
|
39
45
|
end
|
40
46
|
|
41
|
-
context[:endpoint_params] = params
|
42
47
|
context[:auth_scheme] =
|
43
48
|
Aws::Endpoints.resolve_auth_scheme(context, endpoint)
|
44
49
|
|
45
|
-
@handler.call(context)
|
50
|
+
with_metrics(context) { @handler.call(context) }
|
46
51
|
end
|
47
52
|
|
48
53
|
private
|
49
54
|
|
55
|
+
def with_metrics(context, &block)
|
56
|
+
metrics = []
|
57
|
+
metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
|
58
|
+
if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
|
59
|
+
metrics << 'SIGV4A_SIGNING'
|
60
|
+
end
|
61
|
+
{{#has_account_id_endpoint_mode?}}
|
62
|
+
case context.config.account_id_endpoint_mode
|
63
|
+
when 'preferred'
|
64
|
+
metrics << 'ACCOUNT_ID_MODE_PREFERRED'
|
65
|
+
when 'disabled'
|
66
|
+
metrics << 'ACCOUNT_ID_MODE_DISABLED'
|
67
|
+
when 'required'
|
68
|
+
metrics << 'ACCOUNT_ID_MODE_REQUIRED'
|
69
|
+
end
|
70
|
+
{{/has_account_id_endpoint_mode?}}
|
71
|
+
if context.config.credentials&.credentials&.account_id
|
72
|
+
metrics << 'RESOLVED_ACCOUNT_ID'
|
73
|
+
end
|
74
|
+
Aws::Plugins::UserAgent.metric(*metrics, &block)
|
75
|
+
end
|
76
|
+
|
50
77
|
def apply_endpoint_headers(context, headers)
|
51
78
|
headers.each do |key, values|
|
52
79
|
value = values
|
@@ -57,15 +84,6 @@ module {{module_name}}
|
|
57
84
|
context.http_request.headers[key] = value
|
58
85
|
end
|
59
86
|
end
|
60
|
-
|
61
|
-
def parameters_for_operation(context)
|
62
|
-
case context.operation_name
|
63
|
-
{{#endpoint_classes}}
|
64
|
-
when :{{operation_name}}
|
65
|
-
{{module_name}}::Endpoints::{{class_name}}.build(context)
|
66
|
-
{{/endpoint_classes}}
|
67
|
-
end
|
68
|
-
end
|
69
87
|
end
|
70
88
|
|
71
89
|
def add_handlers(handlers, _config)
|
@@ -1,22 +1,18 @@
|
|
1
1
|
{{#generated_src_warning}}
|
2
2
|
{{generated_src_warning}}
|
3
3
|
{{/generated_src_warning}}
|
4
|
-
Feature: Smoke tests for {{
|
5
|
-
|
6
|
-
Background:
|
7
|
-
{{#client_endpoint}}
|
8
|
-
Given I create a client with endpoint '{{client_endpoint}}'
|
9
|
-
{{/client_endpoint}}
|
10
|
-
{{^client_endpoint}}
|
11
|
-
Given I create a client in region '{{client_region}}'
|
12
|
-
{{/client_endpoint}}
|
4
|
+
Feature: Smoke tests for {{service_name}}
|
13
5
|
{{#smoke_tests}}
|
14
6
|
|
15
|
-
{{
|
16
|
-
Scenario: {{
|
17
|
-
|
18
|
-
|
7
|
+
{{tags}}
|
8
|
+
Scenario: {{id}}
|
9
|
+
Given I create a '{{service_module}}' client with config:
|
10
|
+
"""
|
11
|
+
{{&config_hash}}
|
12
|
+
"""
|
13
|
+
When I call the operation '{{operation_name}}' with params:
|
14
|
+
"""
|
19
15
|
{{¶m_hash}}
|
20
|
-
|
21
|
-
|
16
|
+
"""
|
17
|
+
Then {{&expectation}}
|
22
18
|
{{/smoke_tests}}
|
@@ -1,10 +1,5 @@
|
|
1
1
|
Before("@{{var_name}}") do
|
2
|
-
{{#client_endpoint}}
|
3
|
-
@service = {{module_name}}::Resource.new(endpoint: '{{client_endpoint}}')
|
4
|
-
{{/client_endpoint}}
|
5
|
-
{{^client_endpoint}}
|
6
2
|
@service = {{module_name}}::Resource.new
|
7
|
-
{{/client_endpoint}}
|
8
3
|
@client = @service.client
|
9
4
|
end
|
10
5
|
|
data/templates/gemspec.mustache
CHANGED
@@ -24,8 +24,11 @@ Gem::Specification.new do |spec|
|
|
24
24
|
|
25
25
|
{{/metadata}}
|
26
26
|
{{#dependencies}}
|
27
|
-
spec.add_dependency(
|
27
|
+
spec.add_dependency({{{gem_version}}})
|
28
28
|
{{/dependencies}}
|
29
29
|
|
30
|
-
spec.required_ruby_version = '>= 2.
|
30
|
+
spec.required_ruby_version = '>= 2.5'
|
31
|
+
{{#deprecated?}}
|
32
|
+
spec.post_install_message = '*** {{gem_name}} is deprecated ***'
|
33
|
+
{{/deprecated?}}
|
31
34
|
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
{{generated_src_warning}}
|
2
|
+
module Aws
|
3
|
+
module {{service_name}}
|
4
|
+
class Client < ::Seahorse::Client::Base
|
5
|
+
include ::Aws::ClientStubs
|
6
|
+
|
7
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/Client.html#initialize-instance_method
|
8
|
+
def self.new: ({{{client_option}}}) -> instance
|
9
|
+
| (?Hash[Symbol, untyped]) -> instance
|
10
|
+
|
11
|
+
{{#operations}}
|
12
|
+
|
13
|
+
{{^empty_structure}}
|
14
|
+
interface {{interface}}
|
15
|
+
include ::Seahorse::Client::_ResponseSuccess[{{data}}]
|
16
|
+
{{#returns_members}}
|
17
|
+
def {{method_name}}: () -> {{{returns}}}
|
18
|
+
{{/returns_members}}
|
19
|
+
end
|
20
|
+
{{/empty_structure}}
|
21
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/Client.html#{{method_name}}-instance_method
|
22
|
+
{{{signature}}}
|
23
|
+
{{/operations}}
|
24
|
+
{{#waiters?}}
|
25
|
+
|
26
|
+
{{#waiters_first}}
|
27
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/Client.html#wait_until-instance_method
|
28
|
+
def wait_until: {{{client_overload_keyword_argument}}}
|
29
|
+
| {{{client_overload_positional_argument}}}
|
30
|
+
{{/waiters_first}}
|
31
|
+
{{#waiters_others}}
|
32
|
+
| {{{client_overload_keyword_argument}}}
|
33
|
+
| {{{client_overload_positional_argument}}}
|
34
|
+
{{/waiters_others}}
|
35
|
+
{{/waiters?}}
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{{generated_src_warning}}
|
2
|
+
module Aws
|
3
|
+
module {{service_name}}
|
4
|
+
module Errors
|
5
|
+
class ServiceError < ::Aws::Errors::ServiceError
|
6
|
+
end
|
7
|
+
|
8
|
+
{{#errors}}
|
9
|
+
class {{name}} < ::Aws::Errors::ServiceError
|
10
|
+
{{#members}}
|
11
|
+
{{{signature}}}
|
12
|
+
{{/members}}
|
13
|
+
end
|
14
|
+
{{/errors}}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,71 @@
|
|
1
|
+
{{generated_src_warning}}
|
2
|
+
module Aws
|
3
|
+
module {{service_name}}
|
4
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html
|
5
|
+
class {{class_name}}
|
6
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#initialize-instance_method
|
7
|
+
{{{initialize_signature}}}
|
8
|
+
{{#identifiers}}
|
9
|
+
|
10
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#{{name}}-instance_method
|
11
|
+
def {{name}}: () -> {{type}}
|
12
|
+
{{#alias}}
|
13
|
+
alias {{alias}} {{name}}
|
14
|
+
{{/alias}}
|
15
|
+
{{/identifiers}}
|
16
|
+
{{#data_attributes}}
|
17
|
+
|
18
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#{{method_name}}-instance_method
|
19
|
+
{{{signature}}}
|
20
|
+
{{/data_attributes}}
|
21
|
+
|
22
|
+
def client: () -> Client
|
23
|
+
|
24
|
+
{{#load?}}
|
25
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#load-instance_method
|
26
|
+
def load: () -> self
|
27
|
+
alias reload load
|
28
|
+
{{/load?}}
|
29
|
+
|
30
|
+
{{#load_or_shape?}}
|
31
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#data-instance_method
|
32
|
+
def data: () -> Types::{{shape}}
|
33
|
+
{{/load_or_shape?}}
|
34
|
+
{{^load_or_shape?}}
|
35
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#data-instance_method
|
36
|
+
def data: () -> EmptyStructure
|
37
|
+
{{/load_or_shape?}}
|
38
|
+
|
39
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#data_loaded?-instance_method
|
40
|
+
def data_loaded?: () -> bool
|
41
|
+
|
42
|
+
{{#exists_waiters}}
|
43
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#exists?-instance_method
|
44
|
+
def exists?: (?max_attempts: Integer, ?delay: Numeric, ?before_attempt: (^(Integer attempts) -> void), ?before_wait: (^(Integer attempts, untyped response) -> void)) -> bool
|
45
|
+
| (?Hash[Symbol, untyped]) -> bool
|
46
|
+
{{/exists_waiters}}
|
47
|
+
{{#waiters}}
|
48
|
+
|
49
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#{{method_name}}-instance_method
|
50
|
+
{{{signature}}}
|
51
|
+
{{/waiters}}
|
52
|
+
{{#actions}}
|
53
|
+
|
54
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#{{method_name}}-instance_method
|
55
|
+
{{{signature}}}
|
56
|
+
{{/actions}}
|
57
|
+
{{#associations}}
|
58
|
+
|
59
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/{{class_name}}.html#{{method_name}}-instance_method
|
60
|
+
{{{signature}}}
|
61
|
+
{{/associations}}
|
62
|
+
|
63
|
+
class Collection < ::Aws::Resources::Collection[{{class_name}}]
|
64
|
+
{{#batch_actions}}
|
65
|
+
|
66
|
+
{{{signature}}}
|
67
|
+
{{/batch_actions}}
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
{{generated_src_warning}}
|
2
|
+
module Aws
|
3
|
+
module {{service_name}}
|
4
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/Resource.html
|
5
|
+
class Resource
|
6
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/Resource.html#initialize-instance_method
|
7
|
+
def initialize: (
|
8
|
+
?client: Client,{{{client_option}}}) -> void
|
9
|
+
| (?Hash[Symbol, untyped]) -> void
|
10
|
+
|
11
|
+
def client: () -> Client
|
12
|
+
|
13
|
+
{{#actions}}
|
14
|
+
|
15
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/Resource.html#{{method_name}}-instance_method
|
16
|
+
{{{signature}}}
|
17
|
+
{{/actions}}
|
18
|
+
|
19
|
+
{{#associations}}
|
20
|
+
|
21
|
+
# https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/{{service_name}}/Resource.html#{{method_name}}-instance_method
|
22
|
+
{{{signature}}}
|
23
|
+
{{/associations}}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
{{#generated_src_warning}}
|
2
|
+
{{generated_src_warning}}
|
3
|
+
{{/generated_src_warning}}
|
4
|
+
module {{module_name}}
|
5
|
+
module Types
|
6
|
+
{{#structures}}
|
7
|
+
|
8
|
+
{{> documentation}}
|
9
|
+
{{#empty?}}
|
10
|
+
class {{class_name}} < Aws::EmptyStructure
|
11
|
+
end
|
12
|
+
{{/empty?}}
|
13
|
+
{{^empty?}}
|
14
|
+
class {{class_name}}
|
15
|
+
{{#members}}
|
16
|
+
attr_accessor {{member_name}}: {{{returns}}}
|
17
|
+
{{/members}}
|
18
|
+
SENSITIVE: {{sensitive_params}}
|
19
|
+
{{#union?}}
|
20
|
+
|
21
|
+
{{#members}}
|
22
|
+
class {{member_class_name}} < {{class_name}}
|
23
|
+
end
|
24
|
+
{{/members}}
|
25
|
+
{{/union?}}
|
26
|
+
end
|
27
|
+
{{/empty?}}
|
28
|
+
{{/structures}}
|
29
|
+
{{#eventstreams}}
|
30
|
+
|
31
|
+
{{> documentation}}
|
32
|
+
class {{class_name}} < Enumerator[untyped, untyped]
|
33
|
+
def event_types: () -> {{#empty?}}[]{{/empty?}}{{^empty?}}[{{#types}}:{{member_name}}{{^last}}, {{/last}}{{/types}}]{{/empty?}}
|
34
|
+
end
|
35
|
+
{{/eventstreams}}
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
{{generated_src_warning}}
|
2
|
+
module Aws
|
3
|
+
module {{service_name}}
|
4
|
+
module Waiters
|
5
|
+
{{#waiters}}
|
6
|
+
|
7
|
+
class {{class_name}}
|
8
|
+
def initialize: (?client: Client, ?max_attempts: Integer, ?delay: Integer, ?before_attempt: Proc, ?before_wait: Proc) -> void
|
9
|
+
| (?Hash[Symbol, untyped]) -> void
|
10
|
+
|
11
|
+
def wait: {{{waiter_overload_keyword_argument}}}
|
12
|
+
| {{{waiter_overload_positional_argument}}}
|
13
|
+
end
|
14
|
+
{{/waiters}}
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -213,7 +213,9 @@ module {{module_name}}
|
|
213
213
|
:retry
|
214
214
|
end
|
215
215
|
end
|
216
|
-
Aws::
|
216
|
+
Aws::Plugins::UserAgent.metric('RESOURCE_MODEL') do
|
217
|
+
Aws::Waiters::Waiter.new(options).wait({})
|
218
|
+
end
|
217
219
|
end
|
218
220
|
{{/wait_until}}
|
219
221
|
{{#actions?}}
|
@@ -302,3 +304,8 @@ module {{module_name}}
|
|
302
304
|
{{/batch_actions?}}
|
303
305
|
end
|
304
306
|
end
|
307
|
+
{{#customization_file_exists?}}
|
308
|
+
|
309
|
+
# Load customizations if they exist
|
310
|
+
require '{{resource_customization}}'
|
311
|
+
{{/customization_file_exists?}}
|