AWS SDK

AWS SDK

rev. 3388bf5e18f4269f2b46f39cdc814c5c39d413d0 (ignoring whitespace)

Files changed:

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

@@ -0,1 +0,139 @@
           1  +
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
           2  +
pub use crate::operation::get_patch_baseline_for_patch_group::_get_patch_baseline_for_patch_group_input::GetPatchBaselineForPatchGroupInputBuilder;
           3  +
           4  +
pub use crate::operation::get_patch_baseline_for_patch_group::_get_patch_baseline_for_patch_group_output::GetPatchBaselineForPatchGroupOutputBuilder;
           5  +
           6  +
impl crate::operation::get_patch_baseline_for_patch_group::builders::GetPatchBaselineForPatchGroupInputBuilder {
           7  +
    /// Sends a request with this input using the given client.
           8  +
    pub async fn send_with(
           9  +
        self,
          10  +
        client: &crate::Client,
          11  +
    ) -> ::std::result::Result<
          12  +
        crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupOutput,
          13  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          14  +
            crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupError,
          15  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          16  +
        >,
          17  +
    > {
          18  +
        let mut fluent_builder = client.get_patch_baseline_for_patch_group();
          19  +
        fluent_builder.inner = self;
          20  +
        fluent_builder.send().await
          21  +
    }
          22  +
}
          23  +
/// Fluent builder constructing a request to `GetPatchBaselineForPatchGroup`.
          24  +
///
          25  +
/// <p>Retrieves the patch baseline that should be used for the specified patch group.</p>
          26  +
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
          27  +
pub struct GetPatchBaselineForPatchGroupFluentBuilder {
          28  +
    handle: ::std::sync::Arc<crate::client::Handle>,
          29  +
    inner: crate::operation::get_patch_baseline_for_patch_group::builders::GetPatchBaselineForPatchGroupInputBuilder,
          30  +
    config_override: ::std::option::Option<crate::config::Builder>,
          31  +
}
          32  +
impl
          33  +
    crate::client::customize::internal::CustomizableSend<
          34  +
        crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupOutput,
          35  +
        crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupError,
          36  +
    > for GetPatchBaselineForPatchGroupFluentBuilder
          37  +
{
          38  +
    fn send(
          39  +
        self,
          40  +
        config_override: crate::config::Builder,
          41  +
    ) -> crate::client::customize::internal::BoxFuture<
          42  +
        crate::client::customize::internal::SendResult<
          43  +
            crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupOutput,
          44  +
            crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupError,
          45  +
        >,
          46  +
    > {
          47  +
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
          48  +
    }
          49  +
}
          50  +
