aws-sdk-account 1.3.0 → 1.18.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -15,21 +15,53 @@ module Aws::Account
15
15
 
16
16
  AccessDeniedException = Shapes::StructureShape.new(name: 'AccessDeniedException')
17
17
  AccountId = Shapes::StringShape.new(name: 'AccountId')
18
+ AddressLine = Shapes::StringShape.new(name: 'AddressLine')
18
19
  AlternateContact = Shapes::StructureShape.new(name: 'AlternateContact')
19
20
  AlternateContactType = Shapes::StringShape.new(name: 'AlternateContactType')
21
+ City = Shapes::StringShape.new(name: 'City')
22
+ CompanyName = Shapes::StringShape.new(name: 'CompanyName')
23
+ ConflictException = Shapes::StructureShape.new(name: 'ConflictException')
24
+ ContactInformation = Shapes::StructureShape.new(name: 'ContactInformation')
25
+ ContactInformationPhoneNumber = Shapes::StringShape.new(name: 'ContactInformationPhoneNumber')
26
+ CountryCode = Shapes::StringShape.new(name: 'CountryCode')
20
27
  DeleteAlternateContactRequest = Shapes::StructureShape.new(name: 'DeleteAlternateContactRequest')
28
+ DisableRegionRequest = Shapes::StructureShape.new(name: 'DisableRegionRequest')
29
+ DistrictOrCounty = Shapes::StringShape.new(name: 'DistrictOrCounty')
21
30
  EmailAddress = Shapes::StringShape.new(name: 'EmailAddress')
31
+ EnableRegionRequest = Shapes::StructureShape.new(name: 'EnableRegionRequest')
32
+ FullName = Shapes::StringShape.new(name: 'FullName')
22
33
  GetAlternateContactRequest = Shapes::StructureShape.new(name: 'GetAlternateContactRequest')
23
34
  GetAlternateContactResponse = Shapes::StructureShape.new(name: 'GetAlternateContactResponse')
35
+ GetContactInformationRequest = Shapes::StructureShape.new(name: 'GetContactInformationRequest')
36
+ GetContactInformationResponse = Shapes::StructureShape.new(name: 'GetContactInformationResponse')
37
+ GetRegionOptStatusRequest = Shapes::StructureShape.new(name: 'GetRegionOptStatusRequest')
38
+ GetRegionOptStatusResponse = Shapes::StructureShape.new(name: 'GetRegionOptStatusResponse')
24
39
  InternalServerException = Shapes::StructureShape.new(name: 'InternalServerException')
40
+ ListRegionsRequest = Shapes::StructureShape.new(name: 'ListRegionsRequest')
41
+ ListRegionsRequestMaxResultsInteger = Shapes::IntegerShape.new(name: 'ListRegionsRequestMaxResultsInteger')
42
+ ListRegionsRequestNextTokenString = Shapes::StringShape.new(name: 'ListRegionsRequestNextTokenString')
43
+ ListRegionsResponse = Shapes::StructureShape.new(name: 'ListRegionsResponse')
25
44
  Name = Shapes::StringShape.new(name: 'Name')
26
45
  PhoneNumber = Shapes::StringShape.new(name: 'PhoneNumber')
46
+ PostalCode = Shapes::StringShape.new(name: 'PostalCode')
27
47
  PutAlternateContactRequest = Shapes::StructureShape.new(name: 'PutAlternateContactRequest')
48
+ PutContactInformationRequest = Shapes::StructureShape.new(name: 'PutContactInformationRequest')
49
+ Region = Shapes::StructureShape.new(name: 'Region')
50
+ RegionName = Shapes::StringShape.new(name: 'RegionName')
51
+ RegionOptList = Shapes::ListShape.new(name: 'RegionOptList')
52
+ RegionOptStatus = Shapes::StringShape.new(name: 'RegionOptStatus')
53
+ RegionOptStatusList = Shapes::ListShape.new(name: 'RegionOptStatusList')
28
54
  ResourceNotFoundException = Shapes::StructureShape.new(name: 'ResourceNotFoundException')
