AWS SDK

AWS SDK

rev. 97ba95e6039d206ffea5b866ddc214d34f7f88c3 (ignoring whitespace)

Files changed:

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/get_inventory_schema.rs

@@ -0,1 +0,606 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
/// Orchestration and serialization glue logic for `GetInventorySchema`.
           3  +
#[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
           4  +
#[non_exhaustive]
           5  +
pub struct GetInventorySchema;
           6  +
impl GetInventorySchema {
           7  +
    /// Creates a new `GetInventorySchema`
           8  +
    pub fn new() -> Self {
           9  +
        Self
          10  +
    }
          11  +
    /// The schema for this operation's input shape.
          12  +
    pub const INPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_inventory_schema::GetInventorySchemaInput::SCHEMA;
          13  +
    /// The schema for this operation's output shape.
          14  +
    pub const OUTPUT_SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = crate::operation::get_inventory_schema::GetInventorySchemaOutput::SCHEMA;
          15  +
    pub(crate) async fn orchestrate(
          16  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          17  +
        input: crate::operation::get_inventory_schema::GetInventorySchemaInput,
          18  +
    ) -> ::std::result::Result<
          19  +
        crate::operation::get_inventory_schema::GetInventorySchemaOutput,
          20  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          21  +
            crate::operation::get_inventory_schema::GetInventorySchemaError,
          22  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          23  +
        >,
          24  +
    > {
          25  +
        let map_err = |err: ::aws_smithy_runtime_api::client::result::SdkError<
          26  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          27  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          28  +
        >| {
          29  +
            err.map_service_error(|err| {
          30  +
                err.downcast::<crate::operation::get_inventory_schema::GetInventorySchemaError>()
          31  +
                    .expect("correct error type")
          32  +
            })
          33  +
        };
          34  +
        let context = Self::orchestrate_with_stop_point(runtime_plugins, input, ::aws_smithy_runtime::client::orchestrator::StopPoint::None)
          35  +
            .await
          36  +
            .map_err(map_err)?;
          37  +
        let output = context.finalize().map_err(map_err)?;
          38  +
        ::std::result::Result::Ok(
          39  +
            output
          40  +
                .downcast::<crate::operation::get_inventory_schema::GetInventorySchemaOutput>()
          41  +
                .expect("correct output type"),
          42  +
        )
          43  +
    }
          44  +
          45  +
    pub(crate) async fn orchestrate_with_stop_point(
          46  +
        runtime_plugins: &::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          47  +
        input: crate::operation::get_inventory_schema::GetInventorySchemaInput,
          48  +
        stop_point: ::aws_smithy_runtime::client::orchestrator::StopPoint,
          49  +
    ) -> ::std::result::Result<
          50  +
        ::aws_smithy_runtime_api::client::interceptors::context::InterceptorContext,
          51  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          52  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
          53  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          54  +
        >,
          55  +
    > {
          56  +
        let input = ::aws_smithy_runtime_api::client::interceptors::context::Input::erase(input);
          57  +
        use ::tracing::Instrument;
          58  +
        ::aws_smithy_runtime::client::orchestrator::invoke_with_stop_point("SSM", "GetInventorySchema", input, runtime_plugins, stop_point)
          59  +
            // Create a parent span for the entire operation. Includes a random, internal-only,
          60  +
            // seven-digit ID for the operation orchestration so that it can be correlated in the logs.
          61  +
            .instrument(::tracing::debug_span!(
          62  +
                "SSM.GetInventorySchema",
          63  +
                "rpc.service" = "SSM",
          64  +
                "rpc.method" = "GetInventorySchema",
          65  +
                "sdk_invocation_id" = ::fastrand::u32(1_000_000..10_000_000),
          66  +
                "rpc.system" = "aws-api",
          67  +
            ))
          68  +
            .await
          69  +
    }
          70  +
          71  +
    pub(crate) fn operation_runtime_plugins(
          72  +
        client_runtime_plugins: ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins,
          73  +
        client_config: &crate::config::Config,
          74  +
        config_override: ::std::option::Option<crate::config::Builder>,
          75  +
    ) -> ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugins {
          76  +
        let mut runtime_plugins = client_runtime_plugins.with_operation_plugin(Self::new());
          77  +
          78  +
        if let ::std::option::Option::Some(config_override) = config_override {
          79  +
            for plugin in config_override.runtime_plugins.iter().cloned() {
          80  +
                runtime_plugins = runtime_plugins.with_operation_plugin(plugin);
          81  +
            }
          82  +
            runtime_plugins = runtime_plugins.with_operation_plugin(crate::config::ConfigOverrideRuntimePlugin::new(
          83  +
                config_override,
          84  +
                client_config.config.clone(),
          85  +
                &client_config.runtime_components,
          86  +
            ));
          87  +
        }
          88  +
        runtime_plugins
          89  +
    }
          90  +
}
          91  +
/// Per-operation error registry. Contains an entry for every modeled
          92  +
/// error this operation can throw.
          93  +
///
          94  +
/// Used by the schema-serde error path as the operation-scoped lookup
          95  +
/// for registry-backed error reification: an error code that does not
          96  +
/// match one of the operation's modeled errors directly is resolved
          97  +
/// against this registry first, then widened to the service-wide error
          98  +
/// registry.
          99  +
pub(crate) mod error_registry {
         100  +
    pub(crate) static REGISTRY: ::std::sync::LazyLock<::aws_smithy_schema::registry::TypeRegistry> = ::std::sync::LazyLock::new(|| {
         101  +
        ::aws_smithy_schema::registry::TypeRegistry::builder()
         102  +
                            .insert_error_shape(
         103  +
                        crate::types::error::InternalServerError::SCHEMA,
         104  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         105  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InternalServerError::deserialize(d)?))
         106  +
                        },
         107  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         108  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InternalServerError::deserialize(d)?))
         109  +
                        },
         110  +
                    )
         111  +
.insert_error_shape(
         112  +
                        crate::types::error::InvalidNextToken::SCHEMA,
         113  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         114  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidNextToken::deserialize(d)?))
         115  +
                        },
         116  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         117  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidNextToken::deserialize(d)?))
         118  +
                        },
         119  +
                    )
         120  +
.insert_error_shape(
         121  +
                        crate::types::error::InvalidTypeNameException::SCHEMA,
         122  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::aws_smithy_types::type_erasure::TypeErasedBox, ::aws_smithy_schema::serde::SerdeError> {
         123  +
                            ::std::result::Result::Ok(::aws_smithy_types::type_erasure::TypeErasedBox::new(crate::types::error::InvalidTypeNameException::deserialize(d)?))
         124  +
                        },
         125  +
                        |d: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer| -> ::std::result::Result<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync>, ::aws_smithy_schema::serde::SerdeError> {
         126  +
                            ::std::result::Result::Ok(::std::boxed::Box::new(crate::types::error::InvalidTypeNameException::deserialize(d)?))
         127  +
                        },
         128  +
                    )
         129  +
                            .build()
         130  +
    });
         131  +
}
         132  +
