aws-sdk-secretsmanager 1.84.0 → 1.110.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.
@@ -7,14 +7,19 @@
7
7
  #
8
8
  # WARNING ABOUT GENERATED CODE
9
9
 
10
+
10
11
  module Aws::SecretsManager
11
12
  # @api private
12
13
  module ClientApi
13
14
 
14
15
  include Seahorse::Model
15
16
 
17
+ APIErrorListType = Shapes::ListShape.new(name: 'APIErrorListType')
18
+ APIErrorType = Shapes::StructureShape.new(name: 'APIErrorType')
16
19
  AddReplicaRegionListType = Shapes::ListShape.new(name: 'AddReplicaRegionListType')
17
20
  AutomaticallyRotateAfterDaysType = Shapes::IntegerShape.new(name: 'AutomaticallyRotateAfterDaysType')
21
+ BatchGetSecretValueRequest = Shapes::StructureShape.new(name: 'BatchGetSecretValueRequest')
22
+ BatchGetSecretValueResponse = Shapes::StructureShape.new(name: 'BatchGetSecretValueResponse')
18
23
  BooleanType = Shapes::BooleanShape.new(name: 'BooleanType')
19
24
  CancelRotateSecretRequest = Shapes::StructureShape.new(name: 'CancelRotateSecretRequest')
20
25
  CancelRotateSecretResponse = Shapes::StructureShape.new(name: 'CancelRotateSecretResponse')
@@ -34,6 +39,7 @@ module Aws::SecretsManager
34
39
  DescriptionType = Shapes::StringShape.new(name: 'DescriptionType')
35
40
  DurationType = Shapes::StringShape.new(name: 'DurationType')
36
41
  EncryptionFailure = Shapes::StructureShape.new(name: 'EncryptionFailure')
42
+ ErrorCode = Shapes::StringShape.new(name: 'ErrorCode')
37
43
  ErrorMessage = Shapes::StringShape.new(name: 'ErrorMessage')
38
44
  ExcludeCharactersType = Shapes::StringShape.new(name: 'ExcludeCharactersType')
39
45
  ExcludeLowercaseType = Shapes::BooleanShape.new(name: 'ExcludeLowercaseType')
@@ -67,6 +73,7 @@ module Aws::SecretsManager
67
73
  ListSecretsRequest = Shapes::StructureShape.new(name: 'ListSecretsRequest')
68
74
  ListSecretsResponse = Shapes::StructureShape.new(name: 'ListSecretsResponse')
69
75
  MalformedPolicyDocumentException = Shapes::StructureShape.new(name: 'MalformedPolicyDocumentException')
76
+ MaxResultsBatchType = Shapes::IntegerShape.new(name: 'MaxResultsBatchType')
70
77
  MaxResultsType = Shapes::IntegerShape.new(name: 'MaxResultsType')
71
78
  NameType = Shapes::StringShape.new(name: 'NameType')
72
79
  NextRotationDateType = Shapes::TimestampShape.new(name: 'NextRotationDateType')
@@ -101,14 +108,18 @@ module Aws::SecretsManager
101
108
  RotationEnabledType = Shapes::BooleanShape.new(name: 'RotationEnabledType')
102
109
  RotationLambdaARNType = Shapes::StringShape.new(name: 'RotationLambdaARNType')
103
110
  RotationRulesType = Shapes::StructureShape.new(name: 'RotationRulesType')
111
+ RotationTokenType = Shapes::StringShape.new(name: 'RotationTokenType')
104
112
  ScheduleExpressionType = Shapes::StringShape.new(name: 'ScheduleExpressionType')
105
113
  SecretARNType = Shapes::StringShape.new(name: 'SecretARNType')
106
114
  SecretBinaryType = Shapes::BlobShape.new(name: 'SecretBinaryType')
115
+ SecretIdListType = Shapes::ListShape.new(name: 'SecretIdListType')
107
116
  SecretIdType = Shapes::StringShape.new(name: 'SecretIdType')
