Skip to content

Commit 4baefd1

Browse files
landonxjamesaws-sdk-rust-ci
authored andcommitted
[smithy-rs] Add support for operationContextParams Endpoints trait (#3755)
## Motivation and Context <!--- Why is this change required? What problem does it solve? --> <!--- If it fixes an open issue, please link to the issue here --> We have to support the new [`operationContextParams` trait](https://smithy.io/2.0/additional-specs/rules-engine/parameters.html#smithy-rules-operationcontextparams-trait) for endpoint resolution. This trait specifies JMESPath expressions for selecting parameter data from the operation's input type. ## Description <!--- Describe your changes in detail --> * Add codegen support for the [JMESPath `keys`](https://jmespath.org/specification.html#keys) function (required by the trait [spec](https://smithy.io/2.0/additional-specs/rules-engine/parameters.html#smithy-rules-operationcontextparams-trait)) * Add codegen support for the trait itself. This is achieved by generating `get_param_name` functions for each param specified in `operationContextParams`. These functions pull the data out of the input object and it is added to the endpoint params in the `${operationName}EndpointParamsInterceptor` ## Testing <!--- Please describe in detail how you tested your changes --> <!--- Include details of your testing environment, and the tests you ran to --> <!--- see how your change affects other areas of the code, etc. --> Updated the existing test suite for JMESPath codegen to test the `keys` function. Updated the existing EndpointsDecoratorTest with an `operationContextParams` trait specifying one param of each supported type to test the codegen. ## Checklist <!--- If a checkbox below is not applicable, then please DELETE it rather than leaving it unchecked --> - [x] I have updated `CHANGELOG.next.toml` if I made changes to the smithy-rs codegen or runtime crates ---- _By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice._
1 parent dd4230c commit 4baefd1

File tree

15,586 files changed

+47162
-385
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

15,586 files changed

+47162
-385
lines changed

sdk/accessanalyzer/src/operation/apply_archive_rule.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ApplyArchiveR
245245
}
246246
}
247247

248+
// The get_* functions below are generated from JMESPath expressions in the
249+
// operationContextParams trait. They target the operation's input shape.
250+
248251
/// Error type for the `ApplyArchiveRuleError` operation.
249252
#[non_exhaustive]
250253
#[derive(::std::fmt::Debug)]

sdk/accessanalyzer/src/operation/cancel_policy_generation.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,9 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CancelPolicyG
249249
}
250250
}
251251

252+
// The get_* functions below are generated from JMESPath expressions in the
253+
// operationContextParams trait. They target the operation's input shape.
254+
252255
/// Error type for the `CancelPolicyGenerationError` operation.
253256
#[non_exhaustive]
254257
#[derive(::std::fmt::Debug)]

sdk/accessanalyzer/src/operation/check_access_not_granted.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CheckAccessNo
244244
}
245245
}
246246

247+
// The get_* functions below are generated from JMESPath expressions in the
248+
// operationContextParams trait. They target the operation's input shape.
249+
247250
/// Error type for the `CheckAccessNotGrantedError` operation.
248251
#[non_exhaustive]
249252
#[derive(::std::fmt::Debug)]

sdk/accessanalyzer/src/operation/check_no_new_access.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CheckNoNewAcc
236236
}
237237
}
238238

239+
// The get_* functions below are generated from JMESPath expressions in the
240+
// operationContextParams trait. They target the operation's input shape.
241+
239242
/// Error type for the `CheckNoNewAccessError` operation.
240243
#[non_exhaustive]
241244
#[derive(::std::fmt::Debug)]

sdk/accessanalyzer/src/operation/check_no_public_access.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,9 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CheckNoPublic
244244
}
245245
}
246246

247+
// The get_* functions below are generated from JMESPath expressions in the
248+
// operationContextParams trait. They target the operation's input shape.
249+
247250
/// Error type for the `CheckNoPublicAccessError` operation.
248251
#[non_exhaustive]
249252
#[derive(::std::fmt::Debug)]

sdk/accessanalyzer/src/operation/create_access_preview.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,9 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateAccessP
253253
}
254254
}
255255

256+
// The get_* functions below are generated from JMESPath expressions in the
257+
// operationContextParams trait. They target the operation's input shape.
258+
256259
/// Error type for the `CreateAccessPreviewError` operation.
257260
#[non_exhaustive]
258261
#[derive(::std::fmt::Debug)]

sdk/accessanalyzer/src/operation/create_analyzer.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,9 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateAnalyze
245245
}
246246
}
247247

248+
// The get_* functions below are generated from JMESPath expressions in the
249+
// operationContextParams trait. They target the operation's input shape.
250+
248251
/// Error type for the `CreateAnalyzerError` operation.
249252
#[non_exhaustive]
250253
#[derive(::std::fmt::Debug)]

sdk/accessanalyzer/src/operation/create_archive_rule.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateArchive
256256
}
257257
}
258258

259+
// The get_* functions below are generated from JMESPath expressions in the
260+
// operationContextParams trait. They target the operation's input shape.
261+
259262
/// Error type for the `CreateArchiveRuleError` operation.
260263
#[non_exhaustive]
261264
#[derive(::std::fmt::Debug)]

sdk/accessanalyzer/src/operation/delete_analyzer.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteAnalyze
265265
}
266266
}
267267

268+
// The get_* functions below are generated from JMESPath expressions in the
269+
// operationContextParams trait. They target the operation's input shape.
270+
268271
/// Error type for the `DeleteAnalyzerError` operation.
269272
#[non_exhaustive]
270273
#[derive(::std::fmt::Debug)]

sdk/accessanalyzer/src/operation/delete_archive_rule.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteArchive
282282
}
283283
}
284284

285+
// The get_* functions below are generated from JMESPath expressions in the
286+
// operationContextParams trait. They target the operation's input shape.
287+
285288
/// Error type for the `DeleteArchiveRuleError` operation.
286289
#[non_exhaustive]
287290
#[derive(::std::fmt::Debug)]

0 commit comments

Comments
 (0)