superposition_sdk 0.100.1

Rust SDK to work with Superposition
// 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 GetVersionOutput  {
    #[allow(missing_docs)] // documentation missing in model
    pub id: ::std::string::String,
    #[allow(missing_docs)] // documentation missing in model
    pub config: ::aws_smithy_types::Document,
    #[allow(missing_docs)] // documentation missing in model
    pub config_hash: ::std::string::String,
    #[allow(missing_docs)] // documentation missing in model
    pub created_at: ::aws_smithy_types::DateTime,
    #[allow(missing_docs)] // documentation missing in model
    pub description: ::std::string::String,
    #[allow(missing_docs)] // documentation missing in model
    pub tags: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
}
impl  GetVersionOutput  {
    #[allow(missing_docs)] // documentation missing in model
    pub fn id(&self) -> &str {
        use std::ops::Deref; self.id.deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn config(&self) -> &::aws_smithy_types::Document {
        &self.config
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn config_hash(&self) -> &str {
        use std::ops::Deref; self.config_hash.deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
        &self.created_at
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn description(&self) -> &str {
        use std::ops::Deref; self.description.deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    /// 
    /// 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) -> &[::std::string::String] {
        self.tags.as_deref()
        .unwrap_or_default()
    }
}
impl GetVersionOutput {
    /// Creates a new builder-style object to manufacture [`GetVersionOutput`](crate::operation::get_version::GetVersionOutput).
    pub fn builder() -> crate::operation::get_version::builders::GetVersionOutputBuilder {
        crate::operation::get_version::builders::GetVersionOutputBuilder::default()
    }
}

/// A builder for [`GetVersionOutput`](crate::operation::get_version::GetVersionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetVersionOutputBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) config: ::std::option::Option<::aws_smithy_types::Document>,
    pub(crate) config_hash: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec::<::std::string::String>>,
}
impl GetVersionOutputBuilder {
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.id = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn config(mut self, input: ::aws_smithy_types::Document) -> Self {
        self.config = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_config(mut self, input: ::std::option::Option<::aws_smithy_types::Document>) -> Self {
        self.config = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_config(&self) -> &::std::option::Option<::aws_smithy_types::Document> {
        &self.config
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn config_hash(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.config_hash = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_config_hash(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.config_hash = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_config_hash(&self) -> &::std::option::Option<::std::string::String> {
        &self.config_hash
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    pub fn tags(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.tags.unwrap_or_default();
                        v.push(input.into());
                        self.tags = ::std::option::Option::Some(v);
                        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec::<::std::string::String>>) -> Self {
        self.tags = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec::<::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`GetVersionOutput`](crate::operation::get_version::GetVersionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`id`](crate::operation::get_version::builders::GetVersionOutputBuilder::id)
    /// - [`config`](crate::operation::get_version::builders::GetVersionOutputBuilder::config)
    /// - [`config_hash`](crate::operation::get_version::builders::GetVersionOutputBuilder::config_hash)
    /// - [`created_at`](crate::operation::get_version::builders::GetVersionOutputBuilder::created_at)
    /// - [`description`](crate::operation::get_version::builders::GetVersionOutputBuilder::description)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_version::GetVersionOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(
            crate::operation::get_version::GetVersionOutput {
                id: self.id
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("id", "id was not specified but it is required when building GetVersionOutput")
                    )?
                ,
                config: self.config
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("config", "config was not specified but it is required when building GetVersionOutput")
                    )?
                ,
                config_hash: self.config_hash
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("config_hash", "config_hash was not specified but it is required when building GetVersionOutput")
                    )?
                ,
                created_at: self.created_at
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("created_at", "created_at was not specified but it is required when building GetVersionOutput")
                    )?
                ,
                description: self.description
                    .ok_or_else(||
                        ::aws_smithy_types::error::operation::BuildError::missing_field("description", "description was not specified but it is required when building GetVersionOutput")
                    )?
                ,
                tags: self.tags
                ,
            }
        )
    }
}