AWS SDK

AWS SDK

rev. 18b1dd205ff4335251e6dd0ecb88193de1b1cede

Files changed:

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

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

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

@@ -0,1 +0,297 @@
           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 DescribePatchGroupsInput {
           6  +
    /// <p>The maximum number of patch groups to return (per page).</p>
           7  +
    pub max_results: ::std::option::Option<i32>,
           8  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
           9  +
    /// <p>Supported keys for <code>DescribePatchGroups</code> include the following:</p>
          10  +
    /// <ul>
          11  +
    /// <li>
          12  +
    /// <p><b> <code>NAME_PREFIX</code> </b></p>
          13  +
    /// <p>Sample values: <code>AWS-</code> | <code>My-</code>.</p></li>
          14  +
    /// <li>
          15  +
    /// <p><b> <code>OPERATING_SYSTEM</code> </b></p>
          16  +
    /// <p>Sample values: <code>AMAZON_LINUX</code> | <code>SUSE</code> | <code>WINDOWS</code></p></li>
          17  +
    /// </ul>
          18  +
    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>,
          19  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
          20  +
    pub next_token: ::std::option::Option<::std::string::String>,
          21  +
}
          22  +
impl DescribePatchGroupsInput {
          23  +
    /// <p>The maximum number of patch groups to return (per page).</p>
          24  +
    pub fn max_results(&self) -> ::std::option::Option<i32> {
          25  +
        self.max_results
          26  +
    }
          27  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
          28  +
    /// <p>Supported keys for <code>DescribePatchGroups</code> include the following:</p>
          29  +
    /// <ul>
          30  +
    /// <li>
          31  +
    /// <p><b> <code>NAME_PREFIX</code> </b></p>
          32  +
    /// <p>Sample values: <code>AWS-</code> | <code>My-</code>.</p></li>
          33  +
    /// <li>
          34  +
    /// <p><b> <code>OPERATING_SYSTEM</code> </b></p>
          35  +
    /// <p>Sample values: <code>AMAZON_LINUX</code> | <code>SUSE</code> | <code>WINDOWS</code></p></li>
          36  +
    /// </ul>
          37  +
    ///
          38  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
          39  +
    pub fn filters(&self) -> &[crate::types::PatchOrchestratorFilter] {
          40  +
        self.filters.as_deref().unwrap_or_default()
          41  +
    }
          42  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
          43  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          44  +
        self.next_token.as_deref()
          45  +
    }
          46  +
}
          47  +
static DESCRIBEPATCHGROUPSINPUT_MEMBER_MAX_RESULTS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          48  +
    ::aws_smithy_schema::ShapeId::from_parts(
          49  +
        "com.amazonaws.ssm.synthetic#DescribePatchGroupsInput$MaxResults",
          50  +
        "com.amazonaws.ssm.synthetic",
          51  +
        "DescribePatchGroupsInput",
          52  +
    ),
          53  +
    ::aws_smithy_schema::ShapeType::Integer,
          54  +
    "MaxResults",
          55  +
    0,
          56  +
);
          57  +
static DESCRIBEPATCHGROUPSINPUT_MEMBER_FILTERS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          58  +
    ::aws_smithy_schema::ShapeId::from_parts(
          59  +
        "com.amazonaws.ssm#PatchOrchestratorFilterList$member",
          60  +
        "com.amazonaws.ssm",
          61  +
        "PatchOrchestratorFilterList",
          62  +
    ),
          63  +
    ::aws_smithy_schema::ShapeType::Structure,
          64  +
    "member",
          65  +
    0,
          66  +
);
          67  +
static DESCRIBEPATCHGROUPSINPUT_MEMBER_FILTERS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          68  +
    ::aws_smithy_schema::ShapeId::from_parts(
          69  +
        "com.amazonaws.ssm.synthetic#DescribePatchGroupsInput$Filters",
          70  +
        "com.amazonaws.ssm.synthetic",
          71  +
        "DescribePatchGroupsInput",
          72  +
    ),
          73  +
    ::aws_smithy_schema::ShapeType::List,
          74  +
    "Filters",
          75  +
    1,
          76  +
)
          77  +
.with_list_member(&DESCRIBEPATCHGROUPSINPUT_MEMBER_FILTERS_MEMBER);
          78  +
static DESCRIBEPATCHGROUPSINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          79  +
    ::aws_smithy_schema::ShapeId::from_parts(
          80  +
        "com.amazonaws.ssm.synthetic#DescribePatchGroupsInput$NextToken",
          81  +
        "com.amazonaws.ssm.synthetic",
          82  +
        "DescribePatchGroupsInput",
          83  +
    ),
          84  +
    ::aws_smithy_schema::ShapeType::String,
          85  +
    "NextToken",
          86  +
    2,
          87  +
);
          88  +
static DESCRIBEPATCHGROUPSINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          89  +
    ::aws_smithy_schema::ShapeId::from_parts(
          90  +
        "com.amazonaws.ssm.synthetic#DescribePatchGroupsInput",
          91  +
        "com.amazonaws.ssm.synthetic",
          92  +
        "DescribePatchGroupsInput",
          93  +
    ),
          94  +
    ::aws_smithy_schema::ShapeType::Structure,
          95  +
    &[
          96  +
        &DESCRIBEPATCHGROUPSINPUT_MEMBER_MAX_RESULTS,
          97  +
        &DESCRIBEPATCHGROUPSINPUT_MEMBER_FILTERS,
          98  +
        &DESCRIBEPATCHGROUPSINPUT_MEMBER_NEXT_TOKEN,
          99  +
    ],
         100  +
)
         101  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
         102  +
.with_original_name("DescribePatchGroupsRequest");
         103  +
impl DescribePatchGroupsInput {
         104  +
    /// The schema for this shape.
         105  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &DESCRIBEPATCHGROUPSINPUT_SCHEMA;
         106  +
}
         107  +
impl ::aws_smithy_schema::serde::SerializableStruct for DescribePatchGroupsInput {
         108  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
         109  +
    fn serialize_members(
         110  +
        &self,
         111  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
         112  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
         113  +
        if let Some(ref val) = self.max_results {
         114  +
            ser.write_integer(&DESCRIBEPATCHGROUPSINPUT_MEMBER_MAX_RESULTS, *val)?;
         115  +
        }
         116  +
        if let Some(ref val) = self.filters {
         117  +
            ser.write_list(
         118  +
                &DESCRIBEPATCHGROUPSINPUT_MEMBER_FILTERS,
         119  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
         120  +
                    for item in val {
         121  +
                        ser.write_struct(crate::types::PatchOrchestratorFilter::SCHEMA, item)?;
         122  +
                    }
         123  +
                    Ok(())
         124  +
                },
         125  +
            )?;
         126  +
        }
         127  +
        if let Some(ref val) = self.next_token {
         128  +
            ser.write_string(&DESCRIBEPATCHGROUPSINPUT_MEMBER_NEXT_TOKEN, val)?;
         129  +
        }
         130  +
        Ok(())
         131  +
    }
         132  +
}
         133  +
impl DescribePatchGroupsInput {
         134  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
         135  +
    pub fn deserialize(
         136  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         137  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         138  +
        #[allow(unused_variables, unused_mut)]
         139  +
        let mut builder = Self::builder();
         140  +
        #[allow(
         141  +
            unused_variables,
         142  +
            unreachable_code,
         143  +
            clippy::single_match,
         144  +
            clippy::match_single_binding,
         145  +
            clippy::diverging_sub_expression
         146  +
        )]
         147  +
        deserializer.read_struct(&DESCRIBEPATCHGROUPSINPUT_SCHEMA, &mut |member, deser| {
         148  +
            match member.member_index() {
         149  +
                Some(0) => {
         150  +
                    if deser.is_null() {
         151  +
                        deser.read_null()?;
         152  +
                    } else {
         153  +
                        builder.max_results = Some(deser.read_integer(member)?);
         154  +
                    }
         155  +
                }
         156  +
                Some(1) => {
         157  +
                    if deser.is_null() {
         158  +
                        deser.read_null()?;
         159  +
                    } else {
         160  +
                        builder.filters = Some({
         161  +
                            let mut container = Vec::new();
         162  +
                            deser.read_list(member, &mut |deser| {
         163  +
                                container.push(crate::types::PatchOrchestratorFilter::deserialize(deser)?);
         164  +
                                Ok(())
         165  +
                            })?;
         166  +
                            container
         167  +
                        });
         168  +
                    }
         169  +
                }
         170  +
                Some(2) => {
         171  +
                    if deser.is_null() {
         172  +
                        deser.read_null()?;
         173  +
                    } else {
         174  +
                        builder.next_token = Some(deser.read_string(member)?);
         175  +
                    }
         176  +
                }
         177  +
                _ => {}
         178  +
            }
         179  +
            Ok(())
         180  +
        })?;
         181  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         182  +
    }
         183  +
}
         184  +
impl DescribePatchGroupsInput {
         185  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         186  +
    pub fn deserialize_with_response(
         187  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         188  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         189  +
        _status: u16,
         190  +
        _body: &[u8],
         191  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         192  +
        Self::deserialize(deserializer)
         193  +
    }
         194  +
}
         195  +
impl DescribePatchGroupsInput {
         196  +
    /// Creates a new builder-style object to manufacture [`DescribePatchGroupsInput`](crate::operation::describe_patch_groups::DescribePatchGroupsInput).
         197  +
    pub fn builder() -> crate::operation::describe_patch_groups::builders::DescribePatchGroupsInputBuilder {
         198  +
        crate::operation::describe_patch_groups::builders::DescribePatchGroupsInputBuilder::default()
         199  +
    }
         200  +
}
         201  +
         202  +