impl ::aws_smithy_runtime_api::client::runtime_plugin::RuntimePlugin for GetInventorySchema {
         133  +
    fn config(&self) -> ::std::option::Option<::aws_smithy_types::config_bag::FrozenLayer> {
         134  +
        let mut cfg = ::aws_smithy_types::config_bag::Layer::new("GetInventorySchema");
         135  +
         136  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedRequestSerializer::new(
         137  +
            GetInventorySchemaRequestSerializer,
         138  +
        ));
         139  +
        cfg.store_put(::aws_smithy_runtime_api::client::ser_de::SharedResponseDeserializer::new(
         140  +
            GetInventorySchemaResponseDeserializer,
         141  +
        ));
         142  +
         143  +
        cfg.store_put(::aws_smithy_runtime_api::client::auth::AuthSchemeOptionResolverParams::new(
         144  +
            crate::config::auth::Params::builder()
         145  +
                .operation_name("GetInventorySchema")
         146  +
                .build()
         147  +
                .expect("required fields set"),
         148  +
        ));
         149  +
         150  +
        cfg.store_put(::aws_smithy_runtime_api::client::orchestrator::Metadata::new("GetInventorySchema", "SSM"));
         151  +
        let mut signing_options = ::aws_runtime::auth::SigningOptions::default();
         152  +
        signing_options.double_uri_encode = true;
         153  +
        signing_options.content_sha256_header = false;
         154  +
        signing_options.normalize_uri_path = true;
         155  +
        signing_options.payload_override = None;
         156  +
         157  +
        cfg.store_put(::aws_runtime::auth::SigV4OperationSigningConfig {
         158  +
            signing_options,
         159  +
            ..::std::default::Default::default()
         160  +
        });
         161  +
         162  +
        ::std::option::Option::Some(cfg.freeze())
         163  +
    }
         164  +
         165  +
    fn runtime_components(
         166  +
        &self,
         167  +
        _: &::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder,
         168  +
    ) -> ::std::borrow::Cow<'_, ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder> {
         169  +
        #[allow(unused_mut)]
         170  +
        let mut rcb = ::aws_smithy_runtime_api::client::runtime_components::RuntimeComponentsBuilder::new("GetInventorySchema")
         171  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         172  +
                GetInventorySchemaTelemetryInputCaptureInterceptor,
         173  +
            ))
         174  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         175  +
                ::aws_smithy_runtime::client::stalled_stream_protection::StalledStreamProtectionInterceptor::default(),
         176  +
            ))
         177  +
            .with_interceptor(::aws_smithy_runtime_api::client::interceptors::SharedInterceptor::permanent(
         178  +
                GetInventorySchemaEndpointParamsInterceptor,
         179  +
            ))
         180  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::TransientErrorClassifier::<
         181  +
                crate::operation::get_inventory_schema::GetInventorySchemaError,
         182  +
            >::new())
         183  +
            .with_retry_classifier(::aws_smithy_runtime::client::retries::classifiers::ModeledAsRetryableClassifier::<
         184  +
                crate::operation::get_inventory_schema::GetInventorySchemaError,
         185  +
            >::new())
         186  +
            .with_retry_classifier(::aws_runtime::retries::classifiers::AwsErrorCodeClassifier::<
         187  +
                crate::operation::get_inventory_schema::GetInventorySchemaError,
         188  +
            >::new())
         189  +
            .with_retry_classifier(::aws_runtime::service_clock_skew::ServiceClockSkewClassifier::<
         190  +
                crate::operation::get_inventory_schema::GetInventorySchemaError,
         191  +
            >::new());
         192  +
         193  +
        ::std::borrow::Cow::Owned(rcb)
         194  +
    }
         195  +
}
         196  +
         197  +
#[derive(Debug)]
         198  +
struct GetInventorySchemaTelemetryInputCaptureInterceptor;
         199  +
         200  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         201  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetInventorySchemaTelemetryInputCaptureInterceptor {
         202  +
    fn name(&self) -> &'static str {
         203  +
        "GetInventorySchemaTelemetryInputCaptureInterceptor"
         204  +
    }
         205  +
         206  +
    fn read_before_execution(
         207  +
        &self,
         208  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         209  +
            '_,
         210  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         211  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         212  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         213  +
        >,
         214  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         215  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         216  +
        // Nothing to do unless the customer opted in by naming members to record.
         217  +
        let ::std::option::Option::Some(requested) = cfg
         218  +
            .load::<::aws_smithy_types::telemetry::RequestedTelemetryAttributes>()
         219  +
            .filter(|r| !r.is_empty())
         220  +
        else {
         221  +
            return ::std::result::Result::Ok(());
         222  +
        };
         223  +
         224  +
        let ::std::option::Option::Some(input) = context.input().downcast_ref::<GetInventorySchemaInput>() else {
         225  +
            // A mismatched input is not this interceptor's concern; skip quietly.
         226  +
            return ::std::result::Result::Ok(());
         227  +
        };
         228  +
         229  +
        let mut captured = ::aws_smithy_types::telemetry::CapturedTelemetryAttributes::default();
         230  +
        if requested.should_capture("TypeName") {
         231  +
            if let ::std::option::Option::Some(value) = input.type_name.as_deref() {
         232  +
                captured.insert("TypeName", value);
         233  +
            }
         234  +
        }
         235  +
        if requested.should_capture("NextToken") {
         236  +
            if let ::std::option::Option::Some(value) = input.next_token.as_deref() {
         237  +
                captured.insert("NextToken", value);
         238  +
            }
         239  +
        }
         240  +
         241  +
        cfg.interceptor_state().store_put(captured);
         242  +
        ::std::result::Result::Ok(())
         243  +
    }
         244  +
}
         245  +
#[derive(Debug)]
         246  +
struct GetInventorySchemaResponseDeserializer;
         247  +