55
+ SensitiveString = Shapes::StringShape.new(name: 'SensitiveString')
56
+ StateOrRegion = Shapes::StringShape.new(name: 'StateOrRegion')
29
57
  String = Shapes::StringShape.new(name: 'String')
30
58
  Title = Shapes::StringShape.new(name: 'Title')
31
59
  TooManyRequestsException = Shapes::StructureShape.new(name: 'TooManyRequestsException')
32
60
  ValidationException = Shapes::StructureShape.new(name: 'ValidationException')
61
+ ValidationExceptionField = Shapes::StructureShape.new(name: 'ValidationExceptionField')
62
+ ValidationExceptionFieldList = Shapes::ListShape.new(name: 'ValidationExceptionFieldList')
63
+ ValidationExceptionReason = Shapes::StringShape.new(name: 'ValidationExceptionReason')
64
+ WebsiteUrl = Shapes::StringShape.new(name: 'WebsiteUrl')
33
65
 
34
66
  AccessDeniedException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
35
67
  AccessDeniedException.struct_class = Types::AccessDeniedException
@@ -41,10 +73,35 @@ module Aws::Account
41
73
  AlternateContact.add_member(:title, Shapes::ShapeRef.new(shape: Title, location_name: "Title"))
42
74
  AlternateContact.struct_class = Types::AlternateContact
43
75
 
76
+ ConflictException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
77
+ ConflictException.struct_class = Types::ConflictException
78
+
79
+ ContactInformation.add_member(:address_line_1, Shapes::ShapeRef.new(shape: AddressLine, required: true, location_name: "AddressLine1"))
80
+ ContactInformation.add_member(:address_line_2, Shapes::ShapeRef.new(shape: AddressLine, location_name: "AddressLine2"))
81
+ ContactInformation.add_member(:address_line_3, Shapes::ShapeRef.new(shape: AddressLine, location_name: "AddressLine3"))
82
+ ContactInformation.add_member(:city, Shapes::ShapeRef.new(shape: City, required: true, location_name: "City"))
83
+ ContactInformation.add_member(:company_name, Shapes::ShapeRef.new(shape: CompanyName, location_name: "CompanyName"))
84
+ ContactInformation.add_member(:country_code, Shapes::ShapeRef.new(shape: CountryCode, required: true, location_name: "CountryCode"))
85
+ ContactInformation.add_member(:district_or_county, Shapes::ShapeRef.new(shape: DistrictOrCounty, location_name: "DistrictOrCounty"))
86
+ ContactInformation.add_member(:full_name, Shapes::ShapeRef.new(shape: FullName, required: true, location_name: "FullName"))
87
+ ContactInformation.add_member(:phone_number, Shapes::ShapeRef.new(shape: ContactInformationPhoneNumber, required: true, location_name: "PhoneNumber"))
88
+ ContactInformation.add_member(:postal_code, Shapes::ShapeRef.new(shape: PostalCode, required: true, location_name: "PostalCode"))
89
+ ContactInformation.add_member(:state_or_region, Shapes::ShapeRef.new(shape: StateOrRegion, location_name: "StateOrRegion"))
90
+ ContactInformation.add_member(:website_url, Shapes::ShapeRef.new(shape: WebsiteUrl, location_name: "WebsiteUrl"))
91
+ ContactInformation.struct_class = Types::ContactInformation
92
+
44
93
  DeleteAlternateContactRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "AccountId"))
45
94
  DeleteAlternateContactRequest.add_member(:alternate_contact_type, Shapes::ShapeRef.new(shape: AlternateContactType, required: true, location_name: "AlternateContactType"))
46
95
  DeleteAlternateContactRequest.struct_class = Types::DeleteAlternateContactRequest
47
96
 
