aws-sdk-datasync 1.130.0

AWS SDK for AWS DataSync
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 UpdateLocationNfsInput {
    /// <p>Specifies the Amazon Resource Name (ARN) of the NFS transfer location that you want to update.</p>
    pub location_arn: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the export path in your NFS file server that you want DataSync to mount.</p>
    /// <p>This path (or a subdirectory of the path) is where DataSync transfers data to or from. For information on configuring an export for DataSync, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">Accessing NFS file servers</a>.</p>
    pub subdirectory: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the DNS name or IP address (IPv4 or IPv6) of the NFS file server that your DataSync agent connects to.</p>
    pub server_hostname: ::std::option::Option<::std::string::String>,
    /// <p>The DataSync agents that can connect to your Network File System (NFS) file server.</p>
    pub on_prem_config: ::std::option::Option<crate::types::OnPremConfig>,
    /// <p>Specifies how DataSync can access a location using the NFS protocol.</p>
    pub mount_options: ::std::option::Option<crate::types::NfsMountOptions>,
}
impl UpdateLocationNfsInput {
    /// <p>Specifies the Amazon Resource Name (ARN) of the NFS transfer location that you want to update.</p>
    pub fn location_arn(&self) -> ::std::option::Option<&str> {
        self.location_arn.as_deref()
    }
    /// <p>Specifies the export path in your NFS file server that you want DataSync to mount.</p>
    /// <p>This path (or a subdirectory of the path) is where DataSync transfers data to or from. For information on configuring an export for DataSync, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">Accessing NFS file servers</a>.</p>
    pub fn subdirectory(&self) -> ::std::option::Option<&str> {
        self.subdirectory.as_deref()
    }
    /// <p>Specifies the DNS name or IP address (IPv4 or IPv6) of the NFS file server that your DataSync agent connects to.</p>
    pub fn server_hostname(&self) -> ::std::option::Option<&str> {
        self.server_hostname.as_deref()
    }
    /// <p>The DataSync agents that can connect to your Network File System (NFS) file server.</p>
    pub fn on_prem_config(&self) -> ::std::option::Option<&crate::types::OnPremConfig> {
        self.on_prem_config.as_ref()
    }
    /// <p>Specifies how DataSync can access a location using the NFS protocol.</p>
    pub fn mount_options(&self) -> ::std::option::Option<&crate::types::NfsMountOptions> {
        self.mount_options.as_ref()
    }
}
static UPDATELOCATIONNFSINPUT_MEMBER_LOCATION_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.datasync.synthetic#UpdateLocationNfsInput$LocationArn",
        "com.amazonaws.datasync.synthetic",
        "UpdateLocationNfsInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "LocationArn",
    0,
);
static UPDATELOCATIONNFSINPUT_MEMBER_SUBDIRECTORY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.datasync.synthetic#UpdateLocationNfsInput$Subdirectory",
        "com.amazonaws.datasync.synthetic",
        "UpdateLocationNfsInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "Subdirectory",
    1,
);
static UPDATELOCATIONNFSINPUT_MEMBER_SERVER_HOSTNAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.datasync.synthetic#UpdateLocationNfsInput$ServerHostname",
        "com.amazonaws.datasync.synthetic",
        "UpdateLocationNfsInput",
    ),
    ::aws_smithy_schema::ShapeType::String,
    "ServerHostname",
    2,
);
static UPDATELOCATIONNFSINPUT_MEMBER_ON_PREM_CONFIG: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.datasync.synthetic#UpdateLocationNfsInput$OnPremConfig",
        "com.amazonaws.datasync.synthetic",
        "UpdateLocationNfsInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    "OnPremConfig",
    3,
);
static UPDATELOCATIONNFSINPUT_MEMBER_MOUNT_OPTIONS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.datasync.synthetic#UpdateLocationNfsInput$MountOptions",
        "com.amazonaws.datasync.synthetic",
        "UpdateLocationNfsInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    "MountOptions",
    4,
);
static UPDATELOCATIONNFSINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
    ::aws_smithy_schema::ShapeId::from_parts(
        "com.amazonaws.datasync.synthetic#UpdateLocationNfsInput",
        "com.amazonaws.datasync.synthetic",
        "UpdateLocationNfsInput",
    ),
    ::aws_smithy_schema::ShapeType::Structure,
    &[
        &UPDATELOCATIONNFSINPUT_MEMBER_LOCATION_ARN,
        &UPDATELOCATIONNFSINPUT_MEMBER_SUBDIRECTORY,
        &UPDATELOCATIONNFSINPUT_MEMBER_SERVER_HOSTNAME,
        &UPDATELOCATIONNFSINPUT_MEMBER_ON_PREM_CONFIG,
        &UPDATELOCATIONNFSINPUT_MEMBER_MOUNT_OPTIONS,
    ],
)
.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
.with_original_name("UpdateLocationNfsRequest");
impl UpdateLocationNfsInput {
    /// The schema for this shape.
    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &UPDATELOCATIONNFSINPUT_SCHEMA;
}
impl ::aws_smithy_schema::serde::SerializableStruct for UpdateLocationNfsInput {
    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.location_arn {
            ser.write_string(&UPDATELOCATIONNFSINPUT_MEMBER_LOCATION_ARN, val)?;
        }
        if let Some(ref val) = self.subdirectory {
            ser.write_string(&UPDATELOCATIONNFSINPUT_MEMBER_SUBDIRECTORY, val)?;
        }
        if let Some(ref val) = self.server_hostname {
            ser.write_string(&UPDATELOCATIONNFSINPUT_MEMBER_SERVER_HOSTNAME, val)?;
        }
        if let Some(ref val) = self.on_prem_config {
            ser.write_struct(&UPDATELOCATIONNFSINPUT_MEMBER_ON_PREM_CONFIG, val)?;
        }
        if let Some(ref val) = self.mount_options {
            ser.write_struct(&UPDATELOCATIONNFSINPUT_MEMBER_MOUNT_OPTIONS, val)?;
        }
        Ok(())
    }
}
impl crate::operation::update_location_nfs::builders::UpdateLocationNfsInputBuilder {
    #[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(&UPDATELOCATIONNFSINPUT_SCHEMA, &mut |member, deser| {
            match member.member_index() {
                Some(0) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.location_arn = Some(deser.read_string(member)?);
                    }
                }
                Some(1) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.subdirectory = Some(deser.read_string(member)?);
                    }
                }
                Some(2) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.server_hostname = Some(deser.read_string(member)?);
                    }
                }
                Some(3) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.on_prem_config = Some(crate::types::OnPremConfig::deserialize(deser)?);
                    }
                }
                Some(4) => {
                    if deser.is_null() {
                        deser.read_null()?;
                    } else {
                        self.mount_options = Some(crate::types::NfsMountOptions::deserialize(deser)?);
                    }
                }
                _ => {}
            }
            Ok(())
        })
    }
}