impl ::aws_smithy_runtime_api::client::ser_de::DeserializeResponse for GetInventorySchemaResponseDeserializer {
         248  +
    fn deserialize_nonstreaming_with_config(
         249  +
        &self,
         250  +
        response: &::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
         251  +
        _cfg: &::aws_smithy_types::config_bag::ConfigBag,
         252  +
    ) -> ::aws_smithy_runtime_api::client::interceptors::context::OutputOrError {
         253  +
        let (success, status) = (response.status().is_success(), response.status().as_u16());
         254  +
        // Load body and headers BEFORE BeforeParseResponse so customizations
         255  +
        // (e.g., S3's `body_is_error` check that detects errors returned with
         256  +
        // HTTP 200) can inspect them. The legacy non-streaming path also
         257  +
        // loads `body` before firing this hook.
         258  +
        let body = response.body().bytes().expect("body loaded");
         259  +
        let headers = response.headers();
         260  +
        #[allow(unused_mut)]
         261  +
        let mut force_error = false;
         262  +
        ::tracing::debug!(request_id = ?::aws_types::request_id::RequestId::request_id(response));
         263  +
        if !success && status != 200 || force_error {
         264  +
            let protocol = _cfg
         265  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         266  +
                .expect("a SharedClientProtocol is required");
         267  +
            #[allow(unused_mut)]
         268  +
            let mut generic_builder = protocol.parse_error_metadata(response, _cfg).map_err(|e| {
         269  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         270  +
            })?;
         271  +
            generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, headers);
         272  +
            let generic = generic_builder.build();
         273  +
            let error_code = match generic.code() {
         274  +
                ::std::option::Option::Some(code) => code,
         275  +
                ::std::option::Option::None => {
         276  +
                    return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         277  +
                        ::aws_smithy_runtime_api::box_error::BoxError::from(
         278  +
                            crate::operation::get_inventory_schema::GetInventorySchemaError::unhandled(generic),
         279  +
                        ),
         280  +
                    ))
         281  +
                }
         282  +
            };
         283  +
            let _error_message = generic.message().map(|msg| msg.to_owned());
         284  +
            let err = match error_code {
         285  +
                "InternalServerError" => crate::operation::get_inventory_schema::GetInventorySchemaError::InternalServerError({
         286  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         287  +
                        crate::types::error::InternalServerError::deserialize_with_response(
         288  +
                            &mut *deser,
         289  +
                            response.headers(),
         290  +
                            response.status().into(),
         291  +
                            body,
         292  +
                        )
         293  +
                    }) {
         294  +
                        ::std::result::Result::Ok(val) => val,
         295  +
                        ::std::result::Result::Err(e) => {
         296  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         297  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         298  +
                            ))
         299  +
                        }
         300  +
                    };
         301  +
                    tmp.meta = generic;
         302  +
                    if tmp.message.is_none() {
         303  +
                        tmp.message = _error_message;
         304  +
                    }
         305  +
                    tmp
         306  +
                }),
         307  +
                "InvalidNextToken" => crate::operation::get_inventory_schema::GetInventorySchemaError::InvalidNextToken({
         308  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         309  +
                        crate::types::error::InvalidNextToken::deserialize_with_response(
         310  +
                            &mut *deser,
         311  +
                            response.headers(),
         312  +
                            response.status().into(),
         313  +
                            body,
         314  +
                        )
         315  +
                    }) {
         316  +
                        ::std::result::Result::Ok(val) => val,
         317  +
                        ::std::result::Result::Err(e) => {
         318  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         319  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         320  +
                            ))
         321  +
                        }
         322  +
                    };
         323  +
                    tmp.meta = generic;
         324  +
                    if tmp.message.is_none() {
         325  +
                        tmp.message = _error_message;
         326  +
                    }
         327  +
                    tmp
         328  +
                }),
         329  +
                "InvalidTypeNameException" => crate::operation::get_inventory_schema::GetInventorySchemaError::InvalidTypeNameException({
         330  +
                    let mut tmp = match protocol.deserialize_error_response(response, _cfg).and_then(|mut deser| {
         331  +
                        crate::types::error::InvalidTypeNameException::deserialize_with_response(
         332  +
                            &mut *deser,
         333  +
                            response.headers(),
         334  +
                            response.status().into(),
         335  +
                            body,
         336  +
                        )
         337  +
                    }) {
         338  +
                        ::std::result::Result::Ok(val) => val,
         339  +
                        ::std::result::Result::Err(e) => {
         340  +
                            return ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(
         341  +
                                ::aws_smithy_runtime_api::box_error::BoxError::from(e),
         342  +
                            ))
         343  +
                        }
         344  +
                    };
         345  +
                    tmp.meta = generic;
         346  +
                    if tmp.message.is_none() {
         347  +
                        tmp.message = _error_message;
         348  +
                    }
         349  +
                    tmp
         350  +
                }),
         351  +
                _ => {
         352  +
                    // Registry-backed, operation-scoped reification of an error whose
         353  +
                    // code this operation does not model directly: the operation's own
         354  +
                    // error registry is consulted first, then the lookup widens to the
         355  +
                    // service-wide error registry. On a hit, the reified error is attached
         356  +
                    // as the source of the returned unhandled error while its metadata
         357  +
                    // (code, message, request id) is preserved; on a miss the generic
         358  +
                    // error is returned unchanged.
         359  +
                    match protocol
         360  +
                        .deserialize_error_response(response, _cfg)
         361  +
                        .ok()
         362  +
                        .and_then(|mut deser| {
         363  +
                            ::aws_smithy_schema::registry::reify_error(
         364  +
                                crate::operation::get_inventory_schema::error_registry::REGISTRY
         365  +
                                    .or(&crate::error_type_registry::REGISTRY),
         366  +
                                error_code,
         367  +
                                &mut *deser,
         368  +
                            )
         369  +
                        }) {
         370  +
                        ::std::option::Option::Some(source) => <crate::operation::get_inventory_schema::GetInventorySchemaError as ::aws_smithy_runtime_api::client::result::CreateUnhandledError>::create_unhandled_error(source, ::std::option::Option::Some(generic)),
         371  +
                        ::std::option::Option::None => crate::operation::get_inventory_schema::GetInventorySchemaError::generic(generic),
         372  +
                    }
         373  +
                }
         374  +
            };
         375  +
            ::std::result::Result::Err(::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::operation(
         376  +
                ::aws_smithy_runtime_api::client::interceptors::context::Error::erase(err),
         377  +
            ))
         378  +
        } else {
         379  +
            let protocol = _cfg
         380  +
                .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         381  +
                .expect("a SharedClientProtocol is required");
         382  +
            let mut deser = protocol
         383  +
                .deserialize_response(response, GetInventorySchema::OUTPUT_SCHEMA, _cfg)
         384  +
                .map_err(|e| {
         385  +
                    ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         386  +
                })?;
         387  +
            // body and headers are already in scope from the top of the function;
         388  +
            // alias `headers` as `_response_headers` so MutateOutput
         389  +
            // customizations have a stable name to read from.
         390  +
            let _response_headers = headers;
         391  +
            #[allow(unused_mut)]
         392  +
            let mut output = crate::operation::get_inventory_schema::GetInventorySchemaOutput::deserialize_with_response(
         393  +
                &mut *deser,
         394  +
                _response_headers,
         395  +
                response.status().into(),
         396  +
                body,
         397  +
            )
         398  +
            .map_err(|e| {
         399  +
                ::aws_smithy_runtime_api::client::orchestrator::OrchestratorError::other(::aws_smithy_runtime_api::box_error::BoxError::from(e))
         400  +
            })?;
         401  +
            output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
         402  +
            ::std::result::Result::Ok(::aws_smithy_runtime_api::client::interceptors::context::Output::erase(output))
         403  +
        }
         404  +
    }
         405  +
}
         406  +
#[derive(Debug)]
         407  +
struct GetInventorySchemaRequestSerializer;
         408  +
impl ::aws_smithy_runtime_api::client::ser_de::SerializeRequest for GetInventorySchemaRequestSerializer {
         409  +
    #[allow(unused_mut, clippy::let_and_return, clippy::needless_borrow, clippy::useless_conversion)]
         410  +
    fn serialize_input(
         411  +
        &self,
         412  +
        input: ::aws_smithy_runtime_api::client::interceptors::context::Input,
         413  +
        _cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         414  +
    ) -> ::std::result::Result<::aws_smithy_runtime_api::client::orchestrator::HttpRequest, ::aws_smithy_runtime_api::box_error::BoxError> {
         415  +
        let input = input
         416  +
            .downcast::<crate::operation::get_inventory_schema::GetInventorySchemaInput>()
         417  +
            .expect("correct type");
         418  +
         419  +
        let protocol = _cfg
         420  +
            .load::<::aws_smithy_schema::protocol::SharedClientProtocol>()
         421  +
            .expect("a SharedClientProtocol is required");
         422  +
        let mut request = protocol
         423  +
            .serialize_request(&input, GetInventorySchema::INPUT_SCHEMA, "/", _cfg)
         424  +
            .map_err(::aws_smithy_runtime_api::box_error::BoxError::from)?;
         425  +
         426  +
        return ::std::result::Result::Ok(request);
         427  +
    }
         428  +
}
         429  +
#[derive(Debug)]
         430  +
struct GetInventorySchemaEndpointParamsInterceptor;
         431  +
         432  +
#[::aws_smithy_runtime_api::client::interceptors::dyn_dispatch_hint]
         433  +
