aws-sdk-s3files 1.5.0

AWS SDK for Amazon S3 Files
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 GetAccessPointOutput {
    /// <p>The ARN of the access point.</p>
    pub access_point_arn: ::std::string::String,
    /// <p>The ID of the access point.</p>
    pub access_point_id: ::std::string::String,
    /// <p>The client token used for idempotency when the access point was created.</p>
    pub client_token: ::std::string::String,
    /// <p>The ID of the S3 File System.</p>
    pub file_system_id: ::std::string::String,
    /// <p>The current status of the access point.</p>
    pub status: crate::types::LifeCycleState,
    /// <p>The Amazon Web Services account ID of the access point owner.</p>
    pub owner_id: ::std::string::String,
    /// <p>The POSIX identity configured for this access point.</p>
    pub posix_user: ::std::option::Option<crate::types::PosixUser>,
    /// <p>The root directory configuration for this access point.</p>
    pub root_directory: ::std::option::Option<crate::types::RootDirectory>,
    /// <p>The tags associated with the access point.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p>The name of the access point.</p>
    pub name: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetAccessPointOutput {
    /// <p>The ARN of the access point.</p>
    pub fn access_point_arn(&self) -> &str {
        use std::ops::Deref;
        self.access_point_arn.deref()
    }
    /// <p>The ID of the access point.</p>
    pub fn access_point_id(&self) -> &str {
        use std::ops::Deref;
        self.access_point_id.deref()
    }
    /// <p>The client token used for idempotency when the access point was created.</p>
    pub fn client_token(&self) -> &str {
        use std::ops::Deref;
        self.client_token.deref()
    }
    /// <p>The ID of the S3 File System.</p>
    pub fn file_system_id(&self) -> &str {
        use std::ops::Deref;
        self.file_system_id.deref()
    }
    /// <p>The current status of the access point.</p>
    pub fn status(&self) -> &crate::types::LifeCycleState {
        &self.status
    }
    /// <p>The Amazon Web Services account ID of the access point owner.</p>
    pub fn owner_id(&self) -> &str {
        use std::ops::Deref;
        self.owner_id.deref()
    }
    /// <p>The POSIX identity configured for this access point.</p>
    pub fn posix_user(&self) -> ::std::option::Option<&crate::types::PosixUser> {
        self.posix_user.as_ref()
    }
    /// <p>The root directory configuration for this access point.</p>
    pub fn root_directory(&self) -> ::std::option::Option<&crate::types::RootDirectory> {
        self.root_directory.as_ref()
    }
    /// <p>The tags associated with the access point.</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()
    }
    /// <p>The name of the access point.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for GetAccessPointOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetAccessPointOutput {
    /// Creates a new builder-style object to manufacture [`GetAccessPointOutput`](crate::operation::get_access_point::GetAccessPointOutput).
    pub fn builder() -> crate::operation::get_access_point::builders::GetAccessPointOutputBuilder {
        crate::operation::get_access_point::builders::GetAccessPointOutputBuilder::default()
    }
}

