aws-sdk-storagegateway 1.115.0

AWS SDK for AWS Storage Gateway
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>CreateTapesInput</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateTapesInput {
    /// <p>The unique Amazon Resource Name (ARN) that represents the gateway to associate the virtual tapes with. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
    pub gateway_arn: ::std::option::Option<::std::string::String>,
    /// <p>The size, in bytes, of the virtual tapes that you want to create.</p><note>
    /// <p>The size must be aligned by gigabyte (1024*1024*1024 bytes).</p>
    /// </note>
    pub tape_size_in_bytes: ::std::option::Option<i64>,
    /// <p>A unique identifier that you use to retry a request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p><note>
    /// <p>Using the same <code>ClientToken</code> prevents creating the tape multiple times.</p>
    /// </note>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The number of virtual tapes that you want to create.</p>
    pub num_tapes_to_create: ::std::option::Option<i32>,
    /// <p>A prefix that you append to the barcode of the virtual tape you are creating. This prefix makes the barcode unique.</p><note>
    /// <p>The prefix must be 1-4 characters in length and must be one of the uppercase letters from A to Z.</p>
    /// </note>
    pub tape_barcode_prefix: ::std::option::Option<::std::string::String>,
    /// <p>Set to <code>true</code> to use Amazon S3 server-side encryption with your own KMS key, or <code>false</code> to use a key managed by Amazon S3. Optional.</p>
    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
    pub kms_encrypted: ::std::option::Option<bool>,
    /// <p>The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This value can only be set when <code>KMSEncrypted</code> is <code>true</code>. Optional.</p>
    pub kms_key: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.</p>
    pub pool_id: ::std::option::Option<::std::string::String>,
    /// <p>Set to <code>TRUE</code> if the tape you are creating is to be configured as a write-once-read-many (WORM) tape.</p>
    pub worm: ::std::option::Option<bool>,
    /// <p>A list of up to 50 tags that can be assigned to a virtual tape. Each tag is a key-value pair.</p><note>
    /// <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</p>
    /// </note>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateTapesInput {
    /// <p>The unique Amazon Resource Name (ARN) that represents the gateway to associate the virtual tapes with. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
    pub fn gateway_arn(&self) -> ::std::option::Option<&str> {
        self.gateway_arn.as_deref()
    }
    /// <p>The size, in bytes, of the virtual tapes that you want to create.</p><note>
    /// <p>The size must be aligned by gigabyte (1024*1024*1024 bytes).</p>
    /// </note>
    pub fn tape_size_in_bytes(&self) -> ::std::option::Option<i64> {
        self.tape_size_in_bytes
    }
    /// <p>A unique identifier that you use to retry a request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p><note>
    /// <p>Using the same <code>ClientToken</code> prevents creating the tape multiple times.</p>
    /// </note>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The number of virtual tapes that you want to create.</p>
    pub fn num_tapes_to_create(&self) -> ::std::option::Option<i32> {
        self.num_tapes_to_create
    }
    /// <p>A prefix that you append to the barcode of the virtual tape you are creating. This prefix makes the barcode unique.</p><note>
    /// <p>The prefix must be 1-4 characters in length and must be one of the uppercase letters from A to Z.</p>
    /// </note>
    pub fn tape_barcode_prefix(&self) -> ::std::option::Option<&str> {
        self.tape_barcode_prefix.as_deref()
    }
    /// <p>Set to <code>true</code> to use Amazon S3 server-side encryption with your own KMS key, or <code>false</code> to use a key managed by Amazon S3. Optional.</p>
    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
    pub fn kms_encrypted(&self) -> ::std::option::Option<bool> {
        self.kms_encrypted
    }
    /// <p>The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This value can only be set when <code>KMSEncrypted</code> is <code>true</code>. Optional.</p>
    pub fn kms_key(&self) -> ::std::option::Option<&str> {
        self.kms_key.as_deref()
    }
    /// <p>The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.</p>
    pub fn pool_id(&self) -> ::std::option::Option<&str> {
        self.pool_id.as_deref()
    }
    /// <p>Set to <code>TRUE</code> if the tape you are creating is to be configured as a write-once-read-many (WORM) tape.</p>
    pub fn worm(&self) -> ::std::option::Option<bool> {
        self.worm
    }
    /// <p>A list of up to 50 tags that can be assigned to a virtual tape. Each tag is a key-value pair.</p><note>
    /// <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</p>
    /// </note>
    ///
    /// 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 CreateTapesInput {
    /// Creates a new builder-style object to manufacture [`CreateTapesInput`](crate::operation::create_tapes::CreateTapesInput).
    pub fn builder() -> crate::operation::create_tapes::builders::CreateTapesInputBuilder {
        crate::operation::create_tapes::builders::CreateTapesInputBuilder::default()
    }
}

