aws-sdk-observabilityadmin 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,236 @@
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::ObservabilityAdmin
12
+ # @api private
13
+ module ClientApi
14
+
15
+ include Seahorse::Model
16
+
17
+ AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
18
+ AccountIdentifier = Shapes::StringShape.new(name: 'AccountIdentifier')
19
+ AccountIdentifiers = Shapes::ListShape.new(name: 'AccountIdentifiers')
20
+ FailureReason = Shapes::StringShape.new(name: 'FailureReason')
21
+ GetTelemetryEvaluationStatusForOrganizationOutput = Shapes::StructureShape.new(name: 'GetTelemetryEvaluationStatusForOrganizationOutput')
22
+ GetTelemetryEvaluationStatusOutput = Shapes::StructureShape.new(name: 'GetTelemetryEvaluationStatusOutput')
23
+ InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
24
+ ListResourceTelemetryForOrganizationInput = Shapes::StructureShape.new(name: 'ListResourceTelemetryForOrganizationInput')
25
+ ListResourceTelemetryForOrganizationMaxResults = Shapes::IntegerShape.new(name: 'ListResourceTelemetryForOrganizationMaxResults')
26
+ ListResourceTelemetryForOrganizationOutput = Shapes::StructureShape.new(name: 'ListResourceTelemetryForOrganizationOutput')
27
+ ListResourceTelemetryInput = Shapes::StructureShape.new(name: 'ListResourceTelemetryInput')
28
+ ListResourceTelemetryMaxResults = Shapes::IntegerShape.new(name: 'ListResourceTelemetryMaxResults')
29
+ ListResourceTelemetryOutput = Shapes::StructureShape.new(name: 'ListResourceTelemetryOutput')
30
+ Long = Shapes::IntegerShape.new(name: 'Long')
31
+ NextToken = Shapes::StringShape.new(name: 'NextToken')
32
+ ResourceIdentifier = Shapes::StringShape.new(name: 'ResourceIdentifier')
33
+ ResourceIdentifierPrefix = Shapes::StringShape.new(name: 'ResourceIdentifierPrefix')
34
+ ResourceType = Shapes::StringShape.new(name: 'ResourceType')
35
+ ResourceTypes = Shapes::ListShape.new(name: 'ResourceTypes')
36
+ Status = Shapes::StringShape.new(name: 'Status')
37
+ String = Shapes::StringShape.new(name: 'String')
38
+ TagKey = Shapes::StringShape.new(name: 'TagKey')
39
+ TagMapInput = Shapes::MapShape.new(name: 'TagMapInput')
40
+ TagMapOutput = Shapes::MapShape.new(name: 'TagMapOutput')
41
+ TagValue = Shapes::StringShape.new(name: 'TagValue')
42
+ TelemetryConfiguration = Shapes::StructureShape.new(name: 'TelemetryConfiguration')
43
+ TelemetryConfigurationState = Shapes::MapShape.new(name: 'TelemetryConfigurationState')
44
+ TelemetryConfigurations = Shapes::ListShape.new(name: 'TelemetryConfigurations')
45
+ TelemetryState = Shapes::StringShape.new(name: 'TelemetryState')
46
+ TelemetryType = Shapes::StringShape.new(name: 'TelemetryType')
47
+ ValidationException = Shapes::StructureShape.new(name: 'ValidationException')
48
+
49
+ AccessDeniedException.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "Message"))
50
+ AccessDeniedException.add_member(:amzn_error_type, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "x-amzn-ErrorType"))
51
+ AccessDeniedException.struct_class = Types::AccessDeniedException
52
+
53
+ AccountIdentifiers.member = Shapes::ShapeRef.new(shape: AccountIdentifier)
54
+
55
+ GetTelemetryEvaluationStatusForOrganizationOutput.add_member(:status, Shapes::ShapeRef.new(shape: Status, location_name: "Status"))
56
+ GetTelemetryEvaluationStatusForOrganizationOutput.add_member(:failure_reason, Shapes::ShapeRef.new(shape: FailureReason, location_name: "FailureReason"))
57
+ GetTelemetryEvaluationStatusForOrganizationOutput.struct_class = Types::GetTelemetryEvaluationStatusForOrganizationOutput
58
+
59
+ GetTelemetryEvaluationStatusOutput.add_member(:status, Shapes::ShapeRef.new(shape: Status, location_name: "Status"))
60
+ GetTelemetryEvaluationStatusOutput.add_member(:failure_reason, Shapes::ShapeRef.new(shape: FailureReason, location_name: "FailureReason"))
61
+ GetTelemetryEvaluationStatusOutput.struct_class = Types::GetTelemetryEvaluationStatusOutput
62
+
63
+ InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "Message"))
64
+ InternalServerException.add_member(:amzn_error_type, Shapes::ShapeRef.new(shape: String, location: "header", location_name: "x-amzn-ErrorType"))
65
+ InternalServerException.struct_class = Types::InternalServerException
66
+
67
+ ListResourceTelemetryForOrganizationInput.add_member(:account_identifiers, Shapes::ShapeRef.new(shape: AccountIdentifiers, location_name: "AccountIdentifiers"))
68
+ ListResourceTelemetryForOrganizationInput.add_member(:resource_identifier_prefix, Shapes::ShapeRef.new(shape: ResourceIdentifierPrefix, location_name: "ResourceIdentifierPrefix"))
69
+ ListResourceTelemetryForOrganizationInput.add_member(:resource_types, Shapes::ShapeRef.new(shape: ResourceTypes, location_name: "ResourceTypes"))
70
+ ListResourceTelemetryForOrganizationInput.add_member(:telemetry_configuration_state, Shapes::ShapeRef.new(shape: TelemetryConfigurationState, location_name: "TelemetryConfigurationState"))
71
+ ListResourceTelemetryForOrganizationInput.add_member(:resource_tags, Shapes::ShapeRef.new(shape: TagMapInput, location_name: "ResourceTags"))
72
+ ListResourceTelemetryForOrganizationInput.add_member(:max_results, Shapes::ShapeRef.new(shape: ListResourceTelemetryForOrganizationMaxResults, location_name: "MaxResults"))
73
+ ListResourceTelemetryForOrganizationInput.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
74
+ ListResourceTelemetryForOrganizationInput.struct_class = Types::ListResourceTelemetryForOrganizationInput
75
+
76
+ ListResourceTelemetryForOrganizationOutput.add_member(:telemetry_configurations, Shapes::ShapeRef.new(shape: TelemetryConfigurations, location_name: "TelemetryConfigurations"))
77
+ ListResourceTelemetryForOrganizationOutput.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
78
+ ListResourceTelemetryForOrganizationOutput.struct_class = Types::ListResourceTelemetryForOrganizationOutput
79
+
80
+ ListResourceTelemetryInput.add_member(:resource_identifier_prefix, Shapes::ShapeRef.new(shape: ResourceIdentifierPrefix, location_name: "ResourceIdentifierPrefix"))
81
+ ListResourceTelemetryInput.add_member(:resource_types, Shapes::ShapeRef.new(shape: ResourceTypes, location_name: "ResourceTypes"))
82
+ ListResourceTelemetryInput.add_member(:telemetry_configuration_state, Shapes::ShapeRef.new(shape: TelemetryConfigurationState, location_name: "TelemetryConfigurationState"))
83
+ ListResourceTelemetryInput.add_member(:resource_tags, Shapes::ShapeRef.new(shape: TagMapInput, location_name: "ResourceTags"))
84
+ ListResourceTelemetryInput.add_member(:max_results, Shapes::ShapeRef.new(shape: ListResourceTelemetryMaxResults, location_name: "MaxResults"))
85
+ ListResourceTelemetryInput.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
86
+ ListResourceTelemetryInput.struct_class = Types::ListResourceTelemetryInput
87
+
88
+ ListResourceTelemetryOutput.add_member(:telemetry_configurations, Shapes::ShapeRef.new(shape: TelemetryConfigurations, location_name: "TelemetryConfigurations"))
89
+ ListResourceTelemetryOutput.add_member(:next_token, Shapes::ShapeRef.new(shape: NextToken, location_name: "NextToken"))
90
+ ListResourceTelemetryOutput.struct_class = Types::ListResourceTelemetryOutput
91
+
92
+ ResourceTypes.member = Shapes::ShapeRef.new(shape: ResourceType)
93
+
94
+ TagMapInput.key = Shapes::ShapeRef.new(shape: TagKey)
95
+ TagMapInput.value = Shapes::ShapeRef.new(shape: TagValue)
96
+
97
+ TagMapOutput.key = Shapes::ShapeRef.new(shape: String)
98
+ TagMapOutput.value = Shapes::ShapeRef.new(shape: String)
99
+
100
+ TelemetryConfiguration.add_member(:account_identifier, Shapes::ShapeRef.new(shape: AccountIdentifier, location_name: "AccountIdentifier"))
101
+ TelemetryConfiguration.add_member(:telemetry_configuration_state, Shapes::ShapeRef.new(shape: TelemetryConfigurationState, location_name: "TelemetryConfigurationState"))
102
+ TelemetryConfiguration.add_member(:resource_type, Shapes::ShapeRef.new(shape: ResourceType, location_name: "ResourceType"))
103
+ TelemetryConfiguration.add_member(:resource_identifier, Shapes::ShapeRef.new(shape: ResourceIdentifier, location_name: "ResourceIdentifier"))
104
+ TelemetryConfiguration.add_member(:resource_tags, Shapes::ShapeRef.new(shape: TagMapOutput, location_name: "ResourceTags"))
105
+ TelemetryConfiguration.add_member(:last_update_time_stamp, Shapes::ShapeRef.new(shape: Long, location_name: "LastUpdateTimeStamp"))
106
+ TelemetryConfiguration.struct_class = Types::TelemetryConfiguration
107
+
108
+ TelemetryConfigurationState.key = Shapes::ShapeRef.new(shape: TelemetryType)
109
+ TelemetryConfigurationState.value = Shapes::ShapeRef.new(shape: TelemetryState)
110
+
111
+ TelemetryConfigurations.member = Shapes::ShapeRef.new(shape: TelemetryConfiguration)
112
+
113
+ ValidationException.add_member(:message, Shapes::ShapeRef.new(shape: String, location_name: "Message"))
114
+ ValidationException.struct_class = Types::ValidationException
115
+
116
+
117
+ # @api private
118
+ API = Seahorse::Model::Api.new.tap do |api|
119
+
120
+ api.version = "2018-05-10"
121
+
122
+ api.metadata = {
123
+ "apiVersion" => "2018-05-10",
124
+ "auth" => ["aws.auth#sigv4"],
125
+ "endpointPrefix" => "observabilityadmin",
126
+ "protocol" => "rest-json",
127
+ "protocols" => ["rest-json"],
128
+ "serviceFullName" => "CloudWatch Observability Admin Service",
129
+ "serviceId" => "ObservabilityAdmin",
130
+ "signatureVersion" => "v4",
131
+ "signingName" => "observabilityadmin",
132
+ "uid" => "observabilityadmin-2018-05-10",
133
+ }
134
+
135
+ api.add_operation(:get_telemetry_evaluation_status, Seahorse::Model::Operation.new.tap do |o|
136
+ o.name = "GetTelemetryEvaluationStatus"
137
+ o.http_method = "POST"
138
+ o.http_request_uri = "/GetTelemetryEvaluationStatus"
139
+ o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
140
+ o.output = Shapes::ShapeRef.new(shape: GetTelemetryEvaluationStatusOutput)
141
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
142
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
143
+ end)
144
+
145
+ api.add_operation(:get_telemetry_evaluation_status_for_organization, Seahorse::Model::Operation.new.tap do |o|
146
+ o.name = "GetTelemetryEvaluationStatusForOrganization"
147
+ o.http_method = "POST"
148
+ o.http_request_uri = "/GetTelemetryEvaluationStatusForOrganization"
149
+ o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
150
+ o.output = Shapes::ShapeRef.new(shape: GetTelemetryEvaluationStatusForOrganizationOutput)
151
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
152
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
153
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
154
+ end)
155
+
156
+ api.add_operation(:list_resource_telemetry, Seahorse::Model::Operation.new.tap do |o|
157
+ o.name = "ListResourceTelemetry"
158
+ o.http_method = "POST"
159
+ o.http_request_uri = "/ListResourceTelemetry"
160
+ o.input = Shapes::ShapeRef.new(shape: ListResourceTelemetryInput)
161
+ o.output = Shapes::ShapeRef.new(shape: ListResourceTelemetryOutput)
162
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
163
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
164
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
165
+ o[:pager] = Aws::Pager.new(
166
+ limit_key: "max_results",
167
+ tokens: {
168
+ "next_token" => "next_token"
169
+ }
170
+ )
171
+ end)
172
+
173
+ api.add_operation(:list_resource_telemetry_for_organization, Seahorse::Model::Operation.new.tap do |o|
174
+ o.name = "ListResourceTelemetryForOrganization"
175
+ o.http_method = "POST"
176
+ o.http_request_uri = "/ListResourceTelemetryForOrganization"
177
+ o.input = Shapes::ShapeRef.new(shape: ListResourceTelemetryForOrganizationInput)
178
+ o.output = Shapes::ShapeRef.new(shape: ListResourceTelemetryForOrganizationOutput)
179
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
180
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
181
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
182
+ o[:pager] = Aws::Pager.new(
183
+ limit_key: "max_results",
184
+ tokens: {
185
+ "next_token" => "next_token"
186
+ }
187
+ )
188
+ end)
189
+
190
+ api.add_operation(:start_telemetry_evaluation, Seahorse::Model::Operation.new.tap do |o|
191
+ o.name = "StartTelemetryEvaluation"
192
+ o.http_method = "POST"
193
+ o.http_request_uri = "/StartTelemetryEvaluation"
194
+ o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
195
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
196
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
197
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
198
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
199
+ end)
200
+
201
+ api.add_operation(:start_telemetry_evaluation_for_organization, Seahorse::Model::Operation.new.tap do |o|
202
+ o.name = "StartTelemetryEvaluationForOrganization"
203
+ o.http_method = "POST"
204
+ o.http_request_uri = "/StartTelemetryEvaluationForOrganization"
205
+ o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
206
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
207
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
208
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
209
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
210
+ end)
211
+
212
+ api.add_operation(:stop_telemetry_evaluation, Seahorse::Model::Operation.new.tap do |o|
213
+ o.name = "StopTelemetryEvaluation"
214
+ o.http_method = "POST"
215
+ o.http_request_uri = "/StopTelemetryEvaluation"
216
+ o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
217
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
218
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
219
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
220
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
221
+ end)
222
+
223
+ api.add_operation(:stop_telemetry_evaluation_for_organization, Seahorse::Model::Operation.new.tap do |o|
224
+ o.name = "StopTelemetryEvaluationForOrganization"
225
+ o.http_method = "POST"
226
+ o.http_request_uri = "/StopTelemetryEvaluationForOrganization"
227
+ o.input = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
228
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
229
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
230
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
231
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
232
+ end)
233
+ end
234
+
235
+ end
236
+ end
File without changes
@@ -0,0 +1,69 @@
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::ObservabilityAdmin
11
+ # Endpoint parameters used to influence endpoints per request.
12
+ #
13
+ # @!attribute region
14
+ # The AWS region used to dispatch the request.
15
+ #
16
+ # @return [String]
17
+ #
18
+ # @!attribute use_dual_stack
19
+ # When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.
20
+ #
21
+ # @return [Boolean]
22
+ #
23
+ # @!attribute use_fips
24
+ # 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.
25
+ #
26
+ # @return [Boolean]
27
+ #
28
+ # @!attribute endpoint
29
+ # Override the endpoint used to send this request
30
+ #
31
+ # @return [String]
32
+ #
33
+ EndpointParameters = Struct.new(
34
+ :region,
35
+ :use_dual_stack,
36
+ :use_fips,
37
+ :endpoint,
38
+ ) do
39
+ include Aws::Structure
40
+
41
+ # @api private
42
+ class << self
43
+ PARAM_MAP = {
44
+ 'Region' => :region,
45
+ 'UseDualStack' => :use_dual_stack,
46
+ 'UseFIPS' => :use_fips,
47
+ 'Endpoint' => :endpoint,
48
+ }.freeze
49
+ end
50
+
51
+ def initialize(options = {})
52
+ self[:region] = options[:region]
53
+ self[:use_dual_stack] = options[:use_dual_stack]
54
+ self[:use_dual_stack] = false if self[:use_dual_stack].nil?
55
+ self[:use_fips] = options[:use_fips]
56
+ self[:use_fips] = false if self[:use_fips].nil?
57
+ self[:endpoint] = options[:endpoint]
58
+ end
59
+
60
+ def self.create(config, options={})
61
+ new({
62
+ region: config.region,
63
+ use_dual_stack: config.use_dualstack_endpoint,
64
+ use_fips: config.use_fips_endpoint,
65
+ endpoint: (config.endpoint.to_s unless config.regional_endpoint),
66
+ }.merge(options))
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,54 @@
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::ObservabilityAdmin
11
+ class EndpointProvider
12
+ def resolve_endpoint(parameters)
13
+ region = parameters.region
14
+ use_dual_stack = parameters.use_dual_stack
15
+ use_fips = parameters.use_fips
16
+ endpoint = parameters.endpoint
17
+ if Aws::Endpoints::Matchers.set?(endpoint)
18
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
19
+ raise ArgumentError, "Invalid Configuration: FIPS and custom endpoint are not supported"
20
+ end
21
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
22
+ raise ArgumentError, "Invalid Configuration: Dualstack and custom endpoint are not supported"
23
+ end
24
+ return Aws::Endpoints::Endpoint.new(url: endpoint, headers: {}, properties: {})
25
+ end
26
+ if Aws::Endpoints::Matchers.set?(region)
27
+ if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
28
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
29
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS")) && Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
30
+ return Aws::Endpoints::Endpoint.new(url: "https://observabilityadmin-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
31
+ end
32
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
33
+ end
34
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
35
+ if Aws::Endpoints::Matchers.boolean_equals?(Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"), true)
36
+ return Aws::Endpoints::Endpoint.new(url: "https://observabilityadmin-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
37
+ end
38
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
39
+ end
40
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
41
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
42
+ return Aws::Endpoints::Endpoint.new(url: "https://observabilityadmin.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
43
+ end
44
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
45
+ end
46
+ return Aws::Endpoints::Endpoint.new(url: "https://observabilityadmin.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
47
+ end
48
+ end
49
+ raise ArgumentError, "Invalid Configuration: Missing Region"
50
+ raise ArgumentError, 'No endpoint could be resolved'
51
+
52
+ end
53
+ end
54
+ 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::ObservabilityAdmin
12
+ # @api private
13
+ module Endpoints
14
+
15
+
16
+ def self.parameters_for_operation(context)
17
+ Aws::ObservabilityAdmin::EndpointParameters.create(context.config)
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,96 @@
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::ObservabilityAdmin
11
+
12
+ # When ObservabilityAdmin returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::ObservabilityAdmin::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all ObservabilityAdmin errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::ObservabilityAdmin::Errors::ServiceError
20
+ # # rescues all ObservabilityAdmin 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
+ # * {InternalServerException}
32
+ # * {ValidationException}
33
+ #
34
+ # Additionally, error classes are dynamically generated for service errors based on the error code
35
+ # if they are not defined above.
36
+ module Errors
37
+
38
+ extend Aws::Errors::DynamicErrors
39
+
40
+ class AccessDeniedException < ServiceError
41
+
42
+ # @param [Seahorse::Client::RequestContext] context
43
+ # @param [String] message
44
+ # @param [Aws::ObservabilityAdmin::Types::AccessDeniedException] data
45
+ def initialize(context, message, data = Aws::EmptyStructure.new)
46
+ super(context, message, data)
47
+ end
48
+
49
+ # @return [String]
50
+ def message
51
+ @message || @data[:message]
52
+ end
53
+
54
+ # @return [String]
55
+ def amzn_error_type
56
+ @data[:amzn_error_type]
57
+ end
58
+ end
59
+
60
+ class InternalServerException < ServiceError
61
+
62
+ # @param [Seahorse::Client::RequestContext] context
63
+ # @param [String] message
64
+ # @param [Aws::ObservabilityAdmin::Types::InternalServerException] data
65
+ def initialize(context, message, data = Aws::EmptyStructure.new)
66
+ super(context, message, data)
67
+ end
68
+
69
+ # @return [String]
70
+ def message
71
+ @message || @data[:message]
72
+ end
73
+
74
+ # @return [String]
75
+ def amzn_error_type
76
+ @data[:amzn_error_type]
77
+ end
78
+ end
79
+
80
+ class ValidationException < ServiceError
81
+
82
+ # @param [Seahorse::Client::RequestContext] context
83
+ # @param [String] message
84
+ # @param [Aws::ObservabilityAdmin::Types::ValidationException] data
85
+ def initialize(context, message, data = Aws::EmptyStructure.new)
86
+ super(context, message, data)
87
+ end
88
+
89
+ # @return [String]
90
+ def message
91
+ @message || @data[:message]
92
+ end
93
+ end
94
+
95
+ end
96
+ end
@@ -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::ObservabilityAdmin
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::ObservabilityAdmin::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::ObservabilityAdmin::EndpointParameters`.
22
+ DOCS
23
+ Aws::ObservabilityAdmin::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::ObservabilityAdmin::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::ObservabilityAdmin
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