impl ::aws_smithy_runtime_api::client::interceptors::Intercept for GetInventorySchemaEndpointParamsInterceptor {
         434  +
    fn name(&self) -> &'static str {
         435  +
        "GetInventorySchemaEndpointParamsInterceptor"
         436  +
    }
         437  +
         438  +
    fn read_before_execution(
         439  +
        &self,
         440  +
        context: &::aws_smithy_runtime_api::client::interceptors::context::BeforeSerializationInterceptorContextRef<
         441  +
            '_,
         442  +
            ::aws_smithy_runtime_api::client::interceptors::context::Input,
         443  +
            ::aws_smithy_runtime_api::client::interceptors::context::Output,
         444  +
            ::aws_smithy_runtime_api::client::interceptors::context::Error,
         445  +
        >,
         446  +
        cfg: &mut ::aws_smithy_types::config_bag::ConfigBag,
         447  +
    ) -> ::std::result::Result<(), ::aws_smithy_runtime_api::box_error::BoxError> {
         448  +
        let _input = context
         449  +
            .input()
         450  +
            .downcast_ref::<GetInventorySchemaInput>()
         451  +
            .ok_or("failed to downcast to GetInventorySchemaInput")?;
         452  +
         453  +
        let params = crate::config::endpoint::Params::builder()
         454  +
            .set_region(cfg.load::<::aws_types::region::Region>().map(|r| r.as_ref().to_owned()))
         455  +
            .set_use_dual_stack(cfg.load::<::aws_types::endpoint_config::UseDualStack>().map(|ty| ty.0))
         456  +
            .set_use_fips(cfg.load::<::aws_types::endpoint_config::UseFips>().map(|ty| ty.0))
         457  +
            .set_endpoint(cfg.load::<::aws_types::endpoint_config::EndpointUrl>().map(|ty| ty.0.clone()))
         458  +
            .build()
         459  +
            .map_err(|err| {
         460  +
                ::aws_smithy_runtime_api::client::interceptors::error::ContextAttachedError::new("endpoint params could not be built", err)
         461  +
            })?;
         462  +
        cfg.interceptor_state()
         463  +
            .store_put(::aws_smithy_runtime_api::client::endpoint::EndpointResolverParams::new(params));
         464  +
        ::std::result::Result::Ok(())
         465  +
    }
         466  +
}
         467  +
         468  +
// The get_* functions below are generated from JMESPath expressions in the
         469  +
// operationContextParams trait. They target the operation's input shape.
         470  +
         471  +
/// Error type for the `GetInventorySchemaError` operation.
         472  +
#[non_exhaustive]
         473  +
#[derive(::std::fmt::Debug)]
         474  +
pub enum GetInventorySchemaError {
         475  +
    /// <p>An error occurred on the server side.</p>
         476  +
    InternalServerError(crate::types::error::InternalServerError),
         477  +
    /// <p>The specified token isn't valid.</p>
         478  +
    InvalidNextToken(crate::types::error::InvalidNextToken),
         479  +
    /// <p>The parameter type name isn't valid.</p>
         480  +
    InvalidTypeNameException(crate::types::error::InvalidTypeNameException),
         481  +
    /// An unexpected error occurred (e.g., invalid JSON returned by the service or an unknown error code).
         482  +
    #[deprecated(note = "Matching `Unhandled` directly is not forwards compatible. Instead, match using a \
         483  +
    variable wildcard pattern and check `.code()`:
         484  +
     \
         485  +
    &nbsp;&nbsp;&nbsp;`err if err.code() == Some(\"SpecificExceptionCode\") => { /* handle the error */ }`
         486  +
     \
         487  +
    See [`ProvideErrorMetadata`](#impl-ProvideErrorMetadata-for-GetInventorySchemaError) for what information is available for the error.")]
         488  +
    Unhandled(crate::error::sealed_unhandled::Unhandled),
         489  +
}
         490  +
impl GetInventorySchemaError {
         491  +
    /// Creates the `GetInventorySchemaError::Unhandled` variant from any error type.
         492  +
    pub fn unhandled(
         493  +
        err: impl ::std::convert::Into<::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>>,
         494  +
    ) -> Self {
         495  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         496  +
            source: err.into(),
         497  +
            meta: ::std::default::Default::default(),
         498  +
        })
         499  +
    }
         500  +
         501  +
    /// Creates the `GetInventorySchemaError::Unhandled` variant from an [`ErrorMetadata`](::aws_smithy_types::error::ErrorMetadata).
         502  +
    pub fn generic(err: ::aws_smithy_types::error::ErrorMetadata) -> Self {
         503  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         504  +
            source: err.clone().into(),
         505  +
            meta: err,
         506  +
        })
         507  +
    }
         508  +
    ///
         509  +
    /// Returns error metadata, which includes the error code, message,
         510  +
    /// request ID, and potentially additional information.
         511  +
    ///
         512  +
    pub fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         513  +
        match self {
         514  +
            Self::InternalServerError(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         515  +
            Self::InvalidNextToken(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         516  +
            Self::InvalidTypeNameException(e) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(e),
         517  +
            Self::Unhandled(e) => &e.meta,
         518  +
        }
         519  +
    }
         520  +
    /// Returns `true` if the error kind is `GetInventorySchemaError::InternalServerError`.
         521  +
    pub fn is_internal_server_error(&self) -> bool {
         522  +
        matches!(self, Self::InternalServerError(_))
         523  +
    }
         524  +
    /// Returns `true` if the error kind is `GetInventorySchemaError::InvalidNextToken`.
         525  +
    pub fn is_invalid_next_token(&self) -> bool {
         526  +
        matches!(self, Self::InvalidNextToken(_))
         527  +
    }
         528  +
    /// Returns `true` if the error kind is `GetInventorySchemaError::InvalidTypeNameException`.
         529  +
    pub fn is_invalid_type_name_exception(&self) -> bool {
         530  +
        matches!(self, Self::InvalidTypeNameException(_))
         531  +
    }
         532  +
}
         533  +
impl ::std::error::Error for GetInventorySchemaError {
         534  +
    fn source(&self) -> ::std::option::Option<&(dyn ::std::error::Error + 'static)> {
         535  +
        match self {
         536  +
            Self::InternalServerError(_inner) => ::std::option::Option::Some(_inner),
         537  +
            Self::InvalidNextToken(_inner) => ::std::option::Option::Some(_inner),
         538  +
            Self::InvalidTypeNameException(_inner) => ::std::option::Option::Some(_inner),
         539  +
            Self::Unhandled(_inner) => ::std::option::Option::Some(&*_inner.source),
         540  +
        }
         541  +
    }
         542  +
}
         543  +
impl ::std::fmt::Display for GetInventorySchemaError {
         544  +
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         545  +
        match self {
         546  +
            Self::InternalServerError(_inner) => _inner.fmt(f),
         547  +
            Self::InvalidNextToken(_inner) => _inner.fmt(f),
         548  +
            Self::InvalidTypeNameException(_inner) => _inner.fmt(f),
         549  +
            Self::Unhandled(_inner) => {
         550  +
                if let ::std::option::Option::Some(code) = ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self) {
         551  +
                    write!(f, "unhandled error ({code})")
         552  +
                } else {
         553  +
                    f.write_str("unhandled error")
         554  +
                }
         555  +
            }
         556  +
        }
         557  +
    }
         558  +
}
         559  +