108
117
  SecretListEntry = Shapes::StructureShape.new(name: 'SecretListEntry')
109
118
  SecretListType = Shapes::ListShape.new(name: 'SecretListType')
110
119
  SecretNameType = Shapes::StringShape.new(name: 'SecretNameType')
111
120
  SecretStringType = Shapes::StringShape.new(name: 'SecretStringType')
121
+ SecretValueEntry = Shapes::StructureShape.new(name: 'SecretValueEntry')
122
+ SecretValuesType = Shapes::ListShape.new(name: 'SecretValuesType')
112
123
  SecretVersionIdType = Shapes::StringShape.new(name: 'SecretVersionIdType')
113
124
  SecretVersionStageType = Shapes::StringShape.new(name: 'SecretVersionStageType')
114
125
  SecretVersionStagesType = Shapes::ListShape.new(name: 'SecretVersionStagesType')
@@ -137,8 +148,26 @@ module Aws::SecretsManager
137
148
  ValidationErrorsEntry = Shapes::StructureShape.new(name: 'ValidationErrorsEntry')
138
149
  ValidationErrorsType = Shapes::ListShape.new(name: 'ValidationErrorsType')
139
150
 
151
+ APIErrorListType.member = Shapes::ShapeRef.new(shape: APIErrorType)
152
+
153
+ APIErrorType.add_member(:secret_id, Shapes::ShapeRef.new(shape: SecretIdType, location_name: "SecretId"))
154
+ APIErrorType.add_member(:error_code, Shapes::ShapeRef.new(shape: ErrorCode, location_name: "ErrorCode"))
155
+ APIErrorType.add_member(:message, Shapes::ShapeRef.new(shape: ErrorMessage, location_name: "Message"))
156
+ APIErrorType.struct_class = Types::APIErrorType
157
+
140
158
  AddReplicaRegionListType.member = Shapes::ShapeRef.new(shape: ReplicaRegionType)
141
159
 
160
+ BatchGetSecretValueRequest.add_member(:secret_id_list, Shapes::ShapeRef.new(shape: SecretIdListType, location_name: "SecretIdList"))
161
+ BatchGetSecretValueRequest.add_member(:filters, Shapes::ShapeRef.new(shape: FiltersListType, location_name: "Filters"))
162
+ BatchGetSecretValueRequest.add_member(:max_results, Shapes::ShapeRef.new(shape: MaxResultsBatchType, location_name: "MaxResults", metadata: {"box"=>true}))
163
+ BatchGetSecretValueRequest.add_member(:next_token, Shapes::ShapeRef.new(shape: NextTokenType, location_name: "NextToken"))
164
+ BatchGetSecretValueRequest.struct_class = Types::BatchGetSecretValueRequest
165
+
166
+ BatchGetSecretValueResponse.add_member(:secret_values, Shapes::ShapeRef.new(shape: SecretValuesType, location_name: "SecretValues"))
167
+ BatchGetSecretValueResponse.add_member(:next_token, Shapes::ShapeRef.new(shape: NextTokenType, location_name: "NextToken"))
168
+ BatchGetSecretValueResponse.add_member(:errors, Shapes::ShapeRef.new(shape: APIErrorListType, location_name: "Errors"))
169
+ BatchGetSecretValueResponse.struct_class = Types::BatchGetSecretValueResponse
170
+
142
171
  CancelRotateSecretRequest.add_member(:secret_id, Shapes::ShapeRef.new(shape: SecretIdType, required: true, location_name: "SecretId"))
143
172
  CancelRotateSecretRequest.struct_class = Types::CancelRotateSecretRequest
144
173
 
@@ -316,6 +345,7 @@ module Aws::SecretsManager
316
345
  PutSecretValueRequest.add_member(:secret_binary, Shapes::ShapeRef.new(shape: SecretBinaryType, location_name: "SecretBinary"))