impl UpdateLocationNfsInput {
    /// 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)?;
        builder.location_arn = builder.location_arn.or(Some(String::new()));
        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
    }
}
impl UpdateLocationNfsInput {
    /// Creates a new builder-style object to manufacture [`UpdateLocationNfsInput`](crate::operation::update_location_nfs::UpdateLocationNfsInput).
    pub fn builder() -> crate::operation::update_location_nfs::builders::UpdateLocationNfsInputBuilder {
        crate::operation::update_location_nfs::builders::UpdateLocationNfsInputBuilder::default()
    }
}

/// A builder for [`UpdateLocationNfsInput`](crate::operation::update_location_nfs::UpdateLocationNfsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateLocationNfsInputBuilder {
    pub(crate) location_arn: ::std::option::Option<::std::string::String>,
    pub(crate) subdirectory: ::std::option::Option<::std::string::String>,
    pub(crate) server_hostname: ::std::option::Option<::std::string::String>,
    pub(crate) on_prem_config: ::std::option::Option<crate::types::OnPremConfig>,
    pub(crate) mount_options: ::std::option::Option<crate::types::NfsMountOptions>,
}
impl UpdateLocationNfsInputBuilder {
    /// <p>Specifies the Amazon Resource Name (ARN) of the NFS transfer location that you want to update.</p>
    /// This field is required.
    pub fn location_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.location_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the Amazon Resource Name (ARN) of the NFS transfer location that you want to update.</p>
    pub fn set_location_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.location_arn = input;
        self
    }
    /// <p>Specifies the Amazon Resource Name (ARN) of the NFS transfer location that you want to update.</p>
    pub fn get_location_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.location_arn
    }
    /// <p>Specifies the export path in your NFS file server that you want DataSync to mount.</p>
    /// <p>This path (or a subdirectory of the path) is where DataSync transfers data to or from. For information on configuring an export for DataSync, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">Accessing NFS file servers</a>.</p>
    pub fn subdirectory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.subdirectory = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the export path in your NFS file server that you want DataSync to mount.</p>
    /// <p>This path (or a subdirectory of the path) is where DataSync transfers data to or from. For information on configuring an export for DataSync, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">Accessing NFS file servers</a>.</p>
    pub fn set_subdirectory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.subdirectory = input;
        self
    }
    /// <p>Specifies the export path in your NFS file server that you want DataSync to mount.</p>
    /// <p>This path (or a subdirectory of the path) is where DataSync transfers data to or from. For information on configuring an export for DataSync, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/create-nfs-location.html#accessing-nfs">Accessing NFS file servers</a>.</p>
    pub fn get_subdirectory(&self) -> &::std::option::Option<::std::string::String> {
        &self.subdirectory
    }
    /// <p>Specifies the DNS name or IP address (IPv4 or IPv6) of the NFS file server that your DataSync agent connects to.</p>
    pub fn server_hostname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.server_hostname = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Specifies the DNS name or IP address (IPv4 or IPv6) of the NFS file server that your DataSync agent connects to.</p>
    pub fn set_server_hostname(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.server_hostname = input;
        self
    }
    /// <p>Specifies the DNS name or IP address (IPv4 or IPv6) of the NFS file server that your DataSync agent connects to.</p>
    pub fn get_server_hostname(&self) -> &::std::option::Option<::std::string::String> {
        &self.server_hostname
    }
    /// <p>The DataSync agents that can connect to your Network File System (NFS) file server.</p>
    pub fn on_prem_config(mut self, input: crate::types::OnPremConfig) -> Self {
        self.on_prem_config = ::std::option::Option::Some(input);
        self
    }
    /// <p>The DataSync agents that can connect to your Network File System (NFS) file server.</p>
    pub fn set_on_prem_config(mut self, input: ::std::option::Option<crate::types::OnPremConfig>) -> Self {
        self.on_prem_config = input;
        self
    }
    /// <p>The DataSync agents that can connect to your Network File System (NFS) file server.</p>
    pub fn get_on_prem_config(&self) -> &::std::option::Option<crate::types::OnPremConfig> {
        &self.on_prem_config
    }
    /// <p>Specifies how DataSync can access a location using the NFS protocol.</p>
    pub fn mount_options(mut self, input: crate::types::NfsMountOptions) -> Self {
        self.mount_options = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies how DataSync can access a location using the NFS protocol.</p>
    pub fn set_mount_options(mut self, input: ::std::option::Option<crate::types::NfsMountOptions>) -> Self {
        self.mount_options = input;
        self
    }
    /// <p>Specifies how DataSync can access a location using the NFS protocol.</p>
    pub fn get_mount_options(&self) -> &::std::option::Option<crate::types::NfsMountOptions> {
        &self.mount_options
    }
    /// Consumes the builder and constructs a [`UpdateLocationNfsInput`](crate::operation::update_location_nfs::UpdateLocationNfsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_location_nfs::UpdateLocationNfsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_location_nfs::UpdateLocationNfsInput {
            location_arn: self.location_arn,
            subdirectory: self.subdirectory,
            server_hostname: self.server_hostname,
            on_prem_config: self.on_prem_config,
            mount_options: self.mount_options,
        })
    }
}