impl ::aws_smithy_types::retry::ProvideErrorKind for GetInventorySchemaError {
         560  +
    fn code(&self) -> ::std::option::Option<&str> {
         561  +
        ::aws_smithy_types::error::metadata::ProvideErrorMetadata::code(self)
         562  +
    }
         563  +
    fn retryable_error_kind(&self) -> ::std::option::Option<::aws_smithy_types::retry::ErrorKind> {
         564  +
        ::std::option::Option::None
         565  +
    }
         566  +
}
         567  +
impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for GetInventorySchemaError {
         568  +
    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
         569  +
        match self {
         570  +
            Self::InternalServerError(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         571  +
            Self::InvalidNextToken(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         572  +
            Self::InvalidTypeNameException(_inner) => ::aws_smithy_types::error::metadata::ProvideErrorMetadata::meta(_inner),
         573  +
            Self::Unhandled(_inner) => &_inner.meta,
         574  +
        }
         575  +
    }
         576  +
}
         577  +
impl ::aws_smithy_runtime_api::client::result::CreateUnhandledError for GetInventorySchemaError {
         578  +
    fn create_unhandled_error(
         579  +
        source: ::std::boxed::Box<dyn ::std::error::Error + ::std::marker::Send + ::std::marker::Sync + 'static>,
         580  +
        meta: ::std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
         581  +
    ) -> Self {
         582  +
        Self::Unhandled(crate::error::sealed_unhandled::Unhandled {
         583  +
            source,
         584  +
            meta: meta.unwrap_or_default(),
         585  +
        })
         586  +
    }
         587  +
}
         588  +
impl ::aws_types::request_id::RequestId for crate::operation::get_inventory_schema::GetInventorySchemaError {
         589  +
    fn request_id(&self) -> Option<&str> {
         590  +
        self.meta().request_id()
         591  +
    }
         592  +
}
         593  +
         594  +
pub use crate::operation::get_inventory_schema::_get_inventory_schema_input::GetInventorySchemaInput;
         595  +
         596  +
pub use crate::operation::get_inventory_schema::_get_inventory_schema_output::GetInventorySchemaOutput;
         597  +
         598  +
mod _get_inventory_schema_input;
         599  +
         600  +
mod _get_inventory_schema_output;
         601  +
         602  +
/// Builders
         603  +
pub mod builders;
         604  +
         605  +
/// Paginator for this operation
         606  +
pub mod paginator;

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/get_inventory_schema/_get_inventory_schema_input.rs

@@ -0,1 +0,304 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct GetInventorySchemaInput {
           6  +
    /// <p>The type of inventory item to return.</p>
           7  +
    pub type_name: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
           9  +
    pub next_token: ::std::option::Option<::std::string::String>,
          10  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
          11  +
    pub max_results: ::std::option::Option<i32>,
          12  +
    /// <p>Returns inventory schemas that support aggregation. For example, this call returns the <code>AWS:InstanceInformation</code> type, because it supports aggregation based on the <code>PlatformName</code>, <code>PlatformType</code>, and <code>PlatformVersion</code> attributes.</p>
          13  +
    pub aggregator: ::std::option::Option<bool>,
          14  +
    /// <p>Returns the sub-type schema for a specified inventory type.</p>
          15  +
    pub sub_type: ::std::option::Option<bool>,
          16  +
}
          17  +
impl GetInventorySchemaInput {
          18  +
    /// <p>The type of inventory item to return.</p>
          19  +
    pub fn type_name(&self) -> ::std::option::Option<&str> {
          20  +
        self.type_name.as_deref()
          21  +
    }
          22  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
          23  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          24  +
        self.next_token.as_deref()
          25  +
    }
          26  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
          27  +
    pub fn max_results(&self) -> ::std::option::Option<i32> {
          28  +
        self.max_results
          29  +
    }
          30  +
    /// <p>Returns inventory schemas that support aggregation. For example, this call returns the <code>AWS:InstanceInformation</code> type, because it supports aggregation based on the <code>PlatformName</code>, <code>PlatformType</code>, and <code>PlatformVersion</code> attributes.</p>
          31  +
    pub fn aggregator(&self) -> ::std::option::Option<bool> {
          32  +
        self.aggregator
          33  +
    }
          34  +
    /// <p>Returns the sub-type schema for a specified inventory type.</p>
          35  +
    pub fn sub_type(&self) -> ::std::option::Option<bool> {
          36  +
        self.sub_type
          37  +
    }
          38  +
}
          39  +
static GETINVENTORYSCHEMAINPUT_MEMBER_TYPE_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          40  +
    ::aws_smithy_schema::ShapeId::from_parts(
          41  +
        "com.amazonaws.ssm.synthetic#GetInventorySchemaInput$TypeName",
          42  +
        "com.amazonaws.ssm.synthetic",
          43  +
        "GetInventorySchemaInput",
          44  +
    ),
          45  +
    ::aws_smithy_schema::ShapeType::String,
          46  +
    "TypeName",
          47  +
    0,
          48  +
);
          49  +
static GETINVENTORYSCHEMAINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          50  +
    ::aws_smithy_schema::ShapeId::from_parts(
          51  +
        "com.amazonaws.ssm.synthetic#GetInventorySchemaInput$NextToken",
          52  +
        "com.amazonaws.ssm.synthetic",
          53  +
        "GetInventorySchemaInput",
          54  +
    ),
          55  +
    ::aws_smithy_schema::ShapeType::String,
          56  +
    "NextToken",
          57  +
    1,
          58  +
);
          59  +
static GETINVENTORYSCHEMAINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          60  +
    ::aws_smithy_schema::ShapeId::from_parts(
          61  +
        "com.amazonaws.ssm.synthetic#GetInventorySchemaInput$MaxResults",
          62  +
        "com.amazonaws.ssm.synthetic",
          63  +
        "GetInventorySchemaInput",
          64  +
    ),
          65  +
    ::aws_smithy_schema::ShapeType::Integer,
          66  +
    "MaxResults",
          67  +
    2,
          68  +
);
          69  +
static GETINVENTORYSCHEMAINPUT_MEMBER_AGGREGATOR: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          70  +
    ::aws_smithy_schema::ShapeId::from_parts(
          71  +
        "com.amazonaws.ssm.synthetic#GetInventorySchemaInput$Aggregator",
          72  +
        "com.amazonaws.ssm.synthetic",
          73  +
        "GetInventorySchemaInput",
          74  +
    ),
          75  +
    ::aws_smithy_schema::ShapeType::Boolean,
          76  +
    "Aggregator",
          77  +
    3,
          78  +
);
          79  +
static GETINVENTORYSCHEMAINPUT_MEMBER_SUB_TYPE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          80  +
    ::aws_smithy_schema::ShapeId::from_parts(
          81  +
        "com.amazonaws.ssm.synthetic#GetInventorySchemaInput$SubType",
          82  +
        "com.amazonaws.ssm.synthetic",
          83  +
        "GetInventorySchemaInput",
          84  +
    ),
          85  +
    ::aws_smithy_schema::ShapeType::Boolean,
          86  +
    "SubType",
          87  +
    4,
          88  +
);
          89  +
static GETINVENTORYSCHEMAINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          90  +
    ::aws_smithy_schema::ShapeId::from_parts(
          91  +
        "com.amazonaws.ssm.synthetic#GetInventorySchemaInput",
          92  +
        "com.amazonaws.ssm.synthetic",
          93  +
        "GetInventorySchemaInput",
          94  +
    ),
          95  +
    ::aws_smithy_schema::ShapeType::Structure,
          96  +
    &[
          97  +
        &GETINVENTORYSCHEMAINPUT_MEMBER_TYPE_NAME,
          98  +
        &GETINVENTORYSCHEMAINPUT_MEMBER_NEXT_TOKEN,
          99  +
        &GETINVENTORYSCHEMAINPUT_MEMBER_MAX_RESULTS,
         100  +
        &GETINVENTORYSCHEMAINPUT_MEMBER_AGGREGATOR,
         101  +
        &GETINVENTORYSCHEMAINPUT_MEMBER_SUB_TYPE,
         102  +
    ],
         103  +
)
         104  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
         105  +
