aws-sdk-ssm 1.131.0

AWS SDK for Amazon Simple Systems Manager (SSM)
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetOpsMetadataOutput {
    /// <p>The resource ID of the Application Manager application.</p>
    pub resource_id: ::std::option::Option<::std::string::String>,
    /// <p>OpsMetadata for an Application Manager application.</p>
    pub metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>>,
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetOpsMetadataOutput {
    /// <p>The resource ID of the Application Manager application.</p>
    pub fn resource_id(&self) -> ::std::option::Option<&str> {
        self.resource_id.as_deref()
    }
    /// <p>OpsMetadata for an Application Manager application.</p>
    pub fn metadata(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>> {
        self.metadata.as_ref()
    }
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
static GETOPSMETADATAOUTPUT_MEMBER_RESOURCE_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetOpsMetadataOutput$ResourceId",
        "com.amazonaws.ssm.synthetic",
        "GetOpsMetadataOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "ResourceId",
    0,
);
static GETOPSMETADATAOUTPUT_MEMBER_METADATA_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#MetadataMap$key", "com.amazonaws.ssm", "MetadataMap"),
    ::aws_smithy_schema::ShapeType::String,
    "key",
    0,
);
static GETOPSMETADATAOUTPUT_MEMBER_METADATA_VALUE: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.ssm#MetadataMap$value", "com.amazonaws.ssm", "MetadataMap"),
    ::aws_smithy_schema::ShapeType::Structure,
    "value",
    1,
);
static GETOPSMETADATAOUTPUT_MEMBER_METADATA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetOpsMetadataOutput$Metadata",
        "com.amazonaws.ssm.synthetic",
        "GetOpsMetadataOutput",
    ),
    ::aws_smithy_schema::ShapeType::Map,
    "Metadata",
    1,
)
.with_map_members(&GETOPSMETADATAOUTPUT_MEMBER_METADATA_KEY, &GETOPSMETADATAOUTPUT_MEMBER_METADATA_VALUE);
static GETOPSMETADATAOUTPUT_MEMBER_NEXT_TOKEN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetOpsMetadataOutput$NextToken",
        "com.amazonaws.ssm.synthetic",
        "GetOpsMetadataOutput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "NextToken",
    2,
);
static GETOPSMETADATAOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.ssm.synthetic#GetOpsMetadataOutput",
        "com.amazonaws.ssm.synthetic",
        "GetOpsMetadataOutput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &GETOPSMETADATAOUTPUT_MEMBER_RESOURCE_ID,
        &GETOPSMETADATAOUTPUT_MEMBER_METADATA,
        &GETOPSMETADATAOUTPUT_MEMBER_NEXT_TOKEN,
    ],
)
.with_original_name("GetOpsMetadataResult");
impl GetOpsMetadataOutput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &GETOPSMETADATAOUTPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for GetOpsMetadataOutput {
    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
        Self::SCHEMA
    }

    #[allow(unused_variables, clippy::diverging_sub_expression)]
    fn serialize_members(
        &self,
        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
        if let Some(ref val) = self.resource_id {
            ser.write_string(&GETOPSMETADATAOUTPUT_MEMBER_RESOURCE_ID, val)?;
        }
        if let Some(ref val) = self.metadata {
            ser.write_map(
                &GETOPSMETADATAOUTPUT_MEMBER_METADATA,
                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
                    for (key, value) in val {
                        ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
                        ser.write_struct(crate::types::MetadataValue::SCHEMA, value)?;
                    }
                    Ok(())
                },
            )?;
        }
        if let Some(ref val) = self.next_token {
            ser.write_string(&GETOPSMETADATAOUTPUT_MEMBER_NEXT_TOKEN, val)?;
        }
        Ok(())
    }
}
impl crate::operation::get_ops_metadata::builders::GetOpsMetadataOutputBuilder {
    #[allow(
        unused_variables,
        unreachable_code,
        clippy::single_match,
        clippy::match_single_binding,
        clippy::diverging_sub_expression
    )]
    pub(crate) fn deserialize_members(
        &mut self,
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
        deserializer.read_struct(&GETOPSMETADATAOUTPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.resource_id = Some(deser.read_string(member)?);
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.metadata = Some({
                            let mut container = std::collections::HashMap::new();
                            deser.read_map(member, &mut |key, deser| {
                                container.insert(key, crate::types::MetadataValue::deserialize(deser)?);
                                Ok(())
                            })?;
                            container
                        });
                    }
                }
                Some(2) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.next_token = Some(deser.read_string(member)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl GetOpsMetadataOutput {
    /// Deserializes this structure from a [`ShapeDeserializer`].
    pub fn deserialize(
        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
        let mut builder = Self::builder();
        builder.deserialize_members(deserializer)?;
        Ok(builder.build())
    }
}
impl ::aws_types::request_id::RequestId for GetOpsMetadataOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetOpsMetadataOutput {
    /// Creates a new builder-style object to manufacture [`GetOpsMetadataOutput`](crate::operation::get_ops_metadata::GetOpsMetadataOutput).
    pub fn builder() -> crate::operation::get_ops_metadata::builders::GetOpsMetadataOutputBuilder {
        crate::operation::get_ops_metadata::builders::GetOpsMetadataOutputBuilder::default()
    }
}

/// A builder for [`GetOpsMetadataOutput`](crate::operation::get_ops_metadata::GetOpsMetadataOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetOpsMetadataOutputBuilder {
    pub(crate) resource_id: ::std::option::Option<::std::string::String>,
    pub(crate) metadata: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetOpsMetadataOutputBuilder {
    /// <p>The resource ID of the Application Manager application.</p>
    pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The resource ID of the Application Manager application.</p>
    pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_id = input;
        self
    }
    /// <p>The resource ID of the Application Manager application.</p>
    pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_id
    }
    /// Adds a key-value pair to `metadata`.
    ///
    /// To override the contents of this collection use [`set_metadata`](Self::set_metadata).
    ///
    /// <p>OpsMetadata for an Application Manager application.</p>
    pub fn metadata(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::MetadataValue) -> Self {
        let mut hash_map = self.metadata.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.metadata = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>OpsMetadata for an Application Manager application.</p>
    pub fn set_metadata(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>>,
    ) -> Self {
        self.metadata = input;
        self
    }
    /// <p>OpsMetadata for an Application Manager application.</p>
    pub fn get_metadata(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::MetadataValue>> {
        &self.metadata
    }
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>The token for the next set of items to return. Use this token to get the next set of results.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`GetOpsMetadataOutput`](crate::operation::get_ops_metadata::GetOpsMetadataOutput).
    pub fn build(self) -> crate::operation::get_ops_metadata::GetOpsMetadataOutput {
        crate::operation::get_ops_metadata::GetOpsMetadataOutput {
            resource_id: self.resource_id,
            metadata: self.metadata,
            next_token: self.next_token,
            _request_id: self._request_id,
        }
    }
}