impl GetPatchBaselineForPatchGroupFluentBuilder {
          51  +
    /// Creates a new `GetPatchBaselineForPatchGroupFluentBuilder`.
          52  +
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
          53  +
        Self {
          54  +
            handle,
          55  +
            inner: ::std::default::Default::default(),
          56  +
            config_override: ::std::option::Option::None,
          57  +
        }
          58  +
    }
          59  +
    /// Access the GetPatchBaselineForPatchGroup as a reference.
          60  +
    pub fn as_input(&self) -> &crate::operation::get_patch_baseline_for_patch_group::builders::GetPatchBaselineForPatchGroupInputBuilder {
          61  +
        &self.inner
          62  +
    }
          63  +
    /// Sends the request and returns the response.
          64  +
    ///
          65  +
    /// If an error occurs, an `SdkError` will be returned with additional details that
          66  +
    /// can be matched against.
          67  +
    ///
          68  +
    /// By default, any retryable failures will be retried twice. Retry behavior
          69  +
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
          70  +
    /// set when configuring the client.
          71  +
    pub async fn send(
          72  +
        self,
          73  +
    ) -> ::std::result::Result<
          74  +
        crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupOutput,
          75  +
        ::aws_smithy_runtime_api::client::result::SdkError<
          76  +
            crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupError,
          77  +
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
          78  +
        >,
          79  +
    > {
          80  +
        let input = self
          81  +
            .inner
          82  +
            .build()
          83  +
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
          84  +
        let runtime_plugins = crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroup::operation_runtime_plugins(
          85  +
            self.handle.runtime_plugins.clone(),
          86  +
            &self.handle.conf,
          87  +
            self.config_override,
          88  +
        );
          89  +
        crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroup::orchestrate(&runtime_plugins, input).await
          90  +
    }
          91  +
          92  +
    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
          93  +
    pub fn customize(
          94  +
        self,
          95  +
    ) -> crate::client::customize::CustomizableOperation<
          96  +
        crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupOutput,
          97  +
        crate::operation::get_patch_baseline_for_patch_group::GetPatchBaselineForPatchGroupError,
          98  +
        Self,
          99  +
    > {
         100  +
        crate::client::customize::CustomizableOperation::new(self)
         101  +
    }
         102  +
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
         103  +
        self.set_config_override(::std::option::Option::Some(config_override.into()));
         104  +
        self
         105  +
    }
         106  +
         107  +
    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
         108  +
        self.config_override = config_override;
         109  +
        self
         110  +
    }
         111  +
    /// <p>The name of the patch group whose patch baseline should be retrieved.</p>
         112  +
    pub fn patch_group(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         113  +
        self.inner = self.inner.patch_group(input.into());
         114  +
        self
         115  +
    }
         116  +
    /// <p>The name of the patch group whose patch baseline should be retrieved.</p>
         117  +
    pub fn set_patch_group(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         118  +
        self.inner = self.inner.set_patch_group(input);
         119  +
        self
         120  +
    }
         121  +
    /// <p>The name of the patch group whose patch baseline should be retrieved.</p>
         122  +
    pub fn get_patch_group(&self) -> &::std::option::Option<::std::string::String> {
         123  +
        self.inner.get_patch_group()
         124  +
    }
         125  +
    /// <p>Returns the operating system rule specified for patch groups using the patch baseline. The default value is <code>WINDOWS</code>.</p>
         126  +
    pub fn operating_system(mut self, input: crate::types::OperatingSystem) -> Self {
         127  +
        self.inner = self.inner.operating_system(input);
         128  +
        self
         129  +
    }
         130  +
    /// <p>Returns the operating system rule specified for patch groups using the patch baseline. The default value is <code>WINDOWS</code>.</p>
         131  +
    pub fn set_operating_system(mut self, input: ::std::option::Option<crate::types::OperatingSystem>) -> Self {
         132  +
        self.inner = self.inner.set_operating_system(input);
         133  +
        self
         134  +
    }
         135  +
    /// <p>Returns the operating system rule specified for patch groups using the patch baseline. The default value is <code>WINDOWS</code>.</p>
         136  +
    pub fn get_operating_system(&self) -> &::std::option::Option<crate::types::OperatingSystem> {
         137  +
        self.inner.get_operating_system()
         138  +
    }
         139  +
}

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

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

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

@@ -0,1 +0,220 @@
           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 GetResourcePoliciesInput {
           6  +
    /// <p>Amazon Resource Name (ARN) of the resource to which the policies are attached.</p>
           7  +
    pub resource_arn: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>A token to start the list. Use this token to get the next set of results.</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  +
}
          13  +
impl GetResourcePoliciesInput {
          14  +
    /// <p>Amazon Resource Name (ARN) of the resource to which the policies are attached.</p>
          15  +
    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
          16  +
        self.resource_arn.as_deref()
          17  +
    }
          18  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
          19  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          20  +
        self.next_token.as_deref()
          21  +
    }
          22  +
    /// <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>
          23  +
    pub fn max_results(&self) -> ::std::option::Option<i32> {
          24  +
        self.max_results
          25  +
    }
          26  +
}
          27  +
static GETRESOURCEPOLICIESINPUT_MEMBER_RESOURCE_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          28  +
    ::aws_smithy_schema::ShapeId::from_parts(
          29  +
        "com.amazonaws.ssm.synthetic#GetResourcePoliciesInput$ResourceArn",
          30  +
        "com.amazonaws.ssm.synthetic",
          31  +
        "GetResourcePoliciesInput",
          32  +
    ),
          33  +
    ::aws_smithy_schema::ShapeType::String,
          34  +
    "ResourceArn",
          35  +
    0,
          36  +
);
          37  +
static GETRESOURCEPOLICIESINPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          38  +
    ::aws_smithy_schema::ShapeId::from_parts(
          39  +
        "com.amazonaws.ssm.synthetic#GetResourcePoliciesInput$NextToken",
          40  +
        "com.amazonaws.ssm.synthetic",
          41  +
        "GetResourcePoliciesInput",
          42  +
    ),
          43  +
    ::aws_smithy_schema::ShapeType::String,
          44  +
    "NextToken",
          45  +
    1,
          46  +
);
          47  +