.with_original_name("GetInventorySchemaRequest");
         106  +
impl GetInventorySchemaInput {
         107  +
    /// The schema for this shape.
         108  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETINVENTORYSCHEMAINPUT_SCHEMA;
         109  +
}
         110  +
impl ::aws_smithy_schema::serde::SerializableStruct for GetInventorySchemaInput {
         111  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         112  +
    fn serialize_members(
         113  +
        &self,
         114  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         115  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         116  +
        if let Some(ref val) = self.type_name {
         117  +
            ser.write_string(&GETINVENTORYSCHEMAINPUT_MEMBER_TYPE_NAME, val)?;
         118  +
        }
         119  +
        if let Some(ref val) = self.next_token {
         120  +
            ser.write_string(&GETINVENTORYSCHEMAINPUT_MEMBER_NEXT_TOKEN, val)?;
         121  +
        }
         122  +
        if let Some(ref val) = self.max_results {
         123  +
            ser.write_integer(&GETINVENTORYSCHEMAINPUT_MEMBER_MAX_RESULTS, *val)?;
         124  +
        }
         125  +
        if let Some(ref val) = self.aggregator {
         126  +
            ser.write_boolean(&GETINVENTORYSCHEMAINPUT_MEMBER_AGGREGATOR, *val)?;
         127  +
        }
         128  +
        if let Some(ref val) = self.sub_type {
         129  +
            ser.write_boolean(&GETINVENTORYSCHEMAINPUT_MEMBER_SUB_TYPE, *val)?;
         130  +
        }
         131  +
        Ok(())
         132  +
    }
         133  +
}
         134  +
impl GetInventorySchemaInput {
         135  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         136  +
    pub fn deserialize(
         137  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         138  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         139  +
        #[allow(unused_variables, unused_mut)]
         140  +
        let mut builder = Self::builder();
         141  +
        #[allow(
         142  +
            unused_variables,
         143  +
            unreachable_code,
         144  +
            clippy::single_match,
         145  +
            clippy::match_single_binding,
         146  +
            clippy::diverging_sub_expression
         147  +
        )]
         148  +
        deserializer.read_struct(&GETINVENTORYSCHEMAINPUT_SCHEMA, &mut |member, deser| {
         149  +
            match member.member_index() {
         150  +
                Some(0) => {
         151  +
                    if deser.is_null() {
         152  +
                        deser.read_null()?;
         153  +
                    } else {
         154  +
                        builder.type_name = Some(deser.read_string(member)?);
         155  +
                    }
         156  +
                }
         157  +
                Some(1) => {
         158  +
                    if deser.is_null() {
         159  +
                        deser.read_null()?;
         160  +
                    } else {
         161  +
                        builder.next_token = Some(deser.read_string(member)?);
         162  +
                    }
         163  +
                }
         164  +
                Some(2) => {
         165  +
                    if deser.is_null() {
         166  +
                        deser.read_null()?;
         167  +
                    } else {
         168  +
                        builder.max_results = Some(deser.read_integer(member)?);
         169  +
                    }
         170  +
                }
         171  +
                Some(3) => {
         172  +
                    if deser.is_null() {
         173  +
                        deser.read_null()?;
         174  +
                    } else {
         175  +
                        builder.aggregator = Some(deser.read_boolean(member)?);
         176  +
                    }
         177  +
                }
         178  +
                Some(4) => {
         179  +
                    if deser.is_null() {
         180  +
                        deser.read_null()?;
         181  +
                    } else {
         182  +
                        builder.sub_type = Some(deser.read_boolean(member)?);
         183  +
                    }
         184  +
                }
         185  +
                _ => {}
         186  +
            }
         187  +
            Ok(())
         188  +
        })?;
         189  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         190  +
    }
         191  +
}
         192  +
impl GetInventorySchemaInput {
         193  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         194  +
    pub fn deserialize_with_response(
         195  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         196  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         197  +
        _status: u16,
         198  +
        _body: &[u8],
         199  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         200  +
        Self::deserialize(deserializer)
         201  +
    }
         202  +
}
         203  +
impl GetInventorySchemaInput {
         204  +
    /// Creates a new builder-style object to manufacture [`GetInventorySchemaInput`](crate::operation::get_inventory_schema::GetInventorySchemaInput).
         205  +
    pub fn builder() -> crate::operation::get_inventory_schema::builders::GetInventorySchemaInputBuilder {
         206  +
        crate::operation::get_inventory_schema::builders::GetInventorySchemaInputBuilder::default()
         207  +
    }
         208  +
}
         209  +
         210  +
/// A builder for [`GetInventorySchemaInput`](crate::operation::get_inventory_schema::GetInventorySchemaInput).
         211  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         212  +
#[non_exhaustive]
         213  +
pub struct GetInventorySchemaInputBuilder {
         214  +
    pub(crate) type_name: ::std::option::Option<::std::string::String>,
         215  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         216  +
    pub(crate) max_results: ::std::option::Option<i32>,
         217  +
    pub(crate) aggregator: ::std::option::Option<bool>,
         218  +
    pub(crate) sub_type: ::std::option::Option<bool>,
         219  +
}
         220  +