97
+ DisableRegionRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "AccountId"))
98
+ DisableRegionRequest.add_member(:region_name, Shapes::ShapeRef.new(shape: RegionName, required: true, location_name: "RegionName"))
99
+ DisableRegionRequest.struct_class = Types::DisableRegionRequest
100
+
101
+ EnableRegionRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "AccountId"))
102
+ EnableRegionRequest.add_member(:region_name, Shapes::ShapeRef.new(shape: RegionName, required: true, location_name: "RegionName"))
103
+ EnableRegionRequest.struct_class = Types::EnableRegionRequest
104
+
48
105
  GetAlternateContactRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "AccountId"))
49
106
  GetAlternateContactRequest.add_member(:alternate_contact_type, Shapes::ShapeRef.new(shape: AlternateContactType, required: true, location_name: "AlternateContactType"))
50
107
  GetAlternateContactRequest.struct_class = Types::GetAlternateContactRequest
@@ -52,9 +109,33 @@ module Aws::Account
52
109
  GetAlternateContactResponse.add_member(:alternate_contact, Shapes::ShapeRef.new(shape: AlternateContact, location_name: "AlternateContact"))
53
110
  GetAlternateContactResponse.struct_class = Types::GetAlternateContactResponse
54
111
 
112
+ GetContactInformationRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "AccountId"))
113
+ GetContactInformationRequest.struct_class = Types::GetContactInformationRequest
114
+
115
+ GetContactInformationResponse.add_member(:contact_information, Shapes::ShapeRef.new(shape: ContactInformation, location_name: "ContactInformation"))
116
+ GetContactInformationResponse.struct_class = Types::GetContactInformationResponse
117
+
118
+ GetRegionOptStatusRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "AccountId"))
119
+ GetRegionOptStatusRequest.add_member(:region_name, Shapes::ShapeRef.new(shape: RegionName, required: true, location_name: "RegionName"))
120
+ GetRegionOptStatusRequest.struct_class = Types::GetRegionOptStatusRequest
121
+
122
+ GetRegionOptStatusResponse.add_member(:region_name, Shapes::ShapeRef.new(shape: RegionName, location_name: "RegionName"))
123
+ GetRegionOptStatusResponse.add_member(:region_opt_status, Shapes::ShapeRef.new(shape: RegionOptStatus, location_name: "RegionOptStatus"))
124
+ GetRegionOptStatusResponse.struct_class = Types::GetRegionOptStatusResponse
125
+
55
126
  InternalServerException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
56
127
  InternalServerException.struct_class = Types::InternalServerException
57
128
 
129
+ ListRegionsRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "AccountId"))
130
+ ListRegionsRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: ListRegionsRequestMaxResultsInteger, location_name: "MaxResults"))
131
+ ListRegionsRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: ListRegionsRequestNextTokenString, location_name: "NextToken"))
132
+ ListRegionsRequest.add_member(:region_opt_status_contains, Shapes::ShapeRef.new(shape: RegionOptStatusList, location_name: "RegionOptStatusContains"))
133
+ ListRegionsRequest.struct_class = Types::ListRegionsRequest
134
+
135
+ ListRegionsResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: String, location_name: "NextToken"))
136
+ ListRegionsResponse.add_member(:regions, Shapes::ShapeRef.new(shape: RegionOptList, location_name: "Regions"))
137
+ ListRegionsResponse.struct_class = Types::ListRegionsResponse
138
+
58
139
  PutAlternateContactRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "AccountId"))
59
140
  PutAlternateContactRequest.add_member(:alternate_contact_type, Shapes::ShapeRef.new(shape: AlternateContactType, required: true, location_name: "AlternateContactType"))
60
141
  PutAlternateContactRequest.add_member(:email_address, Shapes::ShapeRef.new(shape: EmailAddress, required: true, location_name: "EmailAddress"))
@@ -63,15 +144,35 @@ module Aws::Account
63
144
  PutAlternateContactRequest.add_member(:title, Shapes::ShapeRef.new(shape: Title, required: true, location_name: "Title"))
64
145
  PutAlternateContactRequest.struct_class = Types::PutAlternateContactRequest