static GETRESOURCEPOLICIESINPUT_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#GetResourcePoliciesInput$MaxResults",
          50  +
        "com.amazonaws.ssm.synthetic",
          51  +
        "GetResourcePoliciesInput",
          52  +
    ),
          53  +
    ::aws_smithy_schema::ShapeType::Integer,
          54  +
    "MaxResults",
          55  +
    2,
          56  +
);
          57  +
static GETRESOURCEPOLICIESINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          58  +
    ::aws_smithy_schema::ShapeId::from_parts(
          59  +
        "com.amazonaws.ssm.synthetic#GetResourcePoliciesInput",
          60  +
        "com.amazonaws.ssm.synthetic",
          61  +
        "GetResourcePoliciesInput",
          62  +
    ),
          63  +
    ::aws_smithy_schema::ShapeType::Structure,
          64  +
    &[
          65  +
        &GETRESOURCEPOLICIESINPUT_MEMBER_RESOURCE_ARN,
          66  +
        &GETRESOURCEPOLICIESINPUT_MEMBER_NEXT_TOKEN,
          67  +
        &GETRESOURCEPOLICIESINPUT_MEMBER_MAX_RESULTS,
          68  +
    ],
          69  +
)
          70  +
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
          71  +
.with_original_name("GetResourcePoliciesRequest");
          72  +
impl GetResourcePoliciesInput {
          73  +
    /// The schema for this shape.
          74  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETRESOURCEPOLICIESINPUT_SCHEMA;
          75  +
}
          76  +
impl ::aws_smithy_schema::serde::SerializableStruct for GetResourcePoliciesInput {
          77  +
    #[allow(unused_variables, clippy::diverging_sub_expression)]
          78  +
    fn serialize_members(
          79  +
        &self,
          80  +
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
          81  +
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
          82  +
        if let Some(ref val) = self.resource_arn {
          83  +
            ser.write_string(&GETRESOURCEPOLICIESINPUT_MEMBER_RESOURCE_ARN, val)?;
          84  +
        }
          85  +
        if let Some(ref val) = self.next_token {
          86  +
            ser.write_string(&GETRESOURCEPOLICIESINPUT_MEMBER_NEXT_TOKEN, val)?;
          87  +
        }
          88  +
        if let Some(ref val) = self.max_results {
          89  +
            ser.write_integer(&GETRESOURCEPOLICIESINPUT_MEMBER_MAX_RESULTS, *val)?;
          90  +
        }
          91  +
        Ok(())
          92  +
    }
          93  +
}
          94  +
impl GetResourcePoliciesInput {
          95  +
    /// Deserializes this structure from a [`ShapeDeserializer`].
          96  +
    pub fn deserialize(
          97  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
          98  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
          99  +
        #[allow(unused_variables, unused_mut)]
         100  +
        let mut builder = Self::builder();
         101  +
        #[allow(
         102  +
            unused_variables,
         103  +
            unreachable_code,
         104  +
            clippy::single_match,
         105  +
            clippy::match_single_binding,
         106  +
            clippy::diverging_sub_expression
         107  +
        )]
         108  +
        deserializer.read_struct(&GETRESOURCEPOLICIESINPUT_SCHEMA, &mut |member, deser| {
         109  +
            match member.member_index() {
         110  +
                Some(0) => {
         111  +
                    if deser.is_null() {
         112  +
                        deser.read_null()?;
         113  +
                    } else {
         114  +
                        builder.resource_arn = Some(deser.read_string(member)?);
         115  +
                    }
         116  +
                }
         117  +
                Some(1) => {
         118  +
                    if deser.is_null() {
         119  +
                        deser.read_null()?;
         120  +
                    } else {
         121  +
                        builder.next_token = Some(deser.read_string(member)?);
         122  +
                    }
         123  +
                }
         124  +
                Some(2) => {
         125  +
                    if deser.is_null() {
         126  +
                        deser.read_null()?;
         127  +
                    } else {
         128  +
                        builder.max_results = Some(deser.read_integer(member)?);
         129  +
                    }
         130  +
                }
         131  +
                _ => {}
         132  +
            }
         133  +
            Ok(())
         134  +
        })?;
         135  +
        builder.resource_arn = builder.resource_arn.or(Some(String::new()));
         136  +
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
         137  +
    }
         138  +
}
         139  +
