aws-sdk-backupstorage 1.30.0

AWS SDK for AWS Backup Storage
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::fmt::Debug)]
pub struct PutChunkInput {
    /// Backup job Id for the in-progress backup.
    pub backup_job_id: ::std::option::Option<::std::string::String>,
    /// Upload Id for the in-progress upload.
    pub upload_id: ::std::option::Option<::std::string::String>,
    /// Describes this chunk's position relative to the other chunks
    pub chunk_index: ::std::option::Option<i64>,
    /// Data to be uploaded
    pub data: ::aws_smithy_types::byte_stream::ByteStream,
    /// Data length
    pub length: ::std::option::Option<i64>,
    /// Data checksum
    pub checksum: ::std::option::Option<::std::string::String>,
    /// Checksum algorithm
    pub checksum_algorithm: ::std::option::Option<crate::types::DataChecksumAlgorithm>,
}
impl PutChunkInput {
    /// Backup job Id for the in-progress backup.
    pub fn backup_job_id(&self) -> ::std::option::Option<&str> {
        self.backup_job_id.as_deref()
    }
    /// Upload Id for the in-progress upload.
    pub fn upload_id(&self) -> ::std::option::Option<&str> {
        self.upload_id.as_deref()
    }
    /// Describes this chunk's position relative to the other chunks
    pub fn chunk_index(&self) -> ::std::option::Option<i64> {
        self.chunk_index
    }
    /// Data to be uploaded
    pub fn data(&self) -> &::aws_smithy_types::byte_stream::ByteStream {
        &self.data
    }
    /// Data length
    pub fn length(&self) -> ::std::option::Option<i64> {
        self.length
    }
    /// Data checksum
    pub fn checksum(&self) -> ::std::option::Option<&str> {
        self.checksum.as_deref()
    }
    /// Checksum algorithm
    pub fn checksum_algorithm(&self) -> ::std::option::Option<&crate::types::DataChecksumAlgorithm> {
        self.checksum_algorithm.as_ref()
    }
}
impl PutChunkInput {
    /// Creates a new builder-style object to manufacture [`PutChunkInput`](crate::operation::put_chunk::PutChunkInput).
    pub fn builder() -> crate::operation::put_chunk::builders::PutChunkInputBuilder {
        crate::operation::put_chunk::builders::PutChunkInputBuilder::default()
    }
}

/// A builder for [`PutChunkInput`](crate::operation::put_chunk::PutChunkInput).
#[non_exhaustive]
#[derive(::std::default::Default, ::std::fmt::Debug)]
pub struct PutChunkInputBuilder {
    pub(crate) backup_job_id: ::std::option::Option<::std::string::String>,
    pub(crate) upload_id: ::std::option::Option<::std::string::String>,
    pub(crate) chunk_index: ::std::option::Option<i64>,
    pub(crate) data: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>,
    pub(crate) length: ::std::option::Option<i64>,
    pub(crate) checksum: ::std::option::Option<::std::string::String>,
    pub(crate) checksum_algorithm: ::std::option::Option<crate::types::DataChecksumAlgorithm>,
}
impl PutChunkInputBuilder {
    /// Backup job Id for the in-progress backup.
    /// This field is required.
    pub fn backup_job_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.backup_job_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Backup job Id for the in-progress backup.
    pub fn set_backup_job_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.backup_job_id = input;
        self
    }
    /// Backup job Id for the in-progress backup.
    pub fn get_backup_job_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.backup_job_id
    }
    /// Upload Id for the in-progress upload.
    /// This field is required.
    pub fn upload_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.upload_id = ::std::option::Option::Some(input.into());
        self
    }
    /// Upload Id for the in-progress upload.
    pub fn set_upload_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.upload_id = input;
        self
    }
    /// Upload Id for the in-progress upload.
    pub fn get_upload_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.upload_id
    }
    /// Describes this chunk's position relative to the other chunks
    /// This field is required.
    pub fn chunk_index(mut self, input: i64) -> Self {
        self.chunk_index = ::std::option::Option::Some(input);
        self
    }
    /// Describes this chunk's position relative to the other chunks
    pub fn set_chunk_index(mut self, input: ::std::option::Option<i64>) -> Self {
        self.chunk_index = input;
        self
    }
    /// Describes this chunk's position relative to the other chunks
    pub fn get_chunk_index(&self) -> &::std::option::Option<i64> {
        &self.chunk_index
    }
    /// Data to be uploaded
    /// This field is required.
    pub fn data(mut self, input: ::aws_smithy_types::byte_stream::ByteStream) -> Self {
        self.data = ::std::option::Option::Some(input);
        self
    }
    /// Data to be uploaded
    pub fn set_data(mut self, input: ::std::option::Option<::aws_smithy_types::byte_stream::ByteStream>) -> Self {
        self.data = input;
        self
    }
    /// Data to be uploaded
    pub fn get_data(&self) -> &::std::option::Option<::aws_smithy_types::byte_stream::ByteStream> {
        &self.data
    }
    /// Data length
    /// This field is required.
    pub fn length(mut self, input: i64) -> Self {
        self.length = ::std::option::Option::Some(input);
        self
    }
    /// Data length
    pub fn set_length(mut self, input: ::std::option::Option<i64>) -> Self {
        self.length = input;
        self
    }
    /// Data length
    pub fn get_length(&self) -> &::std::option::Option<i64> {
        &self.length
    }
    /// Data checksum
    /// This field is required.
    pub fn checksum(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.checksum = ::std::option::Option::Some(input.into());
        self
    }
    /// Data checksum
    pub fn set_checksum(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.checksum = input;
        self
    }
    /// Data checksum
    pub fn get_checksum(&self) -> &::std::option::Option<::std::string::String> {
        &self.checksum
    }
    /// Checksum algorithm
    /// This field is required.
    pub fn checksum_algorithm(mut self, input: crate::types::DataChecksumAlgorithm) -> Self {
        self.checksum_algorithm = ::std::option::Option::Some(input);
        self
    }
    /// Checksum algorithm
    pub fn set_checksum_algorithm(mut self, input: ::std::option::Option<crate::types::DataChecksumAlgorithm>) -> Self {
        self.checksum_algorithm = input;
        self
    }
    /// Checksum algorithm
    pub fn get_checksum_algorithm(&self) -> &::std::option::Option<crate::types::DataChecksumAlgorithm> {
        &self.checksum_algorithm
    }
    /// Consumes the builder and constructs a [`PutChunkInput`](crate::operation::put_chunk::PutChunkInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::put_chunk::PutChunkInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_chunk::PutChunkInput {
            backup_job_id: self.backup_job_id,
            upload_id: self.upload_id,
            chunk_index: self.chunk_index,
            data: self.data.unwrap_or_default(),
            length: self.length,
            checksum: self.checksum,
            checksum_algorithm: self.checksum_algorithm,
        })
    }
}