aws-sdk-ssm 1.112.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 StartAccessRequestInput {
    /// <p>A brief description explaining why you are requesting access to the node.</p>
    pub reason: ::std::option::Option<::std::string::String>,
    /// <p>The node you are requesting access to.</p>
    pub targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
    /// <p>Key-value pairs of metadata you want to assign to the access request.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl StartAccessRequestInput {
    /// <p>A brief description explaining why you are requesting access to the node.</p>
    pub fn reason(&self) -> ::std::option::Option<&str> {
        self.reason.as_deref()
    }
    /// <p>The node you are requesting access to.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.targets.is_none()`.
    pub fn targets(&self) -> &[crate::types::Target] {
        self.targets.as_deref().unwrap_or_default()
    }
    /// <p>Key-value pairs of metadata you want to assign to the access request.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl StartAccessRequestInput {
    /// Creates a new builder-style object to manufacture [`StartAccessRequestInput`](crate::operation::start_access_request::StartAccessRequestInput).
    pub fn builder() -> crate::operation::start_access_request::builders::StartAccessRequestInputBuilder {
        crate::operation::start_access_request::builders::StartAccessRequestInputBuilder::default()
    }
}

/// A builder for [`StartAccessRequestInput`](crate::operation::start_access_request::StartAccessRequestInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartAccessRequestInputBuilder {
    pub(crate) reason: ::std::option::Option<::std::string::String>,
    pub(crate) targets: ::std::option::Option<::std::vec::Vec<crate::types::Target>>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl StartAccessRequestInputBuilder {
    /// <p>A brief description explaining why you are requesting access to the node.</p>
    /// This field is required.
    pub fn reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.reason = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A brief description explaining why you are requesting access to the node.</p>
    pub fn set_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.reason = input;
        self
    }
    /// <p>A brief description explaining why you are requesting access to the node.</p>
    pub fn get_reason(&self) -> &::std::option::Option<::std::string::String> {
        &self.reason
    }
    /// Appends an item to `targets`.
    ///
    /// To override the contents of this collection use [`set_targets`](Self::set_targets).
    ///
    /// <p>The node you are requesting access to.</p>
    pub fn targets(mut self, input: crate::types::Target) -> Self {
        let mut v = self.targets.unwrap_or_default();
        v.push(input);
        self.targets = ::std::option::Option::Some(v);
        self
    }
    /// <p>The node you are requesting access to.</p>
    pub fn set_targets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Target>>) -> Self {
        self.targets = input;
        self
    }
    /// <p>The node you are requesting access to.</p>
    pub fn get_targets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Target>> {
        &self.targets
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Key-value pairs of metadata you want to assign to the access request.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>Key-value pairs of metadata you want to assign to the access request.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Key-value pairs of metadata you want to assign to the access request.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`StartAccessRequestInput`](crate::operation::start_access_request::StartAccessRequestInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::start_access_request::StartAccessRequestInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::start_access_request::StartAccessRequestInput {
            reason: self.reason,
            targets: self.targets,
            tags: self.tags,
        })
    }
}