impl GetResourcePoliciesInput {
         140  +
    /// Deserializes this structure from a body deserializer and HTTP response.
         141  +
    pub fn deserialize_with_response(
         142  +
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
         143  +
        _headers: &::aws_smithy_runtime_api::http::Headers,
         144  +
        _status: u16,
         145  +
        _body: &[u8],
         146  +
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
         147  +
        Self::deserialize(deserializer)
         148  +
    }
         149  +
}
         150  +
impl GetResourcePoliciesInput {
         151  +
    /// Creates a new builder-style object to manufacture [`GetResourcePoliciesInput`](crate::operation::get_resource_policies::GetResourcePoliciesInput).
         152  +
    pub fn builder() -> crate::operation::get_resource_policies::builders::GetResourcePoliciesInputBuilder {
         153  +
        crate::operation::get_resource_policies::builders::GetResourcePoliciesInputBuilder::default()
         154  +
    }
         155  +
}
         156  +
         157  +
/// A builder for [`GetResourcePoliciesInput`](crate::operation::get_resource_policies::GetResourcePoliciesInput).
         158  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         159  +
#[non_exhaustive]
         160  +
pub struct GetResourcePoliciesInputBuilder {
         161  +
    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
         162  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         163  +
    pub(crate) max_results: ::std::option::Option<i32>,
         164  +
}
         165  +
impl GetResourcePoliciesInputBuilder {
         166  +
    /// <p>Amazon Resource Name (ARN) of the resource to which the policies are attached.</p>
         167  +
    /// This field is required.
         168  +
    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         169  +
        self.resource_arn = ::std::option::Option::Some(input.into());
         170  +
        self
         171  +
    }
         172  +
    /// <p>Amazon Resource Name (ARN) of the resource to which the policies are attached.</p>
         173  +
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         174  +
        self.resource_arn = input;
         175  +
        self
         176  +
    }
         177  +
    /// <p>Amazon Resource Name (ARN) of the resource to which the policies are attached.</p>
         178  +
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
         179  +
        &self.resource_arn
         180  +
    }
         181  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         182  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         183  +
        self.next_token = ::std::option::Option::Some(input.into());
         184  +
        self
         185  +
    }
         186  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         187  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         188  +
        self.next_token = input;
         189  +
        self
         190  +
    }
         191  +
    /// <p>A token to start the list. Use this token to get the next set of results.</p>
         192  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         193  +
        &self.next_token
         194  +
    }
         195  +
    /// <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>
         196  +
    pub fn max_results(mut self, input: i32) -> Self {
         197  +
        self.max_results = ::std::option::Option::Some(input);
         198  +
        self
         199  +
    }
         200  +
    /// <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>
         201  +
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
         202  +
        self.max_results = input;
         203  +
        self
         204  +
    }
         205  +
    /// <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>
         206  +
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
         207  +
        &self.max_results
         208  +
    }
         209  +
    /// Consumes the builder and constructs a [`GetResourcePoliciesInput`](crate::operation::get_resource_policies::GetResourcePoliciesInput).
         210  +
    pub fn build(
         211  +
        self,
         212  +
    ) -> ::std::result::Result<crate::operation::get_resource_policies::GetResourcePoliciesInput, ::aws_smithy_types::error::operation::BuildError>
         213  +
    {
         214  +
        ::std::result::Result::Ok(crate::operation::get_resource_policies::GetResourcePoliciesInput {
         215  +
            resource_arn: self.resource_arn,
         216  +
            next_token: self.next_token,
         217  +
            max_results: self.max_results,
         218  +
        })
         219  +
    }
         220  +
}

tmp-codegen-diff/aws-sdk/sdk/ssm/src/operation/get_resource_policies/_get_resource_policies_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 GetResourcePoliciesOutput {
           6  +
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
           7  +
    pub next_token: ::std::option::Option<::std::string::String>,
           8  +
    /// <p>An array of the <code>Policy</code> object.</p>
           9  +
    pub policies: ::std::option::Option<::std::vec::Vec<crate::types::GetResourcePoliciesResponseEntry>>,
          10  +
    _request_id: Option<String>,
          11  +
}
          12  +
