aws-sdk-workmail 0.28.0

AWS SDK for Amazon WorkMail
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 CreateResourceInput {
    /// <p>The identifier associated with the organization for which the resource is created.</p>
    #[doc(hidden)]
    pub organization_id: ::std::option::Option<::std::string::String>,
    /// <p>The name of the new resource.</p>
    #[doc(hidden)]
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The type of the new resource. The available types are <code>equipment</code> and <code>room</code>.</p>
    #[doc(hidden)]
    pub r#type: ::std::option::Option<crate::types::ResourceType>,
}
impl CreateResourceInput {
    /// <p>The identifier associated with the organization for which the resource is created.</p>
    pub fn organization_id(&self) -> ::std::option::Option<&str> {
        self.organization_id.as_deref()
    }
    /// <p>The name of the new resource.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The type of the new resource. The available types are <code>equipment</code> and <code>room</code>.</p>
    pub fn r#type(&self) -> ::std::option::Option<&crate::types::ResourceType> {
        self.r#type.as_ref()
    }
}
impl CreateResourceInput {
    /// Creates a new builder-style object to manufacture [`CreateResourceInput`](crate::operation::create_resource::CreateResourceInput).
    pub fn builder() -> crate::operation::create_resource::builders::CreateResourceInputBuilder {
        crate::operation::create_resource::builders::CreateResourceInputBuilder::default()
    }
}

/// A builder for [`CreateResourceInput`](crate::operation::create_resource::CreateResourceInput).
#[non_exhaustive]
#[derive(
    ::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug,
)]
pub struct CreateResourceInputBuilder {
    pub(crate) organization_id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::ResourceType>,
}
impl CreateResourceInputBuilder {
    /// <p>The identifier associated with the organization for which the resource is created.</p>
    pub fn organization_id(
        mut self,
        input: impl ::std::convert::Into<::std::string::String>,
    ) -> Self {
        self.organization_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier associated with the organization for which the resource is created.</p>
    pub fn set_organization_id(
        mut self,
        input: ::std::option::Option<::std::string::String>,
    ) -> Self {
        self.organization_id = input;
        self
    }
    /// <p>The name of the new resource.</p>
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the new resource.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The type of the new resource. The available types are <code>equipment</code> and <code>room</code>.</p>
    pub fn r#type(mut self, input: crate::types::ResourceType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of the new resource. The available types are <code>equipment</code> and <code>room</code>.</p>
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ResourceType>) -> Self {
        self.r#type = input;
        self
    }
    /// Consumes the builder and constructs a [`CreateResourceInput`](crate::operation::create_resource::CreateResourceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_resource::CreateResourceInput,
        ::aws_smithy_http::operation::error::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_resource::CreateResourceInput {
            organization_id: self.organization_id,
            name: self.name,
            r#type: self.r#type,
        })
    }
}