/// A builder for [`GetAccessPointOutput`](crate::operation::get_access_point::GetAccessPointOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetAccessPointOutputBuilder {
    pub(crate) access_point_arn: ::std::option::Option<::std::string::String>,
    pub(crate) access_point_id: ::std::option::Option<::std::string::String>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) file_system_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::LifeCycleState>,
    pub(crate) owner_id: ::std::option::Option<::std::string::String>,
    pub(crate) posix_user: ::std::option::Option<crate::types::PosixUser>,
    pub(crate) root_directory: ::std::option::Option<crate::types::RootDirectory>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetAccessPointOutputBuilder {
    /// <p>The ARN of the access point.</p>
    /// This field is required.
    pub fn access_point_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.access_point_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the access point.</p>
    pub fn set_access_point_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.access_point_arn = input;
        self
    }
    /// <p>The ARN of the access point.</p>
    pub fn get_access_point_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.access_point_arn
    }
    /// <p>The ID of the access point.</p>
    /// This field is required.
    pub fn access_point_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.access_point_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the access point.</p>
    pub fn set_access_point_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.access_point_id = input;
        self
    }
    /// <p>The ID of the access point.</p>
    pub fn get_access_point_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.access_point_id
    }
    /// <p>The client token used for idempotency when the access point was created.</p>
    /// This field is required.
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The client token used for idempotency when the access point was created.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>The client token used for idempotency when the access point was created.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The ID of the S3 File System.</p>
    /// This field is required.
    pub fn file_system_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.file_system_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the S3 File System.</p>
    pub fn set_file_system_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.file_system_id = input;
        self
    }
    /// <p>The ID of the S3 File System.</p>
    pub fn get_file_system_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.file_system_id
    }
    /// <p>The current status of the access point.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::LifeCycleState) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the access point.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::LifeCycleState>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the access point.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::LifeCycleState> {
        &self.status
    }
    /// <p>The Amazon Web Services account ID of the access point owner.</p>
    /// This field is required.
    pub fn owner_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.owner_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services account ID of the access point owner.</p>
    pub fn set_owner_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.owner_id = input;
        self
    }
    /// <p>The Amazon Web Services account ID of the access point owner.</p>
    pub fn get_owner_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.owner_id
    }
    /// <p>The POSIX identity configured for this access point.</p>
    pub fn posix_user(mut self, input: crate::types::PosixUser) -> Self {
        self.posix_user = ::std::option::Option::Some(input);
        self
    }
    /// <p>The POSIX identity configured for this access point.</p>
    pub fn set_posix_user(mut self, input: ::std::option::Option<crate::types::PosixUser>) -> Self {
        self.posix_user = input;
        self
    }
    /// <p>The POSIX identity configured for this access point.</p>
    pub fn get_posix_user(&self) -> &::std::option::Option<crate::types::PosixUser> {
        &self.posix_user
    }
    /// <p>The root directory configuration for this access point.</p>
    pub fn root_directory(mut self, input: crate::types::RootDirectory) -> Self {
        self.root_directory = ::std::option::Option::Some(input);
        self
    }
    /// <p>The root directory configuration for this access point.</p>
    pub fn set_root_directory(mut self, input: ::std::option::Option<crate::types::RootDirectory>) -> Self {
        self.root_directory = input;
        self
    }
    /// <p>The root directory configuration for this access point.</p>
    pub fn get_root_directory(&self) -> &::std::option::Option<crate::types::RootDirectory> {
        &self.root_directory
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags associated with the access point.</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>The tags associated with the access point.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags associated with the access point.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p>The name of the access point.</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 access point.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the access point.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    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 [`GetAccessPointOutput`](crate::operation::get_access_point::GetAccessPointOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`access_point_arn`](crate::operation::get_access_point::builders::GetAccessPointOutputBuilder::access_point_arn)
    /// - [`access_point_id`](crate::operation::get_access_point::builders::GetAccessPointOutputBuilder::access_point_id)
    /// - [`client_token`](crate::operation::get_access_point::builders::GetAccessPointOutputBuilder::client_token)
    /// - [`file_system_id`](crate::operation::get_access_point::builders::GetAccessPointOutputBuilder::file_system_id)
    /// - [`status`](crate::operation::get_access_point::builders::GetAccessPointOutputBuilder::status)
    /// - [`owner_id`](crate::operation::get_access_point::builders::GetAccessPointOutputBuilder::owner_id)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::get_access_point::GetAccessPointOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_access_point::GetAccessPointOutput {
            access_point_arn: self.access_point_arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "access_point_arn",
                    "access_point_arn was not specified but it is required when building GetAccessPointOutput",
                )
            })?,
            access_point_id: self.access_point_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "access_point_id",
                    "access_point_id was not specified but it is required when building GetAccessPointOutput",
                )
            })?,
            client_token: self.client_token.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "client_token",
                    "client_token was not specified but it is required when building GetAccessPointOutput",
                )
            })?,
            file_system_id: self.file_system_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "file_system_id",
                    "file_system_id was not specified but it is required when building GetAccessPointOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building GetAccessPointOutput",
                )
            })?,
            owner_id: self.owner_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "owner_id",
                    "owner_id was not specified but it is required when building GetAccessPointOutput",
                )
            })?,
            posix_user: self.posix_user,
            root_directory: self.root_directory,
            tags: self.tags,
            name: self.name,
            _request_id: self._request_id,
        })
    }
}