317
346
  PutSecretValueRequest.add_member(:secret_string, Shapes::ShapeRef.new(shape: SecretStringType, location_name: "SecretString"))
318
347
  PutSecretValueRequest.add_member(:version_stages, Shapes::ShapeRef.new(shape: SecretVersionStagesType, location_name: "VersionStages"))
348
+ PutSecretValueRequest.add_member(:rotation_token, Shapes::ShapeRef.new(shape: RotationTokenType, location_name: "RotationToken"))
319
349
  PutSecretValueRequest.struct_class = Types::PutSecretValueRequest
320
350
 
321
351
  PutSecretValueResponse.add_member(:arn, Shapes::ShapeRef.new(shape: SecretARNType, location_name: "ARN"))
@@ -386,6 +416,8 @@ module Aws::SecretsManager
386
416
  RotationRulesType.add_member(:schedule_expression, Shapes::ShapeRef.new(shape: ScheduleExpressionType, location_name: "ScheduleExpression"))
387
417
  RotationRulesType.struct_class = Types::RotationRulesType
388
418
 
419
+ SecretIdListType.member = Shapes::ShapeRef.new(shape: SecretIdType)
420
+
389
421
  SecretListEntry.add_member(:arn, Shapes::ShapeRef.new(shape: SecretARNType, location_name: "ARN"))
390
422
  SecretListEntry.add_member(:name, Shapes::ShapeRef.new(shape: SecretNameType, location_name: "Name"))
391
423
  SecretListEntry.add_member(:description, Shapes::ShapeRef.new(shape: DescriptionType, location_name: "Description"))
@@ -407,6 +439,17 @@ module Aws::SecretsManager
407
439
 
408
440
  SecretListType.member = Shapes::ShapeRef.new(shape: SecretListEntry)
409
441
 
442
+ SecretValueEntry.add_member(:arn, Shapes::ShapeRef.new(shape: SecretARNType, location_name: "ARN"))
443
+ SecretValueEntry.add_member(:name, Shapes::ShapeRef.new(shape: SecretNameType, location_name: "Name"))
444
+ SecretValueEntry.add_member(:version_id, Shapes::ShapeRef.new(shape: SecretVersionIdType, location_name: "VersionId"))
445
+ SecretValueEntry.add_member(:secret_binary, Shapes::ShapeRef.new(shape: SecretBinaryType, location_name: "SecretBinary"))
446
+ SecretValueEntry.add_member(:secret_string, Shapes::ShapeRef.new(shape: SecretStringType, location_name: "SecretString"))
447
+ SecretValueEntry.add_member(:version_stages, Shapes::ShapeRef.new(shape: SecretVersionStagesType, location_name: "VersionStages"))
448
+ SecretValueEntry.add_member(:created_date, Shapes::ShapeRef.new(shape: CreatedDateType, location_name: "CreatedDate", metadata: {"box"=>true}))
449
+ SecretValueEntry.struct_class = Types::SecretValueEntry
450
+
451
+ SecretValuesType.member = Shapes::ShapeRef.new(shape: SecretValueEntry)
452
+
410
453
  SecretVersionStagesType.member = Shapes::ShapeRef.new(shape: SecretVersionStageType)
411
454
 
412
455
  SecretVersionsListEntry.add_member(:version_id, Shapes::ShapeRef.new(shape: SecretVersionIdType, location_name: "VersionId"))
@@ -488,9 +531,11 @@ module Aws::SecretsManager
488
531
 
489
532
  api.metadata = {
490
533
  "apiVersion" => "2017-10-17",
534
+ "auth" => ["aws.auth#sigv4"],
491
535
  "endpointPrefix" => "secretsmanager",
492
536
  "jsonVersion" => "1.1",
493
537
  "protocol" => "json",
538
+ "protocols" => ["json"],
494
539
  "serviceFullName" => "AWS Secrets Manager",
495
540
  "serviceId" => "Secrets Manager",
496
541
  "signatureVersion" => "v4",
@@ -499,6 +544,26 @@ module Aws::SecretsManager
499
544
  "uid" => "secretsmanager-2017-10-17",
500
545
  }