impl GetInventorySchemaInputBuilder {
         221  +
    /// <p>The type of inventory item to return.</p>
         222  +
    pub fn type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         223  +
        self.type_name = ::std::option::Option::Some(input.into());
         224  +
        self
         225  +
    }
         226  +
    /// <p>The type of inventory item to return.</p>
         227  +
    pub fn set_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         228  +
        self.type_name = input;
         229  +
        self
         230  +
    }
         231  +
    /// <p>The type of inventory item to return.</p>
         232  +
    pub fn get_type_name(&self) -> &::std::option::Option<::std::string::String> {
         233  +
        &self.type_name
         234  +
    }
         235  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         236  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         237  +
        self.next_token = ::std::option::Option::Some(input.into());
         238  +
        self
         239  +
    }
         240  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         241  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         242  +
        self.next_token = input;
         243  +
        self
         244  +
    }
         245  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         246  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         247  +
        &self.next_token
         248  +
    }
         249  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         250  +
    pub fn max_results(mut self, input: i32) -> Self {
         251  +
        self.max_results = ::std::option::Option::Some(input);
         252  +
        self
         253  +
    }
         254  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         255  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         256  +
        self.max_results = input;
         257  +
        self
         258  +
    }
         259  +
    /// <p>The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.</p>
         260  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         261  +
        &self.max_results
         262  +
    }
         263  +
    /// <p>Returns inventory schemas that support aggregation. For example, this call returns the <code>AWS:InstanceInformation</code> type, because it supports aggregation based on the <code>PlatformName</code>, <code>PlatformType</code>, and <code>PlatformVersion</code> attributes.</p>
         264  +
    pub fn aggregator(mut self, input: bool) -> Self {
         265  +
        self.aggregator = ::std::option::Option::Some(input);
         266  +
        self
         267  +
    }
         268  +
    /// <p>Returns inventory schemas that support aggregation. For example, this call returns the <code>AWS:InstanceInformation</code> type, because it supports aggregation based on the <code>PlatformName</code>, <code>PlatformType</code>, and <code>PlatformVersion</code> attributes.</p>
         269  +
    pub fn set_aggregator(mut self, input: ::std::option::Option<bool>) -> Self {
         270  +
        self.aggregator = input;
         271  +
        self
         272  +
    }
         273  +
    /// <p>Returns inventory schemas that support aggregation. For example, this call returns the <code>AWS:InstanceInformation</code> type, because it supports aggregation based on the <code>PlatformName</code>, <code>PlatformType</code>, and <code>PlatformVersion</code> attributes.</p>
         274  +
    pub fn get_aggregator(&self) -> &::std::option::Option<bool> {
         275  +
        &self.aggregator
         276  +
    }
         277  +
    /// <p>Returns the sub-type schema for a specified inventory type.</p>
         278  +
    pub fn sub_type(mut self, input: bool) -> Self {
         279  +
        self.sub_type = ::std::option::Option::Some(input);
         280  +
        self
         281  +
    }
         282  +
    /// <p>Returns the sub-type schema for a specified inventory type.</p>
         283  +
    pub fn set_sub_type(mut self, input: ::std::option::Option<bool>) -> Self {
         284  +
        self.sub_type = input;
         285  +
        self
         286  +
    }
         287  +
    /// <p>Returns the sub-type schema for a specified inventory type.</p>
         288  +
    pub fn get_sub_type(&self) -> &::std::option::Option<bool> {
         289  +
        &self.sub_type
         290  +
    }
         291  +
    /// Consumes the builder and constructs a [`GetInventorySchemaInput`](crate::operation::get_inventory_schema::GetInventorySchemaInput).
         292  +
    pub fn build(
         293  +
        self,
         294  +
    ) -> ::std::result::Result<crate::operation::get_inventory_schema::GetInventorySchemaInput, ::aws_smithy_types::error::operation::BuildError>
         295  +
    {
         296  +
        ::std::result::Result::Ok(crate::operation::get_inventory_schema::GetInventorySchemaInput {
         297  +
            type_name: self.type_name,
         298  +
            next_token: self.next_token,
         299  +
            max_results: self.max_results,
         300  +
            aggregator: self.aggregator,
         301  +
            sub_type: self.sub_type,
         302  +
        })
         303  +
    }
         304  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/get_inventory_schema/_get_inventory_schema_output.rs

@@ -0,1 +0,273 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
#[allow(missing_docs)] // documentation missing in model
           3  +
#[non_exhaustive]
           4  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
           5  +
pub struct GetInventorySchemaOutput {
           6  +
    /// <p>Inventory schemas returned by the request.</p>
           7  +
    pub schemas: ::std::option::Option<::std::vec::Vec<crate::types::InventoryItemSchema>>,
           8  +
    /// <p>The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.</p>
           9  +
    pub next_token: ::std::option::Option<::std::string::String>,
          10  +
    _request_id: Option<String>,
          11  +
}
          12  +