impl GetResourcePoliciesOutput {
          13  +
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
          14  +
    pub fn next_token(&self) -> ::std::option::Option<&str> {
          15  +
        self.next_token.as_deref()
          16  +
    }
          17  +
    /// <p>An array of the <code>Policy</code> object.</p>
          18  +
    ///
          19  +
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.policies.is_none()`.
          20  +
    pub fn policies(&self) -> &[crate::types::GetResourcePoliciesResponseEntry] {
          21  +
        self.policies.as_deref().unwrap_or_default()
          22  +
    }
          23  +
}
          24  +
static GETRESOURCEPOLICIESOUTPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          25  +
    ::aws_smithy_schema::ShapeId::from_parts(
          26  +
        "com.amazonaws.ssm.synthetic#GetResourcePoliciesOutput$NextToken",
          27  +
        "com.amazonaws.ssm.synthetic",
          28  +
        "GetResourcePoliciesOutput",
          29  +
    ),
          30  +
    ::aws_smithy_schema::ShapeType::String,
          31  +
    "NextToken",
          32  +
    0,
          33  +
);
          34  +
static GETRESOURCEPOLICIESOUTPUT_MEMBER_POLICIES_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          35  +
    ::aws_smithy_schema::ShapeId::from_parts(
          36  +
        "com.amazonaws.ssm#GetResourcePoliciesResponseEntries$member",
          37  +
        "com.amazonaws.ssm",
          38  +
        "GetResourcePoliciesResponseEntries",
          39  +
    ),
          40  +
    ::aws_smithy_schema::ShapeType::Structure,
          41  +
    "member",
          42  +
    0,
          43  +
);
          44  +
static GETRESOURCEPOLICIESOUTPUT_MEMBER_POLICIES: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
          45  +
    ::aws_smithy_schema::ShapeId::from_parts(
          46  +
        "com.amazonaws.ssm.synthetic#GetResourcePoliciesOutput$Policies",
          47  +
        "com.amazonaws.ssm.synthetic",
          48  +
        "GetResourcePoliciesOutput",
          49  +
    ),
          50  +
    ::aws_smithy_schema::ShapeType::List,
          51  +
    "Policies",
          52  +
    1,
          53  +
)
          54  +
.with_list_member(&GETRESOURCEPOLICIESOUTPUT_MEMBER_POLICIES_MEMBER);
          55  +
static GETRESOURCEPOLICIESOUTPUT_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 GETRESOURCEPOLICIESOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
          63  +
    ::aws_smithy_schema::ShapeId::from_parts(
          64  +
        "com.amazonaws.ssm.synthetic#GetResourcePoliciesOutput",
          65  +
        "com.amazonaws.ssm.synthetic",
          66  +
        "GetResourcePoliciesOutput",
          67  +
    ),
          68  +
    ::aws_smithy_schema::ShapeType::Structure,
          69  +
    &[
          70  +
        &GETRESOURCEPOLICIESOUTPUT_MEMBER_NEXT_TOKEN,
          71  +
        &GETRESOURCEPOLICIESOUTPUT_MEMBER_POLICIES,
          72  +
        &GETRESOURCEPOLICIESOUTPUT_MEMBER__REQUEST_ID,
          73  +
    ],
          74  +
)
          75  +
.with_original_name("GetResourcePoliciesResponse");
          76  +
impl GetResourcePoliciesOutput {
          77  +
    /// The schema for this shape.
          78  +
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETRESOURCEPOLICIESOUTPUT_SCHEMA;
          79  +
}
          80  +
impl ::aws_smithy_schema::serde::SerializableStruct for GetResourcePoliciesOutput {
          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.next_token {
          87  +
            ser.write_string(&GETRESOURCEPOLICIESOUTPUT_MEMBER_NEXT_TOKEN, val)?;
          88  +
        }
          89  +
        if let Some(ref val) = self.policies {
          90  +
            ser.write_list(
          91  +
                &GETRESOURCEPOLICIESOUTPUT_MEMBER_POLICIES,
          92  +
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
          93  +
                    for item in val {
          94  +
                        ser.write_struct(crate::types::GetResourcePoliciesResponseEntry::SCHEMA, item)?;
          95  +
                    }
          96  +
                    Ok(())
          97  +
                },
          98  +
            )?;
          99  +
        }
         100  +
        Ok(())
         101  +
    }
         102  +
}
         103  +
impl GetResourcePoliciesOutput {
         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(&GETRESOURCEPOLICIESOUTPUT_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.next_token = Some(deser.read_string(member)?);
         124  +
                    }
         125  +
                }
         126  +
                Some(1) => {
         127  +
                    if deser.is_null() {
         128  +
                        deser.read_null()?;
         129  +
                    } else {
         130  +
                        builder.policies = Some({
         131  +
                            let mut container = Vec::new();
         132  +
                            deser.read_list(member, &mut |deser| {
         133  +
                                container.push(crate::types::GetResourcePoliciesResponseEntry::deserialize(deser)?);
         134  +
                                Ok(())
         135  +
                            })?;
         136  +
                            container
         137  +
                        });
         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 GetResourcePoliciesOutput {
         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(&GETRESOURCEPOLICIESOUTPUT_SCHEMA, &mut |member, deser| {
         174  +
            match member.member_index() {
         175  +
                Some(0) => {
         176  +
                    builder.next_token = Some(deser.read_string(member)?);
         177  +
                }
         178  +
                Some(1) => {
         179  +
                    builder.policies = Some({
         180  +
                        let mut container = Vec::new();
         181  +
                        deser.read_list(member, &mut |deser| {
         182  +
                            container.push(crate::types::GetResourcePoliciesResponseEntry::deserialize(deser)?);
         183  +
                            Ok(())
         184  +
                        })?;
         185  +
                        container
         186  +
                    });
         187  +
                }
         188  +
                _ => {}
         189  +
            }
         190  +
            Ok(())
         191  +
        })?;
         192  +
        Ok(builder.build())
         193  +
    }
         194  +
}
         195  +
impl ::aws_types::request_id::RequestId for GetResourcePoliciesOutput {
         196  +
    fn request_id(&self) -> Option<&str> {
         197  +
        self._request_id.as_deref()
         198  +
    }
         199  +
}
         200  +
impl GetResourcePoliciesOutput {
         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 GetResourcePoliciesOutput {
         207  +
    /// Creates a new builder-style object to manufacture [`GetResourcePoliciesOutput`](crate::operation::get_resource_policies::GetResourcePoliciesOutput).
         208  +
    pub fn builder() -> crate::operation::get_resource_policies::builders::GetResourcePoliciesOutputBuilder {
         209  +
        crate::operation::get_resource_policies::builders::GetResourcePoliciesOutputBuilder::default()
         210  +
    }
         211  +
}
         212  +
         213  +
/// A builder for [`GetResourcePoliciesOutput`](crate::operation::get_resource_policies::GetResourcePoliciesOutput).
         214  +
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
         215  +
#[non_exhaustive]
         216  +
pub struct GetResourcePoliciesOutputBuilder {
         217  +
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
         218  +
    pub(crate) policies: ::std::option::Option<::std::vec::Vec<crate::types::GetResourcePoliciesResponseEntry>>,
         219  +
    _request_id: Option<String>,
         220  +
}
         221  +
impl GetResourcePoliciesOutputBuilder {
         222  +
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
         223  +
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
         224  +
        self.next_token = ::std::option::Option::Some(input.into());
         225  +
        self
         226  +
    }
         227  +
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
         228  +
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
         229  +
        self.next_token = input;
         230  +
        self
         231  +
    }
         232  +
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
         233  +
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
         234  +
        &self.next_token
         235  +
    }
         236  +
    /// Appends an item to `policies`.
         237  +
    ///
         238  +
    /// To override the contents of this collection use [`set_policies`](Self::set_policies).
         239  +
    ///
         240  +
    /// <p>An array of the <code>Policy</code> object.</p>
         241  +
    pub fn policies(mut self, input: crate::types::GetResourcePoliciesResponseEntry) -> Self {
         242  +
        let mut v = self.policies.unwrap_or_default();
         243  +
        v.push(input);
         244  +
        self.policies = ::std::option::Option::Some(v);
         245  +
        self
         246  +
    }
         247  +
    /// <p>An array of the <code>Policy</code> object.</p>
         248  +
    pub fn set_policies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GetResourcePoliciesResponseEntry>>) -> Self {
         249  +
        self.policies = input;
         250  +
        self
         251  +
    }
         252  +
    /// <p>An array of the <code>Policy</code> object.</p>
         253  +
    pub fn get_policies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GetResourcePoliciesResponseEntry>> {
         254  +
        &self.policies
         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 [`GetResourcePoliciesOutput`](crate::operation::get_resource_policies::GetResourcePoliciesOutput).
         266  +
    pub fn build(self) -> crate::operation::get_resource_policies::GetResourcePoliciesOutput {
         267  +
        crate::operation::get_resource_policies::GetResourcePoliciesOutput {
         268  +
            next_token: self.next_token,
         269  +
            policies: self.policies,
         270  +
            _request_id: self._request_id,
         271  +
        }
         272  +
    }
         273  +
}