aws-sdk-ebs 1.97.0

AWS SDK for Amazon Elastic Block Store
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>A block of data in an Amazon Elastic Block Store snapshot.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Block {
    /// <p>The block index.</p>
    pub block_index: ::std::option::Option<i32>,
    /// <p>The block token for the block index.</p>
    pub block_token: ::std::option::Option<::std::string::String>,
}
impl Block {
    /// <p>The block index.</p>
    pub fn block_index(&self) -> ::std::option::Option<i32> {
        self.block_index
    }
    /// <p>The block token for the block index.</p>
    pub fn block_token(&self) -> ::std::option::Option<&str> {
        self.block_token.as_deref()
    }
}
impl Block {
    /// Creates a new builder-style object to manufacture [`Block`](crate::types::Block).
    pub fn builder() -> crate::types::builders::BlockBuilder {
        crate::types::builders::BlockBuilder::default()
    }
}

/// A builder for [`Block`](crate::types::Block).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BlockBuilder {
    pub(crate) block_index: ::std::option::Option<i32>,
    pub(crate) block_token: ::std::option::Option<::std::string::String>,
}
impl BlockBuilder {
    /// <p>The block index.</p>
    pub fn block_index(mut self, input: i32) -> Self {
        self.block_index = ::std::option::Option::Some(input);
        self
    }
    /// <p>The block index.</p>
    pub fn set_block_index(mut self, input: ::std::option::Option<i32>) -> Self {
        self.block_index = input;
        self
    }
    /// <p>The block index.</p>
    pub fn get_block_index(&self) -> &::std::option::Option<i32> {
        &self.block_index
    }
    /// <p>The block token for the block index.</p>
    pub fn block_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.block_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The block token for the block index.</p>
    pub fn set_block_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.block_token = input;
        self
    }
    /// <p>The block token for the block index.</p>
    pub fn get_block_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.block_token
    }
    /// Consumes the builder and constructs a [`Block`](crate::types::Block).
    pub fn build(self) -> crate::types::Block {
        crate::types::Block {
            block_index: self.block_index,
            block_token: self.block_token,
        }
    }
}