aws-sdk-devopsagent 1.0.0

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.
File without changes
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::DevOpsAgent
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute use_fips
14
+ # When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.
15
+ #
16
+ # @return [boolean]
17
+ #
18
+ # @!attribute endpoint
19
+ # Override the endpoint used to send this request
20
+ #
21
+ # @return [string]
22
+ #
23
+ # @!attribute region
24
+ # The AWS region used to dispatch the request.
25
+ #
26
+ # @return [string]
27
+ #
28
+ EndpointParameters = Struct.new(
29
+ :use_fips,
30
+ :endpoint,
31
+ :region,
32
+ ) do
33
+ include Aws::Structure
34
+
35
+ # @api private
36
+ class << self
37
+ PARAM_MAP = {
38
+ 'UseFIPS' => :use_fips,
39
+ 'Endpoint' => :endpoint,
40
+ 'Region' => :region,
41
+ }.freeze
42
+ end
43
+
44
+ def initialize(options = {})
45
+ self[:use_fips] = options[:use_fips]
46
+ self[:use_fips] = false if self[:use_fips].nil?
47
+ self[:endpoint] = options[:endpoint]
48
+ self[:region] = options[:region]
49
+ end
50
+
51
+ def self.create(config, options={})
52
+ new({
53
+ use_fips: config.use_fips_endpoint,
54
+ endpoint: (config.endpoint.to_s unless config.regional_endpoint),
55
+ region: config.region,
56
+ }.merge(options))
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::DevOpsAgent
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ if Aws::Endpoints::Matchers.set?(parameters.endpoint)
14
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
15
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
16
+ end
17
+ return Aws::Endpoints::Endpoint.new(url: parameters.endpoint, headers: {}, properties: {})
18
+ end
19
+ if Aws::Endpoints::Matchers.set?(parameters.region)
20
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(parameters.region))
21
+ if Aws::Endpoints::Matchers.boolean_equals?(parameters.use_fips, true)
22
+ return Aws::Endpoints::Endpoint.new(url: "https://aidevops-fips.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
23
+ end
24
+ return Aws::Endpoints::Endpoint.new(url: "https://aidevops.#{parameters.region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
25
+ end
26
+ end
27
+ raise ArgumentError, "Invalid Configuration: Missing Region"
28
+ raise ArgumentError, 'No endpoint could be resolved'
29
+
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::DevOpsAgent
12
+ # @api private
13
+ module Endpoints
14
+
15
+
16
+ def self.parameters_for_operation(context)
17
+ Aws::DevOpsAgent::EndpointParameters.create(context.config)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,216 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::DevOpsAgent
11
+
12
+ # When DevOpsAgent returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::DevOpsAgent::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all DevOpsAgent errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::DevOpsAgent::Errors::ServiceError
20
+ # # rescues all DevOpsAgent API errors
21
+ # end
22
+ #
23
+ #
24
+ # ## Request Context
25
+ # ServiceError objects have a {Aws::Errors::ServiceError#context #context} method that returns
26
+ # information about the request that generated the error.
27
+ # See {Seahorse::Client::RequestContext} for more information.
28
+ #
29
+ # ## Error Classes
30
+ # * {AccessDeniedException}
31
+ # * {ConflictException}
32
+ # * {ContentSizeExceededException}
33
+ # * {IdentityCenterServiceException}
34
+ # * {InternalServerException}
35
+ # * {InvalidParameterException}
36
+ # * {ResourceNotFoundException}
37
+ # * {ServiceQuotaExceededException}
38
+ # * {ThrottlingException}
39
+ # * {ValidationException}
40
+ #
41
+ # Additionally, error classes are dynamically generated for service errors based on the error code
42
+ # if they are not defined above.
43
+ module Errors
44
+
45
+ extend Aws::Errors::DynamicErrors
46
+
47
+ class AccessDeniedException < ServiceError
48
+
49
+ # @param [Seahorse::Client::RequestContext] context
50
+ # @param [String] message
51
+ # @param [Aws::DevOpsAgent::Types::AccessDeniedException] data
52
+ def initialize(context, message, data = Aws::EmptyStructure.new)
53
+ super(context, message, data)
54
+ end
55
+
56
+ # @return [String]
57
+ def message
58
+ @message || @data[:message]
59
+ end
60
+ end
61
+
62
+ class ConflictException < ServiceError
63
+
64
+ # @param [Seahorse::Client::RequestContext] context
65
+ # @param [String] message
66
+ # @param [Aws::DevOpsAgent::Types::ConflictException] data
67
+ def initialize(context, message, data = Aws::EmptyStructure.new)
68
+ super(context, message, data)
69
+ end
70
+
71
+ # @return [String]
72
+ def message
73
+ @message || @data[:message]
74
+ end
75
+ end
76
+
77
+ class ContentSizeExceededException < ServiceError
78
+
79
+ # @param [Seahorse::Client::RequestContext] context
80
+ # @param [String] message
81
+ # @param [Aws::DevOpsAgent::Types::ContentSizeExceededException] data
82
+ def initialize(context, message, data = Aws::EmptyStructure.new)
83
+ super(context, message, data)
84
+ end
85
+
86
+ # @return [String]
87
+ def message
88
+ @message || @data[:message]
89
+ end
90
+ end
91
+
92
+ class IdentityCenterServiceException < ServiceError
93
+
94
+ # @param [Seahorse::Client::RequestContext] context
95
+ # @param [String] message
96
+ # @param [Aws::DevOpsAgent::Types::IdentityCenterServiceException] data
97
+ def initialize(context, message, data = Aws::EmptyStructure.new)
98
+ super(context, message, data)
99
+ end
100
+
101
+ # @return [String]
102
+ def message
103
+ @message || @data[:message]
104
+ end
105
+
106
+ # @return [String]
107
+ def underlying_error_code
108
+ @data[:underlying_error_code]
109
+ end
110
+ end
111
+
112
+ class InternalServerException < ServiceError
113
+
114
+ # @param [Seahorse::Client::RequestContext] context
115
+ # @param [String] message
116
+ # @param [Aws::DevOpsAgent::Types::InternalServerException] data
117
+ def initialize(context, message, data = Aws::EmptyStructure.new)
118
+ super(context, message, data)
119
+ end
120
+
121
+ # @return [String]
122
+ def message
123
+ @message || @data[:message]
124
+ end
125
+
126
+ def retryable?
127
+ true
128
+ end
129
+ end
130
+
131
+ class InvalidParameterException < ServiceError
132
+
133
+ # @param [Seahorse::Client::RequestContext] context
134
+ # @param [String] message
135
+ # @param [Aws::DevOpsAgent::Types::InvalidParameterException] data
136
+ def initialize(context, message, data = Aws::EmptyStructure.new)
137
+ super(context, message, data)
138
+ end
139
+
140
+ # @return [String]
141
+ def message
142
+ @message || @data[:message]
143
+ end
144
+ end
145
+
146
+ class ResourceNotFoundException < ServiceError
147
+
148
+ # @param [Seahorse::Client::RequestContext] context
149
+ # @param [String] message
150
+ # @param [Aws::DevOpsAgent::Types::ResourceNotFoundException] data
151
+ def initialize(context, message, data = Aws::EmptyStructure.new)
152
+ super(context, message, data)
153
+ end
154
+
155
+ # @return [String]
156
+ def message
157
+ @message || @data[:message]
158
+ end
159
+ end
160
+
161
+ class ServiceQuotaExceededException < ServiceError
162
+
163
+ # @param [Seahorse::Client::RequestContext] context
164
+ # @param [String] message
165
+ # @param [Aws::DevOpsAgent::Types::ServiceQuotaExceededException] data
166
+ def initialize(context, message, data = Aws::EmptyStructure.new)
167
+ super(context, message, data)
168
+ end
169
+
170
+ # @return [String]
171
+ def message
172
+ @message || @data[:message]
173
+ end
174
+ end
175
+
176
+ class ThrottlingException < ServiceError
177
+
178
+ # @param [Seahorse::Client::RequestContext] context
179
+ # @param [String] message
180
+ # @param [Aws::DevOpsAgent::Types::ThrottlingException] data
181
+ def initialize(context, message, data = Aws::EmptyStructure.new)
182
+ super(context, message, data)
183
+ end
184
+
185
+ # @return [String]
186
+ def message
187
+ @message || @data[:message]
188
+ end
189
+
190
+ def retryable?
191
+ true
192
+ end
193
+ end
194
+
195
+ class ValidationException < ServiceError
196
+
197
+ # @param [Seahorse::Client::RequestContext] context
198
+ # @param [String] message
199
+ # @param [Aws::DevOpsAgent::Types::ValidationException] data
200
+ def initialize(context, message, data = Aws::EmptyStructure.new)
201
+ super(context, message, data)
202
+ end
203
+
204
+ # @return [String]
205
+ def message
206
+ @message || @data[:message]
207
+ end
208
+
209
+ # @return [String]
210
+ def field_list
211
+ @data[:field_list]
212
+ end
213
+ end
214
+
215
+ end
216
+ end
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::DevOpsAgent
11
+ module EventStreams
12
+ class SendMessageEvents
13
+
14
+ def initialize
15
+ @event_emitter = Aws::EventEmitter.new
16
+ end
17
+
18
+ def on_response_created_event(&block)
19
+ @event_emitter.on(:response_created, block) if block_given?
20
+ end
21
+
22
+ def on_response_in_progress_event(&block)
23
+ @event_emitter.on(:response_in_progress, block) if block_given?
24
+ end
25
+
26
+ def on_response_completed_event(&block)
27
+ @event_emitter.on(:response_completed, block) if block_given?
28
+ end
29
+
30
+ def on_response_failed_event(&block)
31
+ @event_emitter.on(:response_failed, block) if block_given?
32
+ end
33
+
34
+ def on_summary_event(&block)
35
+ @event_emitter.on(:summary, block) if block_given?
36
+ end
37
+
38
+ def on_heartbeat_event(&block)
39
+ @event_emitter.on(:heartbeat, block) if block_given?
40
+ end
41
+
42
+ def on_content_block_start_event(&block)
43
+ @event_emitter.on(:content_block_start, block) if block_given?
44
+ end
45
+
46
+ def on_content_block_delta_event(&block)
47
+ @event_emitter.on(:content_block_delta, block) if block_given?
48
+ end
49
+
50
+ def on_content_block_stop_event(&block)
51
+ @event_emitter.on(:content_block_stop, block) if block_given?
52
+ end
53
+
54
+ def on_error_event(&block)
55
+ @event_emitter.on(:error, block) if block_given?
56
+ end
57
+
58
+ def on_initial_response_event(&block)
59
+ @event_emitter.on(:initial_response, block) if block_given?
60
+ end
61
+
62
+ def on_unknown_event(&block)
63
+ @event_emitter.on(:unknown_event, block) if block_given?
64
+ end
65
+
66
+ def on_event(&block)
67
+ on_response_created_event(&block)
68
+ on_response_in_progress_event(&block)
69
+ on_response_completed_event(&block)
70
+ on_response_failed_event(&block)
71
+ on_summary_event(&block)
72
+ on_heartbeat_event(&block)
73
+ on_content_block_start_event(&block)
74
+ on_content_block_delta_event(&block)
75
+ on_content_block_stop_event(&block)
76
+ on_error_event(&block)
77
+ on_initial_response_event(&block)
78
+ on_unknown_event(&block)
79
+ end
80
+
81
+ # @api private
82
+ # @return Aws::EventEmitter
83
+ attr_reader :event_emitter
84
+
85
+ end
86
+
87
+ end
88
+ end
89
+
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+
11
+ module Aws::DevOpsAgent
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::DevOpsAgent::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: <<~DOCS) do |_cfg|
19
+ The endpoint provider used to resolve endpoints. Any object that responds to
20
+ `#resolve_endpoint(parameters)` where `parameters` is a Struct similar to
21
+ `Aws::DevOpsAgent::EndpointParameters`.
22
+ DOCS
23
+ Aws::DevOpsAgent::EndpointProvider.new
24
+ end
25
+
26
+ # @api private
27
+ class Handler < Seahorse::Client::Handler
28
+ def call(context)
29
+ unless context[:discovered_endpoint]
30
+ params = Aws::DevOpsAgent::Endpoints.parameters_for_operation(context)
31
+ endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
+
33
+ context.http_request.endpoint = endpoint.url
34
+ apply_endpoint_headers(context, endpoint.headers)
35
+
36
+ context[:endpoint_params] = params
37
+ context[:endpoint_properties] = endpoint.properties
38
+ end
39
+
40
+ context[:auth_scheme] =
41
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
42
+
43
+ with_metrics(context) { @handler.call(context) }
44
+ end
45
+
46
+ private
47
+
48
+ def with_metrics(context, &block)
49
+ metrics = []
50
+ metrics << 'ENDPOINT_OVERRIDE' unless context.config.regional_endpoint
51
+ if context[:auth_scheme] && context[:auth_scheme]['name'] == 'sigv4a'
52
+ metrics << 'SIGV4A_SIGNING'
53
+ end
54
+ if context.config.credentials&.credentials&.account_id
55
+ metrics << 'RESOLVED_ACCOUNT_ID'
56
+ end
57
+ Aws::Plugins::UserAgent.metric(*metrics, &block)
58
+ end
59
+
60
+ def apply_endpoint_headers(context, headers)
61
+ headers.each do |key, values|
62
+ value = values
63
+ .compact
64
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
65
+ .join(',')
66
+
67
+ context.http_request.headers[key] = value
68
+ end
69
+ end
70
+ end
71
+
72
+ def add_handlers(handlers, _config)
73
+ handlers.add(Handler, step: :build, priority: 75)
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ # WARNING ABOUT GENERATED CODE
4
+ #
5
+ # This file is generated. See the contributing guide for more information:
6
+ # https://github.com/aws/aws-sdk-ruby/blob/version-3/CONTRIBUTING.md
7
+ #
8
+ # WARNING ABOUT GENERATED CODE
9
+
10
+ module Aws::DevOpsAgent
11
+
12
+ class Resource
13
+
14
+ # @param options ({})
15
+ # @option options [Client] :client
16
+ def initialize(options = {})
17
+ @client = options[:client] || Client.new(options)
18
+ end
19
+
20
+ # @return [Client]
21
+ def client
22
+ @client
23
+ end
24
+
25
+ end
26
+ end