diff --git a/.github/workflows/ci_check_pr.yaml b/.github/workflows/ci_check_pr.yaml index 25bab0236..06e1d7368 100644 --- a/.github/workflows/ci_check_pr.yaml +++ b/.github/workflows/ci_check_pr.yaml @@ -401,7 +401,7 @@ jobs: - name: Install Smithy CLI run: | mkdir -p smithy-install/smithy && \ - curl -L https://github.com/smithy-lang/smithy/releases/download/1.55.0/smithy-cli-linux-x86_64.zip -o smithy-install/smithy-cli-linux-x86_64.zip && \ + curl -L https://github.com/smithy-lang/smithy/releases/download/1.69.0/smithy-cli-linux-x86_64.zip -o smithy-install/smithy-cli-linux-x86_64.zip && \ unzip -qo smithy-install/smithy-cli-linux-x86_64.zip -d smithy-install && \ mv smithy-install/smithy-cli-linux-x86_64/* smithy-install/smithy/ && \ rm -rf smithy-install/smithy-cli-linux-x86_64.zip diff --git a/.gitignore b/.gitignore index 3184dc929..16f3352c0 100644 --- a/.gitignore +++ b/.gitignore @@ -77,3 +77,6 @@ clients/generated/smithy/typescript/tsconfig.* # Skill packages (zips for upload, regenerated by `make skills-update`) scripts/skill_templates/ + +# Local Maven repo with corrected smithy-rs codegen POMs (generated by `make smithy-local-repo`) +smithy/.local-m2/ diff --git a/clients/haskell/sdk/Io/Superposition/Command/BulkOperation.hs b/clients/haskell/sdk/Io/Superposition/Command/BulkOperation.hs index 58786f7d3..8d3ad6bfd 100644 --- a/clients/haskell/sdk/Io/Superposition/Command/BulkOperation.hs +++ b/clients/haskell/sdk/Io/Superposition/Command/BulkOperation.hs @@ -16,9 +16,9 @@ import qualified Io.Superposition.SuperpositionClient import qualified Io.Superposition.Utility data BulkOperationError = - InternalServerError Io.Superposition.Model.InternalServerError.InternalServerError + ResourceNotFound Io.Superposition.Model.ResourceNotFound.ResourceNotFound | WebhookFailed Io.Superposition.Model.WebhookFailed.WebhookFailed - | ResourceNotFound Io.Superposition.Model.ResourceNotFound.ResourceNotFound + | InternalServerError Io.Superposition.Model.InternalServerError.InternalServerError | BuilderError Data.Text.Text | DeSerializationError Io.Superposition.Utility.HttpMetadata Data.Text.Text | UnexpectedError (Data.Maybe.Maybe Io.Superposition.Utility.HttpMetadata) Data.Text.Text @@ -31,9 +31,9 @@ instance Io.Superposition.Utility.OperationError BulkOperationError where mkUnexpectedError = UnexpectedError getErrorParser status - | status == (Io.Superposition.Utility.expectedStatus @Io.Superposition.Model.InternalServerError.InternalServerError) = Just (fmap InternalServerError (Io.Superposition.Utility.responseParser @Io.Superposition.Model.InternalServerError.InternalServerError)) - | status == (Io.Superposition.Utility.expectedStatus @Io.Superposition.Model.WebhookFailed.WebhookFailed) = Just (fmap WebhookFailed (Io.Superposition.Utility.responseParser @Io.Superposition.Model.WebhookFailed.WebhookFailed)) | status == (Io.Superposition.Utility.expectedStatus @Io.Superposition.Model.ResourceNotFound.ResourceNotFound) = Just (fmap ResourceNotFound (Io.Superposition.Utility.responseParser @Io.Superposition.Model.ResourceNotFound.ResourceNotFound)) + | status == (Io.Superposition.Utility.expectedStatus @Io.Superposition.Model.WebhookFailed.WebhookFailed) = Just (fmap WebhookFailed (Io.Superposition.Utility.responseParser @Io.Superposition.Model.WebhookFailed.WebhookFailed)) + | status == (Io.Superposition.Utility.expectedStatus @Io.Superposition.Model.InternalServerError.InternalServerError) = Just (fmap InternalServerError (Io.Superposition.Utility.responseParser @Io.Superposition.Model.InternalServerError.InternalServerError)) | otherwise = Nothing diff --git a/clients/haskell/sdk/Io/Superposition/Command/WeightRecompute.hs b/clients/haskell/sdk/Io/Superposition/Command/WeightRecompute.hs index 1972f9c39..f160be573 100644 --- a/clients/haskell/sdk/Io/Superposition/Command/WeightRecompute.hs +++ b/clients/haskell/sdk/Io/Superposition/Command/WeightRecompute.hs @@ -15,8 +15,8 @@ import qualified Io.Superposition.SuperpositionClient import qualified Io.Superposition.Utility data WeightRecomputeError = - InternalServerError Io.Superposition.Model.InternalServerError.InternalServerError - | WebhookFailed Io.Superposition.Model.WebhookFailed.WebhookFailed + WebhookFailed Io.Superposition.Model.WebhookFailed.WebhookFailed + | InternalServerError Io.Superposition.Model.InternalServerError.InternalServerError | BuilderError Data.Text.Text | DeSerializationError Io.Superposition.Utility.HttpMetadata Data.Text.Text | UnexpectedError (Data.Maybe.Maybe Io.Superposition.Utility.HttpMetadata) Data.Text.Text @@ -29,8 +29,8 @@ instance Io.Superposition.Utility.OperationError WeightRecomputeError where mkUnexpectedError = UnexpectedError getErrorParser status - | status == (Io.Superposition.Utility.expectedStatus @Io.Superposition.Model.InternalServerError.InternalServerError) = Just (fmap InternalServerError (Io.Superposition.Utility.responseParser @Io.Superposition.Model.InternalServerError.InternalServerError)) | status == (Io.Superposition.Utility.expectedStatus @Io.Superposition.Model.WebhookFailed.WebhookFailed) = Just (fmap WebhookFailed (Io.Superposition.Utility.responseParser @Io.Superposition.Model.WebhookFailed.WebhookFailed)) + | status == (Io.Superposition.Utility.expectedStatus @Io.Superposition.Model.InternalServerError.InternalServerError) = Just (fmap InternalServerError (Io.Superposition.Utility.responseParser @Io.Superposition.Model.InternalServerError.InternalServerError)) | otherwise = Nothing diff --git a/clients/java/provider-sdk-tests/build.gradle.kts b/clients/java/provider-sdk-tests/build.gradle.kts index d32936b98..eacfa665d 100644 --- a/clients/java/provider-sdk-tests/build.gradle.kts +++ b/clients/java/provider-sdk-tests/build.gradle.kts @@ -24,7 +24,7 @@ dependencies { // Add missing Smithy dependencies implementation("software.amazon.smithy.java:client-core:0.0.1") - implementation("software.amazon.smithy:smithy-aws-traits:1.55.0") + implementation("software.amazon.smithy:smithy-aws-traits:1.69.0") implementation("software.amazon.smithy.java:aws-client-restjson:0.0.1") testImplementation("org.junit.jupiter:junit-jupiter:5.7.1") diff --git a/clients/java/sdk/build.gradle.kts b/clients/java/sdk/build.gradle.kts index 4866d0ae9..ebc3e466f 100644 --- a/clients/java/sdk/build.gradle.kts +++ b/clients/java/sdk/build.gradle.kts @@ -18,6 +18,6 @@ java { dependencies { implementation("software.amazon.smithy.java:client-core:0.0.1") - implementation("software.amazon.smithy:smithy-aws-traits:1.55.0") + implementation("software.amazon.smithy:smithy-aws-traits:1.69.0") implementation("software.amazon.smithy.java:aws-client-restjson:0.0.1") } diff --git a/clients/java/sdk/src/main/java/io/juspay/superposition/client/SuperpositionAsyncClient.java b/clients/java/sdk/src/main/java/io/juspay/superposition/client/SuperpositionAsyncClient.java index a319ce8f7..c8834f9c4 100644 --- a/clients/java/sdk/src/main/java/io/juspay/superposition/client/SuperpositionAsyncClient.java +++ b/clients/java/sdk/src/main/java/io/juspay/superposition/client/SuperpositionAsyncClient.java @@ -238,9 +238,9 @@ default CompletableFuture applicableVariants(Applicabl * Executes multiple context operations (PUT, REPLACE, DELETE, MOVE) in a single atomic transaction for * efficient batch processing. * - * @throws InternalServerError - * @throws WebhookFailed * @throws ResourceNotFound + * @throws WebhookFailed + * @throws InternalServerError */ default CompletableFuture bulkOperation(BulkOperationInput input) { return bulkOperation(input, null); @@ -250,9 +250,9 @@ default CompletableFuture bulkOperation(BulkOperationInput * Executes multiple context operations (PUT, REPLACE, DELETE, MOVE) in a single atomic transaction for * efficient batch processing. * - * @throws InternalServerError - * @throws WebhookFailed * @throws ResourceNotFound + * @throws WebhookFailed + * @throws InternalServerError */ CompletableFuture bulkOperation(BulkOperationInput input, RequestOverrideConfig overrideConfig); @@ -1854,8 +1854,8 @@ default CompletableFuture validateContext(ValidateContext * Recalculates and updates the priority weights for all contexts in the workspace based on their * dimensions. * - * @throws InternalServerError * @throws WebhookFailed + * @throws InternalServerError */ default CompletableFuture weightRecompute(WeightRecomputeInput input) { return weightRecompute(input, null); @@ -1865,8 +1865,8 @@ default CompletableFuture weightRecompute(WeightRecompute * Recalculates and updates the priority weights for all contexts in the workspace based on their * dimensions. * - * @throws InternalServerError * @throws WebhookFailed + * @throws InternalServerError */ CompletableFuture weightRecompute(WeightRecomputeInput input, RequestOverrideConfig overrideConfig); @@ -1901,12 +1901,12 @@ final class Builder extends Client.Builder { Node.objectNode() ); - private static final HttpBasicAuthTrait httpBasicAuthScheme = new HttpBasicAuthTrait(); - private static final AuthSchemeFactory httpBasicAuthSchemeFactory = new HttpBasicAuthAuthScheme.Factory(); - private static final HttpBearerAuthTrait httpBearerAuthScheme = new HttpBearerAuthTrait(); private static final AuthSchemeFactory httpBearerAuthSchemeFactory = new HttpBearerAuthScheme.Factory(); + private static final HttpBasicAuthTrait httpBasicAuthScheme = new HttpBasicAuthTrait(); + private static final AuthSchemeFactory httpBasicAuthSchemeFactory = new HttpBasicAuthAuthScheme.Factory(); + private Builder() { configBuilder().putSupportedAuthSchemes(httpBasicAuthSchemeFactory.createAuthScheme(httpBasicAuthScheme), httpBearerAuthSchemeFactory.createAuthScheme(httpBearerAuthScheme)); } diff --git a/clients/java/sdk/src/main/java/io/juspay/superposition/client/SuperpositionClient.java b/clients/java/sdk/src/main/java/io/juspay/superposition/client/SuperpositionClient.java index da93167db..f99ef3d48 100644 --- a/clients/java/sdk/src/main/java/io/juspay/superposition/client/SuperpositionClient.java +++ b/clients/java/sdk/src/main/java/io/juspay/superposition/client/SuperpositionClient.java @@ -237,9 +237,9 @@ default ApplicableVariantsOutput applicableVariants(ApplicableVariantsInput inpu * Executes multiple context operations (PUT, REPLACE, DELETE, MOVE) in a single atomic transaction for * efficient batch processing. * - * @throws InternalServerError - * @throws WebhookFailed * @throws ResourceNotFound + * @throws WebhookFailed + * @throws InternalServerError */ default BulkOperationOutput bulkOperation(BulkOperationInput input) { return bulkOperation(input, null); @@ -249,9 +249,9 @@ default BulkOperationOutput bulkOperation(BulkOperationInput input) { * Executes multiple context operations (PUT, REPLACE, DELETE, MOVE) in a single atomic transaction for * efficient batch processing. * - * @throws InternalServerError - * @throws WebhookFailed * @throws ResourceNotFound + * @throws WebhookFailed + * @throws InternalServerError */ BulkOperationOutput bulkOperation(BulkOperationInput input, RequestOverrideConfig overrideConfig); @@ -1853,8 +1853,8 @@ default ValidateContextOutput validateContext(ValidateContextInput input) { * Recalculates and updates the priority weights for all contexts in the workspace based on their * dimensions. * - * @throws InternalServerError * @throws WebhookFailed + * @throws InternalServerError */ default WeightRecomputeOutput weightRecompute(WeightRecomputeInput input) { return weightRecompute(input, null); @@ -1864,8 +1864,8 @@ default WeightRecomputeOutput weightRecompute(WeightRecomputeInput input) { * Recalculates and updates the priority weights for all contexts in the workspace based on their * dimensions. * - * @throws InternalServerError * @throws WebhookFailed + * @throws InternalServerError */ WeightRecomputeOutput weightRecompute(WeightRecomputeInput input, RequestOverrideConfig overrideConfig); @@ -1900,12 +1900,12 @@ final class Builder extends Client.Builder { Node.objectNode() ); - private static final HttpBasicAuthTrait httpBasicAuthScheme = new HttpBasicAuthTrait(); - private static final AuthSchemeFactory httpBasicAuthSchemeFactory = new HttpBasicAuthAuthScheme.Factory(); - private static final HttpBearerAuthTrait httpBearerAuthScheme = new HttpBearerAuthTrait(); private static final AuthSchemeFactory httpBearerAuthSchemeFactory = new HttpBearerAuthScheme.Factory(); + private static final HttpBasicAuthTrait httpBasicAuthScheme = new HttpBasicAuthTrait(); + private static final AuthSchemeFactory httpBasicAuthSchemeFactory = new HttpBasicAuthAuthScheme.Factory(); + private Builder() { configBuilder().putSupportedAuthSchemes(httpBasicAuthSchemeFactory.createAuthScheme(httpBasicAuthScheme), httpBearerAuthSchemeFactory.createAuthScheme(httpBearerAuthScheme)); } diff --git a/clients/java/sdk/src/main/java/io/juspay/superposition/model/BulkOperation.java b/clients/java/sdk/src/main/java/io/juspay/superposition/model/BulkOperation.java index 810f0ff65..43b69bb0f 100644 --- a/clients/java/sdk/src/main/java/io/juspay/superposition/model/BulkOperation.java +++ b/clients/java/sdk/src/main/java/io/juspay/superposition/model/BulkOperation.java @@ -27,8 +27,8 @@ public final class BulkOperation implements ApiOperation SCHEMES = List.of(ShapeId.from("smithy.api#httpBasicAuth"), ShapeId.from("smithy.api#httpBearerAuth")); diff --git a/clients/python/sdk/superposition_sdk/deserialize.py b/clients/python/sdk/superposition_sdk/deserialize.py index 7b9b65797..a1eeee622 100644 --- a/clients/python/sdk/superposition_sdk/deserialize.py +++ b/clients/python/sdk/superposition_sdk/deserialize.py @@ -186,12 +186,12 @@ async def _deserialize_error_bulk_operation(http_response: HTTPResponse, config: case "internalservererror": return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message) - case "webhookfailed": - return await _deserialize_error_webhook_failed(http_response, config, parsed_body, message) - case "resourcenotfound": return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message) + case "webhookfailed": + return await _deserialize_error_webhook_failed(http_response, config, parsed_body, message) + case _: return UnknownApiError(f"{code}: {message}") diff --git a/clients/python/sdk/superposition_sdk/models.py b/clients/python/sdk/superposition_sdk/models.py index 7787f10d3..d4e95de0c 100644 --- a/clients/python/sdk/superposition_sdk/models.py +++ b/clients/python/sdk/superposition_sdk/models.py @@ -2001,9 +2001,9 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None: input_schema = _SCHEMA_BULK_OPERATION_INPUT, output_schema = _SCHEMA_BULK_OPERATION_OUTPUT, error_registry = TypeRegistry({ - ShapeID("io.superposition#InternalServerError"): InternalServerError, + ShapeID("io.superposition#ResourceNotFound"): ResourceNotFound, ShapeID("io.superposition#WebhookFailed"): WebhookFailed, -ShapeID("io.superposition#ResourceNotFound"): ResourceNotFound, +ShapeID("io.superposition#InternalServerError"): InternalServerError, }), effective_auth_schemes = [ ShapeID("smithy.api#httpBasicAuth"), @@ -5362,8 +5362,8 @@ def _consumer(schema: Schema, de: ShapeDeserializer) -> None: input_schema = _SCHEMA_WEIGHT_RECOMPUTE_INPUT, output_schema = _SCHEMA_WEIGHT_RECOMPUTE_OUTPUT, error_registry = TypeRegistry({ - ShapeID("io.superposition#InternalServerError"): InternalServerError, -ShapeID("io.superposition#WebhookFailed"): WebhookFailed, + ShapeID("io.superposition#WebhookFailed"): WebhookFailed, +ShapeID("io.superposition#InternalServerError"): InternalServerError, }), effective_auth_schemes = [ ShapeID("smithy.api#httpBasicAuth"), diff --git a/crates/superposition_sdk/Cargo.toml b/crates/superposition_sdk/Cargo.toml index dfe04398b..efedcdb7c 100644 --- a/crates/superposition_sdk/Cargo.toml +++ b/crates/superposition_sdk/Cargo.toml @@ -12,27 +12,32 @@ rust-version = "1.82.0" readme = "README.md" [package.metadata.smithy] -codegen-version = "18e06e0a61e4ce792a2b17271d25a1f524d90ed4" +codegen-version = "62028c3457eb372f2dd13f28c760d441b155ffcb" +protocol = "aws.protocols#restJson1" [dependencies.aws-smithy-async] -version = "1.2.5" +version = "1.2.14" [dependencies.aws-smithy-http] -version = "0.62.1" +version = "0.63.6" [dependencies.aws-smithy-json] -version = "0.61.3" +version = "0.62.7" [dependencies.aws-smithy-runtime] -version = "1.8.2" +version = "1.11.3" features = ["client", "http-auth"] [dependencies.aws-smithy-runtime-api] -version = "1.7.4" -features = ["client", "http-02x", "http-auth"] +version = "1.12.3" +features = ["client", "http-1x", "http-auth"] [dependencies.aws-smithy-types] -version = "1.3.0" +version = "1.5.0" +features = ["http-body-1-x"] [dependencies.bytes] version = "1.4.0" [dependencies.fastrand] version = "2.0.0" [dependencies.http] version = "0.2.9" +[dependencies.http-1x] +version = "1" +package = "http" [dependencies.tracing] version = "0.1" [features] diff --git a/crates/superposition_sdk/src/auth_plugin.rs b/crates/superposition_sdk/src/auth_plugin.rs deleted file mode 100644 index 82469a45c..000000000 --- a/crates/superposition_sdk/src/auth_plugin.rs +++ /dev/null @@ -1,41 +0,0 @@ -// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -/* - * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. - * SPDX-License-Identifier: Apache-2.0 - */ - -use std::borrow::Cow; - -use aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolver; -use aws_smithy_runtime_api::client::auth::AuthSchemeId; -use aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder; -use aws_smithy_runtime_api::client::runtime_plugin::{Order, RuntimePlugin}; - -#[derive(Debug)] -pub(crate) struct DefaultAuthOptionsPlugin { - runtime_components: RuntimeComponentsBuilder, -} - -impl DefaultAuthOptionsPlugin { - pub(crate) fn new(auth_schemes: Vec) -> Self { - let runtime_components = RuntimeComponentsBuilder::new("default_auth_options") - .with_auth_scheme_option_resolver(Some(StaticAuthSchemeOptionResolver::new( - auth_schemes, - ))); - Self { runtime_components } - } -} - -impl RuntimePlugin for DefaultAuthOptionsPlugin { - fn order(&self) -> Order { - Order::Defaults - } - - fn runtime_components( - &self, - _current_components: &RuntimeComponentsBuilder, - ) -> Cow<'_, RuntimeComponentsBuilder> { - Cow::Borrowed(&self.runtime_components) - } -} - diff --git a/crates/superposition_sdk/src/client.rs b/crates/superposition_sdk/src/client.rs index 6ba35151b..e2aa72881 100644 --- a/crates/superposition_sdk/src/client.rs +++ b/crates/superposition_sdk/src/client.rs @@ -6,56 +6,56 @@ pub(crate) runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, } - -/// + +/// /// An ergonomic client for Superposition. -/// +/// /// This client allows ergonomic access to Superposition. /// Each method corresponds to an API defined in the service's Smithy model, /// and the request and response shapes are auto-generated from that same model. -/// +/// /// Client for calling Superposition. -/// +/// /// ## Constructing a `Client` -/// +/// /// A `Client` requires a config in order to be constructed. With the default set of Cargo features, /// this config will only require an endpoint to produce a functioning client. However, some Smithy /// features will require additional configuration. For example, `@auth` requires some kind of identity /// or identity resolver to be configured. The config is used to customize various aspects of the client, /// such as: -/// +/// /// - [The underlying HTTP client](crate::config::Builder::http_client) /// - [Retries](crate::config::Builder::retry_config) /// - [Timeouts](crate::config::Builder::timeout_config) /// - [... and more](crate::config::Builder) -/// +/// /// Below is a minimal example of how to create a client: -/// +/// /// ```rust,no_run /// let config = superposition_sdk::Config::builder() /// .endpoint_url("http://localhost:1234") /// .build(); /// let client = superposition_sdk::Client::from_conf(config); /// ``` -/// +/// /// _Note:_ Client construction is expensive due to connection thread pool initialization, and should be done /// once at application start-up. Cloning a client is cheap (it's just an [`Arc`](std::sync::Arc) under the hood), /// so creating it once at start-up and cloning it around the application as needed is recommended. /// # Using the `Client` -/// +/// /// A client has a function for every operation that can be performed by the service. /// For example, the [`AddMembersToGroup`](crate::operation::add_members_to_group) operation has /// a [`Client::add_members_to_group`], function which returns a builder for that operation. /// The fluent builder ultimately has a `send()` function that returns an async future that /// returns a result, as illustrated below: -/// +/// /// ```rust,ignore /// let result = client.add_members_to_group() /// .workspace_id("example") /// .send() /// .await; /// ``` -/// +/// /// The underlying HTTP requests that get made by this can be modified with the `customize_operation` /// function on the fluent builder. See the [`customize`](crate::client::customize) module for more /// information. @@ -137,16 +137,16 @@ mod create_webhook; mod create_workspace; /// Operation customization and supporting types. -/// +/// /// The underlying HTTP requests made during an operation can be customized /// by calling the `customize()` method on the builder returned from a client /// operation call. For example, this can be used to add an additional HTTP header: -/// +/// /// ```ignore /// # async fn wrapper() -> ::std::result::Result<(), superposition_sdk::Error> { /// # let client: superposition_sdk::Client = unimplemented!(); -/// use ::http::header::{HeaderName, HeaderValue}; -/// +/// use ::http_1x::header::{HeaderName, HeaderValue}; +/// /// let result = client.add_members_to_group() /// .customize() /// .mutate_request(|req| { diff --git a/crates/superposition_sdk/src/client/customize.rs b/crates/superposition_sdk/src/client/customize.rs index fee84257e..2362fc27d 100644 --- a/crates/superposition_sdk/src/client/customize.rs +++ b/crates/superposition_sdk/src/client/customize.rs @@ -199,7 +199,7 @@ self.execute(|sender, config|sender.send(config)).await } - + } pub(crate) mod internal; diff --git a/crates/superposition_sdk/src/config.rs b/crates/superposition_sdk/src/config.rs index ef56de3e0..962384d57 100644 --- a/crates/superposition_sdk/src/config.rs +++ b/crates/superposition_sdk/src/config.rs @@ -1,7 +1,7 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. - +#![allow(clippy::empty_line_after_doc_comments)] /// Configuration for a superposition_sdk service client. -/// +/// #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct Config { // Both `config` and `cloneable` are the same config, but the cloneable one @@ -11,16 +11,16 @@ pub struct Config { cloneable: ::aws_smithy_types::config_bag::CloneableLayer, pub(crate) runtime_components: crate::config::RuntimeComponentsBuilder, pub(crate) runtime_plugins: ::std::vec::Vec, - behavior_version: ::std::option::Option, + pub(crate) behavior_version: ::std::option::Option, } impl Config { - /// + /// /// Constructs a config builder. ///
/// Note that a config created from this builder will not have the same safe defaults as one created by /// the aws-config crate. ///
- /// + /// pub fn builder() -> Builder { Builder::default() } /// Converts this config back into a builder so that it can be tweaked. pub fn to_builder(&self) -> Builder { @@ -39,6 +39,19 @@ impl Config { pub fn http_client(&self) -> Option { self.runtime_components.http_client() } + /// Return the auth schemes configured on this service config + pub fn auth_schemes(&self) -> impl Iterator + '_ { + self.runtime_components.auth_schemes() + } + + /// Return the auth scheme resolver configured on this service config + pub fn auth_scheme_resolver(&self) -> ::std::option::Option<::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver> { + self.runtime_components.auth_scheme_option_resolver() + } + /// Returns the configured auth scheme preference + pub fn auth_scheme_preference(&self) -> ::std::option::Option<&::aws_smithy_runtime_api::client::auth::AuthSchemePreference> { + self.config.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>() + } /// Returns the endpoint resolver. pub fn endpoint_resolver(&self) -> ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver { self.runtime_components.endpoint_resolver().expect("resolver defaulted if not set") @@ -47,17 +60,17 @@ impl Config { pub fn retry_config(&self) -> ::std::option::Option<&::aws_smithy_types::retry::RetryConfig> { self.config.load::<::aws_smithy_types::retry::RetryConfig>() } - + /// Return a cloned shared async sleep implementation from this config, if any. pub fn sleep_impl(&self) -> ::std::option::Option { self.runtime_components.sleep_impl() } - + /// Return a reference to the timeout configuration contained in this config, if any. pub fn timeout_config(&self) -> ::std::option::Option<&::aws_smithy_types::timeout::TimeoutConfig> { self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>() } - + /// Returns a reference to the retry partition contained in this config, if any. /// /// WARNING: This method is unstable and may be removed at any time. Do not rely on this @@ -101,13 +114,13 @@ impl ::std::default::Default for Builder { } } impl Builder { - /// + /// /// Constructs a config builder. ///
/// Note that a config created from this builder will not have the same safe defaults as one created by /// the aws-config crate. ///
- /// + /// pub fn new() -> Self { Self::default() } /// Constructs a config builder from the given `config_bag`, setting only fields stored in the config bag, /// but not those in runtime components. @@ -115,6 +128,7 @@ impl Builder { pub(crate) fn from_config_bag(config_bag: &::aws_smithy_types::config_bag::ConfigBag) -> Self { let mut builder = Self::new(); builder.set_stalled_stream_protection(config_bag.load::().cloned()); + builder.set_auth_scheme_preference(config_bag.load::<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>().cloned()); builder.set_retry_config(config_bag.load::<::aws_smithy_types::retry::RetryConfig>().cloned()); builder.set_timeout_config(config_bag.load::<::aws_smithy_types::timeout::TimeoutConfig>().cloned()); builder.set_retry_partition(config_bag.load::<::aws_smithy_runtime::client::retries::RetryPartition>().cloned()); @@ -171,7 +185,7 @@ impl Builder { self.set_http_client(::std::option::Option::Some(crate::config::IntoShared::into_shared(http_client))); self } - + /// Sets the HTTP client to use when making requests. /// /// # Examples @@ -209,7 +223,7 @@ impl Builder { pub fn bearer_token(self, bearer_token: crate::config::Token) -> Self { self.bearer_token_resolver(bearer_token) } - + /// Sets a bearer token provider that will be used for HTTP bearer auth. pub fn bearer_token_resolver(mut self, bearer_token_resolver: impl crate::config::ResolveIdentity + 'static) -> Self { self.runtime_components.set_identity_resolver( @@ -222,7 +236,7 @@ impl Builder { pub fn basic_auth_login(self, basic_auth_login: crate::config::Login) -> Self { self.basic_auth_login_resolver(basic_auth_login) } - + /// Sets a login resolver that will be used for HTTP basic auth. pub fn basic_auth_login_resolver(mut self, basic_auth_resolver: impl crate::config::ResolveIdentity + 'static) -> Self { self.runtime_components.set_identity_resolver( @@ -231,6 +245,232 @@ impl Builder { ); self } + /// Adds an auth scheme to the builder + /// + /// If `auth_scheme` has an existing [AuthSchemeId](aws_smithy_runtime_api::client::auth::AuthSchemeId) in the runtime, the current identity + /// resolver and signer for that scheme will be replaced by those from `auth_scheme`. + /// + /// _Important:_ When introducing a custom auth scheme, ensure you override either + /// [`Self::auth_scheme_resolver`] or [`Self::set_auth_scheme_resolver`] + /// so that the custom auth scheme is included in the list of resolved auth scheme options. + /// [The default auth scheme resolver](crate::config::auth::DefaultAuthSchemeResolver) will not recognize your custom auth scheme. + /// + /// # Examples + /// ```no_run + /// # use aws_smithy_runtime_api::{ + /// # box_error::BoxError, + /// # client::{ + /// # auth::{ + /// # AuthScheme, AuthSchemeEndpointConfig, AuthSchemeId, AuthSchemeOption, + /// # AuthSchemeOptionsFuture, Sign, + /// # }, + /// # identity::{Identity, IdentityFuture, ResolveIdentity, SharedIdentityResolver}, + /// # orchestrator::HttpRequest, + /// # runtime_components::{GetIdentityResolver, RuntimeComponents}, + /// # }, + /// # shared::IntoShared, + /// # }; + /// # use aws_smithy_types::config_bag::ConfigBag; + /// // Auth scheme with customer identity resolver and signer + /// #[derive(Debug)] + /// struct CustomAuthScheme { + /// id: AuthSchemeId, + /// identity_resolver: SharedIdentityResolver, + /// signer: CustomSigner, + /// } + /// impl Default for CustomAuthScheme { + /// fn default() -> Self { + /// Self { + /// id: AuthSchemeId::new("custom"), + /// identity_resolver: CustomIdentityResolver.into_shared(), + /// signer: CustomSigner, + /// } + /// } + /// } + /// impl AuthScheme for CustomAuthScheme { + /// fn scheme_id(&self) -> AuthSchemeId { + /// self.id.clone() + /// } + /// fn identity_resolver( + /// &self, + /// _identity_resolvers: &dyn GetIdentityResolver, + /// ) -> Option { + /// Some(self.identity_resolver.clone()) + /// } + /// fn signer(&self) -> &dyn Sign { + /// &self.signer + /// } + /// } + /// + /// #[derive(Debug, Default)] + /// struct CustomSigner; + /// impl Sign for CustomSigner { + /// fn sign_http_request( + /// &self, + /// _request: &mut HttpRequest, + /// _identity: &Identity, + /// _auth_scheme_endpoint_config: AuthSchemeEndpointConfig<'_>, + /// _runtime_components: &RuntimeComponents, + /// _config_bag: &ConfigBag, + /// ) -> Result<(), BoxError> { + /// // --snip-- + /// # todo!() + /// } + /// } + /// + /// #[derive(Debug)] + /// struct CustomIdentityResolver; + /// impl ResolveIdentity for CustomIdentityResolver { + /// fn resolve_identity<'a>( + /// &'a self, + /// _runtime_components: &'a RuntimeComponents, + /// _config_bag: &'a ConfigBag, + /// ) -> IdentityFuture<'a> { + /// // --snip-- + /// # todo!() + /// } + /// } + /// + /// // Auth scheme resolver that favors `CustomAuthScheme` + /// #[derive(Debug)] + /// struct CustomAuthSchemeResolver; + /// impl superposition_sdk::config::auth::ResolveAuthScheme for CustomAuthSchemeResolver { + /// fn resolve_auth_scheme<'a>( + /// &'a self, + /// _params: &'a superposition_sdk::config::auth::Params, + /// _cfg: &'a ConfigBag, + /// _runtime_components: &'a RuntimeComponents, + /// ) -> AuthSchemeOptionsFuture<'a> { + /// AuthSchemeOptionsFuture::ready(Ok(vec![AuthSchemeOption::from(AuthSchemeId::new( + /// "custom", + /// ))])) + /// } + /// } + /// + /// let config = superposition_sdk::Config::builder() + /// .push_auth_scheme(CustomAuthScheme::default()) + /// .auth_scheme_resolver(CustomAuthSchemeResolver) + /// // other configurations + /// .build(); + /// ``` + pub fn push_auth_scheme(mut self, auth_scheme: impl ::aws_smithy_runtime_api::client::auth::AuthScheme + 'static) -> Self { + self.runtime_components.push_auth_scheme(auth_scheme); + self + } + + /// Set the auth scheme resolver for the builder + /// + /// # Examples + /// ```no_run + /// # use aws_smithy_runtime_api::{ + /// # client::{ + /// # auth::AuthSchemeOptionsFuture, + /// # runtime_components::RuntimeComponents, + /// # }, + /// # }; + /// # use aws_smithy_types::config_bag::ConfigBag; + /// #[derive(Debug)] + /// struct CustomAuthSchemeResolver; + /// impl superposition_sdk::config::auth::ResolveAuthScheme for CustomAuthSchemeResolver { + /// fn resolve_auth_scheme<'a>( + /// &'a self, + /// _params: &'a superposition_sdk::config::auth::Params, + /// _cfg: &'a ConfigBag, + /// _runtime_components: &'a RuntimeComponents, + /// ) -> AuthSchemeOptionsFuture<'a> { + /// // --snip-- + /// # todo!() + /// } + /// } + /// + /// let config = superposition_sdk::Config::builder() + /// .auth_scheme_resolver(CustomAuthSchemeResolver) + /// // other configurations + /// .build(); + /// ``` + pub fn auth_scheme_resolver(mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> Self { + self.set_auth_scheme_resolver(auth_scheme_resolver); + self + } + + /// Set the auth scheme resolver for the builder + /// + /// # Examples + /// See an example for [`Self::auth_scheme_resolver`]. + pub fn set_auth_scheme_resolver(&mut self, auth_scheme_resolver: impl crate::config::auth::ResolveAuthScheme + 'static) -> &mut Self { + self.runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some(auth_scheme_resolver.into_shared_resolver())); + self + } + + /// Enable no authentication regardless of what authentication mechanisms operations support + /// + /// This adds [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback + /// and the auth scheme resolver will use it when no other auth schemes are applicable. + pub fn allow_no_auth(mut self) -> Self { + self.set_allow_no_auth(); + self + } + + /// Enable no authentication regardless of what authentication mechanisms operations support + /// + /// This adds [NoAuthScheme](aws_smithy_runtime::client::auth::no_auth::NoAuthScheme) as a fallback + /// and the auth scheme resolver will use it when no other auth schemes are applicable. + pub fn set_allow_no_auth(&mut self) -> &mut Self { + self.push_runtime_plugin(::aws_smithy_runtime::client::auth::no_auth::NoAuthRuntimePluginV2::new().into_shared()); + self + } + /// Set the auth scheme preference for an auth scheme resolver + /// (typically the default auth scheme resolver). + /// + /// Each operation has a predefined order of auth schemes, as determined by the service, + /// for auth scheme resolution. By using the auth scheme preference, customers + /// can reorder the schemes resolved by the auth scheme resolver. + /// + /// The preference list is intended as a hint rather than a strict override. + /// Any schemes not present in the originally resolved auth schemes will be ignored. + /// + /// # Examples + /// + /// ```no_run + /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId; + /// let config = superposition_sdk::Config::builder() + /// .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")]) + /// // ... + /// .build(); + /// let client = superposition_sdk::Client::from_conf(config); + /// ``` + + pub fn auth_scheme_preference(mut self, preference: impl ::std::convert::Into<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>) -> Self { + self.set_auth_scheme_preference(::std::option::Option::Some(preference.into())); + self + } + + + /// Set the auth scheme preference for an auth scheme resolver + /// (typically the default auth scheme resolver). + /// + /// Each operation has a predefined order of auth schemes, as determined by the service, + /// for auth scheme resolution. By using the auth scheme preference, customers + /// can reorder the schemes resolved by the auth scheme resolver. + /// + /// The preference list is intended as a hint rather than a strict override. + /// Any schemes not present in the originally resolved auth schemes will be ignored. + /// + /// # Examples + /// + /// ```no_run + /// # use aws_smithy_runtime_api::client::auth::AuthSchemeId; + /// let config = superposition_sdk::Config::builder() + /// .auth_scheme_preference([AuthSchemeId::from("scheme1"), AuthSchemeId::from("scheme2")]) + /// // ... + /// .build(); + /// let client = superposition_sdk::Client::from_conf(config); + /// ``` + + pub fn set_auth_scheme_preference(&mut self, preference: ::std::option::Option<::aws_smithy_runtime_api::client::auth::AuthSchemePreference>) -> &mut Self { + self.config.store_or_unset(preference); + self + } /// Set the endpoint URL to use when making requests. /// /// Note: setting an endpoint URL will replace any endpoint resolver that has been set. @@ -241,7 +481,7 @@ impl Builder { self.set_endpoint_url(::std::option::Option::Some(endpoint_url.into())); self } - + /// Set the endpoint URL to use when making requests. /// /// Note: setting an endpoint URL will replace any endpoint resolver that has been set. @@ -285,7 +525,7 @@ impl Builder { self.set_endpoint_resolver(::std::option::Option::Some(endpoint_resolver.into_shared_resolver())); self } - + /// Sets the endpoint resolver to use when making requests. /// /// This service does not define a default endpoint resolver. @@ -307,7 +547,7 @@ impl Builder { self.set_retry_config(Some(retry_config)); self } - + /// Set the retry_config for the builder /// /// # Examples @@ -351,7 +591,7 @@ impl Builder { self.set_sleep_impl(Some(::aws_smithy_runtime_api::shared::IntoShared::into_shared(sleep_impl))); self } - + /// Set the sleep_impl for the builder /// /// # Examples @@ -399,7 +639,7 @@ impl Builder { self.set_timeout_config(Some(timeout_config)); self } - + /// Set the timeout_config for the builder. /// /// Setting this to `None` has no effect if another source of configuration has set timeouts. If you @@ -429,7 +669,7 @@ impl Builder { let Some(mut timeout_config) = timeout_config else { return self }; - + if let Some(base) = self.config.load::<::aws_smithy_types::timeout::TimeoutConfig>() { timeout_config.take_defaults_from(base); } @@ -437,15 +677,55 @@ impl Builder { self } /// Set the partition for retry-related state. When clients share a retry partition, they will - /// also share things like token buckets and client rate limiters. By default, all clients - /// for the same service will share a partition. + /// also share components such as token buckets and client rate limiters. + /// See the [`RetryPartition`](::aws_smithy_runtime::client::retries::RetryPartition) documentation for more details. + /// + /// # Default Behavior + /// + /// When no retry partition is explicitly set, the SDK automatically creates a default retry partition named `superposition` + /// (or `superposition-` if a region is configured). + /// All Superposition clients without an explicit retry partition will share this default partition. + /// + /// # Notes + /// + /// - This is an advanced setting — most users won't need to modify it. + /// - A configured client rate limiter has no effect unless [`RetryConfig::adaptive`](::aws_smithy_types::retry::RetryConfig::adaptive) is used. + /// + /// # Examples + /// + /// Creating a custom retry partition with a token bucket: + /// ```no_run + /// use superposition_sdk::config::Config; + /// use superposition_sdk::config::retry::{RetryPartition, TokenBucket}; + /// + /// let token_bucket = TokenBucket::new(10); + /// let config = Config::builder() + /// .retry_partition(RetryPartition::custom("custom") + /// .token_bucket(token_bucket) + /// .build() + /// ) + /// .build(); + /// ``` + /// + /// Configuring a client rate limiter with adaptive retry mode: + /// ```no_run + /// use superposition_sdk::config::Config; + /// use superposition_sdk::config::retry::{ClientRateLimiter, RetryConfig, RetryPartition}; + /// + /// let client_rate_limiter = ClientRateLimiter::new(10.0); + /// let config = Config::builder() + /// .retry_partition(RetryPartition::custom("custom") + /// .client_rate_limiter(client_rate_limiter) + /// .build() + /// ) + /// .retry_config(RetryConfig::adaptive()) + /// .build(); + /// ``` pub fn retry_partition(mut self, retry_partition: ::aws_smithy_runtime::client::retries::RetryPartition) -> Self { self.set_retry_partition(Some(retry_partition)); self } - /// Set the partition for retry-related state. When clients share a retry partition, they will - /// also share things like token buckets and client rate limiters. By default, all clients - /// for the same service will share a partition. + /// Like [`Self::retry_partition`], but takes a mutable reference to the builder and an optional `RetryPartition` pub fn set_retry_partition(&mut self, retry_partition: ::std::option::Option<::aws_smithy_runtime::client::retries::RetryPartition>) -> &mut Self { retry_partition.map(|r| self.config.store_put(r)); self @@ -490,13 +770,13 @@ impl Builder { /// .build(); /// let client = superposition_sdk::Client::from_conf(config); /// ``` - + /// pub fn identity_cache(mut self, identity_cache: impl crate::config::ResolveCachedIdentity + 'static) -> Self { self.set_identity_cache(identity_cache); self } - - + + /// Set the identity cache for auth. /// /// The identity cache defaults to a lazy caching implementation that will resolve @@ -537,7 +817,7 @@ impl Builder { /// .build(); /// let client = superposition_sdk::Client::from_conf(config); /// ``` - + /// pub fn set_identity_cache(&mut self, identity_cache: impl crate::config::ResolveCachedIdentity + 'static) -> &mut Self { self.runtime_components.set_identity_cache(::std::option::Option::Some(identity_cache)); self @@ -550,14 +830,14 @@ impl Builder { /// /// # Examples /// ```no_run - /// # #[cfg(test)] - /// # mod tests { - /// # #[test] /// # fn example() { - /// use aws_smithy_runtime_api::client::interceptors::context::phase::BeforeTransmit; - /// use aws_smithy_runtime_api::client::interceptors::{Interceptor, InterceptorContext}; + /// use aws_smithy_runtime_api::box_error::BoxError; + /// use aws_smithy_runtime_api::client::interceptors::context::BeforeTransmitInterceptorContextMut; + /// use aws_smithy_runtime_api::client::interceptors::Intercept; + /// use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; /// use aws_smithy_types::config_bag::ConfigBag; /// use superposition_sdk::config::Config; + /// use ::http::uri::Uri; /// /// fn base_url() -> String { /// // ... @@ -567,14 +847,18 @@ impl Builder { /// #[derive(Debug)] /// pub struct UriModifierInterceptor; /// impl Intercept for UriModifierInterceptor { + /// fn name(&self) -> &'static str { + /// "UriModifierInterceptor" + /// } /// fn modify_before_signing( /// &self, - /// context: &mut InterceptorContext, + /// context: &mut BeforeTransmitInterceptorContextMut<'_>, + /// _runtime_components: &RuntimeComponents, /// _cfg: &mut ConfigBag, - /// ) -> Result<(), aws_smithy_runtime_api::client::interceptors::BoxError> { + /// ) -> Result<(), BoxError> { /// let request = context.request_mut(); - /// let uri = format!("{}{}", base_url(), request.uri().path()); - /// *request.uri_mut() = uri.parse()?; + /// let uri = format!("{}{}", base_url(), request.uri()); + /// *request.uri_mut() = uri.parse::()?.into(); /// /// Ok(()) /// } @@ -584,65 +868,18 @@ impl Builder { /// .interceptor(UriModifierInterceptor) /// .build(); /// # } - /// # } /// ``` pub fn interceptor(mut self, interceptor: impl crate::config::Intercept + 'static) -> Self { self.push_interceptor(crate::config::SharedInterceptor::new(interceptor)); self } - - /// Add a [`SharedInterceptor`](crate::config::SharedInterceptor) that runs at specific stages of the request execution pipeline. - /// - /// Interceptors targeted at a certain stage are executed according to the pre-defined priority. - /// The SDK provides a default set of interceptors. An interceptor configured by this method - /// will run after those default interceptors. - /// - /// # Examples - /// ```no_run - /// # #[cfg(test)] - /// # mod tests { - /// # #[test] - /// # fn example() { - /// use aws_smithy_runtime_api::client::interceptors::context::phase::BeforeTransmit; - /// use aws_smithy_runtime_api::client::interceptors::{Interceptor, InterceptorContext, SharedInterceptor}; - /// use aws_smithy_types::config_bag::ConfigBag; - /// use superposition_sdk::config::{Builder, Config}; - /// - /// fn base_url() -> String { - /// // ... - /// # String::new() - /// } - /// - /// fn modify_request_uri(builder: &mut Builder) { - /// #[derive(Debug)] - /// pub struct UriModifierInterceptor; - /// impl Intercept for UriModifierInterceptor { - /// fn modify_before_signing( - /// &self, - /// context: &mut InterceptorContext, - /// _cfg: &mut ConfigBag, - /// ) -> Result<(), aws_smithy_runtime_api::client::interceptors::BoxError> { - /// let request = context.request_mut(); - /// let uri = format!("{}{}", base_url(), request.uri().path()); - /// *request.uri_mut() = uri.parse()?; - /// - /// Ok(()) - /// } - /// } - /// builder.push_interceptor(SharedInterceptor::new(UriModifierInterceptor)); - /// } - /// - /// let mut builder = Config::builder(); - /// modify_request_uri(&mut builder); - /// let config = builder.build(); - /// # } - /// # } - /// ``` + + /// Like [`Self::interceptor`], but takes a [`SharedInterceptor`](crate::config::SharedInterceptor). pub fn push_interceptor(&mut self, interceptor: crate::config::SharedInterceptor) -> &mut Self { self.runtime_components.push_interceptor(interceptor); self } - + /// Set [`SharedInterceptor`](crate::config::SharedInterceptor)s for the builder. pub fn set_interceptors(&mut self, interceptors: impl IntoIterator) -> &mut Self { self.runtime_components.set_interceptors(interceptors.into_iter()); @@ -671,9 +908,6 @@ impl Builder { /// /// # Examples /// ```no_run - /// # #[cfg(test)] - /// # mod tests { - /// # #[test] /// # fn example() { /// use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext; /// use aws_smithy_runtime_api::client::orchestrator::OrchestratorError; @@ -684,17 +918,26 @@ impl Builder { /// use aws_smithy_types::retry::ErrorKind; /// use std::error::Error as StdError; /// use std::marker::PhantomData; + /// use std::fmt; /// use superposition_sdk::config::Config; + /// # #[derive(Debug)] /// # struct SomeOperationError {} + /// # impl StdError for SomeOperationError {} + /// # impl fmt::Display for SomeOperationError { + /// # fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { todo!() } + /// # } + /// # impl ProvideErrorMetadata for SomeOperationError { + /// # fn meta(&self) -> &superposition_sdk::error::ErrorMetadata { todo!() } + /// # } /// - /// const RETRYABLE_ERROR_CODES: &[&str] = [ + /// const RETRYABLE_ERROR_CODES: &[&str] = &[ /// // List error codes to be retried here... /// ]; /// /// // When classifying at an operation's error type, classifiers require a generic parameter. /// // When classifying the HTTP response alone, no generic is needed. /// #[derive(Debug, Default)] - /// pub struct ErrorCodeClassifier { + /// pub struct ExampleErrorCodeClassifier { /// _inner: PhantomData, /// } /// @@ -744,103 +987,18 @@ impl Builder { /// .retry_classifier(ExampleErrorCodeClassifier::::new()) /// .build(); /// # } - /// # } /// ``` pub fn retry_classifier(mut self, retry_classifier: impl ::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry + 'static) -> Self { self.push_retry_classifier(::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier::new(retry_classifier)); self } - - /// Add a [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier) that will be used by the - /// [`RetryStrategy`](::aws_smithy_runtime_api::client::retries::RetryStrategy) to determine what responses should be retried. - /// - /// A retry classifier configured by this method will run according to its priority. - /// - /// # Examples - /// ```no_run - /// # #[cfg(test)] - /// # mod tests { - /// # #[test] - /// # fn example() { - /// use aws_smithy_runtime_api::client::interceptors::context::InterceptorContext; - /// use aws_smithy_runtime_api::client::orchestrator::OrchestratorError; - /// use aws_smithy_runtime_api::client::retries::classifiers::{ - /// ClassifyRetry, RetryAction, RetryClassifierPriority, - /// }; - /// use aws_smithy_types::error::metadata::ProvideErrorMetadata; - /// use aws_smithy_types::retry::ErrorKind; - /// use std::error::Error as StdError; - /// use std::marker::PhantomData; - /// use superposition_sdk::config::{Builder, Config}; - /// # struct SomeOperationError {} - /// - /// const RETRYABLE_ERROR_CODES: &[&str] = [ - /// // List error codes to be retried here... - /// ]; - /// fn set_example_error_code_classifier(builder: &mut Builder) { - /// // When classifying at an operation's error type, classifiers require a generic parameter. - /// // When classifying the HTTP response alone, no generic is needed. - /// #[derive(Debug, Default)] - /// pub struct ExampleErrorCodeClassifier { - /// _inner: PhantomData, - /// } - /// - /// impl ExampleErrorCodeClassifier { - /// pub fn new() -> Self { - /// Self { - /// _inner: PhantomData, - /// } - /// } - /// } - /// - /// impl ClassifyRetry for ExampleErrorCodeClassifier - /// where - /// // Adding a trait bound for ProvideErrorMetadata allows us to inspect the error code. - /// E: StdError + ProvideErrorMetadata + Send + Sync + 'static, - /// { - /// fn classify_retry(&self, ctx: &InterceptorContext) -> RetryAction { - /// // Check for a result - /// let output_or_error = ctx.output_or_error(); - /// // Check for an error - /// let error = match output_or_error { - /// Some(Ok(_)) | None => return RetryAction::NoActionIndicated, - /// Some(Err(err)) => err, - /// }; - /// - /// // Downcast the generic error and extract the code - /// let error_code = OrchestratorError::as_operation_error(error) - /// .and_then(|err| err.downcast_ref::()) - /// .and_then(|err| err.code()); - /// - /// // If this error's code is in our list, return an action that tells the RetryStrategy to retry this request. - /// if let Some(error_code) = error_code { - /// if RETRYABLE_ERROR_CODES.contains(&error_code) { - /// return RetryAction::transient_error(); - /// } - /// } - /// - /// // Otherwise, return that no action is indicated i.e. that this classifier doesn't require a retry. - /// // Another classifier may still classify this response as retryable. - /// RetryAction::NoActionIndicated - /// } - /// - /// fn name(&self) -> &'static str { "Example Error Code Classifier" } - /// } - /// - /// builder.push_retry_classifier(ExampleErrorCodeClassifier::::new()) - /// } - /// - /// let mut builder = Config::builder(); - /// set_example_error_code_classifier(&mut builder); - /// let config = builder.build(); - /// # } - /// # } - /// ``` + + /// Like [`Self::retry_classifier`], but takes a [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier). pub fn push_retry_classifier(&mut self, retry_classifier: ::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier) -> &mut Self { self.runtime_components.push_retry_classifier(retry_classifier); self } - + /// Set [`SharedRetryClassifier`](::aws_smithy_runtime_api::client::retries::classifiers::SharedRetryClassifier)s for the builder, replacing any that /// were previously set. pub fn set_retry_classifiers(&mut self, retry_classifiers: impl IntoIterator) -> &mut Self { @@ -876,13 +1034,13 @@ impl Builder { /// .build(); /// let client = superposition_sdk::Client::from_conf(config); /// ``` - + /// pub fn behavior_version(mut self, behavior_version: crate::config::BehaviorVersion) -> Self { self.set_behavior_version(Some(behavior_version)); self } - - + + /// Sets the [`behavior major version`](crate::config::BehaviorVersion). /// /// Over time, new best-practice behaviors are introduced. However, these behaviors might not be backwards @@ -912,12 +1070,12 @@ impl Builder { /// .build(); /// let client = superposition_sdk::Client::from_conf(config); /// ``` - + /// pub fn set_behavior_version(&mut self, behavior_version: Option) -> &mut Self { self.behavior_version = behavior_version; self } - + /// Convenience method to set the latest behavior major version /// /// This is equivalent to enabling the `behavior-version-latest` Cargo feature @@ -937,7 +1095,7 @@ impl Builder { } #[cfg(any(feature = "test-util", test))] #[allow(unused_mut)] - /// Apply test defaults to the builder + /// Apply test defaults to the builder. NOTE: Consider migrating to use `apply_test_defaults_v2` instead. pub fn apply_test_defaults(&mut self) -> &mut Self { self .set_time_source(::std::option::Option::Some(::aws_smithy_async::time::SharedTimeSource::new( @@ -948,10 +1106,23 @@ impl Builder { } #[cfg(any(feature = "test-util", test))] #[allow(unused_mut)] - /// Apply test defaults to the builder + /// Apply test defaults to the builder. NOTE: Consider migrating to use `with_test_defaults_v2` instead. pub fn with_test_defaults(mut self) -> Self { self.apply_test_defaults(); self } + #[cfg(any(feature = "test-util", test))] + #[allow(unused_mut)] + /// Apply test defaults to the builder. V2 of this function sets additional test defaults such as region configuration (if applicable). + pub fn apply_test_defaults_v2(&mut self) -> &mut Self { + self.apply_test_defaults(); + self + } + #[cfg(any(feature = "test-util", test))] + #[allow(unused_mut)] + /// Apply test defaults to the builder. V2 of this function sets additional test defaults such as region configuration (if applicable). + pub fn with_test_defaults_v2(mut self) -> Self { + self.apply_test_defaults_v2(); self + } /// Builds a [`Config`]. #[allow(unused_mut)] pub fn build(mut self) -> Config { @@ -976,13 +1147,19 @@ impl Builder { impl ServiceRuntimePlugin { pub fn new(_service_config: crate::config::Config) -> Self { - let config = { None }; + let config = { let mut cfg = ::aws_smithy_types::config_bag::Layer::new("Superposition"); + cfg.store_put(::aws_smithy_runtime::client::orchestrator::AuthSchemeAndEndpointOrchestrationV2); + ::std::option::Option::Some(cfg.freeze()) }; let mut runtime_components = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ServiceRuntimePlugin"); runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(::aws_smithy_runtime::client::auth::http::BasicAuthScheme::new())); runtime_components.push_auth_scheme(::aws_smithy_runtime_api::client::auth::SharedAuthScheme::new(::aws_smithy_runtime::client::auth::http::BearerAuthScheme::new())); -runtime_components.push_interceptor(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new()); +runtime_components.set_auth_scheme_option_resolver(::std::option::Option::Some({ + use crate::config::auth::ResolveAuthScheme; + crate::config::auth::DefaultAuthSchemeResolver::default().into_shared_resolver() + })); +runtime_components.push_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::http::connection_poisoning::ConnectionPoisoningInterceptor::new())); runtime_components.push_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::HttpStatusCodeClassifier::default()); -runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new()); +runtime_components.push_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(crate::sdk_feature_tracker::retry_mode::RetryModeFeatureTrackerInterceptor::new())); Self { config, runtime_components } } } @@ -1001,8 +1178,8 @@ runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::Retr } } - /// Cross-operation shared-state singletons - + // Cross-operation shared-state singletons + /// A plugin that enables configuration for a single operation invocation /// /// The `config` method will return a `FrozenLayer` by storing values from `config_override`. @@ -1025,9 +1202,21 @@ runtime_components.push_interceptor(crate::sdk_feature_tracker::retry_mode::Retr #[allow(unused_mut)] let mut resolver = ::aws_smithy_runtime::client::config_override::Resolver::overrid(initial_config, initial_components, &mut layer, &mut components); - + let _ = resolver; + + // When the config override supplies an identity resolver for any auth scheme + // known to the client or the override itself, we give this operation its own + // short-lived identity cache so that new partitions don't accumulate in the + // shared client cache. A lazy cache (not `no_cache`) is used so that resolved + // identities are served from the short-lived identity cache on retries. + // + // This is skipped if the override already sets its own identity cache. + if components.has_identity_resolvers() && components.identity_cache().is_none() { + components.set_identity_cache(::std::option::Option::Some(::aws_smithy_runtime::client::identity::IdentityCache::lazy().max_partitions(1).build())); + } + Self { config: ::aws_smithy_types::config_bag::Layer::from(layer) .with_name("superposition_sdk::config::ConfigOverrideRuntimePlugin").freeze(), @@ -1064,16 +1253,18 @@ pub(crate) fn base_client_runtime_plugins( } let default_retry_partition = "superposition"; - + let scope = "superposition_sdk"; + #[allow(deprecated)] let mut plugins = ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins::new() // defaults .with_client_plugins(::aws_smithy_runtime::client::defaults::default_plugins( ::aws_smithy_runtime::client::defaults::DefaultPluginParams::new() .with_retry_partition_name(default_retry_partition) .with_behavior_version(config.behavior_version.expect("Invalid client configuration: A behavior major version must be set when sending a request or constructing a client. You must set it during client construction or by enabling the `behavior-version-latest` cargo feature.")) + )) // user config .with_client_plugin( @@ -1092,7 +1283,7 @@ pub(crate) fn base_client_runtime_plugins( .expect("All required fields have been set") ); - + for plugin in configured_plugins { plugins = plugins.with_client_plugin(plugin); @@ -1153,3 +1344,6 @@ pub mod retry; /// Timeout configuration. pub mod timeout; +/// Types needed to configure auth scheme resolution. +pub mod auth; + diff --git a/crates/superposition_sdk/src/config/auth.rs b/crates/superposition_sdk/src/config/auth.rs new file mode 100644 index 000000000..2650728ed --- /dev/null +++ b/crates/superposition_sdk/src/config/auth.rs @@ -0,0 +1,155 @@ +// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. +/// Auth scheme resolver trait specific to Superposition + pub trait ResolveAuthScheme: ::std::marker::Send + ::std::marker::Sync + ::std::fmt::Debug { + /// Resolve a priority list of auth scheme options with the given parameters + fn resolve_auth_scheme<'a>( + &'a self, + params: &'a crate::config::auth::Params, + cfg: &'a ::aws_smithy_types::config_bag::ConfigBag, + runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents, + ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a>; + + /// Convert this service-specific resolver into a `SharedAuthSchemeOptionResolver` + fn into_shared_resolver(self) -> ::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver + where + Self: ::std::marker::Sized + 'static, + { + ::aws_smithy_runtime_api::client::auth::SharedAuthSchemeOptionResolver::new(DowncastParams(self)) + } + } + + #[derive(Debug)] + struct DowncastParams(T); + impl ::aws_smithy_runtime_api::client::auth::ResolveAuthSchemeOptions for DowncastParams + where + T: ResolveAuthScheme, + { + fn resolve_auth_scheme_options_v2<'a>( + &'a self, + params: &'a ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams, + cfg: &'a ::aws_smithy_types::config_bag::ConfigBag, + runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents, + ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> { + match params.get::() { + ::std::option::Option::Some(concrete_params) => self.0.resolve_auth_scheme(concrete_params, cfg, runtime_components), + ::std::option::Option::None => ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(::std::result::Result::Err("params of expected type was not present".into())), + } + } + } + +/// The default auth scheme resolver + #[derive(Debug)] + #[allow(dead_code)] + pub struct DefaultAuthSchemeResolver { + service_defaults: Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>, + operation_overrides: ::std::collections::HashMap<&'static str, Vec<::aws_smithy_runtime_api::client::auth::AuthSchemeOption>>, + } + + // TODO(https://github.com/smithy-lang/smithy-rs/issues/4177): Remove `allow(...)` once the issue is addressed. + // When generating code for tests (e.g., `codegen-client-test`), this manual implementation + // of the `Default` trait may appear as if it could be derived automatically. + // However, that is not the case in production. + #[allow(clippy::derivable_impls)] + impl Default for DefaultAuthSchemeResolver { + fn default() -> Self { + Self { + service_defaults: vec![::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder() + .scheme_id(::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID) + .build() + .expect("required fields set") +, ::aws_smithy_runtime_api::client::auth::AuthSchemeOption::builder() + .scheme_id(::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID) + .build() + .expect("required fields set")], + operation_overrides: ::std::collections::HashMap::new(), + } + } + } + + impl crate::config::auth::ResolveAuthScheme for DefaultAuthSchemeResolver { + fn resolve_auth_scheme<'a>( + &'a self, + params: &'a crate::config::auth::Params, + _cfg: &'a ::aws_smithy_types::config_bag::ConfigBag, + _runtime_components: &'a ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponents, + ) -> ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture<'a> { + let operation_name = params.operation_name(); + + let modeled_auth_options = match self.operation_overrides.get(operation_name) { + Some(overrides) => overrides, + None => &self.service_defaults, + }; + + let _fut = ::aws_smithy_runtime_api::client::auth::AuthSchemeOptionsFuture::ready(Ok(modeled_auth_options.clone())); + + + + _fut + } + } + +/// Configuration parameters for resolving the correct auth scheme +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)] +pub struct Params { + operation_name: ::std::borrow::Cow<'static, str> +} +impl Params { + /// Create a builder for [`Params`] + pub fn builder() -> crate::config::auth::ParamsBuilder { + crate::config::auth::ParamsBuilder::default() + } + + /// Return the operation name for [`Params`] + pub fn operation_name(&self) -> &str { + self.operation_name.as_ref() + } +} + +#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)] +/// Builder for [`Params`] +pub struct ParamsBuilder { + operation_name: ::std::option::Option<::std::borrow::Cow<'static, str>>, +} +impl ParamsBuilder { + /// Set the operation name for the builder + pub fn operation_name(self, operation_name: impl Into<::std::borrow::Cow<'static, str>>) -> Self { + self.set_operation_name(::std::option::Option::Some(operation_name.into())) + } + + /// Set the operation name for the builder + pub fn set_operation_name(mut self, operation_name: ::std::option::Option<::std::borrow::Cow<'static, str>>) -> Self { + self.operation_name = operation_name; + self + } + /// Consume this builder, create [`Params`]." + /// + /// Return [`BuildError`] if any of the required fields are unset. + /// + pub fn build(self) -> ::std::result::Result { + ::std::result::Result::Ok(crate::config::auth::Params { + operation_name: self.operation_name + .ok_or_else(||BuildError::missing("operation_name"))? + }) + } +} + +/// An error that occurred while constructing `config::auth::Params` + #[derive(Debug)] + pub struct BuildError { + field: ::std::borrow::Cow<'static, str> + } + + impl BuildError { + fn missing(field: &'static str) -> Self { + Self { field: field.into() } + } + } + + impl std::fmt::Display for BuildError { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "a required field was missing: `{}`", self.field) + } + } + + impl std::error::Error for BuildError { } + diff --git a/crates/superposition_sdk/src/config/endpoint.rs b/crates/superposition_sdk/src/config/endpoint.rs index add19c5bf..49bc36070 100644 --- a/crates/superposition_sdk/src/config/endpoint.rs +++ b/crates/superposition_sdk/src/config/endpoint.rs @@ -5,9 +5,9 @@ pub use ::aws_smithy_runtime_api::client::endpoint::SharedEndpointResolver; #[cfg(test)] mod test { - - - + + + } /// Endpoint resolver trait specific to Superposition @@ -39,6 +39,7 @@ mod test { }; ep } + } #[non_exhaustive] @@ -67,23 +68,41 @@ impl ParamsBuilder { } /// An error that occurred during endpoint resolution - #[derive(Debug)] - pub struct InvalidParams { - field: std::borrow::Cow<'static, str> - } + #[derive(Debug)] + pub struct InvalidParams { + field: std::borrow::Cow<'static, str>, + kind: InvalidParamsErrorKind, + } - impl InvalidParams { - #[allow(dead_code)] - fn missing(field: &'static str) -> Self { - Self { field: field.into() } + /// The kind of invalid parameter error + #[derive(Debug)] + enum InvalidParamsErrorKind { + MissingField, + InvalidValue { + message: &'static str, + } } - } - impl std::fmt::Display for InvalidParams { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "a required field was missing: `{}`", self.field) + impl InvalidParams { + #[allow(dead_code)] + fn missing(field: &'static str) -> Self { + Self { field: field.into(), kind: InvalidParamsErrorKind::MissingField } + } + + #[allow(dead_code)] + fn invalid_value(field: &'static str, message: &'static str) -> Self { + Self { field: field.into(), kind: InvalidParamsErrorKind::InvalidValue { message }} + } + } + + impl std::fmt::Display for InvalidParams { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self.kind { + InvalidParamsErrorKind::MissingField => write!(f, "a required field was missing: `{}`", self.field), + InvalidParamsErrorKind::InvalidValue { message} => write!(f, "invalid value for field: `{}` - {}", self.field, message), + } + } } - } - impl std::error::Error for InvalidParams { } + impl std::error::Error for InvalidParams { } diff --git a/crates/superposition_sdk/src/config/retry.rs b/crates/superposition_sdk/src/config/retry.rs index 9c2f16bf7..29e072c66 100644 --- a/crates/superposition_sdk/src/config/retry.rs +++ b/crates/superposition_sdk/src/config/retry.rs @@ -4,5 +4,5 @@ pub use ::aws_smithy_runtime_api::client::retries::classifiers::ClassifyRetry; pub use ::aws_smithy_runtime_api::client::retries::ShouldAttempt; pub use ::aws_smithy_types::retry::{RetryConfig, RetryConfigBuilder, RetryMode, ReconnectMode}; -pub use ::aws_smithy_runtime::client::retries::RetryPartition; +pub use ::aws_smithy_runtime::client::retries::{ClientRateLimiter, RetryPartition, TokenBucket}; diff --git a/crates/superposition_sdk/src/json_errors.rs b/crates/superposition_sdk/src/json_errors.rs index 6ddf43d7f..68d6e8d43 100644 --- a/crates/superposition_sdk/src/json_errors.rs +++ b/crates/superposition_sdk/src/json_errors.rs @@ -12,7 +12,7 @@ use std::borrow::Cow; // currently only used by AwsJson #[allow(unused)] -pub fn is_error(response: &http::Response) -> bool { +pub fn is_error(response: &http_1x::Response) -> bool { !response.status().is_success() } @@ -36,7 +36,7 @@ struct ErrorBody<'a> { message: Option>, } -fn parse_error_body(bytes: &[u8]) -> Result { +fn parse_error_body(bytes: &[u8]) -> Result, DeserializeError> { let mut tokens = json_token_iter(bytes).peekable(); let (mut typ, mut code, mut message) = (None, None, None); if let Some(Token::StartObject { .. }) = tokens.next().transpose()? { @@ -105,7 +105,7 @@ mod test { #[test] fn error_metadata() { let response = HttpResponse::try_from( - http::Response::builder() + http_1x::Response::builder() .body(SdkBody::from( r#"{ "__type": "FooError", "message": "Go to foo" }"#, )) @@ -187,7 +187,7 @@ mod test { #[test] fn alternative_error_message_names() { let response = HttpResponse::try_from( - http::Response::builder() + http_1x::Response::builder() .header("x-amzn-errortype", "ResourceNotFoundException") .body(SdkBody::from( r#"{ diff --git a/crates/superposition_sdk/src/lib.rs b/crates/superposition_sdk/src/lib.rs index fbbea8035..ad4564e15 100644 --- a/crates/superposition_sdk/src/lib.rs +++ b/crates/superposition_sdk/src/lib.rs @@ -12,36 +12,40 @@ #![allow(clippy::derive_partial_eq_without_eq)] #![allow(clippy::result_large_err)] #![allow(clippy::unnecessary_map_on_constructor)] +#![allow(clippy::useless_conversion)] +#![allow(clippy::deprecated_semver)] #![allow(rustdoc::bare_urls)] #![allow(rustdoc::redundant_explicit_links)] +#![allow(rustdoc::broken_intra_doc_links)] +#![allow(rustdoc::invalid_html_tags)] #![forbid(unsafe_code)] #![warn(missing_docs)] -#![cfg_attr(docsrs, feature(doc_auto_cfg))] +#![cfg_attr(docsrs, feature(doc_cfg))] //! superposition_sdk -//! +//! //! # Crate Organization -//! +//! //! The entry point for most customers will be [`Client`], which exposes one method for each API //! offered by Superposition. The return value of each of these methods is a "fluent builder", //! where the different inputs for that API are added by builder-style function call chaining, //! followed by calling `send()` to get a [`Future`](std::future::Future) that will result in //! either a successful output or a [`SdkError`](crate::error::SdkError). -//! +//! //! Some of these API inputs may be structs or enums to provide more complex structured information. //! These structs and enums live in [`types`](crate::types). There are some simpler types for //! representing data such as date times or binary blobs that live in [`primitives`](crate::primitives). -//! +//! //! All types required to configure a client via the [`Config`](crate::Config) struct live //! in [`config`](crate::config). -//! +//! //! The [`operation`](crate::operation) module has a submodule for every API, and in each submodule //! is the input, output, and error type for that API, as well as builders to construct each of those. -//! +//! //! There is a top-level [`Error`](crate::Error) type that encompasses all the errors that the //! client can return. Any other error type can be converted to this `Error` type via the //! [`From`](std::convert::From) trait. -//! +//! //! The other modules within this crate are not required for normal usage. @@ -52,47 +56,47 @@ pub use error_meta::Error; pub use config::Config; /// Client for calling Superposition. -/// +/// /// ## Constructing a `Client` -/// +/// /// A `Client` requires a config in order to be constructed. With the default set of Cargo features, /// this config will only require an endpoint to produce a functioning client. However, some Smithy /// features will require additional configuration. For example, `@auth` requires some kind of identity /// or identity resolver to be configured. The config is used to customize various aspects of the client, /// such as: -/// +/// /// - [The underlying HTTP client](crate::config::Builder::http_client) /// - [Retries](crate::config::Builder::retry_config) /// - [Timeouts](crate::config::Builder::timeout_config) /// - [... and more](crate::config::Builder) -/// +/// /// Below is a minimal example of how to create a client: -/// +/// /// ```rust,no_run /// let config = superposition_sdk::Config::builder() /// .endpoint_url("http://localhost:1234") /// .build(); /// let client = superposition_sdk::Client::from_conf(config); /// ``` -/// +/// /// _Note:_ Client construction is expensive due to connection thread pool initialization, and should be done /// once at application start-up. Cloning a client is cheap (it's just an [`Arc`](std::sync::Arc) under the hood), /// so creating it once at start-up and cloning it around the application as needed is recommended. /// # Using the `Client` -/// +/// /// A client has a function for every operation that can be performed by the service. /// For example, the [`AddMembersToGroup`](crate::operation::add_members_to_group) operation has /// a [`Client::add_members_to_group`], function which returns a builder for that operation. /// The fluent builder ultimately has a `send()` function that returns an async future that /// returns a result, as illustrated below: -/// +/// /// ```rust,ignore /// let result = client.add_members_to_group() /// .workspace_id("example") /// .send() /// .await; /// ``` -/// +/// /// The underlying HTTP requests that get made by this can be modified with the `customize_operation` /// function on the fluent builder. See the [`customize`](crate::client::customize) module for more /// information. @@ -115,8 +119,6 @@ pub mod primitives; /// Data structures used by operation inputs/outputs. pub mod types; -mod auth_plugin; - /// All operations that this crate can perform. pub mod operation; diff --git a/crates/superposition_sdk/src/operation/add_members_to_group.rs b/crates/superposition_sdk/src/operation/add_members_to_group.rs index fc296e7e8..ff4d0d39b 100644 --- a/crates/superposition_sdk/src/operation/add_members_to_group.rs +++ b/crates/superposition_sdk/src/operation/add_members_to_group.rs @@ -23,7 +23,7 @@ impl AddMembersToGroup { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::add_members_to_group::AddMembersToGroupInput, @@ -45,20 +45,18 @@ impl AddMembersToGroup { "rpc.service" = "Superposition", "rpc.method" = "AddMembersToGroup", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for AddMemb cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(AddMembersToGroupRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(AddMembersToGroupResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("AddMembersToGroup") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "AddMembersToGroup", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for AddMemb fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("AddMembersToGroup") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(AddMembersToGroupEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(AddMembersToGroupEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for AddMemb } } - + #[derive(Debug)] struct AddMembersToGroupResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for AddMembersToGroupResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_add_members_to_group::de_add_members_to_group_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for AddMemb let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::add_members_to_group::AddMembersToGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::add_members_to_group::AddMembersToGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for AddMemb #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::add_members_to_group::AddMembersToGroupInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_add_members_to_group::ser_add_members_to_group_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_add_members_to_group::ser_add_members_to_group_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct AddMembersToGroupEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for AddMembersToGroupEndpointParamsInterceptor { fn name(&self) -> &'static str { "AddMembersToGroupEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to AddMembersToGroupInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `AddMembersToGroupError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl AddMembersToGroupError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `AddMembersToGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -308,10 +312,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for AddMembe } } -pub use crate::operation::add_members_to_group::_add_members_to_group_output::AddMembersToGroupOutput; - pub use crate::operation::add_members_to_group::_add_members_to_group_input::AddMembersToGroupInput; +pub use crate::operation::add_members_to_group::_add_members_to_group_output::AddMembersToGroupOutput; + mod _add_members_to_group_input; mod _add_members_to_group_output; diff --git a/crates/superposition_sdk/src/operation/add_members_to_group/_add_members_to_group_input.rs b/crates/superposition_sdk/src/operation/add_members_to_group/_add_members_to_group_input.rs index 8de9e805d..e95f1a443 100644 --- a/crates/superposition_sdk/src/operation/add_members_to_group/_add_members_to_group_input.rs +++ b/crates/superposition_sdk/src/operation/add_members_to_group/_add_members_to_group_input.rs @@ -33,7 +33,7 @@ impl AddMembersToGroupInput { self.change_reason.as_deref() } /// List of experiment IDs to add/remove to this group. - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.member_experiment_ids.is_none()`. pub fn member_experiment_ids(&self) -> &[::std::string::String] { self.member_experiment_ids.as_deref() diff --git a/crates/superposition_sdk/src/operation/add_members_to_group/builders.rs b/crates/superposition_sdk/src/operation/add_members_to_group/builders.rs index 4dfac95f9..33f1e59f3 100644 --- a/crates/superposition_sdk/src/operation/add_members_to_group/builders.rs +++ b/crates/superposition_sdk/src/operation/add_members_to_group/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::add_members_to_group::_add_members_to_group_output::AddMembersToGroupOutputBuilder; - pub use crate::operation::add_members_to_group::_add_members_to_group_input::AddMembersToGroupInputBuilder; +pub use crate::operation::add_members_to_group::_add_members_to_group_output::AddMembersToGroupOutputBuilder; + impl crate::operation::add_members_to_group::builders::AddMembersToGroupInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::add_members_to_group::builders::AddMembersToGroupInputBui } } /// Fluent builder constructing a request to `AddMembersToGroup`. -/// +/// /// Adds members to an existing experiment group. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct AddMembersToGroupFluentBuilder { @@ -74,7 +74,7 @@ impl AddMembersToGroupFluentBuilder { ); crate::operation::add_members_to_group::AddMembersToGroup::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl AddMembersToGroupFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -152,11 +152,11 @@ impl AddMembersToGroupFluentBuilder { pub fn get_change_reason(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_change_reason() } - /// + /// /// Appends an item to `member_experiment_ids`. - /// + /// /// To override the contents of this collection use [`set_member_experiment_ids`](Self::set_member_experiment_ids). - /// + /// /// List of experiment IDs to add/remove to this group. pub fn member_experiment_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.member_experiment_ids(input.into()); diff --git a/crates/superposition_sdk/src/operation/applicable_variants.rs b/crates/superposition_sdk/src/operation/applicable_variants.rs index c9451ba0d..dd9222676 100644 --- a/crates/superposition_sdk/src/operation/applicable_variants.rs +++ b/crates/superposition_sdk/src/operation/applicable_variants.rs @@ -23,7 +23,7 @@ impl ApplicableVariants { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::applicable_variants::ApplicableVariantsInput, @@ -45,20 +45,18 @@ impl ApplicableVariants { "rpc.service" = "Superposition", "rpc.method" = "ApplicableVariants", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Applica cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ApplicableVariantsRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ApplicableVariantsResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ApplicableVariants") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ApplicableVariants", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Applica fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ApplicableVariants") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ApplicableVariantsEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ApplicableVariantsEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Applica } } - + #[derive(Debug)] struct ApplicableVariantsResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ApplicableVariantsResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_applicable_variants::de_applicable_variants_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Applica let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::applicable_variants::ApplicableVariantsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::applicable_variants::ApplicableVariantsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/experiments/applicable-variants").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -154,22 +157,22 @@ fn uri_query(_input: &crate::operation::applicable_variants::ApplicableVariantsI #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::applicable_variants::ApplicableVariantsInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_applicable_variants::ser_applicable_variants_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_applicable_variants::ser_applicable_variants_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -177,6 +180,7 @@ builder #[derive(Debug)] struct ApplicableVariantsEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ApplicableVariantsEndpointParamsInterceptor { fn name(&self) -> &'static str { "ApplicableVariantsEndpointParamsInterceptor" @@ -191,10 +195,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ApplicableVariantsInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -205,7 +209,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ApplicableVariantsError` operation. #[non_exhaustive] @@ -227,15 +231,15 @@ impl ApplicableVariantsError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ApplicableVariantsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for Applicab } } -pub use crate::operation::applicable_variants::_applicable_variants_output::ApplicableVariantsOutput; - pub use crate::operation::applicable_variants::_applicable_variants_input::ApplicableVariantsInput; +pub use crate::operation::applicable_variants::_applicable_variants_output::ApplicableVariantsOutput; + mod _applicable_variants_input; mod _applicable_variants_output; diff --git a/crates/superposition_sdk/src/operation/applicable_variants/_applicable_variants_input.rs b/crates/superposition_sdk/src/operation/applicable_variants/_applicable_variants_input.rs index 563838df2..a678009e7 100644 --- a/crates/superposition_sdk/src/operation/applicable_variants/_applicable_variants_input.rs +++ b/crates/superposition_sdk/src/operation/applicable_variants/_applicable_variants_input.rs @@ -32,7 +32,7 @@ impl ApplicableVariantsInput { self.identifier.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.prefix.is_none()`. pub fn prefix(&self) -> &[::std::string::String] { self.prefix.as_deref() diff --git a/crates/superposition_sdk/src/operation/applicable_variants/builders.rs b/crates/superposition_sdk/src/operation/applicable_variants/builders.rs index dbffde4f0..884e3c2cc 100644 --- a/crates/superposition_sdk/src/operation/applicable_variants/builders.rs +++ b/crates/superposition_sdk/src/operation/applicable_variants/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::applicable_variants::_applicable_variants_output::ApplicableVariantsOutputBuilder; - pub use crate::operation::applicable_variants::_applicable_variants_input::ApplicableVariantsInputBuilder; +pub use crate::operation::applicable_variants::_applicable_variants_output::ApplicableVariantsOutputBuilder; + impl crate::operation::applicable_variants::builders::ApplicableVariantsInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::applicable_variants::builders::ApplicableVariantsInputBui } } /// Fluent builder constructing a request to `ApplicableVariants`. -/// +/// /// Determines which experiment variants are applicable to a given context, used for experiment evaluation and variant selection. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ApplicableVariantsFluentBuilder { @@ -74,7 +74,7 @@ impl ApplicableVariantsFluentBuilder { ); crate::operation::applicable_variants::ApplicableVariants::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ApplicableVariantsFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -124,11 +124,11 @@ impl ApplicableVariantsFluentBuilder { pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_org_id() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Represents conditional criteria used for context matching. Keys define dimension names and values specify the criteria that must be met. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); @@ -157,11 +157,11 @@ impl ApplicableVariantsFluentBuilder { pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_identifier() } - /// + /// /// Appends an item to `prefix`. - /// + /// /// To override the contents of this collection use [`set_prefix`](Self::set_prefix). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.prefix(input.into()); diff --git a/crates/superposition_sdk/src/operation/bulk_operation.rs b/crates/superposition_sdk/src/operation/bulk_operation.rs index 5f2564e2c..728ecd04c 100644 --- a/crates/superposition_sdk/src/operation/bulk_operation.rs +++ b/crates/superposition_sdk/src/operation/bulk_operation.rs @@ -23,7 +23,7 @@ impl BulkOperation { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::bulk_operation::BulkOperationInput, @@ -45,20 +45,18 @@ impl BulkOperation { "rpc.service" = "Superposition", "rpc.method" = "BulkOperation", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for BulkOpe cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(BulkOperationRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(BulkOperationResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("BulkOperation") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "BulkOperation", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for BulkOpe fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("BulkOperation") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(BulkOperationEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(BulkOperationEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for BulkOpe } } - + #[derive(Debug)] struct BulkOperationResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for BulkOperationResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_bulk_operation::de_bulk_operation_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for BulkOpe let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::bulk_operation::BulkOperationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::bulk_operation::BulkOperationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/context/bulk-operations").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for BulkOpe #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::bulk_operation::BulkOperationInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_bulk_operation::ser_bulk_operation_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PUT").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_bulk_operation::ser_bulk_operation_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct BulkOperationEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for BulkOperationEndpointParamsInterceptor { fn name(&self) -> &'static str { "BulkOperationEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to BulkOperationInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `BulkOperationError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl BulkOperationError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `BulkOperationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -318,10 +322,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for BulkOper } } -pub use crate::operation::bulk_operation::_bulk_operation_output::BulkOperationOutput; - pub use crate::operation::bulk_operation::_bulk_operation_input::BulkOperationInput; +pub use crate::operation::bulk_operation::_bulk_operation_output::BulkOperationOutput; + mod _bulk_operation_input; mod _bulk_operation_output; diff --git a/crates/superposition_sdk/src/operation/bulk_operation/_bulk_operation_input.rs b/crates/superposition_sdk/src/operation/bulk_operation/_bulk_operation_input.rs index cf8c1c966..211d0af3b 100644 --- a/crates/superposition_sdk/src/operation/bulk_operation/_bulk_operation_input.rs +++ b/crates/superposition_sdk/src/operation/bulk_operation/_bulk_operation_input.rs @@ -26,7 +26,7 @@ impl BulkOperationInput { self.config_tags.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.operations.is_none()`. pub fn operations(&self) -> &[crate::types::ContextAction] { self.operations.as_deref() diff --git a/crates/superposition_sdk/src/operation/bulk_operation/builders.rs b/crates/superposition_sdk/src/operation/bulk_operation/builders.rs index 823d72463..774880f55 100644 --- a/crates/superposition_sdk/src/operation/bulk_operation/builders.rs +++ b/crates/superposition_sdk/src/operation/bulk_operation/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::bulk_operation::_bulk_operation_output::BulkOperationOutputBuilder; - pub use crate::operation::bulk_operation::_bulk_operation_input::BulkOperationInputBuilder; +pub use crate::operation::bulk_operation::_bulk_operation_output::BulkOperationOutputBuilder; + impl crate::operation::bulk_operation::builders::BulkOperationInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::bulk_operation::builders::BulkOperationInputBuilder { } } /// Fluent builder constructing a request to `BulkOperation`. -/// +/// /// Executes multiple context operations (PUT, REPLACE, DELETE, MOVE) in a single atomic transaction for efficient batch processing. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct BulkOperationFluentBuilder { @@ -74,7 +74,7 @@ impl BulkOperationFluentBuilder { ); crate::operation::bulk_operation::BulkOperation::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl BulkOperationFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -138,11 +138,11 @@ impl BulkOperationFluentBuilder { pub fn get_config_tags(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_config_tags() } - /// + /// /// Appends an item to `operations`. - /// + /// /// To override the contents of this collection use [`set_operations`](Self::set_operations). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn operations(mut self, input: crate::types::ContextAction) -> Self { self.inner = self.inner.operations(input); diff --git a/crates/superposition_sdk/src/operation/conclude_experiment.rs b/crates/superposition_sdk/src/operation/conclude_experiment.rs index c2250ddb0..d8b629eee 100644 --- a/crates/superposition_sdk/src/operation/conclude_experiment.rs +++ b/crates/superposition_sdk/src/operation/conclude_experiment.rs @@ -23,7 +23,7 @@ impl ConcludeExperiment { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::conclude_experiment::ConcludeExperimentInput, @@ -45,20 +45,18 @@ impl ConcludeExperiment { "rpc.service" = "Superposition", "rpc.method" = "ConcludeExperiment", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Conclud cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ConcludeExperimentRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ConcludeExperimentResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ConcludeExperiment") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ConcludeExperiment", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Conclud fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ConcludeExperiment") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ConcludeExperimentEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ConcludeExperimentEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Conclud } } - + #[derive(Debug)] struct ConcludeExperimentResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ConcludeExperimentResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_conclude_experiment::de_conclude_experiment_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Conclud let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::conclude_experiment::ConcludeExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::conclude_experiment::ConcludeExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Conclud #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::conclude_experiment::ConcludeExperimentInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_conclude_experiment::ser_conclude_experiment_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_conclude_experiment::ser_conclude_experiment_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct ConcludeExperimentEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ConcludeExperimentEndpointParamsInterceptor { fn name(&self) -> &'static str { "ConcludeExperimentEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ConcludeExperimentInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ConcludeExperimentError` operation. #[non_exhaustive] @@ -219,15 +223,15 @@ impl ConcludeExperimentError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ConcludeExperimentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -324,10 +328,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for Conclude } } -pub use crate::operation::conclude_experiment::_conclude_experiment_output::ConcludeExperimentOutput; - pub use crate::operation::conclude_experiment::_conclude_experiment_input::ConcludeExperimentInput; +pub use crate::operation::conclude_experiment::_conclude_experiment_output::ConcludeExperimentOutput; + mod _conclude_experiment_input; mod _conclude_experiment_output; diff --git a/crates/superposition_sdk/src/operation/conclude_experiment/builders.rs b/crates/superposition_sdk/src/operation/conclude_experiment/builders.rs index a14cf15fe..50bd4de05 100644 --- a/crates/superposition_sdk/src/operation/conclude_experiment/builders.rs +++ b/crates/superposition_sdk/src/operation/conclude_experiment/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::conclude_experiment::_conclude_experiment_output::ConcludeExperimentOutputBuilder; - pub use crate::operation::conclude_experiment::_conclude_experiment_input::ConcludeExperimentInputBuilder; +pub use crate::operation::conclude_experiment::_conclude_experiment_output::ConcludeExperimentOutputBuilder; + impl crate::operation::conclude_experiment::builders::ConcludeExperimentInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::conclude_experiment::builders::ConcludeExperimentInputBui } } /// Fluent builder constructing a request to `ConcludeExperiment`. -/// +/// /// Concludes an inprogress experiment by selecting a winning variant and transitioning the experiment to a concluded state. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ConcludeExperimentFluentBuilder { @@ -74,7 +74,7 @@ impl ConcludeExperimentFluentBuilder { ); crate::operation::conclude_experiment::ConcludeExperiment::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ConcludeExperimentFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/create_context.rs b/crates/superposition_sdk/src/operation/create_context.rs index 58a413290..94dbcf87c 100644 --- a/crates/superposition_sdk/src/operation/create_context.rs +++ b/crates/superposition_sdk/src/operation/create_context.rs @@ -23,7 +23,7 @@ impl CreateContext { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_context::CreateContextInput, @@ -45,20 +45,18 @@ impl CreateContext { "rpc.service" = "Superposition", "rpc.method" = "CreateContext", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateC cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateContextRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateContextResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateContext") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateContext", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateC fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateContext") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateContextEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateContextEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateC } } - + #[derive(Debug)] struct CreateContextResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateContextResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_context::de_create_context_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateC let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_context::CreateContextInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_context::CreateContextInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/context").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateC #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_context::CreateContextInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_context::ser_create_context_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PUT").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_context_input::ser_request_http_payload(& input.request)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateContextEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateContextEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateContextEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateContextInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateContextError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl CreateContextError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateContextError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -318,10 +322,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateCo } } -pub use crate::operation::create_context::_create_context_output::CreateContextOutput; - pub use crate::operation::create_context::_create_context_input::CreateContextInput; +pub use crate::operation::create_context::_create_context_output::CreateContextOutput; + mod _create_context_input; mod _create_context_output; diff --git a/crates/superposition_sdk/src/operation/create_context/builders.rs b/crates/superposition_sdk/src/operation/create_context/builders.rs index a56c015ee..b74cf9b9e 100644 --- a/crates/superposition_sdk/src/operation/create_context/builders.rs +++ b/crates/superposition_sdk/src/operation/create_context/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_context::_create_context_output::CreateContextOutputBuilder; - pub use crate::operation::create_context::_create_context_input::CreateContextInputBuilder; +pub use crate::operation::create_context::_create_context_output::CreateContextOutputBuilder; + impl crate::operation::create_context::builders::CreateContextInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_context::builders::CreateContextInputBuilder { } } /// Fluent builder constructing a request to `CreateContext`. -/// +/// /// Creates a new context with specified conditions and overrides. Contexts define conditional rules for config management. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateContextFluentBuilder { @@ -74,7 +74,7 @@ impl CreateContextFluentBuilder { ); crate::operation::create_context::CreateContext::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateContextFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/create_default_config.rs b/crates/superposition_sdk/src/operation/create_default_config.rs index 5affbf34d..61ee66ad4 100644 --- a/crates/superposition_sdk/src/operation/create_default_config.rs +++ b/crates/superposition_sdk/src/operation/create_default_config.rs @@ -23,7 +23,7 @@ impl CreateDefaultConfig { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_default_config::CreateDefaultConfigInput, @@ -45,20 +45,18 @@ impl CreateDefaultConfig { "rpc.service" = "Superposition", "rpc.method" = "CreateDefaultConfig", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateD cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateDefaultConfigRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateDefaultConfigResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateDefaultConfig") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateDefaultConfig", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateD fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateDefaultConfig") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateDefaultConfigEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateDefaultConfigEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateD } } - + #[derive(Debug)] struct CreateDefaultConfigResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateDefaultConfigResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_default_config::de_create_default_config_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateD let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_default_config::CreateDefaultConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_default_config::CreateDefaultConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/default-config").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateD #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_default_config::CreateDefaultConfigInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_default_config::ser_create_default_config_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_default_config::ser_create_default_config_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateDefaultConfigEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateDefaultConfigEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateDefaultConfigEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateDefaultConfigInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateDefaultConfigError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl CreateDefaultConfigError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateDefaultConfigError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::WebhookFailed(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -318,10 +322,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateDe } } -pub use crate::operation::create_default_config::_create_default_config_output::CreateDefaultConfigOutput; - pub use crate::operation::create_default_config::_create_default_config_input::CreateDefaultConfigInput; +pub use crate::operation::create_default_config::_create_default_config_output::CreateDefaultConfigOutput; + mod _create_default_config_input; mod _create_default_config_output; diff --git a/crates/superposition_sdk/src/operation/create_default_config/builders.rs b/crates/superposition_sdk/src/operation/create_default_config/builders.rs index 8b3e5ca3d..f909f32c9 100644 --- a/crates/superposition_sdk/src/operation/create_default_config/builders.rs +++ b/crates/superposition_sdk/src/operation/create_default_config/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_default_config::_create_default_config_output::CreateDefaultConfigOutputBuilder; - pub use crate::operation::create_default_config::_create_default_config_input::CreateDefaultConfigInputBuilder; +pub use crate::operation::create_default_config::_create_default_config_output::CreateDefaultConfigOutputBuilder; + impl crate::operation::create_default_config::builders::CreateDefaultConfigInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_default_config::builders::CreateDefaultConfigInput } } /// Fluent builder constructing a request to `CreateDefaultConfig`. -/// +/// /// Creates a new default config entry with specified key, value, schema, and metadata. Default configs serve as fallback values when no specific context matches. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateDefaultConfigFluentBuilder { @@ -74,7 +74,7 @@ impl CreateDefaultConfigFluentBuilder { ); crate::operation::create_default_config::CreateDefaultConfig::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateDefaultConfigFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -124,11 +124,11 @@ impl CreateDefaultConfigFluentBuilder { pub fn get_value(&self) -> &::std::option::Option<::aws_smithy_types::Document> { self.inner.get_value() } - /// + /// /// Adds a key-value pair to `schema`. - /// + /// /// To override the contents of this collection use [`set_schema`](Self::set_schema). - /// + /// /// Generic key-value object structure used for flexible data representation throughout the API. pub fn schema(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.schema(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/create_dimension.rs b/crates/superposition_sdk/src/operation/create_dimension.rs index d4b96cbbc..aba9f2097 100644 --- a/crates/superposition_sdk/src/operation/create_dimension.rs +++ b/crates/superposition_sdk/src/operation/create_dimension.rs @@ -23,7 +23,7 @@ impl CreateDimension { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_dimension::CreateDimensionInput, @@ -45,20 +45,18 @@ impl CreateDimension { "rpc.service" = "Superposition", "rpc.method" = "CreateDimension", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateD cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateDimensionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateDimensionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateDimension") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateDimension", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateD fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateDimension") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateDimensionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateDimensionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateD } } - + #[derive(Debug)] struct CreateDimensionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateDimensionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_dimension::de_create_dimension_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateD let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_dimension::CreateDimensionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_dimension::CreateDimensionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/dimension").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateD #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_dimension::CreateDimensionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_dimension::ser_create_dimension_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_dimension::ser_create_dimension_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateDimensionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateDimensionEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateDimensionEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateDimensionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateDimensionError` operation. #[non_exhaustive] @@ -211,15 +215,15 @@ impl CreateDimensionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateDimensionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::WebhookFailed(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -302,10 +306,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateDi } } -pub use crate::operation::create_dimension::_create_dimension_output::CreateDimensionOutput; - pub use crate::operation::create_dimension::_create_dimension_input::CreateDimensionInput; +pub use crate::operation::create_dimension::_create_dimension_output::CreateDimensionOutput; + mod _create_dimension_input; mod _create_dimension_output; diff --git a/crates/superposition_sdk/src/operation/create_dimension/builders.rs b/crates/superposition_sdk/src/operation/create_dimension/builders.rs index d8e6befb9..49108e5df 100644 --- a/crates/superposition_sdk/src/operation/create_dimension/builders.rs +++ b/crates/superposition_sdk/src/operation/create_dimension/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_dimension::_create_dimension_output::CreateDimensionOutputBuilder; - pub use crate::operation::create_dimension::_create_dimension_input::CreateDimensionInputBuilder; +pub use crate::operation::create_dimension::_create_dimension_output::CreateDimensionOutputBuilder; + impl crate::operation::create_dimension::builders::CreateDimensionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_dimension::builders::CreateDimensionInputBuilder { } } /// Fluent builder constructing a request to `CreateDimension`. -/// +/// /// Creates a new dimension with the specified json schema. Dimensions define categorical attributes used for context-based config management. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateDimensionFluentBuilder { @@ -74,7 +74,7 @@ impl CreateDimensionFluentBuilder { ); crate::operation::create_dimension::CreateDimension::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateDimensionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -152,11 +152,11 @@ impl CreateDimensionFluentBuilder { pub fn get_position(&self) -> &::std::option::Option { self.inner.get_position() } - /// + /// /// Adds a key-value pair to `schema`. - /// + /// /// To override the contents of this collection use [`set_schema`](Self::set_schema). - /// + /// /// Generic key-value object structure used for flexible data representation throughout the API. pub fn schema(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.schema(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/create_experiment.rs b/crates/superposition_sdk/src/operation/create_experiment.rs index c1aa041b1..a9a815947 100644 --- a/crates/superposition_sdk/src/operation/create_experiment.rs +++ b/crates/superposition_sdk/src/operation/create_experiment.rs @@ -23,7 +23,7 @@ impl CreateExperiment { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_experiment::CreateExperimentInput, @@ -45,20 +45,18 @@ impl CreateExperiment { "rpc.service" = "Superposition", "rpc.method" = "CreateExperiment", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateE cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateExperimentRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateExperimentResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateExperiment") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateExperiment", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateE fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateExperiment") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateExperimentEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateExperimentEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateE } } - + #[derive(Debug)] struct CreateExperimentResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateExperimentResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_experiment::de_create_experiment_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateE let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_experiment::CreateExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_experiment::CreateExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/experiments").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateE #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_experiment::CreateExperimentInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_experiment::ser_create_experiment_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_experiment::ser_create_experiment_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateExperimentEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateExperimentEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateExperimentEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateExperimentInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateExperimentError` operation. #[non_exhaustive] @@ -211,15 +215,15 @@ impl CreateExperimentError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateExperimentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::WebhookFailed(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -302,10 +306,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateEx } } -pub use crate::operation::create_experiment::_create_experiment_output::CreateExperimentOutput; - pub use crate::operation::create_experiment::_create_experiment_input::CreateExperimentInput; +pub use crate::operation::create_experiment::_create_experiment_output::CreateExperimentOutput; + mod _create_experiment_input; mod _create_experiment_output; diff --git a/crates/superposition_sdk/src/operation/create_experiment/_create_experiment_input.rs b/crates/superposition_sdk/src/operation/create_experiment/_create_experiment_input.rs index 034d42edb..40ff0435f 100644 --- a/crates/superposition_sdk/src/operation/create_experiment/_create_experiment_input.rs +++ b/crates/superposition_sdk/src/operation/create_experiment/_create_experiment_input.rs @@ -50,7 +50,7 @@ impl CreateExperimentInput { self.context.as_ref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.variants.is_none()`. pub fn variants(&self) -> &[crate::types::Variant] { self.variants.as_deref() diff --git a/crates/superposition_sdk/src/operation/create_experiment/builders.rs b/crates/superposition_sdk/src/operation/create_experiment/builders.rs index 3b3003c9d..904267271 100644 --- a/crates/superposition_sdk/src/operation/create_experiment/builders.rs +++ b/crates/superposition_sdk/src/operation/create_experiment/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_experiment::_create_experiment_output::CreateExperimentOutputBuilder; - pub use crate::operation::create_experiment::_create_experiment_input::CreateExperimentInputBuilder; +pub use crate::operation::create_experiment::_create_experiment_output::CreateExperimentOutputBuilder; + impl crate::operation::create_experiment::builders::CreateExperimentInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_experiment::builders::CreateExperimentInputBuilder } } /// Fluent builder constructing a request to `CreateExperiment`. -/// +/// /// Creates a new experiment with variants, context and conditions. You can optionally specify metrics and experiment group for tracking and analysis. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateExperimentFluentBuilder { @@ -74,7 +74,7 @@ impl CreateExperimentFluentBuilder { ); crate::operation::create_experiment::CreateExperiment::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateExperimentFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -152,11 +152,11 @@ impl CreateExperimentFluentBuilder { pub fn get_experiment_type(&self) -> &::std::option::Option { self.inner.get_experiment_type() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Represents conditional criteria used for context matching. Keys define dimension names and values specify the criteria that must be met. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); @@ -171,11 +171,11 @@ impl CreateExperimentFluentBuilder { pub fn get_context(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> { self.inner.get_context() } - /// + /// /// Appends an item to `variants`. - /// + /// /// To override the contents of this collection use [`set_variants`](Self::set_variants). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn variants(mut self, input: crate::types::Variant) -> Self { self.inner = self.inner.variants(input); diff --git a/crates/superposition_sdk/src/operation/create_experiment_group.rs b/crates/superposition_sdk/src/operation/create_experiment_group.rs index 5755c5208..71f16df55 100644 --- a/crates/superposition_sdk/src/operation/create_experiment_group.rs +++ b/crates/superposition_sdk/src/operation/create_experiment_group.rs @@ -23,7 +23,7 @@ impl CreateExperimentGroup { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_experiment_group::CreateExperimentGroupInput, @@ -45,20 +45,18 @@ impl CreateExperimentGroup { "rpc.service" = "Superposition", "rpc.method" = "CreateExperimentGroup", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateE cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateExperimentGroupRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateExperimentGroupResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateExperimentGroup") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateExperimentGroup", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateE fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateExperimentGroup") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateExperimentGroupEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateExperimentGroupEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateE } } - + #[derive(Debug)] struct CreateExperimentGroupResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateExperimentGroupResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_experiment_group::de_create_experiment_group_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateE let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_experiment_group::CreateExperimentGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_experiment_group::CreateExperimentGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/experiment-groups").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateE #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_experiment_group::CreateExperimentGroupInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_experiment_group::ser_create_experiment_group_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_experiment_group::ser_create_experiment_group_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateExperimentGroupEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateExperimentGroupEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateExperimentGroupEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateExperimentGroupInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateExperimentGroupError` operation. #[non_exhaustive] @@ -209,15 +213,15 @@ impl CreateExperimentGroupError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateExperimentGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -286,10 +290,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateEx } } -pub use crate::operation::create_experiment_group::_create_experiment_group_output::CreateExperimentGroupOutput; - pub use crate::operation::create_experiment_group::_create_experiment_group_input::CreateExperimentGroupInput; +pub use crate::operation::create_experiment_group::_create_experiment_group_output::CreateExperimentGroupOutput; + mod _create_experiment_group_input; mod _create_experiment_group_output; diff --git a/crates/superposition_sdk/src/operation/create_experiment_group/_create_experiment_group_input.rs b/crates/superposition_sdk/src/operation/create_experiment_group/_create_experiment_group_input.rs index c37c40a37..3322e9551 100644 --- a/crates/superposition_sdk/src/operation/create_experiment_group/_create_experiment_group_input.rs +++ b/crates/superposition_sdk/src/operation/create_experiment_group/_create_experiment_group_input.rs @@ -51,7 +51,7 @@ impl CreateExperimentGroupInput { self.traffic_percentage } /// List of experiment IDs that are members of this group. - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.member_experiment_ids.is_none()`. pub fn member_experiment_ids(&self) -> &[::std::string::String] { self.member_experiment_ids.as_deref() diff --git a/crates/superposition_sdk/src/operation/create_experiment_group/builders.rs b/crates/superposition_sdk/src/operation/create_experiment_group/builders.rs index cebf5a6c0..828fa1370 100644 --- a/crates/superposition_sdk/src/operation/create_experiment_group/builders.rs +++ b/crates/superposition_sdk/src/operation/create_experiment_group/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_experiment_group::_create_experiment_group_output::CreateExperimentGroupOutputBuilder; - pub use crate::operation::create_experiment_group::_create_experiment_group_input::CreateExperimentGroupInputBuilder; +pub use crate::operation::create_experiment_group::_create_experiment_group_output::CreateExperimentGroupOutputBuilder; + impl crate::operation::create_experiment_group::builders::CreateExperimentGroupInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_experiment_group::builders::CreateExperimentGroupI } } /// Fluent builder constructing a request to `CreateExperimentGroup`. -/// +/// /// Creates a new experiment group. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateExperimentGroupFluentBuilder { @@ -74,7 +74,7 @@ impl CreateExperimentGroupFluentBuilder { ); crate::operation::create_experiment_group::CreateExperimentGroup::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateExperimentGroupFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -166,11 +166,11 @@ impl CreateExperimentGroupFluentBuilder { pub fn get_change_reason(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_change_reason() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Represents conditional criteria used for context matching. Keys define dimension names and values specify the criteria that must be met. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); @@ -199,11 +199,11 @@ impl CreateExperimentGroupFluentBuilder { pub fn get_traffic_percentage(&self) -> &::std::option::Option { self.inner.get_traffic_percentage() } - /// + /// /// Appends an item to `member_experiment_ids`. - /// + /// /// To override the contents of this collection use [`set_member_experiment_ids`](Self::set_member_experiment_ids). - /// + /// /// List of experiment IDs that are members of this group. pub fn member_experiment_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.member_experiment_ids(input.into()); diff --git a/crates/superposition_sdk/src/operation/create_function.rs b/crates/superposition_sdk/src/operation/create_function.rs index 2fd305423..bcff15328 100644 --- a/crates/superposition_sdk/src/operation/create_function.rs +++ b/crates/superposition_sdk/src/operation/create_function.rs @@ -23,7 +23,7 @@ impl CreateFunction { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_function::CreateFunctionInput, @@ -45,20 +45,18 @@ impl CreateFunction { "rpc.service" = "Superposition", "rpc.method" = "CreateFunction", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateF cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateFunctionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateFunctionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateFunction") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateFunction", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateF fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateFunction") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateFunctionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateFunctionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateF } } - + #[derive(Debug)] struct CreateFunctionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateFunctionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_function::de_create_function_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateF let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_function::CreateFunctionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_function::CreateFunctionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/function").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateF #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_function::CreateFunctionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_function::ser_create_function_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_function::ser_create_function_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateFunctionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateFunctionEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateFunctionEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateFunctionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateFunctionError` operation. #[non_exhaustive] @@ -209,15 +213,15 @@ impl CreateFunctionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateFunctionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -286,10 +290,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateFu } } -pub use crate::operation::create_function::_create_function_output::CreateFunctionOutput; - pub use crate::operation::create_function::_create_function_input::CreateFunctionInput; +pub use crate::operation::create_function::_create_function_output::CreateFunctionOutput; + mod _create_function_input; mod _create_function_output; diff --git a/crates/superposition_sdk/src/operation/create_function/builders.rs b/crates/superposition_sdk/src/operation/create_function/builders.rs index f72bb7d8c..88c0db7b3 100644 --- a/crates/superposition_sdk/src/operation/create_function/builders.rs +++ b/crates/superposition_sdk/src/operation/create_function/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_function::_create_function_output::CreateFunctionOutputBuilder; - pub use crate::operation::create_function::_create_function_input::CreateFunctionInputBuilder; +pub use crate::operation::create_function::_create_function_output::CreateFunctionOutputBuilder; + impl crate::operation::create_function::builders::CreateFunctionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_function::builders::CreateFunctionInputBuilder { } } /// Fluent builder constructing a request to `CreateFunction`. -/// +/// /// Creates a new custom function for value_validation, value_compute, context_validation or change_reason_validation with specified code, runtime version, and function type. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateFunctionFluentBuilder { @@ -74,7 +74,7 @@ impl CreateFunctionFluentBuilder { ); crate::operation::create_function::CreateFunction::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateFunctionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/create_organisation.rs b/crates/superposition_sdk/src/operation/create_organisation.rs index 99cd51630..f1c02192c 100644 --- a/crates/superposition_sdk/src/operation/create_organisation.rs +++ b/crates/superposition_sdk/src/operation/create_organisation.rs @@ -23,7 +23,7 @@ impl CreateOrganisation { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_organisation::CreateOrganisationInput, @@ -45,20 +45,18 @@ impl CreateOrganisation { "rpc.service" = "Superposition", "rpc.method" = "CreateOrganisation", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateO cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateOrganisationRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateOrganisationResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateOrganisation") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateOrganisation", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateO fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateOrganisation") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateOrganisationEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateOrganisationEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateO } } - + #[derive(Debug)] struct CreateOrganisationResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateOrganisationResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_organisation::de_create_organisation_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateO let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_organisation::CreateOrganisationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_organisation::CreateOrganisationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/superposition/organisations").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,20 +140,20 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateO #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_organisation::CreateOrganisationInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_organisation::ser_create_organisation_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -158,6 +161,7 @@ builder #[derive(Debug)] struct CreateOrganisationEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateOrganisationEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateOrganisationEndpointParamsInterceptor" @@ -172,10 +176,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateOrganisationInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -186,7 +190,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateOrganisationError` operation. #[non_exhaustive] @@ -208,15 +212,15 @@ impl CreateOrganisationError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateOrganisationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -285,10 +289,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateOr } } -pub use crate::operation::create_organisation::_create_organisation_output::CreateOrganisationOutput; - pub use crate::operation::create_organisation::_create_organisation_input::CreateOrganisationInput; +pub use crate::operation::create_organisation::_create_organisation_output::CreateOrganisationOutput; + mod _create_organisation_input; mod _create_organisation_output; diff --git a/crates/superposition_sdk/src/operation/create_organisation/builders.rs b/crates/superposition_sdk/src/operation/create_organisation/builders.rs index bd8dcd84e..a973ece57 100644 --- a/crates/superposition_sdk/src/operation/create_organisation/builders.rs +++ b/crates/superposition_sdk/src/operation/create_organisation/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_organisation::_create_organisation_output::CreateOrganisationOutputBuilder; - pub use crate::operation::create_organisation::_create_organisation_input::CreateOrganisationInputBuilder; +pub use crate::operation::create_organisation::_create_organisation_output::CreateOrganisationOutputBuilder; + impl crate::operation::create_organisation::builders::CreateOrganisationInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_organisation::builders::CreateOrganisationInputBui } } /// Fluent builder constructing a request to `CreateOrganisation`. -/// +/// /// Creates a new organisation with specified name and administrator email. This is the top-level entity that contains workspaces and manages organizational-level settings. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateOrganisationFluentBuilder { @@ -74,7 +74,7 @@ impl CreateOrganisationFluentBuilder { ); crate::operation::create_organisation::CreateOrganisation::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateOrganisationFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/create_secret.rs b/crates/superposition_sdk/src/operation/create_secret.rs index 5efb802da..bdf21cabb 100644 --- a/crates/superposition_sdk/src/operation/create_secret.rs +++ b/crates/superposition_sdk/src/operation/create_secret.rs @@ -23,7 +23,7 @@ impl CreateSecret { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_secret::CreateSecretInput, @@ -45,20 +45,18 @@ impl CreateSecret { "rpc.service" = "Superposition", "rpc.method" = "CreateSecret", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateS cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateSecretRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateSecretResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateSecret") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateSecret", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateS fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateSecret") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateSecretEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateSecretEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateS } } - + #[derive(Debug)] struct CreateSecretResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateSecretResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_secret::de_create_secret_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateS let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_secret::CreateSecretInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_secret::CreateSecretInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/secrets").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateS #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_secret::CreateSecretInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_secret::ser_create_secret_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_secret::ser_create_secret_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateSecretEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateSecretEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateSecretEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateSecretInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateSecretError` operation. #[non_exhaustive] @@ -209,15 +213,15 @@ impl CreateSecretError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateSecretError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -286,10 +290,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateSe } } -pub use crate::operation::create_secret::_create_secret_output::CreateSecretOutput; - pub use crate::operation::create_secret::_create_secret_input::CreateSecretInput; +pub use crate::operation::create_secret::_create_secret_output::CreateSecretOutput; + mod _create_secret_input; mod _create_secret_output; diff --git a/crates/superposition_sdk/src/operation/create_secret/builders.rs b/crates/superposition_sdk/src/operation/create_secret/builders.rs index 36f7ae209..fb40767f6 100644 --- a/crates/superposition_sdk/src/operation/create_secret/builders.rs +++ b/crates/superposition_sdk/src/operation/create_secret/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_secret::_create_secret_output::CreateSecretOutputBuilder; - pub use crate::operation::create_secret::_create_secret_input::CreateSecretInputBuilder; +pub use crate::operation::create_secret::_create_secret_output::CreateSecretOutputBuilder; + impl crate::operation::create_secret::builders::CreateSecretInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_secret::builders::CreateSecretInputBuilder { } } /// Fluent builder constructing a request to `CreateSecret`. -/// +/// /// Creates a new encrypted secret with the specified name and value. The secret is encrypted with the workspace's current encryption key. Secret values are never returned in responses for security. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateSecretFluentBuilder { @@ -74,7 +74,7 @@ impl CreateSecretFluentBuilder { ); crate::operation::create_secret::CreateSecret::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateSecretFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/create_type_templates.rs b/crates/superposition_sdk/src/operation/create_type_templates.rs index c50d85647..eb3692a84 100644 --- a/crates/superposition_sdk/src/operation/create_type_templates.rs +++ b/crates/superposition_sdk/src/operation/create_type_templates.rs @@ -23,7 +23,7 @@ impl CreateTypeTemplates { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_type_templates::CreateTypeTemplatesInput, @@ -45,20 +45,18 @@ impl CreateTypeTemplates { "rpc.service" = "Superposition", "rpc.method" = "CreateTypeTemplates", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateT cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateTypeTemplatesRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateTypeTemplatesResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateTypeTemplates") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateTypeTemplates", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateT fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateTypeTemplates") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateTypeTemplatesEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateTypeTemplatesEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateT } } - + #[derive(Debug)] struct CreateTypeTemplatesResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateTypeTemplatesResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_type_templates::de_create_type_templates_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateT let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_type_templates::CreateTypeTemplatesInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_type_templates::CreateTypeTemplatesInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/types").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateT #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_type_templates::CreateTypeTemplatesInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_type_templates::ser_create_type_templates_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_type_templates::ser_create_type_templates_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateTypeTemplatesEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateTypeTemplatesEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateTypeTemplatesEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateTypeTemplatesInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateTypeTemplatesError` operation. #[non_exhaustive] @@ -209,15 +213,15 @@ impl CreateTypeTemplatesError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateTypeTemplatesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -286,10 +290,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateTy } } -pub use crate::operation::create_type_templates::_create_type_templates_output::CreateTypeTemplatesOutput; - pub use crate::operation::create_type_templates::_create_type_templates_input::CreateTypeTemplatesInput; +pub use crate::operation::create_type_templates::_create_type_templates_output::CreateTypeTemplatesOutput; + mod _create_type_templates_input; mod _create_type_templates_output; diff --git a/crates/superposition_sdk/src/operation/create_type_templates/builders.rs b/crates/superposition_sdk/src/operation/create_type_templates/builders.rs index a7ac37223..ccc7fd2e8 100644 --- a/crates/superposition_sdk/src/operation/create_type_templates/builders.rs +++ b/crates/superposition_sdk/src/operation/create_type_templates/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_type_templates::_create_type_templates_output::CreateTypeTemplatesOutputBuilder; - pub use crate::operation::create_type_templates::_create_type_templates_input::CreateTypeTemplatesInputBuilder; +pub use crate::operation::create_type_templates::_create_type_templates_output::CreateTypeTemplatesOutputBuilder; + impl crate::operation::create_type_templates::builders::CreateTypeTemplatesInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_type_templates::builders::CreateTypeTemplatesInput } } /// Fluent builder constructing a request to `CreateTypeTemplates`. -/// +/// /// Creates a new type template with specified schema definition, providing reusable type definitions for config validation. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateTypeTemplatesFluentBuilder { @@ -74,7 +74,7 @@ impl CreateTypeTemplatesFluentBuilder { ); crate::operation::create_type_templates::CreateTypeTemplates::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateTypeTemplatesFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -138,11 +138,11 @@ impl CreateTypeTemplatesFluentBuilder { pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_type_name() } - /// + /// /// Adds a key-value pair to `type_schema`. - /// + /// /// To override the contents of this collection use [`set_type_schema`](Self::set_type_schema). - /// + /// /// Generic key-value object structure used for flexible data representation throughout the API. pub fn type_schema(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.type_schema(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/create_variable.rs b/crates/superposition_sdk/src/operation/create_variable.rs index 211d3b082..a7f9742d1 100644 --- a/crates/superposition_sdk/src/operation/create_variable.rs +++ b/crates/superposition_sdk/src/operation/create_variable.rs @@ -23,7 +23,7 @@ impl CreateVariable { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_variable::CreateVariableInput, @@ -45,20 +45,18 @@ impl CreateVariable { "rpc.service" = "Superposition", "rpc.method" = "CreateVariable", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateV cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateVariableRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateVariableResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateVariable") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateVariable", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateV fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateVariable") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateVariableEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateVariableEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateV } } - + #[derive(Debug)] struct CreateVariableResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateVariableResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_variable::de_create_variable_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateV let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_variable::CreateVariableInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_variable::CreateVariableInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/variables").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateV #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_variable::CreateVariableInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_variable::ser_create_variable_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_variable::ser_create_variable_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateVariableEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateVariableEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateVariableEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateVariableInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateVariableError` operation. #[non_exhaustive] @@ -209,15 +213,15 @@ impl CreateVariableError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateVariableError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -286,10 +290,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateVa } } -pub use crate::operation::create_variable::_create_variable_output::CreateVariableOutput; - pub use crate::operation::create_variable::_create_variable_input::CreateVariableInput; +pub use crate::operation::create_variable::_create_variable_output::CreateVariableOutput; + mod _create_variable_input; mod _create_variable_output; diff --git a/crates/superposition_sdk/src/operation/create_variable/builders.rs b/crates/superposition_sdk/src/operation/create_variable/builders.rs index 5f1728d20..f75d272ab 100644 --- a/crates/superposition_sdk/src/operation/create_variable/builders.rs +++ b/crates/superposition_sdk/src/operation/create_variable/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_variable::_create_variable_output::CreateVariableOutputBuilder; - pub use crate::operation::create_variable::_create_variable_input::CreateVariableInputBuilder; +pub use crate::operation::create_variable::_create_variable_output::CreateVariableOutputBuilder; + impl crate::operation::create_variable::builders::CreateVariableInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_variable::builders::CreateVariableInputBuilder { } } /// Fluent builder constructing a request to `CreateVariable`. -/// +/// /// Creates a new variable with the specified name and value. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateVariableFluentBuilder { @@ -74,7 +74,7 @@ impl CreateVariableFluentBuilder { ); crate::operation::create_variable::CreateVariable::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateVariableFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/create_webhook.rs b/crates/superposition_sdk/src/operation/create_webhook.rs index 621dd548a..2373b2811 100644 --- a/crates/superposition_sdk/src/operation/create_webhook.rs +++ b/crates/superposition_sdk/src/operation/create_webhook.rs @@ -23,7 +23,7 @@ impl CreateWebhook { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_webhook::CreateWebhookInput, @@ -45,20 +45,18 @@ impl CreateWebhook { "rpc.service" = "Superposition", "rpc.method" = "CreateWebhook", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateW cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateWebhookRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateWebhookResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateWebhook") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateWebhook", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateW fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateWebhook") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateWebhookEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateWebhookEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateW } } - + #[derive(Debug)] struct CreateWebhookResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateWebhookResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_webhook::de_create_webhook_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateW let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_webhook::CreateWebhookInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_webhook::CreateWebhookInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/webhook").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateW #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_webhook::CreateWebhookInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_webhook::ser_create_webhook_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_webhook::ser_create_webhook_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateWebhookEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateWebhookEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateWebhookEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateWebhookInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateWebhookError` operation. #[non_exhaustive] @@ -209,15 +213,15 @@ impl CreateWebhookError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateWebhookError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -286,10 +290,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateWe } } -pub use crate::operation::create_webhook::_create_webhook_output::CreateWebhookOutput; - pub use crate::operation::create_webhook::_create_webhook_input::CreateWebhookInput; +pub use crate::operation::create_webhook::_create_webhook_output::CreateWebhookOutput; + mod _create_webhook_input; mod _create_webhook_output; diff --git a/crates/superposition_sdk/src/operation/create_webhook/_create_webhook_input.rs b/crates/superposition_sdk/src/operation/create_webhook/_create_webhook_input.rs index 9f7b17cd6..d0bb7e769 100644 --- a/crates/superposition_sdk/src/operation/create_webhook/_create_webhook_input.rs +++ b/crates/superposition_sdk/src/operation/create_webhook/_create_webhook_input.rs @@ -64,7 +64,7 @@ impl CreateWebhookInput { self.custom_headers.as_ref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.events.is_none()`. pub fn events(&self) -> &[::std::string::String] { self.events.as_deref() diff --git a/crates/superposition_sdk/src/operation/create_webhook/builders.rs b/crates/superposition_sdk/src/operation/create_webhook/builders.rs index 5abf21a9b..571782ef0 100644 --- a/crates/superposition_sdk/src/operation/create_webhook/builders.rs +++ b/crates/superposition_sdk/src/operation/create_webhook/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_webhook::_create_webhook_output::CreateWebhookOutputBuilder; - pub use crate::operation::create_webhook::_create_webhook_input::CreateWebhookInputBuilder; +pub use crate::operation::create_webhook::_create_webhook_output::CreateWebhookOutputBuilder; + impl crate::operation::create_webhook::builders::CreateWebhookInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_webhook::builders::CreateWebhookInputBuilder { } } /// Fluent builder constructing a request to `CreateWebhook`. -/// +/// /// Creates a new webhook config to receive HTTP notifications when specified events occur in the system. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateWebhookFluentBuilder { @@ -74,7 +74,7 @@ impl CreateWebhookFluentBuilder { ); crate::operation::create_webhook::CreateWebhook::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateWebhookFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -208,11 +208,11 @@ impl CreateWebhookFluentBuilder { pub fn get_version(&self) -> &::std::option::Option { self.inner.get_version() } - /// + /// /// Adds a key-value pair to `custom_headers`. - /// + /// /// To override the contents of this collection use [`set_custom_headers`](Self::set_custom_headers). - /// + /// /// Generic key-value object structure used for flexible data representation throughout the API. pub fn custom_headers(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.custom_headers(k.into(), v); @@ -227,11 +227,11 @@ impl CreateWebhookFluentBuilder { pub fn get_custom_headers(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> { self.inner.get_custom_headers() } - /// + /// /// Appends an item to `events`. - /// + /// /// To override the contents of this collection use [`set_events`](Self::set_events). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn events(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.events(input.into()); diff --git a/crates/superposition_sdk/src/operation/create_workspace.rs b/crates/superposition_sdk/src/operation/create_workspace.rs index e015abddd..3c9569920 100644 --- a/crates/superposition_sdk/src/operation/create_workspace.rs +++ b/crates/superposition_sdk/src/operation/create_workspace.rs @@ -23,7 +23,7 @@ impl CreateWorkspace { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::create_workspace::CreateWorkspaceInput, @@ -45,20 +45,18 @@ impl CreateWorkspace { "rpc.service" = "Superposition", "rpc.method" = "CreateWorkspace", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateW cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(CreateWorkspaceRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(CreateWorkspaceResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("CreateWorkspace") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "CreateWorkspace", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateW fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("CreateWorkspace") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(CreateWorkspaceEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(CreateWorkspaceEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateW } } - + #[derive(Debug)] struct CreateWorkspaceResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for CreateWorkspaceResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_create_workspace::de_create_workspace_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateW let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::create_workspace::CreateWorkspaceInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::create_workspace::CreateWorkspaceInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/workspaces").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for CreateW #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::create_workspace::CreateWorkspaceInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_create_workspace::ser_create_workspace_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_create_workspace::ser_create_workspace_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct CreateWorkspaceEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for CreateWorkspaceEndpointParamsInterceptor { fn name(&self) -> &'static str { "CreateWorkspaceEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to CreateWorkspaceInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `CreateWorkspaceError` operation. #[non_exhaustive] @@ -209,15 +213,15 @@ impl CreateWorkspaceError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `CreateWorkspaceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -286,10 +290,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for CreateWo } } -pub use crate::operation::create_workspace::_create_workspace_output::CreateWorkspaceOutput; - pub use crate::operation::create_workspace::_create_workspace_input::CreateWorkspaceInput; +pub use crate::operation::create_workspace::_create_workspace_output::CreateWorkspaceOutput; + mod _create_workspace_input; mod _create_workspace_output; diff --git a/crates/superposition_sdk/src/operation/create_workspace/_create_workspace_output.rs b/crates/superposition_sdk/src/operation/create_workspace/_create_workspace_output.rs index f0d07c911..4961709f2 100644 --- a/crates/superposition_sdk/src/operation/create_workspace/_create_workspace_output.rs +++ b/crates/superposition_sdk/src/operation/create_workspace/_create_workspace_output.rs @@ -86,7 +86,7 @@ impl CreateWorkspaceOutput { &self.created_at } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.mandatory_dimensions.is_none()`. pub fn mandatory_dimensions(&self) -> &[::std::string::String] { self.mandatory_dimensions.as_deref() diff --git a/crates/superposition_sdk/src/operation/create_workspace/builders.rs b/crates/superposition_sdk/src/operation/create_workspace/builders.rs index 6136c5472..f112dccd9 100644 --- a/crates/superposition_sdk/src/operation/create_workspace/builders.rs +++ b/crates/superposition_sdk/src/operation/create_workspace/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::create_workspace::_create_workspace_output::CreateWorkspaceOutputBuilder; - pub use crate::operation::create_workspace::_create_workspace_input::CreateWorkspaceInputBuilder; +pub use crate::operation::create_workspace::_create_workspace_output::CreateWorkspaceOutputBuilder; + impl crate::operation::create_workspace::builders::CreateWorkspaceInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::create_workspace::builders::CreateWorkspaceInputBuilder { } } /// Fluent builder constructing a request to `CreateWorkspace`. -/// +/// /// Creates a new workspace within an organisation, including database schema setup and isolated environment for config management with specified admin and settings. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct CreateWorkspaceFluentBuilder { @@ -74,7 +74,7 @@ impl CreateWorkspaceFluentBuilder { ); crate::operation::create_workspace::CreateWorkspace::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl CreateWorkspaceFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/delete_context.rs b/crates/superposition_sdk/src/operation/delete_context.rs index e2ec30b5f..dff06c9d8 100644 --- a/crates/superposition_sdk/src/operation/delete_context.rs +++ b/crates/superposition_sdk/src/operation/delete_context.rs @@ -23,7 +23,7 @@ impl DeleteContext { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::delete_context::DeleteContextInput, @@ -45,20 +45,18 @@ impl DeleteContext { "rpc.service" = "Superposition", "rpc.method" = "DeleteContext", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteC cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(DeleteContextRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(DeleteContextResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("DeleteContext") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "DeleteContext", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteC fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteContext") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(DeleteContextEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(DeleteContextEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteC } } - + #[derive(Debug)] struct DeleteContextResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteContextResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 204 || force_error { crate::protocol_serde::shape_delete_context::de_delete_context_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteC let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::delete_context::DeleteContextInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::delete_context::DeleteContextInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteC #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::delete_context::DeleteContextInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_delete_context::ser_delete_context_headers(input, builder)?; ::std::result::Result::Ok(builder.method("DELETE").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct DeleteContextEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteContextEndpointParamsInterceptor { fn name(&self) -> &'static str { "DeleteContextEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to DeleteContextInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `DeleteContextError` operation. #[non_exhaustive] @@ -215,15 +219,15 @@ impl DeleteContextError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `DeleteContextError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -320,10 +324,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteCo } } -pub use crate::operation::delete_context::_delete_context_output::DeleteContextOutput; - pub use crate::operation::delete_context::_delete_context_input::DeleteContextInput; +pub use crate::operation::delete_context::_delete_context_output::DeleteContextOutput; + mod _delete_context_input; mod _delete_context_output; diff --git a/crates/superposition_sdk/src/operation/delete_context/builders.rs b/crates/superposition_sdk/src/operation/delete_context/builders.rs index 4760f2441..0bb4e4190 100644 --- a/crates/superposition_sdk/src/operation/delete_context/builders.rs +++ b/crates/superposition_sdk/src/operation/delete_context/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::delete_context::_delete_context_output::DeleteContextOutputBuilder; - pub use crate::operation::delete_context::_delete_context_input::DeleteContextInputBuilder; +pub use crate::operation::delete_context::_delete_context_output::DeleteContextOutputBuilder; + impl crate::operation::delete_context::builders::DeleteContextInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::delete_context::builders::DeleteContextInputBuilder { } } /// Fluent builder constructing a request to `DeleteContext`. -/// +/// /// Permanently removes a context from the workspace. This operation cannot be undone and will affect config resolution. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DeleteContextFluentBuilder { @@ -74,7 +74,7 @@ impl DeleteContextFluentBuilder { ); crate::operation::delete_context::DeleteContext::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl DeleteContextFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/delete_default_config.rs b/crates/superposition_sdk/src/operation/delete_default_config.rs index 609e32261..91e5a4063 100644 --- a/crates/superposition_sdk/src/operation/delete_default_config.rs +++ b/crates/superposition_sdk/src/operation/delete_default_config.rs @@ -23,7 +23,7 @@ impl DeleteDefaultConfig { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::delete_default_config::DeleteDefaultConfigInput, @@ -45,20 +45,18 @@ impl DeleteDefaultConfig { "rpc.service" = "Superposition", "rpc.method" = "DeleteDefaultConfig", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteD cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(DeleteDefaultConfigRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(DeleteDefaultConfigResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("DeleteDefaultConfig") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "DeleteDefaultConfig", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteD fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteDefaultConfig") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(DeleteDefaultConfigEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(DeleteDefaultConfigEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteD } } - + #[derive(Debug)] struct DeleteDefaultConfigResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteDefaultConfigResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 204 || force_error { crate::protocol_serde::shape_delete_default_config::de_delete_default_config_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteD let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::delete_default_config::DeleteDefaultConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::delete_default_config::DeleteDefaultConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.key; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("key", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteD #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::delete_default_config::DeleteDefaultConfigInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_delete_default_config::ser_delete_default_config_headers(input, builder)?; ::std::result::Result::Ok(builder.method("DELETE").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct DeleteDefaultConfigEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteDefaultConfigEndpointParamsInterceptor { fn name(&self) -> &'static str { "DeleteDefaultConfigEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to DeleteDefaultConfigInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `DeleteDefaultConfigError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl DeleteDefaultConfigError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `DeleteDefaultConfigError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -336,10 +340,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteDe } } -pub use crate::operation::delete_default_config::_delete_default_config_output::DeleteDefaultConfigOutput; - pub use crate::operation::delete_default_config::_delete_default_config_input::DeleteDefaultConfigInput; +pub use crate::operation::delete_default_config::_delete_default_config_output::DeleteDefaultConfigOutput; + mod _delete_default_config_input; mod _delete_default_config_output; diff --git a/crates/superposition_sdk/src/operation/delete_default_config/builders.rs b/crates/superposition_sdk/src/operation/delete_default_config/builders.rs index 783d25203..bfb286ddc 100644 --- a/crates/superposition_sdk/src/operation/delete_default_config/builders.rs +++ b/crates/superposition_sdk/src/operation/delete_default_config/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::delete_default_config::_delete_default_config_output::DeleteDefaultConfigOutputBuilder; - pub use crate::operation::delete_default_config::_delete_default_config_input::DeleteDefaultConfigInputBuilder; +pub use crate::operation::delete_default_config::_delete_default_config_output::DeleteDefaultConfigOutputBuilder; + impl crate::operation::delete_default_config::builders::DeleteDefaultConfigInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::delete_default_config::builders::DeleteDefaultConfigInput } } /// Fluent builder constructing a request to `DeleteDefaultConfig`. -/// +/// /// Permanently removes a default config entry from the workspace. This operation cannot be performed if it affects config resolution for contexts that rely on this fallback value. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DeleteDefaultConfigFluentBuilder { @@ -74,7 +74,7 @@ impl DeleteDefaultConfigFluentBuilder { ); crate::operation::delete_default_config::DeleteDefaultConfig::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl DeleteDefaultConfigFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/delete_dimension.rs b/crates/superposition_sdk/src/operation/delete_dimension.rs index e116c14cd..bfee6abe6 100644 --- a/crates/superposition_sdk/src/operation/delete_dimension.rs +++ b/crates/superposition_sdk/src/operation/delete_dimension.rs @@ -23,7 +23,7 @@ impl DeleteDimension { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::delete_dimension::DeleteDimensionInput, @@ -45,20 +45,18 @@ impl DeleteDimension { "rpc.service" = "Superposition", "rpc.method" = "DeleteDimension", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteD cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(DeleteDimensionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(DeleteDimensionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("DeleteDimension") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "DeleteDimension", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteD fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteDimension") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(DeleteDimensionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(DeleteDimensionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteD } } - + #[derive(Debug)] struct DeleteDimensionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteDimensionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 204 || force_error { crate::protocol_serde::shape_delete_dimension::de_delete_dimension_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteD let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::delete_dimension::DeleteDimensionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::delete_dimension::DeleteDimensionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.dimension; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("dimension", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteD #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::delete_dimension::DeleteDimensionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_delete_dimension::ser_delete_dimension_headers(input, builder)?; ::std::result::Result::Ok(builder.method("DELETE").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct DeleteDimensionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteDimensionEndpointParamsInterceptor { fn name(&self) -> &'static str { "DeleteDimensionEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to DeleteDimensionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `DeleteDimensionError` operation. #[non_exhaustive] @@ -215,15 +219,15 @@ impl DeleteDimensionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `DeleteDimensionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -320,10 +324,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteDi } } -pub use crate::operation::delete_dimension::_delete_dimension_output::DeleteDimensionOutput; - pub use crate::operation::delete_dimension::_delete_dimension_input::DeleteDimensionInput; +pub use crate::operation::delete_dimension::_delete_dimension_output::DeleteDimensionOutput; + mod _delete_dimension_input; mod _delete_dimension_output; diff --git a/crates/superposition_sdk/src/operation/delete_dimension/builders.rs b/crates/superposition_sdk/src/operation/delete_dimension/builders.rs index d4103e88f..5f527f8aa 100644 --- a/crates/superposition_sdk/src/operation/delete_dimension/builders.rs +++ b/crates/superposition_sdk/src/operation/delete_dimension/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::delete_dimension::_delete_dimension_output::DeleteDimensionOutputBuilder; - pub use crate::operation::delete_dimension::_delete_dimension_input::DeleteDimensionInputBuilder; +pub use crate::operation::delete_dimension::_delete_dimension_output::DeleteDimensionOutputBuilder; + impl crate::operation::delete_dimension::builders::DeleteDimensionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::delete_dimension::builders::DeleteDimensionInputBuilder { } } /// Fluent builder constructing a request to `DeleteDimension`. -/// +/// /// Permanently removes a dimension from the workspace. This operation will fail if the dimension has active dependencies or is referenced by existing configurations. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DeleteDimensionFluentBuilder { @@ -74,7 +74,7 @@ impl DeleteDimensionFluentBuilder { ); crate::operation::delete_dimension::DeleteDimension::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl DeleteDimensionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/delete_experiment_group.rs b/crates/superposition_sdk/src/operation/delete_experiment_group.rs index 064fea4f7..f57267b85 100644 --- a/crates/superposition_sdk/src/operation/delete_experiment_group.rs +++ b/crates/superposition_sdk/src/operation/delete_experiment_group.rs @@ -23,7 +23,7 @@ impl DeleteExperimentGroup { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::delete_experiment_group::DeleteExperimentGroupInput, @@ -45,20 +45,18 @@ impl DeleteExperimentGroup { "rpc.service" = "Superposition", "rpc.method" = "DeleteExperimentGroup", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteE cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(DeleteExperimentGroupRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(DeleteExperimentGroupResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("DeleteExperimentGroup") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "DeleteExperimentGroup", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteE fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteExperimentGroup") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(DeleteExperimentGroupEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(DeleteExperimentGroupEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteE } } - + #[derive(Debug)] struct DeleteExperimentGroupResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteExperimentGroupResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_delete_experiment_group::de_delete_experiment_group_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteE let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::delete_experiment_group::DeleteExperimentGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::delete_experiment_group::DeleteExperimentGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteE #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::delete_experiment_group::DeleteExperimentGroupInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_delete_experiment_group::ser_delete_experiment_group_headers(input, builder)?; ::std::result::Result::Ok(builder.method("DELETE").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct DeleteExperimentGroupEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteExperimentGroupEndpointParamsInterceptor { fn name(&self) -> &'static str { "DeleteExperimentGroupEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to DeleteExperimentGroupInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `DeleteExperimentGroupError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl DeleteExperimentGroupError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `DeleteExperimentGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteEx } } -pub use crate::operation::delete_experiment_group::_delete_experiment_group_output::DeleteExperimentGroupOutput; - pub use crate::operation::delete_experiment_group::_delete_experiment_group_input::DeleteExperimentGroupInput; +pub use crate::operation::delete_experiment_group::_delete_experiment_group_output::DeleteExperimentGroupOutput; + mod _delete_experiment_group_input; mod _delete_experiment_group_output; diff --git a/crates/superposition_sdk/src/operation/delete_experiment_group/builders.rs b/crates/superposition_sdk/src/operation/delete_experiment_group/builders.rs index f6d3ad43b..a710d0dd5 100644 --- a/crates/superposition_sdk/src/operation/delete_experiment_group/builders.rs +++ b/crates/superposition_sdk/src/operation/delete_experiment_group/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::delete_experiment_group::_delete_experiment_group_output::DeleteExperimentGroupOutputBuilder; - pub use crate::operation::delete_experiment_group::_delete_experiment_group_input::DeleteExperimentGroupInputBuilder; +pub use crate::operation::delete_experiment_group::_delete_experiment_group_output::DeleteExperimentGroupOutputBuilder; + impl crate::operation::delete_experiment_group::builders::DeleteExperimentGroupInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::delete_experiment_group::builders::DeleteExperimentGroupI } } /// Fluent builder constructing a request to `DeleteExperimentGroup`. -/// +/// /// Deletes an experiment group. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DeleteExperimentGroupFluentBuilder { @@ -74,7 +74,7 @@ impl DeleteExperimentGroupFluentBuilder { ); crate::operation::delete_experiment_group::DeleteExperimentGroup::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl DeleteExperimentGroupFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/delete_function.rs b/crates/superposition_sdk/src/operation/delete_function.rs index 2cb499e97..85e44cab4 100644 --- a/crates/superposition_sdk/src/operation/delete_function.rs +++ b/crates/superposition_sdk/src/operation/delete_function.rs @@ -23,7 +23,7 @@ impl DeleteFunction { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::delete_function::DeleteFunctionInput, @@ -45,20 +45,18 @@ impl DeleteFunction { "rpc.service" = "Superposition", "rpc.method" = "DeleteFunction", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteF cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(DeleteFunctionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(DeleteFunctionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("DeleteFunction") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "DeleteFunction", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteF fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteFunction") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(DeleteFunctionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(DeleteFunctionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteF } } - + #[derive(Debug)] struct DeleteFunctionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteFunctionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 204 || force_error { crate::protocol_serde::shape_delete_function::de_delete_function_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteF let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::delete_function::DeleteFunctionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::delete_function::DeleteFunctionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.function_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteF #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::delete_function::DeleteFunctionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_delete_function::ser_delete_function_headers(input, builder)?; ::std::result::Result::Ok(builder.method("DELETE").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct DeleteFunctionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteFunctionEndpointParamsInterceptor { fn name(&self) -> &'static str { "DeleteFunctionEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to DeleteFunctionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `DeleteFunctionError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl DeleteFunctionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `DeleteFunctionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteFu } } -pub use crate::operation::delete_function::_delete_function_output::DeleteFunctionOutput; - pub use crate::operation::delete_function::_delete_function_input::DeleteFunctionInput; +pub use crate::operation::delete_function::_delete_function_output::DeleteFunctionOutput; + mod _delete_function_input; mod _delete_function_output; diff --git a/crates/superposition_sdk/src/operation/delete_function/builders.rs b/crates/superposition_sdk/src/operation/delete_function/builders.rs index 1ac0f19ad..227419e17 100644 --- a/crates/superposition_sdk/src/operation/delete_function/builders.rs +++ b/crates/superposition_sdk/src/operation/delete_function/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::delete_function::_delete_function_output::DeleteFunctionOutputBuilder; - pub use crate::operation::delete_function::_delete_function_input::DeleteFunctionInputBuilder; +pub use crate::operation::delete_function::_delete_function_output::DeleteFunctionOutputBuilder; + impl crate::operation::delete_function::builders::DeleteFunctionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::delete_function::builders::DeleteFunctionInputBuilder { } } /// Fluent builder constructing a request to `DeleteFunction`. -/// +/// /// Permanently removes a function from the workspace, deleting both draft and published versions along with all associated code. It fails if already in use #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DeleteFunctionFluentBuilder { @@ -74,7 +74,7 @@ impl DeleteFunctionFluentBuilder { ); crate::operation::delete_function::DeleteFunction::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl DeleteFunctionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/delete_secret.rs b/crates/superposition_sdk/src/operation/delete_secret.rs index bb8e6d8d8..a4f93cd40 100644 --- a/crates/superposition_sdk/src/operation/delete_secret.rs +++ b/crates/superposition_sdk/src/operation/delete_secret.rs @@ -23,7 +23,7 @@ impl DeleteSecret { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::delete_secret::DeleteSecretInput, @@ -45,20 +45,18 @@ impl DeleteSecret { "rpc.service" = "Superposition", "rpc.method" = "DeleteSecret", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteS cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(DeleteSecretRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(DeleteSecretResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("DeleteSecret") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "DeleteSecret", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteS fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteSecret") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(DeleteSecretEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(DeleteSecretEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteS } } - + #[derive(Debug)] struct DeleteSecretResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteSecretResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_delete_secret::de_delete_secret_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteS let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::delete_secret::DeleteSecretInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::delete_secret::DeleteSecretInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteS #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::delete_secret::DeleteSecretInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_delete_secret::ser_delete_secret_headers(input, builder)?; ::std::result::Result::Ok(builder.method("DELETE").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct DeleteSecretEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteSecretEndpointParamsInterceptor { fn name(&self) -> &'static str { "DeleteSecretEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to DeleteSecretInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `DeleteSecretError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl DeleteSecretError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `DeleteSecretError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteSe } } -pub use crate::operation::delete_secret::_delete_secret_output::DeleteSecretOutput; - pub use crate::operation::delete_secret::_delete_secret_input::DeleteSecretInput; +pub use crate::operation::delete_secret::_delete_secret_output::DeleteSecretOutput; + mod _delete_secret_input; mod _delete_secret_output; diff --git a/crates/superposition_sdk/src/operation/delete_secret/builders.rs b/crates/superposition_sdk/src/operation/delete_secret/builders.rs index 1a78b7ecd..6e08da317 100644 --- a/crates/superposition_sdk/src/operation/delete_secret/builders.rs +++ b/crates/superposition_sdk/src/operation/delete_secret/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::delete_secret::_delete_secret_output::DeleteSecretOutputBuilder; - pub use crate::operation::delete_secret::_delete_secret_input::DeleteSecretInputBuilder; +pub use crate::operation::delete_secret::_delete_secret_output::DeleteSecretOutputBuilder; + impl crate::operation::delete_secret::builders::DeleteSecretInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::delete_secret::builders::DeleteSecretInputBuilder { } } /// Fluent builder constructing a request to `DeleteSecret`. -/// +/// /// Permanently deletes a secret from the workspace. The encrypted value is removed and cannot be recovered. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DeleteSecretFluentBuilder { @@ -74,7 +74,7 @@ impl DeleteSecretFluentBuilder { ); crate::operation::delete_secret::DeleteSecret::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl DeleteSecretFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/delete_type_templates.rs b/crates/superposition_sdk/src/operation/delete_type_templates.rs index bfc9cd8ba..d02551beb 100644 --- a/crates/superposition_sdk/src/operation/delete_type_templates.rs +++ b/crates/superposition_sdk/src/operation/delete_type_templates.rs @@ -23,7 +23,7 @@ impl DeleteTypeTemplates { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::delete_type_templates::DeleteTypeTemplatesInput, @@ -45,20 +45,18 @@ impl DeleteTypeTemplates { "rpc.service" = "Superposition", "rpc.method" = "DeleteTypeTemplates", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteT cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(DeleteTypeTemplatesRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(DeleteTypeTemplatesResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("DeleteTypeTemplates") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "DeleteTypeTemplates", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteT fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteTypeTemplates") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(DeleteTypeTemplatesEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(DeleteTypeTemplatesEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteT } } - + #[derive(Debug)] struct DeleteTypeTemplatesResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteTypeTemplatesResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_delete_type_templates::de_delete_type_templates_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteT let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::delete_type_templates::DeleteTypeTemplatesInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::delete_type_templates::DeleteTypeTemplatesInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.type_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("type_name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteT #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::delete_type_templates::DeleteTypeTemplatesInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_delete_type_templates::ser_delete_type_templates_headers(input, builder)?; ::std::result::Result::Ok(builder.method("DELETE").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct DeleteTypeTemplatesEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteTypeTemplatesEndpointParamsInterceptor { fn name(&self) -> &'static str { "DeleteTypeTemplatesEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to DeleteTypeTemplatesInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `DeleteTypeTemplatesError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl DeleteTypeTemplatesError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `DeleteTypeTemplatesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteTy } } -pub use crate::operation::delete_type_templates::_delete_type_templates_output::DeleteTypeTemplatesOutput; - pub use crate::operation::delete_type_templates::_delete_type_templates_input::DeleteTypeTemplatesInput; +pub use crate::operation::delete_type_templates::_delete_type_templates_output::DeleteTypeTemplatesOutput; + mod _delete_type_templates_input; mod _delete_type_templates_output; diff --git a/crates/superposition_sdk/src/operation/delete_type_templates/builders.rs b/crates/superposition_sdk/src/operation/delete_type_templates/builders.rs index 193106896..62d700c12 100644 --- a/crates/superposition_sdk/src/operation/delete_type_templates/builders.rs +++ b/crates/superposition_sdk/src/operation/delete_type_templates/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::delete_type_templates::_delete_type_templates_output::DeleteTypeTemplatesOutputBuilder; - pub use crate::operation::delete_type_templates::_delete_type_templates_input::DeleteTypeTemplatesInputBuilder; +pub use crate::operation::delete_type_templates::_delete_type_templates_output::DeleteTypeTemplatesOutputBuilder; + impl crate::operation::delete_type_templates::builders::DeleteTypeTemplatesInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::delete_type_templates::builders::DeleteTypeTemplatesInput } } /// Fluent builder constructing a request to `DeleteTypeTemplates`. -/// +/// /// Permanently removes a type template from the workspace. No checks performed while deleting #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DeleteTypeTemplatesFluentBuilder { @@ -74,7 +74,7 @@ impl DeleteTypeTemplatesFluentBuilder { ); crate::operation::delete_type_templates::DeleteTypeTemplates::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl DeleteTypeTemplatesFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/delete_variable.rs b/crates/superposition_sdk/src/operation/delete_variable.rs index 9bb62e52f..5d29b1220 100644 --- a/crates/superposition_sdk/src/operation/delete_variable.rs +++ b/crates/superposition_sdk/src/operation/delete_variable.rs @@ -23,7 +23,7 @@ impl DeleteVariable { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::delete_variable::DeleteVariableInput, @@ -45,20 +45,18 @@ impl DeleteVariable { "rpc.service" = "Superposition", "rpc.method" = "DeleteVariable", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteV cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(DeleteVariableRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(DeleteVariableResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("DeleteVariable") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "DeleteVariable", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteV fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteVariable") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(DeleteVariableEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(DeleteVariableEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteV } } - + #[derive(Debug)] struct DeleteVariableResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteVariableResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_delete_variable::de_delete_variable_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteV let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::delete_variable::DeleteVariableInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::delete_variable::DeleteVariableInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteV #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::delete_variable::DeleteVariableInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_delete_variable::ser_delete_variable_headers(input, builder)?; ::std::result::Result::Ok(builder.method("DELETE").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct DeleteVariableEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteVariableEndpointParamsInterceptor { fn name(&self) -> &'static str { "DeleteVariableEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to DeleteVariableInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `DeleteVariableError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl DeleteVariableError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `DeleteVariableError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteVa } } -pub use crate::operation::delete_variable::_delete_variable_output::DeleteVariableOutput; - pub use crate::operation::delete_variable::_delete_variable_input::DeleteVariableInput; +pub use crate::operation::delete_variable::_delete_variable_output::DeleteVariableOutput; + mod _delete_variable_input; mod _delete_variable_output; diff --git a/crates/superposition_sdk/src/operation/delete_variable/builders.rs b/crates/superposition_sdk/src/operation/delete_variable/builders.rs index 8618237c8..9ecc278e0 100644 --- a/crates/superposition_sdk/src/operation/delete_variable/builders.rs +++ b/crates/superposition_sdk/src/operation/delete_variable/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::delete_variable::_delete_variable_output::DeleteVariableOutputBuilder; - pub use crate::operation::delete_variable::_delete_variable_input::DeleteVariableInputBuilder; +pub use crate::operation::delete_variable::_delete_variable_output::DeleteVariableOutputBuilder; + impl crate::operation::delete_variable::builders::DeleteVariableInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::delete_variable::builders::DeleteVariableInputBuilder { } } /// Fluent builder constructing a request to `DeleteVariable`. -/// +/// /// Permanently deletes a variable from the workspace. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DeleteVariableFluentBuilder { @@ -74,7 +74,7 @@ impl DeleteVariableFluentBuilder { ); crate::operation::delete_variable::DeleteVariable::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl DeleteVariableFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/delete_webhook.rs b/crates/superposition_sdk/src/operation/delete_webhook.rs index fa5c3138b..9e41fef1c 100644 --- a/crates/superposition_sdk/src/operation/delete_webhook.rs +++ b/crates/superposition_sdk/src/operation/delete_webhook.rs @@ -23,7 +23,7 @@ impl DeleteWebhook { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::delete_webhook::DeleteWebhookInput, @@ -45,20 +45,18 @@ impl DeleteWebhook { "rpc.service" = "Superposition", "rpc.method" = "DeleteWebhook", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteW cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(DeleteWebhookRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(DeleteWebhookResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("DeleteWebhook") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "DeleteWebhook", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteW fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DeleteWebhook") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(DeleteWebhookEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(DeleteWebhookEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteW } } - + #[derive(Debug)] struct DeleteWebhookResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DeleteWebhookResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 204 || force_error { crate::protocol_serde::shape_delete_webhook::de_delete_webhook_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteW let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::delete_webhook::DeleteWebhookInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::delete_webhook::DeleteWebhookInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for DeleteW #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::delete_webhook::DeleteWebhookInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_delete_webhook::ser_delete_webhook_headers(input, builder)?; ::std::result::Result::Ok(builder.method("DELETE").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct DeleteWebhookEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DeleteWebhookEndpointParamsInterceptor { fn name(&self) -> &'static str { "DeleteWebhookEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to DeleteWebhookInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `DeleteWebhookError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl DeleteWebhookError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `DeleteWebhookError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DeleteWe } } -pub use crate::operation::delete_webhook::_delete_webhook_output::DeleteWebhookOutput; - pub use crate::operation::delete_webhook::_delete_webhook_input::DeleteWebhookInput; +pub use crate::operation::delete_webhook::_delete_webhook_output::DeleteWebhookOutput; + mod _delete_webhook_input; mod _delete_webhook_output; diff --git a/crates/superposition_sdk/src/operation/delete_webhook/builders.rs b/crates/superposition_sdk/src/operation/delete_webhook/builders.rs index 4f5d0c147..15b831a8c 100644 --- a/crates/superposition_sdk/src/operation/delete_webhook/builders.rs +++ b/crates/superposition_sdk/src/operation/delete_webhook/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::delete_webhook::_delete_webhook_output::DeleteWebhookOutputBuilder; - pub use crate::operation::delete_webhook::_delete_webhook_input::DeleteWebhookInputBuilder; +pub use crate::operation::delete_webhook::_delete_webhook_output::DeleteWebhookOutputBuilder; + impl crate::operation::delete_webhook::builders::DeleteWebhookInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::delete_webhook::builders::DeleteWebhookInputBuilder { } } /// Fluent builder constructing a request to `DeleteWebhook`. -/// +/// /// Permanently removes a webhook config from the workspace, stopping all future event notifications to that endpoint. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DeleteWebhookFluentBuilder { @@ -74,7 +74,7 @@ impl DeleteWebhookFluentBuilder { ); crate::operation::delete_webhook::DeleteWebhook::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl DeleteWebhookFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/discard_experiment.rs b/crates/superposition_sdk/src/operation/discard_experiment.rs index 7853bf57d..ecc34fb5b 100644 --- a/crates/superposition_sdk/src/operation/discard_experiment.rs +++ b/crates/superposition_sdk/src/operation/discard_experiment.rs @@ -23,7 +23,7 @@ impl DiscardExperiment { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::discard_experiment::DiscardExperimentInput, @@ -45,20 +45,18 @@ impl DiscardExperiment { "rpc.service" = "Superposition", "rpc.method" = "DiscardExperiment", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Discard cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(DiscardExperimentRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(DiscardExperimentResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("DiscardExperiment") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "DiscardExperiment", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Discard fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("DiscardExperiment") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(DiscardExperimentEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(DiscardExperimentEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Discard } } - + #[derive(Debug)] struct DiscardExperimentResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for DiscardExperimentResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_discard_experiment::de_discard_experiment_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Discard let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::discard_experiment::DiscardExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::discard_experiment::DiscardExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Discard #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::discard_experiment::DiscardExperimentInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_discard_experiment::ser_discard_experiment_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_discard_experiment::ser_discard_experiment_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct DiscardExperimentEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for DiscardExperimentEndpointParamsInterceptor { fn name(&self) -> &'static str { "DiscardExperimentEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to DiscardExperimentInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `DiscardExperimentError` operation. #[non_exhaustive] @@ -219,15 +223,15 @@ impl DiscardExperimentError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `DiscardExperimentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -324,10 +328,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for DiscardE } } -pub use crate::operation::discard_experiment::_discard_experiment_output::DiscardExperimentOutput; - pub use crate::operation::discard_experiment::_discard_experiment_input::DiscardExperimentInput; +pub use crate::operation::discard_experiment::_discard_experiment_output::DiscardExperimentOutput; + mod _discard_experiment_input; mod _discard_experiment_output; diff --git a/crates/superposition_sdk/src/operation/discard_experiment/builders.rs b/crates/superposition_sdk/src/operation/discard_experiment/builders.rs index dea1c29b5..095147bf0 100644 --- a/crates/superposition_sdk/src/operation/discard_experiment/builders.rs +++ b/crates/superposition_sdk/src/operation/discard_experiment/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::discard_experiment::_discard_experiment_output::DiscardExperimentOutputBuilder; - pub use crate::operation::discard_experiment::_discard_experiment_input::DiscardExperimentInputBuilder; +pub use crate::operation::discard_experiment::_discard_experiment_output::DiscardExperimentOutputBuilder; + impl crate::operation::discard_experiment::builders::DiscardExperimentInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::discard_experiment::builders::DiscardExperimentInputBuild } } /// Fluent builder constructing a request to `DiscardExperiment`. -/// +/// /// Discards an experiment without selecting a winner, effectively canceling the experiment and removing its effects. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct DiscardExperimentFluentBuilder { @@ -74,7 +74,7 @@ impl DiscardExperimentFluentBuilder { ); crate::operation::discard_experiment::DiscardExperiment::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl DiscardExperimentFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_config.rs b/crates/superposition_sdk/src/operation/get_config.rs index 847c64c9f..520f46bdc 100644 --- a/crates/superposition_sdk/src/operation/get_config.rs +++ b/crates/superposition_sdk/src/operation/get_config.rs @@ -23,7 +23,7 @@ impl GetConfig { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_config::GetConfigInput, @@ -45,20 +45,18 @@ impl GetConfig { "rpc.service" = "Superposition", "rpc.method" = "GetConfig", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetConfigRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetConfigResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetConfig") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetConfig", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetConfig") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetConfigEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetConfigEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf } } - + #[derive(Debug)] struct GetConfigResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetConfigResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_config::de_get_config_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_config::GetConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_config::GetConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/config").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -153,22 +156,22 @@ fn uri_query(_input: &crate::operation::get_config::GetConfigInput, mut output: #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_config::GetConfigInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_config::ser_get_config_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_config::ser_get_config_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -176,6 +179,7 @@ builder #[derive(Debug)] struct GetConfigEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetConfigEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetConfigEndpointParamsInterceptor" @@ -190,10 +194,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetConfigInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -204,7 +208,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetConfigError` operation. #[non_exhaustive] @@ -226,15 +230,15 @@ impl GetConfigError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetConfigError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -303,10 +307,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetConfi } } -pub use crate::operation::get_config::_get_config_output::GetConfigOutput; - pub use crate::operation::get_config::_get_config_input::GetConfigInput; +pub use crate::operation::get_config::_get_config_output::GetConfigOutput; + mod _get_config_input; mod _get_config_output; diff --git a/crates/superposition_sdk/src/operation/get_config/_get_config_input.rs b/crates/superposition_sdk/src/operation/get_config/_get_config_input.rs index deb77c03e..38ee8b861 100644 --- a/crates/superposition_sdk/src/operation/get_config/_get_config_input.rs +++ b/crates/superposition_sdk/src/operation/get_config/_get_config_input.rs @@ -26,7 +26,7 @@ impl GetConfigInput { self.org_id.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.prefix.is_none()`. pub fn prefix(&self) -> &[::std::string::String] { self.prefix.as_deref() diff --git a/crates/superposition_sdk/src/operation/get_config/builders.rs b/crates/superposition_sdk/src/operation/get_config/builders.rs index 88769fb6c..7d0462af7 100644 --- a/crates/superposition_sdk/src/operation/get_config/builders.rs +++ b/crates/superposition_sdk/src/operation/get_config/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_config::_get_config_output::GetConfigOutputBuilder; - pub use crate::operation::get_config::_get_config_input::GetConfigInputBuilder; +pub use crate::operation::get_config::_get_config_output::GetConfigOutputBuilder; + impl crate::operation::get_config::builders::GetConfigInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_config::builders::GetConfigInputBuilder { } } /// Fluent builder constructing a request to `GetConfig`. -/// +/// /// Retrieves config data with context evaluation, including applicable contexts, overrides, and default values based on provided conditions. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetConfigFluentBuilder { @@ -74,7 +74,7 @@ impl GetConfigFluentBuilder { ); crate::operation::get_config::GetConfig::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetConfigFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -124,11 +124,11 @@ impl GetConfigFluentBuilder { pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_org_id() } - /// + /// /// Appends an item to `prefix`. - /// + /// /// To override the contents of this collection use [`set_prefix`](Self::set_prefix). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.prefix(input.into()); @@ -171,11 +171,11 @@ impl GetConfigFluentBuilder { pub fn get_if_modified_since(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { self.inner.get_if_modified_since() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Map representing the context. Keys correspond to the names of the dimensions. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/get_config_json.rs b/crates/superposition_sdk/src/operation/get_config_json.rs index 4f9338b95..fb3af5a06 100644 --- a/crates/superposition_sdk/src/operation/get_config_json.rs +++ b/crates/superposition_sdk/src/operation/get_config_json.rs @@ -23,7 +23,7 @@ impl GetConfigJson { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_config_json::GetConfigJsonInput, @@ -45,20 +45,18 @@ impl GetConfigJson { "rpc.service" = "Superposition", "rpc.method" = "GetConfigJson", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetConfigJsonRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetConfigJsonResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetConfigJson") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetConfigJson", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetConfigJson") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetConfigJsonEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetConfigJsonEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf } } - + #[derive(Debug)] struct GetConfigJsonResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetConfigJsonResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_config_json::de_get_config_json_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_config_json::GetConfigJsonInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_config_json::GetConfigJsonInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/config/json").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,24 +140,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_config_json::GetConfigJsonInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_config_json::ser_get_config_json_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetConfigJsonEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetConfigJsonEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetConfigJsonEndpointParamsInterceptor" @@ -169,10 +173,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetConfigJsonInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -183,7 +187,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetConfigJsonError` operation. #[non_exhaustive] @@ -205,15 +209,15 @@ impl GetConfigJsonError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetConfigJsonError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -282,10 +286,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetConfi } } -pub use crate::operation::get_config_json::_get_config_json_output::GetConfigJsonOutput; - pub use crate::operation::get_config_json::_get_config_json_input::GetConfigJsonInput; +pub use crate::operation::get_config_json::_get_config_json_output::GetConfigJsonOutput; + mod _get_config_json_input; mod _get_config_json_output; diff --git a/crates/superposition_sdk/src/operation/get_config_json/builders.rs b/crates/superposition_sdk/src/operation/get_config_json/builders.rs index d1e0ba1a3..570a0a4f7 100644 --- a/crates/superposition_sdk/src/operation/get_config_json/builders.rs +++ b/crates/superposition_sdk/src/operation/get_config_json/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_config_json::_get_config_json_output::GetConfigJsonOutputBuilder; - pub use crate::operation::get_config_json::_get_config_json_input::GetConfigJsonInputBuilder; +pub use crate::operation::get_config_json::_get_config_json_output::GetConfigJsonOutputBuilder; + impl crate::operation::get_config_json::builders::GetConfigJsonInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_config_json::builders::GetConfigJsonInputBuilder { } } /// Fluent builder constructing a request to `GetConfigJson`. -/// +/// /// Retrieves the full config in JSON format, including default configs with schemas, dimensions, and overrides. This endpoint is optimized for clients that prefer JSON format for configuration management. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetConfigJsonFluentBuilder { @@ -74,7 +74,7 @@ impl GetConfigJsonFluentBuilder { ); crate::operation::get_config_json::GetConfigJson::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetConfigJsonFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_config_toml.rs b/crates/superposition_sdk/src/operation/get_config_toml.rs index 973cc8c7c..cd7c9ad13 100644 --- a/crates/superposition_sdk/src/operation/get_config_toml.rs +++ b/crates/superposition_sdk/src/operation/get_config_toml.rs @@ -23,7 +23,7 @@ impl GetConfigToml { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_config_toml::GetConfigTomlInput, @@ -45,20 +45,18 @@ impl GetConfigToml { "rpc.service" = "Superposition", "rpc.method" = "GetConfigToml", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetConfigTomlRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetConfigTomlResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetConfigToml") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetConfigToml", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetConfigToml") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetConfigTomlEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetConfigTomlEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf } } - + #[derive(Debug)] struct GetConfigTomlResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetConfigTomlResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_config_toml::de_get_config_toml_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_config_toml::GetConfigTomlInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_config_toml::GetConfigTomlInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/config/toml").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,24 +140,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetConf #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_config_toml::GetConfigTomlInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_config_toml::ser_get_config_toml_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetConfigTomlEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetConfigTomlEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetConfigTomlEndpointParamsInterceptor" @@ -169,10 +173,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetConfigTomlInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -183,7 +187,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetConfigTomlError` operation. #[non_exhaustive] @@ -205,15 +209,15 @@ impl GetConfigTomlError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetConfigTomlError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -282,10 +286,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetConfi } } -pub use crate::operation::get_config_toml::_get_config_toml_output::GetConfigTomlOutput; - pub use crate::operation::get_config_toml::_get_config_toml_input::GetConfigTomlInput; +pub use crate::operation::get_config_toml::_get_config_toml_output::GetConfigTomlOutput; + mod _get_config_toml_input; mod _get_config_toml_output; diff --git a/crates/superposition_sdk/src/operation/get_config_toml/builders.rs b/crates/superposition_sdk/src/operation/get_config_toml/builders.rs index 29f9ed52a..1d5493277 100644 --- a/crates/superposition_sdk/src/operation/get_config_toml/builders.rs +++ b/crates/superposition_sdk/src/operation/get_config_toml/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_config_toml::_get_config_toml_output::GetConfigTomlOutputBuilder; - pub use crate::operation::get_config_toml::_get_config_toml_input::GetConfigTomlInputBuilder; +pub use crate::operation::get_config_toml::_get_config_toml_output::GetConfigTomlOutputBuilder; + impl crate::operation::get_config_toml::builders::GetConfigTomlInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_config_toml::builders::GetConfigTomlInputBuilder { } } /// Fluent builder constructing a request to `GetConfigToml`. -/// +/// /// Retrieves the full config in TOML format, including default configs with schemas, dimensions, and overrides. This endpoint is optimized for clients that prefer TOML format for configuration management. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetConfigTomlFluentBuilder { @@ -74,7 +74,7 @@ impl GetConfigTomlFluentBuilder { ); crate::operation::get_config_toml::GetConfigToml::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetConfigTomlFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_context.rs b/crates/superposition_sdk/src/operation/get_context.rs index d056f433b..db6f08920 100644 --- a/crates/superposition_sdk/src/operation/get_context.rs +++ b/crates/superposition_sdk/src/operation/get_context.rs @@ -23,7 +23,7 @@ impl GetContext { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_context::GetContextInput, @@ -45,20 +45,18 @@ impl GetContext { "rpc.service" = "Superposition", "rpc.method" = "GetContext", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCont cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetContextRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetContextResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetContext") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetContext", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCont fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetContext") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetContextEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetContextEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCont } } - + #[derive(Debug)] struct GetContextResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetContextResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_context::de_get_context_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCont let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_context::GetContextInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_context::GetContextInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCont #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_context::GetContextInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_context::ser_get_context_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetContextEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetContextEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetContextEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetContextInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetContextError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetContextError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetContextError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetConte } } -pub use crate::operation::get_context::_get_context_output::GetContextOutput; - pub use crate::operation::get_context::_get_context_input::GetContextInput; +pub use crate::operation::get_context::_get_context_output::GetContextOutput; + mod _get_context_input; mod _get_context_output; diff --git a/crates/superposition_sdk/src/operation/get_context/builders.rs b/crates/superposition_sdk/src/operation/get_context/builders.rs index 059a207a3..18d47aab6 100644 --- a/crates/superposition_sdk/src/operation/get_context/builders.rs +++ b/crates/superposition_sdk/src/operation/get_context/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_context::_get_context_output::GetContextOutputBuilder; - pub use crate::operation::get_context::_get_context_input::GetContextInputBuilder; +pub use crate::operation::get_context::_get_context_output::GetContextOutputBuilder; + impl crate::operation::get_context::builders::GetContextInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_context::builders::GetContextInputBuilder { } } /// Fluent builder constructing a request to `GetContext`. -/// +/// /// Retrieves detailed information about a specific context by its unique identifier, including conditions, overrides, and metadata. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetContextFluentBuilder { @@ -74,7 +74,7 @@ impl GetContextFluentBuilder { ); crate::operation::get_context::GetContext::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetContextFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_context_from_condition.rs b/crates/superposition_sdk/src/operation/get_context_from_condition.rs index ff1f47e3b..d02bc3c1c 100644 --- a/crates/superposition_sdk/src/operation/get_context_from_condition.rs +++ b/crates/superposition_sdk/src/operation/get_context_from_condition.rs @@ -23,7 +23,7 @@ impl GetContextFromCondition { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_context_from_condition::GetContextFromConditionInput, @@ -45,20 +45,18 @@ impl GetContextFromCondition { "rpc.service" = "Superposition", "rpc.method" = "GetContextFromCondition", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCont cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetContextFromConditionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetContextFromConditionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetContextFromCondition") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetContextFromCondition", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCont fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetContextFromCondition") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetContextFromConditionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetContextFromConditionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCont } } - + #[derive(Debug)] struct GetContextFromConditionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetContextFromConditionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_context_from_condition::de_get_context_from_condition_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCont let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_context_from_condition::GetContextFromConditionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_context_from_condition::GetContextFromConditionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/context/get").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetCont #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_context_from_condition::GetContextFromConditionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_context_from_condition::ser_get_context_from_condition_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_context_from_condition_input::ser_context_http_payload(& input.context)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct GetContextFromConditionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetContextFromConditionEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetContextFromConditionEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetContextFromConditionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetContextFromConditionError` operation. #[non_exhaustive] @@ -211,15 +215,15 @@ impl GetContextFromConditionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetContextFromConditionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -302,10 +306,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetConte } } -pub use crate::operation::get_context_from_condition::_get_context_from_condition_output::GetContextFromConditionOutput; - pub use crate::operation::get_context_from_condition::_get_context_from_condition_input::GetContextFromConditionInput; +pub use crate::operation::get_context_from_condition::_get_context_from_condition_output::GetContextFromConditionOutput; + mod _get_context_from_condition_input; mod _get_context_from_condition_output; diff --git a/crates/superposition_sdk/src/operation/get_context_from_condition/builders.rs b/crates/superposition_sdk/src/operation/get_context_from_condition/builders.rs index 2c0aced18..285bdde41 100644 --- a/crates/superposition_sdk/src/operation/get_context_from_condition/builders.rs +++ b/crates/superposition_sdk/src/operation/get_context_from_condition/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_context_from_condition::_get_context_from_condition_output::GetContextFromConditionOutputBuilder; - pub use crate::operation::get_context_from_condition::_get_context_from_condition_input::GetContextFromConditionInputBuilder; +pub use crate::operation::get_context_from_condition::_get_context_from_condition_output::GetContextFromConditionOutputBuilder; + impl crate::operation::get_context_from_condition::builders::GetContextFromConditionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_context_from_condition::builders::GetContextFromCondi } } /// Fluent builder constructing a request to `GetContextFromCondition`. -/// +/// /// Retrieves context information by matching against provided conditions. Used to find contexts that would apply to specific scenarios. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetContextFromConditionFluentBuilder { @@ -74,7 +74,7 @@ impl GetContextFromConditionFluentBuilder { ); crate::operation::get_context_from_condition::GetContextFromCondition::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetContextFromConditionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_default_config.rs b/crates/superposition_sdk/src/operation/get_default_config.rs index cc1cf7eb8..a7a38711b 100644 --- a/crates/superposition_sdk/src/operation/get_default_config.rs +++ b/crates/superposition_sdk/src/operation/get_default_config.rs @@ -23,7 +23,7 @@ impl GetDefaultConfig { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_default_config::GetDefaultConfigInput, @@ -45,20 +45,18 @@ impl GetDefaultConfig { "rpc.service" = "Superposition", "rpc.method" = "GetDefaultConfig", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDefa cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetDefaultConfigRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetDefaultConfigResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetDefaultConfig") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetDefaultConfig", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDefa fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetDefaultConfig") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetDefaultConfigEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetDefaultConfigEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDefa } } - + #[derive(Debug)] struct GetDefaultConfigResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetDefaultConfigResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_default_config::de_get_default_config_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDefa let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_default_config::GetDefaultConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_default_config::GetDefaultConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.key; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("key", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDefa #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_default_config::GetDefaultConfigInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_default_config::ser_get_default_config_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetDefaultConfigEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetDefaultConfigEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetDefaultConfigEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetDefaultConfigInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetDefaultConfigError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetDefaultConfigError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetDefaultConfigError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetDefau } } -pub use crate::operation::get_default_config::_get_default_config_output::GetDefaultConfigOutput; - pub use crate::operation::get_default_config::_get_default_config_input::GetDefaultConfigInput; +pub use crate::operation::get_default_config::_get_default_config_output::GetDefaultConfigOutput; + mod _get_default_config_input; mod _get_default_config_output; diff --git a/crates/superposition_sdk/src/operation/get_default_config/builders.rs b/crates/superposition_sdk/src/operation/get_default_config/builders.rs index ac440435c..8362ab6ad 100644 --- a/crates/superposition_sdk/src/operation/get_default_config/builders.rs +++ b/crates/superposition_sdk/src/operation/get_default_config/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_default_config::_get_default_config_output::GetDefaultConfigOutputBuilder; - pub use crate::operation::get_default_config::_get_default_config_input::GetDefaultConfigInputBuilder; +pub use crate::operation::get_default_config::_get_default_config_output::GetDefaultConfigOutputBuilder; + impl crate::operation::get_default_config::builders::GetDefaultConfigInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_default_config::builders::GetDefaultConfigInputBuilde } } /// Fluent builder constructing a request to `GetDefaultConfig`. -/// +/// /// Retrieves a specific default config entry by its key, including its value, schema, function mappings, and metadata. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetDefaultConfigFluentBuilder { @@ -74,7 +74,7 @@ impl GetDefaultConfigFluentBuilder { ); crate::operation::get_default_config::GetDefaultConfig::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetDefaultConfigFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_detailed_resolved_config.rs b/crates/superposition_sdk/src/operation/get_detailed_resolved_config.rs index d4f0b6a4b..0ff472fb1 100644 --- a/crates/superposition_sdk/src/operation/get_detailed_resolved_config.rs +++ b/crates/superposition_sdk/src/operation/get_detailed_resolved_config.rs @@ -23,7 +23,7 @@ impl GetDetailedResolvedConfig { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_detailed_resolved_config::GetDetailedResolvedConfigInput, @@ -45,20 +45,18 @@ impl GetDetailedResolvedConfig { "rpc.service" = "Superposition", "rpc.method" = "GetDetailedResolvedConfig", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDeta cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetDetailedResolvedConfigRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetDetailedResolvedConfigResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetDetailedResolvedConfig") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetDetailedResolvedConfig", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDeta fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetDetailedResolvedConfig") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetDetailedResolvedConfigEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetDetailedResolvedConfigEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDeta } } - + #[derive(Debug)] struct GetDetailedResolvedConfigResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetDetailedResolvedConfigResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_detailed_resolved_config::de_get_detailed_resolved_config_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDeta let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_detailed_resolved_config::GetDetailedResolvedConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_detailed_resolved_config::GetDetailedResolvedConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/config/resolve/detailed").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -168,22 +171,22 @@ fn uri_query(_input: &crate::operation::get_detailed_resolved_config::GetDetaile #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_detailed_resolved_config::GetDetailedResolvedConfigInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_detailed_resolved_config::ser_get_detailed_resolved_config_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_detailed_resolved_config::ser_get_detailed_resolved_config_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -191,6 +194,7 @@ builder #[derive(Debug)] struct GetDetailedResolvedConfigEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetDetailedResolvedConfigEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetDetailedResolvedConfigEndpointParamsInterceptor" @@ -205,10 +209,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetDetailedResolvedConfigInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -219,7 +223,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetDetailedResolvedConfigError` operation. #[non_exhaustive] @@ -241,15 +245,15 @@ impl GetDetailedResolvedConfigError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetDetailedResolvedConfigError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -318,10 +322,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetDetai } } -pub use crate::operation::get_detailed_resolved_config::_get_detailed_resolved_config_output::GetDetailedResolvedConfigOutput; - pub use crate::operation::get_detailed_resolved_config::_get_detailed_resolved_config_input::GetDetailedResolvedConfigInput; +pub use crate::operation::get_detailed_resolved_config::_get_detailed_resolved_config_output::GetDetailedResolvedConfigOutput; + mod _get_detailed_resolved_config_input; mod _get_detailed_resolved_config_output; diff --git a/crates/superposition_sdk/src/operation/get_detailed_resolved_config/_get_detailed_resolved_config_input.rs b/crates/superposition_sdk/src/operation/get_detailed_resolved_config/_get_detailed_resolved_config_input.rs index 7c00fe64c..b5576ba24 100644 --- a/crates/superposition_sdk/src/operation/get_detailed_resolved_config/_get_detailed_resolved_config_input.rs +++ b/crates/superposition_sdk/src/operation/get_detailed_resolved_config/_get_detailed_resolved_config_input.rs @@ -32,7 +32,7 @@ impl GetDetailedResolvedConfigInput { self.org_id.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.prefix.is_none()`. pub fn prefix(&self) -> &[::std::string::String] { self.prefix.as_deref() diff --git a/crates/superposition_sdk/src/operation/get_detailed_resolved_config/builders.rs b/crates/superposition_sdk/src/operation/get_detailed_resolved_config/builders.rs index dc8aed37c..f5775ef6f 100644 --- a/crates/superposition_sdk/src/operation/get_detailed_resolved_config/builders.rs +++ b/crates/superposition_sdk/src/operation/get_detailed_resolved_config/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_detailed_resolved_config::_get_detailed_resolved_config_output::GetDetailedResolvedConfigOutputBuilder; - pub use crate::operation::get_detailed_resolved_config::_get_detailed_resolved_config_input::GetDetailedResolvedConfigInputBuilder; +pub use crate::operation::get_detailed_resolved_config::_get_detailed_resolved_config_output::GetDetailedResolvedConfigOutputBuilder; + impl crate::operation::get_detailed_resolved_config::builders::GetDetailedResolvedConfigInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_detailed_resolved_config::builders::GetDetailedResolv } } /// Fluent builder constructing a request to `GetDetailedResolvedConfig`. -/// +/// /// Resolves config values and returns each key with default-config metadata. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetDetailedResolvedConfigFluentBuilder { @@ -74,7 +74,7 @@ impl GetDetailedResolvedConfigFluentBuilder { ); crate::operation::get_detailed_resolved_config::GetDetailedResolvedConfig::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetDetailedResolvedConfigFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -124,11 +124,11 @@ impl GetDetailedResolvedConfigFluentBuilder { pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_org_id() } - /// + /// /// Appends an item to `prefix`. - /// + /// /// To override the contents of this collection use [`set_prefix`](Self::set_prefix). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.prefix(input.into()); @@ -213,11 +213,11 @@ impl GetDetailedResolvedConfigFluentBuilder { pub fn get_resolve_remote(&self) -> &::std::option::Option { self.inner.get_resolve_remote() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Map representing the context. Keys correspond to the names of the dimensions. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/get_dimension.rs b/crates/superposition_sdk/src/operation/get_dimension.rs index 9feac98a8..a8b87851f 100644 --- a/crates/superposition_sdk/src/operation/get_dimension.rs +++ b/crates/superposition_sdk/src/operation/get_dimension.rs @@ -23,7 +23,7 @@ impl GetDimension { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_dimension::GetDimensionInput, @@ -45,20 +45,18 @@ impl GetDimension { "rpc.service" = "Superposition", "rpc.method" = "GetDimension", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDime cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetDimensionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetDimensionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetDimension") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetDimension", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDime fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetDimension") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetDimensionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetDimensionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDime } } - + #[derive(Debug)] struct GetDimensionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetDimensionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_dimension::de_get_dimension_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDime let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_dimension::GetDimensionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_dimension::GetDimensionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.dimension; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("dimension", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetDime #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_dimension::GetDimensionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_dimension::ser_get_dimension_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetDimensionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetDimensionEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetDimensionEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetDimensionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetDimensionError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetDimensionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetDimensionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetDimen } } -pub use crate::operation::get_dimension::_get_dimension_output::GetDimensionOutput; - pub use crate::operation::get_dimension::_get_dimension_input::GetDimensionInput; +pub use crate::operation::get_dimension::_get_dimension_output::GetDimensionOutput; + mod _get_dimension_input; mod _get_dimension_output; diff --git a/crates/superposition_sdk/src/operation/get_dimension/builders.rs b/crates/superposition_sdk/src/operation/get_dimension/builders.rs index c0cb012e6..59f29be5f 100644 --- a/crates/superposition_sdk/src/operation/get_dimension/builders.rs +++ b/crates/superposition_sdk/src/operation/get_dimension/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_dimension::_get_dimension_output::GetDimensionOutputBuilder; - pub use crate::operation::get_dimension::_get_dimension_input::GetDimensionInputBuilder; +pub use crate::operation::get_dimension::_get_dimension_output::GetDimensionOutputBuilder; + impl crate::operation::get_dimension::builders::GetDimensionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_dimension::builders::GetDimensionInputBuilder { } } /// Fluent builder constructing a request to `GetDimension`. -/// +/// /// Retrieves detailed information about a specific dimension, including its schema, cohort dependency graph, and configuration metadata. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetDimensionFluentBuilder { @@ -74,7 +74,7 @@ impl GetDimensionFluentBuilder { ); crate::operation::get_dimension::GetDimension::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetDimensionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_experiment.rs b/crates/superposition_sdk/src/operation/get_experiment.rs index ab47e9008..556afed33 100644 --- a/crates/superposition_sdk/src/operation/get_experiment.rs +++ b/crates/superposition_sdk/src/operation/get_experiment.rs @@ -23,7 +23,7 @@ impl GetExperiment { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_experiment::GetExperimentInput, @@ -45,20 +45,18 @@ impl GetExperiment { "rpc.service" = "Superposition", "rpc.method" = "GetExperiment", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetExperimentRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetExperimentResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetExperiment") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetExperiment", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetExperiment") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetExperimentEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetExperimentEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe } } - + #[derive(Debug)] struct GetExperimentResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetExperimentResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_experiment::de_get_experiment_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_experiment::GetExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_experiment::GetExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_experiment::GetExperimentInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_experiment::ser_get_experiment_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetExperimentEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetExperimentEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetExperimentEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetExperimentInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetExperimentError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetExperimentError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetExperimentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetExper } } -pub use crate::operation::get_experiment::_get_experiment_output::GetExperimentOutput; - pub use crate::operation::get_experiment::_get_experiment_input::GetExperimentInput; +pub use crate::operation::get_experiment::_get_experiment_output::GetExperimentOutput; + mod _get_experiment_input; mod _get_experiment_output; diff --git a/crates/superposition_sdk/src/operation/get_experiment/builders.rs b/crates/superposition_sdk/src/operation/get_experiment/builders.rs index fe77c0901..b65556b4f 100644 --- a/crates/superposition_sdk/src/operation/get_experiment/builders.rs +++ b/crates/superposition_sdk/src/operation/get_experiment/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_experiment::_get_experiment_output::GetExperimentOutputBuilder; - pub use crate::operation::get_experiment::_get_experiment_input::GetExperimentInputBuilder; +pub use crate::operation::get_experiment::_get_experiment_output::GetExperimentOutputBuilder; + impl crate::operation::get_experiment::builders::GetExperimentInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_experiment::builders::GetExperimentInputBuilder { } } /// Fluent builder constructing a request to `GetExperiment`. -/// +/// /// Retrieves detailed information about a specific experiment, including its config, variants, status, and metrics. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetExperimentFluentBuilder { @@ -74,7 +74,7 @@ impl GetExperimentFluentBuilder { ); crate::operation::get_experiment::GetExperiment::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetExperimentFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_experiment_config.rs b/crates/superposition_sdk/src/operation/get_experiment_config.rs index 4504a9d36..7b750c5ee 100644 --- a/crates/superposition_sdk/src/operation/get_experiment_config.rs +++ b/crates/superposition_sdk/src/operation/get_experiment_config.rs @@ -23,7 +23,7 @@ impl GetExperimentConfig { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_experiment_config::GetExperimentConfigInput, @@ -45,20 +45,18 @@ impl GetExperimentConfig { "rpc.service" = "Superposition", "rpc.method" = "GetExperimentConfig", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetExperimentConfigRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetExperimentConfigResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetExperimentConfig") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetExperimentConfig", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetExperimentConfig") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetExperimentConfigEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetExperimentConfigEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe } } - + #[derive(Debug)] struct GetExperimentConfigResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetExperimentConfigResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_experiment_config::de_get_experiment_config_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_experiment_config::GetExperimentConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_experiment_config::GetExperimentConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/experiment-config").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -145,7 +148,7 @@ fn uri_query(_input: &crate::operation::get_experiment_config::GetExperimentConf } if let ::std::option::Option::Some(inner_3) = &_input.dimension_match_strategy { { - query.push_kv("dimension_match_strategy", &::aws_smithy_http::query::fmt_string(inner_3)); + query.push_kv("dimension_match_strategy", &::aws_smithy_http::query::fmt_string(inner_3.as_str())); } } ::std::result::Result::Ok(()) @@ -153,22 +156,22 @@ fn uri_query(_input: &crate::operation::get_experiment_config::GetExperimentConf #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_experiment_config::GetExperimentConfigInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_experiment_config::ser_get_experiment_config_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_experiment_config::ser_get_experiment_config_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -176,6 +179,7 @@ builder #[derive(Debug)] struct GetExperimentConfigEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetExperimentConfigEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetExperimentConfigEndpointParamsInterceptor" @@ -190,10 +194,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetExperimentConfigInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -204,7 +208,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetExperimentConfigError` operation. #[non_exhaustive] @@ -226,15 +230,15 @@ impl GetExperimentConfigError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetExperimentConfigError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -303,10 +307,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetExper } } -pub use crate::operation::get_experiment_config::_get_experiment_config_output::GetExperimentConfigOutput; - pub use crate::operation::get_experiment_config::_get_experiment_config_input::GetExperimentConfigInput; +pub use crate::operation::get_experiment_config::_get_experiment_config_output::GetExperimentConfigOutput; + mod _get_experiment_config_input; mod _get_experiment_config_output; diff --git a/crates/superposition_sdk/src/operation/get_experiment_config/_get_experiment_config_input.rs b/crates/superposition_sdk/src/operation/get_experiment_config/_get_experiment_config_input.rs index 54620380e..aa2b38a1a 100644 --- a/crates/superposition_sdk/src/operation/get_experiment_config/_get_experiment_config_input.rs +++ b/crates/superposition_sdk/src/operation/get_experiment_config/_get_experiment_config_input.rs @@ -30,7 +30,7 @@ impl GetExperimentConfigInput { self.if_modified_since.as_ref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.prefix.is_none()`. pub fn prefix(&self) -> &[::std::string::String] { self.prefix.as_deref() diff --git a/crates/superposition_sdk/src/operation/get_experiment_config/builders.rs b/crates/superposition_sdk/src/operation/get_experiment_config/builders.rs index 522d273ef..906546a48 100644 --- a/crates/superposition_sdk/src/operation/get_experiment_config/builders.rs +++ b/crates/superposition_sdk/src/operation/get_experiment_config/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_experiment_config::_get_experiment_config_output::GetExperimentConfigOutputBuilder; - pub use crate::operation::get_experiment_config::_get_experiment_config_input::GetExperimentConfigInputBuilder; +pub use crate::operation::get_experiment_config::_get_experiment_config_output::GetExperimentConfigOutputBuilder; + impl crate::operation::get_experiment_config::builders::GetExperimentConfigInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_experiment_config::builders::GetExperimentConfigInput } } /// Fluent builder constructing a request to `GetExperimentConfig`. -/// +/// /// Retrieves the experiment configuration for a given workspace and organization. The response includes details of all experiment groups and experiments that match the specified filters. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetExperimentConfigFluentBuilder { @@ -74,7 +74,7 @@ impl GetExperimentConfigFluentBuilder { ); crate::operation::get_experiment_config::GetExperimentConfig::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetExperimentConfigFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -138,11 +138,11 @@ impl GetExperimentConfigFluentBuilder { pub fn get_if_modified_since(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { self.inner.get_if_modified_since() } - /// + /// /// Appends an item to `prefix`. - /// + /// /// To override the contents of this collection use [`set_prefix`](Self::set_prefix). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.prefix(input.into()); @@ -157,11 +157,11 @@ impl GetExperimentConfigFluentBuilder { pub fn get_prefix(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> { self.inner.get_prefix() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Map representing the context. Keys correspond to the names of the dimensions. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/get_experiment_group.rs b/crates/superposition_sdk/src/operation/get_experiment_group.rs index a7c7844bc..3cab307ce 100644 --- a/crates/superposition_sdk/src/operation/get_experiment_group.rs +++ b/crates/superposition_sdk/src/operation/get_experiment_group.rs @@ -23,7 +23,7 @@ impl GetExperimentGroup { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_experiment_group::GetExperimentGroupInput, @@ -45,20 +45,18 @@ impl GetExperimentGroup { "rpc.service" = "Superposition", "rpc.method" = "GetExperimentGroup", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetExperimentGroupRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetExperimentGroupResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetExperimentGroup") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetExperimentGroup", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetExperimentGroup") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetExperimentGroupEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetExperimentGroupEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe } } - + #[derive(Debug)] struct GetExperimentGroupResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetExperimentGroupResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_experiment_group::de_get_experiment_group_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_experiment_group::GetExperimentGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_experiment_group::GetExperimentGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetExpe #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_experiment_group::GetExperimentGroupInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_experiment_group::ser_get_experiment_group_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetExperimentGroupEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetExperimentGroupEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetExperimentGroupEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetExperimentGroupInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetExperimentGroupError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetExperimentGroupError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetExperimentGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetExper } } -pub use crate::operation::get_experiment_group::_get_experiment_group_output::GetExperimentGroupOutput; - pub use crate::operation::get_experiment_group::_get_experiment_group_input::GetExperimentGroupInput; +pub use crate::operation::get_experiment_group::_get_experiment_group_output::GetExperimentGroupOutput; + mod _get_experiment_group_input; mod _get_experiment_group_output; diff --git a/crates/superposition_sdk/src/operation/get_experiment_group/builders.rs b/crates/superposition_sdk/src/operation/get_experiment_group/builders.rs index 23ae291f9..a452eabe0 100644 --- a/crates/superposition_sdk/src/operation/get_experiment_group/builders.rs +++ b/crates/superposition_sdk/src/operation/get_experiment_group/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_experiment_group::_get_experiment_group_output::GetExperimentGroupOutputBuilder; - pub use crate::operation::get_experiment_group::_get_experiment_group_input::GetExperimentGroupInputBuilder; +pub use crate::operation::get_experiment_group::_get_experiment_group_output::GetExperimentGroupOutputBuilder; + impl crate::operation::get_experiment_group::builders::GetExperimentGroupInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_experiment_group::builders::GetExperimentGroupInputBu } } /// Fluent builder constructing a request to `GetExperimentGroup`. -/// +/// /// Retrieves an existing experiment group by its ID. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetExperimentGroupFluentBuilder { @@ -74,7 +74,7 @@ impl GetExperimentGroupFluentBuilder { ); crate::operation::get_experiment_group::GetExperimentGroup::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetExperimentGroupFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_function.rs b/crates/superposition_sdk/src/operation/get_function.rs index 19afbc739..7e0e36a51 100644 --- a/crates/superposition_sdk/src/operation/get_function.rs +++ b/crates/superposition_sdk/src/operation/get_function.rs @@ -23,7 +23,7 @@ impl GetFunction { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_function::GetFunctionInput, @@ -45,20 +45,18 @@ impl GetFunction { "rpc.service" = "Superposition", "rpc.method" = "GetFunction", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetFunc cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetFunctionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetFunctionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetFunction") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetFunction", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetFunc fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetFunction") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetFunctionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetFunctionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetFunc } } - + #[derive(Debug)] struct GetFunctionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetFunctionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_function::de_get_function_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetFunc let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_function::GetFunctionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_function::GetFunctionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.function_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetFunc #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_function::GetFunctionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_function::ser_get_function_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetFunctionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetFunctionEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetFunctionEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetFunctionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetFunctionError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetFunctionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetFunctionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetFunct } } -pub use crate::operation::get_function::_get_function_output::GetFunctionOutput; - pub use crate::operation::get_function::_get_function_input::GetFunctionInput; +pub use crate::operation::get_function::_get_function_output::GetFunctionOutput; + mod _get_function_input; mod _get_function_output; diff --git a/crates/superposition_sdk/src/operation/get_function/builders.rs b/crates/superposition_sdk/src/operation/get_function/builders.rs index 2cb6f40c8..ebd8d6673 100644 --- a/crates/superposition_sdk/src/operation/get_function/builders.rs +++ b/crates/superposition_sdk/src/operation/get_function/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_function::_get_function_output::GetFunctionOutputBuilder; - pub use crate::operation::get_function::_get_function_input::GetFunctionInputBuilder; +pub use crate::operation::get_function::_get_function_output::GetFunctionOutputBuilder; + impl crate::operation::get_function::builders::GetFunctionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_function::builders::GetFunctionInputBuilder { } } /// Fluent builder constructing a request to `GetFunction`. -/// +/// /// Retrieves detailed information about a specific function including its published and draft versions, code, and metadata. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetFunctionFluentBuilder { @@ -74,7 +74,7 @@ impl GetFunctionFluentBuilder { ); crate::operation::get_function::GetFunction::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetFunctionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_organisation.rs b/crates/superposition_sdk/src/operation/get_organisation.rs index a3bdc509b..e97a37067 100644 --- a/crates/superposition_sdk/src/operation/get_organisation.rs +++ b/crates/superposition_sdk/src/operation/get_organisation.rs @@ -23,7 +23,7 @@ impl GetOrganisation { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_organisation::GetOrganisationInput, @@ -45,20 +45,18 @@ impl GetOrganisation { "rpc.service" = "Superposition", "rpc.method" = "GetOrganisation", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetOrga cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetOrganisationRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetOrganisationResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetOrganisation") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetOrganisation", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetOrga fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetOrganisation") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetOrganisationEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetOrganisationEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetOrga } } - + #[derive(Debug)] struct GetOrganisationResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetOrganisationResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_organisation::de_get_organisation_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetOrga let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_organisation::GetOrganisationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_organisation::GetOrganisationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,23 +146,24 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetOrga #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_organisation::GetOrganisationInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetOrganisationEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetOrganisationEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetOrganisationEndpointParamsInterceptor" @@ -174,10 +178,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetOrganisationInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -188,7 +192,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetOrganisationError` operation. #[non_exhaustive] @@ -212,15 +216,15 @@ impl GetOrganisationError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetOrganisationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -303,10 +307,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetOrgan } } -pub use crate::operation::get_organisation::_get_organisation_output::GetOrganisationOutput; - pub use crate::operation::get_organisation::_get_organisation_input::GetOrganisationInput; +pub use crate::operation::get_organisation::_get_organisation_output::GetOrganisationOutput; + mod _get_organisation_input; mod _get_organisation_output; diff --git a/crates/superposition_sdk/src/operation/get_organisation/builders.rs b/crates/superposition_sdk/src/operation/get_organisation/builders.rs index a4066a4cd..34f0889ed 100644 --- a/crates/superposition_sdk/src/operation/get_organisation/builders.rs +++ b/crates/superposition_sdk/src/operation/get_organisation/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_organisation::_get_organisation_output::GetOrganisationOutputBuilder; - pub use crate::operation::get_organisation::_get_organisation_input::GetOrganisationInputBuilder; +pub use crate::operation::get_organisation::_get_organisation_output::GetOrganisationOutputBuilder; + impl crate::operation::get_organisation::builders::GetOrganisationInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_organisation::builders::GetOrganisationInputBuilder { } } /// Fluent builder constructing a request to `GetOrganisation`. -/// +/// /// Retrieves detailed information about a specific organisation including its status, contact details, and administrative metadata. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetOrganisationFluentBuilder { @@ -74,7 +74,7 @@ impl GetOrganisationFluentBuilder { ); crate::operation::get_organisation::GetOrganisation::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetOrganisationFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_resolved_config.rs b/crates/superposition_sdk/src/operation/get_resolved_config.rs index d0ab762bc..0df6a1b84 100644 --- a/crates/superposition_sdk/src/operation/get_resolved_config.rs +++ b/crates/superposition_sdk/src/operation/get_resolved_config.rs @@ -23,7 +23,7 @@ impl GetResolvedConfig { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_resolved_config::GetResolvedConfigInput, @@ -45,20 +45,18 @@ impl GetResolvedConfig { "rpc.service" = "Superposition", "rpc.method" = "GetResolvedConfig", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetResolvedConfigRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetResolvedConfigResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetResolvedConfig") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetResolvedConfig", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetResolvedConfig") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetResolvedConfigEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetResolvedConfigEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso } } - + #[derive(Debug)] struct GetResolvedConfigResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetResolvedConfigResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_resolved_config::de_get_resolved_config_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_resolved_config::GetResolvedConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_resolved_config::GetResolvedConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/config/resolve").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -168,22 +171,22 @@ fn uri_query(_input: &crate::operation::get_resolved_config::GetResolvedConfigIn #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_resolved_config::GetResolvedConfigInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_resolved_config::ser_get_resolved_config_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_resolved_config::ser_get_resolved_config_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -191,6 +194,7 @@ builder #[derive(Debug)] struct GetResolvedConfigEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetResolvedConfigEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetResolvedConfigEndpointParamsInterceptor" @@ -205,10 +209,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetResolvedConfigInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -219,7 +223,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetResolvedConfigError` operation. #[non_exhaustive] @@ -241,15 +245,15 @@ impl GetResolvedConfigError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetResolvedConfigError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -318,10 +322,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetResol } } -pub use crate::operation::get_resolved_config::_get_resolved_config_output::GetResolvedConfigOutput; - pub use crate::operation::get_resolved_config::_get_resolved_config_input::GetResolvedConfigInput; +pub use crate::operation::get_resolved_config::_get_resolved_config_output::GetResolvedConfigOutput; + mod _get_resolved_config_input; mod _get_resolved_config_output; diff --git a/crates/superposition_sdk/src/operation/get_resolved_config/_get_resolved_config_input.rs b/crates/superposition_sdk/src/operation/get_resolved_config/_get_resolved_config_input.rs index 6d784c856..0f1aa9741 100644 --- a/crates/superposition_sdk/src/operation/get_resolved_config/_get_resolved_config_input.rs +++ b/crates/superposition_sdk/src/operation/get_resolved_config/_get_resolved_config_input.rs @@ -32,7 +32,7 @@ impl GetResolvedConfigInput { self.org_id.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.prefix.is_none()`. pub fn prefix(&self) -> &[::std::string::String] { self.prefix.as_deref() diff --git a/crates/superposition_sdk/src/operation/get_resolved_config/builders.rs b/crates/superposition_sdk/src/operation/get_resolved_config/builders.rs index 0070c77a5..cf5fff404 100644 --- a/crates/superposition_sdk/src/operation/get_resolved_config/builders.rs +++ b/crates/superposition_sdk/src/operation/get_resolved_config/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_resolved_config::_get_resolved_config_output::GetResolvedConfigOutputBuilder; - pub use crate::operation::get_resolved_config::_get_resolved_config_input::GetResolvedConfigInputBuilder; +pub use crate::operation::get_resolved_config::_get_resolved_config_output::GetResolvedConfigOutputBuilder; + impl crate::operation::get_resolved_config::builders::GetResolvedConfigInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_resolved_config::builders::GetResolvedConfigInputBuil } } /// Fluent builder constructing a request to `GetResolvedConfig`. -/// +/// /// Resolves and merges config values based on context conditions, applying overrides and merge strategies to produce the final configuration. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetResolvedConfigFluentBuilder { @@ -74,7 +74,7 @@ impl GetResolvedConfigFluentBuilder { ); crate::operation::get_resolved_config::GetResolvedConfig::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetResolvedConfigFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -124,11 +124,11 @@ impl GetResolvedConfigFluentBuilder { pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_org_id() } - /// + /// /// Appends an item to `prefix`. - /// + /// /// To override the contents of this collection use [`set_prefix`](Self::set_prefix). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.prefix(input.into()); @@ -213,11 +213,11 @@ impl GetResolvedConfigFluentBuilder { pub fn get_resolve_remote(&self) -> &::std::option::Option { self.inner.get_resolve_remote() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Map representing the context. Keys correspond to the names of the dimensions. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/get_resolved_config_explanation.rs b/crates/superposition_sdk/src/operation/get_resolved_config_explanation.rs index aaafae532..e32befb5f 100644 --- a/crates/superposition_sdk/src/operation/get_resolved_config_explanation.rs +++ b/crates/superposition_sdk/src/operation/get_resolved_config_explanation.rs @@ -23,7 +23,7 @@ impl GetResolvedConfigExplanation { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_resolved_config_explanation::GetResolvedConfigExplanationInput, @@ -45,20 +45,18 @@ impl GetResolvedConfigExplanation { "rpc.service" = "Superposition", "rpc.method" = "GetResolvedConfigExplanation", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetResolvedConfigExplanationRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetResolvedConfigExplanationResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetResolvedConfigExplanation") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetResolvedConfigExplanation", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetResolvedConfigExplanation") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetResolvedConfigExplanationEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetResolvedConfigExplanationEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso } } - + #[derive(Debug)] struct GetResolvedConfigExplanationResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetResolvedConfigExplanationResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_resolved_config_explanation::de_get_resolved_config_explanation_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_resolved_config_explanation::GetResolvedConfigExplanationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_resolved_config_explanation::GetResolvedConfigExplanationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.key; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("key", "cannot be empty or unset"))?; @@ -162,22 +165,22 @@ fn uri_query(_input: &crate::operation::get_resolved_config_explanation::GetReso #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_resolved_config_explanation::GetResolvedConfigExplanationInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_resolved_config_explanation::ser_get_resolved_config_explanation_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_resolved_config_explanation::ser_get_resolved_config_explanation_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -185,6 +188,7 @@ builder #[derive(Debug)] struct GetResolvedConfigExplanationEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetResolvedConfigExplanationEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetResolvedConfigExplanationEndpointParamsInterceptor" @@ -199,10 +203,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetResolvedConfigExplanationInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -213,7 +217,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetResolvedConfigExplanationError` operation. #[non_exhaustive] @@ -235,15 +239,15 @@ impl GetResolvedConfigExplanationError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetResolvedConfigExplanationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -312,10 +316,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetResol } } -pub use crate::operation::get_resolved_config_explanation::_get_resolved_config_explanation_output::GetResolvedConfigExplanationOutput; - pub use crate::operation::get_resolved_config_explanation::_get_resolved_config_explanation_input::GetResolvedConfigExplanationInput; +pub use crate::operation::get_resolved_config_explanation::_get_resolved_config_explanation_output::GetResolvedConfigExplanationOutput; + mod _get_resolved_config_explanation_input; mod _get_resolved_config_explanation_output; diff --git a/crates/superposition_sdk/src/operation/get_resolved_config_explanation/builders.rs b/crates/superposition_sdk/src/operation/get_resolved_config_explanation/builders.rs index f1a0a48eb..1754a861c 100644 --- a/crates/superposition_sdk/src/operation/get_resolved_config_explanation/builders.rs +++ b/crates/superposition_sdk/src/operation/get_resolved_config_explanation/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_resolved_config_explanation::_get_resolved_config_explanation_output::GetResolvedConfigExplanationOutputBuilder; - pub use crate::operation::get_resolved_config_explanation::_get_resolved_config_explanation_input::GetResolvedConfigExplanationInputBuilder; +pub use crate::operation::get_resolved_config_explanation::_get_resolved_config_explanation_output::GetResolvedConfigExplanationOutputBuilder; + impl crate::operation::get_resolved_config_explanation::builders::GetResolvedConfigExplanationInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_resolved_config_explanation::builders::GetResolvedCon } } /// Fluent builder constructing a request to `GetResolvedConfigExplanation`. -/// +/// /// Explains how matching contexts affect a single resolved config key. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetResolvedConfigExplanationFluentBuilder { @@ -74,7 +74,7 @@ impl GetResolvedConfigExplanationFluentBuilder { ); crate::operation::get_resolved_config_explanation::GetResolvedConfigExplanation::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetResolvedConfigExplanationFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -194,11 +194,11 @@ impl GetResolvedConfigExplanationFluentBuilder { pub fn get_resolve_remote(&self) -> &::std::option::Option { self.inner.get_resolve_remote() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Map representing the context. Keys correspond to the names of the dimensions. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier.rs b/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier.rs index 3fbba61d6..b43689373 100644 --- a/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier.rs +++ b/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier.rs @@ -23,7 +23,7 @@ impl GetResolvedConfigWithIdentifier { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_resolved_config_with_identifier::GetResolvedConfigWithIdentifierInput, @@ -45,20 +45,18 @@ impl GetResolvedConfigWithIdentifier { "rpc.service" = "Superposition", "rpc.method" = "GetResolvedConfigWithIdentifier", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetResolvedConfigWithIdentifierRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetResolvedConfigWithIdentifierResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetResolvedConfigWithIdentifier") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetResolvedConfigWithIdentifier", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetResolvedConfigWithIdentifier") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetResolvedConfigWithIdentifierEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetResolvedConfigWithIdentifierEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso } } - + #[derive(Debug)] struct GetResolvedConfigWithIdentifierResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetResolvedConfigWithIdentifierResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_resolved_config_with_identifier::de_get_resolved_config_with_identifier_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetReso let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_resolved_config_with_identifier::GetResolvedConfigWithIdentifierInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_resolved_config_with_identifier::GetResolvedConfigWithIdentifierInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/resolve").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -173,22 +176,22 @@ fn uri_query(_input: &crate::operation::get_resolved_config_with_identifier::Get #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_resolved_config_with_identifier::GetResolvedConfigWithIdentifierInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_resolved_config_with_identifier::ser_get_resolved_config_with_identifier_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_get_resolved_config_with_identifier::ser_get_resolved_config_with_identifier_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -196,6 +199,7 @@ builder #[derive(Debug)] struct GetResolvedConfigWithIdentifierEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetResolvedConfigWithIdentifierEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetResolvedConfigWithIdentifierEndpointParamsInterceptor" @@ -210,10 +214,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetResolvedConfigWithIdentifierInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -224,7 +228,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetResolvedConfigWithIdentifierError` operation. #[non_exhaustive] @@ -246,15 +250,15 @@ impl GetResolvedConfigWithIdentifierError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetResolvedConfigWithIdentifierError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -323,10 +327,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetResol } } -pub use crate::operation::get_resolved_config_with_identifier::_get_resolved_config_with_identifier_output::GetResolvedConfigWithIdentifierOutput; - pub use crate::operation::get_resolved_config_with_identifier::_get_resolved_config_with_identifier_input::GetResolvedConfigWithIdentifierInput; +pub use crate::operation::get_resolved_config_with_identifier::_get_resolved_config_with_identifier_output::GetResolvedConfigWithIdentifierOutput; + mod _get_resolved_config_with_identifier_input; mod _get_resolved_config_with_identifier_output; diff --git a/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier/_get_resolved_config_with_identifier_input.rs b/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier/_get_resolved_config_with_identifier_input.rs index 30921c819..4a34893e9 100644 --- a/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier/_get_resolved_config_with_identifier_input.rs +++ b/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier/_get_resolved_config_with_identifier_input.rs @@ -34,7 +34,7 @@ impl GetResolvedConfigWithIdentifierInput { self.org_id.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.prefix.is_none()`. pub fn prefix(&self) -> &[::std::string::String] { self.prefix.as_deref() diff --git a/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier/builders.rs b/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier/builders.rs index 9d6d1105f..9db035b29 100644 --- a/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier/builders.rs +++ b/crates/superposition_sdk/src/operation/get_resolved_config_with_identifier/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_resolved_config_with_identifier::_get_resolved_config_with_identifier_output::GetResolvedConfigWithIdentifierOutputBuilder; - pub use crate::operation::get_resolved_config_with_identifier::_get_resolved_config_with_identifier_input::GetResolvedConfigWithIdentifierInputBuilder; +pub use crate::operation::get_resolved_config_with_identifier::_get_resolved_config_with_identifier_output::GetResolvedConfigWithIdentifierOutputBuilder; + impl crate::operation::get_resolved_config_with_identifier::builders::GetResolvedConfigWithIdentifierInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_resolved_config_with_identifier::builders::GetResolve } } /// Fluent builder constructing a request to `GetResolvedConfigWithIdentifier`. -/// +/// /// Resolves and merges config values based on context conditions and identifier, applying overrides and merge strategies to produce the final configuration. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetResolvedConfigWithIdentifierFluentBuilder { @@ -74,7 +74,7 @@ impl GetResolvedConfigWithIdentifierFluentBuilder { ); crate::operation::get_resolved_config_with_identifier::GetResolvedConfigWithIdentifier::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetResolvedConfigWithIdentifierFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -124,11 +124,11 @@ impl GetResolvedConfigWithIdentifierFluentBuilder { pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_org_id() } - /// + /// /// Appends an item to `prefix`. - /// + /// /// To override the contents of this collection use [`set_prefix`](Self::set_prefix). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.prefix(input.into()); @@ -213,11 +213,11 @@ impl GetResolvedConfigWithIdentifierFluentBuilder { pub fn get_resolve_remote(&self) -> &::std::option::Option { self.inner.get_resolve_remote() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Map representing the context. Keys correspond to the names of the dimensions. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/get_secret.rs b/crates/superposition_sdk/src/operation/get_secret.rs index d53aa5e49..f78f09a16 100644 --- a/crates/superposition_sdk/src/operation/get_secret.rs +++ b/crates/superposition_sdk/src/operation/get_secret.rs @@ -23,7 +23,7 @@ impl GetSecret { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_secret::GetSecretInput, @@ -45,20 +45,18 @@ impl GetSecret { "rpc.service" = "Superposition", "rpc.method" = "GetSecret", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetSecr cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetSecretRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetSecretResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetSecret") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetSecret", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetSecr fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetSecret") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetSecretEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetSecretEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetSecr } } - + #[derive(Debug)] struct GetSecretResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetSecretResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_secret::de_get_secret_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetSecr let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_secret::GetSecretInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_secret::GetSecretInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetSecr #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_secret::GetSecretInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_secret::ser_get_secret_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetSecretEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetSecretEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetSecretEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetSecretInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetSecretError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetSecretError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetSecretError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetSecre } } -pub use crate::operation::get_secret::_get_secret_output::GetSecretOutput; - pub use crate::operation::get_secret::_get_secret_input::GetSecretInput; +pub use crate::operation::get_secret::_get_secret_output::GetSecretOutput; + mod _get_secret_input; mod _get_secret_output; diff --git a/crates/superposition_sdk/src/operation/get_secret/builders.rs b/crates/superposition_sdk/src/operation/get_secret/builders.rs index b98879a8d..bdb1ab48f 100644 --- a/crates/superposition_sdk/src/operation/get_secret/builders.rs +++ b/crates/superposition_sdk/src/operation/get_secret/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_secret::_get_secret_output::GetSecretOutputBuilder; - pub use crate::operation::get_secret::_get_secret_input::GetSecretInputBuilder; +pub use crate::operation::get_secret::_get_secret_output::GetSecretOutputBuilder; + impl crate::operation::get_secret::builders::GetSecretInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_secret::builders::GetSecretInputBuilder { } } /// Fluent builder constructing a request to `GetSecret`. -/// +/// /// Retrieves detailed information about a specific secret by its name. The value is masked for security. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetSecretFluentBuilder { @@ -74,7 +74,7 @@ impl GetSecretFluentBuilder { ); crate::operation::get_secret::GetSecret::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetSecretFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_type_template.rs b/crates/superposition_sdk/src/operation/get_type_template.rs index 2c214fe9c..7cc365f13 100644 --- a/crates/superposition_sdk/src/operation/get_type_template.rs +++ b/crates/superposition_sdk/src/operation/get_type_template.rs @@ -23,7 +23,7 @@ impl GetTypeTemplate { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_type_template::GetTypeTemplateInput, @@ -45,20 +45,18 @@ impl GetTypeTemplate { "rpc.service" = "Superposition", "rpc.method" = "GetTypeTemplate", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetType cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetTypeTemplateRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetTypeTemplateResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetTypeTemplate") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetTypeTemplate", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetType fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetTypeTemplate") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetTypeTemplateEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetTypeTemplateEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetType } } - + #[derive(Debug)] struct GetTypeTemplateResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetTypeTemplateResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_type_template::de_get_type_template_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetType let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_type_template::GetTypeTemplateInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_type_template::GetTypeTemplateInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.type_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("type_name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetType #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_type_template::GetTypeTemplateInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_type_template::ser_get_type_template_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetTypeTemplateEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetTypeTemplateEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetTypeTemplateEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetTypeTemplateInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetTypeTemplateError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetTypeTemplateError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetTypeTemplateError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetTypeT } } -pub use crate::operation::get_type_template::_get_type_template_output::GetTypeTemplateOutput; - pub use crate::operation::get_type_template::_get_type_template_input::GetTypeTemplateInput; +pub use crate::operation::get_type_template::_get_type_template_output::GetTypeTemplateOutput; + mod _get_type_template_input; mod _get_type_template_output; diff --git a/crates/superposition_sdk/src/operation/get_type_template/builders.rs b/crates/superposition_sdk/src/operation/get_type_template/builders.rs index c86dafaab..3a993baa6 100644 --- a/crates/superposition_sdk/src/operation/get_type_template/builders.rs +++ b/crates/superposition_sdk/src/operation/get_type_template/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_type_template::_get_type_template_output::GetTypeTemplateOutputBuilder; - pub use crate::operation::get_type_template::_get_type_template_input::GetTypeTemplateInputBuilder; +pub use crate::operation::get_type_template::_get_type_template_output::GetTypeTemplateOutputBuilder; + impl crate::operation::get_type_template::builders::GetTypeTemplateInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_type_template::builders::GetTypeTemplateInputBuilder } } /// Fluent builder constructing a request to `GetTypeTemplate`. -/// +/// /// Retrieves detailed information about a specific type template including its schema and metadata. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetTypeTemplateFluentBuilder { @@ -74,7 +74,7 @@ impl GetTypeTemplateFluentBuilder { ); crate::operation::get_type_template::GetTypeTemplate::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetTypeTemplateFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_type_templates_list.rs b/crates/superposition_sdk/src/operation/get_type_templates_list.rs index 96b844ec1..8c76b058e 100644 --- a/crates/superposition_sdk/src/operation/get_type_templates_list.rs +++ b/crates/superposition_sdk/src/operation/get_type_templates_list.rs @@ -23,7 +23,7 @@ impl GetTypeTemplatesList { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_type_templates_list::GetTypeTemplatesListInput, @@ -45,20 +45,18 @@ impl GetTypeTemplatesList { "rpc.service" = "Superposition", "rpc.method" = "GetTypeTemplatesList", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetType cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetTypeTemplatesListRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetTypeTemplatesListResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetTypeTemplatesList") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetTypeTemplatesList", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetType fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetTypeTemplatesList") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetTypeTemplatesListEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetTypeTemplatesListEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetType } } - + #[derive(Debug)] struct GetTypeTemplatesListResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetTypeTemplatesListResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_type_templates_list::de_get_type_templates_list_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetType let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_type_templates_list::GetTypeTemplatesListInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_type_templates_list::GetTypeTemplatesListInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/types").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -156,25 +159,26 @@ fn uri_query(_input: &crate::operation::get_type_templates_list::GetTypeTemplate #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_type_templates_list::GetTypeTemplatesListInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_type_templates_list::ser_get_type_templates_list_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetTypeTemplatesListEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetTypeTemplatesListEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetTypeTemplatesListEndpointParamsInterceptor" @@ -189,10 +193,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetTypeTemplatesListInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -203,7 +207,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetTypeTemplatesListError` operation. #[non_exhaustive] @@ -225,15 +229,15 @@ impl GetTypeTemplatesListError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetTypeTemplatesListError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -302,10 +306,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetTypeT } } -pub use crate::operation::get_type_templates_list::_get_type_templates_list_output::GetTypeTemplatesListOutput; - pub use crate::operation::get_type_templates_list::_get_type_templates_list_input::GetTypeTemplatesListInput; +pub use crate::operation::get_type_templates_list::_get_type_templates_list_output::GetTypeTemplatesListOutput; + mod _get_type_templates_list_input; mod _get_type_templates_list_output; diff --git a/crates/superposition_sdk/src/operation/get_type_templates_list/builders.rs b/crates/superposition_sdk/src/operation/get_type_templates_list/builders.rs index 6529b2e2c..cf84692f6 100644 --- a/crates/superposition_sdk/src/operation/get_type_templates_list/builders.rs +++ b/crates/superposition_sdk/src/operation/get_type_templates_list/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_type_templates_list::_get_type_templates_list_output::GetTypeTemplatesListOutputBuilder; - pub use crate::operation::get_type_templates_list::_get_type_templates_list_input::GetTypeTemplatesListInputBuilder; +pub use crate::operation::get_type_templates_list::_get_type_templates_list_output::GetTypeTemplatesListOutputBuilder; + impl crate::operation::get_type_templates_list::builders::GetTypeTemplatesListInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_type_templates_list::builders::GetTypeTemplatesListIn } } /// Fluent builder constructing a request to `GetTypeTemplatesList`. -/// +/// /// Retrieves a paginated list of all type templates in the workspace, including their schemas and metadata for type management. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetTypeTemplatesListFluentBuilder { @@ -74,7 +74,7 @@ impl GetTypeTemplatesListFluentBuilder { ); crate::operation::get_type_templates_list::GetTypeTemplatesList::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetTypeTemplatesListFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_variable.rs b/crates/superposition_sdk/src/operation/get_variable.rs index af8a7f3d5..64425db48 100644 --- a/crates/superposition_sdk/src/operation/get_variable.rs +++ b/crates/superposition_sdk/src/operation/get_variable.rs @@ -23,7 +23,7 @@ impl GetVariable { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_variable::GetVariableInput, @@ -45,20 +45,18 @@ impl GetVariable { "rpc.service" = "Superposition", "rpc.method" = "GetVariable", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetVari cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetVariableRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetVariableResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetVariable") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetVariable", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetVari fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetVariable") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetVariableEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetVariableEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetVari } } - + #[derive(Debug)] struct GetVariableResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetVariableResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_variable::de_get_variable_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetVari let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_variable::GetVariableInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_variable::GetVariableInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetVari #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_variable::GetVariableInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_variable::ser_get_variable_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetVariableEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetVariableEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetVariableEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetVariableInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetVariableError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetVariableError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetVariableError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetVaria } } -pub use crate::operation::get_variable::_get_variable_output::GetVariableOutput; - pub use crate::operation::get_variable::_get_variable_input::GetVariableInput; +pub use crate::operation::get_variable::_get_variable_output::GetVariableOutput; + mod _get_variable_input; mod _get_variable_output; diff --git a/crates/superposition_sdk/src/operation/get_variable/builders.rs b/crates/superposition_sdk/src/operation/get_variable/builders.rs index 0c77fed20..93c02bbb6 100644 --- a/crates/superposition_sdk/src/operation/get_variable/builders.rs +++ b/crates/superposition_sdk/src/operation/get_variable/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_variable::_get_variable_output::GetVariableOutputBuilder; - pub use crate::operation::get_variable::_get_variable_input::GetVariableInputBuilder; +pub use crate::operation::get_variable::_get_variable_output::GetVariableOutputBuilder; + impl crate::operation::get_variable::builders::GetVariableInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_variable::builders::GetVariableInputBuilder { } } /// Fluent builder constructing a request to `GetVariable`. -/// +/// /// Retrieves detailed information about a specific variable by its name. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetVariableFluentBuilder { @@ -74,7 +74,7 @@ impl GetVariableFluentBuilder { ); crate::operation::get_variable::GetVariable::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetVariableFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_version.rs b/crates/superposition_sdk/src/operation/get_version.rs index 666ed8dda..a743e908e 100644 --- a/crates/superposition_sdk/src/operation/get_version.rs +++ b/crates/superposition_sdk/src/operation/get_version.rs @@ -23,7 +23,7 @@ impl GetVersion { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_version::GetVersionInput, @@ -45,20 +45,18 @@ impl GetVersion { "rpc.service" = "Superposition", "rpc.method" = "GetVersion", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetVers cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetVersionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetVersionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetVersion") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetVersion", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetVers fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetVersion") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetVersionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetVersionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetVers } } - + #[derive(Debug)] struct GetVersionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetVersionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_version::de_get_version_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetVers let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_version::GetVersionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_version::GetVersionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetVers #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_version::GetVersionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_version::ser_get_version_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetVersionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetVersionEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetVersionEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetVersionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetVersionError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetVersionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetVersionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetVersi } } -pub use crate::operation::get_version::_get_version_output::GetVersionOutput; - pub use crate::operation::get_version::_get_version_input::GetVersionInput; +pub use crate::operation::get_version::_get_version_output::GetVersionOutput; + mod _get_version_input; mod _get_version_output; diff --git a/crates/superposition_sdk/src/operation/get_version/_get_version_output.rs b/crates/superposition_sdk/src/operation/get_version/_get_version_output.rs index f4826300f..4e42635d7 100644 --- a/crates/superposition_sdk/src/operation/get_version/_get_version_output.rs +++ b/crates/superposition_sdk/src/operation/get_version/_get_version_output.rs @@ -38,7 +38,7 @@ impl GetVersionOutput { use std::ops::Deref; self.description.deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`. pub fn tags(&self) -> &[::std::string::String] { self.tags.as_deref() diff --git a/crates/superposition_sdk/src/operation/get_version/builders.rs b/crates/superposition_sdk/src/operation/get_version/builders.rs index 94628ad72..32726732a 100644 --- a/crates/superposition_sdk/src/operation/get_version/builders.rs +++ b/crates/superposition_sdk/src/operation/get_version/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_version::_get_version_output::GetVersionOutputBuilder; - pub use crate::operation::get_version::_get_version_input::GetVersionInputBuilder; +pub use crate::operation::get_version::_get_version_output::GetVersionOutputBuilder; + impl crate::operation::get_version::builders::GetVersionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_version::builders::GetVersionInputBuilder { } } /// Fluent builder constructing a request to `GetVersion`. -/// +/// /// Retrieves a specific config version along with its metadata for audit and rollback purposes. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetVersionFluentBuilder { @@ -74,7 +74,7 @@ impl GetVersionFluentBuilder { ); crate::operation::get_version::GetVersion::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetVersionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_webhook.rs b/crates/superposition_sdk/src/operation/get_webhook.rs index 6a6b5a025..efcd939c0 100644 --- a/crates/superposition_sdk/src/operation/get_webhook.rs +++ b/crates/superposition_sdk/src/operation/get_webhook.rs @@ -23,7 +23,7 @@ impl GetWebhook { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_webhook::GetWebhookInput, @@ -45,20 +45,18 @@ impl GetWebhook { "rpc.service" = "Superposition", "rpc.method" = "GetWebhook", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWebh cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetWebhookRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetWebhookResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetWebhook") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetWebhook", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWebh fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetWebhook") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetWebhookEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetWebhookEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWebh } } - + #[derive(Debug)] struct GetWebhookResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetWebhookResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_webhook::de_get_webhook_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWebh let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_webhook::GetWebhookInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_webhook::GetWebhookInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWebh #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_webhook::GetWebhookInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_webhook::ser_get_webhook_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetWebhookEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetWebhookEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetWebhookEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetWebhookInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetWebhookError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetWebhookError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetWebhookError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetWebho } } -pub use crate::operation::get_webhook::_get_webhook_output::GetWebhookOutput; - pub use crate::operation::get_webhook::_get_webhook_input::GetWebhookInput; +pub use crate::operation::get_webhook::_get_webhook_output::GetWebhookOutput; + mod _get_webhook_input; mod _get_webhook_output; diff --git a/crates/superposition_sdk/src/operation/get_webhook/builders.rs b/crates/superposition_sdk/src/operation/get_webhook/builders.rs index 8dea99ed1..ea05a108b 100644 --- a/crates/superposition_sdk/src/operation/get_webhook/builders.rs +++ b/crates/superposition_sdk/src/operation/get_webhook/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_webhook::_get_webhook_output::GetWebhookOutputBuilder; - pub use crate::operation::get_webhook::_get_webhook_input::GetWebhookInputBuilder; +pub use crate::operation::get_webhook::_get_webhook_output::GetWebhookOutputBuilder; + impl crate::operation::get_webhook::builders::GetWebhookInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_webhook::builders::GetWebhookInputBuilder { } } /// Fluent builder constructing a request to `GetWebhook`. -/// +/// /// Retrieves detailed information about a specific webhook config, including its events, headers, and trigger history. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetWebhookFluentBuilder { @@ -74,7 +74,7 @@ impl GetWebhookFluentBuilder { ); crate::operation::get_webhook::GetWebhook::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetWebhookFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_webhook_by_event.rs b/crates/superposition_sdk/src/operation/get_webhook_by_event.rs index 6e9c31a7e..a5a0b99db 100644 --- a/crates/superposition_sdk/src/operation/get_webhook_by_event.rs +++ b/crates/superposition_sdk/src/operation/get_webhook_by_event.rs @@ -23,7 +23,7 @@ impl GetWebhookByEvent { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_webhook_by_event::GetWebhookByEventInput, @@ -45,20 +45,18 @@ impl GetWebhookByEvent { "rpc.service" = "Superposition", "rpc.method" = "GetWebhookByEvent", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWebh cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetWebhookByEventRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetWebhookByEventResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetWebhookByEvent") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetWebhookByEvent", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWebh fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetWebhookByEvent") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetWebhookByEventEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetWebhookByEventEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWebh } } - + #[derive(Debug)] struct GetWebhookByEventResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetWebhookByEventResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_webhook_by_event::de_get_webhook_by_event_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWebh let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_webhook_by_event::GetWebhookByEventInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_webhook_by_event::GetWebhookByEventInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.event; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("event", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWebh #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_webhook_by_event::GetWebhookByEventInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_webhook_by_event::ser_get_webhook_by_event_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetWebhookByEventEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetWebhookByEventEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetWebhookByEventEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetWebhookByEventInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetWebhookByEventError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetWebhookByEventError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetWebhookByEventError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetWebho } } -pub use crate::operation::get_webhook_by_event::_get_webhook_by_event_output::GetWebhookByEventOutput; - pub use crate::operation::get_webhook_by_event::_get_webhook_by_event_input::GetWebhookByEventInput; +pub use crate::operation::get_webhook_by_event::_get_webhook_by_event_output::GetWebhookByEventOutput; + mod _get_webhook_by_event_input; mod _get_webhook_by_event_output; diff --git a/crates/superposition_sdk/src/operation/get_webhook_by_event/builders.rs b/crates/superposition_sdk/src/operation/get_webhook_by_event/builders.rs index b9f22c55b..bcece7dce 100644 --- a/crates/superposition_sdk/src/operation/get_webhook_by_event/builders.rs +++ b/crates/superposition_sdk/src/operation/get_webhook_by_event/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_webhook_by_event::_get_webhook_by_event_output::GetWebhookByEventOutputBuilder; - pub use crate::operation::get_webhook_by_event::_get_webhook_by_event_input::GetWebhookByEventInputBuilder; +pub use crate::operation::get_webhook_by_event::_get_webhook_by_event_output::GetWebhookByEventOutputBuilder; + impl crate::operation::get_webhook_by_event::builders::GetWebhookByEventInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_webhook_by_event::builders::GetWebhookByEventInputBui } } /// Fluent builder constructing a request to `GetWebhookByEvent`. -/// +/// /// Retrieves a webhook configuration based on a specific event type, allowing users to find which webhook is set to trigger for that event. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetWebhookByEventFluentBuilder { @@ -74,7 +74,7 @@ impl GetWebhookByEventFluentBuilder { ); crate::operation::get_webhook_by_event::GetWebhookByEvent::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetWebhookByEventFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/get_workspace.rs b/crates/superposition_sdk/src/operation/get_workspace.rs index 177afb420..c84d08003 100644 --- a/crates/superposition_sdk/src/operation/get_workspace.rs +++ b/crates/superposition_sdk/src/operation/get_workspace.rs @@ -23,7 +23,7 @@ impl GetWorkspace { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::get_workspace::GetWorkspaceInput, @@ -45,20 +45,18 @@ impl GetWorkspace { "rpc.service" = "Superposition", "rpc.method" = "GetWorkspace", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWork cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(GetWorkspaceRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(GetWorkspaceResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("GetWorkspace") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "GetWorkspace", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWork fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetWorkspace") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(GetWorkspaceEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(GetWorkspaceEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWork } } - + #[derive(Debug)] struct GetWorkspaceResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetWorkspaceResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_get_workspace::de_get_workspace_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWork let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::get_workspace::GetWorkspaceInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::get_workspace::GetWorkspaceInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.workspace_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("workspace_name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetWork #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::get_workspace::GetWorkspaceInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_get_workspace::ser_get_workspace_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct GetWorkspaceEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetWorkspaceEndpointParamsInterceptor { fn name(&self) -> &'static str { "GetWorkspaceEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to GetWorkspaceInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `GetWorkspaceError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl GetWorkspaceError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `GetWorkspaceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetWorks } } -pub use crate::operation::get_workspace::_get_workspace_output::GetWorkspaceOutput; - pub use crate::operation::get_workspace::_get_workspace_input::GetWorkspaceInput; +pub use crate::operation::get_workspace::_get_workspace_output::GetWorkspaceOutput; + mod _get_workspace_input; mod _get_workspace_output; diff --git a/crates/superposition_sdk/src/operation/get_workspace/_get_workspace_output.rs b/crates/superposition_sdk/src/operation/get_workspace/_get_workspace_output.rs index b030ca000..1f32b62b7 100644 --- a/crates/superposition_sdk/src/operation/get_workspace/_get_workspace_output.rs +++ b/crates/superposition_sdk/src/operation/get_workspace/_get_workspace_output.rs @@ -86,7 +86,7 @@ impl GetWorkspaceOutput { &self.created_at } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.mandatory_dimensions.is_none()`. pub fn mandatory_dimensions(&self) -> &[::std::string::String] { self.mandatory_dimensions.as_deref() diff --git a/crates/superposition_sdk/src/operation/get_workspace/builders.rs b/crates/superposition_sdk/src/operation/get_workspace/builders.rs index c38966c3e..8923a547b 100644 --- a/crates/superposition_sdk/src/operation/get_workspace/builders.rs +++ b/crates/superposition_sdk/src/operation/get_workspace/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::get_workspace::_get_workspace_output::GetWorkspaceOutputBuilder; - pub use crate::operation::get_workspace::_get_workspace_input::GetWorkspaceInputBuilder; +pub use crate::operation::get_workspace::_get_workspace_output::GetWorkspaceOutputBuilder; + impl crate::operation::get_workspace::builders::GetWorkspaceInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::get_workspace::builders::GetWorkspaceInputBuilder { } } /// Fluent builder constructing a request to `GetWorkspace`. -/// +/// /// Retrieves detailed information about a specific workspace including its configuration and metadata. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct GetWorkspaceFluentBuilder { @@ -74,7 +74,7 @@ impl GetWorkspaceFluentBuilder { ); crate::operation::get_workspace::GetWorkspace::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl GetWorkspaceFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/list_audit_logs.rs b/crates/superposition_sdk/src/operation/list_audit_logs.rs index 65410d045..57ad81cea 100644 --- a/crates/superposition_sdk/src/operation/list_audit_logs.rs +++ b/crates/superposition_sdk/src/operation/list_audit_logs.rs @@ -23,7 +23,7 @@ impl ListAuditLogs { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_audit_logs::ListAuditLogsInput, @@ -45,20 +45,18 @@ impl ListAuditLogs { "rpc.service" = "Superposition", "rpc.method" = "ListAuditLogs", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListAud cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListAuditLogsRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListAuditLogsResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListAuditLogs") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListAuditLogs", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListAud fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListAuditLogs") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListAuditLogsEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListAuditLogsEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListAud } } - + #[derive(Debug)] struct ListAuditLogsResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListAuditLogsResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_audit_logs::de_list_audit_logs_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListAud let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_audit_logs::ListAuditLogsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_audit_logs::ListAuditLogsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/audit").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -181,7 +184,7 @@ fn uri_query(_input: &crate::operation::list_audit_logs::ListAuditLogsInput, mut if let ::std::option::Option::Some(inner_9) = &_input.action { { for inner_10 in inner_9 { - query.push_kv("action", &::aws_smithy_http::query::fmt_string(inner_10)); + query.push_kv("action", &::aws_smithy_http::query::fmt_string(inner_10.as_str())); } } } @@ -192,7 +195,7 @@ fn uri_query(_input: &crate::operation::list_audit_logs::ListAuditLogsInput, mut } if let ::std::option::Option::Some(inner_12) = &_input.sort_by { { - query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_12)); + query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_12.as_str())); } } ::std::result::Result::Ok(()) @@ -200,25 +203,26 @@ fn uri_query(_input: &crate::operation::list_audit_logs::ListAuditLogsInput, mut #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_audit_logs::ListAuditLogsInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_audit_logs::ser_list_audit_logs_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListAuditLogsEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListAuditLogsEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListAuditLogsEndpointParamsInterceptor" @@ -233,10 +237,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListAuditLogsInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -247,7 +251,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListAuditLogsError` operation. #[non_exhaustive] @@ -269,15 +273,15 @@ impl ListAuditLogsError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListAuditLogsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -346,10 +350,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListAudi } } -pub use crate::operation::list_audit_logs::_list_audit_logs_output::ListAuditLogsOutput; - pub use crate::operation::list_audit_logs::_list_audit_logs_input::ListAuditLogsInput; +pub use crate::operation::list_audit_logs::_list_audit_logs_output::ListAuditLogsOutput; + mod _list_audit_logs_input; mod _list_audit_logs_output; diff --git a/crates/superposition_sdk/src/operation/list_audit_logs/_list_audit_logs_input.rs b/crates/superposition_sdk/src/operation/list_audit_logs/_list_audit_logs_input.rs index 20bcabc88..de1c1ece5 100644 --- a/crates/superposition_sdk/src/operation/list_audit_logs/_list_audit_logs_input.rs +++ b/crates/superposition_sdk/src/operation/list_audit_logs/_list_audit_logs_input.rs @@ -58,14 +58,14 @@ impl ListAuditLogsInput { self.to_date.as_ref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tables.is_none()`. pub fn tables(&self) -> &[::std::string::String] { self.tables.as_deref() .unwrap_or_default() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.action.is_none()`. pub fn action(&self) -> &[crate::types::AuditAction] { self.action.as_deref() diff --git a/crates/superposition_sdk/src/operation/list_audit_logs/builders.rs b/crates/superposition_sdk/src/operation/list_audit_logs/builders.rs index 9dc71dd28..fec68d7da 100644 --- a/crates/superposition_sdk/src/operation/list_audit_logs/builders.rs +++ b/crates/superposition_sdk/src/operation/list_audit_logs/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_audit_logs::_list_audit_logs_output::ListAuditLogsOutputBuilder; - pub use crate::operation::list_audit_logs::_list_audit_logs_input::ListAuditLogsInputBuilder; +pub use crate::operation::list_audit_logs::_list_audit_logs_output::ListAuditLogsOutputBuilder; + impl crate::operation::list_audit_logs::builders::ListAuditLogsInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_audit_logs::builders::ListAuditLogsInputBuilder { } } /// Fluent builder constructing a request to `ListAuditLogs`. -/// +/// /// Retrieves a paginated list of audit logs with support for filtering by date range, table names, actions, and usernames for compliance and monitoring purposes. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListAuditLogsFluentBuilder { @@ -74,7 +74,7 @@ impl ListAuditLogsFluentBuilder { ); crate::operation::list_audit_logs::ListAuditLogs::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListAuditLogsFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -194,11 +194,11 @@ impl ListAuditLogsFluentBuilder { pub fn get_to_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { self.inner.get_to_date() } - /// + /// /// Appends an item to `tables`. - /// + /// /// To override the contents of this collection use [`set_tables`](Self::set_tables). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn tables(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.tables(input.into()); @@ -213,11 +213,11 @@ impl ListAuditLogsFluentBuilder { pub fn get_tables(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> { self.inner.get_tables() } - /// + /// /// Appends an item to `action`. - /// + /// /// To override the contents of this collection use [`set_action`](Self::set_action). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn action(mut self, input: crate::types::AuditAction) -> Self { self.inner = self.inner.action(input); @@ -246,11 +246,11 @@ impl ListAuditLogsFluentBuilder { pub fn get_username(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_username() } - /// + /// /// Adds a key-value pair to `dimension_params`. - /// + /// /// To override the contents of this collection use [`set_dimension_params`](Self::set_dimension_params). - /// + /// /// Additional dimension filter query parameters. Keys must be full query parameter names accepted by the API, for example `dimension\[country\]`. pub fn dimension_params(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.dimension_params(k.into(), v.into()); diff --git a/crates/superposition_sdk/src/operation/list_contexts.rs b/crates/superposition_sdk/src/operation/list_contexts.rs index 68a158c54..a66653b1a 100644 --- a/crates/superposition_sdk/src/operation/list_contexts.rs +++ b/crates/superposition_sdk/src/operation/list_contexts.rs @@ -23,7 +23,7 @@ impl ListContexts { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_contexts::ListContextsInput, @@ -45,20 +45,18 @@ impl ListContexts { "rpc.service" = "Superposition", "rpc.method" = "ListContexts", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListCon cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListContextsRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListContextsResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListContexts") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListContexts", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListCon fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListContexts") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListContextsEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListContextsEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListCon } } - + #[derive(Debug)] struct ListContextsResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListContextsResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_contexts::de_list_contexts_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListCon let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_contexts::ListContextsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_contexts::ListContextsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/context").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -170,12 +173,12 @@ fn uri_query(_input: &crate::operation::list_contexts::ListContextsInput, mut ou } if let ::std::option::Option::Some(inner_7) = &_input.sort_on { { - query.push_kv("sort_on", &::aws_smithy_http::query::fmt_string(inner_7)); + query.push_kv("sort_on", &::aws_smithy_http::query::fmt_string(inner_7.as_str())); } } if let ::std::option::Option::Some(inner_8) = &_input.sort_by { { - query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_8)); + query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_8.as_str())); } } if let ::std::option::Option::Some(inner_9) = &_input.created_by { @@ -199,7 +202,7 @@ fn uri_query(_input: &crate::operation::list_contexts::ListContextsInput, mut ou } if let ::std::option::Option::Some(inner_14) = &_input.dimension_match_strategy { { - query.push_kv("dimension_match_strategy", &::aws_smithy_http::query::fmt_string(inner_14)); + query.push_kv("dimension_match_strategy", &::aws_smithy_http::query::fmt_string(inner_14.as_str())); } } ::std::result::Result::Ok(()) @@ -207,25 +210,26 @@ fn uri_query(_input: &crate::operation::list_contexts::ListContextsInput, mut ou #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_contexts::ListContextsInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_contexts::ser_list_contexts_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListContextsEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListContextsEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListContextsEndpointParamsInterceptor" @@ -240,10 +244,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListContextsInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -254,7 +258,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListContextsError` operation. #[non_exhaustive] @@ -276,15 +280,15 @@ impl ListContextsError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListContextsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -353,10 +357,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListCont } } -pub use crate::operation::list_contexts::_list_contexts_output::ListContextsOutput; - pub use crate::operation::list_contexts::_list_contexts_input::ListContextsInput; +pub use crate::operation::list_contexts::_list_contexts_output::ListContextsOutput; + mod _list_contexts_input; mod _list_contexts_output; diff --git a/crates/superposition_sdk/src/operation/list_contexts/_list_contexts_input.rs b/crates/superposition_sdk/src/operation/list_contexts/_list_contexts_input.rs index f0bbe9620..73d99917b 100644 --- a/crates/superposition_sdk/src/operation/list_contexts/_list_contexts_input.rs +++ b/crates/superposition_sdk/src/operation/list_contexts/_list_contexts_input.rs @@ -52,7 +52,7 @@ impl ListContextsInput { self.org_id.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.prefix.is_none()`. pub fn prefix(&self) -> &[::std::string::String] { self.prefix.as_deref() @@ -67,14 +67,14 @@ impl ListContextsInput { self.sort_by.as_ref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.created_by.is_none()`. pub fn created_by(&self) -> &[::std::string::String] { self.created_by.as_deref() .unwrap_or_default() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.last_modified_by.is_none()`. pub fn last_modified_by(&self) -> &[::std::string::String] { self.last_modified_by.as_deref() diff --git a/crates/superposition_sdk/src/operation/list_contexts/builders.rs b/crates/superposition_sdk/src/operation/list_contexts/builders.rs index ebffe6ed2..1ada251ef 100644 --- a/crates/superposition_sdk/src/operation/list_contexts/builders.rs +++ b/crates/superposition_sdk/src/operation/list_contexts/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_contexts::_list_contexts_output::ListContextsOutputBuilder; - pub use crate::operation::list_contexts::_list_contexts_input::ListContextsInputBuilder; +pub use crate::operation::list_contexts::_list_contexts_output::ListContextsOutputBuilder; + impl crate::operation::list_contexts::builders::ListContextsInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_contexts::builders::ListContextsInputBuilder { } } /// Fluent builder constructing a request to `ListContexts`. -/// +/// /// Retrieves a paginated list of contexts with support for filtering by creation date, modification date, weight, and other criteria. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListContextsFluentBuilder { @@ -74,7 +74,7 @@ impl ListContextsFluentBuilder { ); crate::operation::list_contexts::ListContexts::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListContextsFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -166,11 +166,11 @@ impl ListContextsFluentBuilder { pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_org_id() } - /// + /// /// Appends an item to `prefix`. - /// + /// /// To override the contents of this collection use [`set_prefix`](Self::set_prefix). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.prefix(input.into()); @@ -213,11 +213,11 @@ impl ListContextsFluentBuilder { pub fn get_sort_by(&self) -> &::std::option::Option { self.inner.get_sort_by() } - /// + /// /// Appends an item to `created_by`. - /// + /// /// To override the contents of this collection use [`set_created_by`](Self::set_created_by). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.created_by(input.into()); @@ -232,11 +232,11 @@ impl ListContextsFluentBuilder { pub fn get_created_by(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> { self.inner.get_created_by() } - /// + /// /// Appends an item to `last_modified_by`. - /// + /// /// To override the contents of this collection use [`set_last_modified_by`](Self::set_last_modified_by). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.last_modified_by(input.into()); @@ -279,11 +279,11 @@ impl ListContextsFluentBuilder { pub fn get_dimension_match_strategy(&self) -> &::std::option::Option { self.inner.get_dimension_match_strategy() } - /// + /// /// Adds a key-value pair to `dimension_params`. - /// + /// /// To override the contents of this collection use [`set_dimension_params`](Self::set_dimension_params). - /// + /// /// Additional dimension filter query parameters. Keys must be full query parameter names accepted by the API, for example `dimension\[country\]`. pub fn dimension_params(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.dimension_params(k.into(), v.into()); diff --git a/crates/superposition_sdk/src/operation/list_default_configs.rs b/crates/superposition_sdk/src/operation/list_default_configs.rs index 772b7e49f..359d281dd 100644 --- a/crates/superposition_sdk/src/operation/list_default_configs.rs +++ b/crates/superposition_sdk/src/operation/list_default_configs.rs @@ -23,7 +23,7 @@ impl ListDefaultConfigs { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_default_configs::ListDefaultConfigsInput, @@ -45,20 +45,18 @@ impl ListDefaultConfigs { "rpc.service" = "Superposition", "rpc.method" = "ListDefaultConfigs", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListDef cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListDefaultConfigsRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListDefaultConfigsResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListDefaultConfigs") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListDefaultConfigs", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListDef fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListDefaultConfigs") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListDefaultConfigsEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListDefaultConfigsEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListDef } } - + #[derive(Debug)] struct ListDefaultConfigsResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListDefaultConfigsResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_default_configs::de_list_default_configs_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListDef let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_default_configs::ListDefaultConfigsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_default_configs::ListDefaultConfigsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/default-config").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -161,25 +164,26 @@ fn uri_query(_input: &crate::operation::list_default_configs::ListDefaultConfigs #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_default_configs::ListDefaultConfigsInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_default_configs::ser_list_default_configs_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListDefaultConfigsEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListDefaultConfigsEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListDefaultConfigsEndpointParamsInterceptor" @@ -194,10 +198,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListDefaultConfigsInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -208,7 +212,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListDefaultConfigsError` operation. #[non_exhaustive] @@ -230,15 +234,15 @@ impl ListDefaultConfigsError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListDefaultConfigsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -307,10 +311,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListDefa } } -pub use crate::operation::list_default_configs::_list_default_configs_output::ListDefaultConfigsOutput; - pub use crate::operation::list_default_configs::_list_default_configs_input::ListDefaultConfigsInput; +pub use crate::operation::list_default_configs::_list_default_configs_output::ListDefaultConfigsOutput; + mod _list_default_configs_input; mod _list_default_configs_output; diff --git a/crates/superposition_sdk/src/operation/list_default_configs/builders.rs b/crates/superposition_sdk/src/operation/list_default_configs/builders.rs index 5b4b75464..4a440f0a7 100644 --- a/crates/superposition_sdk/src/operation/list_default_configs/builders.rs +++ b/crates/superposition_sdk/src/operation/list_default_configs/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_default_configs::_list_default_configs_output::ListDefaultConfigsOutputBuilder; - pub use crate::operation::list_default_configs::_list_default_configs_input::ListDefaultConfigsInputBuilder; +pub use crate::operation::list_default_configs::_list_default_configs_output::ListDefaultConfigsOutputBuilder; + impl crate::operation::list_default_configs::builders::ListDefaultConfigsInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_default_configs::builders::ListDefaultConfigsInputBu } } /// Fluent builder constructing a request to `ListDefaultConfigs`. -/// +/// /// Retrieves a paginated list of all default config entries in the workspace, including their values, schemas, and metadata. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListDefaultConfigsFluentBuilder { @@ -74,7 +74,7 @@ impl ListDefaultConfigsFluentBuilder { ); crate::operation::list_default_configs::ListDefaultConfigs::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListDefaultConfigsFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/list_dimensions.rs b/crates/superposition_sdk/src/operation/list_dimensions.rs index 2addc2aa7..c0f621e64 100644 --- a/crates/superposition_sdk/src/operation/list_dimensions.rs +++ b/crates/superposition_sdk/src/operation/list_dimensions.rs @@ -23,7 +23,7 @@ impl ListDimensions { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_dimensions::ListDimensionsInput, @@ -45,20 +45,18 @@ impl ListDimensions { "rpc.service" = "Superposition", "rpc.method" = "ListDimensions", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListDim cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListDimensionsRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListDimensionsResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListDimensions") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListDimensions", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListDim fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListDimensions") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListDimensionsEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListDimensionsEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListDim } } - + #[derive(Debug)] struct ListDimensionsResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListDimensionsResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_dimensions::de_list_dimensions_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListDim let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_dimensions::ListDimensionsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_dimensions::ListDimensionsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/dimension").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -156,25 +159,26 @@ fn uri_query(_input: &crate::operation::list_dimensions::ListDimensionsInput, mu #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_dimensions::ListDimensionsInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_dimensions::ser_list_dimensions_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListDimensionsEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListDimensionsEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListDimensionsEndpointParamsInterceptor" @@ -189,10 +193,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListDimensionsInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -203,7 +207,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListDimensionsError` operation. #[non_exhaustive] @@ -225,15 +229,15 @@ impl ListDimensionsError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListDimensionsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -302,10 +306,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListDime } } -pub use crate::operation::list_dimensions::_list_dimensions_output::ListDimensionsOutput; - pub use crate::operation::list_dimensions::_list_dimensions_input::ListDimensionsInput; +pub use crate::operation::list_dimensions::_list_dimensions_output::ListDimensionsOutput; + mod _list_dimensions_input; mod _list_dimensions_output; diff --git a/crates/superposition_sdk/src/operation/list_dimensions/builders.rs b/crates/superposition_sdk/src/operation/list_dimensions/builders.rs index bb1b11ecd..82eb181a3 100644 --- a/crates/superposition_sdk/src/operation/list_dimensions/builders.rs +++ b/crates/superposition_sdk/src/operation/list_dimensions/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_dimensions::_list_dimensions_output::ListDimensionsOutputBuilder; - pub use crate::operation::list_dimensions::_list_dimensions_input::ListDimensionsInputBuilder; +pub use crate::operation::list_dimensions::_list_dimensions_output::ListDimensionsOutputBuilder; + impl crate::operation::list_dimensions::builders::ListDimensionsInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_dimensions::builders::ListDimensionsInputBuilder { } } /// Fluent builder constructing a request to `ListDimensions`. -/// +/// /// Retrieves a paginated list of all dimensions in the workspace. Dimensions are returned with their details and metadata. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListDimensionsFluentBuilder { @@ -74,7 +74,7 @@ impl ListDimensionsFluentBuilder { ); crate::operation::list_dimensions::ListDimensions::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListDimensionsFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/list_experiment.rs b/crates/superposition_sdk/src/operation/list_experiment.rs index d14b46a72..de6b6dd00 100644 --- a/crates/superposition_sdk/src/operation/list_experiment.rs +++ b/crates/superposition_sdk/src/operation/list_experiment.rs @@ -23,7 +23,7 @@ impl ListExperiment { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_experiment::ListExperimentInput, @@ -45,20 +45,18 @@ impl ListExperiment { "rpc.service" = "Superposition", "rpc.method" = "ListExperiment", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListExp cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListExperimentRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListExperimentResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListExperiment") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListExperiment", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListExp fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListExperiment") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListExperimentEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListExperimentEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListExp } } - + #[derive(Debug)] struct ListExperimentResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListExperimentResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_experiment::de_list_experiment_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListExp let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_experiment::ListExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_experiment::ListExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/experiments/list").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -164,7 +167,7 @@ fn uri_query(_input: &crate::operation::list_experiment::ListExperimentInput, mu if let ::std::option::Option::Some(inner_5) = &_input.status { { for inner_6 in inner_5 { - query.push_kv("status", &::aws_smithy_http::query::fmt_string(inner_6)); + query.push_kv("status", &::aws_smithy_http::query::fmt_string(inner_6.as_str())); } } } @@ -206,12 +209,12 @@ fn uri_query(_input: &crate::operation::list_experiment::ListExperimentInput, mu } if let ::std::option::Option::Some(inner_16) = &_input.sort_on { { - query.push_kv("sort_on", &::aws_smithy_http::query::fmt_string(inner_16)); + query.push_kv("sort_on", &::aws_smithy_http::query::fmt_string(inner_16.as_str())); } } if let ::std::option::Option::Some(inner_17) = &_input.sort_by { { - query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_17)); + query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_17.as_str())); } } if let ::std::option::Option::Some(inner_18) = &_input.global_experiments_only { @@ -221,7 +224,7 @@ fn uri_query(_input: &crate::operation::list_experiment::ListExperimentInput, mu } if let ::std::option::Option::Some(inner_19) = &_input.dimension_match_strategy { { - query.push_kv("dimension_match_strategy", &::aws_smithy_http::query::fmt_string(inner_19)); + query.push_kv("dimension_match_strategy", &::aws_smithy_http::query::fmt_string(inner_19.as_str())); } } if let ::std::option::Option::Some(inner_20) = &_input.prefix { @@ -236,22 +239,22 @@ fn uri_query(_input: &crate::operation::list_experiment::ListExperimentInput, mu #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_experiment::ListExperimentInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_experiment::ser_list_experiment_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_experiment::ser_list_experiment_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -259,6 +262,7 @@ builder #[derive(Debug)] struct ListExperimentEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListExperimentEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListExperimentEndpointParamsInterceptor" @@ -273,10 +277,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListExperimentInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -287,7 +291,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListExperimentError` operation. #[non_exhaustive] @@ -309,15 +313,15 @@ impl ListExperimentError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListExperimentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -386,10 +390,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListExpe } } -pub use crate::operation::list_experiment::_list_experiment_output::ListExperimentOutput; - pub use crate::operation::list_experiment::_list_experiment_input::ListExperimentInput; +pub use crate::operation::list_experiment::_list_experiment_output::ListExperimentOutput; + mod _list_experiment_input; mod _list_experiment_output; diff --git a/crates/superposition_sdk/src/operation/list_experiment/_list_experiment_input.rs b/crates/superposition_sdk/src/operation/list_experiment/_list_experiment_input.rs index e97a34721..2f5992cb9 100644 --- a/crates/superposition_sdk/src/operation/list_experiment/_list_experiment_input.rs +++ b/crates/superposition_sdk/src/operation/list_experiment/_list_experiment_input.rs @@ -70,7 +70,7 @@ impl ListExperimentInput { self.if_modified_since.as_ref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.status.is_none()`. pub fn status(&self) -> &[crate::types::ExperimentStatusType] { self.status.as_deref() @@ -89,21 +89,21 @@ impl ListExperimentInput { self.experiment_name.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.experiment_ids.is_none()`. pub fn experiment_ids(&self) -> &[::std::string::String] { self.experiment_ids.as_deref() .unwrap_or_default() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.experiment_group_ids.is_none()`. pub fn experiment_group_ids(&self) -> &[::std::string::String] { self.experiment_group_ids.as_deref() .unwrap_or_default() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.created_by.is_none()`. pub fn created_by(&self) -> &[::std::string::String] { self.created_by.as_deref() @@ -130,7 +130,7 @@ impl ListExperimentInput { self.dimension_params.as_ref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.prefix.is_none()`. pub fn prefix(&self) -> &[::std::string::String] { self.prefix.as_deref() diff --git a/crates/superposition_sdk/src/operation/list_experiment/builders.rs b/crates/superposition_sdk/src/operation/list_experiment/builders.rs index 28c31969d..ab627ea3d 100644 --- a/crates/superposition_sdk/src/operation/list_experiment/builders.rs +++ b/crates/superposition_sdk/src/operation/list_experiment/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_experiment::_list_experiment_output::ListExperimentOutputBuilder; - pub use crate::operation::list_experiment::_list_experiment_input::ListExperimentInputBuilder; +pub use crate::operation::list_experiment::_list_experiment_output::ListExperimentOutputBuilder; + impl crate::operation::list_experiment::builders::ListExperimentInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_experiment::builders::ListExperimentInputBuilder { } } /// Fluent builder constructing a request to `ListExperiment`. -/// +/// /// Retrieves a paginated list of experiments with support for filtering by status, date range, name, creator, and experiment group. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListExperimentFluentBuilder { @@ -74,7 +74,7 @@ impl ListExperimentFluentBuilder { ); crate::operation::list_experiment::ListExperiment::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListExperimentFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -180,11 +180,11 @@ impl ListExperimentFluentBuilder { pub fn get_if_modified_since(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> { self.inner.get_if_modified_since() } - /// + /// /// Appends an item to `status`. - /// + /// /// To override the contents of this collection use [`set_status`](Self::set_status). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn status(mut self, input: crate::types::ExperimentStatusType) -> Self { self.inner = self.inner.status(input); @@ -241,11 +241,11 @@ impl ListExperimentFluentBuilder { pub fn get_experiment_name(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_experiment_name() } - /// + /// /// Appends an item to `experiment_ids`. - /// + /// /// To override the contents of this collection use [`set_experiment_ids`](Self::set_experiment_ids). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn experiment_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.experiment_ids(input.into()); @@ -260,11 +260,11 @@ impl ListExperimentFluentBuilder { pub fn get_experiment_ids(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> { self.inner.get_experiment_ids() } - /// + /// /// Appends an item to `experiment_group_ids`. - /// + /// /// To override the contents of this collection use [`set_experiment_group_ids`](Self::set_experiment_group_ids). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn experiment_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.experiment_group_ids(input.into()); @@ -279,11 +279,11 @@ impl ListExperimentFluentBuilder { pub fn get_experiment_group_ids(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> { self.inner.get_experiment_group_ids() } - /// + /// /// Appends an item to `created_by`. - /// + /// /// To override the contents of this collection use [`set_created_by`](Self::set_created_by). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.created_by(input.into()); @@ -354,11 +354,11 @@ impl ListExperimentFluentBuilder { pub fn get_dimension_match_strategy(&self) -> &::std::option::Option { self.inner.get_dimension_match_strategy() } - /// + /// /// Adds a key-value pair to `dimension_params`. - /// + /// /// To override the contents of this collection use [`set_dimension_params`](Self::set_dimension_params). - /// + /// /// Additional dimension filter query parameters. Keys must be full query parameter names accepted by the API, for example `dimension\[country\]`. pub fn dimension_params(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.dimension_params(k.into(), v.into()); @@ -373,11 +373,11 @@ impl ListExperimentFluentBuilder { pub fn get_dimension_params(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>> { self.inner.get_dimension_params() } - /// + /// /// Appends an item to `prefix`. - /// + /// /// To override the contents of this collection use [`set_prefix`](Self::set_prefix). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.prefix(input.into()); @@ -392,11 +392,11 @@ impl ListExperimentFluentBuilder { pub fn get_prefix(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> { self.inner.get_prefix() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Map representing the context. Keys correspond to the names of the dimensions. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/list_experiment_groups.rs b/crates/superposition_sdk/src/operation/list_experiment_groups.rs index 22b2d55b7..e7fd69e77 100644 --- a/crates/superposition_sdk/src/operation/list_experiment_groups.rs +++ b/crates/superposition_sdk/src/operation/list_experiment_groups.rs @@ -23,7 +23,7 @@ impl ListExperimentGroups { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_experiment_groups::ListExperimentGroupsInput, @@ -45,20 +45,18 @@ impl ListExperimentGroups { "rpc.service" = "Superposition", "rpc.method" = "ListExperimentGroups", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListExp cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListExperimentGroupsRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListExperimentGroupsResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListExperimentGroups") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListExperimentGroups", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListExp fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListExperimentGroups") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListExperimentGroupsEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListExperimentGroupsEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListExp } } - + #[derive(Debug)] struct ListExperimentGroupsResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListExperimentGroupsResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_experiment_groups::de_list_experiment_groups_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListExp let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_experiment_groups::ListExperimentGroupsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_experiment_groups::ListExperimentGroupsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/experiment-groups/list").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -178,24 +181,24 @@ fn uri_query(_input: &crate::operation::list_experiment_groups::ListExperimentGr } if let ::std::option::Option::Some(inner_8) = &_input.sort_on { { - query.push_kv("sort_on", &::aws_smithy_http::query::fmt_string(inner_8)); + query.push_kv("sort_on", &::aws_smithy_http::query::fmt_string(inner_8.as_str())); } } if let ::std::option::Option::Some(inner_9) = &_input.sort_by { { - query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_9)); + query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_9.as_str())); } } if let ::std::option::Option::Some(inner_10) = &_input.group_type { { for inner_11 in inner_10 { - query.push_kv("group_type", &::aws_smithy_http::query::fmt_string(inner_11)); + query.push_kv("group_type", &::aws_smithy_http::query::fmt_string(inner_11.as_str())); } } } if let ::std::option::Option::Some(inner_12) = &_input.dimension_match_strategy { { - query.push_kv("dimension_match_strategy", &::aws_smithy_http::query::fmt_string(inner_12)); + query.push_kv("dimension_match_strategy", &::aws_smithy_http::query::fmt_string(inner_12.as_str())); } } ::std::result::Result::Ok(()) @@ -203,22 +206,22 @@ fn uri_query(_input: &crate::operation::list_experiment_groups::ListExperimentGr #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_experiment_groups::ListExperimentGroupsInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_experiment_groups::ser_list_experiment_groups_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_list_experiment_groups::ser_list_experiment_groups_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -226,6 +229,7 @@ builder #[derive(Debug)] struct ListExperimentGroupsEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListExperimentGroupsEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListExperimentGroupsEndpointParamsInterceptor" @@ -240,10 +244,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListExperimentGroupsInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -254,7 +258,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListExperimentGroupsError` operation. #[non_exhaustive] @@ -276,15 +280,15 @@ impl ListExperimentGroupsError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListExperimentGroupsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -353,10 +357,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListExpe } } -pub use crate::operation::list_experiment_groups::_list_experiment_groups_output::ListExperimentGroupsOutput; - pub use crate::operation::list_experiment_groups::_list_experiment_groups_input::ListExperimentGroupsInput; +pub use crate::operation::list_experiment_groups::_list_experiment_groups_output::ListExperimentGroupsOutput; + mod _list_experiment_groups_input; mod _list_experiment_groups_output; diff --git a/crates/superposition_sdk/src/operation/list_experiment_groups/_list_experiment_groups_input.rs b/crates/superposition_sdk/src/operation/list_experiment_groups/_list_experiment_groups_input.rs index 618f4e30f..35e7f62a4 100644 --- a/crates/superposition_sdk/src/operation/list_experiment_groups/_list_experiment_groups_input.rs +++ b/crates/superposition_sdk/src/operation/list_experiment_groups/_list_experiment_groups_input.rs @@ -80,7 +80,7 @@ impl ListExperimentGroupsInput { self.sort_by.as_ref() } /// Filter by the type of group (USER_CREATED or SYSTEM_GENERATED). - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.group_type.is_none()`. pub fn group_type(&self) -> &[crate::types::GroupType] { self.group_type.as_deref() diff --git a/crates/superposition_sdk/src/operation/list_experiment_groups/builders.rs b/crates/superposition_sdk/src/operation/list_experiment_groups/builders.rs index 3b8416870..928260e1f 100644 --- a/crates/superposition_sdk/src/operation/list_experiment_groups/builders.rs +++ b/crates/superposition_sdk/src/operation/list_experiment_groups/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_experiment_groups::_list_experiment_groups_output::ListExperimentGroupsOutputBuilder; - pub use crate::operation::list_experiment_groups::_list_experiment_groups_input::ListExperimentGroupsInputBuilder; +pub use crate::operation::list_experiment_groups::_list_experiment_groups_output::ListExperimentGroupsOutputBuilder; + impl crate::operation::list_experiment_groups::builders::ListExperimentGroupsInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_experiment_groups::builders::ListExperimentGroupsInp } } /// Fluent builder constructing a request to `ListExperimentGroups`. -/// +/// /// Lists experiment groups, with support for filtering and pagination. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListExperimentGroupsFluentBuilder { @@ -74,7 +74,7 @@ impl ListExperimentGroupsFluentBuilder { ); crate::operation::list_experiment_groups::ListExperimentGroups::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListExperimentGroupsFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -250,11 +250,11 @@ impl ListExperimentGroupsFluentBuilder { pub fn get_sort_by(&self) -> &::std::option::Option { self.inner.get_sort_by() } - /// + /// /// Appends an item to `group_type`. - /// + /// /// To override the contents of this collection use [`set_group_type`](Self::set_group_type). - /// + /// /// Filter by the type of group (USER_CREATED or SYSTEM_GENERATED). pub fn group_type(mut self, input: crate::types::GroupType) -> Self { self.inner = self.inner.group_type(input); @@ -283,11 +283,11 @@ impl ListExperimentGroupsFluentBuilder { pub fn get_dimension_match_strategy(&self) -> &::std::option::Option { self.inner.get_dimension_match_strategy() } - /// + /// /// Adds a key-value pair to `dimension_params`. - /// + /// /// To override the contents of this collection use [`set_dimension_params`](Self::set_dimension_params). - /// + /// /// Additional dimension filter query parameters. Keys must be full query parameter names accepted by the API, for example `dimension\[country\]`. pub fn dimension_params(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.dimension_params(k.into(), v.into()); @@ -302,11 +302,11 @@ impl ListExperimentGroupsFluentBuilder { pub fn get_dimension_params(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::std::string::String>> { self.inner.get_dimension_params() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Map representing the context. Keys correspond to the names of the dimensions. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/list_function.rs b/crates/superposition_sdk/src/operation/list_function.rs index 2935cbbee..2ede87343 100644 --- a/crates/superposition_sdk/src/operation/list_function.rs +++ b/crates/superposition_sdk/src/operation/list_function.rs @@ -23,7 +23,7 @@ impl ListFunction { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_function::ListFunctionInput, @@ -45,20 +45,18 @@ impl ListFunction { "rpc.service" = "Superposition", "rpc.method" = "ListFunction", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListFun cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListFunctionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListFunctionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListFunction") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListFunction", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListFun fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListFunction") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListFunctionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListFunctionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListFun } } - + #[derive(Debug)] struct ListFunctionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListFunctionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_function::de_list_function_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListFun let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_function::ListFunctionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_function::ListFunctionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/function").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -154,7 +157,7 @@ fn uri_query(_input: &crate::operation::list_function::ListFunctionInput, mut ou if let ::std::option::Option::Some(inner_4) = &_input.function_type { { for inner_5 in inner_4 { - query.push_kv("function_type", &::aws_smithy_http::query::fmt_string(inner_5)); + query.push_kv("function_type", &::aws_smithy_http::query::fmt_string(inner_5.as_str())); } } } @@ -163,25 +166,26 @@ fn uri_query(_input: &crate::operation::list_function::ListFunctionInput, mut ou #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_function::ListFunctionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_function::ser_list_function_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListFunctionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListFunctionEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListFunctionEndpointParamsInterceptor" @@ -196,10 +200,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListFunctionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -210,7 +214,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListFunctionError` operation. #[non_exhaustive] @@ -232,15 +236,15 @@ impl ListFunctionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListFunctionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -309,10 +313,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListFunc } } -pub use crate::operation::list_function::_list_function_output::ListFunctionOutput; - pub use crate::operation::list_function::_list_function_input::ListFunctionInput; +pub use crate::operation::list_function::_list_function_output::ListFunctionOutput; + mod _list_function_input; mod _list_function_output; diff --git a/crates/superposition_sdk/src/operation/list_function/_list_function_input.rs b/crates/superposition_sdk/src/operation/list_function/_list_function_input.rs index 3eeb788f1..8bd6a836e 100644 --- a/crates/superposition_sdk/src/operation/list_function/_list_function_input.rs +++ b/crates/superposition_sdk/src/operation/list_function/_list_function_input.rs @@ -38,7 +38,7 @@ impl ListFunctionInput { self.org_id.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.function_type.is_none()`. pub fn function_type(&self) -> &[crate::types::FunctionTypes] { self.function_type.as_deref() diff --git a/crates/superposition_sdk/src/operation/list_function/builders.rs b/crates/superposition_sdk/src/operation/list_function/builders.rs index 9c8d0c63e..35141f601 100644 --- a/crates/superposition_sdk/src/operation/list_function/builders.rs +++ b/crates/superposition_sdk/src/operation/list_function/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_function::_list_function_output::ListFunctionOutputBuilder; - pub use crate::operation::list_function::_list_function_input::ListFunctionInputBuilder; +pub use crate::operation::list_function::_list_function_output::ListFunctionOutputBuilder; + impl crate::operation::list_function::builders::ListFunctionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_function::builders::ListFunctionInputBuilder { } } /// Fluent builder constructing a request to `ListFunction`. -/// +/// /// Retrieves a paginated list of all functions in the workspace with their basic information and current status. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListFunctionFluentBuilder { @@ -74,7 +74,7 @@ impl ListFunctionFluentBuilder { ); crate::operation::list_function::ListFunction::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListFunctionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -166,11 +166,11 @@ impl ListFunctionFluentBuilder { pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_org_id() } - /// + /// /// Appends an item to `function_type`. - /// + /// /// To override the contents of this collection use [`set_function_type`](Self::set_function_type). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn function_type(mut self, input: crate::types::FunctionTypes) -> Self { self.inner = self.inner.function_type(input); diff --git a/crates/superposition_sdk/src/operation/list_organisation.rs b/crates/superposition_sdk/src/operation/list_organisation.rs index 1e54849cb..17207d4e2 100644 --- a/crates/superposition_sdk/src/operation/list_organisation.rs +++ b/crates/superposition_sdk/src/operation/list_organisation.rs @@ -23,7 +23,7 @@ impl ListOrganisation { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_organisation::ListOrganisationInput, @@ -45,20 +45,18 @@ impl ListOrganisation { "rpc.service" = "Superposition", "rpc.method" = "ListOrganisation", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListOrg cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListOrganisationRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListOrganisationResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListOrganisation") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListOrganisation", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListOrg fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListOrganisation") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListOrganisationEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListOrganisationEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListOrg } } - + #[derive(Debug)] struct ListOrganisationResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListOrganisationResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_organisation::de_list_organisation_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListOrg let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_organisation::ListOrganisationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_organisation::ListOrganisationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/superposition/organisations").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -156,24 +159,25 @@ fn uri_query(_input: &crate::operation::list_organisation::ListOrganisationInput #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_organisation::ListOrganisationInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListOrganisationEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListOrganisationEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListOrganisationEndpointParamsInterceptor" @@ -188,10 +192,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListOrganisationInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -202,7 +206,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListOrganisationError` operation. #[non_exhaustive] @@ -224,15 +228,15 @@ impl ListOrganisationError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListOrganisationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -301,10 +305,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListOrga } } -pub use crate::operation::list_organisation::_list_organisation_output::ListOrganisationOutput; - pub use crate::operation::list_organisation::_list_organisation_input::ListOrganisationInput; +pub use crate::operation::list_organisation::_list_organisation_output::ListOrganisationOutput; + mod _list_organisation_input; mod _list_organisation_output; diff --git a/crates/superposition_sdk/src/operation/list_organisation/builders.rs b/crates/superposition_sdk/src/operation/list_organisation/builders.rs index d86ee7a48..c5050208a 100644 --- a/crates/superposition_sdk/src/operation/list_organisation/builders.rs +++ b/crates/superposition_sdk/src/operation/list_organisation/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_organisation::_list_organisation_output::ListOrganisationOutputBuilder; - pub use crate::operation::list_organisation::_list_organisation_input::ListOrganisationInputBuilder; +pub use crate::operation::list_organisation::_list_organisation_output::ListOrganisationOutputBuilder; + impl crate::operation::list_organisation::builders::ListOrganisationInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_organisation::builders::ListOrganisationInputBuilder } } /// Fluent builder constructing a request to `ListOrganisation`. -/// +/// /// Retrieves a paginated list of all organisations with their basic information, creation details, and current status. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListOrganisationFluentBuilder { @@ -74,7 +74,7 @@ impl ListOrganisationFluentBuilder { ); crate::operation::list_organisation::ListOrganisation::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListOrganisationFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/list_secrets.rs b/crates/superposition_sdk/src/operation/list_secrets.rs index 4bdabee0d..0ca3d8469 100644 --- a/crates/superposition_sdk/src/operation/list_secrets.rs +++ b/crates/superposition_sdk/src/operation/list_secrets.rs @@ -23,7 +23,7 @@ impl ListSecrets { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_secrets::ListSecretsInput, @@ -45,20 +45,18 @@ impl ListSecrets { "rpc.service" = "Superposition", "rpc.method" = "ListSecrets", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListSec cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListSecretsRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListSecretsResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListSecrets") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListSecrets", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListSec fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListSecrets") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListSecretsEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListSecretsEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListSec } } - + #[derive(Debug)] struct ListSecretsResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListSecretsResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_secrets::de_list_secrets_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListSec let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_secrets::ListSecretsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_secrets::ListSecretsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/secrets").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -174,12 +177,12 @@ fn uri_query(_input: &crate::operation::list_secrets::ListSecretsInput, mut outp } if let ::std::option::Option::Some(inner_10) = &_input.sort_on { { - query.push_kv("sort_on", &::aws_smithy_http::query::fmt_string(inner_10)); + query.push_kv("sort_on", &::aws_smithy_http::query::fmt_string(inner_10.as_str())); } } if let ::std::option::Option::Some(inner_11) = &_input.sort_by { { - query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_11)); + query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_11.as_str())); } } ::std::result::Result::Ok(()) @@ -187,25 +190,26 @@ fn uri_query(_input: &crate::operation::list_secrets::ListSecretsInput, mut outp #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_secrets::ListSecretsInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_secrets::ser_list_secrets_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListSecretsEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListSecretsEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListSecretsEndpointParamsInterceptor" @@ -220,10 +224,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListSecretsInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -234,7 +238,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListSecretsError` operation. #[non_exhaustive] @@ -256,15 +260,15 @@ impl ListSecretsError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListSecretsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -333,10 +337,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListSecr } } -pub use crate::operation::list_secrets::_list_secrets_output::ListSecretsOutput; - pub use crate::operation::list_secrets::_list_secrets_input::ListSecretsInput; +pub use crate::operation::list_secrets::_list_secrets_output::ListSecretsOutput; + mod _list_secrets_input; mod _list_secrets_output; diff --git a/crates/superposition_sdk/src/operation/list_secrets/_list_secrets_input.rs b/crates/superposition_sdk/src/operation/list_secrets/_list_secrets_input.rs index c5f9b772c..7b64f067f 100644 --- a/crates/superposition_sdk/src/operation/list_secrets/_list_secrets_input.rs +++ b/crates/superposition_sdk/src/operation/list_secrets/_list_secrets_input.rs @@ -46,21 +46,21 @@ impl ListSecretsInput { self.org_id.as_deref() } /// Filter by secret name. - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.name.is_none()`. pub fn name(&self) -> &[::std::string::String] { self.name.as_deref() .unwrap_or_default() } /// Filter by the user who created the secret. - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.created_by.is_none()`. pub fn created_by(&self) -> &[::std::string::String] { self.created_by.as_deref() .unwrap_or_default() } /// Filter by the user who last modified the secret. - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.last_modified_by.is_none()`. pub fn last_modified_by(&self) -> &[::std::string::String] { self.last_modified_by.as_deref() diff --git a/crates/superposition_sdk/src/operation/list_secrets/builders.rs b/crates/superposition_sdk/src/operation/list_secrets/builders.rs index 9c0c4844a..1126571e6 100644 --- a/crates/superposition_sdk/src/operation/list_secrets/builders.rs +++ b/crates/superposition_sdk/src/operation/list_secrets/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_secrets::_list_secrets_output::ListSecretsOutputBuilder; - pub use crate::operation::list_secrets::_list_secrets_input::ListSecretsInputBuilder; +pub use crate::operation::list_secrets::_list_secrets_output::ListSecretsOutputBuilder; + impl crate::operation::list_secrets::builders::ListSecretsInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_secrets::builders::ListSecretsInputBuilder { } } /// Fluent builder constructing a request to `ListSecrets`. -/// +/// /// Retrieves a paginated list of all secrets in the workspace with optional filtering and sorting. All secret values are masked. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListSecretsFluentBuilder { @@ -74,7 +74,7 @@ impl ListSecretsFluentBuilder { ); crate::operation::list_secrets::ListSecrets::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListSecretsFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -166,11 +166,11 @@ impl ListSecretsFluentBuilder { pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_org_id() } - /// + /// /// Appends an item to `name`. - /// + /// /// To override the contents of this collection use [`set_name`](Self::set_name). - /// + /// /// Filter by secret name. pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.name(input.into()); @@ -185,11 +185,11 @@ impl ListSecretsFluentBuilder { pub fn get_name(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> { self.inner.get_name() } - /// + /// /// Appends an item to `created_by`. - /// + /// /// To override the contents of this collection use [`set_created_by`](Self::set_created_by). - /// + /// /// Filter by the user who created the secret. pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.created_by(input.into()); @@ -204,11 +204,11 @@ impl ListSecretsFluentBuilder { pub fn get_created_by(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> { self.inner.get_created_by() } - /// + /// /// Appends an item to `last_modified_by`. - /// + /// /// To override the contents of this collection use [`set_last_modified_by`](Self::set_last_modified_by). - /// + /// /// Filter by the user who last modified the secret. pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.last_modified_by(input.into()); diff --git a/crates/superposition_sdk/src/operation/list_variables.rs b/crates/superposition_sdk/src/operation/list_variables.rs index 7b41c8699..3da09dd23 100644 --- a/crates/superposition_sdk/src/operation/list_variables.rs +++ b/crates/superposition_sdk/src/operation/list_variables.rs @@ -23,7 +23,7 @@ impl ListVariables { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_variables::ListVariablesInput, @@ -45,20 +45,18 @@ impl ListVariables { "rpc.service" = "Superposition", "rpc.method" = "ListVariables", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListVar cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListVariablesRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListVariablesResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListVariables") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListVariables", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListVar fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListVariables") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListVariablesEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListVariablesEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListVar } } - + #[derive(Debug)] struct ListVariablesResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListVariablesResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_variables::de_list_variables_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListVar let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_variables::ListVariablesInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_variables::ListVariablesInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/variables").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -174,12 +177,12 @@ fn uri_query(_input: &crate::operation::list_variables::ListVariablesInput, mut } if let ::std::option::Option::Some(inner_10) = &_input.sort_on { { - query.push_kv("sort_on", &::aws_smithy_http::query::fmt_string(inner_10)); + query.push_kv("sort_on", &::aws_smithy_http::query::fmt_string(inner_10.as_str())); } } if let ::std::option::Option::Some(inner_11) = &_input.sort_by { { - query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_11)); + query.push_kv("sort_by", &::aws_smithy_http::query::fmt_string(inner_11.as_str())); } } ::std::result::Result::Ok(()) @@ -187,25 +190,26 @@ fn uri_query(_input: &crate::operation::list_variables::ListVariablesInput, mut #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_variables::ListVariablesInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_variables::ser_list_variables_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListVariablesEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListVariablesEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListVariablesEndpointParamsInterceptor" @@ -220,10 +224,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListVariablesInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -234,7 +238,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListVariablesError` operation. #[non_exhaustive] @@ -256,15 +260,15 @@ impl ListVariablesError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListVariablesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -333,10 +337,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListVari } } -pub use crate::operation::list_variables::_list_variables_output::ListVariablesOutput; - pub use crate::operation::list_variables::_list_variables_input::ListVariablesInput; +pub use crate::operation::list_variables::_list_variables_output::ListVariablesOutput; + mod _list_variables_input; mod _list_variables_output; diff --git a/crates/superposition_sdk/src/operation/list_variables/_list_variables_input.rs b/crates/superposition_sdk/src/operation/list_variables/_list_variables_input.rs index db4f3e409..298dd93c9 100644 --- a/crates/superposition_sdk/src/operation/list_variables/_list_variables_input.rs +++ b/crates/superposition_sdk/src/operation/list_variables/_list_variables_input.rs @@ -46,21 +46,21 @@ impl ListVariablesInput { self.org_id.as_deref() } /// Filter by variable name (exact match or substring, depending on backend implementation). - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.name.is_none()`. pub fn name(&self) -> &[::std::string::String] { self.name.as_deref() .unwrap_or_default() } /// Filter by the user who created the variable - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.created_by.is_none()`. pub fn created_by(&self) -> &[::std::string::String] { self.created_by.as_deref() .unwrap_or_default() } /// Filter by the user who last modified the variable - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.last_modified_by.is_none()`. pub fn last_modified_by(&self) -> &[::std::string::String] { self.last_modified_by.as_deref() diff --git a/crates/superposition_sdk/src/operation/list_variables/builders.rs b/crates/superposition_sdk/src/operation/list_variables/builders.rs index 9fd0b838c..9f0d84b07 100644 --- a/crates/superposition_sdk/src/operation/list_variables/builders.rs +++ b/crates/superposition_sdk/src/operation/list_variables/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_variables::_list_variables_output::ListVariablesOutputBuilder; - pub use crate::operation::list_variables::_list_variables_input::ListVariablesInputBuilder; +pub use crate::operation::list_variables::_list_variables_output::ListVariablesOutputBuilder; + impl crate::operation::list_variables::builders::ListVariablesInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_variables::builders::ListVariablesInputBuilder { } } /// Fluent builder constructing a request to `ListVariables`. -/// +/// /// Retrieves a paginated list of all variables in the workspace with optional filtering and sorting. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListVariablesFluentBuilder { @@ -74,7 +74,7 @@ impl ListVariablesFluentBuilder { ); crate::operation::list_variables::ListVariables::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListVariablesFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -166,11 +166,11 @@ impl ListVariablesFluentBuilder { pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_org_id() } - /// + /// /// Appends an item to `name`. - /// + /// /// To override the contents of this collection use [`set_name`](Self::set_name). - /// + /// /// Filter by variable name (exact match or substring, depending on backend implementation). pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.name(input.into()); @@ -185,11 +185,11 @@ impl ListVariablesFluentBuilder { pub fn get_name(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> { self.inner.get_name() } - /// + /// /// Appends an item to `created_by`. - /// + /// /// To override the contents of this collection use [`set_created_by`](Self::set_created_by). - /// + /// /// Filter by the user who created the variable pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.created_by(input.into()); @@ -204,11 +204,11 @@ impl ListVariablesFluentBuilder { pub fn get_created_by(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> { self.inner.get_created_by() } - /// + /// /// Appends an item to `last_modified_by`. - /// + /// /// To override the contents of this collection use [`set_last_modified_by`](Self::set_last_modified_by). - /// + /// /// Filter by the user who last modified the variable pub fn last_modified_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.last_modified_by(input.into()); diff --git a/crates/superposition_sdk/src/operation/list_versions.rs b/crates/superposition_sdk/src/operation/list_versions.rs index 1f21968bf..0f310f358 100644 --- a/crates/superposition_sdk/src/operation/list_versions.rs +++ b/crates/superposition_sdk/src/operation/list_versions.rs @@ -23,7 +23,7 @@ impl ListVersions { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_versions::ListVersionsInput, @@ -45,20 +45,18 @@ impl ListVersions { "rpc.service" = "Superposition", "rpc.method" = "ListVersions", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListVer cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListVersionsRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListVersionsResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListVersions") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListVersions", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListVer fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListVersions") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListVersionsEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListVersionsEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListVer } } - + #[derive(Debug)] struct ListVersionsResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListVersionsResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_versions::de_list_versions_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListVer let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_versions::ListVersionsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_versions::ListVersionsInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/config/versions").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -151,25 +154,26 @@ fn uri_query(_input: &crate::operation::list_versions::ListVersionsInput, mut ou #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_versions::ListVersionsInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_versions::ser_list_versions_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListVersionsEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListVersionsEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListVersionsEndpointParamsInterceptor" @@ -184,10 +188,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListVersionsInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -198,7 +202,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListVersionsError` operation. #[non_exhaustive] @@ -220,15 +224,15 @@ impl ListVersionsError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListVersionsError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -297,10 +301,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListVers } } -pub use crate::operation::list_versions::_list_versions_output::ListVersionsOutput; - pub use crate::operation::list_versions::_list_versions_input::ListVersionsInput; +pub use crate::operation::list_versions::_list_versions_output::ListVersionsOutput; + mod _list_versions_input; mod _list_versions_output; diff --git a/crates/superposition_sdk/src/operation/list_versions/builders.rs b/crates/superposition_sdk/src/operation/list_versions/builders.rs index 612d5aa3f..1ad710e8e 100644 --- a/crates/superposition_sdk/src/operation/list_versions/builders.rs +++ b/crates/superposition_sdk/src/operation/list_versions/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_versions::_list_versions_output::ListVersionsOutputBuilder; - pub use crate::operation::list_versions::_list_versions_input::ListVersionsInputBuilder; +pub use crate::operation::list_versions::_list_versions_output::ListVersionsOutputBuilder; + impl crate::operation::list_versions::builders::ListVersionsInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_versions::builders::ListVersionsInputBuilder { } } /// Fluent builder constructing a request to `ListVersions`. -/// +/// /// Retrieves a paginated list of config versions with their metadata, hash values, and creation timestamps for audit and rollback purposes. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListVersionsFluentBuilder { @@ -74,7 +74,7 @@ impl ListVersionsFluentBuilder { ); crate::operation::list_versions::ListVersions::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListVersionsFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/list_webhook.rs b/crates/superposition_sdk/src/operation/list_webhook.rs index bda5b5e59..0e7666394 100644 --- a/crates/superposition_sdk/src/operation/list_webhook.rs +++ b/crates/superposition_sdk/src/operation/list_webhook.rs @@ -23,7 +23,7 @@ impl ListWebhook { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_webhook::ListWebhookInput, @@ -45,20 +45,18 @@ impl ListWebhook { "rpc.service" = "Superposition", "rpc.method" = "ListWebhook", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListWeb cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListWebhookRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListWebhookResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListWebhook") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListWebhook", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListWeb fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListWebhook") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListWebhookEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListWebhookEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListWeb } } - + #[derive(Debug)] struct ListWebhookResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListWebhookResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_webhook::de_list_webhook_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListWeb let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_webhook::ListWebhookInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_webhook::ListWebhookInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/webhook").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -156,25 +159,26 @@ fn uri_query(_input: &crate::operation::list_webhook::ListWebhookInput, mut outp #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_webhook::ListWebhookInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_webhook::ser_list_webhook_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListWebhookEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListWebhookEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListWebhookEndpointParamsInterceptor" @@ -189,10 +193,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListWebhookInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -203,7 +207,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListWebhookError` operation. #[non_exhaustive] @@ -225,15 +229,15 @@ impl ListWebhookError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListWebhookError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -302,10 +306,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListWebh } } -pub use crate::operation::list_webhook::_list_webhook_output::ListWebhookOutput; - pub use crate::operation::list_webhook::_list_webhook_input::ListWebhookInput; +pub use crate::operation::list_webhook::_list_webhook_output::ListWebhookOutput; + mod _list_webhook_input; mod _list_webhook_output; diff --git a/crates/superposition_sdk/src/operation/list_webhook/builders.rs b/crates/superposition_sdk/src/operation/list_webhook/builders.rs index 1a9a838a5..25c6eef2d 100644 --- a/crates/superposition_sdk/src/operation/list_webhook/builders.rs +++ b/crates/superposition_sdk/src/operation/list_webhook/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_webhook::_list_webhook_output::ListWebhookOutputBuilder; - pub use crate::operation::list_webhook::_list_webhook_input::ListWebhookInputBuilder; +pub use crate::operation::list_webhook::_list_webhook_output::ListWebhookOutputBuilder; + impl crate::operation::list_webhook::builders::ListWebhookInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_webhook::builders::ListWebhookInputBuilder { } } /// Fluent builder constructing a request to `ListWebhook`. -/// +/// /// Retrieves a paginated list of all webhook configs in the workspace, including their status and config details. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListWebhookFluentBuilder { @@ -74,7 +74,7 @@ impl ListWebhookFluentBuilder { ); crate::operation::list_webhook::ListWebhook::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListWebhookFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/list_workspace.rs b/crates/superposition_sdk/src/operation/list_workspace.rs index 03de06fc2..bec7b2ae3 100644 --- a/crates/superposition_sdk/src/operation/list_workspace.rs +++ b/crates/superposition_sdk/src/operation/list_workspace.rs @@ -23,7 +23,7 @@ impl ListWorkspace { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::list_workspace::ListWorkspaceInput, @@ -45,20 +45,18 @@ impl ListWorkspace { "rpc.service" = "Superposition", "rpc.method" = "ListWorkspace", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListWor cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ListWorkspaceRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ListWorkspaceResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ListWorkspace") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ListWorkspace", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListWor fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ListWorkspace") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ListWorkspaceEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ListWorkspaceEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListWor } } - + #[derive(Debug)] struct ListWorkspaceResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ListWorkspaceResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_list_workspace::de_list_workspace_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ListWor let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::list_workspace::ListWorkspaceInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::list_workspace::ListWorkspaceInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/workspaces").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -156,25 +159,26 @@ fn uri_query(_input: &crate::operation::list_workspace::ListWorkspaceInput, mut #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::list_workspace::ListWorkspaceInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; uri_query(input, &mut uri)?; let builder = crate::protocol_serde::shape_list_workspace::ser_list_workspace_headers(input, builder)?; ::std::result::Result::Ok(builder.method("GET").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct ListWorkspaceEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ListWorkspaceEndpointParamsInterceptor { fn name(&self) -> &'static str { "ListWorkspaceEndpointParamsInterceptor" @@ -189,10 +193,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ListWorkspaceInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -203,7 +207,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ListWorkspaceError` operation. #[non_exhaustive] @@ -225,15 +229,15 @@ impl ListWorkspaceError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ListWorkspaceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -302,10 +306,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ListWork } } -pub use crate::operation::list_workspace::_list_workspace_output::ListWorkspaceOutput; - pub use crate::operation::list_workspace::_list_workspace_input::ListWorkspaceInput; +pub use crate::operation::list_workspace::_list_workspace_output::ListWorkspaceOutput; + mod _list_workspace_input; mod _list_workspace_output; diff --git a/crates/superposition_sdk/src/operation/list_workspace/builders.rs b/crates/superposition_sdk/src/operation/list_workspace/builders.rs index 770f993b8..bd41ac09d 100644 --- a/crates/superposition_sdk/src/operation/list_workspace/builders.rs +++ b/crates/superposition_sdk/src/operation/list_workspace/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::list_workspace::_list_workspace_output::ListWorkspaceOutputBuilder; - pub use crate::operation::list_workspace::_list_workspace_input::ListWorkspaceInputBuilder; +pub use crate::operation::list_workspace::_list_workspace_output::ListWorkspaceOutputBuilder; + impl crate::operation::list_workspace::builders::ListWorkspaceInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::list_workspace::builders::ListWorkspaceInputBuilder { } } /// Fluent builder constructing a request to `ListWorkspace`. -/// +/// /// Retrieves a paginated list of all workspaces with optional filtering by workspace name, including their status, config details, and administrative information. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ListWorkspaceFluentBuilder { @@ -74,7 +74,7 @@ impl ListWorkspaceFluentBuilder { ); crate::operation::list_workspace::ListWorkspace::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ListWorkspaceFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/migrate_workspace_schema.rs b/crates/superposition_sdk/src/operation/migrate_workspace_schema.rs index a020fd190..dbff1b9d4 100644 --- a/crates/superposition_sdk/src/operation/migrate_workspace_schema.rs +++ b/crates/superposition_sdk/src/operation/migrate_workspace_schema.rs @@ -23,7 +23,7 @@ impl MigrateWorkspaceSchema { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::migrate_workspace_schema::MigrateWorkspaceSchemaInput, @@ -45,20 +45,18 @@ impl MigrateWorkspaceSchema { "rpc.service" = "Superposition", "rpc.method" = "MigrateWorkspaceSchema", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Migrate cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(MigrateWorkspaceSchemaRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(MigrateWorkspaceSchemaResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("MigrateWorkspaceSchema") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "MigrateWorkspaceSchema", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Migrate fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("MigrateWorkspaceSchema") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(MigrateWorkspaceSchemaEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(MigrateWorkspaceSchemaEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Migrate } } - + #[derive(Debug)] struct MigrateWorkspaceSchemaResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MigrateWorkspaceSchemaResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_migrate_workspace_schema::de_migrate_workspace_schema_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Migrate let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::migrate_workspace_schema::MigrateWorkspaceSchemaInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::migrate_workspace_schema::MigrateWorkspaceSchemaInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.workspace_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("workspace_name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Migrate #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::migrate_workspace_schema::MigrateWorkspaceSchemaInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_migrate_workspace_schema::ser_migrate_workspace_schema_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct MigrateWorkspaceSchemaEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MigrateWorkspaceSchemaEndpointParamsInterceptor { fn name(&self) -> &'static str { "MigrateWorkspaceSchemaEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to MigrateWorkspaceSchemaInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `MigrateWorkspaceSchemaError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl MigrateWorkspaceSchemaError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `MigrateWorkspaceSchemaError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -304,10 +308,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for MigrateW } } -pub use crate::operation::migrate_workspace_schema::_migrate_workspace_schema_output::MigrateWorkspaceSchemaOutput; - pub use crate::operation::migrate_workspace_schema::_migrate_workspace_schema_input::MigrateWorkspaceSchemaInput; +pub use crate::operation::migrate_workspace_schema::_migrate_workspace_schema_output::MigrateWorkspaceSchemaOutput; + mod _migrate_workspace_schema_input; mod _migrate_workspace_schema_output; diff --git a/crates/superposition_sdk/src/operation/migrate_workspace_schema/_migrate_workspace_schema_output.rs b/crates/superposition_sdk/src/operation/migrate_workspace_schema/_migrate_workspace_schema_output.rs index 1c2c3965c..b52ee7629 100644 --- a/crates/superposition_sdk/src/operation/migrate_workspace_schema/_migrate_workspace_schema_output.rs +++ b/crates/superposition_sdk/src/operation/migrate_workspace_schema/_migrate_workspace_schema_output.rs @@ -86,7 +86,7 @@ impl MigrateWorkspaceSchemaOutput { &self.created_at } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.mandatory_dimensions.is_none()`. pub fn mandatory_dimensions(&self) -> &[::std::string::String] { self.mandatory_dimensions.as_deref() diff --git a/crates/superposition_sdk/src/operation/migrate_workspace_schema/builders.rs b/crates/superposition_sdk/src/operation/migrate_workspace_schema/builders.rs index c86369a59..8ecff0f19 100644 --- a/crates/superposition_sdk/src/operation/migrate_workspace_schema/builders.rs +++ b/crates/superposition_sdk/src/operation/migrate_workspace_schema/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::migrate_workspace_schema::_migrate_workspace_schema_output::MigrateWorkspaceSchemaOutputBuilder; - pub use crate::operation::migrate_workspace_schema::_migrate_workspace_schema_input::MigrateWorkspaceSchemaInputBuilder; +pub use crate::operation::migrate_workspace_schema::_migrate_workspace_schema_output::MigrateWorkspaceSchemaOutputBuilder; + impl crate::operation::migrate_workspace_schema::builders::MigrateWorkspaceSchemaInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::migrate_workspace_schema::builders::MigrateWorkspaceSchem } } /// Fluent builder constructing a request to `MigrateWorkspaceSchema`. -/// +/// /// Migrates the workspace database schema to the new version of the template #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct MigrateWorkspaceSchemaFluentBuilder { @@ -74,7 +74,7 @@ impl MigrateWorkspaceSchemaFluentBuilder { ); crate::operation::migrate_workspace_schema::MigrateWorkspaceSchema::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl MigrateWorkspaceSchemaFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/move_context.rs b/crates/superposition_sdk/src/operation/move_context.rs index ef13d0a6b..da9c32a0d 100644 --- a/crates/superposition_sdk/src/operation/move_context.rs +++ b/crates/superposition_sdk/src/operation/move_context.rs @@ -23,7 +23,7 @@ impl MoveContext { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::move_context::MoveContextInput, @@ -45,20 +45,18 @@ impl MoveContext { "rpc.service" = "Superposition", "rpc.method" = "MoveContext", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for MoveCon cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(MoveContextRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(MoveContextResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("MoveContext") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "MoveContext", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for MoveCon fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("MoveContext") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(MoveContextEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(MoveContextEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for MoveCon } } - + #[derive(Debug)] struct MoveContextResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for MoveContextResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_move_context::de_move_context_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for MoveCon let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::move_context::MoveContextInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::move_context::MoveContextInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for MoveCon #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::move_context::MoveContextInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_move_context::ser_move_context_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PUT").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_move_context_input::ser_request_http_payload(& input.request)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct MoveContextEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for MoveContextEndpointParamsInterceptor { fn name(&self) -> &'static str { "MoveContextEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to MoveContextInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `MoveContextError` operation. #[non_exhaustive] @@ -219,15 +223,15 @@ impl MoveContextError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `MoveContextError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -324,10 +328,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for MoveCont } } -pub use crate::operation::move_context::_move_context_output::MoveContextOutput; - pub use crate::operation::move_context::_move_context_input::MoveContextInput; +pub use crate::operation::move_context::_move_context_output::MoveContextOutput; + mod _move_context_input; mod _move_context_output; diff --git a/crates/superposition_sdk/src/operation/move_context/builders.rs b/crates/superposition_sdk/src/operation/move_context/builders.rs index 0cf85bb00..790782d6f 100644 --- a/crates/superposition_sdk/src/operation/move_context/builders.rs +++ b/crates/superposition_sdk/src/operation/move_context/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::move_context::_move_context_output::MoveContextOutputBuilder; - pub use crate::operation::move_context::_move_context_input::MoveContextInputBuilder; +pub use crate::operation::move_context::_move_context_output::MoveContextOutputBuilder; + impl crate::operation::move_context::builders::MoveContextInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::move_context::builders::MoveContextInputBuilder { } } /// Fluent builder constructing a request to `MoveContext`. -/// +/// /// Updates the condition of the mentioned context, if a context with the new condition already exists, it merges the override and effectively deleting the old context #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct MoveContextFluentBuilder { @@ -74,7 +74,7 @@ impl MoveContextFluentBuilder { ); crate::operation::move_context::MoveContext::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl MoveContextFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/pause_experiment.rs b/crates/superposition_sdk/src/operation/pause_experiment.rs index b3bdef20a..c10536f8b 100644 --- a/crates/superposition_sdk/src/operation/pause_experiment.rs +++ b/crates/superposition_sdk/src/operation/pause_experiment.rs @@ -23,7 +23,7 @@ impl PauseExperiment { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::pause_experiment::PauseExperimentInput, @@ -45,20 +45,18 @@ impl PauseExperiment { "rpc.service" = "Superposition", "rpc.method" = "PauseExperiment", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for PauseEx cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(PauseExperimentRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(PauseExperimentResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("PauseExperiment") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "PauseExperiment", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for PauseEx fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("PauseExperiment") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(PauseExperimentEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(PauseExperimentEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for PauseEx } } - + #[derive(Debug)] struct PauseExperimentResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PauseExperimentResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_pause_experiment::de_pause_experiment_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for PauseEx let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::pause_experiment::PauseExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::pause_experiment::PauseExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for PauseEx #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::pause_experiment::PauseExperimentInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_pause_experiment::ser_pause_experiment_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_pause_experiment::ser_pause_experiment_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct PauseExperimentEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PauseExperimentEndpointParamsInterceptor { fn name(&self) -> &'static str { "PauseExperimentEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to PauseExperimentInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `PauseExperimentError` operation. #[non_exhaustive] @@ -219,15 +223,15 @@ impl PauseExperimentError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `PauseExperimentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -324,10 +328,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for PauseExp } } -pub use crate::operation::pause_experiment::_pause_experiment_output::PauseExperimentOutput; - pub use crate::operation::pause_experiment::_pause_experiment_input::PauseExperimentInput; +pub use crate::operation::pause_experiment::_pause_experiment_output::PauseExperimentOutput; + mod _pause_experiment_input; mod _pause_experiment_output; diff --git a/crates/superposition_sdk/src/operation/pause_experiment/builders.rs b/crates/superposition_sdk/src/operation/pause_experiment/builders.rs index 5c846feb6..2d1e535fe 100644 --- a/crates/superposition_sdk/src/operation/pause_experiment/builders.rs +++ b/crates/superposition_sdk/src/operation/pause_experiment/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::pause_experiment::_pause_experiment_output::PauseExperimentOutputBuilder; - pub use crate::operation::pause_experiment::_pause_experiment_input::PauseExperimentInputBuilder; +pub use crate::operation::pause_experiment::_pause_experiment_output::PauseExperimentOutputBuilder; + impl crate::operation::pause_experiment::builders::PauseExperimentInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::pause_experiment::builders::PauseExperimentInputBuilder { } } /// Fluent builder constructing a request to `PauseExperiment`. -/// +/// /// Temporarily pauses an inprogress experiment, suspending its effects while preserving the experiment config for later resumption. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct PauseExperimentFluentBuilder { @@ -74,7 +74,7 @@ impl PauseExperimentFluentBuilder { ); crate::operation::pause_experiment::PauseExperiment::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl PauseExperimentFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/publish.rs b/crates/superposition_sdk/src/operation/publish.rs index f921576ef..aaab2395e 100644 --- a/crates/superposition_sdk/src/operation/publish.rs +++ b/crates/superposition_sdk/src/operation/publish.rs @@ -23,7 +23,7 @@ impl Publish { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::publish::PublishInput, @@ -45,20 +45,18 @@ impl Publish { "rpc.service" = "Superposition", "rpc.method" = "Publish", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Publish cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(PublishRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(PublishResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("Publish") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "Publish", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Publish fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("Publish") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(PublishEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(PublishEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Publish } } - + #[derive(Debug)] struct PublishResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for PublishResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_publish::de_publish_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Publish let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::publish::PublishInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::publish::PublishInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.function_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Publish #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::publish::PublishInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_publish::ser_publish_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_publish::ser_publish_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct PublishEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for PublishEndpointParamsInterceptor { fn name(&self) -> &'static str { "PublishEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to PublishInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `PublishError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl PublishError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `PublishError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -308,10 +312,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for PublishE } } -pub use crate::operation::publish::_publish_output::PublishOutput; - pub use crate::operation::publish::_publish_input::PublishInput; +pub use crate::operation::publish::_publish_output::PublishOutput; + mod _publish_input; mod _publish_output; diff --git a/crates/superposition_sdk/src/operation/publish/builders.rs b/crates/superposition_sdk/src/operation/publish/builders.rs index cdb0c7a4c..4d5d5aa09 100644 --- a/crates/superposition_sdk/src/operation/publish/builders.rs +++ b/crates/superposition_sdk/src/operation/publish/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::publish::_publish_output::PublishOutputBuilder; - pub use crate::operation::publish::_publish_input::PublishInputBuilder; +pub use crate::operation::publish::_publish_output::PublishOutputBuilder; + impl crate::operation::publish::builders::PublishInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::publish::builders::PublishInputBuilder { } } /// Fluent builder constructing a request to `Publish`. -/// +/// /// Publishes the draft version of a function, making it the active version used for value_validation, value_compute, context_validation or change_reason_validation in the system. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct PublishFluentBuilder { @@ -74,7 +74,7 @@ impl PublishFluentBuilder { ); crate::operation::publish::Publish::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl PublishFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/ramp_experiment.rs b/crates/superposition_sdk/src/operation/ramp_experiment.rs index ba73610df..810a8a40d 100644 --- a/crates/superposition_sdk/src/operation/ramp_experiment.rs +++ b/crates/superposition_sdk/src/operation/ramp_experiment.rs @@ -23,7 +23,7 @@ impl RampExperiment { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::ramp_experiment::RampExperimentInput, @@ -45,20 +45,18 @@ impl RampExperiment { "rpc.service" = "Superposition", "rpc.method" = "RampExperiment", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RampExp cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(RampExperimentRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(RampExperimentResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("RampExperiment") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "RampExperiment", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RampExp fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("RampExperiment") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(RampExperimentEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(RampExperimentEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RampExp } } - + #[derive(Debug)] struct RampExperimentResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RampExperimentResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_ramp_experiment::de_ramp_experiment_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RampExp let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::ramp_experiment::RampExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::ramp_experiment::RampExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RampExp #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::ramp_experiment::RampExperimentInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_ramp_experiment::ser_ramp_experiment_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_ramp_experiment::ser_ramp_experiment_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct RampExperimentEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RampExperimentEndpointParamsInterceptor { fn name(&self) -> &'static str { "RampExperimentEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to RampExperimentInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `RampExperimentError` operation. #[non_exhaustive] @@ -219,15 +223,15 @@ impl RampExperimentError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `RampExperimentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -324,10 +328,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RampExpe } } -pub use crate::operation::ramp_experiment::_ramp_experiment_output::RampExperimentOutput; - pub use crate::operation::ramp_experiment::_ramp_experiment_input::RampExperimentInput; +pub use crate::operation::ramp_experiment::_ramp_experiment_output::RampExperimentOutput; + mod _ramp_experiment_input; mod _ramp_experiment_output; diff --git a/crates/superposition_sdk/src/operation/ramp_experiment/builders.rs b/crates/superposition_sdk/src/operation/ramp_experiment/builders.rs index 4bce84b5a..4621f7647 100644 --- a/crates/superposition_sdk/src/operation/ramp_experiment/builders.rs +++ b/crates/superposition_sdk/src/operation/ramp_experiment/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::ramp_experiment::_ramp_experiment_output::RampExperimentOutputBuilder; - pub use crate::operation::ramp_experiment::_ramp_experiment_input::RampExperimentInputBuilder; +pub use crate::operation::ramp_experiment::_ramp_experiment_output::RampExperimentOutputBuilder; + impl crate::operation::ramp_experiment::builders::RampExperimentInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::ramp_experiment::builders::RampExperimentInputBuilder { } } /// Fluent builder constructing a request to `RampExperiment`. -/// +/// /// Adjusts the traffic percentage allocation for an in-progress experiment, allowing gradual rollout or rollback of experimental features. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct RampExperimentFluentBuilder { @@ -74,7 +74,7 @@ impl RampExperimentFluentBuilder { ); crate::operation::ramp_experiment::RampExperiment::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl RampExperimentFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/remove_members_from_group.rs b/crates/superposition_sdk/src/operation/remove_members_from_group.rs index fcf040840..7b1862ad3 100644 --- a/crates/superposition_sdk/src/operation/remove_members_from_group.rs +++ b/crates/superposition_sdk/src/operation/remove_members_from_group.rs @@ -23,7 +23,7 @@ impl RemoveMembersFromGroup { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::remove_members_from_group::RemoveMembersFromGroupInput, @@ -45,20 +45,18 @@ impl RemoveMembersFromGroup { "rpc.service" = "Superposition", "rpc.method" = "RemoveMembersFromGroup", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RemoveM cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(RemoveMembersFromGroupRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(RemoveMembersFromGroupResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("RemoveMembersFromGroup") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "RemoveMembersFromGroup", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RemoveM fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("RemoveMembersFromGroup") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(RemoveMembersFromGroupEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(RemoveMembersFromGroupEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RemoveM } } - + #[derive(Debug)] struct RemoveMembersFromGroupResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RemoveMembersFromGroupResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_remove_members_from_group::de_remove_members_from_group_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RemoveM let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::remove_members_from_group::RemoveMembersFromGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::remove_members_from_group::RemoveMembersFromGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RemoveM #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::remove_members_from_group::RemoveMembersFromGroupInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_remove_members_from_group::ser_remove_members_from_group_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_remove_members_from_group::ser_remove_members_from_group_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct RemoveMembersFromGroupEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RemoveMembersFromGroupEndpointParamsInterceptor { fn name(&self) -> &'static str { "RemoveMembersFromGroupEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to RemoveMembersFromGroupInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `RemoveMembersFromGroupError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl RemoveMembersFromGroupError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `RemoveMembersFromGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -308,10 +312,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RemoveMe } } -pub use crate::operation::remove_members_from_group::_remove_members_from_group_output::RemoveMembersFromGroupOutput; - pub use crate::operation::remove_members_from_group::_remove_members_from_group_input::RemoveMembersFromGroupInput; +pub use crate::operation::remove_members_from_group::_remove_members_from_group_output::RemoveMembersFromGroupOutput; + mod _remove_members_from_group_input; mod _remove_members_from_group_output; diff --git a/crates/superposition_sdk/src/operation/remove_members_from_group/_remove_members_from_group_input.rs b/crates/superposition_sdk/src/operation/remove_members_from_group/_remove_members_from_group_input.rs index 98b71a5a5..88c7bef20 100644 --- a/crates/superposition_sdk/src/operation/remove_members_from_group/_remove_members_from_group_input.rs +++ b/crates/superposition_sdk/src/operation/remove_members_from_group/_remove_members_from_group_input.rs @@ -33,7 +33,7 @@ impl RemoveMembersFromGroupInput { self.change_reason.as_deref() } /// List of experiment IDs to add/remove to this group. - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.member_experiment_ids.is_none()`. pub fn member_experiment_ids(&self) -> &[::std::string::String] { self.member_experiment_ids.as_deref() diff --git a/crates/superposition_sdk/src/operation/remove_members_from_group/builders.rs b/crates/superposition_sdk/src/operation/remove_members_from_group/builders.rs index f275643a0..e33ff55de 100644 --- a/crates/superposition_sdk/src/operation/remove_members_from_group/builders.rs +++ b/crates/superposition_sdk/src/operation/remove_members_from_group/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::remove_members_from_group::_remove_members_from_group_output::RemoveMembersFromGroupOutputBuilder; - pub use crate::operation::remove_members_from_group::_remove_members_from_group_input::RemoveMembersFromGroupInputBuilder; +pub use crate::operation::remove_members_from_group::_remove_members_from_group_output::RemoveMembersFromGroupOutputBuilder; + impl crate::operation::remove_members_from_group::builders::RemoveMembersFromGroupInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::remove_members_from_group::builders::RemoveMembersFromGro } } /// Fluent builder constructing a request to `RemoveMembersFromGroup`. -/// +/// /// Removes members from an existing experiment group. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct RemoveMembersFromGroupFluentBuilder { @@ -74,7 +74,7 @@ impl RemoveMembersFromGroupFluentBuilder { ); crate::operation::remove_members_from_group::RemoveMembersFromGroup::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl RemoveMembersFromGroupFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -152,11 +152,11 @@ impl RemoveMembersFromGroupFluentBuilder { pub fn get_change_reason(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_change_reason() } - /// + /// /// Appends an item to `member_experiment_ids`. - /// + /// /// To override the contents of this collection use [`set_member_experiment_ids`](Self::set_member_experiment_ids). - /// + /// /// List of experiment IDs to add/remove to this group. pub fn member_experiment_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.member_experiment_ids(input.into()); diff --git a/crates/superposition_sdk/src/operation/resume_experiment.rs b/crates/superposition_sdk/src/operation/resume_experiment.rs index 7030946bc..387b8b2c7 100644 --- a/crates/superposition_sdk/src/operation/resume_experiment.rs +++ b/crates/superposition_sdk/src/operation/resume_experiment.rs @@ -23,7 +23,7 @@ impl ResumeExperiment { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::resume_experiment::ResumeExperimentInput, @@ -45,20 +45,18 @@ impl ResumeExperiment { "rpc.service" = "Superposition", "rpc.method" = "ResumeExperiment", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ResumeE cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ResumeExperimentRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ResumeExperimentResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ResumeExperiment") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ResumeExperiment", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ResumeE fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ResumeExperiment") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ResumeExperimentEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ResumeExperimentEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ResumeE } } - + #[derive(Debug)] struct ResumeExperimentResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ResumeExperimentResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_resume_experiment::de_resume_experiment_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ResumeE let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::resume_experiment::ResumeExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::resume_experiment::ResumeExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for ResumeE #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::resume_experiment::ResumeExperimentInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_resume_experiment::ser_resume_experiment_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_resume_experiment::ser_resume_experiment_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct ResumeExperimentEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ResumeExperimentEndpointParamsInterceptor { fn name(&self) -> &'static str { "ResumeExperimentEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ResumeExperimentInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ResumeExperimentError` operation. #[non_exhaustive] @@ -219,15 +223,15 @@ impl ResumeExperimentError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ResumeExperimentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -324,10 +328,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for ResumeEx } } -pub use crate::operation::resume_experiment::_resume_experiment_output::ResumeExperimentOutput; - pub use crate::operation::resume_experiment::_resume_experiment_input::ResumeExperimentInput; +pub use crate::operation::resume_experiment::_resume_experiment_output::ResumeExperimentOutput; + mod _resume_experiment_input; mod _resume_experiment_output; diff --git a/crates/superposition_sdk/src/operation/resume_experiment/builders.rs b/crates/superposition_sdk/src/operation/resume_experiment/builders.rs index f7701c164..b90053b4b 100644 --- a/crates/superposition_sdk/src/operation/resume_experiment/builders.rs +++ b/crates/superposition_sdk/src/operation/resume_experiment/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::resume_experiment::_resume_experiment_output::ResumeExperimentOutputBuilder; - pub use crate::operation::resume_experiment::_resume_experiment_input::ResumeExperimentInputBuilder; +pub use crate::operation::resume_experiment::_resume_experiment_output::ResumeExperimentOutputBuilder; + impl crate::operation::resume_experiment::builders::ResumeExperimentInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::resume_experiment::builders::ResumeExperimentInputBuilder } } /// Fluent builder constructing a request to `ResumeExperiment`. -/// +/// /// Resumes a previously paused experiment, restoring its in-progress state and re-enabling variant evaluation. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ResumeExperimentFluentBuilder { @@ -74,7 +74,7 @@ impl ResumeExperimentFluentBuilder { ); crate::operation::resume_experiment::ResumeExperiment::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ResumeExperimentFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/rotate_master_encryption_key.rs b/crates/superposition_sdk/src/operation/rotate_master_encryption_key.rs index 0ec33abc8..683a4a0dd 100644 --- a/crates/superposition_sdk/src/operation/rotate_master_encryption_key.rs +++ b/crates/superposition_sdk/src/operation/rotate_master_encryption_key.rs @@ -23,7 +23,7 @@ impl RotateMasterEncryptionKey { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::rotate_master_encryption_key::RotateMasterEncryptionKeyInput, @@ -45,20 +45,18 @@ impl RotateMasterEncryptionKey { "rpc.service" = "Superposition", "rpc.method" = "RotateMasterEncryptionKey", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RotateM cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(RotateMasterEncryptionKeyRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(RotateMasterEncryptionKeyResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("RotateMasterEncryptionKey") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "RotateMasterEncryptionKey", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RotateM fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("RotateMasterEncryptionKey") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(RotateMasterEncryptionKeyEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(RotateMasterEncryptionKeyEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RotateM } } - + #[derive(Debug)] struct RotateMasterEncryptionKeyResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RotateMasterEncryptionKeyResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_rotate_master_encryption_key::de_rotate_master_encryption_key_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RotateM let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::rotate_master_encryption_key::RotateMasterEncryptionKeyInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::rotate_master_encryption_key::RotateMasterEncryptionKeyInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/master-encryption-key/rotate").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,23 +140,24 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RotateM #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::rotate_master_encryption_key::RotateMasterEncryptionKeyInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct RotateMasterEncryptionKeyEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RotateMasterEncryptionKeyEndpointParamsInterceptor { fn name(&self) -> &'static str { "RotateMasterEncryptionKeyEndpointParamsInterceptor" @@ -168,10 +172,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to RotateMasterEncryptionKeyInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -182,7 +186,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `RotateMasterEncryptionKeyError` operation. #[non_exhaustive] @@ -204,15 +208,15 @@ impl RotateMasterEncryptionKeyError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `RotateMasterEncryptionKeyError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -281,10 +285,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RotateMa } } -pub use crate::operation::rotate_master_encryption_key::_rotate_master_encryption_key_output::RotateMasterEncryptionKeyOutput; - pub use crate::operation::rotate_master_encryption_key::_rotate_master_encryption_key_input::RotateMasterEncryptionKeyInput; +pub use crate::operation::rotate_master_encryption_key::_rotate_master_encryption_key_output::RotateMasterEncryptionKeyOutput; + mod _rotate_master_encryption_key_input; mod _rotate_master_encryption_key_output; diff --git a/crates/superposition_sdk/src/operation/rotate_master_encryption_key/builders.rs b/crates/superposition_sdk/src/operation/rotate_master_encryption_key/builders.rs index 8f55fce80..40c129402 100644 --- a/crates/superposition_sdk/src/operation/rotate_master_encryption_key/builders.rs +++ b/crates/superposition_sdk/src/operation/rotate_master_encryption_key/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::rotate_master_encryption_key::_rotate_master_encryption_key_output::RotateMasterEncryptionKeyOutputBuilder; - pub use crate::operation::rotate_master_encryption_key::_rotate_master_encryption_key_input::RotateMasterEncryptionKeyInputBuilder; +pub use crate::operation::rotate_master_encryption_key::_rotate_master_encryption_key_output::RotateMasterEncryptionKeyOutputBuilder; + impl crate::operation::rotate_master_encryption_key::builders::RotateMasterEncryptionKeyInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::rotate_master_encryption_key::builders::RotateMasterEncry } } /// Fluent builder constructing a request to `RotateMasterEncryptionKey`. -/// +/// /// Rotates the master encryption key across all workspaces #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct RotateMasterEncryptionKeyFluentBuilder { @@ -74,7 +74,7 @@ impl RotateMasterEncryptionKeyFluentBuilder { ); crate::operation::rotate_master_encryption_key::RotateMasterEncryptionKey::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl RotateMasterEncryptionKeyFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/rotate_workspace_encryption_key.rs b/crates/superposition_sdk/src/operation/rotate_workspace_encryption_key.rs index 43e31590b..f0c1729fd 100644 --- a/crates/superposition_sdk/src/operation/rotate_workspace_encryption_key.rs +++ b/crates/superposition_sdk/src/operation/rotate_workspace_encryption_key.rs @@ -23,7 +23,7 @@ impl RotateWorkspaceEncryptionKey { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::rotate_workspace_encryption_key::RotateWorkspaceEncryptionKeyInput, @@ -45,20 +45,18 @@ impl RotateWorkspaceEncryptionKey { "rpc.service" = "Superposition", "rpc.method" = "RotateWorkspaceEncryptionKey", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RotateW cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(RotateWorkspaceEncryptionKeyRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(RotateWorkspaceEncryptionKeyResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("RotateWorkspaceEncryptionKey") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "RotateWorkspaceEncryptionKey", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RotateW fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("RotateWorkspaceEncryptionKey") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(RotateWorkspaceEncryptionKeyEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(RotateWorkspaceEncryptionKeyEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RotateW } } - + #[derive(Debug)] struct RotateWorkspaceEncryptionKeyResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for RotateWorkspaceEncryptionKeyResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_rotate_workspace_encryption_key::de_rotate_workspace_encryption_key_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RotateW let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::rotate_workspace_encryption_key::RotateWorkspaceEncryptionKeyInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::rotate_workspace_encryption_key::RotateWorkspaceEncryptionKeyInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.workspace_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("workspace_name", "cannot be empty or unset"))?; @@ -143,24 +146,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for RotateW #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::rotate_workspace_encryption_key::RotateWorkspaceEncryptionKeyInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_rotate_workspace_encryption_key::ser_rotate_workspace_encryption_key_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct RotateWorkspaceEncryptionKeyEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for RotateWorkspaceEncryptionKeyEndpointParamsInterceptor { fn name(&self) -> &'static str { "RotateWorkspaceEncryptionKeyEndpointParamsInterceptor" @@ -175,10 +179,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to RotateWorkspaceEncryptionKeyInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -189,7 +193,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `RotateWorkspaceEncryptionKeyError` operation. #[non_exhaustive] @@ -211,15 +215,15 @@ impl RotateWorkspaceEncryptionKeyError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `RotateWorkspaceEncryptionKeyError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -288,10 +292,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for RotateWo } } -pub use crate::operation::rotate_workspace_encryption_key::_rotate_workspace_encryption_key_output::RotateWorkspaceEncryptionKeyOutput; - pub use crate::operation::rotate_workspace_encryption_key::_rotate_workspace_encryption_key_input::RotateWorkspaceEncryptionKeyInput; +pub use crate::operation::rotate_workspace_encryption_key::_rotate_workspace_encryption_key_output::RotateWorkspaceEncryptionKeyOutput; + mod _rotate_workspace_encryption_key_input; mod _rotate_workspace_encryption_key_output; diff --git a/crates/superposition_sdk/src/operation/rotate_workspace_encryption_key/builders.rs b/crates/superposition_sdk/src/operation/rotate_workspace_encryption_key/builders.rs index a197a2d33..87fbd73d5 100644 --- a/crates/superposition_sdk/src/operation/rotate_workspace_encryption_key/builders.rs +++ b/crates/superposition_sdk/src/operation/rotate_workspace_encryption_key/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::rotate_workspace_encryption_key::_rotate_workspace_encryption_key_output::RotateWorkspaceEncryptionKeyOutputBuilder; - pub use crate::operation::rotate_workspace_encryption_key::_rotate_workspace_encryption_key_input::RotateWorkspaceEncryptionKeyInputBuilder; +pub use crate::operation::rotate_workspace_encryption_key::_rotate_workspace_encryption_key_output::RotateWorkspaceEncryptionKeyOutputBuilder; + impl crate::operation::rotate_workspace_encryption_key::builders::RotateWorkspaceEncryptionKeyInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::rotate_workspace_encryption_key::builders::RotateWorkspac } } /// Fluent builder constructing a request to `RotateWorkspaceEncryptionKey`. -/// +/// /// Rotates the workspace encryption key. Generates a new encryption key and re-encrypts all secrets with the new key. This is a critical operation that should be done during low-traffic periods. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct RotateWorkspaceEncryptionKeyFluentBuilder { @@ -74,7 +74,7 @@ impl RotateWorkspaceEncryptionKeyFluentBuilder { ); crate::operation::rotate_workspace_encryption_key::RotateWorkspaceEncryptionKey::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl RotateWorkspaceEncryptionKeyFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/test.rs b/crates/superposition_sdk/src/operation/test.rs index f827cf0c3..ea50cc3c9 100644 --- a/crates/superposition_sdk/src/operation/test.rs +++ b/crates/superposition_sdk/src/operation/test.rs @@ -23,7 +23,7 @@ impl Test { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::test::TestInput, @@ -45,20 +45,18 @@ impl Test { "rpc.service" = "Superposition", "rpc.method" = "Test", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Test { cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(TestRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(TestResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("Test") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "Test", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Test { fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("Test") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(TestEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(TestEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Test { } } - + #[derive(Debug)] struct TestResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for TestResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_test::de_test_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Test { let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::test::TestInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::test::TestInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.function_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?; @@ -139,7 +142,7 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Test { } let input_2 = &_input.stage; let input_2 = input_2.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("stage", "cannot be empty or unset"))?; - let stage = ::aws_smithy_http::label::fmt_string(input_2, ::aws_smithy_http::label::EncodingStrategy::Default); + let stage = ::aws_smithy_http::label::fmt_string(input_2.as_str(), ::aws_smithy_http::label::EncodingStrategy::Default); if stage.is_empty() { return ::std::result::Result::Err(::aws_smithy_types::error::operation::BuildError::missing_field("stage", "cannot be empty or unset")) } @@ -149,21 +152,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Test { #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::test::TestInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_test::ser_test_headers(input, builder)?; ::std::result::Result::Ok(builder.method("POST").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_test_input::ser_request_http_payload(& input.request)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -171,6 +174,7 @@ builder #[derive(Debug)] struct TestEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for TestEndpointParamsInterceptor { fn name(&self) -> &'static str { "TestEndpointParamsInterceptor" @@ -185,10 +189,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to TestInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -199,7 +203,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `TestError` operation. #[non_exhaustive] @@ -223,15 +227,15 @@ impl TestError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `TestError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -314,10 +318,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for TestErro } } -pub use crate::operation::test::_test_output::TestOutput; - pub use crate::operation::test::_test_input::TestInput; +pub use crate::operation::test::_test_output::TestOutput; + mod _test_input; mod _test_output; diff --git a/crates/superposition_sdk/src/operation/test/builders.rs b/crates/superposition_sdk/src/operation/test/builders.rs index 7af5789c3..160f49a2a 100644 --- a/crates/superposition_sdk/src/operation/test/builders.rs +++ b/crates/superposition_sdk/src/operation/test/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::test::_test_output::TestOutputBuilder; - pub use crate::operation::test::_test_input::TestInputBuilder; +pub use crate::operation::test::_test_output::TestOutputBuilder; + impl crate::operation::test::builders::TestInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::test::builders::TestInputBuilder { } } /// Fluent builder constructing a request to `Test`. -/// +/// /// Executes a function in test mode with provided input parameters to validate its behavior before publishing or deployment. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct TestFluentBuilder { @@ -74,7 +74,7 @@ impl TestFluentBuilder { ); crate::operation::test::Test::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl TestFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/update_default_config.rs b/crates/superposition_sdk/src/operation/update_default_config.rs index 4d8be87f5..198e271c7 100644 --- a/crates/superposition_sdk/src/operation/update_default_config.rs +++ b/crates/superposition_sdk/src/operation/update_default_config.rs @@ -23,7 +23,7 @@ impl UpdateDefaultConfig { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_default_config::UpdateDefaultConfigInput, @@ -45,20 +45,18 @@ impl UpdateDefaultConfig { "rpc.service" = "Superposition", "rpc.method" = "UpdateDefaultConfig", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateD cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateDefaultConfigRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateDefaultConfigResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateDefaultConfig") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateDefaultConfig", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateD fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateDefaultConfig") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateDefaultConfigEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateDefaultConfigEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateD } } - + #[derive(Debug)] struct UpdateDefaultConfigResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateDefaultConfigResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_default_config::de_update_default_config_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateD let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_default_config::UpdateDefaultConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_default_config::UpdateDefaultConfigInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.key; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("key", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateD #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_default_config::UpdateDefaultConfigInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_default_config::ser_update_default_config_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_default_config::ser_update_default_config_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct UpdateDefaultConfigEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateDefaultConfigEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateDefaultConfigEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateDefaultConfigInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateDefaultConfigError` operation. #[non_exhaustive] @@ -221,15 +225,15 @@ impl UpdateDefaultConfigError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateDefaultConfigError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -340,10 +344,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateDe } } -pub use crate::operation::update_default_config::_update_default_config_output::UpdateDefaultConfigOutput; - pub use crate::operation::update_default_config::_update_default_config_input::UpdateDefaultConfigInput; +pub use crate::operation::update_default_config::_update_default_config_output::UpdateDefaultConfigOutput; + mod _update_default_config_input; mod _update_default_config_output; diff --git a/crates/superposition_sdk/src/operation/update_default_config/builders.rs b/crates/superposition_sdk/src/operation/update_default_config/builders.rs index 22464d3c6..41e473bf3 100644 --- a/crates/superposition_sdk/src/operation/update_default_config/builders.rs +++ b/crates/superposition_sdk/src/operation/update_default_config/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_default_config::_update_default_config_output::UpdateDefaultConfigOutputBuilder; - pub use crate::operation::update_default_config::_update_default_config_input::UpdateDefaultConfigInputBuilder; +pub use crate::operation::update_default_config::_update_default_config_output::UpdateDefaultConfigOutputBuilder; + impl crate::operation::update_default_config::builders::UpdateDefaultConfigInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_default_config::builders::UpdateDefaultConfigInput } } /// Fluent builder constructing a request to `UpdateDefaultConfig`. -/// +/// /// Updates an existing default config entry. Allows modification of value, schema, function mappings, and description while preserving the key identifier. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateDefaultConfigFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateDefaultConfigFluentBuilder { ); crate::operation::update_default_config::UpdateDefaultConfig::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateDefaultConfigFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -166,11 +166,11 @@ impl UpdateDefaultConfigFluentBuilder { pub fn get_value(&self) -> &::std::option::Option<::aws_smithy_types::Document> { self.inner.get_value() } - /// + /// /// Adds a key-value pair to `schema`. - /// + /// /// To override the contents of this collection use [`set_schema`](Self::set_schema). - /// + /// /// Generic key-value object structure used for flexible data representation throughout the API. pub fn schema(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.schema(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/update_dimension.rs b/crates/superposition_sdk/src/operation/update_dimension.rs index 4b44da033..9103b967b 100644 --- a/crates/superposition_sdk/src/operation/update_dimension.rs +++ b/crates/superposition_sdk/src/operation/update_dimension.rs @@ -23,7 +23,7 @@ impl UpdateDimension { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_dimension::UpdateDimensionInput, @@ -45,20 +45,18 @@ impl UpdateDimension { "rpc.service" = "Superposition", "rpc.method" = "UpdateDimension", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateD cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateDimensionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateDimensionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateDimension") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateDimension", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateD fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateDimension") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateDimensionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateDimensionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateD } } - + #[derive(Debug)] struct UpdateDimensionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateDimensionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_dimension::de_update_dimension_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateD let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_dimension::UpdateDimensionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_dimension::UpdateDimensionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.dimension; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("dimension", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateD #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_dimension::UpdateDimensionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_dimension::ser_update_dimension_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_dimension::ser_update_dimension_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct UpdateDimensionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateDimensionEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateDimensionEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateDimensionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateDimensionError` operation. #[non_exhaustive] @@ -219,15 +223,15 @@ impl UpdateDimensionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateDimensionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -324,10 +328,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateDi } } -pub use crate::operation::update_dimension::_update_dimension_output::UpdateDimensionOutput; - pub use crate::operation::update_dimension::_update_dimension_input::UpdateDimensionInput; +pub use crate::operation::update_dimension::_update_dimension_output::UpdateDimensionOutput; + mod _update_dimension_input; mod _update_dimension_output; diff --git a/crates/superposition_sdk/src/operation/update_dimension/builders.rs b/crates/superposition_sdk/src/operation/update_dimension/builders.rs index 7fe7daa86..e51d8ab75 100644 --- a/crates/superposition_sdk/src/operation/update_dimension/builders.rs +++ b/crates/superposition_sdk/src/operation/update_dimension/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_dimension::_update_dimension_output::UpdateDimensionOutputBuilder; - pub use crate::operation::update_dimension::_update_dimension_input::UpdateDimensionInputBuilder; +pub use crate::operation::update_dimension::_update_dimension_output::UpdateDimensionOutputBuilder; + impl crate::operation::update_dimension::builders::UpdateDimensionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_dimension::builders::UpdateDimensionInputBuilder { } } /// Fluent builder constructing a request to `UpdateDimension`. -/// +/// /// Updates an existing dimension's configuration. Allows modification of schema, position, function mappings, and other properties while maintaining dependency relationships. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateDimensionFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateDimensionFluentBuilder { ); crate::operation::update_dimension::UpdateDimension::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateDimensionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -138,11 +138,11 @@ impl UpdateDimensionFluentBuilder { pub fn get_dimension(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_dimension() } - /// + /// /// Adds a key-value pair to `schema`. - /// + /// /// To override the contents of this collection use [`set_schema`](Self::set_schema). - /// + /// /// Generic key-value object structure used for flexible data representation throughout the API. pub fn schema(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.schema(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/update_experiment_group.rs b/crates/superposition_sdk/src/operation/update_experiment_group.rs index ca70d744a..a246d7a55 100644 --- a/crates/superposition_sdk/src/operation/update_experiment_group.rs +++ b/crates/superposition_sdk/src/operation/update_experiment_group.rs @@ -23,7 +23,7 @@ impl UpdateExperimentGroup { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_experiment_group::UpdateExperimentGroupInput, @@ -45,20 +45,18 @@ impl UpdateExperimentGroup { "rpc.service" = "Superposition", "rpc.method" = "UpdateExperimentGroup", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateE cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateExperimentGroupRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateExperimentGroupResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateExperimentGroup") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateExperimentGroup", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateE fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateExperimentGroup") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateExperimentGroupEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateExperimentGroupEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateE } } - + #[derive(Debug)] struct UpdateExperimentGroupResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateExperimentGroupResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_experiment_group::de_update_experiment_group_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateE let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_experiment_group::UpdateExperimentGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_experiment_group::UpdateExperimentGroupInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateE #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_experiment_group::UpdateExperimentGroupInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_experiment_group::ser_update_experiment_group_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_experiment_group::ser_update_experiment_group_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct UpdateExperimentGroupEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateExperimentGroupEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateExperimentGroupEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateExperimentGroupInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateExperimentGroupError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl UpdateExperimentGroupError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateExperimentGroupError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -308,10 +312,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateEx } } -pub use crate::operation::update_experiment_group::_update_experiment_group_output::UpdateExperimentGroupOutput; - pub use crate::operation::update_experiment_group::_update_experiment_group_input::UpdateExperimentGroupInput; +pub use crate::operation::update_experiment_group::_update_experiment_group_output::UpdateExperimentGroupOutput; + mod _update_experiment_group_input; mod _update_experiment_group_output; diff --git a/crates/superposition_sdk/src/operation/update_experiment_group/builders.rs b/crates/superposition_sdk/src/operation/update_experiment_group/builders.rs index d8e8dd8af..6b559d3a1 100644 --- a/crates/superposition_sdk/src/operation/update_experiment_group/builders.rs +++ b/crates/superposition_sdk/src/operation/update_experiment_group/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_experiment_group::_update_experiment_group_output::UpdateExperimentGroupOutputBuilder; - pub use crate::operation::update_experiment_group::_update_experiment_group_input::UpdateExperimentGroupInputBuilder; +pub use crate::operation::update_experiment_group::_update_experiment_group_output::UpdateExperimentGroupOutputBuilder; + impl crate::operation::update_experiment_group::builders::UpdateExperimentGroupInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_experiment_group::builders::UpdateExperimentGroupI } } /// Fluent builder constructing a request to `UpdateExperimentGroup`. -/// +/// /// Updates an existing experiment group. Allows partial updates to specified fields. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateExperimentGroupFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateExperimentGroupFluentBuilder { ); crate::operation::update_experiment_group::UpdateExperimentGroup::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateExperimentGroupFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/update_function.rs b/crates/superposition_sdk/src/operation/update_function.rs index 78737a4f1..f2e10d95b 100644 --- a/crates/superposition_sdk/src/operation/update_function.rs +++ b/crates/superposition_sdk/src/operation/update_function.rs @@ -23,7 +23,7 @@ impl UpdateFunction { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_function::UpdateFunctionInput, @@ -45,20 +45,18 @@ impl UpdateFunction { "rpc.service" = "Superposition", "rpc.method" = "UpdateFunction", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateF cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateFunctionRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateFunctionResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateFunction") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateFunction", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateF fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateFunction") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateFunctionEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateFunctionEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateF } } - + #[derive(Debug)] struct UpdateFunctionResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateFunctionResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_function::de_update_function_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateF let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_function::UpdateFunctionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_function::UpdateFunctionInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.function_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("function_name", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateF #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_function::UpdateFunctionInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_function::ser_update_function_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_function::ser_update_function_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct UpdateFunctionEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateFunctionEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateFunctionEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateFunctionInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateFunctionError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl UpdateFunctionError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateFunctionError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -308,10 +312,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateFu } } -pub use crate::operation::update_function::_update_function_output::UpdateFunctionOutput; - pub use crate::operation::update_function::_update_function_input::UpdateFunctionInput; +pub use crate::operation::update_function::_update_function_output::UpdateFunctionOutput; + mod _update_function_input; mod _update_function_output; diff --git a/crates/superposition_sdk/src/operation/update_function/builders.rs b/crates/superposition_sdk/src/operation/update_function/builders.rs index eb1738be9..01a9d229d 100644 --- a/crates/superposition_sdk/src/operation/update_function/builders.rs +++ b/crates/superposition_sdk/src/operation/update_function/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_function::_update_function_output::UpdateFunctionOutputBuilder; - pub use crate::operation::update_function::_update_function_input::UpdateFunctionInputBuilder; +pub use crate::operation::update_function::_update_function_output::UpdateFunctionOutputBuilder; + impl crate::operation::update_function::builders::UpdateFunctionInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_function::builders::UpdateFunctionInputBuilder { } } /// Fluent builder constructing a request to `UpdateFunction`. -/// +/// /// Updates the draft version of an existing function with new code, runtime version, or description while preserving the published version. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateFunctionFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateFunctionFluentBuilder { ); crate::operation::update_function::UpdateFunction::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateFunctionFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/update_organisation.rs b/crates/superposition_sdk/src/operation/update_organisation.rs index b5bd51b6d..94c183ffc 100644 --- a/crates/superposition_sdk/src/operation/update_organisation.rs +++ b/crates/superposition_sdk/src/operation/update_organisation.rs @@ -23,7 +23,7 @@ impl UpdateOrganisation { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_organisation::UpdateOrganisationInput, @@ -45,20 +45,18 @@ impl UpdateOrganisation { "rpc.service" = "Superposition", "rpc.method" = "UpdateOrganisation", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateOrganisationRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateOrganisationResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateOrganisation") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateOrganisation", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateOrganisation") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateOrganisationEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateOrganisationEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO } } - + #[derive(Debug)] struct UpdateOrganisationResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateOrganisationResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_organisation::de_update_organisation_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_organisation::UpdateOrganisationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_organisation::UpdateOrganisationInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,20 +146,20 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_organisation::UpdateOrganisationInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_organisation::ser_update_organisation_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -164,6 +167,7 @@ builder #[derive(Debug)] struct UpdateOrganisationEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateOrganisationEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateOrganisationEndpointParamsInterceptor" @@ -178,10 +182,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateOrganisationInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -192,7 +196,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateOrganisationError` operation. #[non_exhaustive] @@ -216,15 +220,15 @@ impl UpdateOrganisationError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateOrganisationError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -307,10 +311,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateOr } } -pub use crate::operation::update_organisation::_update_organisation_output::UpdateOrganisationOutput; - pub use crate::operation::update_organisation::_update_organisation_input::UpdateOrganisationInput; +pub use crate::operation::update_organisation::_update_organisation_output::UpdateOrganisationOutput; + mod _update_organisation_input; mod _update_organisation_output; diff --git a/crates/superposition_sdk/src/operation/update_organisation/builders.rs b/crates/superposition_sdk/src/operation/update_organisation/builders.rs index 53d2de3b5..00b383260 100644 --- a/crates/superposition_sdk/src/operation/update_organisation/builders.rs +++ b/crates/superposition_sdk/src/operation/update_organisation/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_organisation::_update_organisation_output::UpdateOrganisationOutputBuilder; - pub use crate::operation::update_organisation::_update_organisation_input::UpdateOrganisationInputBuilder; +pub use crate::operation::update_organisation::_update_organisation_output::UpdateOrganisationOutputBuilder; + impl crate::operation::update_organisation::builders::UpdateOrganisationInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_organisation::builders::UpdateOrganisationInputBui } } /// Fluent builder constructing a request to `UpdateOrganisation`. -/// +/// /// Updates an existing organisation's information including contact details, status, and administrative properties. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateOrganisationFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateOrganisationFluentBuilder { ); crate::operation::update_organisation::UpdateOrganisation::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateOrganisationFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/update_override.rs b/crates/superposition_sdk/src/operation/update_override.rs index 38bda03bc..7e981b83c 100644 --- a/crates/superposition_sdk/src/operation/update_override.rs +++ b/crates/superposition_sdk/src/operation/update_override.rs @@ -23,7 +23,7 @@ impl UpdateOverride { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_override::UpdateOverrideInput, @@ -45,20 +45,18 @@ impl UpdateOverride { "rpc.service" = "Superposition", "rpc.method" = "UpdateOverride", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateOverrideRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateOverrideResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateOverride") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateOverride", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateOverride") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateOverrideEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateOverrideEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO } } - + #[derive(Debug)] struct UpdateOverrideResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateOverrideResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_override::de_update_override_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_override::UpdateOverrideInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_override::UpdateOverrideInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/context/overrides").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_override::UpdateOverrideInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_override::ser_update_override_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_override_input::ser_request_http_payload(& input.request)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct UpdateOverrideEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateOverrideEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateOverrideEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateOverrideInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateOverrideError` operation. #[non_exhaustive] @@ -213,15 +217,15 @@ impl UpdateOverrideError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateOverrideError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -318,10 +322,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateOv } } -pub use crate::operation::update_override::_update_override_output::UpdateOverrideOutput; - pub use crate::operation::update_override::_update_override_input::UpdateOverrideInput; +pub use crate::operation::update_override::_update_override_output::UpdateOverrideOutput; + mod _update_override_input; mod _update_override_output; diff --git a/crates/superposition_sdk/src/operation/update_override/builders.rs b/crates/superposition_sdk/src/operation/update_override/builders.rs index 3aedcc0b5..7140aaa61 100644 --- a/crates/superposition_sdk/src/operation/update_override/builders.rs +++ b/crates/superposition_sdk/src/operation/update_override/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_override::_update_override_output::UpdateOverrideOutputBuilder; - pub use crate::operation::update_override::_update_override_input::UpdateOverrideInputBuilder; +pub use crate::operation::update_override::_update_override_output::UpdateOverrideOutputBuilder; + impl crate::operation::update_override::builders::UpdateOverrideInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_override::builders::UpdateOverrideInputBuilder { } } /// Fluent builder constructing a request to `UpdateOverride`. -/// +/// /// Updates the overrides for an existing context. Allows modification of override values while maintaining the context's conditions. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateOverrideFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateOverrideFluentBuilder { ); crate::operation::update_override::UpdateOverride::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateOverrideFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/update_overrides_experiment.rs b/crates/superposition_sdk/src/operation/update_overrides_experiment.rs index 3ddbcdd30..95652bb38 100644 --- a/crates/superposition_sdk/src/operation/update_overrides_experiment.rs +++ b/crates/superposition_sdk/src/operation/update_overrides_experiment.rs @@ -23,7 +23,7 @@ impl UpdateOverridesExperiment { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_overrides_experiment::UpdateOverridesExperimentInput, @@ -45,20 +45,18 @@ impl UpdateOverridesExperiment { "rpc.service" = "Superposition", "rpc.method" = "UpdateOverridesExperiment", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateOverridesExperimentRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateOverridesExperimentResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateOverridesExperiment") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateOverridesExperiment", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateOverridesExperiment") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateOverridesExperimentEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateOverridesExperimentEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO } } - + #[derive(Debug)] struct UpdateOverridesExperimentResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateOverridesExperimentResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_overrides_experiment::de_update_overrides_experiment_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_overrides_experiment::UpdateOverridesExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_overrides_experiment::UpdateOverridesExperimentInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.id; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("id", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateO #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_overrides_experiment::UpdateOverridesExperimentInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_overrides_experiment::ser_update_overrides_experiment_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_overrides_experiment::ser_update_overrides_experiment_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct UpdateOverridesExperimentEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateOverridesExperimentEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateOverridesExperimentEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateOverridesExperimentInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateOverridesExperimentError` operation. #[non_exhaustive] @@ -219,15 +223,15 @@ impl UpdateOverridesExperimentError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateOverridesExperimentError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -324,10 +328,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateOv } } -pub use crate::operation::update_overrides_experiment::_update_overrides_experiment_output::UpdateOverridesExperimentOutput; - pub use crate::operation::update_overrides_experiment::_update_overrides_experiment_input::UpdateOverridesExperimentInput; +pub use crate::operation::update_overrides_experiment::_update_overrides_experiment_output::UpdateOverridesExperimentOutput; + mod _update_overrides_experiment_input; mod _update_overrides_experiment_output; diff --git a/crates/superposition_sdk/src/operation/update_overrides_experiment/_update_overrides_experiment_input.rs b/crates/superposition_sdk/src/operation/update_overrides_experiment/_update_overrides_experiment_input.rs index c6a57615e..517d4a826 100644 --- a/crates/superposition_sdk/src/operation/update_overrides_experiment/_update_overrides_experiment_input.rs +++ b/crates/superposition_sdk/src/operation/update_overrides_experiment/_update_overrides_experiment_input.rs @@ -36,7 +36,7 @@ impl UpdateOverridesExperimentInput { self.id.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.variant_list.is_none()`. pub fn variant_list(&self) -> &[crate::types::VariantUpdateRequest] { self.variant_list.as_deref() diff --git a/crates/superposition_sdk/src/operation/update_overrides_experiment/builders.rs b/crates/superposition_sdk/src/operation/update_overrides_experiment/builders.rs index c4fb0333f..c6bbb8ee1 100644 --- a/crates/superposition_sdk/src/operation/update_overrides_experiment/builders.rs +++ b/crates/superposition_sdk/src/operation/update_overrides_experiment/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_overrides_experiment::_update_overrides_experiment_output::UpdateOverridesExperimentOutputBuilder; - pub use crate::operation::update_overrides_experiment::_update_overrides_experiment_input::UpdateOverridesExperimentInputBuilder; +pub use crate::operation::update_overrides_experiment::_update_overrides_experiment_output::UpdateOverridesExperimentOutputBuilder; + impl crate::operation::update_overrides_experiment::builders::UpdateOverridesExperimentInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_overrides_experiment::builders::UpdateOverridesExp } } /// Fluent builder constructing a request to `UpdateOverridesExperiment`. -/// +/// /// Updates the overrides for specific variants within an experiment, allowing modification of experiment behavior Updates the overrides for specific variants within an experiment, allowing modification of experiment behavior while it is in the created state. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateOverridesExperimentFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateOverridesExperimentFluentBuilder { ); crate::operation::update_overrides_experiment::UpdateOverridesExperiment::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateOverridesExperimentFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -138,11 +138,11 @@ impl UpdateOverridesExperimentFluentBuilder { pub fn get_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_id() } - /// + /// /// Appends an item to `variant_list`. - /// + /// /// To override the contents of this collection use [`set_variant_list`](Self::set_variant_list). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn variant_list(mut self, input: crate::types::VariantUpdateRequest) -> Self { self.inner = self.inner.variant_list(input); diff --git a/crates/superposition_sdk/src/operation/update_secret.rs b/crates/superposition_sdk/src/operation/update_secret.rs index 690110fc4..34d153914 100644 --- a/crates/superposition_sdk/src/operation/update_secret.rs +++ b/crates/superposition_sdk/src/operation/update_secret.rs @@ -23,7 +23,7 @@ impl UpdateSecret { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_secret::UpdateSecretInput, @@ -45,20 +45,18 @@ impl UpdateSecret { "rpc.service" = "Superposition", "rpc.method" = "UpdateSecret", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateS cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateSecretRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateSecretResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateSecret") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateSecret", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateS fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateSecret") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateSecretEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateSecretEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateS } } - + #[derive(Debug)] struct UpdateSecretResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateSecretResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_secret::de_update_secret_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateS let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_secret::UpdateSecretInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_secret::UpdateSecretInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("name", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateS #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_secret::UpdateSecretInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_secret::ser_update_secret_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_secret::ser_update_secret_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct UpdateSecretEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateSecretEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateSecretEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateSecretInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateSecretError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl UpdateSecretError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateSecretError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -308,10 +312,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateSe } } -pub use crate::operation::update_secret::_update_secret_output::UpdateSecretOutput; - pub use crate::operation::update_secret::_update_secret_input::UpdateSecretInput; +pub use crate::operation::update_secret::_update_secret_output::UpdateSecretOutput; + mod _update_secret_input; mod _update_secret_output; diff --git a/crates/superposition_sdk/src/operation/update_secret/builders.rs b/crates/superposition_sdk/src/operation/update_secret/builders.rs index ab2aa61a1..d7fb7d4f9 100644 --- a/crates/superposition_sdk/src/operation/update_secret/builders.rs +++ b/crates/superposition_sdk/src/operation/update_secret/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_secret::_update_secret_output::UpdateSecretOutputBuilder; - pub use crate::operation::update_secret::_update_secret_input::UpdateSecretInputBuilder; +pub use crate::operation::update_secret::_update_secret_output::UpdateSecretOutputBuilder; + impl crate::operation::update_secret::builders::UpdateSecretInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_secret::builders::UpdateSecretInputBuilder { } } /// Fluent builder constructing a request to `UpdateSecret`. -/// +/// /// Updates an existing secret's value or description. The value is re-encrypted with the current workspace encryption key. Returns masked value. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateSecretFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateSecretFluentBuilder { ); crate::operation::update_secret::UpdateSecret::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateSecretFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/update_type_templates.rs b/crates/superposition_sdk/src/operation/update_type_templates.rs index 7b47f70da..61fea2d88 100644 --- a/crates/superposition_sdk/src/operation/update_type_templates.rs +++ b/crates/superposition_sdk/src/operation/update_type_templates.rs @@ -23,7 +23,7 @@ impl UpdateTypeTemplates { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_type_templates::UpdateTypeTemplatesInput, @@ -45,20 +45,18 @@ impl UpdateTypeTemplates { "rpc.service" = "Superposition", "rpc.method" = "UpdateTypeTemplates", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateT cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateTypeTemplatesRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateTypeTemplatesResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateTypeTemplates") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateTypeTemplates", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateT fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateTypeTemplates") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateTypeTemplatesEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateTypeTemplatesEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateT } } - + #[derive(Debug)] struct UpdateTypeTemplatesResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateTypeTemplatesResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_type_templates::de_update_type_templates_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateT let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_type_templates::UpdateTypeTemplatesInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_type_templates::UpdateTypeTemplatesInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.type_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("type_name", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateT #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_type_templates::UpdateTypeTemplatesInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_type_templates::ser_update_type_templates_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_type_templates::ser_update_type_templates_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct UpdateTypeTemplatesEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateTypeTemplatesEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateTypeTemplatesEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateTypeTemplatesInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateTypeTemplatesError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl UpdateTypeTemplatesError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateTypeTemplatesError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -308,10 +312,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateTy } } -pub use crate::operation::update_type_templates::_update_type_templates_output::UpdateTypeTemplatesOutput; - pub use crate::operation::update_type_templates::_update_type_templates_input::UpdateTypeTemplatesInput; +pub use crate::operation::update_type_templates::_update_type_templates_output::UpdateTypeTemplatesOutput; + mod _update_type_templates_input; mod _update_type_templates_output; diff --git a/crates/superposition_sdk/src/operation/update_type_templates/builders.rs b/crates/superposition_sdk/src/operation/update_type_templates/builders.rs index 738079702..80c85efab 100644 --- a/crates/superposition_sdk/src/operation/update_type_templates/builders.rs +++ b/crates/superposition_sdk/src/operation/update_type_templates/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_type_templates::_update_type_templates_output::UpdateTypeTemplatesOutputBuilder; - pub use crate::operation::update_type_templates::_update_type_templates_input::UpdateTypeTemplatesInputBuilder; +pub use crate::operation::update_type_templates::_update_type_templates_output::UpdateTypeTemplatesOutputBuilder; + impl crate::operation::update_type_templates::builders::UpdateTypeTemplatesInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_type_templates::builders::UpdateTypeTemplatesInput } } /// Fluent builder constructing a request to `UpdateTypeTemplates`. -/// +/// /// Updates an existing type template's schema definition and metadata while preserving its identifier and usage history. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateTypeTemplatesFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateTypeTemplatesFluentBuilder { ); crate::operation::update_type_templates::UpdateTypeTemplates::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateTypeTemplatesFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -138,11 +138,11 @@ impl UpdateTypeTemplatesFluentBuilder { pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_type_name() } - /// + /// /// Adds a key-value pair to `type_schema`. - /// + /// /// To override the contents of this collection use [`set_type_schema`](Self::set_type_schema). - /// + /// /// Generic key-value object structure used for flexible data representation throughout the API. pub fn type_schema(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.type_schema(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/update_variable.rs b/crates/superposition_sdk/src/operation/update_variable.rs index 192ae3d59..3054cffd8 100644 --- a/crates/superposition_sdk/src/operation/update_variable.rs +++ b/crates/superposition_sdk/src/operation/update_variable.rs @@ -23,7 +23,7 @@ impl UpdateVariable { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_variable::UpdateVariableInput, @@ -45,20 +45,18 @@ impl UpdateVariable { "rpc.service" = "Superposition", "rpc.method" = "UpdateVariable", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateV cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateVariableRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateVariableResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateVariable") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateVariable", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateV fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateVariable") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateVariableEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateVariableEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateV } } - + #[derive(Debug)] struct UpdateVariableResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateVariableResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_variable::de_update_variable_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateV let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_variable::UpdateVariableInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_variable::UpdateVariableInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("name", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateV #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_variable::UpdateVariableInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_variable::ser_update_variable_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_variable::ser_update_variable_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct UpdateVariableEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateVariableEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateVariableEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateVariableInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateVariableError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl UpdateVariableError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateVariableError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -308,10 +312,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateVa } } -pub use crate::operation::update_variable::_update_variable_output::UpdateVariableOutput; - pub use crate::operation::update_variable::_update_variable_input::UpdateVariableInput; +pub use crate::operation::update_variable::_update_variable_output::UpdateVariableOutput; + mod _update_variable_input; mod _update_variable_output; diff --git a/crates/superposition_sdk/src/operation/update_variable/builders.rs b/crates/superposition_sdk/src/operation/update_variable/builders.rs index ed4ed3b2f..1b6e3c9c0 100644 --- a/crates/superposition_sdk/src/operation/update_variable/builders.rs +++ b/crates/superposition_sdk/src/operation/update_variable/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_variable::_update_variable_output::UpdateVariableOutputBuilder; - pub use crate::operation::update_variable::_update_variable_input::UpdateVariableInputBuilder; +pub use crate::operation::update_variable::_update_variable_output::UpdateVariableOutputBuilder; + impl crate::operation::update_variable::builders::UpdateVariableInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_variable::builders::UpdateVariableInputBuilder { } } /// Fluent builder constructing a request to `UpdateVariable`. -/// +/// /// Updates an existing variable's value, description, or tags. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateVariableFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateVariableFluentBuilder { ); crate::operation::update_variable::UpdateVariable::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateVariableFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/operation/update_webhook.rs b/crates/superposition_sdk/src/operation/update_webhook.rs index 8475d1979..f32d7f540 100644 --- a/crates/superposition_sdk/src/operation/update_webhook.rs +++ b/crates/superposition_sdk/src/operation/update_webhook.rs @@ -23,7 +23,7 @@ impl UpdateWebhook { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_webhook::UpdateWebhookInput, @@ -45,20 +45,18 @@ impl UpdateWebhook { "rpc.service" = "Superposition", "rpc.method" = "UpdateWebhook", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateW cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateWebhookRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateWebhookResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateWebhook") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateWebhook", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateW fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateWebhook") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateWebhookEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateWebhookEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateW } } - + #[derive(Debug)] struct UpdateWebhookResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateWebhookResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_webhook::de_update_webhook_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateW let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_webhook::UpdateWebhookInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_webhook::UpdateWebhookInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("name", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateW #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_webhook::UpdateWebhookInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_webhook::ser_update_webhook_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_webhook::ser_update_webhook_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct UpdateWebhookEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateWebhookEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateWebhookEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateWebhookInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateWebhookError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl UpdateWebhookError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateWebhookError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -308,10 +312,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateWe } } -pub use crate::operation::update_webhook::_update_webhook_output::UpdateWebhookOutput; - pub use crate::operation::update_webhook::_update_webhook_input::UpdateWebhookInput; +pub use crate::operation::update_webhook::_update_webhook_output::UpdateWebhookOutput; + mod _update_webhook_input; mod _update_webhook_output; diff --git a/crates/superposition_sdk/src/operation/update_webhook/_update_webhook_input.rs b/crates/superposition_sdk/src/operation/update_webhook/_update_webhook_input.rs index 21244ef49..8cc888ee6 100644 --- a/crates/superposition_sdk/src/operation/update_webhook/_update_webhook_input.rs +++ b/crates/superposition_sdk/src/operation/update_webhook/_update_webhook_input.rs @@ -64,7 +64,7 @@ impl UpdateWebhookInput { self.custom_headers.as_ref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.events.is_none()`. pub fn events(&self) -> &[::std::string::String] { self.events.as_deref() diff --git a/crates/superposition_sdk/src/operation/update_webhook/builders.rs b/crates/superposition_sdk/src/operation/update_webhook/builders.rs index 2e0e31ec0..05f72be51 100644 --- a/crates/superposition_sdk/src/operation/update_webhook/builders.rs +++ b/crates/superposition_sdk/src/operation/update_webhook/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_webhook::_update_webhook_output::UpdateWebhookOutputBuilder; - pub use crate::operation::update_webhook::_update_webhook_input::UpdateWebhookInputBuilder; +pub use crate::operation::update_webhook::_update_webhook_output::UpdateWebhookOutputBuilder; + impl crate::operation::update_webhook::builders::UpdateWebhookInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_webhook::builders::UpdateWebhookInputBuilder { } } /// Fluent builder constructing a request to `UpdateWebhook`. -/// +/// /// Updates an existing webhook config, allowing modification of URL, events, headers, and other webhook properties. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateWebhookFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateWebhookFluentBuilder { ); crate::operation::update_webhook::UpdateWebhook::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateWebhookFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -208,11 +208,11 @@ impl UpdateWebhookFluentBuilder { pub fn get_version(&self) -> &::std::option::Option { self.inner.get_version() } - /// + /// /// Adds a key-value pair to `custom_headers`. - /// + /// /// To override the contents of this collection use [`set_custom_headers`](Self::set_custom_headers). - /// + /// /// Generic key-value object structure used for flexible data representation throughout the API. pub fn custom_headers(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.custom_headers(k.into(), v); @@ -227,11 +227,11 @@ impl UpdateWebhookFluentBuilder { pub fn get_custom_headers(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> { self.inner.get_custom_headers() } - /// + /// /// Appends an item to `events`. - /// + /// /// To override the contents of this collection use [`set_events`](Self::set_events). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn events(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.events(input.into()); diff --git a/crates/superposition_sdk/src/operation/update_workspace.rs b/crates/superposition_sdk/src/operation/update_workspace.rs index c82aeab9e..34411f090 100644 --- a/crates/superposition_sdk/src/operation/update_workspace.rs +++ b/crates/superposition_sdk/src/operation/update_workspace.rs @@ -23,7 +23,7 @@ impl UpdateWorkspace { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::update_workspace::UpdateWorkspaceInput, @@ -45,20 +45,18 @@ impl UpdateWorkspace { "rpc.service" = "Superposition", "rpc.method" = "UpdateWorkspace", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateW cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(UpdateWorkspaceRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(UpdateWorkspaceResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("UpdateWorkspace") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "UpdateWorkspace", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateW fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("UpdateWorkspace") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(UpdateWorkspaceEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(UpdateWorkspaceEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateW } } - + #[derive(Debug)] struct UpdateWorkspaceResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for UpdateWorkspaceResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_update_workspace::de_update_workspace_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateW let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::update_workspace::UpdateWorkspaceInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::update_workspace::UpdateWorkspaceInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; let input_1 = &_input.workspace_name; let input_1 = input_1.as_ref().ok_or_else(|| ::aws_smithy_types::error::operation::BuildError::missing_field("workspace_name", "cannot be empty or unset"))?; @@ -143,21 +146,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for UpdateW #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::update_workspace::UpdateWorkspaceInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_update_workspace::ser_update_workspace_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PATCH").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_update_workspace::ser_update_workspace_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -165,6 +168,7 @@ builder #[derive(Debug)] struct UpdateWorkspaceEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for UpdateWorkspaceEndpointParamsInterceptor { fn name(&self) -> &'static str { "UpdateWorkspaceEndpointParamsInterceptor" @@ -179,10 +183,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to UpdateWorkspaceInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -193,7 +197,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `UpdateWorkspaceError` operation. #[non_exhaustive] @@ -217,15 +221,15 @@ impl UpdateWorkspaceError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `UpdateWorkspaceError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::ResourceNotFound(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -308,10 +312,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for UpdateWo } } -pub use crate::operation::update_workspace::_update_workspace_output::UpdateWorkspaceOutput; - pub use crate::operation::update_workspace::_update_workspace_input::UpdateWorkspaceInput; +pub use crate::operation::update_workspace::_update_workspace_output::UpdateWorkspaceOutput; + mod _update_workspace_input; mod _update_workspace_output; diff --git a/crates/superposition_sdk/src/operation/update_workspace/_update_workspace_input.rs b/crates/superposition_sdk/src/operation/update_workspace/_update_workspace_input.rs index f9160bf0c..354b562fd 100644 --- a/crates/superposition_sdk/src/operation/update_workspace/_update_workspace_input.rs +++ b/crates/superposition_sdk/src/operation/update_workspace/_update_workspace_input.rs @@ -44,7 +44,7 @@ impl UpdateWorkspaceInput { self.config_version.as_deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.mandatory_dimensions.is_none()`. pub fn mandatory_dimensions(&self) -> &[::std::string::String] { self.mandatory_dimensions.as_deref() diff --git a/crates/superposition_sdk/src/operation/update_workspace/_update_workspace_output.rs b/crates/superposition_sdk/src/operation/update_workspace/_update_workspace_output.rs index dc80b53c0..b37635aca 100644 --- a/crates/superposition_sdk/src/operation/update_workspace/_update_workspace_output.rs +++ b/crates/superposition_sdk/src/operation/update_workspace/_update_workspace_output.rs @@ -86,7 +86,7 @@ impl UpdateWorkspaceOutput { &self.created_at } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.mandatory_dimensions.is_none()`. pub fn mandatory_dimensions(&self) -> &[::std::string::String] { self.mandatory_dimensions.as_deref() diff --git a/crates/superposition_sdk/src/operation/update_workspace/builders.rs b/crates/superposition_sdk/src/operation/update_workspace/builders.rs index 442ff1ceb..639742d60 100644 --- a/crates/superposition_sdk/src/operation/update_workspace/builders.rs +++ b/crates/superposition_sdk/src/operation/update_workspace/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::update_workspace::_update_workspace_output::UpdateWorkspaceOutputBuilder; - pub use crate::operation::update_workspace::_update_workspace_input::UpdateWorkspaceInputBuilder; +pub use crate::operation::update_workspace::_update_workspace_output::UpdateWorkspaceOutputBuilder; + impl crate::operation::update_workspace::builders::UpdateWorkspaceInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::update_workspace::builders::UpdateWorkspaceInputBuilder { } } /// Fluent builder constructing a request to `UpdateWorkspace`. -/// +/// /// Updates an existing workspace configuration, allowing modification of admin settings, mandatory dimensions, and workspace properties. Validates config version existence if provided. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct UpdateWorkspaceFluentBuilder { @@ -74,7 +74,7 @@ impl UpdateWorkspaceFluentBuilder { ); crate::operation::update_workspace::UpdateWorkspace::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl UpdateWorkspaceFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -152,11 +152,11 @@ impl UpdateWorkspaceFluentBuilder { pub fn get_config_version(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_config_version() } - /// + /// /// Appends an item to `mandatory_dimensions`. - /// + /// /// To override the contents of this collection use [`set_mandatory_dimensions`](Self::set_mandatory_dimensions). - /// + /// #[allow(missing_docs)] // documentation missing in model pub fn mandatory_dimensions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self { self.inner = self.inner.mandatory_dimensions(input.into()); diff --git a/crates/superposition_sdk/src/operation/validate_context.rs b/crates/superposition_sdk/src/operation/validate_context.rs index a70cfab37..155bbdd5b 100644 --- a/crates/superposition_sdk/src/operation/validate_context.rs +++ b/crates/superposition_sdk/src/operation/validate_context.rs @@ -23,7 +23,7 @@ impl ValidateContext { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::validate_context::ValidateContextInput, @@ -45,20 +45,18 @@ impl ValidateContext { "rpc.service" = "Superposition", "rpc.method" = "ValidateContext", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Validat cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(ValidateContextRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(ValidateContextResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("ValidateContext") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "ValidateContext", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Validat fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("ValidateContext") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(ValidateContextEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(ValidateContextEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Validat } } - + #[derive(Debug)] struct ValidateContextResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for ValidateContextResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_validate_context::de_validate_context_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Validat let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::validate_context::ValidateContextInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::validate_context::ValidateContextInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/context/validate").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,21 +140,21 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for Validat #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::validate_context::ValidateContextInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_validate_context::ser_validate_context_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PUT").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; -builder = _header_serialization_settings.set_default_header(builder, ::http::header::CONTENT_TYPE, "application/json"); +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; +builder = _header_serialization_settings.set_default_header(builder, ::http_1x::header::CONTENT_TYPE, "application/json"); builder }; let body = ::aws_smithy_types::body::SdkBody::from(crate::protocol_serde::shape_validate_context::ser_validate_context_input(&input)?); if let Some(content_length) = body.content_length() { let content_length = content_length.to_string(); - request_builder = _header_serialization_settings.set_default_header(request_builder, ::http::header::CONTENT_LENGTH, &content_length); + request_builder = _header_serialization_settings.set_default_header(request_builder, ::http_1x::header::CONTENT_LENGTH, &content_length); } ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } @@ -159,6 +162,7 @@ builder #[derive(Debug)] struct ValidateContextEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for ValidateContextEndpointParamsInterceptor { fn name(&self) -> &'static str { "ValidateContextEndpointParamsInterceptor" @@ -173,10 +177,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to ValidateContextInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -187,7 +191,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `ValidateContextError` operation. #[non_exhaustive] @@ -209,15 +213,15 @@ impl ValidateContextError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `ValidateContextError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -286,10 +290,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for Validate } } -pub use crate::operation::validate_context::_validate_context_output::ValidateContextOutput; - pub use crate::operation::validate_context::_validate_context_input::ValidateContextInput; +pub use crate::operation::validate_context::_validate_context_output::ValidateContextOutput; + mod _validate_context_input; mod _validate_context_output; diff --git a/crates/superposition_sdk/src/operation/validate_context/builders.rs b/crates/superposition_sdk/src/operation/validate_context/builders.rs index eb3751e53..bb21dbcff 100644 --- a/crates/superposition_sdk/src/operation/validate_context/builders.rs +++ b/crates/superposition_sdk/src/operation/validate_context/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::validate_context::_validate_context_output::ValidateContextOutputBuilder; - pub use crate::operation::validate_context::_validate_context_input::ValidateContextInputBuilder; +pub use crate::operation::validate_context::_validate_context_output::ValidateContextOutputBuilder; + impl crate::operation::validate_context::builders::ValidateContextInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::validate_context::builders::ValidateContextInputBuilder { } } /// Fluent builder constructing a request to `ValidateContext`. -/// +/// /// Validates if a given context condition is well-formed #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct ValidateContextFluentBuilder { @@ -74,7 +74,7 @@ impl ValidateContextFluentBuilder { ); crate::operation::validate_context::ValidateContext::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl ValidateContextFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, @@ -124,11 +124,11 @@ impl ValidateContextFluentBuilder { pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> { self.inner.get_org_id() } - /// + /// /// Adds a key-value pair to `context`. - /// + /// /// To override the contents of this collection use [`set_context`](Self::set_context). - /// + /// /// Represents conditional criteria used for context matching. Keys define dimension names and values specify the criteria that must be met. pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self { self.inner = self.inner.context(k.into(), v); diff --git a/crates/superposition_sdk/src/operation/weight_recompute.rs b/crates/superposition_sdk/src/operation/weight_recompute.rs index 913b2c9a3..35f7a503a 100644 --- a/crates/superposition_sdk/src/operation/weight_recompute.rs +++ b/crates/superposition_sdk/src/operation/weight_recompute.rs @@ -23,7 +23,7 @@ impl WeightRecompute { let output = context.finalize().map_err(map_err)?; ::std::result::Result::Ok(output.downcast::().expect("correct output type")) } - + pub(crate) async fn orchestrate_with_stop_point( runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, input: crate::operation::weight_recompute::WeightRecomputeInput, @@ -45,20 +45,18 @@ impl WeightRecompute { "rpc.service" = "Superposition", "rpc.method" = "WeightRecompute", "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000), - + )) .await } - + pub(crate) fn operation_runtime_plugins( client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins, client_config: &crate::config::Config, config_override: ::std::option::Option, ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins { let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new()); - runtime_plugins = runtime_plugins - .with_client_plugin(crate::auth_plugin::DefaultAuthOptionsPlugin::new(vec![::aws_smithy_runtime_api::client::auth::http::HTTP_BASIC_AUTH_SCHEME_ID - , ::aws_smithy_runtime_api::client::auth::http::HTTP_BEARER_AUTH_SCHEME_ID])); + if let ::std::option::Option::Some(config_override) = config_override { for plugin in config_override.runtime_plugins.iter().cloned() { runtime_plugins = runtime_plugins.with_operation_plugin(plugin); @@ -77,8 +75,12 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for WeightR cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(WeightRecomputeRequestSerializer)); cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(WeightRecomputeResponseDeserializer)); - - cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(::aws_smithy_runtime_api::client::auth::static_resolver::StaticAuthSchemeOptionResolverParams::new())); + cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new( + crate::config::auth::Params::builder() + .operation_name("WeightRecompute") + .build() + .expect("required fields set") + )); cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new( "WeightRecompute", @@ -91,8 +93,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for WeightR fn runtime_components(&self, _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> { #[allow(unused_mut)] let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("WeightRecompute") - .with_interceptor(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default()) -.with_interceptor(WeightRecomputeEndpointParamsInterceptor) + .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default())) +.with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(WeightRecomputeEndpointParamsInterceptor)) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::::new()) .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::::new()); @@ -100,19 +102,19 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for WeightR } } - + #[derive(Debug)] struct WeightRecomputeResponseDeserializer; impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for WeightRecomputeResponseDeserializer { - - fn deserialize_nonstreaming(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { + + fn deserialize_nonstreaming_with_config(&self, response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse, _cfg: &::aws_smithy_types::config_bag::ConfigBag) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError { let (success, status) = (response.status().is_success(), response.status().as_u16()); let headers = response.headers(); let body = response.body().bytes().expect("body loaded"); #[allow(unused_mut)] let mut force_error = false; - + let parse_result = if !success && status != 200 || force_error { crate::protocol_serde::shape_weight_recompute::de_weight_recompute_http_error(status, headers, body) } else { @@ -129,7 +131,8 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for WeightR let input = input.downcast::().expect("correct type"); let _header_serialization_settings = _cfg.load::().cloned().unwrap_or_default(); let mut request_builder = { - fn uri_base(_input: &crate::operation::weight_recompute::WeightRecomputeInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { + #[allow(clippy::uninlined_format_args)] +fn uri_base(_input: &crate::operation::weight_recompute::WeightRecomputeInput, output: &mut ::std::string::String) -> ::std::result::Result<(), ::aws_smithy_types::error::operation::BuildError> { use ::std::fmt::Write as _; ::std::write!(output, "/context/weight/recompute").expect("formatting should succeed"); ::std::result::Result::Ok(()) @@ -137,24 +140,25 @@ impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for WeightR #[allow(clippy::unnecessary_wraps)] fn update_http_builder( input: &crate::operation::weight_recompute::WeightRecomputeInput, - builder: ::http::request::Builder - ) -> ::std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + builder: ::http_1x::request::Builder + ) -> ::std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { let mut uri = ::std::string::String::new(); uri_base(input, &mut uri)?; let builder = crate::protocol_serde::shape_weight_recompute::ser_weight_recompute_headers(input, builder)?; ::std::result::Result::Ok(builder.method("PUT").uri(uri)) } -let mut builder = update_http_builder(&input, ::http::request::Builder::new())?; +let mut builder = update_http_builder(&input, ::http_1x::request::Builder::new())?; builder }; let body = ::aws_smithy_types::body::SdkBody::from(""); - + ::std::result::Result::Ok(request_builder.body(body).expect("valid request").try_into().unwrap()) } } #[derive(Debug)] struct WeightRecomputeEndpointParamsInterceptor; + #[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint] impl ::aws_smithy_runtime_api::client::interceptors::Intercept for WeightRecomputeEndpointParamsInterceptor { fn name(&self) -> &'static str { "WeightRecomputeEndpointParamsInterceptor" @@ -169,10 +173,10 @@ builder .downcast_ref::() .ok_or("failed to downcast to WeightRecomputeInput")?; - + let params = crate::config::endpoint::Params::builder() - + .build() .map_err(|err| ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err))?; cfg.interceptor_state().store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params)); @@ -183,7 +187,7 @@ builder // The get_* functions below are generated from JMESPath expressions in the // operationContextParams trait. They target the operation's input shape. - + /// Error type for the `WeightRecomputeError` operation. #[non_exhaustive] @@ -207,15 +211,15 @@ impl WeightRecomputeError { pub fn unhandled(err: impl ::std::convert::Into<::std::boxed::Box>) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.into(), meta: ::std::default::Default::default() }) } - + /// Creates the `WeightRecomputeError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata). pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self { Self::Unhandled(crate::error::sealed_unhandled::Unhandled { source: err.clone().into(), meta: err }) } - /// + /// /// Returns error metadata, which includes the error code, message, /// request ID, and potentially additional information. - /// + /// pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata { match self { Self::WebhookFailed(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e), @@ -298,10 +302,10 @@ impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for WeightRe } } -pub use crate::operation::weight_recompute::_weight_recompute_output::WeightRecomputeOutput; - pub use crate::operation::weight_recompute::_weight_recompute_input::WeightRecomputeInput; +pub use crate::operation::weight_recompute::_weight_recompute_output::WeightRecomputeOutput; + mod _weight_recompute_input; mod _weight_recompute_output; diff --git a/crates/superposition_sdk/src/operation/weight_recompute/_weight_recompute_output.rs b/crates/superposition_sdk/src/operation/weight_recompute/_weight_recompute_output.rs index 1f9948024..1cf63e198 100644 --- a/crates/superposition_sdk/src/operation/weight_recompute/_weight_recompute_output.rs +++ b/crates/superposition_sdk/src/operation/weight_recompute/_weight_recompute_output.rs @@ -8,7 +8,7 @@ pub struct WeightRecomputeOutput { } impl WeightRecomputeOutput { #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.data.is_none()`. pub fn data(&self) -> &[crate::types::WeightRecomputeResponse] { self.data.as_deref() diff --git a/crates/superposition_sdk/src/operation/weight_recompute/builders.rs b/crates/superposition_sdk/src/operation/weight_recompute/builders.rs index 77d619ca2..8c826c5ba 100644 --- a/crates/superposition_sdk/src/operation/weight_recompute/builders.rs +++ b/crates/superposition_sdk/src/operation/weight_recompute/builders.rs @@ -1,8 +1,8 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::operation::weight_recompute::_weight_recompute_output::WeightRecomputeOutputBuilder; - pub use crate::operation::weight_recompute::_weight_recompute_input::WeightRecomputeInputBuilder; +pub use crate::operation::weight_recompute::_weight_recompute_output::WeightRecomputeOutputBuilder; + impl crate::operation::weight_recompute::builders::WeightRecomputeInputBuilder { /// Sends a request with this input using the given client. pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result< @@ -18,7 +18,7 @@ impl crate::operation::weight_recompute::builders::WeightRecomputeInputBuilder { } } /// Fluent builder constructing a request to `WeightRecompute`. -/// +/// /// Recalculates and updates the priority weights for all contexts in the workspace based on their dimensions. #[derive(::std::clone::Clone, ::std::fmt::Debug)] pub struct WeightRecomputeFluentBuilder { @@ -74,7 +74,7 @@ impl WeightRecomputeFluentBuilder { ); crate::operation::weight_recompute::WeightRecompute::orchestrate(&runtime_plugins, input).await } - + /// Consumes this builder, creating a customizable operation that can be modified before being sent. pub fn customize( self, @@ -88,7 +88,7 @@ impl WeightRecomputeFluentBuilder { self.set_config_override(::std::option::Option::Some(config_override.into())); self } - + pub(crate) fn set_config_override( &mut self, config_override: ::std::option::Option, diff --git a/crates/superposition_sdk/src/primitives/sealed_enum_unknown.rs b/crates/superposition_sdk/src/primitives/sealed_enum_unknown.rs index 4ea3a8031..7c5d28d97 100644 --- a/crates/superposition_sdk/src/primitives/sealed_enum_unknown.rs +++ b/crates/superposition_sdk/src/primitives/sealed_enum_unknown.rs @@ -2,7 +2,7 @@ /// Opaque struct used as inner data for the `Unknown` variant defined in enums in /// the crate. -/// +/// /// This is not intended to be used directly. #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] diff --git a/crates/superposition_sdk/src/protocol_serde/shape_add_members_to_group.rs b/crates/superposition_sdk/src/protocol_serde/shape_add_members_to_group.rs index 93826604a..1f287f3a7 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_add_members_to_group.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_add_members_to_group.rs @@ -8,7 +8,7 @@ pub fn de_add_members_to_group_http_error(_response_status: u16, _response_heade Some(code) => code, None => return Err(crate::operation::add_members_to_group::AddMembersToGroupError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::add_members_to_group::AddMembersToGroupError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_add_members_to_group_http_response(_response_status: u16, _response_he pub fn ser_add_members_to_group_headers( input: &crate::operation::add_members_to_group::AddMembersToGroupInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_add_members_to_group_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_add_members_to_group_input(input: &crate::operation::add_members_to_g Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_add_members_to_group(value: &[u8], mut builder: crate::operation::add_members_to_group::builders::AddMembersToGroupOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_add_members_to_group(_value: &[u8], mut builder: crate::operation::add_members_to_group::builders::AddMembersToGroupOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -107,7 +109,7 @@ pub(crate) fn de_add_members_to_group(value: &[u8], mut builder: crate::operatio match key.to_unescaped()?.as_ref() { "buckets" => { builder = builder.set_buckets( - crate::protocol_serde::shape_buckets::de_buckets(tokens)? + crate::protocol_serde::shape_buckets::de_buckets(tokens, _value, depth + 1)? ); } "change_reason" => { @@ -121,7 +123,7 @@ pub(crate) fn de_add_members_to_group(value: &[u8], mut builder: crate::operatio } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "context_hash" => { @@ -190,7 +192,7 @@ pub(crate) fn de_add_members_to_group(value: &[u8], mut builder: crate::operatio } "member_experiment_ids" => { builder = builder.set_member_experiment_ids( - crate::protocol_serde::shape_string_list::de_string_list(tokens)? + crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)? ); } "name" => { @@ -212,7 +214,7 @@ pub(crate) fn de_add_members_to_group(value: &[u8], mut builder: crate::operatio _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_applicable_variants.rs b/crates/superposition_sdk/src/protocol_serde/shape_applicable_variants.rs index 84054932d..3315e2cc3 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_applicable_variants.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_applicable_variants.rs @@ -8,7 +8,7 @@ pub fn de_applicable_variants_http_error(_response_status: u16, _response_header Some(code) => code, None => return Err(crate::operation::applicable_variants::ApplicableVariantsError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::applicable_variants::ApplicableVariantsError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_applicable_variants_http_response(_response_status: u16, _response_hea pub fn ser_applicable_variants_headers( input: &crate::operation::applicable_variants::ApplicableVariantsInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_applicable_variants_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -80,9 +80,11 @@ pub fn ser_applicable_variants_input(input: &crate::operation::applicable_varian Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_applicable_variants(value: &[u8], mut builder: crate::operation::applicable_variants::builders::ApplicableVariantsOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_applicable_variants(_value: &[u8], mut builder: crate::operation::applicable_variants::builders::ApplicableVariantsOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -91,13 +93,13 @@ pub(crate) fn de_applicable_variants(value: &[u8], mut builder: crate::operation match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_list_variant::de_list_variant(tokens)? + crate::protocol_serde::shape_list_variant::de_list_variant(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_audit_log_full.rs b/crates/superposition_sdk/src/protocol_serde/shape_audit_log_full.rs index 098308e61..328e2ed27 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_audit_log_full.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_audit_log_full.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_audit_log_full<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_audit_log_full<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -74,7 +77,7 @@ pub(crate) fn de_audit_log_full<'a, I>(tokens: &mut ::std::iter::Peekable) -> _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::audit_log_full_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_audit_log_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_audit_log_list.rs index a96deaa2f..3645fccc3 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_audit_log_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_audit_log_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_audit_log_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_audit_log_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_audit_log_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> } _ => { let value = - crate::protocol_serde::shape_audit_log_full::de_audit_log_full(tokens)? + crate::protocol_serde::shape_audit_log_full::de_audit_log_full(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_bucket.rs b/crates/superposition_sdk/src/protocol_serde/shape_bucket.rs index f89b09b58..1f343a929 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_bucket.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_bucket.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_bucket<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_bucket<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -32,7 +35,7 @@ pub(crate) fn de_bucket<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std:: _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::bucket_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_buckets.rs b/crates/superposition_sdk/src/protocol_serde/shape_buckets.rs index 2a3ff4699..295c46437 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_buckets.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_buckets.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_buckets<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_buckets<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,7 +15,7 @@ pub(crate) fn de_buckets<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std: } _ => { items.push( - crate::protocol_serde::shape_bucket::de_bucket(tokens)? + crate::protocol_serde::shape_bucket::de_bucket(tokens, _value, depth + 1)? ); } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_bulk_operation.rs b/crates/superposition_sdk/src/protocol_serde/shape_bulk_operation.rs index abdcee883..117a63401 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_bulk_operation.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_bulk_operation.rs @@ -8,7 +8,7 @@ pub fn de_bulk_operation_http_error(_response_status: u16, _response_headers: &: Some(code) => code, None => return Err(crate::operation::bulk_operation::BulkOperationError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::bulk_operation::BulkOperationError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_bulk_operation_http_response(_response_status: u16, _response_headers: pub fn ser_bulk_operation_headers( input: &crate::operation::bulk_operation::BulkOperationInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_bulk_operation_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -104,7 +104,7 @@ pub fn ser_bulk_operation_headers( if let ::std::option::Option::Some(inner_5) = &input.config_tags { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("config_tags", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -124,9 +124,11 @@ pub fn ser_bulk_operation_input(input: &crate::operation::bulk_operation::BulkOp Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_bulk_operation(value: &[u8], mut builder: crate::operation::bulk_operation::builders::BulkOperationOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_bulk_operation(_value: &[u8], mut builder: crate::operation::bulk_operation::builders::BulkOperationOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -135,13 +137,13 @@ pub(crate) fn de_bulk_operation(value: &[u8], mut builder: crate::operation::bul match key.to_unescaped()?.as_ref() { "output" => { builder = builder.set_output( - crate::protocol_serde::shape_bulk_operation_out_list::de_bulk_operation_out_list(tokens)? + crate::protocol_serde::shape_bulk_operation_out_list::de_bulk_operation_out_list(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_bulk_operation_out_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_bulk_operation_out_list.rs index 96d41bdfb..90b0c1389 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_bulk_operation_out_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_bulk_operation_out_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_bulk_operation_out_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_bulk_operation_out_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_bulk_operation_out_list<'a, I>(tokens: &mut ::std::iter::Peekab } _ => { let value = - crate::protocol_serde::shape_context_action_out::de_context_action_out(tokens)? + crate::protocol_serde::shape_context_action_out::de_context_action_out(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_conclude_experiment.rs b/crates/superposition_sdk/src/protocol_serde/shape_conclude_experiment.rs index c157c8702..b07d10770 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_conclude_experiment.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_conclude_experiment.rs @@ -8,7 +8,7 @@ pub fn de_conclude_experiment_http_error(_response_status: u16, _response_header Some(code) => code, None => return Err(crate::operation::conclude_experiment::ConcludeExperimentError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::conclude_experiment::ConcludeExperimentError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_conclude_experiment_http_response(_response_status: u16, _response_hea pub fn ser_conclude_experiment_headers( input: &crate::operation::conclude_experiment::ConcludeExperimentInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_conclude_experiment_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -104,7 +104,7 @@ pub fn ser_conclude_experiment_headers( if let ::std::option::Option::Some(inner_5) = &input.config_tags { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("config_tags", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -124,9 +124,11 @@ pub fn ser_conclude_experiment_input(input: &crate::operation::conclude_experime Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_conclude_experiment(value: &[u8], mut builder: crate::operation::conclude_experiment::builders::ConcludeExperimentOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_conclude_experiment(_value: &[u8], mut builder: crate::operation::conclude_experiment::builders::ConcludeExperimentOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -153,7 +155,7 @@ pub(crate) fn de_conclude_experiment(value: &[u8], mut builder: crate::operation } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "created_at" => { @@ -245,7 +247,7 @@ pub(crate) fn de_conclude_experiment(value: &[u8], mut builder: crate::operation } "override_keys" => { builder = builder.set_override_keys( - crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens)? + crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens, _value, depth + 1)? ); } "started_at" => { @@ -280,13 +282,13 @@ pub(crate) fn de_conclude_experiment(value: &[u8], mut builder: crate::operation } "variants" => { builder = builder.set_variants( - crate::protocol_serde::shape_list_variant::de_list_variant(tokens)? + crate::protocol_serde::shape_list_variant::de_list_variant(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_condition.rs b/crates/superposition_sdk/src/protocol_serde/shape_condition.rs index 371c9a34f..0cef29c17 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_condition.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_condition.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_condition<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_condition<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -17,11 +20,12 @@ pub(crate) fn de_condition<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::st let value = Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?) ; - if let Some(value) = value { - map.insert(key, value); - } + match value { + Some(value) => { map.insert(key, value); } + None => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense map cannot contain null values")) + } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(map)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_config_data.rs b/crates/superposition_sdk/src/protocol_serde/shape_config_data.rs index a9ab403d7..79f843101 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_config_data.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_config_data.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_config_data<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_config_data<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -13,28 +16,28 @@ pub(crate) fn de_config_data<'a, I>(tokens: &mut ::std::iter::Peekable) -> :: match key.to_unescaped()?.as_ref() { "contexts" => { builder = builder.set_contexts( - crate::protocol_serde::shape_context_list::de_context_list(tokens)? + crate::protocol_serde::shape_context_list::de_context_list(tokens, _value, depth + 1)? ); } "overrides" => { builder = builder.set_overrides( - crate::protocol_serde::shape_overrides_map::de_overrides_map(tokens)? + crate::protocol_serde::shape_overrides_map::de_overrides_map(tokens, _value, depth + 1)? ); } "default_configs" => { builder = builder.set_default_configs( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "dimensions" => { builder = builder.set_dimensions( - crate::protocol_serde::shape_dimension_data::de_dimension_data(tokens)? + crate::protocol_serde::shape_dimension_data::de_dimension_data(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::config_data_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_context_action_out.rs b/crates/superposition_sdk/src/protocol_serde/shape_context_action_out.rs index d195c3952..d2aabe2a7 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_context_action_out.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_context_action_out.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_context_action_out<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_context_action_out<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } let mut variant = None; match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), @@ -24,13 +27,13 @@ pub(crate) fn de_context_action_out<'a, I>(tokens: &mut ::std::iter::Peekable variant = match key.as_ref() { "PUT" => { Some(crate::types::ContextActionOut::Put( - crate::protocol_serde::shape_context_response::de_context_response(tokens)? + crate::protocol_serde::shape_context_response::de_context_response(tokens, _value, depth + 1)? .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'PUT' cannot be null"))? )) } "REPLACE" => { Some(crate::types::ContextActionOut::Replace( - crate::protocol_serde::shape_context_response::de_context_response(tokens)? + crate::protocol_serde::shape_context_response::de_context_response(tokens, _value, depth + 1)? .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'REPLACE' cannot be null"))? )) } @@ -46,7 +49,7 @@ pub(crate) fn de_context_action_out<'a, I>(tokens: &mut ::std::iter::Peekable } "MOVE" => { Some(crate::types::ContextActionOut::Move( - crate::protocol_serde::shape_context_response::de_context_response(tokens)? + crate::protocol_serde::shape_context_response::de_context_response(tokens, _value, depth + 1)? .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'MOVE' cannot be null"))? )) } @@ -56,7 +59,7 @@ pub(crate) fn de_context_action_out<'a, I>(tokens: &mut ::std::iter::Peekable } }; } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_context_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_context_list.rs index f85319e0a..e9ebb3d9e 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_context_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_context_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_context_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_context_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_context_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> : } _ => { let value = - crate::protocol_serde::shape_context_partial::de_context_partial(tokens)? + crate::protocol_serde::shape_context_partial::de_context_partial(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_context_partial.rs b/crates/superposition_sdk/src/protocol_serde/shape_context_partial.rs index c7daa9e97..04ec5a5bb 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_context_partial.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_context_partial.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_context_partial<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_context_partial<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -22,7 +25,7 @@ pub(crate) fn de_context_partial<'a, I>(tokens: &mut ::std::iter::Peekable) - } "condition" => { builder = builder.set_condition( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "priority" => { @@ -41,13 +44,13 @@ pub(crate) fn de_context_partial<'a, I>(tokens: &mut ::std::iter::Peekable) - } "override_with_keys" => { builder = builder.set_override_with_keys( - crate::protocol_serde::shape_override_with_keys::de_override_with_keys(tokens)? + crate::protocol_serde::shape_override_with_keys::de_override_with_keys(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::context_partial_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_context_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_context_response.rs index 7be6d1d4a..36fe7c662 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_context_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_context_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_context_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_context_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -22,12 +25,12 @@ pub(crate) fn de_context_response<'a, I>(tokens: &mut ::std::iter::Peekable) } "value" => { builder = builder.set_value( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "override" => { builder = builder.set_override( - crate::protocol_serde::shape_overrides::de_overrides(tokens)? + crate::protocol_serde::shape_overrides::de_overrides(tokens, _value, depth + 1)? ); } "override_id" => { @@ -97,7 +100,7 @@ pub(crate) fn de_context_response<'a, I>(tokens: &mut ::std::iter::Peekable) _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::context_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_context.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_context.rs index 866ec1905..a1b979ba8 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_context.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_context.rs @@ -8,7 +8,7 @@ pub fn de_create_context_http_error(_response_status: u16, _response_headers: &: Some(code) => code, None => return Err(crate::operation::create_context::CreateContextError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::create_context::CreateContextError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_create_context_http_response(_response_status: u16, _response_headers: pub fn ser_create_context_headers( input: &crate::operation::create_context::CreateContextInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_create_context_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -104,7 +104,7 @@ pub fn ser_create_context_headers( if let ::std::option::Option::Some(inner_5) = &input.config_tags { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("config_tags", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -116,9 +116,11 @@ pub fn ser_create_context_headers( Ok(builder) } -pub(crate) fn de_create_context(value: &[u8], mut builder: crate::operation::create_context::builders::CreateContextOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_context(_value: &[u8], mut builder: crate::operation::create_context::builders::CreateContextOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -182,7 +184,7 @@ pub(crate) fn de_create_context(value: &[u8], mut builder: crate::operation::cre } "override" => { builder = builder.set_override( - crate::protocol_serde::shape_overrides::de_overrides(tokens)? + crate::protocol_serde::shape_overrides::de_overrides(tokens, _value, depth + 1)? ); } "override_id" => { @@ -196,7 +198,7 @@ pub(crate) fn de_create_context(value: &[u8], mut builder: crate::operation::cre } "value" => { builder = builder.set_value( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "weight" => { @@ -211,7 +213,7 @@ pub(crate) fn de_create_context(value: &[u8], mut builder: crate::operation::cre _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_default_config.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_default_config.rs index 8eff01c8b..66e8d664f 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_default_config.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_default_config.rs @@ -8,7 +8,7 @@ pub fn de_create_default_config_http_error(_response_status: u16, _response_head Some(code) => code, None => return Err(crate::operation::create_default_config::CreateDefaultConfigError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "WebhookFailed" => crate::operation::create_default_config::CreateDefaultConfigError::WebhookFailed({ @@ -72,12 +72,12 @@ pub fn de_create_default_config_http_response(_response_status: u16, _response_h pub fn ser_create_default_config_headers( input: &crate::operation::create_default_config::CreateDefaultConfigInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -89,7 +89,7 @@ pub fn ser_create_default_config_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -109,9 +109,11 @@ pub fn ser_create_default_config_input(input: &crate::operation::create_default_ Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_default_config(value: &[u8], mut builder: crate::operation::create_default_config::builders::CreateDefaultConfigOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_default_config(_value: &[u8], mut builder: crate::operation::create_default_config::builders::CreateDefaultConfigOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -175,7 +177,7 @@ pub(crate) fn de_create_default_config(value: &[u8], mut builder: crate::operati } "schema" => { builder = builder.set_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "value" => { @@ -204,7 +206,7 @@ pub(crate) fn de_create_default_config(value: &[u8], mut builder: crate::operati _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_dimension.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_dimension.rs index 0d1446ab6..64bb8c496 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_dimension.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_dimension.rs @@ -8,7 +8,7 @@ pub fn de_create_dimension_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::create_dimension::CreateDimensionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "WebhookFailed" => crate::operation::create_dimension::CreateDimensionError::WebhookFailed({ @@ -59,12 +59,12 @@ pub fn de_create_dimension_http_response(_response_status: u16, _response_header pub fn ser_create_dimension_headers( input: &crate::operation::create_dimension::CreateDimensionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_create_dimension_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_create_dimension_input(input: &crate::operation::create_dimension::Cr Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_dimension(value: &[u8], mut builder: crate::operation::create_dimension::builders::CreateDimensionOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_dimension(_value: &[u8], mut builder: crate::operation::create_dimension::builders::CreateDimensionOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -130,7 +132,7 @@ pub(crate) fn de_create_dimension(value: &[u8], mut builder: crate::operation::c } "dependency_graph" => { builder = builder.set_dependency_graph( - crate::protocol_serde::shape_dependency_graph::de_dependency_graph(tokens)? + crate::protocol_serde::shape_dependency_graph::de_dependency_graph(tokens, _value, depth + 1)? ); } "description" => { @@ -153,7 +155,7 @@ pub(crate) fn de_create_dimension(value: &[u8], mut builder: crate::operation::c } "dimension_type" => { builder = builder.set_dimension_type( - crate::protocol_serde::shape_dimension_type::de_dimension_type(tokens)? + crate::protocol_serde::shape_dimension_type::de_dimension_type(tokens, _value, depth + 1)? ); } "last_modified_at" => { @@ -184,7 +186,7 @@ pub(crate) fn de_create_dimension(value: &[u8], mut builder: crate::operation::c } "schema" => { builder = builder.set_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "value_compute_function_name" => { @@ -208,7 +210,7 @@ pub(crate) fn de_create_dimension(value: &[u8], mut builder: crate::operation::c _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_experiment.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_experiment.rs index 6d7afaafe..611210000 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_experiment.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_experiment.rs @@ -8,7 +8,7 @@ pub fn de_create_experiment_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::create_experiment::CreateExperimentError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "WebhookFailed" => crate::operation::create_experiment::CreateExperimentError::WebhookFailed({ @@ -59,12 +59,12 @@ pub fn de_create_experiment_http_response(_response_status: u16, _response_heade pub fn ser_create_experiment_headers( input: &crate::operation::create_experiment::CreateExperimentInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_create_experiment_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,7 +88,7 @@ pub fn ser_create_experiment_headers( if let ::std::option::Option::Some(inner_5) = &input.idempotency_key { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("idempotency_key", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -100,7 +100,7 @@ pub fn ser_create_experiment_headers( if let ::std::option::Option::Some(inner_7) = &input.config_tags { let formatted_8 = inner_7.as_str(); let header_value = formatted_8; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("config_tags", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -120,9 +120,11 @@ pub fn ser_create_experiment_input(input: &crate::operation::create_experiment:: Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_experiment(value: &[u8], mut builder: crate::operation::create_experiment::builders::CreateExperimentOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_experiment(_value: &[u8], mut builder: crate::operation::create_experiment::builders::CreateExperimentOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -149,7 +151,7 @@ pub(crate) fn de_create_experiment(value: &[u8], mut builder: crate::operation:: } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "created_at" => { @@ -241,7 +243,7 @@ pub(crate) fn de_create_experiment(value: &[u8], mut builder: crate::operation:: } "override_keys" => { builder = builder.set_override_keys( - crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens)? + crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens, _value, depth + 1)? ); } "started_at" => { @@ -276,13 +278,13 @@ pub(crate) fn de_create_experiment(value: &[u8], mut builder: crate::operation:: } "variants" => { builder = builder.set_variants( - crate::protocol_serde::shape_list_variant::de_list_variant(tokens)? + crate::protocol_serde::shape_list_variant::de_list_variant(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_experiment_group.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_experiment_group.rs index 750b2e072..8384dd8d0 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_experiment_group.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_experiment_group.rs @@ -8,7 +8,7 @@ pub fn de_create_experiment_group_http_error(_response_status: u16, _response_he Some(code) => code, None => return Err(crate::operation::create_experiment_group::CreateExperimentGroupError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::create_experiment_group::CreateExperimentGroupError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_create_experiment_group_http_response(_response_status: u16, _response pub fn ser_create_experiment_group_headers( input: &crate::operation::create_experiment_group::CreateExperimentGroupInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_create_experiment_group_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -80,9 +80,11 @@ pub fn ser_create_experiment_group_input(input: &crate::operation::create_experi Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_experiment_group(value: &[u8], mut builder: crate::operation::create_experiment_group::builders::CreateExperimentGroupOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_experiment_group(_value: &[u8], mut builder: crate::operation::create_experiment_group::builders::CreateExperimentGroupOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -91,7 +93,7 @@ pub(crate) fn de_create_experiment_group(value: &[u8], mut builder: crate::opera match key.to_unescaped()?.as_ref() { "buckets" => { builder = builder.set_buckets( - crate::protocol_serde::shape_buckets::de_buckets(tokens)? + crate::protocol_serde::shape_buckets::de_buckets(tokens, _value, depth + 1)? ); } "change_reason" => { @@ -105,7 +107,7 @@ pub(crate) fn de_create_experiment_group(value: &[u8], mut builder: crate::opera } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "context_hash" => { @@ -174,7 +176,7 @@ pub(crate) fn de_create_experiment_group(value: &[u8], mut builder: crate::opera } "member_experiment_ids" => { builder = builder.set_member_experiment_ids( - crate::protocol_serde::shape_string_list::de_string_list(tokens)? + crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)? ); } "name" => { @@ -196,7 +198,7 @@ pub(crate) fn de_create_experiment_group(value: &[u8], mut builder: crate::opera _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_function.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_function.rs index 604c921e4..032d25a41 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_function.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_function.rs @@ -8,7 +8,7 @@ pub fn de_create_function_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::create_function::CreateFunctionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::create_function::CreateFunctionError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_create_function_http_response(_response_status: u16, _response_headers pub fn ser_create_function_headers( input: &crate::operation::create_function::CreateFunctionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_create_function_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -80,9 +80,11 @@ pub fn ser_create_function_input(input: &crate::operation::create_function::Crea Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_function(value: &[u8], mut builder: crate::operation::create_function::builders::CreateFunctionOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_function(_value: &[u8], mut builder: crate::operation::create_function::builders::CreateFunctionOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -206,7 +208,7 @@ pub(crate) fn de_create_function(value: &[u8], mut builder: crate::operation::cr _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_organisation.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_organisation.rs index b08af20ac..6cda41585 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_organisation.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_organisation.rs @@ -8,7 +8,7 @@ pub fn de_create_organisation_http_error(_response_status: u16, _response_header Some(code) => code, None => return Err(crate::operation::create_organisation::CreateOrganisationError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::create_organisation::CreateOrganisationError::InternalServerError({ @@ -49,9 +49,11 @@ pub fn ser_create_organisation_input(input: &crate::operation::create_organisati Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_organisation(value: &[u8], mut builder: crate::operation::create_organisation::builders::CreateOrganisationOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_organisation(_value: &[u8], mut builder: crate::operation::create_organisation::builders::CreateOrganisationOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -161,7 +163,7 @@ pub(crate) fn de_create_organisation(value: &[u8], mut builder: crate::operation _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_secret.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_secret.rs index 97a13ae4d..e2a91b71e 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_secret.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_secret.rs @@ -8,7 +8,7 @@ pub fn de_create_secret_http_error(_response_status: u16, _response_headers: &:: Some(code) => code, None => return Err(crate::operation::create_secret::CreateSecretError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::create_secret::CreateSecretError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_create_secret_http_response(_response_status: u16, _response_headers: pub fn ser_create_secret_headers( input: &crate::operation::create_secret::CreateSecretInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_create_secret_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -80,9 +80,11 @@ pub fn ser_create_secret_input(input: &crate::operation::create_secret::CreateSe Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_secret(value: &[u8], mut builder: crate::operation::create_secret::builders::CreateSecretOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_secret(_value: &[u8], mut builder: crate::operation::create_secret::builders::CreateSecretOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -147,7 +149,7 @@ pub(crate) fn de_create_secret(value: &[u8], mut builder: crate::operation::crea _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_type_templates.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_type_templates.rs index d142fe444..cfec6eb82 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_type_templates.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_type_templates.rs @@ -8,7 +8,7 @@ pub fn de_create_type_templates_http_error(_response_status: u16, _response_head Some(code) => code, None => return Err(crate::operation::create_type_templates::CreateTypeTemplatesError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::create_type_templates::CreateTypeTemplatesError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_create_type_templates_http_response(_response_status: u16, _response_h pub fn ser_create_type_templates_headers( input: &crate::operation::create_type_templates::CreateTypeTemplatesInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_create_type_templates_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -80,9 +80,11 @@ pub fn ser_create_type_templates_input(input: &crate::operation::create_type_tem Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_type_templates(value: &[u8], mut builder: crate::operation::create_type_templates::builders::CreateTypeTemplatesOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_type_templates(_value: &[u8], mut builder: crate::operation::create_type_templates::builders::CreateTypeTemplatesOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -146,13 +148,13 @@ pub(crate) fn de_create_type_templates(value: &[u8], mut builder: crate::operati } "type_schema" => { builder = builder.set_type_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_variable.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_variable.rs index 7a1bed17e..7c54d93ef 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_variable.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_variable.rs @@ -8,7 +8,7 @@ pub fn de_create_variable_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::create_variable::CreateVariableError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::create_variable::CreateVariableError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_create_variable_http_response(_response_status: u16, _response_headers pub fn ser_create_variable_headers( input: &crate::operation::create_variable::CreateVariableInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_create_variable_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -80,9 +80,11 @@ pub fn ser_create_variable_input(input: &crate::operation::create_variable::Crea Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_variable(value: &[u8], mut builder: crate::operation::create_variable::builders::CreateVariableOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_variable(_value: &[u8], mut builder: crate::operation::create_variable::builders::CreateVariableOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -156,7 +158,7 @@ pub(crate) fn de_create_variable(value: &[u8], mut builder: crate::operation::cr _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_webhook.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_webhook.rs index b9d07276a..7bcf10bf8 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_webhook.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_webhook.rs @@ -8,7 +8,7 @@ pub fn de_create_webhook_http_error(_response_status: u16, _response_headers: &: Some(code) => code, None => return Err(crate::operation::create_webhook::CreateWebhookError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::create_webhook::CreateWebhookError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_create_webhook_http_response(_response_status: u16, _response_headers: pub fn ser_create_webhook_headers( input: &crate::operation::create_webhook::CreateWebhookInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_create_webhook_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -80,9 +80,11 @@ pub fn ser_create_webhook_input(input: &crate::operation::create_webhook::Create Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_webhook(value: &[u8], mut builder: crate::operation::create_webhook::builders::CreateWebhookOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_webhook(_value: &[u8], mut builder: crate::operation::create_webhook::builders::CreateWebhookOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -114,7 +116,7 @@ pub(crate) fn de_create_webhook(value: &[u8], mut builder: crate::operation::cre } "custom_headers" => { builder = builder.set_custom_headers( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "description" => { @@ -133,7 +135,7 @@ pub(crate) fn de_create_webhook(value: &[u8], mut builder: crate::operation::cre } "events" => { builder = builder.set_events( - crate::protocol_serde::shape_events::de_events(tokens)? + crate::protocol_serde::shape_events::de_events(tokens, _value, depth + 1)? ); } "last_modified_at" => { @@ -201,7 +203,7 @@ pub(crate) fn de_create_webhook(value: &[u8], mut builder: crate::operation::cre _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_create_workspace.rs b/crates/superposition_sdk/src/protocol_serde/shape_create_workspace.rs index 36b35d284..6078d6b8e 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_create_workspace.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_create_workspace.rs @@ -8,7 +8,7 @@ pub fn de_create_workspace_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::create_workspace::CreateWorkspaceError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::create_workspace::CreateWorkspaceError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_create_workspace_http_response(_response_status: u16, _response_header pub fn ser_create_workspace_headers( input: &crate::operation::create_workspace::CreateWorkspaceInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.org_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -68,9 +68,11 @@ pub fn ser_create_workspace_input(input: &crate::operation::create_workspace::Cr Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_create_workspace(value: &[u8], mut builder: crate::operation::create_workspace::builders::CreateWorkspaceOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_create_workspace(_value: &[u8], mut builder: crate::operation::create_workspace::builders::CreateWorkspaceOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -136,7 +138,7 @@ pub(crate) fn de_create_workspace(value: &[u8], mut builder: crate::operation::c } "mandatory_dimensions" => { builder = builder.set_mandatory_dimensions( - crate::protocol_serde::shape_list_mandatory_dimensions::de_list_mandatory_dimensions(tokens)? + crate::protocol_serde::shape_list_mandatory_dimensions::de_list_mandatory_dimensions(tokens, _value, depth + 1)? ); } "metrics" => { @@ -173,7 +175,7 @@ pub(crate) fn de_create_workspace(value: &[u8], mut builder: crate::operation::c } "workspace_lock" => { builder = builder.set_workspace_lock( - crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens)? + crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens, _value, depth + 1)? ); } "workspace_name" => { @@ -206,7 +208,7 @@ pub(crate) fn de_create_workspace(value: &[u8], mut builder: crate::operation::c _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_default_config_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_default_config_response.rs index f92cd48bf..2f453b1b8 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_default_config_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_default_config_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_default_config_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_default_config_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -27,7 +30,7 @@ pub(crate) fn de_default_config_response<'a, I>(tokens: &mut ::std::iter::Peekab } "schema" => { builder = builder.set_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "description" => { @@ -97,7 +100,7 @@ pub(crate) fn de_default_config_response<'a, I>(tokens: &mut ::std::iter::Peekab _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::default_config_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_delete_context.rs b/crates/superposition_sdk/src/protocol_serde/shape_delete_context.rs index d689aeaa1..2587ea489 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_delete_context.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_delete_context.rs @@ -8,7 +8,7 @@ pub fn de_delete_context_http_error(_response_status: u16, _response_headers: &: Some(code) => code, None => return Err(crate::operation::delete_context::DeleteContextError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::delete_context::DeleteContextError::ResourceNotFound({ @@ -74,12 +74,12 @@ pub fn de_delete_context_http_response(_response_status: u16, _response_headers: pub fn ser_delete_context_headers( input: &crate::operation::delete_context::DeleteContextInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -91,7 +91,7 @@ pub fn ser_delete_context_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -103,7 +103,7 @@ pub fn ser_delete_context_headers( if let ::std::option::Option::Some(inner_5) = &input.config_tags { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("config_tags", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_delete_default_config.rs b/crates/superposition_sdk/src/protocol_serde/shape_delete_default_config.rs index 49405eda5..140a223c9 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_delete_default_config.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_delete_default_config.rs @@ -8,7 +8,7 @@ pub fn de_delete_default_config_http_error(_response_status: u16, _response_head Some(code) => code, None => return Err(crate::operation::delete_default_config::DeleteDefaultConfigError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::delete_default_config::DeleteDefaultConfigError::ResourceNotFound({ @@ -87,12 +87,12 @@ pub fn de_delete_default_config_http_response(_response_status: u16, _response_h pub fn ser_delete_default_config_headers( input: &crate::operation::delete_default_config::DeleteDefaultConfigInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -104,7 +104,7 @@ pub fn ser_delete_default_config_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_delete_dimension.rs b/crates/superposition_sdk/src/protocol_serde/shape_delete_dimension.rs index 32accb1cf..9940fc479 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_delete_dimension.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_delete_dimension.rs @@ -8,7 +8,7 @@ pub fn de_delete_dimension_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::delete_dimension::DeleteDimensionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::delete_dimension::DeleteDimensionError::ResourceNotFound({ @@ -74,12 +74,12 @@ pub fn de_delete_dimension_http_response(_response_status: u16, _response_header pub fn ser_delete_dimension_headers( input: &crate::operation::delete_dimension::DeleteDimensionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -91,7 +91,7 @@ pub fn ser_delete_dimension_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_delete_experiment_group.rs b/crates/superposition_sdk/src/protocol_serde/shape_delete_experiment_group.rs index 4d2d7f7d0..0b45e9912 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_delete_experiment_group.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_delete_experiment_group.rs @@ -8,7 +8,7 @@ pub fn de_delete_experiment_group_http_error(_response_status: u16, _response_he Some(code) => code, None => return Err(crate::operation::delete_experiment_group::DeleteExperimentGroupError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::delete_experiment_group::DeleteExperimentGroupError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_delete_experiment_group_http_response(_response_status: u16, _response pub fn ser_delete_experiment_group_headers( input: &crate::operation::delete_experiment_group::DeleteExperimentGroupInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_delete_experiment_group_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_delete_experiment_group_headers( Ok(builder) } -pub(crate) fn de_delete_experiment_group(value: &[u8], mut builder: crate::operation::delete_experiment_group::builders::DeleteExperimentGroupOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_delete_experiment_group(_value: &[u8], mut builder: crate::operation::delete_experiment_group::builders::DeleteExperimentGroupOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -99,7 +101,7 @@ pub(crate) fn de_delete_experiment_group(value: &[u8], mut builder: crate::opera match key.to_unescaped()?.as_ref() { "buckets" => { builder = builder.set_buckets( - crate::protocol_serde::shape_buckets::de_buckets(tokens)? + crate::protocol_serde::shape_buckets::de_buckets(tokens, _value, depth + 1)? ); } "change_reason" => { @@ -113,7 +115,7 @@ pub(crate) fn de_delete_experiment_group(value: &[u8], mut builder: crate::opera } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "context_hash" => { @@ -182,7 +184,7 @@ pub(crate) fn de_delete_experiment_group(value: &[u8], mut builder: crate::opera } "member_experiment_ids" => { builder = builder.set_member_experiment_ids( - crate::protocol_serde::shape_string_list::de_string_list(tokens)? + crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)? ); } "name" => { @@ -204,7 +206,7 @@ pub(crate) fn de_delete_experiment_group(value: &[u8], mut builder: crate::opera _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_delete_function.rs b/crates/superposition_sdk/src/protocol_serde/shape_delete_function.rs index f5cec06a1..eb3e3717a 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_delete_function.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_delete_function.rs @@ -8,7 +8,7 @@ pub fn de_delete_function_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::delete_function::DeleteFunctionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::delete_function::DeleteFunctionError::ResourceNotFound({ @@ -58,12 +58,12 @@ pub fn de_delete_function_http_response(_response_status: u16, _response_headers pub fn ser_delete_function_headers( input: &crate::operation::delete_function::DeleteFunctionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -75,7 +75,7 @@ pub fn ser_delete_function_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_delete_secret.rs b/crates/superposition_sdk/src/protocol_serde/shape_delete_secret.rs index 993f47e11..81e9ee864 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_delete_secret.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_delete_secret.rs @@ -8,7 +8,7 @@ pub fn de_delete_secret_http_error(_response_status: u16, _response_headers: &:: Some(code) => code, None => return Err(crate::operation::delete_secret::DeleteSecretError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::delete_secret::DeleteSecretError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_delete_secret_http_response(_response_status: u16, _response_headers: pub fn ser_delete_secret_headers( input: &crate::operation::delete_secret::DeleteSecretInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_delete_secret_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_delete_secret_headers( Ok(builder) } -pub(crate) fn de_delete_secret(value: &[u8], mut builder: crate::operation::delete_secret::builders::DeleteSecretOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_delete_secret(_value: &[u8], mut builder: crate::operation::delete_secret::builders::DeleteSecretOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -155,7 +157,7 @@ pub(crate) fn de_delete_secret(value: &[u8], mut builder: crate::operation::dele _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_delete_type_templates.rs b/crates/superposition_sdk/src/protocol_serde/shape_delete_type_templates.rs index 6b1c06b91..8b1dcaf06 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_delete_type_templates.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_delete_type_templates.rs @@ -8,7 +8,7 @@ pub fn de_delete_type_templates_http_error(_response_status: u16, _response_head Some(code) => code, None => return Err(crate::operation::delete_type_templates::DeleteTypeTemplatesError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::delete_type_templates::DeleteTypeTemplatesError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_delete_type_templates_http_response(_response_status: u16, _response_h pub fn ser_delete_type_templates_headers( input: &crate::operation::delete_type_templates::DeleteTypeTemplatesInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_delete_type_templates_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_delete_type_templates_headers( Ok(builder) } -pub(crate) fn de_delete_type_templates(value: &[u8], mut builder: crate::operation::delete_type_templates::builders::DeleteTypeTemplatesOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_delete_type_templates(_value: &[u8], mut builder: crate::operation::delete_type_templates::builders::DeleteTypeTemplatesOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -154,13 +156,13 @@ pub(crate) fn de_delete_type_templates(value: &[u8], mut builder: crate::operati } "type_schema" => { builder = builder.set_type_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_delete_variable.rs b/crates/superposition_sdk/src/protocol_serde/shape_delete_variable.rs index 6dd1239b2..4fdb91ed2 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_delete_variable.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_delete_variable.rs @@ -8,7 +8,7 @@ pub fn de_delete_variable_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::delete_variable::DeleteVariableError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::delete_variable::DeleteVariableError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_delete_variable_http_response(_response_status: u16, _response_headers pub fn ser_delete_variable_headers( input: &crate::operation::delete_variable::DeleteVariableInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_delete_variable_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_delete_variable_headers( Ok(builder) } -pub(crate) fn de_delete_variable(value: &[u8], mut builder: crate::operation::delete_variable::builders::DeleteVariableOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_delete_variable(_value: &[u8], mut builder: crate::operation::delete_variable::builders::DeleteVariableOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -164,7 +166,7 @@ pub(crate) fn de_delete_variable(value: &[u8], mut builder: crate::operation::de _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_delete_webhook.rs b/crates/superposition_sdk/src/protocol_serde/shape_delete_webhook.rs index e34d21cbf..abf6d481c 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_delete_webhook.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_delete_webhook.rs @@ -8,7 +8,7 @@ pub fn de_delete_webhook_http_error(_response_status: u16, _response_headers: &: Some(code) => code, None => return Err(crate::operation::delete_webhook::DeleteWebhookError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::delete_webhook::DeleteWebhookError::ResourceNotFound({ @@ -58,12 +58,12 @@ pub fn de_delete_webhook_http_response(_response_status: u16, _response_headers: pub fn ser_delete_webhook_headers( input: &crate::operation::delete_webhook::DeleteWebhookInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -75,7 +75,7 @@ pub fn ser_delete_webhook_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_dependency_graph.rs b/crates/superposition_sdk/src/protocol_serde/shape_dependency_graph.rs index b162505d9..596d1fb8b 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_dependency_graph.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_dependency_graph.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_dependency_graph<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_dependency_graph<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -15,13 +18,14 @@ pub(crate) fn de_dependency_graph<'a, I>(tokens: &mut ::std::iter::Peekable) ) ?; let value = - crate::protocol_serde::shape_string_list::de_string_list(tokens)? + crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)? ; - if let Some(value) = value { - map.insert(key, value); - } + match value { + Some(value) => { map.insert(key, value); } + None => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense map cannot contain null values")) + } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(map)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_dimension_data.rs b/crates/superposition_sdk/src/protocol_serde/shape_dimension_data.rs index 0bdee3c33..f37d66799 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_dimension_data.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_dimension_data.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_dimension_data<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_dimension_data<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -15,13 +18,14 @@ pub(crate) fn de_dimension_data<'a, I>(tokens: &mut ::std::iter::Peekable) -> ) ?; let value = - crate::protocol_serde::shape_dimension_info::de_dimension_info(tokens)? + crate::protocol_serde::shape_dimension_info::de_dimension_info(tokens, _value, depth + 1)? ; - if let Some(value) = value { - map.insert(key, value); - } + match value { + Some(value) => { map.insert(key, value); } + None => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense map cannot contain null values")) + } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(map)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_dimension_info.rs b/crates/superposition_sdk/src/protocol_serde/shape_dimension_info.rs index 338cb2cac..a5c5328d9 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_dimension_info.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_dimension_info.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_dimension_info<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_dimension_info<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -13,7 +16,7 @@ pub(crate) fn de_dimension_info<'a, I>(tokens: &mut ::std::iter::Peekable) -> match key.to_unescaped()?.as_ref() { "schema" => { builder = builder.set_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "position" => { @@ -25,12 +28,12 @@ pub(crate) fn de_dimension_info<'a, I>(tokens: &mut ::std::iter::Peekable) -> } "dimension_type" => { builder = builder.set_dimension_type( - crate::protocol_serde::shape_dimension_type::de_dimension_type(tokens)? + crate::protocol_serde::shape_dimension_type::de_dimension_type(tokens, _value, depth + 1)? ); } "dependency_graph" => { builder = builder.set_dependency_graph( - crate::protocol_serde::shape_dependency_graph::de_dependency_graph(tokens)? + crate::protocol_serde::shape_dependency_graph::de_dependency_graph(tokens, _value, depth + 1)? ); } "value_compute_function_name" => { @@ -45,7 +48,7 @@ pub(crate) fn de_dimension_info<'a, I>(tokens: &mut ::std::iter::Peekable) -> _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::dimension_info_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_dimension_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_dimension_list.rs index 47d24300e..ec2307ac1 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_dimension_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_dimension_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_dimension_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_dimension_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_dimension_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> } _ => { let value = - crate::protocol_serde::shape_dimension_response::de_dimension_response(tokens)? + crate::protocol_serde::shape_dimension_response::de_dimension_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_dimension_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_dimension_response.rs index ef4c7ccd4..995f0ff00 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_dimension_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_dimension_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_dimension_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_dimension_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -29,7 +32,7 @@ pub(crate) fn de_dimension_response<'a, I>(tokens: &mut ::std::iter::Peekable } "schema" => { builder = builder.set_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "value_validation_function_name" => { @@ -89,12 +92,12 @@ pub(crate) fn de_dimension_response<'a, I>(tokens: &mut ::std::iter::Peekable } "dependency_graph" => { builder = builder.set_dependency_graph( - crate::protocol_serde::shape_dependency_graph::de_dependency_graph(tokens)? + crate::protocol_serde::shape_dependency_graph::de_dependency_graph(tokens, _value, depth + 1)? ); } "dimension_type" => { builder = builder.set_dimension_type( - crate::protocol_serde::shape_dimension_type::de_dimension_type(tokens)? + crate::protocol_serde::shape_dimension_type::de_dimension_type(tokens, _value, depth + 1)? ); } "value_compute_function_name" => { @@ -114,7 +117,7 @@ pub(crate) fn de_dimension_response<'a, I>(tokens: &mut ::std::iter::Peekable _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::dimension_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_dimension_type.rs b/crates/superposition_sdk/src/protocol_serde/shape_dimension_type.rs index f782f4694..cbb2352ca 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_dimension_type.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_dimension_type.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_dimension_type<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_dimension_type<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } let mut variant = None; match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None), @@ -52,7 +55,7 @@ pub(crate) fn de_dimension_type<'a, I>(tokens: &mut ::std::iter::Peekable) -> } }; } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_discard_experiment.rs b/crates/superposition_sdk/src/protocol_serde/shape_discard_experiment.rs index b8f0e1ae1..38ba54dad 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_discard_experiment.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_discard_experiment.rs @@ -8,7 +8,7 @@ pub fn de_discard_experiment_http_error(_response_status: u16, _response_headers Some(code) => code, None => return Err(crate::operation::discard_experiment::DiscardExperimentError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::discard_experiment::DiscardExperimentError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_discard_experiment_http_response(_response_status: u16, _response_head pub fn ser_discard_experiment_headers( input: &crate::operation::discard_experiment::DiscardExperimentInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_discard_experiment_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -104,7 +104,7 @@ pub fn ser_discard_experiment_headers( if let ::std::option::Option::Some(inner_5) = &input.config_tags { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("config_tags", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -124,9 +124,11 @@ pub fn ser_discard_experiment_input(input: &crate::operation::discard_experiment Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_discard_experiment(value: &[u8], mut builder: crate::operation::discard_experiment::builders::DiscardExperimentOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_discard_experiment(_value: &[u8], mut builder: crate::operation::discard_experiment::builders::DiscardExperimentOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -153,7 +155,7 @@ pub(crate) fn de_discard_experiment(value: &[u8], mut builder: crate::operation: } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "created_at" => { @@ -245,7 +247,7 @@ pub(crate) fn de_discard_experiment(value: &[u8], mut builder: crate::operation: } "override_keys" => { builder = builder.set_override_keys( - crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens)? + crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens, _value, depth + 1)? ); } "started_at" => { @@ -280,13 +282,13 @@ pub(crate) fn de_discard_experiment(value: &[u8], mut builder: crate::operation: } "variants" => { builder = builder.set_variants( - crate::protocol_serde::shape_list_variant::de_list_variant(tokens)? + crate::protocol_serde::shape_list_variant::de_list_variant(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_document.rs b/crates/superposition_sdk/src/protocol_serde/shape_document.rs index 60201cbd4..659c1ae92 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_document.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_document.rs @@ -1,7 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_document_payload(input: &[u8]) -> ::std::result::Result<::aws_smithy_types::Document, ::aws_smithy_json::deserialize::error::DeserializeError> { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(input).peekable(); +pub(crate) fn de_document_payload(_value: &[u8]) -> ::std::result::Result<::aws_smithy_types::Document, ::aws_smithy_json::deserialize::error::DeserializeError> { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(_value).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; let result = Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?) .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("expected payload member value")); diff --git a/crates/superposition_sdk/src/protocol_serde/shape_events.rs b/crates/superposition_sdk/src/protocol_serde/shape_events.rs index b1d34c8af..e45452414 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_events.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_events.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_events<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_events<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -20,6 +23,8 @@ pub(crate) fn de_events<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std:: ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_experiment_group_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_experiment_group_list.rs index e75f1a054..5c809c06e 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_experiment_group_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_experiment_group_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_experiment_group_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_experiment_group_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_experiment_group_list<'a, I>(tokens: &mut ::std::iter::Peekable } _ => { let value = - crate::protocol_serde::shape_experiment_group_response::de_experiment_group_response(tokens)? + crate::protocol_serde::shape_experiment_group_response::de_experiment_group_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_experiment_group_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_experiment_group_response.rs index eda13e880..e4be532f3 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_experiment_group_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_experiment_group_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_experiment_group_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_experiment_group_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -58,7 +61,7 @@ pub(crate) fn de_experiment_group_response<'a, I>(tokens: &mut ::std::iter::Peek } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "traffic_percentage" => { @@ -70,7 +73,7 @@ pub(crate) fn de_experiment_group_response<'a, I>(tokens: &mut ::std::iter::Peek } "member_experiment_ids" => { builder = builder.set_member_experiment_ids( - crate::protocol_serde::shape_string_list::de_string_list(tokens)? + crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)? ); } "created_at" => { @@ -103,7 +106,7 @@ pub(crate) fn de_experiment_group_response<'a, I>(tokens: &mut ::std::iter::Peek } "buckets" => { builder = builder.set_buckets( - crate::protocol_serde::shape_buckets::de_buckets(tokens)? + crate::protocol_serde::shape_buckets::de_buckets(tokens, _value, depth + 1)? ); } "group_type" => { @@ -118,7 +121,7 @@ pub(crate) fn de_experiment_group_response<'a, I>(tokens: &mut ::std::iter::Peek _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::experiment_group_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_experiment_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_experiment_list.rs index 5d1311a27..09768b492 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_experiment_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_experiment_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_experiment_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_experiment_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_experiment_list<'a, I>(tokens: &mut ::std::iter::Peekable) - } _ => { let value = - crate::protocol_serde::shape_experiment_response::de_experiment_response(tokens)? + crate::protocol_serde::shape_experiment_response::de_experiment_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_experiment_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_experiment_response.rs index 10ba4ce90..d95a122b3 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_experiment_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_experiment_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_experiment_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_experiment_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -59,7 +62,7 @@ pub(crate) fn de_experiment_response<'a, I>(tokens: &mut ::std::iter::Peekable { builder = builder.set_override_keys( - crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens)? + crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens, _value, depth + 1)? ); } "status" => { @@ -80,12 +83,12 @@ pub(crate) fn de_experiment_response<'a, I>(tokens: &mut ::std::iter::Peekable { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "variants" => { builder = builder.set_variants( - crate::protocol_serde::shape_list_variant::de_list_variant(tokens)? + crate::protocol_serde::shape_list_variant::de_list_variant(tokens, _value, depth + 1)? ); } "last_modified_by" => { @@ -164,7 +167,7 @@ pub(crate) fn de_experiment_response<'a, I>(tokens: &mut ::std::iter::Peekable ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::experiment_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_function_list_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_function_list_response.rs index c5e52e67c..08fd839e0 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_function_list_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_function_list_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_function_list_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_function_list_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_function_list_response<'a, I>(tokens: &mut ::std::iter::Peekabl } _ => { let value = - crate::protocol_serde::shape_function_response::de_function_response(tokens)? + crate::protocol_serde::shape_function_response::de_function_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_function_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_function_response.rs index 9f1f3c293..424e64b24 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_function_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_function_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_function_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_function_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -128,7 +131,7 @@ pub(crate) fn de_function_response<'a, I>(tokens: &mut ::std::iter::Peekable) _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::function_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_config.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_config.rs index 409ac9055..22197997f 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_config.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_config.rs @@ -8,7 +8,7 @@ pub fn de_get_config_http_error(_response_status: u16, _response_headers: &::aws Some(code) => code, None => return Err(crate::operation::get_config::GetConfigError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::get_config::GetConfigError::InternalServerError({ @@ -51,12 +51,12 @@ pub fn de_get_config_http_response(_response_status: u16, _response_headers: &:: pub fn ser_get_config_headers( input: &crate::operation::get_config::GetConfigInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -68,7 +68,7 @@ pub fn ser_get_config_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -80,7 +80,7 @@ pub fn ser_get_config_headers( if let ::std::option::Option::Some(inner_5) = &input.if_modified_since { let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::DateTime)?; let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("if_modified_since", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -100,9 +100,11 @@ pub fn ser_get_config_input(input: &crate::operation::get_config::GetConfigInput Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_get_config(value: &[u8], mut builder: crate::operation::get_config::builders::GetConfigOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_config(_value: &[u8], mut builder: crate::operation::get_config::builders::GetConfigOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -111,28 +113,28 @@ pub(crate) fn de_get_config(value: &[u8], mut builder: crate::operation::get_con match key.to_unescaped()?.as_ref() { "contexts" => { builder = builder.set_contexts( - crate::protocol_serde::shape_context_list::de_context_list(tokens)? + crate::protocol_serde::shape_context_list::de_context_list(tokens, _value, depth + 1)? ); } "default_configs" => { builder = builder.set_default_configs( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "dimensions" => { builder = builder.set_dimensions( - crate::protocol_serde::shape_dimension_data::de_dimension_data(tokens)? + crate::protocol_serde::shape_dimension_data::de_dimension_data(tokens, _value, depth + 1)? ); } "overrides" => { builder = builder.set_overrides( - crate::protocol_serde::shape_overrides_map::de_overrides_map(tokens)? + crate::protocol_serde::shape_overrides_map::de_overrides_map(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_config_json.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_config_json.rs index 803e0f481..e05384325 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_config_json.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_config_json.rs @@ -8,7 +8,7 @@ pub fn de_get_config_json_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::get_config_json::GetConfigJsonError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::get_config_json::GetConfigJsonError::InternalServerError({ @@ -49,12 +49,12 @@ pub fn de_get_config_json_http_response(_response_status: u16, _response_headers pub fn ser_get_config_json_headers( input: &crate::operation::get_config_json::GetConfigJsonInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -66,7 +66,7 @@ pub fn ser_get_config_json_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -78,7 +78,7 @@ pub fn ser_get_config_json_headers( if let ::std::option::Option::Some(inner_5) = &input.if_modified_since { let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::DateTime)?; let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("if_modified_since", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_config_toml.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_config_toml.rs index 0edb4ae39..85e7805cb 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_config_toml.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_config_toml.rs @@ -8,7 +8,7 @@ pub fn de_get_config_toml_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::get_config_toml::GetConfigTomlError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::get_config_toml::GetConfigTomlError::InternalServerError({ @@ -49,12 +49,12 @@ pub fn de_get_config_toml_http_response(_response_status: u16, _response_headers pub fn ser_get_config_toml_headers( input: &crate::operation::get_config_toml::GetConfigTomlInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -66,7 +66,7 @@ pub fn ser_get_config_toml_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -78,7 +78,7 @@ pub fn ser_get_config_toml_headers( if let ::std::option::Option::Some(inner_5) = &input.if_modified_since { let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::DateTime)?; let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("if_modified_since", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_context.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_context.rs index 96a1cee97..470922a71 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_context.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_context.rs @@ -8,7 +8,7 @@ pub fn de_get_context_http_error(_response_status: u16, _response_headers: &::aw Some(code) => code, None => return Err(crate::operation::get_context::GetContextError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_context::GetContextError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_context_http_response(_response_status: u16, _response_headers: &: pub fn ser_get_context_headers( input: &crate::operation::get_context::GetContextInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_context_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_context_headers( Ok(builder) } -pub(crate) fn de_get_context(value: &[u8], mut builder: crate::operation::get_context::builders::GetContextOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_context(_value: &[u8], mut builder: crate::operation::get_context::builders::GetContextOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -154,7 +156,7 @@ pub(crate) fn de_get_context(value: &[u8], mut builder: crate::operation::get_co } "override" => { builder = builder.set_override( - crate::protocol_serde::shape_overrides::de_overrides(tokens)? + crate::protocol_serde::shape_overrides::de_overrides(tokens, _value, depth + 1)? ); } "override_id" => { @@ -168,7 +170,7 @@ pub(crate) fn de_get_context(value: &[u8], mut builder: crate::operation::get_co } "value" => { builder = builder.set_value( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "weight" => { @@ -183,7 +185,7 @@ pub(crate) fn de_get_context(value: &[u8], mut builder: crate::operation::get_co _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_context_from_condition.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_context_from_condition.rs index 066162028..9eadd17ac 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_context_from_condition.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_context_from_condition.rs @@ -8,7 +8,7 @@ pub fn de_get_context_from_condition_http_error(_response_status: u16, _response Some(code) => code, None => return Err(crate::operation::get_context_from_condition::GetContextFromConditionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_context_from_condition::GetContextFromConditionError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_context_from_condition_http_response(_response_status: u16, _respo pub fn ser_get_context_from_condition_headers( input: &crate::operation::get_context_from_condition::GetContextFromConditionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_context_from_condition_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_context_from_condition_headers( Ok(builder) } -pub(crate) fn de_get_context_from_condition(value: &[u8], mut builder: crate::operation::get_context_from_condition::builders::GetContextFromConditionOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_context_from_condition(_value: &[u8], mut builder: crate::operation::get_context_from_condition::builders::GetContextFromConditionOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -154,7 +156,7 @@ pub(crate) fn de_get_context_from_condition(value: &[u8], mut builder: crate::op } "override" => { builder = builder.set_override( - crate::protocol_serde::shape_overrides::de_overrides(tokens)? + crate::protocol_serde::shape_overrides::de_overrides(tokens, _value, depth + 1)? ); } "override_id" => { @@ -168,7 +170,7 @@ pub(crate) fn de_get_context_from_condition(value: &[u8], mut builder: crate::op } "value" => { builder = builder.set_value( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "weight" => { @@ -183,7 +185,7 @@ pub(crate) fn de_get_context_from_condition(value: &[u8], mut builder: crate::op _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_default_config.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_default_config.rs index 77a358d44..864fa0d89 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_default_config.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_default_config.rs @@ -8,7 +8,7 @@ pub fn de_get_default_config_http_error(_response_status: u16, _response_headers Some(code) => code, None => return Err(crate::operation::get_default_config::GetDefaultConfigError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_default_config::GetDefaultConfigError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_default_config_http_response(_response_status: u16, _response_head pub fn ser_get_default_config_headers( input: &crate::operation::get_default_config::GetDefaultConfigInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_default_config_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_default_config_headers( Ok(builder) } -pub(crate) fn de_get_default_config(value: &[u8], mut builder: crate::operation::get_default_config::builders::GetDefaultConfigOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_default_config(_value: &[u8], mut builder: crate::operation::get_default_config::builders::GetDefaultConfigOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -154,7 +156,7 @@ pub(crate) fn de_get_default_config(value: &[u8], mut builder: crate::operation: } "schema" => { builder = builder.set_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "value" => { @@ -183,7 +185,7 @@ pub(crate) fn de_get_default_config(value: &[u8], mut builder: crate::operation: _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_detailed_resolved_config.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_detailed_resolved_config.rs index 3947dd28e..bbfb373a7 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_detailed_resolved_config.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_detailed_resolved_config.rs @@ -8,7 +8,7 @@ pub fn de_get_detailed_resolved_config_http_error(_response_status: u16, _respon Some(code) => code, None => return Err(crate::operation::get_detailed_resolved_config::GetDetailedResolvedConfigError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::get_detailed_resolved_config::GetDetailedResolvedConfigError::InternalServerError({ @@ -57,12 +57,12 @@ pub fn de_get_detailed_resolved_config_http_response(_response_status: u16, _res pub fn ser_get_detailed_resolved_config_headers( input: &crate::operation::get_detailed_resolved_config::GetDetailedResolvedConfigInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -74,7 +74,7 @@ pub fn ser_get_detailed_resolved_config_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -86,7 +86,7 @@ pub fn ser_get_detailed_resolved_config_headers( if let ::std::option::Option::Some(inner_5) = &input.merge_strategy { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("merge_strategy", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_dimension.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_dimension.rs index e5ca83f2a..b12e1f07d 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_dimension.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_dimension.rs @@ -8,7 +8,7 @@ pub fn de_get_dimension_http_error(_response_status: u16, _response_headers: &:: Some(code) => code, None => return Err(crate::operation::get_dimension::GetDimensionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_dimension::GetDimensionError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_dimension_http_response(_response_status: u16, _response_headers: pub fn ser_get_dimension_headers( input: &crate::operation::get_dimension::GetDimensionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_dimension_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_dimension_headers( Ok(builder) } -pub(crate) fn de_get_dimension(value: &[u8], mut builder: crate::operation::get_dimension::builders::GetDimensionOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_dimension(_value: &[u8], mut builder: crate::operation::get_dimension::builders::GetDimensionOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -122,7 +124,7 @@ pub(crate) fn de_get_dimension(value: &[u8], mut builder: crate::operation::get_ } "dependency_graph" => { builder = builder.set_dependency_graph( - crate::protocol_serde::shape_dependency_graph::de_dependency_graph(tokens)? + crate::protocol_serde::shape_dependency_graph::de_dependency_graph(tokens, _value, depth + 1)? ); } "description" => { @@ -145,7 +147,7 @@ pub(crate) fn de_get_dimension(value: &[u8], mut builder: crate::operation::get_ } "dimension_type" => { builder = builder.set_dimension_type( - crate::protocol_serde::shape_dimension_type::de_dimension_type(tokens)? + crate::protocol_serde::shape_dimension_type::de_dimension_type(tokens, _value, depth + 1)? ); } "last_modified_at" => { @@ -176,7 +178,7 @@ pub(crate) fn de_get_dimension(value: &[u8], mut builder: crate::operation::get_ } "schema" => { builder = builder.set_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "value_compute_function_name" => { @@ -200,7 +202,7 @@ pub(crate) fn de_get_dimension(value: &[u8], mut builder: crate::operation::get_ _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_experiment.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_experiment.rs index d5f1980af..3c61e114f 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_experiment.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_experiment.rs @@ -8,7 +8,7 @@ pub fn de_get_experiment_http_error(_response_status: u16, _response_headers: &: Some(code) => code, None => return Err(crate::operation::get_experiment::GetExperimentError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_experiment::GetExperimentError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_experiment_http_response(_response_status: u16, _response_headers: pub fn ser_get_experiment_headers( input: &crate::operation::get_experiment::GetExperimentInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_experiment_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_experiment_headers( Ok(builder) } -pub(crate) fn de_get_experiment(value: &[u8], mut builder: crate::operation::get_experiment::builders::GetExperimentOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_experiment(_value: &[u8], mut builder: crate::operation::get_experiment::builders::GetExperimentOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -117,7 +119,7 @@ pub(crate) fn de_get_experiment(value: &[u8], mut builder: crate::operation::get } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "created_at" => { @@ -209,7 +211,7 @@ pub(crate) fn de_get_experiment(value: &[u8], mut builder: crate::operation::get } "override_keys" => { builder = builder.set_override_keys( - crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens)? + crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens, _value, depth + 1)? ); } "started_at" => { @@ -244,13 +246,13 @@ pub(crate) fn de_get_experiment(value: &[u8], mut builder: crate::operation::get } "variants" => { builder = builder.set_variants( - crate::protocol_serde::shape_list_variant::de_list_variant(tokens)? + crate::protocol_serde::shape_list_variant::de_list_variant(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_experiment_config.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_experiment_config.rs index 9d2312e4e..6df9624b5 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_experiment_config.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_experiment_config.rs @@ -8,7 +8,7 @@ pub fn de_get_experiment_config_http_error(_response_status: u16, _response_head Some(code) => code, None => return Err(crate::operation::get_experiment_config::GetExperimentConfigError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::get_experiment_config::GetExperimentConfigError::InternalServerError({ @@ -47,12 +47,12 @@ pub fn de_get_experiment_config_http_response(_response_status: u16, _response_h pub fn ser_get_experiment_config_headers( input: &crate::operation::get_experiment_config::GetExperimentConfigInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -64,7 +64,7 @@ pub fn ser_get_experiment_config_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_experiment_config_headers( if let ::std::option::Option::Some(inner_5) = &input.if_modified_since { let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::DateTime)?; let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("if_modified_since", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_get_experiment_config_input(input: &crate::operation::get_experiment_ Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_get_experiment_config(value: &[u8], mut builder: crate::operation::get_experiment_config::builders::GetExperimentConfigOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_experiment_config(_value: &[u8], mut builder: crate::operation::get_experiment_config::builders::GetExperimentConfigOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -107,18 +109,18 @@ pub(crate) fn de_get_experiment_config(value: &[u8], mut builder: crate::operati match key.to_unescaped()?.as_ref() { "experiment_groups" => { builder = builder.set_experiment_groups( - crate::protocol_serde::shape_experiment_group_list::de_experiment_group_list(tokens)? + crate::protocol_serde::shape_experiment_group_list::de_experiment_group_list(tokens, _value, depth + 1)? ); } "experiments" => { builder = builder.set_experiments( - crate::protocol_serde::shape_experiment_list::de_experiment_list(tokens)? + crate::protocol_serde::shape_experiment_list::de_experiment_list(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_experiment_group.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_experiment_group.rs index 669a60450..df3432daa 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_experiment_group.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_experiment_group.rs @@ -8,7 +8,7 @@ pub fn de_get_experiment_group_http_error(_response_status: u16, _response_heade Some(code) => code, None => return Err(crate::operation::get_experiment_group::GetExperimentGroupError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_experiment_group::GetExperimentGroupError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_experiment_group_http_response(_response_status: u16, _response_he pub fn ser_get_experiment_group_headers( input: &crate::operation::get_experiment_group::GetExperimentGroupInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_experiment_group_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_experiment_group_headers( Ok(builder) } -pub(crate) fn de_get_experiment_group(value: &[u8], mut builder: crate::operation::get_experiment_group::builders::GetExperimentGroupOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_experiment_group(_value: &[u8], mut builder: crate::operation::get_experiment_group::builders::GetExperimentGroupOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -99,7 +101,7 @@ pub(crate) fn de_get_experiment_group(value: &[u8], mut builder: crate::operatio match key.to_unescaped()?.as_ref() { "buckets" => { builder = builder.set_buckets( - crate::protocol_serde::shape_buckets::de_buckets(tokens)? + crate::protocol_serde::shape_buckets::de_buckets(tokens, _value, depth + 1)? ); } "change_reason" => { @@ -113,7 +115,7 @@ pub(crate) fn de_get_experiment_group(value: &[u8], mut builder: crate::operatio } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "context_hash" => { @@ -182,7 +184,7 @@ pub(crate) fn de_get_experiment_group(value: &[u8], mut builder: crate::operatio } "member_experiment_ids" => { builder = builder.set_member_experiment_ids( - crate::protocol_serde::shape_string_list::de_string_list(tokens)? + crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)? ); } "name" => { @@ -204,7 +206,7 @@ pub(crate) fn de_get_experiment_group(value: &[u8], mut builder: crate::operatio _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_function.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_function.rs index cd3001407..12e8db6fd 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_function.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_function.rs @@ -8,7 +8,7 @@ pub fn de_get_function_http_error(_response_status: u16, _response_headers: &::a Some(code) => code, None => return Err(crate::operation::get_function::GetFunctionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_function::GetFunctionError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_function_http_response(_response_status: u16, _response_headers: & pub fn ser_get_function_headers( input: &crate::operation::get_function::GetFunctionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_function_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_function_headers( Ok(builder) } -pub(crate) fn de_get_function(value: &[u8], mut builder: crate::operation::get_function::builders::GetFunctionOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_function(_value: &[u8], mut builder: crate::operation::get_function::builders::GetFunctionOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -214,7 +216,7 @@ pub(crate) fn de_get_function(value: &[u8], mut builder: crate::operation::get_f _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_organisation.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_organisation.rs index 2852ea9b7..8037ec6cb 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_organisation.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_organisation.rs @@ -8,7 +8,7 @@ pub fn de_get_organisation_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::get_organisation::GetOrganisationError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_organisation::GetOrganisationError::ResourceNotFound({ @@ -57,9 +57,11 @@ pub fn de_get_organisation_http_response(_response_status: u16, _response_header }) } -pub(crate) fn de_get_organisation(value: &[u8], mut builder: crate::operation::get_organisation::builders::GetOrganisationOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_organisation(_value: &[u8], mut builder: crate::operation::get_organisation::builders::GetOrganisationOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -169,7 +171,7 @@ pub(crate) fn de_get_organisation(value: &[u8], mut builder: crate::operation::g _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config.rs index 9d9a3182a..f4a8e89d9 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config.rs @@ -8,7 +8,7 @@ pub fn de_get_resolved_config_http_error(_response_status: u16, _response_header Some(code) => code, None => return Err(crate::operation::get_resolved_config::GetResolvedConfigError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::get_resolved_config::GetResolvedConfigError::InternalServerError({ @@ -57,12 +57,12 @@ pub fn de_get_resolved_config_http_response(_response_status: u16, _response_hea pub fn ser_get_resolved_config_headers( input: &crate::operation::get_resolved_config::GetResolvedConfigInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -74,7 +74,7 @@ pub fn ser_get_resolved_config_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -86,7 +86,7 @@ pub fn ser_get_resolved_config_headers( if let ::std::option::Option::Some(inner_5) = &input.merge_strategy { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("merge_strategy", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config_explanation.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config_explanation.rs index e0ab0b54e..81f892012 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config_explanation.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config_explanation.rs @@ -8,7 +8,7 @@ pub fn de_get_resolved_config_explanation_http_error(_response_status: u16, _res Some(code) => code, None => return Err(crate::operation::get_resolved_config_explanation::GetResolvedConfigExplanationError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::get_resolved_config_explanation::GetResolvedConfigExplanationError::InternalServerError({ @@ -57,12 +57,12 @@ pub fn de_get_resolved_config_explanation_http_response(_response_status: u16, _ pub fn ser_get_resolved_config_explanation_headers( input: &crate::operation::get_resolved_config_explanation::GetResolvedConfigExplanationInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -74,7 +74,7 @@ pub fn ser_get_resolved_config_explanation_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -86,7 +86,7 @@ pub fn ser_get_resolved_config_explanation_headers( if let ::std::option::Option::Some(inner_5) = &input.merge_strategy { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("merge_strategy", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config_with_identifier.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config_with_identifier.rs index 52ebaed23..eeeb27aea 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config_with_identifier.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_resolved_config_with_identifier.rs @@ -8,7 +8,7 @@ pub fn de_get_resolved_config_with_identifier_http_error(_response_status: u16, Some(code) => code, None => return Err(crate::operation::get_resolved_config_with_identifier::GetResolvedConfigWithIdentifierError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::get_resolved_config_with_identifier::GetResolvedConfigWithIdentifierError::InternalServerError({ @@ -57,12 +57,12 @@ pub fn de_get_resolved_config_with_identifier_http_response(_response_status: u1 pub fn ser_get_resolved_config_with_identifier_headers( input: &crate::operation::get_resolved_config_with_identifier::GetResolvedConfigWithIdentifierInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -74,7 +74,7 @@ pub fn ser_get_resolved_config_with_identifier_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -86,7 +86,7 @@ pub fn ser_get_resolved_config_with_identifier_headers( if let ::std::option::Option::Some(inner_5) = &input.merge_strategy { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("merge_strategy", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_secret.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_secret.rs index fad17d527..008d23f01 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_secret.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_secret.rs @@ -8,7 +8,7 @@ pub fn de_get_secret_http_error(_response_status: u16, _response_headers: &::aws Some(code) => code, None => return Err(crate::operation::get_secret::GetSecretError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_secret::GetSecretError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_secret_http_response(_response_status: u16, _response_headers: &:: pub fn ser_get_secret_headers( input: &crate::operation::get_secret::GetSecretInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_secret_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_secret_headers( Ok(builder) } -pub(crate) fn de_get_secret(value: &[u8], mut builder: crate::operation::get_secret::builders::GetSecretOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_secret(_value: &[u8], mut builder: crate::operation::get_secret::builders::GetSecretOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -155,7 +157,7 @@ pub(crate) fn de_get_secret(value: &[u8], mut builder: crate::operation::get_sec _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_type_template.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_type_template.rs index 03581d91c..f441abae9 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_type_template.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_type_template.rs @@ -8,7 +8,7 @@ pub fn de_get_type_template_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::get_type_template::GetTypeTemplateError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_type_template::GetTypeTemplateError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_type_template_http_response(_response_status: u16, _response_heade pub fn ser_get_type_template_headers( input: &crate::operation::get_type_template::GetTypeTemplateInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_type_template_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_type_template_headers( Ok(builder) } -pub(crate) fn de_get_type_template(value: &[u8], mut builder: crate::operation::get_type_template::builders::GetTypeTemplateOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_type_template(_value: &[u8], mut builder: crate::operation::get_type_template::builders::GetTypeTemplateOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -154,13 +156,13 @@ pub(crate) fn de_get_type_template(value: &[u8], mut builder: crate::operation:: } "type_schema" => { builder = builder.set_type_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_type_templates_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_type_templates_list.rs index a8de36ba7..797cb7725 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_type_templates_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_type_templates_list.rs @@ -8,7 +8,7 @@ pub fn de_get_type_templates_list_http_error(_response_status: u16, _response_he Some(code) => code, None => return Err(crate::operation::get_type_templates_list::GetTypeTemplatesListError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::get_type_templates_list::GetTypeTemplatesListError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_get_type_templates_list_http_response(_response_status: u16, _response pub fn ser_get_type_templates_list_headers( input: &crate::operation::get_type_templates_list::GetTypeTemplatesListInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_get_type_templates_list_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -72,9 +72,11 @@ pub fn ser_get_type_templates_list_headers( Ok(builder) } -pub(crate) fn de_get_type_templates_list(value: &[u8], mut builder: crate::operation::get_type_templates_list::builders::GetTypeTemplatesListOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_type_templates_list(_value: &[u8], mut builder: crate::operation::get_type_templates_list::builders::GetTypeTemplatesListOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -83,7 +85,7 @@ pub(crate) fn de_get_type_templates_list(value: &[u8], mut builder: crate::opera match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_type_templates_list::de_type_templates_list(tokens)? + crate::protocol_serde::shape_type_templates_list::de_type_templates_list(tokens, _value, depth + 1)? ); } "total_items" => { @@ -103,7 +105,7 @@ pub(crate) fn de_get_type_templates_list(value: &[u8], mut builder: crate::opera _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_variable.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_variable.rs index 83cb71daf..7394ce0c6 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_variable.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_variable.rs @@ -8,7 +8,7 @@ pub fn de_get_variable_http_error(_response_status: u16, _response_headers: &::a Some(code) => code, None => return Err(crate::operation::get_variable::GetVariableError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_variable::GetVariableError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_variable_http_response(_response_status: u16, _response_headers: & pub fn ser_get_variable_headers( input: &crate::operation::get_variable::GetVariableInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_variable_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_variable_headers( Ok(builder) } -pub(crate) fn de_get_variable(value: &[u8], mut builder: crate::operation::get_variable::builders::GetVariableOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_variable(_value: &[u8], mut builder: crate::operation::get_variable::builders::GetVariableOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -164,7 +166,7 @@ pub(crate) fn de_get_variable(value: &[u8], mut builder: crate::operation::get_v _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_version.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_version.rs index 2e38a7902..ca4d7ebbc 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_version.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_version.rs @@ -8,7 +8,7 @@ pub fn de_get_version_http_error(_response_status: u16, _response_headers: &::aw Some(code) => code, None => return Err(crate::operation::get_version::GetVersionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_version::GetVersionError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_version_http_response(_response_status: u16, _response_headers: &: pub fn ser_get_version_headers( input: &crate::operation::get_version::GetVersionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_version_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_version_headers( Ok(builder) } -pub(crate) fn de_get_version(value: &[u8], mut builder: crate::operation::get_version::builders::GetVersionOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_version(_value: &[u8], mut builder: crate::operation::get_version::builders::GetVersionOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -99,7 +101,7 @@ pub(crate) fn de_get_version(value: &[u8], mut builder: crate::operation::get_ve match key.to_unescaped()?.as_ref() { "config" => { builder = builder.set_config( - crate::protocol_serde::shape_config_data::de_config_data(tokens)? + crate::protocol_serde::shape_config_data::de_config_data(tokens, _value, depth + 1)? ); } "config_hash" => { @@ -136,13 +138,13 @@ pub(crate) fn de_get_version(value: &[u8], mut builder: crate::operation::get_ve } "tags" => { builder = builder.set_tags( - crate::protocol_serde::shape_string_list::de_string_list(tokens)? + crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_webhook.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_webhook.rs index cdacda13c..363bb0ab4 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_webhook.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_webhook.rs @@ -8,7 +8,7 @@ pub fn de_get_webhook_http_error(_response_status: u16, _response_headers: &::aw Some(code) => code, None => return Err(crate::operation::get_webhook::GetWebhookError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_webhook::GetWebhookError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_webhook_http_response(_response_status: u16, _response_headers: &: pub fn ser_get_webhook_headers( input: &crate::operation::get_webhook::GetWebhookInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_webhook_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_webhook_headers( Ok(builder) } -pub(crate) fn de_get_webhook(value: &[u8], mut builder: crate::operation::get_webhook::builders::GetWebhookOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_webhook(_value: &[u8], mut builder: crate::operation::get_webhook::builders::GetWebhookOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -122,7 +124,7 @@ pub(crate) fn de_get_webhook(value: &[u8], mut builder: crate::operation::get_we } "custom_headers" => { builder = builder.set_custom_headers( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "description" => { @@ -141,7 +143,7 @@ pub(crate) fn de_get_webhook(value: &[u8], mut builder: crate::operation::get_we } "events" => { builder = builder.set_events( - crate::protocol_serde::shape_events::de_events(tokens)? + crate::protocol_serde::shape_events::de_events(tokens, _value, depth + 1)? ); } "last_modified_at" => { @@ -209,7 +211,7 @@ pub(crate) fn de_get_webhook(value: &[u8], mut builder: crate::operation::get_we _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_webhook_by_event.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_webhook_by_event.rs index 82bf72d9b..f5f59cf81 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_webhook_by_event.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_webhook_by_event.rs @@ -8,7 +8,7 @@ pub fn de_get_webhook_by_event_http_error(_response_status: u16, _response_heade Some(code) => code, None => return Err(crate::operation::get_webhook_by_event::GetWebhookByEventError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_webhook_by_event::GetWebhookByEventError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_webhook_by_event_http_response(_response_status: u16, _response_he pub fn ser_get_webhook_by_event_headers( input: &crate::operation::get_webhook_by_event::GetWebhookByEventInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_get_webhook_by_event_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_get_webhook_by_event_headers( Ok(builder) } -pub(crate) fn de_get_webhook_by_event(value: &[u8], mut builder: crate::operation::get_webhook_by_event::builders::GetWebhookByEventOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_webhook_by_event(_value: &[u8], mut builder: crate::operation::get_webhook_by_event::builders::GetWebhookByEventOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -122,7 +124,7 @@ pub(crate) fn de_get_webhook_by_event(value: &[u8], mut builder: crate::operatio } "custom_headers" => { builder = builder.set_custom_headers( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "description" => { @@ -141,7 +143,7 @@ pub(crate) fn de_get_webhook_by_event(value: &[u8], mut builder: crate::operatio } "events" => { builder = builder.set_events( - crate::protocol_serde::shape_events::de_events(tokens)? + crate::protocol_serde::shape_events::de_events(tokens, _value, depth + 1)? ); } "last_modified_at" => { @@ -209,7 +211,7 @@ pub(crate) fn de_get_webhook_by_event(value: &[u8], mut builder: crate::operatio _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_get_workspace.rs b/crates/superposition_sdk/src/protocol_serde/shape_get_workspace.rs index 264e6ea67..d890d15d3 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_get_workspace.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_get_workspace.rs @@ -8,7 +8,7 @@ pub fn de_get_workspace_http_error(_response_status: u16, _response_headers: &:: Some(code) => code, None => return Err(crate::operation::get_workspace::GetWorkspaceError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::get_workspace::GetWorkspaceError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_get_workspace_http_response(_response_status: u16, _response_headers: pub fn ser_get_workspace_headers( input: &crate::operation::get_workspace::GetWorkspaceInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.org_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,9 +76,11 @@ pub fn ser_get_workspace_headers( Ok(builder) } -pub(crate) fn de_get_workspace(value: &[u8], mut builder: crate::operation::get_workspace::builders::GetWorkspaceOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_get_workspace(_value: &[u8], mut builder: crate::operation::get_workspace::builders::GetWorkspaceOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -144,7 +146,7 @@ pub(crate) fn de_get_workspace(value: &[u8], mut builder: crate::operation::get_ } "mandatory_dimensions" => { builder = builder.set_mandatory_dimensions( - crate::protocol_serde::shape_list_mandatory_dimensions::de_list_mandatory_dimensions(tokens)? + crate::protocol_serde::shape_list_mandatory_dimensions::de_list_mandatory_dimensions(tokens, _value, depth + 1)? ); } "metrics" => { @@ -181,7 +183,7 @@ pub(crate) fn de_get_workspace(value: &[u8], mut builder: crate::operation::get_ } "workspace_lock" => { builder = builder.set_workspace_lock( - crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens)? + crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens, _value, depth + 1)? ); } "workspace_name" => { @@ -214,7 +216,7 @@ pub(crate) fn de_get_workspace(value: &[u8], mut builder: crate::operation::get_ _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_internal_server_error.rs b/crates/superposition_sdk/src/protocol_serde/shape_internal_server_error.rs index cec23811a..0ff3ce850 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_internal_server_error.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_internal_server_error.rs @@ -1,7 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_internal_server_error_json_err(value: &[u8], mut builder: crate::types::error::builders::InternalServerErrorBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_internal_server_error_json_err(_value: &[u8], mut builder: crate::types::error::builders::InternalServerErrorBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -20,7 +22,7 @@ pub(crate) fn de_internal_server_error_json_err(value: &[u8], mut builder: crate _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_audit_logs.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_audit_logs.rs index fcdc5d57e..1a5cb2c17 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_audit_logs.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_audit_logs.rs @@ -8,7 +8,7 @@ pub fn de_list_audit_logs_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::list_audit_logs::ListAuditLogsError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_audit_logs::ListAuditLogsError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_list_audit_logs_http_response(_response_status: u16, _response_headers pub fn ser_list_audit_logs_headers( input: &crate::operation::list_audit_logs::ListAuditLogsInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_list_audit_logs_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -72,9 +72,11 @@ pub fn ser_list_audit_logs_headers( Ok(builder) } -pub(crate) fn de_list_audit_logs(value: &[u8], mut builder: crate::operation::list_audit_logs::builders::ListAuditLogsOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_audit_logs(_value: &[u8], mut builder: crate::operation::list_audit_logs::builders::ListAuditLogsOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -83,7 +85,7 @@ pub(crate) fn de_list_audit_logs(value: &[u8], mut builder: crate::operation::li match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_audit_log_list::de_audit_log_list(tokens)? + crate::protocol_serde::shape_audit_log_list::de_audit_log_list(tokens, _value, depth + 1)? ); } "total_items" => { @@ -103,7 +105,7 @@ pub(crate) fn de_list_audit_logs(value: &[u8], mut builder: crate::operation::li _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_context_out.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_context_out.rs index c3259eb7d..d41626c16 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_context_out.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_context_out.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_list_context_out<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_list_context_out<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_list_context_out<'a, I>(tokens: &mut ::std::iter::Peekable) } _ => { let value = - crate::protocol_serde::shape_context_response::de_context_response(tokens)? + crate::protocol_serde::shape_context_response::de_context_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_contexts.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_contexts.rs index 77fd246be..69db36465 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_contexts.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_contexts.rs @@ -8,7 +8,7 @@ pub fn de_list_contexts_http_error(_response_status: u16, _response_headers: &:: Some(code) => code, None => return Err(crate::operation::list_contexts::ListContextsError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_contexts::ListContextsError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_list_contexts_http_response(_response_status: u16, _response_headers: pub fn ser_list_contexts_headers( input: &crate::operation::list_contexts::ListContextsInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_list_contexts_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -72,9 +72,11 @@ pub fn ser_list_contexts_headers( Ok(builder) } -pub(crate) fn de_list_contexts(value: &[u8], mut builder: crate::operation::list_contexts::builders::ListContextsOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_contexts(_value: &[u8], mut builder: crate::operation::list_contexts::builders::ListContextsOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -83,7 +85,7 @@ pub(crate) fn de_list_contexts(value: &[u8], mut builder: crate::operation::list match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_list_context_out::de_list_context_out(tokens)? + crate::protocol_serde::shape_list_context_out::de_list_context_out(tokens, _value, depth + 1)? ); } "total_items" => { @@ -103,7 +105,7 @@ pub(crate) fn de_list_contexts(value: &[u8], mut builder: crate::operation::list _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_default_config_out.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_default_config_out.rs index 9b2d8e6ff..bae4612f6 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_default_config_out.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_default_config_out.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_list_default_config_out<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_list_default_config_out<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_list_default_config_out<'a, I>(tokens: &mut ::std::iter::Peekab } _ => { let value = - crate::protocol_serde::shape_default_config_response::de_default_config_response(tokens)? + crate::protocol_serde::shape_default_config_response::de_default_config_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_default_configs.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_default_configs.rs index 0cb6dcf4c..932690192 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_default_configs.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_default_configs.rs @@ -8,7 +8,7 @@ pub fn de_list_default_configs_http_error(_response_status: u16, _response_heade Some(code) => code, None => return Err(crate::operation::list_default_configs::ListDefaultConfigsError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_default_configs::ListDefaultConfigsError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_list_default_configs_http_response(_response_status: u16, _response_he pub fn ser_list_default_configs_headers( input: &crate::operation::list_default_configs::ListDefaultConfigsInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_list_default_configs_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -72,9 +72,11 @@ pub fn ser_list_default_configs_headers( Ok(builder) } -pub(crate) fn de_list_default_configs(value: &[u8], mut builder: crate::operation::list_default_configs::builders::ListDefaultConfigsOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_default_configs(_value: &[u8], mut builder: crate::operation::list_default_configs::builders::ListDefaultConfigsOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -83,7 +85,7 @@ pub(crate) fn de_list_default_configs(value: &[u8], mut builder: crate::operatio match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_list_default_config_out::de_list_default_config_out(tokens)? + crate::protocol_serde::shape_list_default_config_out::de_list_default_config_out(tokens, _value, depth + 1)? ); } "total_items" => { @@ -103,7 +105,7 @@ pub(crate) fn de_list_default_configs(value: &[u8], mut builder: crate::operatio _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_dimensions.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_dimensions.rs index 51bf78509..93332df1c 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_dimensions.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_dimensions.rs @@ -8,7 +8,7 @@ pub fn de_list_dimensions_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::list_dimensions::ListDimensionsError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_dimensions::ListDimensionsError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_list_dimensions_http_response(_response_status: u16, _response_headers pub fn ser_list_dimensions_headers( input: &crate::operation::list_dimensions::ListDimensionsInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_list_dimensions_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -72,9 +72,11 @@ pub fn ser_list_dimensions_headers( Ok(builder) } -pub(crate) fn de_list_dimensions(value: &[u8], mut builder: crate::operation::list_dimensions::builders::ListDimensionsOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_dimensions(_value: &[u8], mut builder: crate::operation::list_dimensions::builders::ListDimensionsOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -83,7 +85,7 @@ pub(crate) fn de_list_dimensions(value: &[u8], mut builder: crate::operation::li match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_dimension_list::de_dimension_list(tokens)? + crate::protocol_serde::shape_dimension_list::de_dimension_list(tokens, _value, depth + 1)? ); } "total_items" => { @@ -103,7 +105,7 @@ pub(crate) fn de_list_dimensions(value: &[u8], mut builder: crate::operation::li _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_experiment.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_experiment.rs index 43cd98cca..75094c88e 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_experiment.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_experiment.rs @@ -8,7 +8,7 @@ pub fn de_list_experiment_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::list_experiment::ListExperimentError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_experiment::ListExperimentError::InternalServerError({ @@ -47,12 +47,12 @@ pub fn de_list_experiment_http_response(_response_status: u16, _response_headers pub fn ser_list_experiment_headers( input: &crate::operation::list_experiment::ListExperimentInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -64,7 +64,7 @@ pub fn ser_list_experiment_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_list_experiment_headers( if let ::std::option::Option::Some(inner_5) = &input.if_modified_since { let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::DateTime)?; let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("if_modified_since", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_list_experiment_input(input: &crate::operation::list_experiment::List Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_list_experiment(value: &[u8], mut builder: crate::operation::list_experiment::builders::ListExperimentOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_experiment(_value: &[u8], mut builder: crate::operation::list_experiment::builders::ListExperimentOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -107,7 +109,7 @@ pub(crate) fn de_list_experiment(value: &[u8], mut builder: crate::operation::li match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_experiment_list::de_experiment_list(tokens)? + crate::protocol_serde::shape_experiment_list::de_experiment_list(tokens, _value, depth + 1)? ); } "total_items" => { @@ -127,7 +129,7 @@ pub(crate) fn de_list_experiment(value: &[u8], mut builder: crate::operation::li _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_experiment_groups.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_experiment_groups.rs index 0ec5ea3a9..be46e4c4e 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_experiment_groups.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_experiment_groups.rs @@ -8,7 +8,7 @@ pub fn de_list_experiment_groups_http_error(_response_status: u16, _response_hea Some(code) => code, None => return Err(crate::operation::list_experiment_groups::ListExperimentGroupsError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_experiment_groups::ListExperimentGroupsError::InternalServerError({ @@ -47,12 +47,12 @@ pub fn de_list_experiment_groups_http_response(_response_status: u16, _response_ pub fn ser_list_experiment_groups_headers( input: &crate::operation::list_experiment_groups::ListExperimentGroupsInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -64,7 +64,7 @@ pub fn ser_list_experiment_groups_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_list_experiment_groups_headers( if let ::std::option::Option::Some(inner_5) = &input.if_modified_since { let formatted_6 = inner_5.fmt(::aws_smithy_types::date_time::Format::DateTime)?; let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("if_modified_since", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_list_experiment_groups_input(input: &crate::operation::list_experimen Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_list_experiment_groups(value: &[u8], mut builder: crate::operation::list_experiment_groups::builders::ListExperimentGroupsOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_experiment_groups(_value: &[u8], mut builder: crate::operation::list_experiment_groups::builders::ListExperimentGroupsOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -107,7 +109,7 @@ pub(crate) fn de_list_experiment_groups(value: &[u8], mut builder: crate::operat match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_experiment_group_list::de_experiment_group_list(tokens)? + crate::protocol_serde::shape_experiment_group_list::de_experiment_group_list(tokens, _value, depth + 1)? ); } "total_items" => { @@ -127,7 +129,7 @@ pub(crate) fn de_list_experiment_groups(value: &[u8], mut builder: crate::operat _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_function.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_function.rs index 51c1cfec2..7b0921420 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_function.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_function.rs @@ -8,7 +8,7 @@ pub fn de_list_function_http_error(_response_status: u16, _response_headers: &:: Some(code) => code, None => return Err(crate::operation::list_function::ListFunctionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_function::ListFunctionError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_list_function_http_response(_response_status: u16, _response_headers: pub fn ser_list_function_headers( input: &crate::operation::list_function::ListFunctionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_list_function_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -72,9 +72,11 @@ pub fn ser_list_function_headers( Ok(builder) } -pub(crate) fn de_list_function(value: &[u8], mut builder: crate::operation::list_function::builders::ListFunctionOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_function(_value: &[u8], mut builder: crate::operation::list_function::builders::ListFunctionOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -83,7 +85,7 @@ pub(crate) fn de_list_function(value: &[u8], mut builder: crate::operation::list match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_function_list_response::de_function_list_response(tokens)? + crate::protocol_serde::shape_function_list_response::de_function_list_response(tokens, _value, depth + 1)? ); } "total_items" => { @@ -103,7 +105,7 @@ pub(crate) fn de_list_function(value: &[u8], mut builder: crate::operation::list _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_mandatory_dimensions.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_mandatory_dimensions.rs index 47d5aeeea..b93f977a9 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_mandatory_dimensions.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_mandatory_dimensions.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_list_mandatory_dimensions<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_list_mandatory_dimensions<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -20,6 +23,8 @@ pub(crate) fn de_list_mandatory_dimensions<'a, I>(tokens: &mut ::std::iter::Peek ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_organisation.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_organisation.rs index c108e73e2..ff8e72b9e 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_organisation.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_organisation.rs @@ -8,7 +8,7 @@ pub fn de_list_organisation_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::list_organisation::ListOrganisationError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_organisation::ListOrganisationError::InternalServerError({ @@ -41,9 +41,11 @@ pub fn de_list_organisation_http_response(_response_status: u16, _response_heade }) } -pub(crate) fn de_list_organisation(value: &[u8], mut builder: crate::operation::list_organisation::builders::ListOrganisationOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_organisation(_value: &[u8], mut builder: crate::operation::list_organisation::builders::ListOrganisationOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -52,7 +54,7 @@ pub(crate) fn de_list_organisation(value: &[u8], mut builder: crate::operation:: match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_organisation_list::de_organisation_list(tokens)? + crate::protocol_serde::shape_organisation_list::de_organisation_list(tokens, _value, depth + 1)? ); } "total_items" => { @@ -72,7 +74,7 @@ pub(crate) fn de_list_organisation(value: &[u8], mut builder: crate::operation:: _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_override_keys.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_override_keys.rs index dd03d06a5..07fb393b5 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_override_keys.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_override_keys.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_list_override_keys<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_list_override_keys<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -20,6 +23,8 @@ pub(crate) fn de_list_override_keys<'a, I>(tokens: &mut ::std::iter::Peekable ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_secrets.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_secrets.rs index b72eb53d0..5094faf2c 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_secrets.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_secrets.rs @@ -8,7 +8,7 @@ pub fn de_list_secrets_http_error(_response_status: u16, _response_headers: &::a Some(code) => code, None => return Err(crate::operation::list_secrets::ListSecretsError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_secrets::ListSecretsError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_list_secrets_http_response(_response_status: u16, _response_headers: & pub fn ser_list_secrets_headers( input: &crate::operation::list_secrets::ListSecretsInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_list_secrets_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -72,9 +72,11 @@ pub fn ser_list_secrets_headers( Ok(builder) } -pub(crate) fn de_list_secrets(value: &[u8], mut builder: crate::operation::list_secrets::builders::ListSecretsOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_secrets(_value: &[u8], mut builder: crate::operation::list_secrets::builders::ListSecretsOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -83,7 +85,7 @@ pub(crate) fn de_list_secrets(value: &[u8], mut builder: crate::operation::list_ match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_secret_list::de_secret_list(tokens)? + crate::protocol_serde::shape_secret_list::de_secret_list(tokens, _value, depth + 1)? ); } "total_items" => { @@ -103,7 +105,7 @@ pub(crate) fn de_list_secrets(value: &[u8], mut builder: crate::operation::list_ _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_variables.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_variables.rs index d678c1eae..0f69a29c0 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_variables.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_variables.rs @@ -8,7 +8,7 @@ pub fn de_list_variables_http_error(_response_status: u16, _response_headers: &: Some(code) => code, None => return Err(crate::operation::list_variables::ListVariablesError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_variables::ListVariablesError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_list_variables_http_response(_response_status: u16, _response_headers: pub fn ser_list_variables_headers( input: &crate::operation::list_variables::ListVariablesInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_list_variables_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -72,9 +72,11 @@ pub fn ser_list_variables_headers( Ok(builder) } -pub(crate) fn de_list_variables(value: &[u8], mut builder: crate::operation::list_variables::builders::ListVariablesOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_variables(_value: &[u8], mut builder: crate::operation::list_variables::builders::ListVariablesOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -83,7 +85,7 @@ pub(crate) fn de_list_variables(value: &[u8], mut builder: crate::operation::lis match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_variable_list::de_variable_list(tokens)? + crate::protocol_serde::shape_variable_list::de_variable_list(tokens, _value, depth + 1)? ); } "total_items" => { @@ -103,7 +105,7 @@ pub(crate) fn de_list_variables(value: &[u8], mut builder: crate::operation::lis _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_variant.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_variant.rs index 4f5df94d1..26b95fed6 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_variant.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_variant.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_list_variant<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_list_variant<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_list_variant<'a, I>(tokens: &mut ::std::iter::Peekable) -> : } _ => { let value = - crate::protocol_serde::shape_variant::de_variant(tokens)? + crate::protocol_serde::shape_variant::de_variant(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_versions.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_versions.rs index 1c2021758..3e2c4bc80 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_versions.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_versions.rs @@ -8,7 +8,7 @@ pub fn de_list_versions_http_error(_response_status: u16, _response_headers: &:: Some(code) => code, None => return Err(crate::operation::list_versions::ListVersionsError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_versions::ListVersionsError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_list_versions_http_response(_response_status: u16, _response_headers: pub fn ser_list_versions_headers( input: &crate::operation::list_versions::ListVersionsInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_list_versions_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -72,9 +72,11 @@ pub fn ser_list_versions_headers( Ok(builder) } -pub(crate) fn de_list_versions(value: &[u8], mut builder: crate::operation::list_versions::builders::ListVersionsOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_versions(_value: &[u8], mut builder: crate::operation::list_versions::builders::ListVersionsOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -83,7 +85,7 @@ pub(crate) fn de_list_versions(value: &[u8], mut builder: crate::operation::list match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_list_versions_out::de_list_versions_out(tokens)? + crate::protocol_serde::shape_list_versions_out::de_list_versions_out(tokens, _value, depth + 1)? ); } "total_items" => { @@ -103,7 +105,7 @@ pub(crate) fn de_list_versions(value: &[u8], mut builder: crate::operation::list _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_versions_member.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_versions_member.rs index 86492aa12..5df4dc84d 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_versions_member.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_versions_member.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_list_versions_member<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_list_versions_member<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -22,7 +25,7 @@ pub(crate) fn de_list_versions_member<'a, I>(tokens: &mut ::std::iter::Peekable< } "config" => { builder = builder.set_config( - crate::protocol_serde::shape_config_data::de_config_data(tokens)? + crate::protocol_serde::shape_config_data::de_config_data(tokens, _value, depth + 1)? ); } "created_at" => { @@ -41,13 +44,13 @@ pub(crate) fn de_list_versions_member<'a, I>(tokens: &mut ::std::iter::Peekable< } "tags" => { builder = builder.set_tags( - crate::protocol_serde::shape_string_list::de_string_list(tokens)? + crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::list_versions_member_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_versions_out.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_versions_out.rs index 7d5278f50..2d87a4e61 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_versions_out.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_versions_out.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_list_versions_out<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_list_versions_out<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_list_versions_out<'a, I>(tokens: &mut ::std::iter::Peekable) } _ => { let value = - crate::protocol_serde::shape_list_versions_member::de_list_versions_member(tokens)? + crate::protocol_serde::shape_list_versions_member::de_list_versions_member(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_webhook.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_webhook.rs index 9d340ad30..da1342f38 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_webhook.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_webhook.rs @@ -8,7 +8,7 @@ pub fn de_list_webhook_http_error(_response_status: u16, _response_headers: &::a Some(code) => code, None => return Err(crate::operation::list_webhook::ListWebhookError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_webhook::ListWebhookError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_list_webhook_http_response(_response_status: u16, _response_headers: & pub fn ser_list_webhook_headers( input: &crate::operation::list_webhook::ListWebhookInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,7 +60,7 @@ pub fn ser_list_webhook_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -72,9 +72,11 @@ pub fn ser_list_webhook_headers( Ok(builder) } -pub(crate) fn de_list_webhook(value: &[u8], mut builder: crate::operation::list_webhook::builders::ListWebhookOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_webhook(_value: &[u8], mut builder: crate::operation::list_webhook::builders::ListWebhookOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -83,7 +85,7 @@ pub(crate) fn de_list_webhook(value: &[u8], mut builder: crate::operation::list_ match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_webhook_list::de_webhook_list(tokens)? + crate::protocol_serde::shape_webhook_list::de_webhook_list(tokens, _value, depth + 1)? ); } "total_items" => { @@ -103,7 +105,7 @@ pub(crate) fn de_list_webhook(value: &[u8], mut builder: crate::operation::list_ _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_list_workspace.rs b/crates/superposition_sdk/src/protocol_serde/shape_list_workspace.rs index 39291909c..75ddd9660 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_list_workspace.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_list_workspace.rs @@ -8,7 +8,7 @@ pub fn de_list_workspace_http_error(_response_status: u16, _response_headers: &: Some(code) => code, None => return Err(crate::operation::list_workspace::ListWorkspaceError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::list_workspace::ListWorkspaceError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_list_workspace_http_response(_response_status: u16, _response_headers: pub fn ser_list_workspace_headers( input: &crate::operation::list_workspace::ListWorkspaceInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.org_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,9 +60,11 @@ pub fn ser_list_workspace_headers( Ok(builder) } -pub(crate) fn de_list_workspace(value: &[u8], mut builder: crate::operation::list_workspace::builders::ListWorkspaceOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_list_workspace(_value: &[u8], mut builder: crate::operation::list_workspace::builders::ListWorkspaceOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -71,7 +73,7 @@ pub(crate) fn de_list_workspace(value: &[u8], mut builder: crate::operation::lis match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_workspace_list::de_workspace_list(tokens)? + crate::protocol_serde::shape_workspace_list::de_workspace_list(tokens, _value, depth + 1)? ); } "total_items" => { @@ -91,7 +93,7 @@ pub(crate) fn de_list_workspace(value: &[u8], mut builder: crate::operation::lis _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_migrate_workspace_schema.rs b/crates/superposition_sdk/src/protocol_serde/shape_migrate_workspace_schema.rs index e56e05db2..bb7ecad55 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_migrate_workspace_schema.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_migrate_workspace_schema.rs @@ -8,7 +8,7 @@ pub fn de_migrate_workspace_schema_http_error(_response_status: u16, _response_h Some(code) => code, None => return Err(crate::operation::migrate_workspace_schema::MigrateWorkspaceSchemaError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::migrate_workspace_schema::MigrateWorkspaceSchemaError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_migrate_workspace_schema_http_response(_response_status: u16, _respons pub fn ser_migrate_workspace_schema_headers( input: &crate::operation::migrate_workspace_schema::MigrateWorkspaceSchemaInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.org_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,9 +76,11 @@ pub fn ser_migrate_workspace_schema_headers( Ok(builder) } -pub(crate) fn de_migrate_workspace_schema(value: &[u8], mut builder: crate::operation::migrate_workspace_schema::builders::MigrateWorkspaceSchemaOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_migrate_workspace_schema(_value: &[u8], mut builder: crate::operation::migrate_workspace_schema::builders::MigrateWorkspaceSchemaOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -144,7 +146,7 @@ pub(crate) fn de_migrate_workspace_schema(value: &[u8], mut builder: crate::oper } "mandatory_dimensions" => { builder = builder.set_mandatory_dimensions( - crate::protocol_serde::shape_list_mandatory_dimensions::de_list_mandatory_dimensions(tokens)? + crate::protocol_serde::shape_list_mandatory_dimensions::de_list_mandatory_dimensions(tokens, _value, depth + 1)? ); } "metrics" => { @@ -181,7 +183,7 @@ pub(crate) fn de_migrate_workspace_schema(value: &[u8], mut builder: crate::oper } "workspace_lock" => { builder = builder.set_workspace_lock( - crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens)? + crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens, _value, depth + 1)? ); } "workspace_name" => { @@ -214,7 +216,7 @@ pub(crate) fn de_migrate_workspace_schema(value: &[u8], mut builder: crate::oper _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_move_context.rs b/crates/superposition_sdk/src/protocol_serde/shape_move_context.rs index f3e6744cf..78d425dd5 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_move_context.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_move_context.rs @@ -8,7 +8,7 @@ pub fn de_move_context_http_error(_response_status: u16, _response_headers: &::a Some(code) => code, None => return Err(crate::operation::move_context::MoveContextError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::move_context::MoveContextError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_move_context_http_response(_response_status: u16, _response_headers: & pub fn ser_move_context_headers( input: &crate::operation::move_context::MoveContextInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_move_context_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -104,9 +104,11 @@ pub fn ser_move_context_headers( Ok(builder) } -pub(crate) fn de_move_context(value: &[u8], mut builder: crate::operation::move_context::builders::MoveContextOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_move_context(_value: &[u8], mut builder: crate::operation::move_context::builders::MoveContextOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -170,7 +172,7 @@ pub(crate) fn de_move_context(value: &[u8], mut builder: crate::operation::move_ } "override" => { builder = builder.set_override( - crate::protocol_serde::shape_overrides::de_overrides(tokens)? + crate::protocol_serde::shape_overrides::de_overrides(tokens, _value, depth + 1)? ); } "override_id" => { @@ -184,7 +186,7 @@ pub(crate) fn de_move_context(value: &[u8], mut builder: crate::operation::move_ } "value" => { builder = builder.set_value( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "weight" => { @@ -199,7 +201,7 @@ pub(crate) fn de_move_context(value: &[u8], mut builder: crate::operation::move_ _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_object.rs b/crates/superposition_sdk/src/protocol_serde/shape_object.rs index 83f1bb3f6..e3f2f5203 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_object.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_object.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_object<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_object<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -17,11 +20,12 @@ pub(crate) fn de_object<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std:: let value = Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?) ; - if let Some(value) = value { - map.insert(key, value); - } + match value { + Some(value) => { map.insert(key, value); } + None => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense map cannot contain null values")) + } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(map)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_organisation_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_organisation_list.rs index a55573074..f8f9d5265 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_organisation_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_organisation_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_organisation_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_organisation_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_organisation_list<'a, I>(tokens: &mut ::std::iter::Peekable) } _ => { let value = - crate::protocol_serde::shape_organisation_response::de_organisation_response(tokens)? + crate::protocol_serde::shape_organisation_response::de_organisation_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_organisation_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_organisation_response.rs index 54b91304d..2b8bf5161 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_organisation_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_organisation_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_organisation_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_organisation_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -114,7 +117,7 @@ pub(crate) fn de_organisation_response<'a, I>(tokens: &mut ::std::iter::Peekable _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::organisation_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_override_with_keys.rs b/crates/superposition_sdk/src/protocol_serde/shape_override_with_keys.rs index a7c803beb..0b2545673 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_override_with_keys.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_override_with_keys.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_override_with_keys<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_override_with_keys<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -20,6 +23,8 @@ pub(crate) fn de_override_with_keys<'a, I>(tokens: &mut ::std::iter::Peekable ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_overrides.rs b/crates/superposition_sdk/src/protocol_serde/shape_overrides.rs index 18d9ad872..40611bedc 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_overrides.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_overrides.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_overrides<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_overrides<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -17,11 +20,12 @@ pub(crate) fn de_overrides<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::st let value = Some(::aws_smithy_json::deserialize::token::expect_document(tokens)?) ; - if let Some(value) = value { - map.insert(key, value); - } + match value { + Some(value) => { map.insert(key, value); } + None => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense map cannot contain null values")) + } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(map)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_overrides_map.rs b/crates/superposition_sdk/src/protocol_serde/shape_overrides_map.rs index 255630c39..2d9956c2c 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_overrides_map.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_overrides_map.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_overrides_map<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_overrides_map<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -15,13 +18,14 @@ pub(crate) fn de_overrides_map<'a, I>(tokens: &mut ::std::iter::Peekable) -> ) ?; let value = - crate::protocol_serde::shape_overrides::de_overrides(tokens)? + crate::protocol_serde::shape_overrides::de_overrides(tokens, _value, depth + 1)? ; - if let Some(value) = value { - map.insert(key, value); - } + match value { + Some(value) => { map.insert(key, value); } + None => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense map cannot contain null values")) + } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(map)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_pause_experiment.rs b/crates/superposition_sdk/src/protocol_serde/shape_pause_experiment.rs index 4b977eacf..8bc335ffe 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_pause_experiment.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_pause_experiment.rs @@ -8,7 +8,7 @@ pub fn de_pause_experiment_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::pause_experiment::PauseExperimentError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::pause_experiment::PauseExperimentError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_pause_experiment_http_response(_response_status: u16, _response_header pub fn ser_pause_experiment_headers( input: &crate::operation::pause_experiment::PauseExperimentInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_pause_experiment_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -112,9 +112,11 @@ pub fn ser_pause_experiment_input(input: &crate::operation::pause_experiment::Pa Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_pause_experiment(value: &[u8], mut builder: crate::operation::pause_experiment::builders::PauseExperimentOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_pause_experiment(_value: &[u8], mut builder: crate::operation::pause_experiment::builders::PauseExperimentOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -141,7 +143,7 @@ pub(crate) fn de_pause_experiment(value: &[u8], mut builder: crate::operation::p } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "created_at" => { @@ -233,7 +235,7 @@ pub(crate) fn de_pause_experiment(value: &[u8], mut builder: crate::operation::p } "override_keys" => { builder = builder.set_override_keys( - crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens)? + crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens, _value, depth + 1)? ); } "started_at" => { @@ -268,13 +270,13 @@ pub(crate) fn de_pause_experiment(value: &[u8], mut builder: crate::operation::p } "variants" => { builder = builder.set_variants( - crate::protocol_serde::shape_list_variant::de_list_variant(tokens)? + crate::protocol_serde::shape_list_variant::de_list_variant(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_publish.rs b/crates/superposition_sdk/src/protocol_serde/shape_publish.rs index 59ca00690..0b22a5912 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_publish.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_publish.rs @@ -8,7 +8,7 @@ pub fn de_publish_http_error(_response_status: u16, _response_headers: &::aws_sm Some(code) => code, None => return Err(crate::operation::publish::PublishError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::publish::PublishError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_publish_http_response(_response_status: u16, _response_headers: &::aws pub fn ser_publish_headers( input: &crate::operation::publish::PublishInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_publish_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_publish_input(input: &crate::operation::publish::PublishInput) -> ::s Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_publish(value: &[u8], mut builder: crate::operation::publish::builders::PublishOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_publish(_value: &[u8], mut builder: crate::operation::publish::builders::PublishOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -222,7 +224,7 @@ pub(crate) fn de_publish(value: &[u8], mut builder: crate::operation::publish::b _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_ramp_experiment.rs b/crates/superposition_sdk/src/protocol_serde/shape_ramp_experiment.rs index ffe49602c..cff9a5996 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_ramp_experiment.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_ramp_experiment.rs @@ -8,7 +8,7 @@ pub fn de_ramp_experiment_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::ramp_experiment::RampExperimentError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::ramp_experiment::RampExperimentError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_ramp_experiment_http_response(_response_status: u16, _response_headers pub fn ser_ramp_experiment_headers( input: &crate::operation::ramp_experiment::RampExperimentInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_ramp_experiment_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -112,9 +112,11 @@ pub fn ser_ramp_experiment_input(input: &crate::operation::ramp_experiment::Ramp Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_ramp_experiment(value: &[u8], mut builder: crate::operation::ramp_experiment::builders::RampExperimentOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_ramp_experiment(_value: &[u8], mut builder: crate::operation::ramp_experiment::builders::RampExperimentOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -141,7 +143,7 @@ pub(crate) fn de_ramp_experiment(value: &[u8], mut builder: crate::operation::ra } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "created_at" => { @@ -233,7 +235,7 @@ pub(crate) fn de_ramp_experiment(value: &[u8], mut builder: crate::operation::ra } "override_keys" => { builder = builder.set_override_keys( - crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens)? + crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens, _value, depth + 1)? ); } "started_at" => { @@ -268,13 +270,13 @@ pub(crate) fn de_ramp_experiment(value: &[u8], mut builder: crate::operation::ra } "variants" => { builder = builder.set_variants( - crate::protocol_serde::shape_list_variant::de_list_variant(tokens)? + crate::protocol_serde::shape_list_variant::de_list_variant(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_remove_members_from_group.rs b/crates/superposition_sdk/src/protocol_serde/shape_remove_members_from_group.rs index 689668e63..b7c9d9b98 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_remove_members_from_group.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_remove_members_from_group.rs @@ -8,7 +8,7 @@ pub fn de_remove_members_from_group_http_error(_response_status: u16, _response_ Some(code) => code, None => return Err(crate::operation::remove_members_from_group::RemoveMembersFromGroupError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::remove_members_from_group::RemoveMembersFromGroupError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_remove_members_from_group_http_response(_response_status: u16, _respon pub fn ser_remove_members_from_group_headers( input: &crate::operation::remove_members_from_group::RemoveMembersFromGroupInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_remove_members_from_group_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_remove_members_from_group_input(input: &crate::operation::remove_memb Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_remove_members_from_group(value: &[u8], mut builder: crate::operation::remove_members_from_group::builders::RemoveMembersFromGroupOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_remove_members_from_group(_value: &[u8], mut builder: crate::operation::remove_members_from_group::builders::RemoveMembersFromGroupOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -107,7 +109,7 @@ pub(crate) fn de_remove_members_from_group(value: &[u8], mut builder: crate::ope match key.to_unescaped()?.as_ref() { "buckets" => { builder = builder.set_buckets( - crate::protocol_serde::shape_buckets::de_buckets(tokens)? + crate::protocol_serde::shape_buckets::de_buckets(tokens, _value, depth + 1)? ); } "change_reason" => { @@ -121,7 +123,7 @@ pub(crate) fn de_remove_members_from_group(value: &[u8], mut builder: crate::ope } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "context_hash" => { @@ -190,7 +192,7 @@ pub(crate) fn de_remove_members_from_group(value: &[u8], mut builder: crate::ope } "member_experiment_ids" => { builder = builder.set_member_experiment_ids( - crate::protocol_serde::shape_string_list::de_string_list(tokens)? + crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)? ); } "name" => { @@ -212,7 +214,7 @@ pub(crate) fn de_remove_members_from_group(value: &[u8], mut builder: crate::ope _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation.rs b/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation.rs index 1ae7395da..83cb1c064 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation.rs @@ -1,9 +1,11 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_resolve_explanation_payload(input: &[u8]) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(input)).peekable(); +pub(crate) fn de_resolve_explanation_payload(_value: &[u8]) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; let result = - crate::protocol_serde::shape_resolve_explanation::de_resolve_explanation(tokens)? + crate::protocol_serde::shape_resolve_explanation::de_resolve_explanation(tokens, _value, depth + 1)? .ok_or_else(|| ::aws_smithy_json::deserialize::error::DeserializeError::custom("expected payload member value")); if tokens.next().is_some() { return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("found more JSON tokens after completing parsing")); @@ -11,8 +13,11 @@ pub(crate) fn de_resolve_explanation_payload(input: &[u8]) -> ::std::result::Res result } -pub(crate) fn de_resolve_explanation<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_resolve_explanation<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -34,13 +39,13 @@ pub(crate) fn de_resolve_explanation<'a, I>(tokens: &mut ::std::iter::Peekable { builder = builder.set_timeline( - crate::protocol_serde::shape_resolve_explanation_timeline::de_resolve_explanation_timeline(tokens)? + crate::protocol_serde::shape_resolve_explanation_timeline::de_resolve_explanation_timeline(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::resolve_explanation_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation_timeline.rs b/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation_timeline.rs index 5595a1e3a..1787a1e82 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation_timeline.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation_timeline.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_resolve_explanation_timeline<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_resolve_explanation_timeline<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_resolve_explanation_timeline<'a, I>(tokens: &mut ::std::iter::P } _ => { let value = - crate::protocol_serde::shape_resolve_explanation_timeline_item::de_resolve_explanation_timeline_item(tokens)? + crate::protocol_serde::shape_resolve_explanation_timeline_item::de_resolve_explanation_timeline_item(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation_timeline_item.rs b/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation_timeline_item.rs index 4282a0b8b..8d0596517 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation_timeline_item.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_resolve_explanation_timeline_item.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_resolve_explanation_timeline_item<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_resolve_explanation_timeline_item<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -22,7 +25,7 @@ pub(crate) fn de_resolve_explanation_timeline_item<'a, I>(tokens: &mut ::std::it } "condition" => { builder = builder.set_condition( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "override_id" => { @@ -47,7 +50,7 @@ pub(crate) fn de_resolve_explanation_timeline_item<'a, I>(tokens: &mut ::std::it _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::resolve_explanation_timeline_item_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_resource_not_found.rs b/crates/superposition_sdk/src/protocol_serde/shape_resource_not_found.rs index 9b1bc9882..10036c8f1 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_resource_not_found.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_resource_not_found.rs @@ -1,7 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_resource_not_found_json_err(value: &[u8], mut builder: crate::types::error::builders::ResourceNotFoundBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_resource_not_found_json_err(_value: &[u8], mut builder: crate::types::error::builders::ResourceNotFoundBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -20,7 +22,7 @@ pub(crate) fn de_resource_not_found_json_err(value: &[u8], mut builder: crate::t _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_resume_experiment.rs b/crates/superposition_sdk/src/protocol_serde/shape_resume_experiment.rs index 7eb751780..fa3790337 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_resume_experiment.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_resume_experiment.rs @@ -8,7 +8,7 @@ pub fn de_resume_experiment_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::resume_experiment::ResumeExperimentError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::resume_experiment::ResumeExperimentError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_resume_experiment_http_response(_response_status: u16, _response_heade pub fn ser_resume_experiment_headers( input: &crate::operation::resume_experiment::ResumeExperimentInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_resume_experiment_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -112,9 +112,11 @@ pub fn ser_resume_experiment_input(input: &crate::operation::resume_experiment:: Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_resume_experiment(value: &[u8], mut builder: crate::operation::resume_experiment::builders::ResumeExperimentOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_resume_experiment(_value: &[u8], mut builder: crate::operation::resume_experiment::builders::ResumeExperimentOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -141,7 +143,7 @@ pub(crate) fn de_resume_experiment(value: &[u8], mut builder: crate::operation:: } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "created_at" => { @@ -233,7 +235,7 @@ pub(crate) fn de_resume_experiment(value: &[u8], mut builder: crate::operation:: } "override_keys" => { builder = builder.set_override_keys( - crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens)? + crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens, _value, depth + 1)? ); } "started_at" => { @@ -268,13 +270,13 @@ pub(crate) fn de_resume_experiment(value: &[u8], mut builder: crate::operation:: } "variants" => { builder = builder.set_variants( - crate::protocol_serde::shape_list_variant::de_list_variant(tokens)? + crate::protocol_serde::shape_list_variant::de_list_variant(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_rotate_master_encryption_key.rs b/crates/superposition_sdk/src/protocol_serde/shape_rotate_master_encryption_key.rs index be39d588d..328173fed 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_rotate_master_encryption_key.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_rotate_master_encryption_key.rs @@ -8,7 +8,7 @@ pub fn de_rotate_master_encryption_key_http_error(_response_status: u16, _respon Some(code) => code, None => return Err(crate::operation::rotate_master_encryption_key::RotateMasterEncryptionKeyError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::rotate_master_encryption_key::RotateMasterEncryptionKeyError::InternalServerError({ @@ -41,9 +41,11 @@ pub fn de_rotate_master_encryption_key_http_response(_response_status: u16, _res }) } -pub(crate) fn de_rotate_master_encryption_key(value: &[u8], mut builder: crate::operation::rotate_master_encryption_key::builders::RotateMasterEncryptionKeyOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_rotate_master_encryption_key(_value: &[u8], mut builder: crate::operation::rotate_master_encryption_key::builders::RotateMasterEncryptionKeyOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -67,7 +69,7 @@ pub(crate) fn de_rotate_master_encryption_key(value: &[u8], mut builder: crate:: _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_rotate_workspace_encryption_key.rs b/crates/superposition_sdk/src/protocol_serde/shape_rotate_workspace_encryption_key.rs index 886cae395..f13e0c204 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_rotate_workspace_encryption_key.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_rotate_workspace_encryption_key.rs @@ -8,7 +8,7 @@ pub fn de_rotate_workspace_encryption_key_http_error(_response_status: u16, _res Some(code) => code, None => return Err(crate::operation::rotate_workspace_encryption_key::RotateWorkspaceEncryptionKeyError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::rotate_workspace_encryption_key::RotateWorkspaceEncryptionKeyError::InternalServerError({ @@ -43,12 +43,12 @@ pub fn de_rotate_workspace_encryption_key_http_response(_response_status: u16, _ pub fn ser_rotate_workspace_encryption_key_headers( input: &crate::operation::rotate_workspace_encryption_key::RotateWorkspaceEncryptionKeyInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.org_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -60,9 +60,11 @@ pub fn ser_rotate_workspace_encryption_key_headers( Ok(builder) } -pub(crate) fn de_rotate_workspace_encryption_key(value: &[u8], mut builder: crate::operation::rotate_workspace_encryption_key::builders::RotateWorkspaceEncryptionKeyOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_rotate_workspace_encryption_key(_value: &[u8], mut builder: crate::operation::rotate_workspace_encryption_key::builders::RotateWorkspaceEncryptionKeyOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -79,7 +81,7 @@ pub(crate) fn de_rotate_workspace_encryption_key(value: &[u8], mut builder: crat _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_secret_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_secret_list.rs index cb7737ad3..706f86ec3 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_secret_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_secret_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_secret_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_secret_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_secret_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> :: } _ => { let value = - crate::protocol_serde::shape_secret_response::de_secret_response(tokens)? + crate::protocol_serde::shape_secret_response::de_secret_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_secret_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_secret_response.rs index 184bb3d78..a435b58ca 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_secret_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_secret_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_secret_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_secret_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -69,7 +72,7 @@ pub(crate) fn de_secret_response<'a, I>(tokens: &mut ::std::iter::Peekable) - _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::secret_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_string_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_string_list.rs index 5f7c3e439..40118db07 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_string_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_string_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_string_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_string_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -20,6 +23,8 @@ pub(crate) fn de_string_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> :: ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_test.rs b/crates/superposition_sdk/src/protocol_serde/shape_test.rs index b21882b2c..70c596695 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_test.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_test.rs @@ -8,7 +8,7 @@ pub fn de_test_http_error(_response_status: u16, _response_headers: &::aws_smith Some(code) => code, None => return Err(crate::operation::test::TestError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::test::TestError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_test_http_response(_response_status: u16, _response_headers: &::aws_sm pub fn ser_test_headers( input: &crate::operation::test::TestInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_test_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,9 +88,11 @@ pub fn ser_test_headers( Ok(builder) } -pub(crate) fn de_test(value: &[u8], mut builder: crate::operation::test::builders::TestOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_test(_value: &[u8], mut builder: crate::operation::test::builders::TestOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -123,7 +125,7 @@ pub(crate) fn de_test(value: &[u8], mut builder: crate::operation::test::builder _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_type_templates_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_type_templates_list.rs index f82f410f9..faca4d936 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_type_templates_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_type_templates_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_type_templates_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_type_templates_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_type_templates_list<'a, I>(tokens: &mut ::std::iter::Peekable { let value = - crate::protocol_serde::shape_type_templates_response::de_type_templates_response(tokens)? + crate::protocol_serde::shape_type_templates_response::de_type_templates_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_type_templates_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_type_templates_response.rs index fb142e3f4..f7bb2e647 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_type_templates_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_type_templates_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_type_templates_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_type_templates_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -22,7 +25,7 @@ pub(crate) fn de_type_templates_response<'a, I>(tokens: &mut ::std::iter::Peekab } "type_schema" => { builder = builder.set_type_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "description" => { @@ -74,7 +77,7 @@ pub(crate) fn de_type_templates_response<'a, I>(tokens: &mut ::std::iter::Peekab _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::type_templates_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_default_config.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_default_config.rs index dea9e600a..d6916523f 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_default_config.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_default_config.rs @@ -8,7 +8,7 @@ pub fn de_update_default_config_http_error(_response_status: u16, _response_head Some(code) => code, None => return Err(crate::operation::update_default_config::UpdateDefaultConfigError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_default_config::UpdateDefaultConfigError::ResourceNotFound({ @@ -88,12 +88,12 @@ pub fn de_update_default_config_http_response(_response_status: u16, _response_h pub fn ser_update_default_config_headers( input: &crate::operation::update_default_config::UpdateDefaultConfigInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -105,7 +105,7 @@ pub fn ser_update_default_config_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -125,9 +125,11 @@ pub fn ser_update_default_config_input(input: &crate::operation::update_default_ Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_default_config(value: &[u8], mut builder: crate::operation::update_default_config::builders::UpdateDefaultConfigOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_default_config(_value: &[u8], mut builder: crate::operation::update_default_config::builders::UpdateDefaultConfigOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -191,7 +193,7 @@ pub(crate) fn de_update_default_config(value: &[u8], mut builder: crate::operati } "schema" => { builder = builder.set_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "value" => { @@ -220,7 +222,7 @@ pub(crate) fn de_update_default_config(value: &[u8], mut builder: crate::operati _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_dimension.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_dimension.rs index 9f83118d6..afa0555e4 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_dimension.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_dimension.rs @@ -8,7 +8,7 @@ pub fn de_update_dimension_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::update_dimension::UpdateDimensionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_dimension::UpdateDimensionError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_update_dimension_http_response(_response_status: u16, _response_header pub fn ser_update_dimension_headers( input: &crate::operation::update_dimension::UpdateDimensionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_update_dimension_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -112,9 +112,11 @@ pub fn ser_update_dimension_input(input: &crate::operation::update_dimension::Up Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_dimension(value: &[u8], mut builder: crate::operation::update_dimension::builders::UpdateDimensionOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_dimension(_value: &[u8], mut builder: crate::operation::update_dimension::builders::UpdateDimensionOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -146,7 +148,7 @@ pub(crate) fn de_update_dimension(value: &[u8], mut builder: crate::operation::u } "dependency_graph" => { builder = builder.set_dependency_graph( - crate::protocol_serde::shape_dependency_graph::de_dependency_graph(tokens)? + crate::protocol_serde::shape_dependency_graph::de_dependency_graph(tokens, _value, depth + 1)? ); } "description" => { @@ -169,7 +171,7 @@ pub(crate) fn de_update_dimension(value: &[u8], mut builder: crate::operation::u } "dimension_type" => { builder = builder.set_dimension_type( - crate::protocol_serde::shape_dimension_type::de_dimension_type(tokens)? + crate::protocol_serde::shape_dimension_type::de_dimension_type(tokens, _value, depth + 1)? ); } "last_modified_at" => { @@ -200,7 +202,7 @@ pub(crate) fn de_update_dimension(value: &[u8], mut builder: crate::operation::u } "schema" => { builder = builder.set_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "value_compute_function_name" => { @@ -224,7 +226,7 @@ pub(crate) fn de_update_dimension(value: &[u8], mut builder: crate::operation::u _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_experiment_group.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_experiment_group.rs index 6f8507f39..04acfc6db 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_experiment_group.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_experiment_group.rs @@ -8,7 +8,7 @@ pub fn de_update_experiment_group_http_error(_response_status: u16, _response_he Some(code) => code, None => return Err(crate::operation::update_experiment_group::UpdateExperimentGroupError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_experiment_group::UpdateExperimentGroupError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_update_experiment_group_http_response(_response_status: u16, _response pub fn ser_update_experiment_group_headers( input: &crate::operation::update_experiment_group::UpdateExperimentGroupInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_update_experiment_group_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_update_experiment_group_input(input: &crate::operation::update_experi Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_experiment_group(value: &[u8], mut builder: crate::operation::update_experiment_group::builders::UpdateExperimentGroupOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_experiment_group(_value: &[u8], mut builder: crate::operation::update_experiment_group::builders::UpdateExperimentGroupOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -107,7 +109,7 @@ pub(crate) fn de_update_experiment_group(value: &[u8], mut builder: crate::opera match key.to_unescaped()?.as_ref() { "buckets" => { builder = builder.set_buckets( - crate::protocol_serde::shape_buckets::de_buckets(tokens)? + crate::protocol_serde::shape_buckets::de_buckets(tokens, _value, depth + 1)? ); } "change_reason" => { @@ -121,7 +123,7 @@ pub(crate) fn de_update_experiment_group(value: &[u8], mut builder: crate::opera } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "context_hash" => { @@ -190,7 +192,7 @@ pub(crate) fn de_update_experiment_group(value: &[u8], mut builder: crate::opera } "member_experiment_ids" => { builder = builder.set_member_experiment_ids( - crate::protocol_serde::shape_string_list::de_string_list(tokens)? + crate::protocol_serde::shape_string_list::de_string_list(tokens, _value, depth + 1)? ); } "name" => { @@ -212,7 +214,7 @@ pub(crate) fn de_update_experiment_group(value: &[u8], mut builder: crate::opera _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_function.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_function.rs index 1a8961d6f..2826809c5 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_function.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_function.rs @@ -8,7 +8,7 @@ pub fn de_update_function_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::update_function::UpdateFunctionError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_function::UpdateFunctionError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_update_function_http_response(_response_status: u16, _response_headers pub fn ser_update_function_headers( input: &crate::operation::update_function::UpdateFunctionInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_update_function_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_update_function_input(input: &crate::operation::update_function::Upda Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_function(value: &[u8], mut builder: crate::operation::update_function::builders::UpdateFunctionOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_function(_value: &[u8], mut builder: crate::operation::update_function::builders::UpdateFunctionOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -222,7 +224,7 @@ pub(crate) fn de_update_function(value: &[u8], mut builder: crate::operation::up _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_organisation.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_organisation.rs index 473867beb..8860b5587 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_organisation.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_organisation.rs @@ -8,7 +8,7 @@ pub fn de_update_organisation_http_error(_response_status: u16, _response_header Some(code) => code, None => return Err(crate::operation::update_organisation::UpdateOrganisationError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_organisation::UpdateOrganisationError::ResourceNotFound({ @@ -65,9 +65,11 @@ pub fn ser_update_organisation_input(input: &crate::operation::update_organisati Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_organisation(value: &[u8], mut builder: crate::operation::update_organisation::builders::UpdateOrganisationOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_organisation(_value: &[u8], mut builder: crate::operation::update_organisation::builders::UpdateOrganisationOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -177,7 +179,7 @@ pub(crate) fn de_update_organisation(value: &[u8], mut builder: crate::operation _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_override.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_override.rs index 2101464fb..b130317c8 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_override.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_override.rs @@ -8,7 +8,7 @@ pub fn de_update_override_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::update_override::UpdateOverrideError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_override::UpdateOverrideError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_update_override_http_response(_response_status: u16, _response_headers pub fn ser_update_override_headers( input: &crate::operation::update_override::UpdateOverrideInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_update_override_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -104,7 +104,7 @@ pub fn ser_update_override_headers( if let ::std::option::Option::Some(inner_5) = &input.config_tags { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("config_tags", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -116,9 +116,11 @@ pub fn ser_update_override_headers( Ok(builder) } -pub(crate) fn de_update_override(value: &[u8], mut builder: crate::operation::update_override::builders::UpdateOverrideOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_override(_value: &[u8], mut builder: crate::operation::update_override::builders::UpdateOverrideOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -182,7 +184,7 @@ pub(crate) fn de_update_override(value: &[u8], mut builder: crate::operation::up } "override" => { builder = builder.set_override( - crate::protocol_serde::shape_overrides::de_overrides(tokens)? + crate::protocol_serde::shape_overrides::de_overrides(tokens, _value, depth + 1)? ); } "override_id" => { @@ -196,7 +198,7 @@ pub(crate) fn de_update_override(value: &[u8], mut builder: crate::operation::up } "value" => { builder = builder.set_value( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "weight" => { @@ -211,7 +213,7 @@ pub(crate) fn de_update_override(value: &[u8], mut builder: crate::operation::up _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_overrides_experiment.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_overrides_experiment.rs index 9b8939238..707451eca 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_overrides_experiment.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_overrides_experiment.rs @@ -8,7 +8,7 @@ pub fn de_update_overrides_experiment_http_error(_response_status: u16, _respons Some(code) => code, None => return Err(crate::operation::update_overrides_experiment::UpdateOverridesExperimentError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_overrides_experiment::UpdateOverridesExperimentError::ResourceNotFound({ @@ -75,12 +75,12 @@ pub fn de_update_overrides_experiment_http_response(_response_status: u16, _resp pub fn ser_update_overrides_experiment_headers( input: &crate::operation::update_overrides_experiment::UpdateOverridesExperimentInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -92,7 +92,7 @@ pub fn ser_update_overrides_experiment_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -104,7 +104,7 @@ pub fn ser_update_overrides_experiment_headers( if let ::std::option::Option::Some(inner_5) = &input.config_tags { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("config_tags", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -124,9 +124,11 @@ pub fn ser_update_overrides_experiment_input(input: &crate::operation::update_ov Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_overrides_experiment(value: &[u8], mut builder: crate::operation::update_overrides_experiment::builders::UpdateOverridesExperimentOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_overrides_experiment(_value: &[u8], mut builder: crate::operation::update_overrides_experiment::builders::UpdateOverridesExperimentOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -153,7 +155,7 @@ pub(crate) fn de_update_overrides_experiment(value: &[u8], mut builder: crate::o } "context" => { builder = builder.set_context( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "created_at" => { @@ -245,7 +247,7 @@ pub(crate) fn de_update_overrides_experiment(value: &[u8], mut builder: crate::o } "override_keys" => { builder = builder.set_override_keys( - crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens)? + crate::protocol_serde::shape_list_override_keys::de_list_override_keys(tokens, _value, depth + 1)? ); } "started_at" => { @@ -280,13 +282,13 @@ pub(crate) fn de_update_overrides_experiment(value: &[u8], mut builder: crate::o } "variants" => { builder = builder.set_variants( - crate::protocol_serde::shape_list_variant::de_list_variant(tokens)? + crate::protocol_serde::shape_list_variant::de_list_variant(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_secret.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_secret.rs index fad292c5a..aa75658c5 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_secret.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_secret.rs @@ -8,7 +8,7 @@ pub fn de_update_secret_http_error(_response_status: u16, _response_headers: &:: Some(code) => code, None => return Err(crate::operation::update_secret::UpdateSecretError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_secret::UpdateSecretError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_update_secret_http_response(_response_status: u16, _response_headers: pub fn ser_update_secret_headers( input: &crate::operation::update_secret::UpdateSecretInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_update_secret_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_update_secret_input(input: &crate::operation::update_secret::UpdateSe Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_secret(value: &[u8], mut builder: crate::operation::update_secret::builders::UpdateSecretOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_secret(_value: &[u8], mut builder: crate::operation::update_secret::builders::UpdateSecretOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -163,7 +165,7 @@ pub(crate) fn de_update_secret(value: &[u8], mut builder: crate::operation::upda _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_type_templates.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_type_templates.rs index c47862b92..f00da8c05 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_type_templates.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_type_templates.rs @@ -8,7 +8,7 @@ pub fn de_update_type_templates_http_error(_response_status: u16, _response_head Some(code) => code, None => return Err(crate::operation::update_type_templates::UpdateTypeTemplatesError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_type_templates::UpdateTypeTemplatesError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_update_type_templates_http_response(_response_status: u16, _response_h pub fn ser_update_type_templates_headers( input: &crate::operation::update_type_templates::UpdateTypeTemplatesInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_update_type_templates_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_update_type_templates_input(input: &crate::operation::update_type_tem Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_type_templates(value: &[u8], mut builder: crate::operation::update_type_templates::builders::UpdateTypeTemplatesOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_type_templates(_value: &[u8], mut builder: crate::operation::update_type_templates::builders::UpdateTypeTemplatesOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -162,13 +164,13 @@ pub(crate) fn de_update_type_templates(value: &[u8], mut builder: crate::operati } "type_schema" => { builder = builder.set_type_schema( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_variable.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_variable.rs index fcc9a6121..e2b446235 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_variable.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_variable.rs @@ -8,7 +8,7 @@ pub fn de_update_variable_http_error(_response_status: u16, _response_headers: & Some(code) => code, None => return Err(crate::operation::update_variable::UpdateVariableError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_variable::UpdateVariableError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_update_variable_http_response(_response_status: u16, _response_headers pub fn ser_update_variable_headers( input: &crate::operation::update_variable::UpdateVariableInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_update_variable_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_update_variable_input(input: &crate::operation::update_variable::Upda Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_variable(value: &[u8], mut builder: crate::operation::update_variable::builders::UpdateVariableOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_variable(_value: &[u8], mut builder: crate::operation::update_variable::builders::UpdateVariableOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -172,7 +174,7 @@ pub(crate) fn de_update_variable(value: &[u8], mut builder: crate::operation::up _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_webhook.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_webhook.rs index 71d4b242c..7b1a9392f 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_webhook.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_webhook.rs @@ -8,7 +8,7 @@ pub fn de_update_webhook_http_error(_response_status: u16, _response_headers: &: Some(code) => code, None => return Err(crate::operation::update_webhook::UpdateWebhookError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_webhook::UpdateWebhookError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_update_webhook_http_response(_response_status: u16, _response_headers: pub fn ser_update_webhook_headers( input: &crate::operation::update_webhook::UpdateWebhookInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_update_webhook_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -96,9 +96,11 @@ pub fn ser_update_webhook_input(input: &crate::operation::update_webhook::Update Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_webhook(value: &[u8], mut builder: crate::operation::update_webhook::builders::UpdateWebhookOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_webhook(_value: &[u8], mut builder: crate::operation::update_webhook::builders::UpdateWebhookOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -130,7 +132,7 @@ pub(crate) fn de_update_webhook(value: &[u8], mut builder: crate::operation::upd } "custom_headers" => { builder = builder.set_custom_headers( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "description" => { @@ -149,7 +151,7 @@ pub(crate) fn de_update_webhook(value: &[u8], mut builder: crate::operation::upd } "events" => { builder = builder.set_events( - crate::protocol_serde::shape_events::de_events(tokens)? + crate::protocol_serde::shape_events::de_events(tokens, _value, depth + 1)? ); } "last_modified_at" => { @@ -217,7 +219,7 @@ pub(crate) fn de_update_webhook(value: &[u8], mut builder: crate::operation::upd _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_update_workspace.rs b/crates/superposition_sdk/src/protocol_serde/shape_update_workspace.rs index 959a06d90..f05c1195d 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_update_workspace.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_update_workspace.rs @@ -8,7 +8,7 @@ pub fn de_update_workspace_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::update_workspace::UpdateWorkspaceError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "ResourceNotFound" => crate::operation::update_workspace::UpdateWorkspaceError::ResourceNotFound({ @@ -59,12 +59,12 @@ pub fn de_update_workspace_http_response(_response_status: u16, _response_header pub fn ser_update_workspace_headers( input: &crate::operation::update_workspace::UpdateWorkspaceInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.org_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -84,9 +84,11 @@ pub fn ser_update_workspace_input(input: &crate::operation::update_workspace::Up Ok(::aws_smithy_types::body::SdkBody::from(out)) } -pub(crate) fn de_update_workspace(value: &[u8], mut builder: crate::operation::update_workspace::builders::UpdateWorkspaceOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_update_workspace(_value: &[u8], mut builder: crate::operation::update_workspace::builders::UpdateWorkspaceOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -152,7 +154,7 @@ pub(crate) fn de_update_workspace(value: &[u8], mut builder: crate::operation::u } "mandatory_dimensions" => { builder = builder.set_mandatory_dimensions( - crate::protocol_serde::shape_list_mandatory_dimensions::de_list_mandatory_dimensions(tokens)? + crate::protocol_serde::shape_list_mandatory_dimensions::de_list_mandatory_dimensions(tokens, _value, depth + 1)? ); } "metrics" => { @@ -189,7 +191,7 @@ pub(crate) fn de_update_workspace(value: &[u8], mut builder: crate::operation::u } "workspace_lock" => { builder = builder.set_workspace_lock( - crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens)? + crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens, _value, depth + 1)? ); } "workspace_name" => { @@ -222,7 +224,7 @@ pub(crate) fn de_update_workspace(value: &[u8], mut builder: crate::operation::u _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_validate_context.rs b/crates/superposition_sdk/src/protocol_serde/shape_validate_context.rs index d336f2594..4bca70a58 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_validate_context.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_validate_context.rs @@ -8,7 +8,7 @@ pub fn de_validate_context_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::validate_context::ValidateContextError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "InternalServerError" => crate::operation::validate_context::ValidateContextError::InternalServerError({ @@ -42,12 +42,12 @@ pub fn de_validate_context_http_response(_response_status: u16, _response_header pub fn ser_validate_context_headers( input: &crate::operation::validate_context::ValidateContextInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -59,7 +59,7 @@ pub fn ser_validate_context_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, diff --git a/crates/superposition_sdk/src/protocol_serde/shape_variable_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_variable_list.rs index 9a30fd4ed..0a844e65a 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_variable_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_variable_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_variable_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_variable_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_variable_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> } _ => { let value = - crate::protocol_serde::shape_variable_response::de_variable_response(tokens)? + crate::protocol_serde::shape_variable_response::de_variable_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_variable_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_variable_response.rs index 8340c4419..115ba768d 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_variable_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_variable_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_variable_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_variable_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -78,7 +81,7 @@ pub(crate) fn de_variable_response<'a, I>(tokens: &mut ::std::iter::Peekable) _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::variable_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_variant.rs b/crates/superposition_sdk/src/protocol_serde/shape_variant.rs index 3f4a702f9..297e4291b 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_variant.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_variant.rs @@ -28,8 +28,11 @@ pub fn ser_variant( Ok(()) } -pub(crate) fn de_variant<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_variant<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -78,13 +81,13 @@ pub(crate) fn de_variant<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std: } "overrides" => { builder = builder.set_overrides( - crate::protocol_serde::shape_overrides::de_overrides(tokens)? + crate::protocol_serde::shape_overrides::de_overrides(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::variant_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_webhook_failed.rs b/crates/superposition_sdk/src/protocol_serde/shape_webhook_failed.rs index 6010ad031..b5bb015fd 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_webhook_failed.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_webhook_failed.rs @@ -1,7 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_webhook_failed_json_err(value: &[u8], mut builder: crate::types::error::builders::WebhookFailedBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_webhook_failed_json_err(_value: &[u8], mut builder: crate::types::error::builders::WebhookFailedBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -25,7 +27,7 @@ pub(crate) fn de_webhook_failed_json_err(value: &[u8], mut builder: crate::types _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_webhook_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_webhook_list.rs index 47f5b49cd..f89e7f51c 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_webhook_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_webhook_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_webhook_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_webhook_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_webhook_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> : } _ => { let value = - crate::protocol_serde::shape_webhook_response::de_webhook_response(tokens)? + crate::protocol_serde::shape_webhook_response::de_webhook_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_webhook_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_webhook_response.rs index bf833f88e..e390c6a62 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_webhook_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_webhook_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_webhook_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_webhook_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -63,12 +66,12 @@ pub(crate) fn de_webhook_response<'a, I>(tokens: &mut ::std::iter::Peekable) } "custom_headers" => { builder = builder.set_custom_headers( - crate::protocol_serde::shape_object::de_object(tokens)? + crate::protocol_serde::shape_object::de_object(tokens, _value, depth + 1)? ); } "events" => { builder = builder.set_events( - crate::protocol_serde::shape_events::de_events(tokens)? + crate::protocol_serde::shape_events::de_events(tokens, _value, depth + 1)? ); } "max_retries" => { @@ -123,7 +126,7 @@ pub(crate) fn de_webhook_response<'a, I>(tokens: &mut ::std::iter::Peekable) _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::webhook_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute.rs b/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute.rs index 9c5703dfd..594904dfa 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute.rs @@ -8,7 +8,7 @@ pub fn de_weight_recompute_http_error(_response_status: u16, _response_headers: Some(code) => code, None => return Err(crate::operation::weight_recompute::WeightRecomputeError::unhandled(generic)) }; - + let _error_message = generic.message().map(|msg|msg.to_owned()); Err(match error_code { "WebhookFailed" => crate::operation::weight_recompute::WeightRecomputeError::WebhookFailed({ @@ -59,12 +59,12 @@ pub fn de_weight_recompute_http_response(_response_status: u16, _response_header pub fn ser_weight_recompute_headers( input: &crate::operation::weight_recompute::WeightRecomputeInput, - mut builder: ::http::request::Builder - ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> { + mut builder: ::http_1x::request::Builder + ) -> std::result::Result<::http_1x::request::Builder, ::aws_smithy_types::error::operation::BuildError> { if let ::std::option::Option::Some(inner_1) = &input.workspace_id { let formatted_2 = inner_1.as_str(); let header_value = formatted_2; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("workspace_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -76,7 +76,7 @@ pub fn ser_weight_recompute_headers( if let ::std::option::Option::Some(inner_3) = &input.org_id { let formatted_4 = inner_3.as_str(); let header_value = formatted_4; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("org_id", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -88,7 +88,7 @@ pub fn ser_weight_recompute_headers( if let ::std::option::Option::Some(inner_5) = &input.config_tags { let formatted_6 = inner_5.as_str(); let header_value = formatted_6; - let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| { + let header_value: ::http_1x::HeaderValue = header_value.parse().map_err(|err| { ::aws_smithy_types::error::operation::BuildError::invalid_field("config_tags", format!( "`{}` cannot be used as a header value: {}", &header_value, @@ -100,9 +100,11 @@ pub fn ser_weight_recompute_headers( Ok(builder) } -pub(crate) fn de_weight_recompute(value: &[u8], mut builder: crate::operation::weight_recompute::builders::WeightRecomputeOutputBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_weight_recompute(_value: &[u8], mut builder: crate::operation::weight_recompute::builders::WeightRecomputeOutputBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -111,13 +113,13 @@ pub(crate) fn de_weight_recompute(value: &[u8], mut builder: crate::operation::w match key.to_unescaped()?.as_ref() { "data" => { builder = builder.set_data( - crate::protocol_serde::shape_weight_recompute_responses::de_weight_recompute_responses(tokens)? + crate::protocol_serde::shape_weight_recompute_responses::de_weight_recompute_responses(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute_response.rs index 215f834f6..1aa260dbf 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_weight_recompute_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_weight_recompute_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -22,7 +25,7 @@ pub(crate) fn de_weight_recompute_response<'a, I>(tokens: &mut ::std::iter::Peek } "condition" => { builder = builder.set_condition( - crate::protocol_serde::shape_condition::de_condition(tokens)? + crate::protocol_serde::shape_condition::de_condition(tokens, _value, depth + 1)? ); } "old_weight" => { @@ -46,7 +49,7 @@ pub(crate) fn de_weight_recompute_response<'a, I>(tokens: &mut ::std::iter::Peek _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::weight_recompute_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute_responses.rs b/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute_responses.rs index 8c70b0fc9..16c7b74ef 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute_responses.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_weight_recompute_responses.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_weight_recompute_responses<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_weight_recompute_responses<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_weight_recompute_responses<'a, I>(tokens: &mut ::std::iter::Pee } _ => { let value = - crate::protocol_serde::shape_weight_recompute_response::de_weight_recompute_response(tokens)? + crate::protocol_serde::shape_weight_recompute_response::de_weight_recompute_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_workspace_list.rs b/crates/superposition_sdk/src/protocol_serde/shape_workspace_list.rs index 8af23428b..8cc15289a 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_workspace_list.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_workspace_list.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_workspace_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_workspace_list<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result>, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartArray { .. }) => { @@ -12,10 +15,12 @@ pub(crate) fn de_workspace_list<'a, I>(tokens: &mut ::std::iter::Peekable) -> } _ => { let value = - crate::protocol_serde::shape_workspace_response::de_workspace_response(tokens)? + crate::protocol_serde::shape_workspace_response::de_workspace_response(tokens, _value, depth + 1)? ; if let Some(value) = value { items.push(value); + } else { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("dense list cannot contain null values")); } } } diff --git a/crates/superposition_sdk/src/protocol_serde/shape_workspace_lock.rs b/crates/superposition_sdk/src/protocol_serde/shape_workspace_lock.rs index e34990a3a..b2b4b1821 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_workspace_lock.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_workspace_lock.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_workspace_lock<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_workspace_lock<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -51,7 +54,7 @@ pub(crate) fn de_workspace_lock<'a, I>(tokens: &mut ::std::iter::Peekable) -> _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::workspace_lock_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/protocol_serde/shape_workspace_lock_conflict.rs b/crates/superposition_sdk/src/protocol_serde/shape_workspace_lock_conflict.rs index 3d060ef25..347cd6a60 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_workspace_lock_conflict.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_workspace_lock_conflict.rs @@ -1,7 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_workspace_lock_conflict_json_err(value: &[u8], mut builder: crate::types::error::builders::WorkspaceLockConflictBuilder) -> ::std::result::Result { - let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable(); +pub(crate) fn de_workspace_lock_conflict_json_err(_value: &[u8], mut builder: crate::types::error::builders::WorkspaceLockConflictBuilder) -> ::std::result::Result { + let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(_value)).peekable(); let tokens = &mut tokens_owned; + #[allow(unused_variables)] + let depth = 0u32; ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?; loop { match tokens.next().transpose()? { @@ -19,13 +21,13 @@ pub(crate) fn de_workspace_lock_conflict_json_err(value: &[u8], mut builder: cra } "lock" => { builder = builder.set_lock( - crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens)? + crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } if tokens.next().is_some() { diff --git a/crates/superposition_sdk/src/protocol_serde/shape_workspace_response.rs b/crates/superposition_sdk/src/protocol_serde/shape_workspace_response.rs index e3aafba8d..6c60e3e63 100644 --- a/crates/superposition_sdk/src/protocol_serde/shape_workspace_response.rs +++ b/crates/superposition_sdk/src/protocol_serde/shape_workspace_response.rs @@ -1,6 +1,9 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub(crate) fn de_workspace_response<'a, I>(tokens: &mut ::std::iter::Peekable) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> +pub(crate) fn de_workspace_response<'a, I>(tokens: &mut ::std::iter::Peekable, _value: &'a [u8], depth: u32) -> ::std::result::Result, ::aws_smithy_json::deserialize::error::DeserializeError> where I: Iterator, ::aws_smithy_json::deserialize::error::DeserializeError>> { + if depth >= 128u32 { + return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom("maximum nesting depth exceeded")); + } match tokens.next().transpose()? { Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => Ok(None), Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => { @@ -104,7 +107,7 @@ pub(crate) fn de_workspace_response<'a, I>(tokens: &mut ::std::iter::Peekable } "mandatory_dimensions" => { builder = builder.set_mandatory_dimensions( - crate::protocol_serde::shape_list_mandatory_dimensions::de_list_mandatory_dimensions(tokens)? + crate::protocol_serde::shape_list_mandatory_dimensions::de_list_mandatory_dimensions(tokens, _value, depth + 1)? ); } "metrics" => { @@ -134,13 +137,13 @@ pub(crate) fn de_workspace_response<'a, I>(tokens: &mut ::std::iter::Peekable } "workspace_lock" => { builder = builder.set_workspace_lock( - crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens)? + crate::protocol_serde::shape_workspace_lock::de_workspace_lock(tokens, _value, depth + 1)? ); } _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)? } } - other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {:?}", other))) + other => return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!("expected object key or end object, found: {other:?}"))) } } Ok(Some(crate::serde_util::workspace_response_correct_errors(builder).build().map_err(|err|::aws_smithy_json::deserialize::error::DeserializeError::custom_source("Response was invalid", err))?)) diff --git a/crates/superposition_sdk/src/sdk_feature_tracker.rs b/crates/superposition_sdk/src/sdk_feature_tracker.rs index be4a8d426..5a7f547fd 100644 --- a/crates/superposition_sdk/src/sdk_feature_tracker.rs +++ b/crates/superposition_sdk/src/sdk_feature_tracker.rs @@ -9,7 +9,7 @@ pub(crate) mod rpc_v2_cbor { use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; - use aws_smithy_runtime_api::client::interceptors::Intercept; + use aws_smithy_runtime_api::client::interceptors::{dyn_dispatch_hint, Intercept}; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; use aws_smithy_types::config_bag::ConfigBag; @@ -22,6 +22,7 @@ pub(crate) mod rpc_v2_cbor { } } + #[dyn_dispatch_hint] impl Intercept for RpcV2CborFeatureTrackerInterceptor { fn name(&self) -> &'static str { "RpcV2CborFeatureTrackerInterceptor" @@ -45,7 +46,9 @@ pub(crate) mod paginator { use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; - use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor}; + use aws_smithy_runtime_api::client::interceptors::{ + dyn_dispatch_hint, Intercept, SharedInterceptor, + }; use aws_smithy_runtime_api::client::runtime_components::{ RuntimeComponents, RuntimeComponentsBuilder, }; @@ -62,6 +65,7 @@ pub(crate) mod paginator { } } + #[dyn_dispatch_hint] impl Intercept for PaginatorFeatureTrackerInterceptor { fn name(&self) -> &'static str { "PaginatorFeatureTrackerInterceptor" @@ -90,7 +94,7 @@ pub(crate) mod paginator { runtime_components: RuntimeComponentsBuilder::new( "PaginatorFeatureTrackerRuntimePlugin", ) - .with_interceptor(SharedInterceptor::new( + .with_interceptor(SharedInterceptor::permanent( PaginatorFeatureTrackerInterceptor::new(), )), } @@ -112,7 +116,9 @@ pub(crate) mod waiter { use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextMut; - use aws_smithy_runtime_api::client::interceptors::{Intercept, SharedInterceptor}; + use aws_smithy_runtime_api::client::interceptors::{ + dyn_dispatch_hint, Intercept, SharedInterceptor, + }; use aws_smithy_runtime_api::client::runtime_components::{ RuntimeComponents, RuntimeComponentsBuilder, }; @@ -129,6 +135,7 @@ pub(crate) mod waiter { } } + #[dyn_dispatch_hint] impl Intercept for WaiterFeatureTrackerInterceptor { fn name(&self) -> &'static str { "WaiterFeatureTrackerInterceptor" @@ -157,7 +164,7 @@ pub(crate) mod waiter { runtime_components: RuntimeComponentsBuilder::new( "WaiterFeatureTrackerRuntimePlugin", ) - .with_interceptor(SharedInterceptor::new( + .with_interceptor(SharedInterceptor::permanent( WaiterFeatureTrackerInterceptor::new(), )), } @@ -179,7 +186,7 @@ pub(crate) mod retry_mode { use aws_smithy_runtime::client::sdk_feature::SmithySdkFeature; use aws_smithy_runtime_api::box_error::BoxError; use aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef; - use aws_smithy_runtime_api::client::interceptors::Intercept; + use aws_smithy_runtime_api::client::interceptors::{dyn_dispatch_hint, Intercept}; use aws_smithy_runtime_api::client::runtime_components::RuntimeComponents; use aws_smithy_types::config_bag::ConfigBag; use aws_smithy_types::retry::{RetryConfig, RetryMode}; @@ -193,6 +200,7 @@ pub(crate) mod retry_mode { } } + #[dyn_dispatch_hint] impl Intercept for RetryModeFeatureTrackerInterceptor { fn name(&self) -> &'static str { "RetryModeFeatureTrackerInterceptor" diff --git a/crates/superposition_sdk/src/serialization_settings.rs b/crates/superposition_sdk/src/serialization_settings.rs index ad5b64f55..5be932b98 100644 --- a/crates/superposition_sdk/src/serialization_settings.rs +++ b/crates/superposition_sdk/src/serialization_settings.rs @@ -8,7 +8,7 @@ use aws_smithy_http::header::set_request_header_if_absent; use aws_smithy_types::config_bag::{Storable, StoreReplace}; -use http::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE}; +use http_1x::header::{HeaderName, CONTENT_LENGTH, CONTENT_TYPE}; /// Configuration for how default protocol headers are serialized #[derive(Clone, Debug, Default)] @@ -48,10 +48,10 @@ impl HeaderSerializationSettings { /// Sets a default header on the given request builder if it should be serialized pub(crate) fn set_default_header( &self, - mut request: http::request::Builder, + mut request: http_1x::request::Builder, header_name: HeaderName, value: &str, - ) -> http::request::Builder { + ) -> http_1x::request::Builder { if self.include_header(&header_name) { request = set_request_header_if_absent(request, header_name, value); } diff --git a/crates/superposition_sdk/src/types.rs b/crates/superposition_sdk/src/types.rs index b39d43f0e..267896132 100644 --- a/crates/superposition_sdk/src/types.rs +++ b/crates/superposition_sdk/src/types.rs @@ -1,119 +1,119 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::types::_secret_response::SecretResponse; +pub use crate::types::_dimension_type::DimensionType; -pub use crate::types::_sort_by::SortBy; +pub use crate::types::_config_data::ConfigData; -pub use crate::types::_secret_sort_on::SecretSortOn; +pub use crate::types::_function_runtime_version::FunctionRuntimeVersion; -pub use crate::types::_variable_response::VariableResponse; +pub use crate::types::_function_types::FunctionTypes; -pub use crate::types::_variable_sort_on::VariableSortOn; +pub use crate::types::_org_status::OrgStatus; -pub use crate::types::_experiment_group_response::ExperimentGroupResponse; +pub use crate::types::_experiment_type::ExperimentType; -pub use crate::types::_group_type::GroupType; +pub use crate::types::_experiment_status_type::ExperimentStatusType; -pub use crate::types::_bucket::Bucket; +pub use crate::types::_workspace_status::WorkspaceStatus; -pub use crate::types::_experiment_response::ExperimentResponse; +pub use crate::types::_workspace_lock::WorkspaceLock; -pub use crate::types::_variant::Variant; +pub use crate::types::_http_method::HttpMethod; -pub use crate::types::_variant_type::VariantType; +pub use crate::types::_version::Version; -pub use crate::types::_experiment_status_type::ExperimentStatusType; +pub use crate::types::_group_type::GroupType; -pub use crate::types::_experiment_type::ExperimentType; +pub use crate::types::_unit::Unit; -pub use crate::types::_dimension_match_strategy::DimensionMatchStrategy; +pub use crate::types::_context_partial::ContextPartial; -pub use crate::types::_experiment_group_sort_on::ExperimentGroupSortOn; +pub use crate::types::_dimension_info::DimensionInfo; -pub use crate::types::_version::Version; +pub use crate::types::_variant::Variant; -pub use crate::types::_http_method::HttpMethod; +pub use crate::types::_bucket::Bucket; -pub use crate::types::_webhook_response::WebhookResponse; +pub use crate::types::_experiment_group_response::ExperimentGroupResponse; -pub use crate::types::_workspace_lock::WorkspaceLock; +pub use crate::types::_experiment_response::ExperimentResponse; -pub use crate::types::_workspace_status::WorkspaceStatus; +pub use crate::types::_context_filter_sort_on::ContextFilterSortOn; -pub use crate::types::_workspace_response::WorkspaceResponse; +pub use crate::types::_sort_by::SortBy; -pub use crate::types::_type_templates_response::TypeTemplatesResponse; +pub use crate::types::_dimension_match_strategy::DimensionMatchStrategy; -pub use crate::types::_experiment_sort_on::ExperimentSortOn; +pub use crate::types::_context_put::ContextPut; -pub use crate::types::_variant_update_request::VariantUpdateRequest; +pub use crate::types::_context_move::ContextMove; -pub use crate::types::_org_status::OrgStatus; +pub use crate::types::_update_context_override_request::UpdateContextOverrideRequest; -pub use crate::types::_organisation_response::OrganisationResponse; +pub use crate::types::_merge_strategy::MergeStrategy; -pub use crate::types::_function_types::FunctionTypes; +pub use crate::types::_resolve_explanation::ResolveExplanation; -pub use crate::types::_function_runtime_version::FunctionRuntimeVersion; +pub use crate::types::_stage::Stage; pub use crate::types::_function_execution_request::FunctionExecutionRequest; -pub use crate::types::_change_reason_validation_function_request::ChangeReasonValidationFunctionRequest; - -pub use crate::types::_context_validation_function_request::ContextValidationFunctionRequest; +pub use crate::types::_experiment_sort_on::ExperimentSortOn; -pub use crate::types::_value_compute_function_request::ValueComputeFunctionRequest; +pub use crate::types::_experiment_group_sort_on::ExperimentGroupSortOn; -pub use crate::types::_value_validation_function_request::ValueValidationFunctionRequest; +pub use crate::types::_variable_sort_on::VariableSortOn; -pub use crate::types::_stage::Stage; +pub use crate::types::_secret_sort_on::SecretSortOn; -pub use crate::types::_function_response::FunctionResponse; +pub use crate::types::_variant_type::VariantType; -pub use crate::types::_audit_log_full::AuditLogFull; +pub use crate::types::_default_config_response::DefaultConfigResponse; -pub use crate::types::_audit_action::AuditAction; +pub use crate::types::_dimension_response::DimensionResponse; -pub use crate::types::_config_data::ConfigData; +pub use crate::types::_context_response::ContextResponse; -pub use crate::types::_dimension_info::DimensionInfo; +pub use crate::types::_context_identifier::ContextIdentifier; -pub use crate::types::_dimension_type::DimensionType; +pub use crate::types::_weight_recompute_response::WeightRecomputeResponse; -pub use crate::types::_unit::Unit; +pub use crate::types::_context_action::ContextAction; -pub use crate::types::_context_partial::ContextPartial; +pub use crate::types::_context_action_out::ContextActionOut; pub use crate::types::_list_versions_member::ListVersionsMember; -pub use crate::types::_merge_strategy::MergeStrategy; +pub use crate::types::_audit_action::AuditAction; -pub use crate::types::_resolve_explanation::ResolveExplanation; +pub use crate::types::_audit_log_full::AuditLogFull; -pub use crate::types::_resolve_explanation_timeline_item::ResolveExplanationTimelineItem; +pub use crate::types::_function_response::FunctionResponse; -pub use crate::types::_context_action_out::ContextActionOut; +pub use crate::types::_value_validation_function_request::ValueValidationFunctionRequest; -pub use crate::types::_context_response::ContextResponse; +pub use crate::types::_value_compute_function_request::ValueComputeFunctionRequest; -pub use crate::types::_context_action::ContextAction; +pub use crate::types::_context_validation_function_request::ContextValidationFunctionRequest; -pub use crate::types::_context_move_bulk_request::ContextMoveBulkRequest; +pub use crate::types::_change_reason_validation_function_request::ChangeReasonValidationFunctionRequest; -pub use crate::types::_context_move::ContextMove; +pub use crate::types::_organisation_response::OrganisationResponse; -pub use crate::types::_update_context_override_request::UpdateContextOverrideRequest; +pub use crate::types::_variant_update_request::VariantUpdateRequest; -pub use crate::types::_context_identifier::ContextIdentifier; +pub use crate::types::_type_templates_response::TypeTemplatesResponse; -pub use crate::types::_context_put::ContextPut; +pub use crate::types::_workspace_response::WorkspaceResponse; -pub use crate::types::_weight_recompute_response::WeightRecomputeResponse; +pub use crate::types::_webhook_response::WebhookResponse; -pub use crate::types::_context_filter_sort_on::ContextFilterSortOn; +pub use crate::types::_variable_response::VariableResponse; -pub use crate::types::_dimension_response::DimensionResponse; +pub use crate::types::_secret_response::SecretResponse; -pub use crate::types::_default_config_response::DefaultConfigResponse; +pub use crate::types::_context_move_bulk_request::ContextMoveBulkRequest; + +pub use crate::types::_resolve_explanation_timeline_item::ResolveExplanationTimelineItem; mod _audit_action; diff --git a/crates/superposition_sdk/src/types/_audit_action.rs b/crates/superposition_sdk/src/types/_audit_action.rs index 6056e05c3..eb5159481 100644 --- a/crates/superposition_sdk/src/types/_audit_action.rs +++ b/crates/superposition_sdk/src/types/_audit_action.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let auditaction = unimplemented!(); /// match auditaction { @@ -31,12 +31,12 @@ /// Specifically, when `auditaction` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `AuditAction::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -106,7 +106,7 @@ impl ::std::fmt::Display for AuditAction { AuditAction::Delete => write!(f, "DELETE"), AuditAction::Insert => write!(f, "INSERT"), AuditAction::Update => write!(f, "UPDATE"), -AuditAction::Unknown(value) => write!(f, "{}", value) +AuditAction::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_context_filter_sort_on.rs b/crates/superposition_sdk/src/types/_context_filter_sort_on.rs index f13e41b3c..121f62530 100644 --- a/crates/superposition_sdk/src/types/_context_filter_sort_on.rs +++ b/crates/superposition_sdk/src/types/_context_filter_sort_on.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let contextfiltersorton = unimplemented!(); /// match contextfiltersorton { @@ -31,12 +31,12 @@ /// Specifically, when `contextfiltersorton` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `ContextFilterSortOn::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -106,7 +106,7 @@ impl ::std::fmt::Display for ContextFilterSortOn { ContextFilterSortOn::CreatedAt => write!(f, "created_at"), ContextFilterSortOn::LastModifiedAt => write!(f, "last_modified_at"), ContextFilterSortOn::Weight => write!(f, "weight"), -ContextFilterSortOn::Unknown(value) => write!(f, "{}", value) +ContextFilterSortOn::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_dimension_match_strategy.rs b/crates/superposition_sdk/src/types/_dimension_match_strategy.rs index 61db1853a..ddb93d85a 100644 --- a/crates/superposition_sdk/src/types/_dimension_match_strategy.rs +++ b/crates/superposition_sdk/src/types/_dimension_match_strategy.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let dimensionmatchstrategy = unimplemented!(); /// match dimensionmatchstrategy { @@ -31,12 +31,12 @@ /// Specifically, when `dimensionmatchstrategy` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `DimensionMatchStrategy::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// /// Strategy to follow while filter items based on the context #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -106,7 +106,7 @@ impl ::std::fmt::Display for DimensionMatchStrategy { DimensionMatchStrategy::Exact => write!(f, "exact"), DimensionMatchStrategy::NonConflicting => write!(f, "non_conflicting"), DimensionMatchStrategy::Subset => write!(f, "subset"), -DimensionMatchStrategy::Unknown(value) => write!(f, "{}", value) +DimensionMatchStrategy::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_experiment_group_sort_on.rs b/crates/superposition_sdk/src/types/_experiment_group_sort_on.rs index 0a9065bb6..7c65e8b9a 100644 --- a/crates/superposition_sdk/src/types/_experiment_group_sort_on.rs +++ b/crates/superposition_sdk/src/types/_experiment_group_sort_on.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let experimentgroupsorton = unimplemented!(); /// match experimentgroupsorton { @@ -31,12 +31,12 @@ /// Specifically, when `experimentgroupsorton` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `ExperimentGroupSortOn::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -106,7 +106,7 @@ impl ::std::fmt::Display for ExperimentGroupSortOn { ExperimentGroupSortOn::CreatedAt => write!(f, "created_at"), ExperimentGroupSortOn::LastModifiedAt => write!(f, "last_modified_at"), ExperimentGroupSortOn::Name => write!(f, "name"), -ExperimentGroupSortOn::Unknown(value) => write!(f, "{}", value) +ExperimentGroupSortOn::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_experiment_sort_on.rs b/crates/superposition_sdk/src/types/_experiment_sort_on.rs index f5d31ace8..45f3d54c8 100644 --- a/crates/superposition_sdk/src/types/_experiment_sort_on.rs +++ b/crates/superposition_sdk/src/types/_experiment_sort_on.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let experimentsorton = unimplemented!(); /// match experimentsorton { @@ -30,12 +30,12 @@ /// Specifically, when `experimentsorton` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `ExperimentSortOn::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -100,7 +100,7 @@ impl ::std::fmt::Display for ExperimentSortOn { match self { ExperimentSortOn::CreatedAt => write!(f, "created_at"), ExperimentSortOn::LastModifiedAt => write!(f, "last_modified_at"), -ExperimentSortOn::Unknown(value) => write!(f, "{}", value) +ExperimentSortOn::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_experiment_status_type.rs b/crates/superposition_sdk/src/types/_experiment_status_type.rs index 38ed17c9f..ce85d6160 100644 --- a/crates/superposition_sdk/src/types/_experiment_status_type.rs +++ b/crates/superposition_sdk/src/types/_experiment_status_type.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let experimentstatustype = unimplemented!(); /// match experimentstatustype { @@ -33,12 +33,12 @@ /// Specifically, when `experimentstatustype` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `ExperimentStatusType::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -118,7 +118,7 @@ ExperimentStatusType::Created => write!(f, "CREATED"), ExperimentStatusType::Discarded => write!(f, "DISCARDED"), ExperimentStatusType::Inprogress => write!(f, "INPROGRESS"), ExperimentStatusType::Paused => write!(f, "PAUSED"), -ExperimentStatusType::Unknown(value) => write!(f, "{}", value) +ExperimentStatusType::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_experiment_type.rs b/crates/superposition_sdk/src/types/_experiment_type.rs index af180ea2f..740fbaafa 100644 --- a/crates/superposition_sdk/src/types/_experiment_type.rs +++ b/crates/superposition_sdk/src/types/_experiment_type.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let experimenttype = unimplemented!(); /// match experimenttype { @@ -30,12 +30,12 @@ /// Specifically, when `experimenttype` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `ExperimentType::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -100,7 +100,7 @@ impl ::std::fmt::Display for ExperimentType { match self { ExperimentType::Default => write!(f, "DEFAULT"), ExperimentType::DeleteOverrides => write!(f, "DELETE_OVERRIDES"), -ExperimentType::Unknown(value) => write!(f, "{}", value) +ExperimentType::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_function_runtime_version.rs b/crates/superposition_sdk/src/types/_function_runtime_version.rs index d4144c3f7..ecea59245 100644 --- a/crates/superposition_sdk/src/types/_function_runtime_version.rs +++ b/crates/superposition_sdk/src/types/_function_runtime_version.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let functionruntimeversion = unimplemented!(); /// match functionruntimeversion { @@ -29,12 +29,12 @@ /// Specifically, when `functionruntimeversion` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `FunctionRuntimeVersion::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -94,7 +94,7 @@ impl ::std::fmt::Display for FunctionRuntimeVersion { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { match self { FunctionRuntimeVersion::V1 => write!(f, "1.0"), -FunctionRuntimeVersion::Unknown(value) => write!(f, "{}", value) +FunctionRuntimeVersion::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_function_types.rs b/crates/superposition_sdk/src/types/_function_types.rs index 7e865f3c3..e29a33635 100644 --- a/crates/superposition_sdk/src/types/_function_types.rs +++ b/crates/superposition_sdk/src/types/_function_types.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let functiontypes = unimplemented!(); /// match functiontypes { @@ -32,12 +32,12 @@ /// Specifically, when `functiontypes` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `FunctionTypes::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -112,7 +112,7 @@ impl ::std::fmt::Display for FunctionTypes { FunctionTypes::ContextValidation => write!(f, "CONTEXT_VALIDATION"), FunctionTypes::ValueCompute => write!(f, "VALUE_COMPUTE"), FunctionTypes::ValueValidation => write!(f, "VALUE_VALIDATION"), -FunctionTypes::Unknown(value) => write!(f, "{}", value) +FunctionTypes::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_group_type.rs b/crates/superposition_sdk/src/types/_group_type.rs index e497aeb43..8fd1d154b 100644 --- a/crates/superposition_sdk/src/types/_group_type.rs +++ b/crates/superposition_sdk/src/types/_group_type.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let grouptype = unimplemented!(); /// match grouptype { @@ -30,12 +30,12 @@ /// Specifically, when `grouptype` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `GroupType::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -100,7 +100,7 @@ impl ::std::fmt::Display for GroupType { match self { GroupType::SystemGenerated => write!(f, "SYSTEM_GENERATED"), GroupType::UserCreated => write!(f, "USER_CREATED"), -GroupType::Unknown(value) => write!(f, "{}", value) +GroupType::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_http_method.rs b/crates/superposition_sdk/src/types/_http_method.rs index 25cc61a55..5d44a210f 100644 --- a/crates/superposition_sdk/src/types/_http_method.rs +++ b/crates/superposition_sdk/src/types/_http_method.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let httpmethod = unimplemented!(); /// match httpmethod { @@ -34,12 +34,12 @@ /// Specifically, when `httpmethod` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `HttpMethod::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -124,7 +124,7 @@ HttpMethod::Head => write!(f, "HEAD"), HttpMethod::Patch => write!(f, "PATCH"), HttpMethod::Post => write!(f, "POST"), HttpMethod::Put => write!(f, "PUT"), -HttpMethod::Unknown(value) => write!(f, "{}", value) +HttpMethod::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_list_versions_member.rs b/crates/superposition_sdk/src/types/_list_versions_member.rs index 43e14c0a2..5a1eebcce 100644 --- a/crates/superposition_sdk/src/types/_list_versions_member.rs +++ b/crates/superposition_sdk/src/types/_list_versions_member.rs @@ -32,7 +32,7 @@ impl ListVersionsMember { use std::ops::Deref; self.description.deref() } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`. pub fn tags(&self) -> &[::std::string::String] { self.tags.as_deref() diff --git a/crates/superposition_sdk/src/types/_merge_strategy.rs b/crates/superposition_sdk/src/types/_merge_strategy.rs index a2a396351..b12d4a75f 100644 --- a/crates/superposition_sdk/src/types/_merge_strategy.rs +++ b/crates/superposition_sdk/src/types/_merge_strategy.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let mergestrategy = unimplemented!(); /// match mergestrategy { @@ -30,12 +30,12 @@ /// Specifically, when `mergestrategy` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `MergeStrategy::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -100,7 +100,7 @@ impl ::std::fmt::Display for MergeStrategy { match self { MergeStrategy::Merge => write!(f, "MERGE"), MergeStrategy::Replace => write!(f, "REPLACE"), -MergeStrategy::Unknown(value) => write!(f, "{}", value) +MergeStrategy::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_org_status.rs b/crates/superposition_sdk/src/types/_org_status.rs index 0d23a3e58..6f99bf283 100644 --- a/crates/superposition_sdk/src/types/_org_status.rs +++ b/crates/superposition_sdk/src/types/_org_status.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let orgstatus = unimplemented!(); /// match orgstatus { @@ -31,12 +31,12 @@ /// Specifically, when `orgstatus` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `OrgStatus::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -106,7 +106,7 @@ impl ::std::fmt::Display for OrgStatus { OrgStatus::Active => write!(f, "Active"), OrgStatus::Inactive => write!(f, "Inactive"), OrgStatus::PendingKyb => write!(f, "PendingKyb"), -OrgStatus::Unknown(value) => write!(f, "{}", value) +OrgStatus::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_secret_sort_on.rs b/crates/superposition_sdk/src/types/_secret_sort_on.rs index 78342c657..b71d4a67c 100644 --- a/crates/superposition_sdk/src/types/_secret_sort_on.rs +++ b/crates/superposition_sdk/src/types/_secret_sort_on.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let secretsorton = unimplemented!(); /// match secretsorton { @@ -31,12 +31,12 @@ /// Specifically, when `secretsorton` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `SecretSortOn::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -106,7 +106,7 @@ impl ::std::fmt::Display for SecretSortOn { SecretSortOn::CreatedAt => write!(f, "created_at"), SecretSortOn::LastModifiedAt => write!(f, "last_modified_at"), SecretSortOn::Name => write!(f, "name"), -SecretSortOn::Unknown(value) => write!(f, "{}", value) +SecretSortOn::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_sort_by.rs b/crates/superposition_sdk/src/types/_sort_by.rs index 19d5938b5..245ad80a4 100644 --- a/crates/superposition_sdk/src/types/_sort_by.rs +++ b/crates/superposition_sdk/src/types/_sort_by.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let sortby = unimplemented!(); /// match sortby { @@ -30,12 +30,12 @@ /// Specifically, when `sortby` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `SortBy::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// /// Sort order enumeration for list operations. #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -100,7 +100,7 @@ impl ::std::fmt::Display for SortBy { match self { SortBy::Asc => write!(f, "asc"), SortBy::Desc => write!(f, "desc"), -SortBy::Unknown(value) => write!(f, "{}", value) +SortBy::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_stage.rs b/crates/superposition_sdk/src/types/_stage.rs index 1ba8fbade..02e22f8c5 100644 --- a/crates/superposition_sdk/src/types/_stage.rs +++ b/crates/superposition_sdk/src/types/_stage.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let stage = unimplemented!(); /// match stage { @@ -30,12 +30,12 @@ /// Specifically, when `stage` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `Stage::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -100,7 +100,7 @@ impl ::std::fmt::Display for Stage { match self { Stage::Draft => write!(f, "draft"), Stage::Published => write!(f, "published"), -Stage::Unknown(value) => write!(f, "{}", value) +Stage::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_variable_sort_on.rs b/crates/superposition_sdk/src/types/_variable_sort_on.rs index e72d19046..f1a0109cd 100644 --- a/crates/superposition_sdk/src/types/_variable_sort_on.rs +++ b/crates/superposition_sdk/src/types/_variable_sort_on.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let variablesorton = unimplemented!(); /// match variablesorton { @@ -31,12 +31,12 @@ /// Specifically, when `variablesorton` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `VariableSortOn::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -106,7 +106,7 @@ impl ::std::fmt::Display for VariableSortOn { VariableSortOn::CreatedAt => write!(f, "created_at"), VariableSortOn::LastModifiedAt => write!(f, "last_modified_at"), VariableSortOn::Name => write!(f, "name"), -VariableSortOn::Unknown(value) => write!(f, "{}", value) +VariableSortOn::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_variant_type.rs b/crates/superposition_sdk/src/types/_variant_type.rs index dc8badb8c..794ee5b8a 100644 --- a/crates/superposition_sdk/src/types/_variant_type.rs +++ b/crates/superposition_sdk/src/types/_variant_type.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let varianttype = unimplemented!(); /// match varianttype { @@ -30,12 +30,12 @@ /// Specifically, when `varianttype` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `VariantType::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -100,7 +100,7 @@ impl ::std::fmt::Display for VariantType { match self { VariantType::Control => write!(f, "CONTROL"), VariantType::Experimental => write!(f, "EXPERIMENTAL"), -VariantType::Unknown(value) => write!(f, "{}", value) +VariantType::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_version.rs b/crates/superposition_sdk/src/types/_version.rs index 22c91c7a9..1a3b8912c 100644 --- a/crates/superposition_sdk/src/types/_version.rs +++ b/crates/superposition_sdk/src/types/_version.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let version = unimplemented!(); /// match version { @@ -29,12 +29,12 @@ /// Specifically, when `version` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `Version::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -94,7 +94,7 @@ impl ::std::fmt::Display for Version { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { match self { Version::V1 => write!(f, "V1"), -Version::Unknown(value) => write!(f, "{}", value) +Version::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/_workspace_response.rs b/crates/superposition_sdk/src/types/_workspace_response.rs index 2187bd8f2..85ce4dda5 100644 --- a/crates/superposition_sdk/src/types/_workspace_response.rs +++ b/crates/superposition_sdk/src/types/_workspace_response.rs @@ -86,7 +86,7 @@ impl WorkspaceResponse { &self.created_at } #[allow(missing_docs)] // documentation missing in model - /// + /// /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.mandatory_dimensions.is_none()`. pub fn mandatory_dimensions(&self) -> &[::std::string::String] { self.mandatory_dimensions.as_deref() diff --git a/crates/superposition_sdk/src/types/_workspace_status.rs b/crates/superposition_sdk/src/types/_workspace_status.rs index 799a038dc..8630918b9 100644 --- a/crates/superposition_sdk/src/types/_workspace_status.rs +++ b/crates/superposition_sdk/src/types/_workspace_status.rs @@ -6,9 +6,9 @@ /// variant in a current version of SDK, your code should continue to work when you /// upgrade SDK to a future version in which the enum does include a variant for that /// feature. -/// +/// /// Here is an example of how you can make a match expression forward-compatible: -/// +/// /// ```text /// # let workspacestatus = unimplemented!(); /// match workspacestatus { @@ -30,12 +30,12 @@ /// Specifically, when `workspacestatus` represents `NewFeature`, /// the execution path will hit the second last match arm as before by virtue of /// calling `as_str` on `WorkspaceStatus::NewFeature` also yielding `"NewFeature"`. -/// +/// /// Explicitly matching on the `Unknown` variant should /// be avoided for two reasons: /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted. /// - It might inadvertently shadow other intended match arms. -/// +/// #[allow(missing_docs)] // documentation missing in model #[non_exhaustive] #[derive(::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash)] @@ -100,7 +100,7 @@ impl ::std::fmt::Display for WorkspaceStatus { match self { WorkspaceStatus::Disabled => write!(f, "DISABLED"), WorkspaceStatus::Enabled => write!(f, "ENABLED"), -WorkspaceStatus::Unknown(value) => write!(f, "{}", value) +WorkspaceStatus::Unknown(value) => write!(f, "{value}") } } } diff --git a/crates/superposition_sdk/src/types/builders.rs b/crates/superposition_sdk/src/types/builders.rs index b7fc3a81b..110b9f4a0 100644 --- a/crates/superposition_sdk/src/types/builders.rs +++ b/crates/superposition_sdk/src/types/builders.rs @@ -1,67 +1,67 @@ // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT. -pub use crate::types::_secret_response::SecretResponseBuilder; +pub use crate::types::_config_data::ConfigDataBuilder; -pub use crate::types::_variable_response::VariableResponseBuilder; +pub use crate::types::_workspace_lock::WorkspaceLockBuilder; -pub use crate::types::_experiment_group_response::ExperimentGroupResponseBuilder; +pub use crate::types::_unit::UnitBuilder; -pub use crate::types::_bucket::BucketBuilder; +pub use crate::types::_context_partial::ContextPartialBuilder; -pub use crate::types::_experiment_response::ExperimentResponseBuilder; +pub use crate::types::_dimension_info::DimensionInfoBuilder; pub use crate::types::_variant::VariantBuilder; -pub use crate::types::_webhook_response::WebhookResponseBuilder; +pub use crate::types::_bucket::BucketBuilder; -pub use crate::types::_workspace_lock::WorkspaceLockBuilder; +pub use crate::types::_experiment_group_response::ExperimentGroupResponseBuilder; -pub use crate::types::_workspace_response::WorkspaceResponseBuilder; +pub use crate::types::_experiment_response::ExperimentResponseBuilder; -pub use crate::types::_type_templates_response::TypeTemplatesResponseBuilder; +pub use crate::types::_context_put::ContextPutBuilder; -pub use crate::types::_variant_update_request::VariantUpdateRequestBuilder; +pub use crate::types::_context_move::ContextMoveBuilder; -pub use crate::types::_organisation_response::OrganisationResponseBuilder; +pub use crate::types::_update_context_override_request::UpdateContextOverrideRequestBuilder; -pub use crate::types::_change_reason_validation_function_request::ChangeReasonValidationFunctionRequestBuilder; +pub use crate::types::_resolve_explanation::ResolveExplanationBuilder; -pub use crate::types::_context_validation_function_request::ContextValidationFunctionRequestBuilder; +pub use crate::types::_default_config_response::DefaultConfigResponseBuilder; -pub use crate::types::_value_compute_function_request::ValueComputeFunctionRequestBuilder; +pub use crate::types::_dimension_response::DimensionResponseBuilder; -pub use crate::types::_value_validation_function_request::ValueValidationFunctionRequestBuilder; +pub use crate::types::_context_response::ContextResponseBuilder; -pub use crate::types::_function_response::FunctionResponseBuilder; +pub use crate::types::_weight_recompute_response::WeightRecomputeResponseBuilder; -pub use crate::types::_audit_log_full::AuditLogFullBuilder; +pub use crate::types::_list_versions_member::ListVersionsMemberBuilder; -pub use crate::types::_config_data::ConfigDataBuilder; +pub use crate::types::_audit_log_full::AuditLogFullBuilder; -pub use crate::types::_dimension_info::DimensionInfoBuilder; +pub use crate::types::_function_response::FunctionResponseBuilder; -pub use crate::types::_unit::UnitBuilder; +pub use crate::types::_value_validation_function_request::ValueValidationFunctionRequestBuilder; -pub use crate::types::_context_partial::ContextPartialBuilder; +pub use crate::types::_value_compute_function_request::ValueComputeFunctionRequestBuilder; -pub use crate::types::_list_versions_member::ListVersionsMemberBuilder; +pub use crate::types::_context_validation_function_request::ContextValidationFunctionRequestBuilder; -pub use crate::types::_resolve_explanation::ResolveExplanationBuilder; +pub use crate::types::_change_reason_validation_function_request::ChangeReasonValidationFunctionRequestBuilder; -pub use crate::types::_resolve_explanation_timeline_item::ResolveExplanationTimelineItemBuilder; +pub use crate::types::_organisation_response::OrganisationResponseBuilder; -pub use crate::types::_context_response::ContextResponseBuilder; +pub use crate::types::_variant_update_request::VariantUpdateRequestBuilder; -pub use crate::types::_context_move_bulk_request::ContextMoveBulkRequestBuilder; +pub use crate::types::_type_templates_response::TypeTemplatesResponseBuilder; -pub use crate::types::_context_move::ContextMoveBuilder; +pub use crate::types::_workspace_response::WorkspaceResponseBuilder; -pub use crate::types::_update_context_override_request::UpdateContextOverrideRequestBuilder; +pub use crate::types::_webhook_response::WebhookResponseBuilder; -pub use crate::types::_context_put::ContextPutBuilder; +pub use crate::types::_variable_response::VariableResponseBuilder; -pub use crate::types::_weight_recompute_response::WeightRecomputeResponseBuilder; +pub use crate::types::_secret_response::SecretResponseBuilder; -pub use crate::types::_dimension_response::DimensionResponseBuilder; +pub use crate::types::_context_move_bulk_request::ContextMoveBulkRequestBuilder; -pub use crate::types::_default_config_response::DefaultConfigResponseBuilder; +pub use crate::types::_resolve_explanation_timeline_item::ResolveExplanationTimelineItemBuilder; diff --git a/crates/superposition_sdk/src/types/error/_internal_server_error.rs b/crates/superposition_sdk/src/types/error/_internal_server_error.rs index 94920fdd0..ac192f33c 100644 --- a/crates/superposition_sdk/src/types/error/_internal_server_error.rs +++ b/crates/superposition_sdk/src/types/error/_internal_server_error.rs @@ -16,7 +16,7 @@ impl ::std::fmt::Display for InternalServerError { ::std::write!(f, "InternalServerError")?; if let ::std::option::Option::Some(inner_1) = &self.message { { - ::std::write!(f, ": {}", inner_1)?; + ::std::write!(f, ": {inner_1}")?; } } Ok(()) @@ -59,7 +59,7 @@ impl InternalServerErrorBuilder { self.meta = Some(meta); self } - + /// Sets error metadata pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { self.meta = meta; diff --git a/crates/superposition_sdk/src/types/error/_resource_not_found.rs b/crates/superposition_sdk/src/types/error/_resource_not_found.rs index cdee7db5b..5e3f2b30d 100644 --- a/crates/superposition_sdk/src/types/error/_resource_not_found.rs +++ b/crates/superposition_sdk/src/types/error/_resource_not_found.rs @@ -16,7 +16,7 @@ impl ::std::fmt::Display for ResourceNotFound { ::std::write!(f, "ResourceNotFound")?; if let ::std::option::Option::Some(inner_1) = &self.message { { - ::std::write!(f, ": {}", inner_1)?; + ::std::write!(f, ": {inner_1}")?; } } Ok(()) @@ -59,7 +59,7 @@ impl ResourceNotFoundBuilder { self.meta = Some(meta); self } - + /// Sets error metadata pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { self.meta = meta; diff --git a/crates/superposition_sdk/src/types/error/_webhook_failed.rs b/crates/superposition_sdk/src/types/error/_webhook_failed.rs index f477f3550..d08d465cf 100644 --- a/crates/superposition_sdk/src/types/error/_webhook_failed.rs +++ b/crates/superposition_sdk/src/types/error/_webhook_failed.rs @@ -25,7 +25,7 @@ impl ::std::fmt::Display for WebhookFailed { ::std::write!(f, "WebhookFailed")?; if let ::std::option::Option::Some(inner_1) = &self.message { { - ::std::write!(f, ": {}", inner_1)?; + ::std::write!(f, ": {inner_1}")?; } } Ok(()) @@ -83,7 +83,7 @@ impl WebhookFailedBuilder { self.meta = Some(meta); self } - + /// Sets error metadata pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { self.meta = meta; diff --git a/crates/superposition_sdk/src/types/error/_workspace_lock_conflict.rs b/crates/superposition_sdk/src/types/error/_workspace_lock_conflict.rs index 0099d9c03..9a38a7e5e 100644 --- a/crates/superposition_sdk/src/types/error/_workspace_lock_conflict.rs +++ b/crates/superposition_sdk/src/types/error/_workspace_lock_conflict.rs @@ -82,7 +82,7 @@ impl WorkspaceLockConflictBuilder { self.meta = Some(meta); self } - + /// Sets error metadata pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self { self.meta = meta; diff --git a/makefile b/makefile index e4385c7b4..3b4367321 100644 --- a/makefile +++ b/makefile @@ -49,7 +49,13 @@ DB_CONTAINER_NAME = $(shell $(call read-container-name,postgres)) DB_UP = $(shell $(call check-container,$(DB_CONTAINER_NAME))) LSTACK_CONTAINER_NAME = $(shell $(call read-container-name,localstack)) LSTACK_UP = $(shell $(call check-container,$(LSTACK_CONTAINER_NAME))) -export SMITHY_MAVEN_REPOS = https://repo1.maven.org/maven2|https://sandbox.assets.juspay.in/smithy/m2 +## codegen-client 0.1.19 is on Maven Central under groupId software.amazon.smithy.rust, +## but its POM (and codegen-core's) declare kotlin-stdlib-jdk8 with version "unspecified" +## (the real version only lives in Gradle module metadata, which the Smithy CLI's Maven +## resolver ignores). smithy-local-repo mirrors those two artifacts into a file-based repo +## with corrected POMs; we prepend it so the fixed POMs win over Maven Central's. +SMITHY_LOCAL_REPO := $(CURDIR)/smithy/.local-m2 +export SMITHY_MAVEN_REPOS = file://$(SMITHY_LOCAL_REPO)|https://repo1.maven.org/maven2|https://sandbox.assets.juspay.in/smithy/m2 .PHONY: amend \ amend-no-edit \ @@ -88,6 +94,7 @@ export SMITHY_MAVEN_REPOS = https://repo1.maven.org/maven2|https://sandbox.asset smithy-build \ smithy-clean \ smithy-clean-build \ + smithy-local-repo \ smithy-clients \ smithy-updates \ superposition \ @@ -258,7 +265,20 @@ tailwind: smithy-clean: rm -rf smithy/output -smithy-build: +smithy-local-repo: + @for a in codegen-client codegen-core; do \ + dir="$(SMITHY_LOCAL_REPO)/software/amazon/smithy/rust/$$a/0.1.19"; \ + if [ ! -f "$$dir/$$a-0.1.19.pom" ]; then \ + mkdir -p "$$dir"; \ + base="https://repo1.maven.org/maven2/software/amazon/smithy/rust/$$a/0.1.19/$$a-0.1.19"; \ + curl -fsSL -o "$$dir/$$a-0.1.19.jar" "$$base.jar"; \ + curl -fsSL -o "$$dir/$$a-0.1.19.pom" "$$base.pom"; \ + sed -i.bak 's#unspecified#2.1.0#g' "$$dir/$$a-0.1.19.pom" && rm -f "$$dir/$$a-0.1.19.pom.bak"; \ + echo "prepared $$a-0.1.19 (kotlin-stdlib-jdk8 pinned to 2.1.0)"; \ + fi; \ + done + +smithy-build: smithy-local-repo cd smithy && smithy build smithy-clean-build: smithy-clean smithy-build diff --git a/nix/smithy-cli.nix b/nix/smithy-cli.nix index febe35bb4..cfaac8488 100644 --- a/nix/smithy-cli.nix +++ b/nix/smithy-cli.nix @@ -6,11 +6,10 @@ }: let - version = "1.55.0"; + version = "1.69.0"; smithy-platform = lib.pipe stdenv.hostPlatform.system ( with builtins; [ - ## Converts 'x86_64-linux' into 'linux-x86_64'. (split "-") (filter (x: builtins.typeOf x == "string" && x != "")) lib.lists.reverseList @@ -19,10 +18,9 @@ let ); sha256 = if smithy-platform == "darwin-aarch64" then - "sha256-08uJuB9We4EVlxt7gh07/mxYZqma9B7VZ/vflposwZU=" - ## FIXME Defaulting to linux-x86_64 SHA. + "sha256-umZfI1bC7uF8fU33DDNSrjNrJq+z8sdwEZ6BxfbOEAg=" else - "sha256-L4xWsgzGOIbfT9fTFyEjZBIo7GA2cn10/m6YzJjWxcU="; + "sha256-j99kyy1XlJwEmDlKJA7G0KmnE6mBgfxoTxWY09opNo4="; in stdenv.mkDerivation { name = "smithy-cli"; diff --git a/smithy/smithy-build.json b/smithy/smithy-build.json index 0fed00e2a..10970d31c 100644 --- a/smithy/smithy-build.json +++ b/smithy/smithy-build.json @@ -6,14 +6,15 @@ "outputDirectory": "output", "maven": { "dependencies": [ - "software.amazon.smithy:smithy-model:1.55.0", - "software.amazon.smithy:smithy-utils:1.55.0", - "software.amazon.smithy:smithy-codegen-core:1.55.0", - "software.amazon.smithy:smithy-aws-traits:1.55.0", - "software.amazon.smithy:smithy-validation-model:1.55.0", + "software.amazon.smithy:smithy-model:1.69.0", + "software.amazon.smithy:smithy-utils:1.69.0", + "software.amazon.smithy:smithy-codegen-core:1.69.0", + "software.amazon.smithy:smithy-aws-traits:1.69.0", + "software.amazon.smithy:smithy-validation-model:1.69.0", + "software.amazon.smithy:smithy-rules-engine:1.69.0", "software.amazon.smithy.typescript:smithy-aws-typescript-codegen:0.26.0", - "software.amazon.smithy:smithy-openapi:1.55.0", - "software.amazon.smithy.rust.codegen:codegen-client:0.1.0", + "software.amazon.smithy:smithy-openapi:1.69.0", + "software.amazon.smithy.rust:codegen-client:0.1.19", "software.amazon.smithy.python.codegen:core:0.0.1", "software.amazon.smithy.java:client-core:0.0.1", "software.amazon.smithy.java.codegen:plugins:0.0.1",