65
146
 
147
+ PutContactInformationRequest.add_member(:account_id, Shapes::ShapeRef.new(shape: AccountId, location_name: "AccountId"))
148
+ PutContactInformationRequest.add_member(:contact_information, Shapes::ShapeRef.new(shape: ContactInformation, required: true, location_name: "ContactInformation"))
149
+ PutContactInformationRequest.struct_class = Types::PutContactInformationRequest
150
+
151
+ Region.add_member(:region_name, Shapes::ShapeRef.new(shape: RegionName, location_name: "RegionName"))
152
+ Region.add_member(:region_opt_status, Shapes::ShapeRef.new(shape: RegionOptStatus, location_name: "RegionOptStatus"))
153
+ Region.struct_class = Types::Region
154
+
155
+ RegionOptList.member = Shapes::ShapeRef.new(shape: Region)
156
+
157
+ RegionOptStatusList.member = Shapes::ShapeRef.new(shape: RegionOptStatus)
158
+
66
159
  ResourceNotFoundException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
67
160
  ResourceNotFoundException.struct_class = Types::ResourceNotFoundException
68
161
 
69
162
  TooManyRequestsException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
70
163
  TooManyRequestsException.struct_class = Types::TooManyRequestsException
71
164
 
72
- ValidationException.add_member(:message, Shapes::ShapeRef.new(shape: String, required: true, location_name: "message"))
165
+ ValidationException.add_member(:field_list, Shapes::ShapeRef.new(shape: ValidationExceptionFieldList, location_name: "fieldList"))
166
+ ValidationException.add_member(:message, Shapes::ShapeRef.new(shape: SensitiveString, required: true, location_name: "message"))
167
+ ValidationException.add_member(:reason, Shapes::ShapeRef.new(shape: ValidationExceptionReason, location_name: "reason"))
73
168
  ValidationException.struct_class = Types::ValidationException
74
169
 
170
+ ValidationExceptionField.add_member(:message, Shapes::ShapeRef.new(shape: SensitiveString, required: true, location_name: "message"))
171
+ ValidationExceptionField.add_member(:name, Shapes::ShapeRef.new(shape: String, required: true, location_name: "name"))
172
+ ValidationExceptionField.struct_class = Types::ValidationExceptionField
173
+
174
+ ValidationExceptionFieldList.member = Shapes::ShapeRef.new(shape: ValidationExceptionField)
175
+
75
176
 
76
177
  # @api private
77
178
  API = Seahorse::Model::Api.new.tap do |api|
@@ -103,6 +204,32 @@ module Aws::Account
103
204
  o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
104
205
  end)
105
206
 
207
+ api.add_operation(:disable_region, Seahorse::Model::Operation.new.tap do |o|
208
+ o.name = "DisableRegion"
209
+ o.http_method = "POST"
210
+ o.http_request_uri = "/disableRegion"
211
+ o.input = Shapes::ShapeRef.new(shape: DisableRegionRequest)
212
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
213
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
214
+ o.errors << Shapes::ShapeRef.new(shape: ConflictException)
215
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
216
+ o.errors << Shapes::ShapeRef.new(shape: TooManyRequestsException)
217
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
218
+ end)
219
+
220
+ api.add_operation(:enable_region, Seahorse::Model::Operation.new.tap do |o|
221
+ o.name = "EnableRegion"
222
+ o.http_method = "POST"
223
+ o.http_request_uri = "/enableRegion"
224
+ o.input = Shapes::ShapeRef.new(shape: EnableRegionRequest)
225
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
226
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
227
+ o.errors << Shapes::ShapeRef.new(shape: ConflictException)
228
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
229
+ o.errors << Shapes::ShapeRef.new(shape: TooManyRequestsException)
230
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
231
+ end)
232
+
106
233
  api.add_operation(:get_alternate_contact, Seahorse::Model::Operation.new.tap do |o|
107
234
  o.name = "GetAlternateContact"
108
235
  o.http_method = "POST"
@@ -116,6 +243,49 @@ module Aws::Account
116
243
  o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
117
244
  end)