/// A builder for [`DescribePatchGroupsInput`](crate::operation::describe_patch_groups::DescribePatchGroupsInput).
         203  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         204  +
#[non_exhaustive]
         205  +
pub struct DescribePatchGroupsInputBuilder {
         206  +
    pub(crate) max_results: ::std::option::Option<i32>,
         207  +
    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>,
         208  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         209  +
}
         210  +
impl DescribePatchGroupsInputBuilder {
         211  +
    /// <p>The maximum number of patch groups to return (per page).</p>
         212  +
    pub fn max_results(mut self, input: i32) -> Self {
         213  +
        self.max_results = ::std::option::Option::Some(input);
         214  +
        self
         215  +
    }
         216  +
    /// <p>The maximum number of patch groups to return (per page).</p>
         217  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         218  +
        self.max_results = input;
         219  +
        self
         220  +
    }
         221  +
    /// <p>The maximum number of patch groups to return (per page).</p>
         222  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         223  +
        &self.max_results
         224  +
    }
         225  +
    /// Appends an item to `filters`.
         226  +
    ///
         227  +
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
         228  +
    ///
         229  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
         230  +
    /// <p>Supported keys for <code>DescribePatchGroups</code> include the following:</p>
         231  +
    /// <ul>
         232  +
    /// <li>
         233  +
    /// <p><b> <code>NAME_PREFIX</code> </b></p>
         234  +
    /// <p>Sample values: <code>AWS-</code> | <code>My-</code>.</p></li>
         235  +
    /// <li>
         236  +
    /// <p><b> <code>OPERATING_SYSTEM</code> </b></p>
         237  +
    /// <p>Sample values: <code>AMAZON_LINUX</code> | <code>SUSE</code> | <code>WINDOWS</code></p></li>
         238  +
    /// </ul>
         239  +
    pub fn filters(mut self, input: crate::types::PatchOrchestratorFilter) -> Self {
         240  +
        let mut v = self.filters.unwrap_or_default();
         241  +
        v.push(input);
         242  +
        self.filters = ::std::option::Option::Some(v);
         243  +
        self
         244  +
    }
         245  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
         246  +
    /// <p>Supported keys for <code>DescribePatchGroups</code> include the following:</p>
         247  +
    /// <ul>
         248  +
    /// <li>
         249  +
    /// <p><b> <code>NAME_PREFIX</code> </b></p>
         250  +
    /// <p>Sample values: <code>AWS-</code> | <code>My-</code>.</p></li>
         251  +
    /// <li>
         252  +
    /// <p><b> <code>OPERATING_SYSTEM</code> </b></p>
         253  +
    /// <p>Sample values: <code>AMAZON_LINUX</code> | <code>SUSE</code> | <code>WINDOWS</code></p></li>
         254  +
    /// </ul>
         255  +
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>>) -> Self {
         256  +
        self.filters = input;
         257  +
        self
         258  +
    }
         259  +
    /// <p>Each element in the array is a structure containing a key-value pair.</p>
         260  +
    /// <p>Supported keys for <code>DescribePatchGroups</code> include the following:</p>
         261  +
    /// <ul>
         262  +
    /// <li>
         263  +
    /// <p><b> <code>NAME_PREFIX</code> </b></p>
         264  +
    /// <p>Sample values: <code>AWS-</code> | <code>My-</code>.</p></li>
         265  +
    /// <li>
         266  +
    /// <p><b> <code>OPERATING_SYSTEM</code> </b></p>
         267  +
    /// <p>Sample values: <code>AMAZON_LINUX</code> | <code>SUSE</code> | <code>WINDOWS</code></p></li>
         268  +
    /// </ul>
         269  +
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PatchOrchestratorFilter>> {
         270  +
        &self.filters
         271  +
    }
         272  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         273  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         274  +
        self.next_token = ::std::option::Option::Some(input.into());
         275  +
        self
         276  +
    }
         277  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         278  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         279  +
        self.next_token = input;
         280  +
        self
         281  +
    }
         282  +
    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
         283  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         284  +
        &self.next_token
         285  +
    }
         286  +
    /// Consumes the builder and constructs a [`DescribePatchGroupsInput`](crate::operation::describe_patch_groups::DescribePatchGroupsInput).
         287  +
    pub fn build(
         288  +
        self,
         289  +
    ) -> ::std::result::Result<crate::operation::describe_patch_groups::DescribePatchGroupsInput, ::aws_smithy_types::error::operation::BuildError>
         290  +
    {
         291  +
        ::std::result::Result::Ok(crate::operation::describe_patch_groups::DescribePatchGroupsInput {
         292  +
            max_results: self.max_results,
         293  +
            filters: self.filters,
         294  +
            next_token: self.next_token,
         295  +
        })
         296  +
    }
         297  +
}

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

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