impl GetInventorySchemaOutput {
          13  +
    /// <p>Inventory schemas returned by the request.</p>
          14  +
    ///
          15  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.schemas.is_none()`.
          16  +
    pub fn schemas(&self) -> &[crate::types::InventoryItemSchema] {
          17  +
        self.schemas.as_deref().unwrap_or_default()
          18  +
    }
          19  +
    /// <p>The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.</p>
          20  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          21  +
        self.next_token.as_deref()
          22  +
    }
          23  +
}
          24  +
static GETINVENTORYSCHEMAOUTPUT_MEMBER_SCHEMAS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          25  +
    ::aws_smithy_schema::ShapeId::from_parts(
          26  +
        "com.amazonaws.ssm#InventoryItemSchemaResultList$member",
          27  +
        "com.amazonaws.ssm",
          28  +
        "InventoryItemSchemaResultList",
          29  +
    ),
          30  +
    ::aws_smithy_schema::ShapeType::Structure,
          31  +
    "member",
          32  +
    0,
          33  +
);
          34  +
static GETINVENTORYSCHEMAOUTPUT_MEMBER_SCHEMAS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          35  +
    ::aws_smithy_schema::ShapeId::from_parts(
          36  +
        "com.amazonaws.ssm.synthetic#GetInventorySchemaOutput$Schemas",
          37  +
        "com.amazonaws.ssm.synthetic",
          38  +
        "GetInventorySchemaOutput",
          39  +
    ),
          40  +
    ::aws_smithy_schema::ShapeType::List,
          41  +
    "Schemas",
          42  +
    0,
          43  +
)
          44  +
.with_list_member(&GETINVENTORYSCHEMAOUTPUT_MEMBER_SCHEMAS_MEMBER);
          45  +
static GETINVENTORYSCHEMAOUTPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          46  +
    ::aws_smithy_schema::ShapeId::from_parts(
          47  +
        "com.amazonaws.ssm.synthetic#GetInventorySchemaOutput$NextToken",
          48  +
        "com.amazonaws.ssm.synthetic",
          49  +
        "GetInventorySchemaOutput",
          50  +
    ),
          51  +
    ::aws_smithy_schema::ShapeType::String,
          52  +
    "NextToken",
          53  +
    1,
          54  +
);
          55  +
static GETINVENTORYSCHEMAOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          56  +
    ::aws_smithy_schema::ShapeId::from_parts("synthetic#request_id", "synthetic", "request_id"),
          57  +
    ::aws_smithy_schema::ShapeType::String,
          58  +
    "request_id",
          59  +
    2,
          60  +
)
          61  +
.with_http_header("x-amzn-requestid");
          62  +
static GETINVENTORYSCHEMAOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          63  +
    ::aws_smithy_schema::ShapeId::from_parts(
          64  +
        "com.amazonaws.ssm.synthetic#GetInventorySchemaOutput",
          65  +
        "com.amazonaws.ssm.synthetic",
          66  +
        "GetInventorySchemaOutput",
          67  +
    ),
          68  +
    ::aws_smithy_schema::ShapeType::Structure,
          69  +
    &[
          70  +
        &GETINVENTORYSCHEMAOUTPUT_MEMBER_SCHEMAS,
          71  +
        &GETINVENTORYSCHEMAOUTPUT_MEMBER_NEXT_TOKEN,
          72  +
        &GETINVENTORYSCHEMAOUTPUT_MEMBER__REQUEST_ID,
          73  +
    ],
          74  +
)
          75  +
.with_original_name("GetInventorySchemaResult");
          76  +
impl GetInventorySchemaOutput {
          77  +
    /// The schema for this shape.
          78  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETINVENTORYSCHEMAOUTPUT_SCHEMA;
          79  +
}
          80  +
impl ::aws_smithy_schema::serde::SerializableStruct for GetInventorySchemaOutput {
          81  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          82  +
    fn serialize_members(
          83  +
        &self,
          84  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          85  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          86  +
        if let Some(ref val) = self.schemas {
          87  +
            ser.write_list(
          88  +
                &GETINVENTORYSCHEMAOUTPUT_MEMBER_SCHEMAS,
          89  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          90  +
                    for item in val {
          91  +
                        ser.write_struct(crate::types::InventoryItemSchema::SCHEMA, item)?;
          92  +
                    }
          93  +
                    Ok(())
          94  +
                },
          95  +
            )?;
          96  +
        }
          97  +
        if let Some(ref val) = self.next_token {
          98  +
            ser.write_string(&GETINVENTORYSCHEMAOUTPUT_MEMBER_NEXT_TOKEN, val)?;
          99  +
        }
         100  +
        Ok(())
         101  +
    }
         102  +
}
         103  +
impl GetInventorySchemaOutput {
         104  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         105  +
    pub fn deserialize(
         106  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         107  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         108  +
        #[allow(unused_variables, unused_mut)]
         109  +
        let mut builder = Self::builder();
         110  +
        #[allow(
         111  +
            unused_variables,
         112  +
            unreachable_code,
         113  +
            clippy::single_match,
         114  +
            clippy::match_single_binding,
         115  +
            clippy::diverging_sub_expression
         116  +
        )]
         117  +
        deserializer.read_struct(&GETINVENTORYSCHEMAOUTPUT_SCHEMA, &mut |member, deser| {
         118  +
            match member.member_index() {
         119  +
                Some(0) => {
         120  +
                    if deser.is_null() {
         121  +
                        deser.read_null()?;
         122  +
                    } else {
         123  +
                        builder.schemas = Some({
         124  +
                            let mut container = Vec::new();
         125  +
                            deser.read_list(member, &mut |deser| {
         126  +
                                container.push(crate::types::InventoryItemSchema::deserialize(deser)?);
         127  +
                                Ok(())
         128  +
                            })?;
         129  +
                            container
         130  +
                        });
         131  +
                    }
         132  +
                }
         133  +
                Some(1) => {
         134  +
                    if deser.is_null() {
         135  +
                        deser.read_null()?;
         136  +
                    } else {
         137  +
                        builder.next_token = Some(deser.read_string(member)?);
         138  +
                    }
         139  +
                }
         140  +
                Some(2) => {
         141  +
                    builder._request_id = Some(deser.read_string(member)?);
         142  +
                }
         143  +
                _ => {}
         144  +
            }
         145  +
            Ok(())
         146  +
        })?;
         147  +
        Ok(builder.build())
         148  +
    }
         149  +
}
         150  +
impl GetInventorySchemaOutput {
         151  +
    /// Deserializes this structure from a body deserializer and HTTP response headers.
         152  +
    /// Header-bound members are read directly from headers, avoiding runtime
         153  +
    /// member iteration overhead. Body members are read via the deserializer.
         154  +
    pub fn deserialize_with_response(
         155  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         156  +
        headers: &::aws_smithy_runtime_api::http::Headers,
         157  +
        _status: u16,
         158  +
        _body: &[u8],
         159  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         160  +
        #[allow(unused_variables, unused_mut)]
         161  +
        let mut builder = Self::builder();
         162  +
        if let Some(val) = headers.get("x-amzn-requestid") {
         163  +
            builder._request_id = Some(val.to_string());
         164  +
        }
         165  +
         166  +
        #[allow(
         167  +
            unused_variables,
         168  +
            unreachable_code,
         169  +
            clippy::single_match,
         170  +
            clippy::match_single_binding,
         171  +
            clippy::diverging_sub_expression
         172  +
        )]
         173  +
        deserializer.read_struct(&GETINVENTORYSCHEMAOUTPUT_SCHEMA, &mut |member, deser| {
         174  +
            match member.member_index() {
         175  +
                Some(0) => {
         176  +
                    builder.schemas = Some({
         177  +
                        let mut container = Vec::new();
         178  +
                        deser.read_list(member, &mut |deser| {
         179  +
                            container.push(crate::types::InventoryItemSchema::deserialize(deser)?);
         180  +
                            Ok(())
         181  +
                        })?;
         182  +
                        container
         183  +
                    });
         184  +
                }
         185  +
                Some(1) => {
         186  +
                    builder.next_token = Some(deser.read_string(member)?);
         187  +
                }
         188  +
                _ => {}
         189  +
            }
         190  +
            Ok(())
         191  +
        })?;
         192  +
        Ok(builder.build())
         193  +
    }
         194  +
}
         195  +
impl ::aws_types::request_id::RequestId for GetInventorySchemaOutput {
         196  +
    fn request_id(&self) -> Option<&str> {
         197  +
        self._request_id.as_deref()
         198  +
    }
         199  +
}
         200  +
impl GetInventorySchemaOutput {
         201  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         202  +
        self._request_id = request_id;
         203  +
        self
         204  +
    }
         205  +
}
         206  +
impl GetInventorySchemaOutput {
         207  +
    /// Creates a new builder-style object to manufacture [`GetInventorySchemaOutput`](crate::operation::get_inventory_schema::GetInventorySchemaOutput).
         208  +
    pub fn builder() -> crate::operation::get_inventory_schema::builders::GetInventorySchemaOutputBuilder {
         209  +
        crate::operation::get_inventory_schema::builders::GetInventorySchemaOutputBuilder::default()
         210  +
    }
         211  +
}
         212  +
         213  +
/// A builder for [`GetInventorySchemaOutput`](crate::operation::get_inventory_schema::GetInventorySchemaOutput).
         214  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         215  +
#[non_exhaustive]
         216  +
pub struct GetInventorySchemaOutputBuilder {
         217  +
    pub(crate) schemas: ::std::option::Option<::std::vec::Vec<crate::types::InventoryItemSchema>>,
         218  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         219  +
    _request_id: Option<String>,
         220  +
}
         221  +
impl GetInventorySchemaOutputBuilder {
         222  +
    /// Appends an item to `schemas`.
         223  +
    ///
         224  +
    /// To override the contents of this collection use [`set_schemas`](Self::set_schemas).
         225  +
    ///
         226  +
    /// <p>Inventory schemas returned by the request.</p>
         227  +
    pub fn schemas(mut self, input: crate::types::InventoryItemSchema) -> Self {
         228  +
        let mut v = self.schemas.unwrap_or_default();
         229  +
        v.push(input);
         230  +
        self.schemas = ::std::option::Option::Some(v);
         231  +
        self
         232  +
    }
         233  +
    /// <p>Inventory schemas returned by the request.</p>
         234  +
    pub fn set_schemas(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InventoryItemSchema>>) -> Self {
         235  +
        self.schemas = input;
         236  +
        self
         237  +
    }
         238  +
    /// <p>Inventory schemas returned by the request.</p>
         239  +
    pub fn get_schemas(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InventoryItemSchema>> {
         240  +
        &self.schemas
         241  +
    }
         242  +
    /// <p>The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.</p>
         243  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         244  +
        self.next_token = ::std::option::Option::Some(input.into());
         245  +
        self
         246  +
    }
         247  +
    /// <p>The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.</p>
         248  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         249  +
        self.next_token = input;
         250  +
        self
         251  +
    }
         252  +
    /// <p>The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.</p>
         253  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         254  +
        &self.next_token
         255  +
    }
         256  +
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
         257  +
        self._request_id = Some(request_id.into());
         258  +
        self
         259  +
    }
         260  +
         261  +
    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
         262  +
        self._request_id = request_id;
         263  +
        self
         264  +
    }
         265  +
    /// Consumes the builder and constructs a [`GetInventorySchemaOutput`](crate::operation::get_inventory_schema::GetInventorySchemaOutput).
         266  +
    pub fn build(self) -> crate::operation::get_inventory_schema::GetInventorySchemaOutput {
         267  +
        crate::operation::get_inventory_schema::GetInventorySchemaOutput {
         268  +
            schemas: self.schemas,
         269  +
            next_token: self.next_token,
         270  +
            _request_id: self._request_id,
         271  +
        }
         272  +
    }
         273  +
}