superposition_sdk 0.104.0

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 ValidateContextInput  {
    #[allow(missing_docs)] // documentation missing in model
    pub workspace_id: ::std::option::Option<::std::string::String>,
    #[allow(missing_docs)] // documentation missing in model
    pub org_id: ::std::option::Option<::std::string::String>,
    /// Represents conditional criteria used for context matching. Keys define dimension names and values specify the criteria that must be met.
    pub context: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>,
}
impl  ValidateContextInput  {
    #[allow(missing_docs)] // documentation missing in model
    pub fn workspace_id(&self) -> ::std::option::Option<&str> {
        self.workspace_id.as_deref()
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn org_id(&self) -> ::std::option::Option<&str> {
        self.org_id.as_deref()
    }
    /// Represents conditional criteria used for context matching. Keys define dimension names and values specify the criteria that must be met.
    pub fn context(&self) -> ::std::option::Option<&::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> {
        self.context.as_ref()
    }
}
impl ValidateContextInput {
    /// Creates a new builder-style object to manufacture [`ValidateContextInput`](crate::operation::validate_context::ValidateContextInput).
    pub fn builder() -> crate::operation::validate_context::builders::ValidateContextInputBuilder {
        crate::operation::validate_context::builders::ValidateContextInputBuilder::default()
    }
}

/// A builder for [`ValidateContextInput`](crate::operation::validate_context::ValidateContextInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ValidateContextInputBuilder {
    pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
    pub(crate) org_id: ::std::option::Option<::std::string::String>,
    pub(crate) context: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>,
}
impl ValidateContextInputBuilder {
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.workspace_id = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.workspace_id = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.workspace_id
    }
    #[allow(missing_docs)] // documentation missing in model
    /// This field is required.
    pub fn org_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.org_id = ::std::option::Option::Some(input.into());
        self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn set_org_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.org_id = input; self
    }
    #[allow(missing_docs)] // documentation missing in model
    pub fn get_org_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.org_id
    }
    /// Adds a key-value pair to `context`.
    ///
    /// To override the contents of this collection use [`set_context`](Self::set_context).
    ///
    /// Represents conditional criteria used for context matching. Keys define dimension names and values specify the criteria that must be met.
    pub fn context(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::aws_smithy_types::Document) -> Self {
        let mut hash_map = self.context.unwrap_or_default();
                        hash_map.insert(k.into(), v);
                        self.context = ::std::option::Option::Some(hash_map);
                        self
    }
    /// Represents conditional criteria used for context matching. Keys define dimension names and values specify the criteria that must be met.
    pub fn set_context(mut self, input: ::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>>) -> Self {
        self.context = input; self
    }
    /// Represents conditional criteria used for context matching. Keys define dimension names and values specify the criteria that must be met.
    pub fn get_context(&self) -> &::std::option::Option<::std::collections::HashMap::<::std::string::String, ::aws_smithy_types::Document>> {
        &self.context
    }
    /// Consumes the builder and constructs a [`ValidateContextInput`](crate::operation::validate_context::ValidateContextInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::validate_context::ValidateContextInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(
            crate::operation::validate_context::ValidateContextInput {
                workspace_id: self.workspace_id
                ,
                org_id: self.org_id
                ,
                context: self.context
                ,
            }
        )
    }
}