501
546
 
547
+ api.add_operation(:batch_get_secret_value, Seahorse::Model::Operation.new.tap do |o|
548
+ o.name = "BatchGetSecretValue"
549
+ o.http_method = "POST"
550
+ o.http_request_uri = "/"
551
+ o.input = Shapes::ShapeRef.new(shape: BatchGetSecretValueRequest)
552
+ o.output = Shapes::ShapeRef.new(shape: BatchGetSecretValueResponse)
553
+ o.errors << Shapes::ShapeRef.new(shape: ResourceNotFoundException)
554
+ o.errors << Shapes::ShapeRef.new(shape: InvalidParameterException)
555
+ o.errors << Shapes::ShapeRef.new(shape: InvalidRequestException)
556
+ o.errors << Shapes::ShapeRef.new(shape: DecryptionFailure)
557
+ o.errors << Shapes::ShapeRef.new(shape: InternalServiceError)
558
+ o.errors << Shapes::ShapeRef.new(shape: InvalidNextTokenException)
559
+ o[:pager] = Aws::Pager.new(
560
+ limit_key: "max_results",
561
+ tokens: {
562
+ "next_token" => "next_token"
563
+ }
564
+ )
565
+ end)
566
+
502
567
  api.add_operation(:cancel_rotate_secret, Seahorse::Model::Operation.new.tap do |o|
503
568
  o.name = "CancelRotateSecret"
504
569
  o.http_method = "POST"
@@ -52,15 +52,18 @@ module Aws::SecretsManager
52
52
  self[:region] = options[:region]
53
53
  self[:use_dual_stack] = options[:use_dual_stack]
54
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
55
  self[:use_fips] = options[:use_fips]
59
56
  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
57
  self[:endpoint] = options[:endpoint]
64
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
65
68
  end
66
69
  end
@@ -27,6 +27,12 @@ module Aws::SecretsManager
27
27
  if (partition_result = Aws::Endpoints::Matchers.aws_partition(region))
28
28
  if Aws::Endpoints::Matchers.boolean_equals?(use_fips, true) && Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
29
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
+ if Aws::Endpoints::Matchers.string_equals?("aws", Aws::Endpoints::Matchers.attr(partition_result, "name"))
31
+ return Aws::Endpoints::Endpoint.new(url: "https://secretsmanager-fips.#{region}.amazonaws.com", headers: {}, properties: {})
32
+ end
33
+ if Aws::Endpoints::Matchers.string_equals?("aws-us-gov", Aws::Endpoints::Matchers.attr(partition_result, "name"))
34
+ return Aws::Endpoints::Endpoint.new(url: "https://secretsmanager-fips.#{region}.amazonaws.com", headers: {}, properties: {})
35
+ end
30
36
  return Aws::Endpoints::Endpoint.new(url: "https://secretsmanager-fips.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
31
37
  end
32
38
  raise ArgumentError, "FIPS and DualStack are enabled, but this partition does not support one or both"
@@ -39,6 +45,15 @@ module Aws::SecretsManager
39
45
  end
40
46
  if Aws::Endpoints::Matchers.boolean_equals?(use_dual_stack, true)
41
47
  if Aws::Endpoints::Matchers.boolean_equals?(true, Aws::Endpoints::Matchers.attr(partition_result, "supportsDualStack"))
48
+ if Aws::Endpoints::Matchers.string_equals?("aws", Aws::Endpoints::Matchers.attr(partition_result, "name"))
49
+ return Aws::Endpoints::Endpoint.new(url: "https://secretsmanager.#{region}.amazonaws.com", headers: {}, properties: {})
50
+ end
51
+ if Aws::Endpoints::Matchers.string_equals?("aws-cn", Aws::Endpoints::Matchers.attr(partition_result, "name"))
52
+ return Aws::Endpoints::Endpoint.new(url: "https://secretsmanager.#{region}.amazonaws.com.cn", headers: {}, properties: {})
53
+ end
54
+ if Aws::Endpoints::Matchers.string_equals?("aws-us-gov", Aws::Endpoints::Matchers.attr(partition_result, "name"))
55
+ return Aws::Endpoints::Endpoint.new(url: "https://secretsmanager.#{region}.amazonaws.com", headers: {}, properties: {})
56
+ end
42
57
  return Aws::Endpoints::Endpoint.new(url: "https://secretsmanager.#{region}.#{partition_result['dualStackDnsSuffix']}", headers: {}, properties: {})
43
58
  end
44
59
  raise ArgumentError, "DualStack is enabled but this partition does not support DualStack"
@@ -12,313 +12,9 @@ module Aws::SecretsManager
12
12
  # @api private
13
13
  module Endpoints
14
14
 
15
- class CancelRotateSecret
16
- def self.build(context)
17
- unless context.config.regional_endpoint
18
- endpoint = context.config.endpoint.to_s
19
- end
20
- Aws::SecretsManager::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 CreateSecret
30
- def self.build(context)
31
- unless context.config.regional_endpoint
32
- endpoint = context.config.endpoint.to_s
33
- end
34
- Aws::SecretsManager::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 DeleteResourcePolicy
44
- def self.build(context)
45
- unless context.config.regional_endpoint
46
- endpoint = context.config.endpoint.to_s
47
- end
48
- Aws::SecretsManager::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 DeleteSecret
58
- def self.build(context)
59
- unless context.config.regional_endpoint
60
- endpoint = context.config.endpoint.to_s
61
- end
62
- Aws::SecretsManager::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 DescribeSecret
72
- def self.build(context)
73
- unless context.config.regional_endpoint
74
- endpoint = context.config.endpoint.to_s
75
- end
76
- Aws::SecretsManager::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 GetRandomPassword
86
- def self.build(context)
87
- unless context.config.regional_endpoint
88
- endpoint = context.config.endpoint.to_s
89
- end
90
- Aws::SecretsManager::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 GetResourcePolicy
100
- def self.build(context)
101
- unless context.config.regional_endpoint
102
- endpoint = context.config.endpoint.to_s
103
- end
104
- Aws::SecretsManager::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 GetSecretValue
114
- def self.build(context)
115
- unless context.config.regional_endpoint
116
- endpoint = context.config.endpoint.to_s
117
- end
118
- Aws::SecretsManager::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 ListSecretVersionIds
128
- def self.build(context)
129
- unless context.config.regional_endpoint
130
- endpoint = context.config.endpoint.to_s
131
- end
132
- Aws::SecretsManager::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 ListSecrets
142
- def self.build(context)
143
- unless context.config.regional_endpoint
144
- endpoint = context.config.endpoint.to_s
145
- end
146
- Aws::SecretsManager::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 PutResourcePolicy
156
- def self.build(context)
157
- unless context.config.regional_endpoint
158
- endpoint = context.config.endpoint.to_s
159
- end
160
- Aws::SecretsManager::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
15
 
169
- class PutSecretValue
170
- def self.build(context)
171
- unless context.config.regional_endpoint
172
- endpoint = context.config.endpoint.to_s
173
- end
174
- Aws::SecretsManager::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
16
+ def self.parameters_for_operation(context)
17
+ Aws::SecretsManager::EndpointParameters.create(context.config)
181
18
  end
182
-
183
- class RemoveRegionsFromReplication
184
- def self.build(context)
185
- unless context.config.regional_endpoint
186
- endpoint = context.config.endpoint.to_s
187
- end
188
- Aws::SecretsManager::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 ReplicateSecretToRegions
198
- def self.build(context)
199
- unless context.config.regional_endpoint
200
- endpoint = context.config.endpoint.to_s
201
- end
202
- Aws::SecretsManager::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 RestoreSecret
212
- def self.build(context)
213
- unless context.config.regional_endpoint
214
- endpoint = context.config.endpoint.to_s
215
- end
216
- Aws::SecretsManager::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 RotateSecret
226
- def self.build(context)
227
- unless context.config.regional_endpoint
228
- endpoint = context.config.endpoint.to_s
229
- end
230
- Aws::SecretsManager::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
- class StopReplicationToReplica
240
- def self.build(context)
241
- unless context.config.regional_endpoint
242
- endpoint = context.config.endpoint.to_s
243
- end
244
- Aws::SecretsManager::EndpointParameters.new(
245
- region: context.config.region,
246
- use_dual_stack: context.config.use_dualstack_endpoint,
247
- use_fips: context.config.use_fips_endpoint,
248
- endpoint: endpoint,
249
- )
250
- end
251
- end
252
-
253
- class TagResource
254
- def self.build(context)
255
- unless context.config.regional_endpoint
256
- endpoint = context.config.endpoint.to_s
257
- end
258
- Aws::SecretsManager::EndpointParameters.new(
259
- region: context.config.region,
260
- use_dual_stack: context.config.use_dualstack_endpoint,
261
- use_fips: context.config.use_fips_endpoint,
262
- endpoint: endpoint,
263
- )
264
- end
265
- end
266
-
267
- class UntagResource
268
- def self.build(context)
269
- unless context.config.regional_endpoint
270
- endpoint = context.config.endpoint.to_s
271
- end
272
- Aws::SecretsManager::EndpointParameters.new(
273
- region: context.config.region,
274
- use_dual_stack: context.config.use_dualstack_endpoint,
275
- use_fips: context.config.use_fips_endpoint,
276
- endpoint: endpoint,
277
- )
278
- end
279
- end
280
-
281
- class UpdateSecret
282
- def self.build(context)
283
- unless context.config.regional_endpoint
284
- endpoint = context.config.endpoint.to_s
285
- end
286
- Aws::SecretsManager::EndpointParameters.new(
287
- region: context.config.region,
288
- use_dual_stack: context.config.use_dualstack_endpoint,
289
- use_fips: context.config.use_fips_endpoint,
290
- endpoint: endpoint,
291
- )
292
- end
293
- end
294
-
295
- class UpdateSecretVersionStage
296
- def self.build(context)
297
- unless context.config.regional_endpoint
298
- endpoint = context.config.endpoint.to_s
299
- end
300
- Aws::SecretsManager::EndpointParameters.new(
301
- region: context.config.region,
302
- use_dual_stack: context.config.use_dualstack_endpoint,
303
- use_fips: context.config.use_fips_endpoint,
304
- endpoint: endpoint,
305
- )
306
- end
307
- end
308
-
309
- class ValidateResourcePolicy
310
- def self.build(context)
311
- unless context.config.regional_endpoint
312
- endpoint = context.config.endpoint.to_s
313
- end
314
- Aws::SecretsManager::EndpointParameters.new(
315
- region: context.config.region,
316
- use_dual_stack: context.config.use_dualstack_endpoint,
317
- use_fips: context.config.use_fips_endpoint,
318
- endpoint: endpoint,
319
- )
320
- end
321
- end
322
-
323
19
  end
324
20
  end
@@ -14,35 +14,49 @@ module Aws::SecretsManager
14
14
  option(
15
15
  :endpoint_provider,
16
16
  doc_type: 'Aws::SecretsManager::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::SecretsManager::EndpointParameters`'
21
- ) do |cfg|
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::SecretsManager::EndpointParameters`.
22
+ DOCS
22
23
  Aws::SecretsManager::EndpointProvider.new
23
24
  end
24
25
 
25
26
  # @api private
26
27
  class Handler < Seahorse::Client::Handler
27
28
  def call(context)
28
- # If endpoint was discovered, do not resolve or apply the endpoint.
29
29
  unless context[:discovered_endpoint]
30
- params = parameters_for_operation(context)
30
+ params = Aws::SecretsManager::Endpoints.parameters_for_operation(context)
31
31
  endpoint = context.config.endpoint_provider.resolve_endpoint(params)
32
32
 
33
33
  context.http_request.endpoint = endpoint.url
34
34
  apply_endpoint_headers(context, endpoint.headers)
35
+
36
+ context[:endpoint_params] = params
37
+ context[:endpoint_properties] = endpoint.properties
35
38
  end
36
39
 
37
- context[:endpoint_params] = params
38
40
  context[:auth_scheme] =
39
41
  Aws::Endpoints.resolve_auth_scheme(context, endpoint)
40
42
 
41
- @handler.call(context)
43
+ with_metrics(context) { @handler.call(context) }
42
44
  end
43
45
 
44
46
  private
45
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
+
46
60
  def apply_endpoint_headers(context, headers)
47
61
  headers.each do |key, values|
48
62
  value = values
@@ -53,55 +67,6 @@ module Aws::SecretsManager
53
67
  context.http_request.headers[key] = value
54
68
  end
55
69
  end
56
-
57
- def parameters_for_operation(context)
58
- case context.operation_name
59
- when :cancel_rotate_secret
60
- Aws::SecretsManager::Endpoints::CancelRotateSecret.build(context)
61
- when :create_secret
62
- Aws::SecretsManager::Endpoints::CreateSecret.build(context)
63
- when :delete_resource_policy
64
- Aws::SecretsManager::Endpoints::DeleteResourcePolicy.build(context)
65
- when :delete_secret
66
- Aws::SecretsManager::Endpoints::DeleteSecret.build(context)
67
- when :describe_secret
68
- Aws::SecretsManager::Endpoints::DescribeSecret.build(context)
69
- when :get_random_password
70
- Aws::SecretsManager::Endpoints::GetRandomPassword.build(context)
71
- when :get_resource_policy
72
- Aws::SecretsManager::Endpoints::GetResourcePolicy.build(context)
73
- when :get_secret_value
74
- Aws::SecretsManager::Endpoints::GetSecretValue.build(context)
75
- when :list_secret_version_ids
76
- Aws::SecretsManager::Endpoints::ListSecretVersionIds.build(context)
77
- when :list_secrets
78
- Aws::SecretsManager::Endpoints::ListSecrets.build(context)
79
- when :put_resource_policy
80
- Aws::SecretsManager::Endpoints::PutResourcePolicy.build(context)
81
- when :put_secret_value
82
- Aws::SecretsManager::Endpoints::PutSecretValue.build(context)
83
- when :remove_regions_from_replication
84
- Aws::SecretsManager::Endpoints::RemoveRegionsFromReplication.build(context)
85
- when :replicate_secret_to_regions
86
- Aws::SecretsManager::Endpoints::ReplicateSecretToRegions.build(context)
87
- when :restore_secret
88
- Aws::SecretsManager::Endpoints::RestoreSecret.build(context)
89
- when :rotate_secret
90
- Aws::SecretsManager::Endpoints::RotateSecret.build(context)
91
- when :stop_replication_to_replica
92
- Aws::SecretsManager::Endpoints::StopReplicationToReplica.build(context)
93
- when :tag_resource
94
- Aws::SecretsManager::Endpoints::TagResource.build(context)
95
- when :untag_resource
96
- Aws::SecretsManager::Endpoints::UntagResource.build(context)
97
- when :update_secret
98
- Aws::SecretsManager::Endpoints::UpdateSecret.build(context)
99
- when :update_secret_version_stage
100
- Aws::SecretsManager::Endpoints::UpdateSecretVersionStage.build(context)
101
- when :validate_resource_policy
102
- Aws::SecretsManager::Endpoints::ValidateResourcePolicy.build(context)
103
- end
104
- end
105
70
  end
106
71
 
107
72
  def add_handlers(handlers, _config)