118
245
 
246
+ api.add_operation(:get_contact_information, Seahorse::Model::Operation.new.tap do |o|
247
+ o.name = "GetContactInformation"
248
+ o.http_method = "POST"
249
+ o.http_request_uri = "/getContactInformation"
250
+ o.input = Shapes::ShapeRef.new(shape: GetContactInformationRequest)
251
+ o.output = Shapes::ShapeRef.new(shape: GetContactInformationResponse)
252
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
253
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
254
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
255
+ o.errors << Shapes::ShapeRef.new(shape: TooManyRequestsException)
256
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
257
+ end)
258
+
259
+ api.add_operation(:get_region_opt_status, Seahorse::Model::Operation.new.tap do |o|
260
+ o.name = "GetRegionOptStatus"
261
+ o.http_method = "POST"
262
+ o.http_request_uri = "/getRegionOptStatus"
263
+ o.input = Shapes::ShapeRef.new(shape: GetRegionOptStatusRequest)
264
+ o.output = Shapes::ShapeRef.new(shape: GetRegionOptStatusResponse)
265
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
266
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
267
+ o.errors << Shapes::ShapeRef.new(shape: TooManyRequestsException)
268
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
269
+ end)
270
+
271
+ api.add_operation(:list_regions, Seahorse::Model::Operation.new.tap do |o|
272
+ o.name = "ListRegions"
273
+ o.http_method = "POST"
274
+ o.http_request_uri = "/listRegions"
275
+ o.input = Shapes::ShapeRef.new(shape: ListRegionsRequest)
276
+ o.output = Shapes::ShapeRef.new(shape: ListRegionsResponse)
277
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
278
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
279
+ o.errors << Shapes::ShapeRef.new(shape: TooManyRequestsException)
280
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
281
+ o[:pager] = Aws::Pager.new(
282
+ limit_key: "max_results",
283
+ tokens: {
284
+ "next_token" => "next_token"
285
+ }
286
+ )
287
+ end)
288
+
119
289
  api.add_operation(:put_alternate_contact, Seahorse::Model::Operation.new.tap do |o|
120
290
  o.name = "PutAlternateContact"
121
291
  o.http_method = "POST"
@@ -127,6 +297,18 @@ module Aws::Account
127
297
  o.errors << Shapes::ShapeRef.new(shape: TooManyRequestsException)
128
298
  o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
129
299
  end)
300
+
301
+ api.add_operation(:put_contact_information, Seahorse::Model::Operation.new.tap do |o|
302
+ o.name = "PutContactInformation"
303
+ o.http_method = "POST"
304
+ o.http_request_uri = "/putContactInformation"
305
+ o.input = Shapes::ShapeRef.new(shape: PutContactInformationRequest)
306
+ o.output = Shapes::ShapeRef.new(shape: Shapes::StructureShape.new(struct_class: Aws::EmptyStructure))
307
+ o.errors << Shapes::ShapeRef.new(shape: ValidationException)
308
+ o.errors << Shapes::ShapeRef.new(shape: AccessDeniedException)
309
+ o.errors << Shapes::ShapeRef.new(shape: TooManyRequestsException)
310
+ o.errors << Shapes::ShapeRef.new(shape: InternalServerException)
311
+ end)
130
312
  end
131
313
 
132
314
  end
