aws-sdk-route53profiles 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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::Route53Profiles
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://route53profiles-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://route53profiles-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://route53profiles.#{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://route53profiles.#{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,240 @@
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::Route53Profiles
12
+ # @api private
13
+ module Endpoints
14
+
15
+ class AssociateProfile
16
+ def self.build(context)
17
+ unless context.config.regional_endpoint
18
+ endpoint = context.config.endpoint.to_s
19
+ end
20
+ Aws::Route53Profiles::EndpointParameters.new(
21
+ region: context.config.region,
22
+ use_dual_stack: context.config.use_dualstack_endpoint,
23
+ use_fips: context.config.use_fips_endpoint,
24
+ endpoint: endpoint,
25
+ )
26
+ end
27
+ end
28
+
29
+ class AssociateResourceToProfile
30
+ def self.build(context)
31
+ unless context.config.regional_endpoint
32
+ endpoint = context.config.endpoint.to_s
33
+ end
34
+ Aws::Route53Profiles::EndpointParameters.new(
35
+ region: context.config.region,
36
+ use_dual_stack: context.config.use_dualstack_endpoint,
37
+ use_fips: context.config.use_fips_endpoint,
38
+ endpoint: endpoint,
39
+ )
40
+ end
41
+ end
42
+
43
+ class CreateProfile
44
+ def self.build(context)
45
+ unless context.config.regional_endpoint
46
+ endpoint = context.config.endpoint.to_s
47
+ end
48
+ Aws::Route53Profiles::EndpointParameters.new(
49
+ region: context.config.region,
50
+ use_dual_stack: context.config.use_dualstack_endpoint,
51
+ use_fips: context.config.use_fips_endpoint,
52
+ endpoint: endpoint,
53
+ )
54
+ end
55
+ end
56
+
57
+ class DeleteProfile
58
+ def self.build(context)
59
+ unless context.config.regional_endpoint
60
+ endpoint = context.config.endpoint.to_s
61
+ end
62
+ Aws::Route53Profiles::EndpointParameters.new(
63
+ region: context.config.region,
64
+ use_dual_stack: context.config.use_dualstack_endpoint,
65
+ use_fips: context.config.use_fips_endpoint,
66
+ endpoint: endpoint,
67
+ )
68
+ end
69
+ end
70
+
71
+ class DisassociateProfile
72
+ def self.build(context)
73
+ unless context.config.regional_endpoint
74
+ endpoint = context.config.endpoint.to_s
75
+ end
76
+ Aws::Route53Profiles::EndpointParameters.new(
77
+ region: context.config.region,
78
+ use_dual_stack: context.config.use_dualstack_endpoint,
79
+ use_fips: context.config.use_fips_endpoint,
80
+ endpoint: endpoint,
81
+ )
82
+ end
83
+ end
84
+
85
+ class DisassociateResourceFromProfile
86
+ def self.build(context)
87
+ unless context.config.regional_endpoint
88
+ endpoint = context.config.endpoint.to_s
89
+ end
90
+ Aws::Route53Profiles::EndpointParameters.new(
91
+ region: context.config.region,
92
+ use_dual_stack: context.config.use_dualstack_endpoint,
93
+ use_fips: context.config.use_fips_endpoint,
94
+ endpoint: endpoint,
95
+ )
96
+ end
97
+ end
98
+
99
+ class GetProfile
100
+ def self.build(context)
101
+ unless context.config.regional_endpoint
102
+ endpoint = context.config.endpoint.to_s
103
+ end
104
+ Aws::Route53Profiles::EndpointParameters.new(
105
+ region: context.config.region,
106
+ use_dual_stack: context.config.use_dualstack_endpoint,
107
+ use_fips: context.config.use_fips_endpoint,
108
+ endpoint: endpoint,
109
+ )
110
+ end
111
+ end
112
+
113
+ class GetProfileAssociation
114
+ def self.build(context)
115
+ unless context.config.regional_endpoint
116
+ endpoint = context.config.endpoint.to_s
117
+ end
118
+ Aws::Route53Profiles::EndpointParameters.new(
119
+ region: context.config.region,
120
+ use_dual_stack: context.config.use_dualstack_endpoint,
121
+ use_fips: context.config.use_fips_endpoint,
122
+ endpoint: endpoint,
123
+ )
124
+ end
125
+ end
126
+
127
+ class GetProfileResourceAssociation
128
+ def self.build(context)
129
+ unless context.config.regional_endpoint
130
+ endpoint = context.config.endpoint.to_s
131
+ end
132
+ Aws::Route53Profiles::EndpointParameters.new(
133
+ region: context.config.region,
134
+ use_dual_stack: context.config.use_dualstack_endpoint,
135
+ use_fips: context.config.use_fips_endpoint,
136
+ endpoint: endpoint,
137
+ )
138
+ end
139
+ end
140
+
141
+ class ListProfileAssociations
142
+ def self.build(context)
143
+ unless context.config.regional_endpoint
144
+ endpoint = context.config.endpoint.to_s
145
+ end
146
+ Aws::Route53Profiles::EndpointParameters.new(
147
+ region: context.config.region,
148
+ use_dual_stack: context.config.use_dualstack_endpoint,
149
+ use_fips: context.config.use_fips_endpoint,
150
+ endpoint: endpoint,
151
+ )
152
+ end
153
+ end
154
+
155
+ class ListProfileResourceAssociations
156
+ def self.build(context)
157
+ unless context.config.regional_endpoint
158
+ endpoint = context.config.endpoint.to_s
159
+ end
160
+ Aws::Route53Profiles::EndpointParameters.new(
161
+ region: context.config.region,
162
+ use_dual_stack: context.config.use_dualstack_endpoint,
163
+ use_fips: context.config.use_fips_endpoint,
164
+ endpoint: endpoint,
165
+ )
166
+ end
167
+ end
168
+
169
+ class ListProfiles
170
+ def self.build(context)
171
+ unless context.config.regional_endpoint
172
+ endpoint = context.config.endpoint.to_s
173
+ end
174
+ Aws::Route53Profiles::EndpointParameters.new(
175
+ region: context.config.region,
176
+ use_dual_stack: context.config.use_dualstack_endpoint,
177
+ use_fips: context.config.use_fips_endpoint,
178
+ endpoint: endpoint,
179
+ )
180
+ end
181
+ end
182
+
183
+ class ListTagsForResource
184
+ def self.build(context)
185
+ unless context.config.regional_endpoint
186
+ endpoint = context.config.endpoint.to_s
187
+ end
188
+ Aws::Route53Profiles::EndpointParameters.new(
189
+ region: context.config.region,
190
+ use_dual_stack: context.config.use_dualstack_endpoint,
191
+ use_fips: context.config.use_fips_endpoint,
192
+ endpoint: endpoint,
193
+ )
194
+ end
195
+ end
196
+
197
+ class TagResource
198
+ def self.build(context)
199
+ unless context.config.regional_endpoint
200
+ endpoint = context.config.endpoint.to_s
201
+ end
202
+ Aws::Route53Profiles::EndpointParameters.new(
203
+ region: context.config.region,
204
+ use_dual_stack: context.config.use_dualstack_endpoint,
205
+ use_fips: context.config.use_fips_endpoint,
206
+ endpoint: endpoint,
207
+ )
208
+ end
209
+ end
210
+
211
+ class UntagResource
212
+ def self.build(context)
213
+ unless context.config.regional_endpoint
214
+ endpoint = context.config.endpoint.to_s
215
+ end
216
+ Aws::Route53Profiles::EndpointParameters.new(
217
+ region: context.config.region,
218
+ use_dual_stack: context.config.use_dualstack_endpoint,
219
+ use_fips: context.config.use_fips_endpoint,
220
+ endpoint: endpoint,
221
+ )
222
+ end
223
+ end
224
+
225
+ class UpdateProfileResourceAssociation
226
+ def self.build(context)
227
+ unless context.config.regional_endpoint
228
+ endpoint = context.config.endpoint.to_s
229
+ end
230
+ Aws::Route53Profiles::EndpointParameters.new(
231
+ region: context.config.region,
232
+ use_dual_stack: context.config.use_dualstack_endpoint,
233
+ use_fips: context.config.use_fips_endpoint,
234
+ endpoint: endpoint,
235
+ )
236
+ end
237
+ end
238
+
239
+ end
240
+ end
@@ -0,0 +1,218 @@
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::Route53Profiles
11
+
12
+ # When Route53Profiles returns an error response, the Ruby SDK constructs and raises an error.
13
+ # These errors all extend Aws::Route53Profiles::Errors::ServiceError < {Aws::Errors::ServiceError}
14
+ #
15
+ # You can rescue all Route53Profiles errors using ServiceError:
16
+ #
17
+ # begin
18
+ # # do stuff
19
+ # rescue Aws::Route53Profiles::Errors::ServiceError
20
+ # # rescues all Route53Profiles 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
+ # * {InternalServiceErrorException}
33
+ # * {InvalidNextTokenException}
34
+ # * {InvalidParameterException}
35
+ # * {LimitExceededException}
36
+ # * {ResourceExistsException}
37
+ # * {ResourceNotFoundException}
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::Route53Profiles::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::Route53Profiles::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 InternalServiceErrorException < ServiceError
78
+
79
+ # @param [Seahorse::Client::RequestContext] context
80
+ # @param [String] message
81
+ # @param [Aws::Route53Profiles::Types::InternalServiceErrorException] 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 InvalidNextTokenException < ServiceError
93
+
94
+ # @param [Seahorse::Client::RequestContext] context
95
+ # @param [String] message
96
+ # @param [Aws::Route53Profiles::Types::InvalidNextTokenException] 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
+ end
106
+
107
+ class InvalidParameterException < ServiceError
108
+
109
+ # @param [Seahorse::Client::RequestContext] context
110
+ # @param [String] message
111
+ # @param [Aws::Route53Profiles::Types::InvalidParameterException] data
112
+ def initialize(context, message, data = Aws::EmptyStructure.new)
113
+ super(context, message, data)
114
+ end
115
+
116
+ # @return [String]
117
+ def field_name
118
+ @data[:field_name]
119
+ end
120
+
121
+ # @return [String]
122
+ def message
123
+ @message || @data[:message]
124
+ end
125
+ end
126
+
127
+ class LimitExceededException < ServiceError
128
+
129
+ # @param [Seahorse::Client::RequestContext] context
130
+ # @param [String] message
131
+ # @param [Aws::Route53Profiles::Types::LimitExceededException] data
132
+ def initialize(context, message, data = Aws::EmptyStructure.new)
133
+ super(context, message, data)
134
+ end
135
+
136
+ # @return [String]
137
+ def message
138
+ @message || @data[:message]
139
+ end
140
+
141
+ # @return [String]
142
+ def resource_type
143
+ @data[:resource_type]
144
+ end
145
+ end
146
+
147
+ class ResourceExistsException < ServiceError
148
+
149
+ # @param [Seahorse::Client::RequestContext] context
150
+ # @param [String] message
151
+ # @param [Aws::Route53Profiles::Types::ResourceExistsException] data
152
+ def initialize(context, message, data = Aws::EmptyStructure.new)
153
+ super(context, message, data)
154
+ end
155
+
156
+ # @return [String]
157
+ def message
158
+ @message || @data[:message]
159
+ end
160
+
161
+ # @return [String]
162
+ def resource_type
163
+ @data[:resource_type]
164
+ end
165
+ end
166
+
167
+ class ResourceNotFoundException < ServiceError
168
+
169
+ # @param [Seahorse::Client::RequestContext] context
170
+ # @param [String] message
171
+ # @param [Aws::Route53Profiles::Types::ResourceNotFoundException] data
172
+ def initialize(context, message, data = Aws::EmptyStructure.new)
173
+ super(context, message, data)
174
+ end
175
+
176
+ # @return [String]
177
+ def message
178
+ @message || @data[:message]
179
+ end
180
+
181
+ # @return [String]
182
+ def resource_type
183
+ @data[:resource_type]
184
+ end
185
+ end
186
+
187
+ class ThrottlingException < ServiceError
188
+
189
+ # @param [Seahorse::Client::RequestContext] context
190
+ # @param [String] message
191
+ # @param [Aws::Route53Profiles::Types::ThrottlingException] data
192
+ def initialize(context, message, data = Aws::EmptyStructure.new)
193
+ super(context, message, data)
194
+ end
195
+
196
+ # @return [String]
197
+ def message
198
+ @message || @data[:message]
199
+ end
200
+ end
201
+
202
+ class ValidationException < ServiceError
203
+
204
+ # @param [Seahorse::Client::RequestContext] context
205
+ # @param [String] message
206
+ # @param [Aws::Route53Profiles::Types::ValidationException] data
207
+ def initialize(context, message, data = Aws::EmptyStructure.new)
208
+ super(context, message, data)
209
+ end
210
+
211
+ # @return [String]
212
+ def message
213
+ @message || @data[:message]
214
+ end
215
+ end
216
+
217
+ end
218
+ end
@@ -0,0 +1,102 @@
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::Route53Profiles
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Route53Profiles::EndpointProvider',
17
+ rbs_type: 'untyped',
18
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
19
+ 'object that responds to `#resolve_endpoint(parameters)` '\
20
+ 'where `parameters` is a Struct similar to '\
21
+ '`Aws::Route53Profiles::EndpointParameters`'
22
+ ) do |cfg|
23
+ Aws::Route53Profiles::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 = 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
+ @handler.call(context)
44
+ end
45
+
46
+ private
47
+
48
+ def apply_endpoint_headers(context, headers)
49
+ headers.each do |key, values|
50
+ value = values
51
+ .compact
52
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
53
+ .join(',')
54
+
55
+ context.http_request.headers[key] = value
56
+ end
57
+ end
58
+
59
+ def parameters_for_operation(context)
60
+ case context.operation_name
61
+ when :associate_profile
62
+ Aws::Route53Profiles::Endpoints::AssociateProfile.build(context)
63
+ when :associate_resource_to_profile
64
+ Aws::Route53Profiles::Endpoints::AssociateResourceToProfile.build(context)
65
+ when :create_profile
66
+ Aws::Route53Profiles::Endpoints::CreateProfile.build(context)
67
+ when :delete_profile
68
+ Aws::Route53Profiles::Endpoints::DeleteProfile.build(context)
69
+ when :disassociate_profile
70
+ Aws::Route53Profiles::Endpoints::DisassociateProfile.build(context)
71
+ when :disassociate_resource_from_profile
72
+ Aws::Route53Profiles::Endpoints::DisassociateResourceFromProfile.build(context)
73
+ when :get_profile
74
+ Aws::Route53Profiles::Endpoints::GetProfile.build(context)
75
+ when :get_profile_association
76
+ Aws::Route53Profiles::Endpoints::GetProfileAssociation.build(context)
77
+ when :get_profile_resource_association
78
+ Aws::Route53Profiles::Endpoints::GetProfileResourceAssociation.build(context)
79
+ when :list_profile_associations
80
+ Aws::Route53Profiles::Endpoints::ListProfileAssociations.build(context)
81
+ when :list_profile_resource_associations
82
+ Aws::Route53Profiles::Endpoints::ListProfileResourceAssociations.build(context)
83
+ when :list_profiles
84
+ Aws::Route53Profiles::Endpoints::ListProfiles.build(context)
85
+ when :list_tags_for_resource
86
+ Aws::Route53Profiles::Endpoints::ListTagsForResource.build(context)
87
+ when :tag_resource
88
+ Aws::Route53Profiles::Endpoints::TagResource.build(context)
89
+ when :untag_resource
90
+ Aws::Route53Profiles::Endpoints::UntagResource.build(context)
91
+ when :update_profile_resource_association
92
+ Aws::Route53Profiles::Endpoints::UpdateProfileResourceAssociation.build(context)
93
+ end
94
+ end
95
+ end
96
+
97
+ def add_handlers(handlers, _config)
98
+ handlers.add(Handler, step: :build, priority: 75)
99
+ end
100
+ end
101
+ end
102
+ 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::Route53Profiles
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