aws-sdk-elementalinference 1.5.0

AWS SDK for AWS Elemental Inference
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::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateDictionaryOutput {
    /// <p>The name that you specified in the request.</p>
    pub name: ::std::string::String,
    /// <p>The ARN of the dictionary.</p>
    pub arn: ::std::string::String,
    /// <p>A unique ID that Elemental Inference assigns to the dictionary.</p>
    pub id: ::std::string::String,
    /// <p>The language of the dictionary.</p>
    pub language: crate::types::DictionaryLanguage,
    /// <p>The current status of the dictionary. After creation succeeds, the status will be AVAILABLE.</p>
    pub status: crate::types::DictionaryStatus,
    /// <p>A list of feed IDs that reference this dictionary.</p>
    pub references: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Any tags that you included when you created the dictionary.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl CreateDictionaryOutput {
    /// <p>The name that you specified in the request.</p>
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// <p>The ARN of the dictionary.</p>
    pub fn arn(&self) -> &str {
        use std::ops::Deref;
        self.arn.deref()
    }
    /// <p>A unique ID that Elemental Inference assigns to the dictionary.</p>
    pub fn id(&self) -> &str {
        use std::ops::Deref;
        self.id.deref()
    }
    /// <p>The language of the dictionary.</p>
    pub fn language(&self) -> &crate::types::DictionaryLanguage {
        &self.language
    }
    /// <p>The current status of the dictionary. After creation succeeds, the status will be AVAILABLE.</p>
    pub fn status(&self) -> &crate::types::DictionaryStatus {
        &self.status
    }
    /// <p>A list of feed IDs that reference this dictionary.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.references.is_none()`.
    pub fn references(&self) -> &[::std::string::String] {
        self.references.as_deref().unwrap_or_default()
    }
    /// <p>Any tags that you included when you created the dictionary.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for CreateDictionaryOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateDictionaryOutput {
    /// Creates a new builder-style object to manufacture [`CreateDictionaryOutput`](crate::operation::create_dictionary::CreateDictionaryOutput).
    pub fn builder() -> crate::operation::create_dictionary::builders::CreateDictionaryOutputBuilder {
        crate::operation::create_dictionary::builders::CreateDictionaryOutputBuilder::default()
    }
}

/// A builder for [`CreateDictionaryOutput`](crate::operation::create_dictionary::CreateDictionaryOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateDictionaryOutputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) arn: ::std::option::Option<::std::string::String>,
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) language: ::std::option::Option<crate::types::DictionaryLanguage>,
    pub(crate) status: ::std::option::Option<crate::types::DictionaryStatus>,
    pub(crate) references: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl CreateDictionaryOutputBuilder {
    /// <p>The name that you specified in the request.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name that you specified in the request.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name that you specified in the request.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The ARN of the dictionary.</p>
    /// This field is required.
    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of the dictionary.</p>
    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.arn = input;
        self
    }
    /// <p>The ARN of the dictionary.</p>
    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.arn
    }
    /// <p>A unique ID that Elemental Inference assigns to the dictionary.</p>
    /// 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
    }
    /// <p>A unique ID that Elemental Inference assigns to the dictionary.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>A unique ID that Elemental Inference assigns to the dictionary.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The language of the dictionary.</p>
    /// This field is required.
    pub fn language(mut self, input: crate::types::DictionaryLanguage) -> Self {
        self.language = ::std::option::Option::Some(input);
        self
    }
    /// <p>The language of the dictionary.</p>
    pub fn set_language(mut self, input: ::std::option::Option<crate::types::DictionaryLanguage>) -> Self {
        self.language = input;
        self
    }
    /// <p>The language of the dictionary.</p>
    pub fn get_language(&self) -> &::std::option::Option<crate::types::DictionaryLanguage> {
        &self.language
    }
    /// <p>The current status of the dictionary. After creation succeeds, the status will be AVAILABLE.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::DictionaryStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The current status of the dictionary. After creation succeeds, the status will be AVAILABLE.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::DictionaryStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The current status of the dictionary. After creation succeeds, the status will be AVAILABLE.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::DictionaryStatus> {
        &self.status
    }
    /// Appends an item to `references`.
    ///
    /// To override the contents of this collection use [`set_references`](Self::set_references).
    ///
    /// <p>A list of feed IDs that reference this dictionary.</p>
    pub fn references(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.references.unwrap_or_default();
        v.push(input.into());
        self.references = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of feed IDs that reference this dictionary.</p>
    pub fn set_references(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.references = input;
        self
    }
    /// <p>A list of feed IDs that reference this dictionary.</p>
    pub fn get_references(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.references
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Any tags that you included when you created the dictionary.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Any tags that you included when you created the dictionary.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Any tags that you included when you created the dictionary.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`CreateDictionaryOutput`](crate::operation::create_dictionary::CreateDictionaryOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::operation::create_dictionary::builders::CreateDictionaryOutputBuilder::name)
    /// - [`arn`](crate::operation::create_dictionary::builders::CreateDictionaryOutputBuilder::arn)
    /// - [`id`](crate::operation::create_dictionary::builders::CreateDictionaryOutputBuilder::id)
    /// - [`language`](crate::operation::create_dictionary::builders::CreateDictionaryOutputBuilder::language)
    /// - [`status`](crate::operation::create_dictionary::builders::CreateDictionaryOutputBuilder::status)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_dictionary::CreateDictionaryOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_dictionary::CreateDictionaryOutput {
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building CreateDictionaryOutput",
                )
            })?,
            arn: self.arn.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "arn",
                    "arn was not specified but it is required when building CreateDictionaryOutput",
                )
            })?,
            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 CreateDictionaryOutput",
                )
            })?,
            language: self.language.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "language",
                    "language was not specified but it is required when building CreateDictionaryOutput",
                )
            })?,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building CreateDictionaryOutput",
                )
            })?,
            references: self.references,
            tags: self.tags,
            _request_id: self._request_id,
        })
    }
}