@@ -0,0 +1,66 @@
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::Account
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
+ if self[:use_dual_stack].nil?
56
+ raise ArgumentError, "Missing required EndpointParameter: :use_dual_stack"
57
+ end
58
+ self[:use_fips] = options[:use_fips]
59
+ self[:use_fips] = false if self[:use_fips].nil?
60
+ if self[:use_fips].nil?
61
+ raise ArgumentError, "Missing required EndpointParameter: :use_fips"
62
+ end
63
+ self[:endpoint] = options[:endpoint]
64
+ end
65
+ end
66
+ end
@@ -0,0 +1,60 @@
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::Account
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.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws") && Aws::Endpoints::Matchers.boolean_equals?(use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, false)
29
+ return Aws::Endpoints::Endpoint.new(url: "https://account.us-east-1.amazonaws.com", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"account", "signingRegion"=>"us-east-1"}]})
30
+ end
31
+ if Aws::Endpoints::Matchers.string_equals?(Aws::Endpoints::Matchers.attr(partition_result, "name"), "aws-cn") && Aws::Endpoints::Matchers.boolean_equals?(use_fips, false) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, false)
32
+ return Aws::Endpoints::Endpoint.new(url: "https://account.cn-northwest-1.amazonaws.com.cn", headers: {}, properties: {"authSchemes"=>[{"name"=>"sigv4", "signingName"=>"account", "signingRegion"=>"cn-northwest-1"}]})
33
+ end
34
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
35
+ 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"))
36
+ return Aws::Endpoints::Endpoint.new(url: "https://account-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
37
+ end
38
+ raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
39
+ end
40
+ if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true)
41
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsFIPS"))
42
+ return Aws::Endpoints::Endpoint.new(url: "https://account-fips.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
43
+ end
44
+ raise ArgumentError, "FIPS is enabled but this partition does not support FIPS"
45
+ end
46
+ if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
47
+ if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
48
+ return Aws::Endpoints::Endpoint.new(url: "https://account.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
49
+ end
50
+ raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
51
+ end
52
+ return Aws::Endpoints::Endpoint.new(url: "https://account.#{region}.#{partition_result['dnsSuffix']}", headers: {}, properties: {})
53
+ end
54
+ end
55
+ raise ArgumentError, "Invalid Configuration: Missing Region"
56
+ raise ArgumentError, 'No endpoint could be resolved'
57
+
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,142 @@
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::Account
12
+ # @api private
13
+ module Endpoints
14
+
15
+ class DeleteAlternateContact
16
+ def self.build(context)
17
+ unless context.config.regional_endpoint
18
+ endpoint = context.config.endpoint.to_s
19
+ end
20
+ Aws::Account::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 DisableRegion
30
+ def self.build(context)
31
+ unless context.config.regional_endpoint
32
+ endpoint = context.config.endpoint.to_s
33
+ end
34
+ Aws::Account::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 EnableRegion
44
+ def self.build(context)
45
+ unless context.config.regional_endpoint
46
+ endpoint = context.config.endpoint.to_s
47
+ end
48
+ Aws::Account::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 GetAlternateContact
58
+ def self.build(context)
59
+ unless context.config.regional_endpoint
60
+ endpoint = context.config.endpoint.to_s
61
+ end
62
+ Aws::Account::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 GetContactInformation
72
+ def self.build(context)
73
+ unless context.config.regional_endpoint
74
+ endpoint = context.config.endpoint.to_s
75
+ end
76
+ Aws::Account::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 GetRegionOptStatus
86
+ def self.build(context)
87
+ unless context.config.regional_endpoint
88
+ endpoint = context.config.endpoint.to_s
89
+ end
90
+ Aws::Account::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 ListRegions
100
+ def self.build(context)
101
+ unless context.config.regional_endpoint
102
+ endpoint = context.config.endpoint.to_s
103
+ end
104
+ Aws::Account::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 PutAlternateContact
114
+ def self.build(context)
115
+ unless context.config.regional_endpoint
116
+ endpoint = context.config.endpoint.to_s
117
+ end
118
+ Aws::Account::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 PutContactInformation
128
+ def self.build(context)
129
+ unless context.config.regional_endpoint
130
+ endpoint = context.config.endpoint.to_s
131
+ end
132
+ Aws::Account::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
+ end
142
+ end
@@ -28,6 +28,7 @@ module Aws::Account
28
28
  #
29
29
  # ## Error Classes
30
30
  # * {AccessDeniedException}
31
+ # * {ConflictException}
31
32
  # * {InternalServerException}
32
33
  # * {ResourceNotFoundException}
33
34
  # * {TooManyRequestsException}
@@ -54,6 +55,21 @@ module Aws::Account
54
55
  end
55
56
  end
56
57
 
58
+ class ConflictException < ServiceError
59
+
60
+ # @param [Seahorse::Client::RequestContext] context
61
+ # @param [String] message
62
+ # @param [Aws::Account::Types::ConflictException] data
63
+ def initialize(context, message, data = Aws::EmptyStructure.new)
64
+ super(context, message, data)
65
+ end
66
+
67
+ # @return [String]
68
+ def message
69
+ @message || @data[:message]
70
+ end
71
+ end
72
+
57
73
  class InternalServerException < ServiceError
58
74
 
59
75
  # @param [Seahorse::Client::RequestContext] context
@@ -120,10 +136,20 @@ module Aws::Account
120
136
  super(context, message, data)
121
137
  end
122
138
 
139
+ # @return [String]
140
+ def field_list
141
+ @data[:field_list]
142
+ end
143
+
123
144
  # @return [String]
124
145
  def message
125
146
  @message || @data[:message]
126
147
  end
148
+
149
+ # @return [String]
150
+ def reason
151
+ @data[:reason]
152
+ end
127
153
  end
128
154
 
129
155
  end
@@ -0,0 +1,86 @@
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::Account
12
+ module Plugins
13
+ class Endpoints < Seahorse::Client::Plugin
14
+ option(
15
+ :endpoint_provider,
16
+ doc_type: 'Aws::Account::EndpointProvider',
17
+ docstring: 'The endpoint provider used to resolve endpoints. Any '\
18
+ 'object that responds to `#resolve_endpoint(parameters)` '\
19
+ 'where `parameters` is a Struct similar to '\
20
+ '`Aws::Account::EndpointParameters`'
21
+ ) do |cfg|
22
+ Aws::Account::EndpointProvider.new
23
+ end
24
+
25
+ # @api private
26
+ class Handler < Seahorse::Client::Handler
27
+ def call(context)
28
+ # If endpoint was discovered, do not resolve or apply the endpoint.
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
+ end
36
+
37
+ context[:endpoint_params] = params
38
+ context[:auth_scheme] =
39
+ Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
+
41
+ @handler.call(context)
42
+ end
43
+
44
+ private
45
+
46
+ def apply_endpoint_headers(context, headers)
47
+ headers.each do |key, values|
48
+ value = values
49
+ .compact
50
+ .map { |s| Seahorse::Util.escape_header_list_string(s.to_s) }
51
+ .join(',')
52
+
53
+ context.http_request.headers[key] = value
54
+ end
55
+ end
56
+
57
+ def parameters_for_operation(context)
58
+ case context.operation_name
59
+ when :delete_alternate_contact
60
+ Aws::Account::Endpoints::DeleteAlternateContact.build(context)
61
+ when :disable_region
62
+ Aws::Account::Endpoints::DisableRegion.build(context)
63
+ when :enable_region
64
+ Aws::Account::Endpoints::EnableRegion.build(context)
65
+ when :get_alternate_contact
66
+ Aws::Account::Endpoints::GetAlternateContact.build(context)
67
+ when :get_contact_information
68
+ Aws::Account::Endpoints::GetContactInformation.build(context)
69
+ when :get_region_opt_status
70
+ Aws::Account::Endpoints::GetRegionOptStatus.build(context)
71
+ when :list_regions
72
+ Aws::Account::Endpoints::ListRegions.build(context)
73
+ when :put_alternate_contact
74
+ Aws::Account::Endpoints::PutAlternateContact.build(context)
75
+ when :put_contact_information
76
+ Aws::Account::Endpoints::PutContactInformation.build(context)
77
+ end
78
+ end
79
+ end
80
+
81
+ def add_handlers(handlers, _config)
82
+ handlers.add(Handler, step: :build, priority: 75)
83
+ end
84
+ end
85
+ end
86
+ end