/// A builder for [`CreateTapesInput`](crate::operation::create_tapes::CreateTapesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateTapesInputBuilder {
    pub(crate) gateway_arn: ::std::option::Option<::std::string::String>,
    pub(crate) tape_size_in_bytes: ::std::option::Option<i64>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) num_tapes_to_create: ::std::option::Option<i32>,
    pub(crate) tape_barcode_prefix: ::std::option::Option<::std::string::String>,
    pub(crate) kms_encrypted: ::std::option::Option<bool>,
    pub(crate) kms_key: ::std::option::Option<::std::string::String>,
    pub(crate) pool_id: ::std::option::Option<::std::string::String>,
    pub(crate) worm: ::std::option::Option<bool>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateTapesInputBuilder {
    /// <p>The unique Amazon Resource Name (ARN) that represents the gateway to associate the virtual tapes with. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
    /// This field is required.
    pub fn gateway_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.gateway_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique Amazon Resource Name (ARN) that represents the gateway to associate the virtual tapes with. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
    pub fn set_gateway_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.gateway_arn = input;
        self
    }
    /// <p>The unique Amazon Resource Name (ARN) that represents the gateway to associate the virtual tapes with. Use the <code>ListGateways</code> operation to return a list of gateways for your account and Amazon Web Services Region.</p>
    pub fn get_gateway_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.gateway_arn
    }
    /// <p>The size, in bytes, of the virtual tapes that you want to create.</p><note>
    /// <p>The size must be aligned by gigabyte (1024*1024*1024 bytes).</p>
    /// </note>
    /// This field is required.
    pub fn tape_size_in_bytes(mut self, input: i64) -> Self {
        self.tape_size_in_bytes = ::std::option::Option::Some(input);
        self
    }
    /// <p>The size, in bytes, of the virtual tapes that you want to create.</p><note>
    /// <p>The size must be aligned by gigabyte (1024*1024*1024 bytes).</p>
    /// </note>
    pub fn set_tape_size_in_bytes(mut self, input: ::std::option::Option<i64>) -> Self {
        self.tape_size_in_bytes = input;
        self
    }
    /// <p>The size, in bytes, of the virtual tapes that you want to create.</p><note>
    /// <p>The size must be aligned by gigabyte (1024*1024*1024 bytes).</p>
    /// </note>
    pub fn get_tape_size_in_bytes(&self) -> &::std::option::Option<i64> {
        &self.tape_size_in_bytes
    }
    /// <p>A unique identifier that you use to retry a request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p><note>
    /// <p>Using the same <code>ClientToken</code> prevents creating the tape multiple times.</p>
    /// </note>
    /// 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>A unique identifier that you use to retry a request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p><note>
    /// <p>Using the same <code>ClientToken</code> prevents creating the tape multiple times.</p>
    /// </note>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique identifier that you use to retry a request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p><note>
    /// <p>Using the same <code>ClientToken</code> prevents creating the tape multiple times.</p>
    /// </note>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The number of virtual tapes that you want to create.</p>
    /// This field is required.
    pub fn num_tapes_to_create(mut self, input: i32) -> Self {
        self.num_tapes_to_create = ::std::option::Option::Some(input);
        self
    }
    /// <p>The number of virtual tapes that you want to create.</p>
    pub fn set_num_tapes_to_create(mut self, input: ::std::option::Option<i32>) -> Self {
        self.num_tapes_to_create = input;
        self
    }
    /// <p>The number of virtual tapes that you want to create.</p>
    pub fn get_num_tapes_to_create(&self) -> &::std::option::Option<i32> {
        &self.num_tapes_to_create
    }
    /// <p>A prefix that you append to the barcode of the virtual tape you are creating. This prefix makes the barcode unique.</p><note>
    /// <p>The prefix must be 1-4 characters in length and must be one of the uppercase letters from A to Z.</p>
    /// </note>
    /// This field is required.
    pub fn tape_barcode_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.tape_barcode_prefix = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A prefix that you append to the barcode of the virtual tape you are creating. This prefix makes the barcode unique.</p><note>
    /// <p>The prefix must be 1-4 characters in length and must be one of the uppercase letters from A to Z.</p>
    /// </note>
    pub fn set_tape_barcode_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.tape_barcode_prefix = input;
        self
    }
    /// <p>A prefix that you append to the barcode of the virtual tape you are creating. This prefix makes the barcode unique.</p><note>
    /// <p>The prefix must be 1-4 characters in length and must be one of the uppercase letters from A to Z.</p>
    /// </note>
    pub fn get_tape_barcode_prefix(&self) -> &::std::option::Option<::std::string::String> {
        &self.tape_barcode_prefix
    }
    /// <p>Set to <code>true</code> to use Amazon S3 server-side encryption with your own KMS key, or <code>false</code> to use a key managed by Amazon S3. Optional.</p>
    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
    pub fn kms_encrypted(mut self, input: bool) -> Self {
        self.kms_encrypted = ::std::option::Option::Some(input);
        self
    }
    /// <p>Set to <code>true</code> to use Amazon S3 server-side encryption with your own KMS key, or <code>false</code> to use a key managed by Amazon S3. Optional.</p>
    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
    pub fn set_kms_encrypted(mut self, input: ::std::option::Option<bool>) -> Self {
        self.kms_encrypted = input;
        self
    }
    /// <p>Set to <code>true</code> to use Amazon S3 server-side encryption with your own KMS key, or <code>false</code> to use a key managed by Amazon S3. Optional.</p>
    /// <p>Valid Values: <code>true</code> | <code>false</code></p>
    pub fn get_kms_encrypted(&self) -> &::std::option::Option<bool> {
        &self.kms_encrypted
    }
    /// <p>The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This value can only be set when <code>KMSEncrypted</code> is <code>true</code>. Optional.</p>
    pub fn kms_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This value can only be set when <code>KMSEncrypted</code> is <code>true</code>. Optional.</p>
    pub fn set_kms_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of a symmetric customer master key (CMK) used for Amazon S3 server-side encryption. Storage Gateway does not support asymmetric CMKs. This value can only be set when <code>KMSEncrypted</code> is <code>true</code>. Optional.</p>
    pub fn get_kms_key(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key
    }
    /// <p>The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.</p>
    pub fn pool_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.pool_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.</p>
    pub fn set_pool_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.pool_id = input;
        self
    }
    /// <p>The ID of the pool that you want to add your tape to for archiving. The tape in this pool is archived in the S3 storage class that is associated with the pool. When you use your backup application to eject the tape, the tape is archived directly into the storage class (S3 Glacier or S3 Glacier Deep Archive) that corresponds to the pool.</p>
    pub fn get_pool_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.pool_id
    }
    /// <p>Set to <code>TRUE</code> if the tape you are creating is to be configured as a write-once-read-many (WORM) tape.</p>
    pub fn worm(mut self, input: bool) -> Self {
        self.worm = ::std::option::Option::Some(input);
        self
    }
    /// <p>Set to <code>TRUE</code> if the tape you are creating is to be configured as a write-once-read-many (WORM) tape.</p>
    pub fn set_worm(mut self, input: ::std::option::Option<bool>) -> Self {
        self.worm = input;
        self
    }
    /// <p>Set to <code>TRUE</code> if the tape you are creating is to be configured as a write-once-read-many (WORM) tape.</p>
    pub fn get_worm(&self) -> &::std::option::Option<bool> {
        &self.worm
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A list of up to 50 tags that can be assigned to a virtual tape. Each tag is a key-value pair.</p><note>
    /// <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</p>
    /// </note>
    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>A list of up to 50 tags that can be assigned to a virtual tape. Each tag is a key-value pair.</p><note>
    /// <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</p>
    /// </note>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>A list of up to 50 tags that can be assigned to a virtual tape. Each tag is a key-value pair.</p><note>
    /// <p>Valid characters for key and value are letters, spaces, and numbers representable in UTF-8 format, and the following special characters: + - = . _ : / @. The maximum length of a tag's key is 128 characters, and the maximum length for a tag's value is 256.</p>
    /// </note>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateTapesInput`](crate::operation::create_tapes::CreateTapesInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::create_tapes::CreateTapesInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_tapes::CreateTapesInput {
            gateway_arn: self.gateway_arn,
            tape_size_in_bytes: self.tape_size_in_bytes,
            client_token: self.client_token,
            num_tapes_to_create: self.num_tapes_to_create,
            tape_barcode_prefix: self.tape_barcode_prefix,
            kms_encrypted: self.kms_encrypted,
            kms_key: self.kms_key,
            pool_id: self.pool_id,
            worm: self.worm,
            tags: self.tags,
        })
    }
}