aws-sdk-code-generator 0.1.0.pre → 0.2.4.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/aws-sdk-code-generator/api.rb +150 -0
- data/lib/aws-sdk-code-generator/apply_docs.rb +15 -2
- data/lib/aws-sdk-code-generator/client_constructor.rb +39 -0
- data/lib/aws-sdk-code-generator/client_operation_documentation.rb +282 -0
- data/lib/aws-sdk-code-generator/client_operation_list.rb +148 -0
- data/lib/aws-sdk-code-generator/client_response_structure_example.rb +115 -0
- data/lib/aws-sdk-code-generator/code_builder.rb +146 -133
- data/lib/aws-sdk-code-generator/crosslink.rb +42 -0
- data/lib/aws-sdk-code-generator/docstring.rb +199 -0
- data/lib/aws-sdk-code-generator/error_list.rb +77 -0
- data/lib/aws-sdk-code-generator/errors.rb +2 -0
- data/lib/aws-sdk-code-generator/eventstream_example.rb +220 -0
- data/lib/aws-sdk-code-generator/gem_builder.rb +42 -25
- data/lib/aws-sdk-code-generator/hash_formatter.rb +5 -2
- data/lib/aws-sdk-code-generator/helper.rb +86 -119
- data/lib/aws-sdk-code-generator/plugin_list.rb +147 -0
- data/lib/aws-sdk-code-generator/resource_action.rb +69 -0
- data/lib/aws-sdk-code-generator/resource_action_code.rb +57 -0
- data/lib/aws-sdk-code-generator/resource_association.rb +37 -0
- data/lib/aws-sdk-code-generator/resource_attribute.rb +76 -0
- data/lib/aws-sdk-code-generator/resource_batch_action.rb +56 -0
- data/lib/aws-sdk-code-generator/resource_batch_action_code.rb +136 -0
- data/lib/aws-sdk-code-generator/resource_batch_action_documentation.rb +108 -0
- data/lib/aws-sdk-code-generator/resource_batch_builder.rb +212 -0
- data/lib/aws-sdk-code-generator/resource_builder.rb +48 -0
- data/lib/aws-sdk-code-generator/resource_client_request.rb +62 -0
- data/lib/aws-sdk-code-generator/resource_client_request_documentation.rb +81 -0
- data/lib/aws-sdk-code-generator/resource_client_request_params.rb +86 -0
- data/lib/aws-sdk-code-generator/resource_data_method.rb +60 -0
- data/lib/aws-sdk-code-generator/resource_has_association.rb +117 -0
- data/lib/aws-sdk-code-generator/resource_has_many_association.rb +52 -0
- data/lib/aws-sdk-code-generator/resource_has_many_association_code.rb +76 -0
- data/lib/aws-sdk-code-generator/resource_identifier.rb +44 -0
- data/lib/aws-sdk-code-generator/resource_identifiers_method.rb +29 -0
- data/lib/aws-sdk-code-generator/resource_load_method.rb +68 -0
- data/lib/aws-sdk-code-generator/resource_method.rb +22 -0
- data/lib/aws-sdk-code-generator/resource_skip_params.rb +36 -0
- data/lib/aws-sdk-code-generator/resource_value_source.rb +68 -0
- data/lib/aws-sdk-code-generator/resource_waiter.rb +80 -0
- data/lib/aws-sdk-code-generator/service.rb +30 -7
- data/lib/aws-sdk-code-generator/shared_example.rb +131 -0
- data/lib/aws-sdk-code-generator/syntax_example.rb +60 -0
- data/lib/aws-sdk-code-generator/syntax_example_hash.rb +174 -0
- data/lib/aws-sdk-code-generator/underscore.rb +10 -5
- data/lib/aws-sdk-code-generator/view.rb +33 -0
- data/lib/aws-sdk-code-generator/views/apig_endpoint_class.rb +25 -0
- data/lib/aws-sdk-code-generator/views/apig_readme.rb +32 -0
- data/lib/aws-sdk-code-generator/views/async_client_class.rb +68 -0
- data/lib/aws-sdk-code-generator/views/authorizer_class.rb +17 -0
- data/lib/aws-sdk-code-generator/views/client_api_module.rb +602 -0
- data/lib/aws-sdk-code-generator/views/client_class.rb +93 -0
- data/lib/aws-sdk-code-generator/views/docstring.rb +27 -0
- data/lib/aws-sdk-code-generator/views/errors_module.rb +32 -0
- data/lib/aws-sdk-code-generator/views/event_streams_module.rb +149 -0
- data/lib/aws-sdk-code-generator/views/features/env.rb +9 -0
- data/lib/aws-sdk-code-generator/views/features/smoke.rb +52 -0
- data/lib/aws-sdk-code-generator/views/features/smoke_step_definitions.rb +26 -0
- data/lib/aws-sdk-code-generator/views/features/step_definitions.rb +6 -2
- data/lib/aws-sdk-code-generator/views/gemspec.rb +39 -5
- data/lib/aws-sdk-code-generator/views/resource_class.rb +122 -0
- data/lib/aws-sdk-code-generator/views/root_resource_class.rb +58 -0
- data/lib/aws-sdk-code-generator/views/service_module.rb +38 -14
- data/lib/aws-sdk-code-generator/views/spec/spec_helper.rb +9 -0
- data/lib/aws-sdk-code-generator/views/types_module.rb +329 -0
- data/lib/aws-sdk-code-generator/views/version.rb +2 -0
- data/lib/aws-sdk-code-generator/views/waiters_module.rb +37 -0
- data/lib/aws-sdk-code-generator/views.rb +2 -0
- data/lib/aws-sdk-code-generator/waiter.rb +95 -0
- data/lib/aws-sdk-code-generator/yard_option_tag.rb +43 -0
- data/lib/aws-sdk-code-generator.rb +68 -75
- data/templates/apig_endpoint_class.mustache +16 -0
- data/templates/apig_readme.mustache +62 -0
- data/templates/async_client_class.mustache +125 -0
- data/templates/authorizer_class.mustache +37 -0
- data/templates/client_api_module.mustache +106 -0
- data/templates/client_class.mustache +295 -0
- data/templates/code.mustache +4 -0
- data/templates/documentation.mustache +4 -0
- data/templates/errors_module.mustache +70 -0
- data/templates/event_streams_module.mustache +76 -0
- data/templates/features/env.mustache +15 -0
- data/templates/features/smoke.mustache +22 -0
- data/templates/features/smoke_step_definitions.mustache +31 -0
- data/templates/features/step_definitions.mustache +13 -0
- data/templates/gemspec.mustache +31 -0
- data/templates/license.txt +202 -0
- data/templates/method.mustache +7 -0
- data/templates/resource_class.mustache +304 -0
- data/templates/root_resource_class.mustache +51 -0
- data/templates/service_module.mustache +58 -0
- data/templates/spec/spec_helper.mustache +15 -0
- data/templates/types_module.mustache +53 -0
- data/templates/version.mustache +1 -0
- data/templates/waiters_module.mustache +112 -0
- metadata +115 -70
- data/lib/aws-sdk-code-generator/dsl/access_control_statement.rb +0 -23
- data/lib/aws-sdk-code-generator/dsl/attribute_accessor.rb +0 -43
- data/lib/aws-sdk-code-generator/dsl/attribute_reader.rb +0 -11
- data/lib/aws-sdk-code-generator/dsl/attribute_writer.rb +0 -11
- data/lib/aws-sdk-code-generator/dsl/autoload_statement.rb +0 -15
- data/lib/aws-sdk-code-generator/dsl/block_param.rb +0 -11
- data/lib/aws-sdk-code-generator/dsl/class.rb +0 -27
- data/lib/aws-sdk-code-generator/dsl/code_literal.rb +0 -66
- data/lib/aws-sdk-code-generator/dsl/code_object.rb +0 -33
- data/lib/aws-sdk-code-generator/dsl/docstring.rb +0 -36
- data/lib/aws-sdk-code-generator/dsl/eigenclass.rb +0 -15
- data/lib/aws-sdk-code-generator/dsl/extend_statement.rb +0 -12
- data/lib/aws-sdk-code-generator/dsl/formatter.rb +0 -25
- data/lib/aws-sdk-code-generator/dsl/include_statement.rb +0 -17
- data/lib/aws-sdk-code-generator/dsl/main.rb +0 -105
- data/lib/aws-sdk-code-generator/dsl/method.rb +0 -108
- data/lib/aws-sdk-code-generator/dsl/module.rb +0 -167
- data/lib/aws-sdk-code-generator/dsl/option_tag.rb +0 -36
- data/lib/aws-sdk-code-generator/dsl/param.rb +0 -43
- data/lib/aws-sdk-code-generator/dsl/param_list.rb +0 -38
- data/lib/aws-sdk-code-generator/dsl/return_tag.rb +0 -19
- data/lib/aws-sdk-code-generator/dsl/tag_default.rb +0 -20
- data/lib/aws-sdk-code-generator/dsl/tag_docstring.rb +0 -27
- data/lib/aws-sdk-code-generator/dsl/tag_type.rb +0 -18
- data/lib/aws-sdk-code-generator/generators/client_api_module.rb +0 -334
- data/lib/aws-sdk-code-generator/generators/client_class.rb +0 -389
- data/lib/aws-sdk-code-generator/generators/client_operation_documentation.rb +0 -166
- data/lib/aws-sdk-code-generator/generators/errors_module.rb +0 -25
- data/lib/aws-sdk-code-generator/generators/resource/action.rb +0 -88
- data/lib/aws-sdk-code-generator/generators/resource/batch_builder.rb +0 -211
- data/lib/aws-sdk-code-generator/generators/resource/builder.rb +0 -50
- data/lib/aws-sdk-code-generator/generators/resource/client_getter.rb +0 -15
- data/lib/aws-sdk-code-generator/generators/resource/client_request.rb +0 -49
- data/lib/aws-sdk-code-generator/generators/resource/client_request_docs.rb +0 -97
- data/lib/aws-sdk-code-generator/generators/resource/client_request_params.rb +0 -88
- data/lib/aws-sdk-code-generator/generators/resource/collection_class.rb +0 -180
- data/lib/aws-sdk-code-generator/generators/resource/data_attribute_getter.rb +0 -24
- data/lib/aws-sdk-code-generator/generators/resource/data_loaded_method.rb +0 -18
- data/lib/aws-sdk-code-generator/generators/resource/data_method.rb +0 -49
- data/lib/aws-sdk-code-generator/generators/resource/exists_method.rb +0 -29
- data/lib/aws-sdk-code-generator/generators/resource/extract_identifier_method.rb +0 -32
- data/lib/aws-sdk-code-generator/generators/resource/has_association.rb +0 -101
- data/lib/aws-sdk-code-generator/generators/resource/has_many_association.rb +0 -108
- data/lib/aws-sdk-code-generator/generators/resource/identifier_getter.rb +0 -26
- data/lib/aws-sdk-code-generator/generators/resource/identifiers_method.rb +0 -28
- data/lib/aws-sdk-code-generator/generators/resource/initialize_method.rb +0 -67
- data/lib/aws-sdk-code-generator/generators/resource/load_method.rb +0 -65
- data/lib/aws-sdk-code-generator/generators/resource/value_source.rb +0 -68
- data/lib/aws-sdk-code-generator/generators/resource/waiter_method.rb +0 -61
- data/lib/aws-sdk-code-generator/generators/resource_class.rb +0 -325
- data/lib/aws-sdk-code-generator/generators/response_structure_example.rb +0 -83
- data/lib/aws-sdk-code-generator/generators/root_resource_class.rb +0 -42
- data/lib/aws-sdk-code-generator/generators/service_documentation.rb +0 -64
- data/lib/aws-sdk-code-generator/generators/shared_example.rb +0 -132
- data/lib/aws-sdk-code-generator/generators/structure_type_class.rb +0 -95
- data/lib/aws-sdk-code-generator/generators/syntax_example.rb +0 -169
- data/lib/aws-sdk-code-generator/generators/types_module.rb +0 -52
- data/lib/aws-sdk-code-generator/generators/waiter_class.rb +0 -62
- data/lib/aws-sdk-code-generator/generators/waiters_module.rb +0 -20
@@ -0,0 +1,112 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
{{#generated_src_warning}}
|
4
|
+
{{generated_src_warning}}
|
5
|
+
{{/generated_src_warning}}
|
6
|
+
require 'aws-sdk-core/waiters'
|
7
|
+
|
8
|
+
module {{module_name}}
|
9
|
+
{{#waiters?}}
|
10
|
+
# Waiters are utility methods that poll for a particular state to occur
|
11
|
+
# on a client. Waiters can fail after a number of attempts at a polling
|
12
|
+
# interval defined for the service client.
|
13
|
+
#
|
14
|
+
# For a list of operations that can be waited for and the
|
15
|
+
# client methods called for each operation, see the table below or the
|
16
|
+
# {Client#wait_until} field documentation for the {Client}.
|
17
|
+
#
|
18
|
+
# # Invoking a Waiter
|
19
|
+
# To invoke a waiter, call #wait_until on a {Client}. The first parameter
|
20
|
+
# is the waiter name, which is specific to the service client and indicates
|
21
|
+
# which operation is being waited for. The second parameter is a hash of
|
22
|
+
# parameters that are passed to the client method called by the waiter,
|
23
|
+
# which varies according to the waiter name.
|
24
|
+
#
|
25
|
+
# # Wait Failures
|
26
|
+
# To catch errors in a waiter, use WaiterFailed,
|
27
|
+
# as shown in the following example.
|
28
|
+
#
|
29
|
+
# rescue rescue Aws::Waiters::Errors::WaiterFailed => error
|
30
|
+
# puts "failed waiting for instance running: #{error.message}
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# # Configuring a Waiter
|
34
|
+
# Each waiter has a default polling interval and a maximum number of
|
35
|
+
# attempts it will make before returning control to your program.
|
36
|
+
# To set these values, use the `max_attempts` and `delay` parameters
|
37
|
+
# in your `#wait_until` call.
|
38
|
+
# The following example waits for up to 25 seconds, polling every five seconds.
|
39
|
+
#
|
40
|
+
# client.wait_until(...) do |w|
|
41
|
+
# w.max_attempts = 5
|
42
|
+
# w.delay = 5
|
43
|
+
# end
|
44
|
+
#
|
45
|
+
# To disable wait failures, set the value of either of these parameters
|
46
|
+
# to `nil`.
|
47
|
+
#
|
48
|
+
# # Extending a Waiter
|
49
|
+
# To modify the behavior of waiters, you can register callbacks that are
|
50
|
+
# triggered before each polling attempt and before waiting.
|
51
|
+
#
|
52
|
+
# The following example implements an exponential backoff in a waiter
|
53
|
+
# by doubling the amount of time to wait on every attempt.
|
54
|
+
#
|
55
|
+
# client.wait_until(...) do |w|
|
56
|
+
# w.interval = 0 # disable normal sleep
|
57
|
+
# w.before_wait do |n, resp|
|
58
|
+
# sleep(n ** 2)
|
59
|
+
# end
|
60
|
+
# end
|
61
|
+
#
|
62
|
+
# # Available Waiters
|
63
|
+
#
|
64
|
+
# The following table lists the valid waiter names, the operations they call,
|
65
|
+
# and the default `:delay` and `:max_attempts` values.
|
66
|
+
#
|
67
|
+
{{#waiters_markdown_table}}
|
68
|
+
{{#lines}}
|
69
|
+
# {{{.}}}{{/lines}}
|
70
|
+
{{/waiters_markdown_table}}
|
71
|
+
#
|
72
|
+
{{/waiters?}}
|
73
|
+
module Waiters
|
74
|
+
{{#waiters}}
|
75
|
+
|
76
|
+
{{> documentation}}
|
77
|
+
class {{class_name}}
|
78
|
+
|
79
|
+
# @param [Hash] options
|
80
|
+
# @option options [required, Client] :client
|
81
|
+
# @option options [Integer] :max_attempts ({{max_attempts}})
|
82
|
+
# @option options [Integer] :delay ({{delay}})
|
83
|
+
# @option options [Proc] :before_attempt
|
84
|
+
# @option options [Proc] :before_wait
|
85
|
+
def initialize(options)
|
86
|
+
@client = options.fetch(:client)
|
87
|
+
@waiter = Aws::Waiters::Waiter.new({
|
88
|
+
max_attempts: {{max_attempts}},
|
89
|
+
delay: {{delay}},
|
90
|
+
poller: Aws::Waiters::Poller.new(
|
91
|
+
operation_name: :{{client_method}},
|
92
|
+
{{#acceptors}}
|
93
|
+
{{#lines}}
|
94
|
+
{{{.}}}{{/lines}}
|
95
|
+
{{/acceptors}}
|
96
|
+
)
|
97
|
+
}.merge(options))
|
98
|
+
end
|
99
|
+
|
100
|
+
# @option (see Client#{{client_method}})
|
101
|
+
# @return (see Client#{{client_method}})
|
102
|
+
def wait(params = {})
|
103
|
+
@waiter.wait(client: @client, params: params)
|
104
|
+
end
|
105
|
+
|
106
|
+
# @api private
|
107
|
+
attr_reader :waiter
|
108
|
+
|
109
|
+
end
|
110
|
+
{{/waiters}}
|
111
|
+
end
|
112
|
+
end
|
metadata
CHANGED
@@ -1,103 +1,149 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws-sdk-code-generator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.4.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Amazon Web Services
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
12
|
-
dependencies:
|
11
|
+
date: 2021-10-20 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: kramdown
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ">="
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '0'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ">="
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mustache
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
13
41
|
description: Generates the service code for the AWS SDK for Ruby
|
14
42
|
email:
|
15
|
-
-
|
43
|
+
- aws-dr-rubygems@amazon.com
|
16
44
|
executables: []
|
17
45
|
extensions: []
|
18
46
|
extra_rdoc_files: []
|
19
47
|
files:
|
20
48
|
- lib/aws-sdk-code-generator.rb
|
49
|
+
- lib/aws-sdk-code-generator/api.rb
|
21
50
|
- lib/aws-sdk-code-generator/apply_docs.rb
|
51
|
+
- lib/aws-sdk-code-generator/client_constructor.rb
|
52
|
+
- lib/aws-sdk-code-generator/client_operation_documentation.rb
|
53
|
+
- lib/aws-sdk-code-generator/client_operation_list.rb
|
54
|
+
- lib/aws-sdk-code-generator/client_response_structure_example.rb
|
22
55
|
- lib/aws-sdk-code-generator/code_builder.rb
|
23
|
-
- lib/aws-sdk-code-generator/
|
24
|
-
- lib/aws-sdk-code-generator/
|
25
|
-
- lib/aws-sdk-code-generator/
|
26
|
-
- lib/aws-sdk-code-generator/dsl/attribute_writer.rb
|
27
|
-
- lib/aws-sdk-code-generator/dsl/autoload_statement.rb
|
28
|
-
- lib/aws-sdk-code-generator/dsl/block_param.rb
|
29
|
-
- lib/aws-sdk-code-generator/dsl/class.rb
|
30
|
-
- lib/aws-sdk-code-generator/dsl/code_literal.rb
|
31
|
-
- lib/aws-sdk-code-generator/dsl/code_object.rb
|
32
|
-
- lib/aws-sdk-code-generator/dsl/docstring.rb
|
33
|
-
- lib/aws-sdk-code-generator/dsl/eigenclass.rb
|
34
|
-
- lib/aws-sdk-code-generator/dsl/extend_statement.rb
|
35
|
-
- lib/aws-sdk-code-generator/dsl/formatter.rb
|
36
|
-
- lib/aws-sdk-code-generator/dsl/include_statement.rb
|
37
|
-
- lib/aws-sdk-code-generator/dsl/main.rb
|
38
|
-
- lib/aws-sdk-code-generator/dsl/method.rb
|
39
|
-
- lib/aws-sdk-code-generator/dsl/module.rb
|
40
|
-
- lib/aws-sdk-code-generator/dsl/option_tag.rb
|
41
|
-
- lib/aws-sdk-code-generator/dsl/param.rb
|
42
|
-
- lib/aws-sdk-code-generator/dsl/param_list.rb
|
43
|
-
- lib/aws-sdk-code-generator/dsl/return_tag.rb
|
44
|
-
- lib/aws-sdk-code-generator/dsl/tag_default.rb
|
45
|
-
- lib/aws-sdk-code-generator/dsl/tag_docstring.rb
|
46
|
-
- lib/aws-sdk-code-generator/dsl/tag_type.rb
|
56
|
+
- lib/aws-sdk-code-generator/crosslink.rb
|
57
|
+
- lib/aws-sdk-code-generator/docstring.rb
|
58
|
+
- lib/aws-sdk-code-generator/error_list.rb
|
47
59
|
- lib/aws-sdk-code-generator/errors.rb
|
60
|
+
- lib/aws-sdk-code-generator/eventstream_example.rb
|
48
61
|
- lib/aws-sdk-code-generator/gem_builder.rb
|
49
|
-
- lib/aws-sdk-code-generator/generators/client_api_module.rb
|
50
|
-
- lib/aws-sdk-code-generator/generators/client_class.rb
|
51
|
-
- lib/aws-sdk-code-generator/generators/client_operation_documentation.rb
|
52
|
-
- lib/aws-sdk-code-generator/generators/errors_module.rb
|
53
|
-
- lib/aws-sdk-code-generator/generators/resource/action.rb
|
54
|
-
- lib/aws-sdk-code-generator/generators/resource/batch_builder.rb
|
55
|
-
- lib/aws-sdk-code-generator/generators/resource/builder.rb
|
56
|
-
- lib/aws-sdk-code-generator/generators/resource/client_getter.rb
|
57
|
-
- lib/aws-sdk-code-generator/generators/resource/client_request.rb
|
58
|
-
- lib/aws-sdk-code-generator/generators/resource/client_request_docs.rb
|
59
|
-
- lib/aws-sdk-code-generator/generators/resource/client_request_params.rb
|
60
|
-
- lib/aws-sdk-code-generator/generators/resource/collection_class.rb
|
61
|
-
- lib/aws-sdk-code-generator/generators/resource/data_attribute_getter.rb
|
62
|
-
- lib/aws-sdk-code-generator/generators/resource/data_loaded_method.rb
|
63
|
-
- lib/aws-sdk-code-generator/generators/resource/data_method.rb
|
64
|
-
- lib/aws-sdk-code-generator/generators/resource/exists_method.rb
|
65
|
-
- lib/aws-sdk-code-generator/generators/resource/extract_identifier_method.rb
|
66
|
-
- lib/aws-sdk-code-generator/generators/resource/has_association.rb
|
67
|
-
- lib/aws-sdk-code-generator/generators/resource/has_many_association.rb
|
68
|
-
- lib/aws-sdk-code-generator/generators/resource/identifier_getter.rb
|
69
|
-
- lib/aws-sdk-code-generator/generators/resource/identifiers_method.rb
|
70
|
-
- lib/aws-sdk-code-generator/generators/resource/initialize_method.rb
|
71
|
-
- lib/aws-sdk-code-generator/generators/resource/load_method.rb
|
72
|
-
- lib/aws-sdk-code-generator/generators/resource/value_source.rb
|
73
|
-
- lib/aws-sdk-code-generator/generators/resource/waiter_method.rb
|
74
|
-
- lib/aws-sdk-code-generator/generators/resource_class.rb
|
75
|
-
- lib/aws-sdk-code-generator/generators/response_structure_example.rb
|
76
|
-
- lib/aws-sdk-code-generator/generators/root_resource_class.rb
|
77
|
-
- lib/aws-sdk-code-generator/generators/service_documentation.rb
|
78
|
-
- lib/aws-sdk-code-generator/generators/shared_example.rb
|
79
|
-
- lib/aws-sdk-code-generator/generators/structure_type_class.rb
|
80
|
-
- lib/aws-sdk-code-generator/generators/syntax_example.rb
|
81
|
-
- lib/aws-sdk-code-generator/generators/types_module.rb
|
82
|
-
- lib/aws-sdk-code-generator/generators/waiter_class.rb
|
83
|
-
- lib/aws-sdk-code-generator/generators/waiters_module.rb
|
84
62
|
- lib/aws-sdk-code-generator/hash_formatter.rb
|
85
63
|
- lib/aws-sdk-code-generator/helper.rb
|
64
|
+
- lib/aws-sdk-code-generator/plugin_list.rb
|
65
|
+
- lib/aws-sdk-code-generator/resource_action.rb
|
66
|
+
- lib/aws-sdk-code-generator/resource_action_code.rb
|
67
|
+
- lib/aws-sdk-code-generator/resource_association.rb
|
68
|
+
- lib/aws-sdk-code-generator/resource_attribute.rb
|
69
|
+
- lib/aws-sdk-code-generator/resource_batch_action.rb
|
70
|
+
- lib/aws-sdk-code-generator/resource_batch_action_code.rb
|
71
|
+
- lib/aws-sdk-code-generator/resource_batch_action_documentation.rb
|
72
|
+
- lib/aws-sdk-code-generator/resource_batch_builder.rb
|
73
|
+
- lib/aws-sdk-code-generator/resource_builder.rb
|
74
|
+
- lib/aws-sdk-code-generator/resource_client_request.rb
|
75
|
+
- lib/aws-sdk-code-generator/resource_client_request_documentation.rb
|
76
|
+
- lib/aws-sdk-code-generator/resource_client_request_params.rb
|
77
|
+
- lib/aws-sdk-code-generator/resource_data_method.rb
|
78
|
+
- lib/aws-sdk-code-generator/resource_has_association.rb
|
79
|
+
- lib/aws-sdk-code-generator/resource_has_many_association.rb
|
80
|
+
- lib/aws-sdk-code-generator/resource_has_many_association_code.rb
|
81
|
+
- lib/aws-sdk-code-generator/resource_identifier.rb
|
82
|
+
- lib/aws-sdk-code-generator/resource_identifiers_method.rb
|
83
|
+
- lib/aws-sdk-code-generator/resource_load_method.rb
|
84
|
+
- lib/aws-sdk-code-generator/resource_method.rb
|
85
|
+
- lib/aws-sdk-code-generator/resource_skip_params.rb
|
86
|
+
- lib/aws-sdk-code-generator/resource_value_source.rb
|
87
|
+
- lib/aws-sdk-code-generator/resource_waiter.rb
|
86
88
|
- lib/aws-sdk-code-generator/service.rb
|
89
|
+
- lib/aws-sdk-code-generator/shared_example.rb
|
90
|
+
- lib/aws-sdk-code-generator/syntax_example.rb
|
91
|
+
- lib/aws-sdk-code-generator/syntax_example_hash.rb
|
87
92
|
- lib/aws-sdk-code-generator/underscore.rb
|
88
93
|
- lib/aws-sdk-code-generator/view.rb
|
89
94
|
- lib/aws-sdk-code-generator/views.rb
|
95
|
+
- lib/aws-sdk-code-generator/views/apig_endpoint_class.rb
|
96
|
+
- lib/aws-sdk-code-generator/views/apig_readme.rb
|
97
|
+
- lib/aws-sdk-code-generator/views/async_client_class.rb
|
98
|
+
- lib/aws-sdk-code-generator/views/authorizer_class.rb
|
99
|
+
- lib/aws-sdk-code-generator/views/client_api_module.rb
|
100
|
+
- lib/aws-sdk-code-generator/views/client_class.rb
|
101
|
+
- lib/aws-sdk-code-generator/views/docstring.rb
|
102
|
+
- lib/aws-sdk-code-generator/views/errors_module.rb
|
103
|
+
- lib/aws-sdk-code-generator/views/event_streams_module.rb
|
90
104
|
- lib/aws-sdk-code-generator/views/features/env.rb
|
105
|
+
- lib/aws-sdk-code-generator/views/features/smoke.rb
|
106
|
+
- lib/aws-sdk-code-generator/views/features/smoke_step_definitions.rb
|
91
107
|
- lib/aws-sdk-code-generator/views/features/step_definitions.rb
|
92
108
|
- lib/aws-sdk-code-generator/views/gemspec.rb
|
109
|
+
- lib/aws-sdk-code-generator/views/resource_class.rb
|
110
|
+
- lib/aws-sdk-code-generator/views/root_resource_class.rb
|
93
111
|
- lib/aws-sdk-code-generator/views/service_module.rb
|
94
112
|
- lib/aws-sdk-code-generator/views/spec/spec_helper.rb
|
113
|
+
- lib/aws-sdk-code-generator/views/types_module.rb
|
95
114
|
- lib/aws-sdk-code-generator/views/version.rb
|
96
|
-
|
115
|
+
- lib/aws-sdk-code-generator/views/waiters_module.rb
|
116
|
+
- lib/aws-sdk-code-generator/waiter.rb
|
117
|
+
- lib/aws-sdk-code-generator/yard_option_tag.rb
|
118
|
+
- templates/apig_endpoint_class.mustache
|
119
|
+
- templates/apig_readme.mustache
|
120
|
+
- templates/async_client_class.mustache
|
121
|
+
- templates/authorizer_class.mustache
|
122
|
+
- templates/client_api_module.mustache
|
123
|
+
- templates/client_class.mustache
|
124
|
+
- templates/code.mustache
|
125
|
+
- templates/documentation.mustache
|
126
|
+
- templates/errors_module.mustache
|
127
|
+
- templates/event_streams_module.mustache
|
128
|
+
- templates/features/env.mustache
|
129
|
+
- templates/features/smoke.mustache
|
130
|
+
- templates/features/smoke_step_definitions.mustache
|
131
|
+
- templates/features/step_definitions.mustache
|
132
|
+
- templates/gemspec.mustache
|
133
|
+
- templates/license.txt
|
134
|
+
- templates/method.mustache
|
135
|
+
- templates/resource_class.mustache
|
136
|
+
- templates/root_resource_class.mustache
|
137
|
+
- templates/service_module.mustache
|
138
|
+
- templates/spec/spec_helper.mustache
|
139
|
+
- templates/types_module.mustache
|
140
|
+
- templates/version.mustache
|
141
|
+
- templates/waiters_module.mustache
|
142
|
+
homepage: https://github.com/aws/aws-sdk-ruby
|
97
143
|
licenses:
|
98
|
-
- Apache
|
144
|
+
- Apache-2.0
|
99
145
|
metadata: {}
|
100
|
-
post_install_message:
|
146
|
+
post_install_message:
|
101
147
|
rdoc_options: []
|
102
148
|
require_paths:
|
103
149
|
- lib
|
@@ -112,9 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
112
158
|
- !ruby/object:Gem::Version
|
113
159
|
version: 1.3.1
|
114
160
|
requirements: []
|
115
|
-
|
116
|
-
|
117
|
-
signing_key:
|
161
|
+
rubygems_version: 3.2.7
|
162
|
+
signing_key:
|
118
163
|
specification_version: 4
|
119
164
|
summary: AWS SDK for Ruby - Code Generator
|
120
165
|
test_files: []
|
@@ -1,23 +0,0 @@
|
|
1
|
-
module AwsSdkCodeGenerator
|
2
|
-
module Dsl
|
3
|
-
class AccessControlStatement
|
4
|
-
|
5
|
-
include Dsl::CodeObject
|
6
|
-
|
7
|
-
def initialize(access)
|
8
|
-
if [:public, :protected, :private].include?(access)
|
9
|
-
@access = access
|
10
|
-
else
|
11
|
-
raise ArgumentError, "expected :public, :protected, or :private"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
attr_reader :access
|
16
|
-
|
17
|
-
def lines
|
18
|
-
[access.to_s]
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module AwsSdkCodeGenerator
|
2
|
-
module Dsl
|
3
|
-
class AttributeAccessor
|
4
|
-
|
5
|
-
include Dsl::CodeObject
|
6
|
-
|
7
|
-
# @option options [Boolean] :api_private (false)
|
8
|
-
def initialize(name, options = {}, &block)
|
9
|
-
@name = name
|
10
|
-
@tags = []
|
11
|
-
yield(self) if block
|
12
|
-
api_private! if options.fetch(:api_private, false)
|
13
|
-
end
|
14
|
-
|
15
|
-
attr_reader :name
|
16
|
-
|
17
|
-
def returns(type, options = {})
|
18
|
-
@tags << ReturnTag.new(options.merge(type:type))
|
19
|
-
end
|
20
|
-
|
21
|
-
def api_private!
|
22
|
-
@tags << "# @api private"
|
23
|
-
end
|
24
|
-
|
25
|
-
def documented?
|
26
|
-
!@tags.empty?
|
27
|
-
end
|
28
|
-
|
29
|
-
def lines
|
30
|
-
lines = []
|
31
|
-
@tags.each do |tag|
|
32
|
-
lines.concat(tag.lines.to_a)
|
33
|
-
end
|
34
|
-
lines + ["#{macro} :#{@name}"]
|
35
|
-
end
|
36
|
-
|
37
|
-
def macro
|
38
|
-
"attr_accessor"
|
39
|
-
end
|
40
|
-
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,27 +0,0 @@
|
|
1
|
-
module AwsSdkCodeGenerator
|
2
|
-
module Dsl
|
3
|
-
class Class < Dsl::Module
|
4
|
-
|
5
|
-
# @option options [String, nil] :extends (nil)
|
6
|
-
def initialize(name, options = {}, &block)
|
7
|
-
super(name, options, &block)
|
8
|
-
@extends = options.fetch(:extends, nil)
|
9
|
-
end
|
10
|
-
|
11
|
-
def open_module
|
12
|
-
lines = ["class #{@name}"]
|
13
|
-
if @extends
|
14
|
-
extends = @extends.lines.to_a
|
15
|
-
lines[-1] = "#{lines[-1]} < #{extends[0].rstrip}"
|
16
|
-
extends[1..-1].each do |line|
|
17
|
-
lines << line.rstrip
|
18
|
-
end
|
19
|
-
lines
|
20
|
-
else
|
21
|
-
["class #{@name}"]
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
@@ -1,66 +0,0 @@
|
|
1
|
-
module AwsSdkCodeGenerator
|
2
|
-
module Dsl
|
3
|
-
class CodeLiteral
|
4
|
-
|
5
|
-
include Dsl::CodeObject
|
6
|
-
|
7
|
-
# @param [String] code
|
8
|
-
# @option options [Integer] :nesting (0)
|
9
|
-
def initialize(code = nil, options = {}, &block)
|
10
|
-
@code_objects = []
|
11
|
-
@nesting = options.fetch(:nesting, 0)
|
12
|
-
append(code) if code
|
13
|
-
yield(self) if block
|
14
|
-
end
|
15
|
-
|
16
|
-
attr_accessor :nesting
|
17
|
-
|
18
|
-
# @param [String, CodeLiteral]
|
19
|
-
def <<(code)
|
20
|
-
if CodeLiteral === code || String === code
|
21
|
-
@code_objects << [@nesting, code]
|
22
|
-
else
|
23
|
-
msg = "expected String or CodeLiteral, got #{code.class}"
|
24
|
-
raise ArgumentError, msg
|
25
|
-
end
|
26
|
-
end
|
27
|
-
alias :append :<<
|
28
|
-
|
29
|
-
def newline
|
30
|
-
@code_objects << [@nesting, :newline]
|
31
|
-
end
|
32
|
-
|
33
|
-
def indent(code = nil, &block)
|
34
|
-
@nesting += 1
|
35
|
-
code = CodeLiteral.new(code) unless CodeLiteral === code
|
36
|
-
append(code)
|
37
|
-
yield(code) if block
|
38
|
-
@nesting -= 1
|
39
|
-
code
|
40
|
-
end
|
41
|
-
|
42
|
-
def lines(pad = '')
|
43
|
-
lines = []
|
44
|
-
@code_objects.each do |i, code_obj|
|
45
|
-
case code_obj
|
46
|
-
when :newline
|
47
|
-
lines << :newline
|
48
|
-
when String
|
49
|
-
code_obj.lines.each do |line|
|
50
|
-
line = line.rstrip
|
51
|
-
if line == ''
|
52
|
-
lines << :newline
|
53
|
-
else
|
54
|
-
lines << "#{pad}#{' ' * i}#{line}"
|
55
|
-
end
|
56
|
-
end
|
57
|
-
when CodeLiteral
|
58
|
-
lines.concat(code_obj.lines(pad + (' ' * i)))
|
59
|
-
end
|
60
|
-
end
|
61
|
-
lines
|
62
|
-
end
|
63
|
-
|
64
|
-
end
|
65
|
-
end
|
66
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'set'
|
2
|
-
|
3
|
-
module AwsSdkCodeGenerator
|
4
|
-
module Dsl
|
5
|
-
# @api private
|
6
|
-
module CodeObject
|
7
|
-
|
8
|
-
def to_s
|
9
|
-
format(lines)
|
10
|
-
end
|
11
|
-
|
12
|
-
private
|
13
|
-
|
14
|
-
def underscore(str)
|
15
|
-
Underscore.underscore(str)
|
16
|
-
end
|
17
|
-
|
18
|
-
def format(lines, nesting = 0)
|
19
|
-
i = ' ' * nesting
|
20
|
-
lines.inject([]) do |code, obj|
|
21
|
-
case obj
|
22
|
-
when :newline then code << "\n"
|
23
|
-
when String then code << "#{i}#{obj}\n"
|
24
|
-
when CodeObject then code.concat(obj.lines)
|
25
|
-
when Array, Enumerator then code << format(obj, nesting + 1)
|
26
|
-
else raise ArgumentError, "got #{obj.class}"
|
27
|
-
end
|
28
|
-
end.join
|
29
|
-
end
|
30
|
-
|
31
|
-
end
|
32
|
-
end
|
33
|
-
end
|
@@ -1,36 +0,0 @@
|
|
1
|
-
module AwsSdkCodeGenerator
|
2
|
-
module Dsl
|
3
|
-
# @api private
|
4
|
-
class Docstring
|
5
|
-
|
6
|
-
include Dsl::CodeObject
|
7
|
-
|
8
|
-
# @param [String, nil]
|
9
|
-
def initialize(docstring = nil, &block)
|
10
|
-
@lines = []
|
11
|
-
append(docstring)
|
12
|
-
yield(self) if block
|
13
|
-
end
|
14
|
-
|
15
|
-
def append(docstring)
|
16
|
-
@lines.concat(docstring.to_s.rstrip.lines.map do |line|
|
17
|
-
if line == "\n"
|
18
|
-
"#"
|
19
|
-
else
|
20
|
-
"# #{line.rstrip}"
|
21
|
-
end
|
22
|
-
end)
|
23
|
-
end
|
24
|
-
alias :<< :append
|
25
|
-
|
26
|
-
# @return [Array<String>]
|
27
|
-
attr_reader :lines
|
28
|
-
|
29
|
-
# @return [Boolean]
|
30
|
-
def empty?
|
31
|
-
@lines.empty?
|
32
|
-
end
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
@@ -1,25 +0,0 @@
|
|
1
|
-
module AwsSdkCodeGenerator
|
2
|
-
module Dsl
|
3
|
-
class Formatter
|
4
|
-
|
5
|
-
def initialize
|
6
|
-
@indent = ' '
|
7
|
-
end
|
8
|
-
|
9
|
-
def format(lines, nesting:0)
|
10
|
-
i = @indent * nesting
|
11
|
-
lines.inject([]) do |code, section|
|
12
|
-
case section
|
13
|
-
when "\n" then code << "\n" # do not indent blank lines
|
14
|
-
when CodeObject then code.concat(section.lines)
|
15
|
-
when String then code << "#{i}#{section}"
|
16
|
-
when Array then code << format(section, nesting:nesting + 1)
|
17
|
-
else
|
18
|
-
raise ArgumentError, "got #{section.class}"
|
19
|
-
end
|
20
|
-
end.join
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|