aws-sdk-glue 1.163.0

AWS SDK for AWS Glue
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The asset metadata returned by the <code>GetAsset</code> operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GetAssetOutput {
    /// <p>The unique identifier of the asset.</p>
    pub id: ::std::string::String,
    /// <p>The name of the asset.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>The description of the asset.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The timestamp at which the asset was created.</p>
    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The timestamp at which the asset was last updated.</p>
    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The identifier of the asset type for this asset.</p>
    pub asset_type_id: ::std::string::String,
    /// <p>The identifiers of the glossary terms associated with the asset.</p>
    pub glossary_terms: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The forms on the asset, keyed by form name.</p>
    pub forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
    /// <p>Additional attachments on the asset for more context, keyed by attachment name.</p>
    pub attachments: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
    /// <p>The iterable forms available on the asset, keyed by form name (for example, <code>columns</code>). Use the form name with <code>ListIterableForms</code> or <code>BatchGetIterableForms</code> to retrieve the form's items.</p>
    pub iterable_forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>>,
    _request_id: Option<String>,
}
impl GetAssetOutput {
    /// <p>The unique identifier of the asset.</p>
    pub fn id(&self) -> &str {
        use std::ops::Deref;
        self.id.deref()
    }
    /// <p>The name of the asset.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>The description of the asset.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The timestamp at which the asset was created.</p>
    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.created_at.as_ref()
    }
    /// <p>The timestamp at which the asset was last updated.</p>
    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.updated_at.as_ref()
    }
    /// <p>The identifier of the asset type for this asset.</p>
    pub fn asset_type_id(&self) -> &str {
        use std::ops::Deref;
        self.asset_type_id.deref()
    }
    /// <p>The identifiers of the glossary terms associated with the asset.</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 `.glossary_terms.is_none()`.
    pub fn glossary_terms(&self) -> &[::std::string::String] {
        self.glossary_terms.as_deref().unwrap_or_default()
    }
    /// <p>The forms on the asset, keyed by form name.</p>
    pub fn forms(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
        self.forms.as_ref()
    }
    /// <p>Additional attachments on the asset for more context, keyed by attachment name.</p>
    pub fn attachments(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
        self.attachments.as_ref()
    }
    /// <p>The iterable forms available on the asset, keyed by form name (for example, <code>columns</code>). Use the form name with <code>ListIterableForms</code> or <code>BatchGetIterableForms</code> to retrieve the form's items.</p>
    pub fn iterable_forms(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>> {
        self.iterable_forms.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for GetAssetOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetAssetOutput {
    /// Creates a new builder-style object to manufacture [`GetAssetOutput`](crate::operation::get_asset::GetAssetOutput).
    pub fn builder() -> crate::operation::get_asset::builders::GetAssetOutputBuilder {
        crate::operation::get_asset::builders::GetAssetOutputBuilder::default()
    }
}

/// A builder for [`GetAssetOutput`](crate::operation::get_asset::GetAssetOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GetAssetOutputBuilder {
    pub(crate) id: ::std::option::Option<::std::string::String>,
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) asset_type_id: ::std::option::Option<::std::string::String>,
    pub(crate) glossary_terms: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
    pub(crate) attachments: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
    pub(crate) iterable_forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>>,
    _request_id: Option<String>,
}
impl GetAssetOutputBuilder {
    /// <p>The unique identifier of the asset.</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>The unique identifier of the asset.</p>
    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.id = input;
        self
    }
    /// <p>The unique identifier of the asset.</p>
    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.id
    }
    /// <p>The name of the asset.</p>
    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 of the asset.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the asset.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>The description of the asset.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the asset.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>The description of the asset.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The timestamp at which the asset was created.</p>
    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.created_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp at which the asset was created.</p>
    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.created_at = input;
        self
    }
    /// <p>The timestamp at which the asset was created.</p>
    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.created_at
    }
    /// <p>The timestamp at which the asset was last updated.</p>
    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.updated_at = ::std::option::Option::Some(input);
        self
    }
    /// <p>The timestamp at which the asset was last updated.</p>
    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.updated_at = input;
        self
    }
    /// <p>The timestamp at which the asset was last updated.</p>
    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.updated_at
    }
    /// <p>The identifier of the asset type for this asset.</p>
    /// This field is required.
    pub fn asset_type_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.asset_type_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the asset type for this asset.</p>
    pub fn set_asset_type_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.asset_type_id = input;
        self
    }
    /// <p>The identifier of the asset type for this asset.</p>
    pub fn get_asset_type_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.asset_type_id
    }
    /// Appends an item to `glossary_terms`.
    ///
    /// To override the contents of this collection use [`set_glossary_terms`](Self::set_glossary_terms).
    ///
    /// <p>The identifiers of the glossary terms associated with the asset.</p>
    pub fn glossary_terms(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.glossary_terms.unwrap_or_default();
        v.push(input.into());
        self.glossary_terms = ::std::option::Option::Some(v);
        self
    }
    /// <p>The identifiers of the glossary terms associated with the asset.</p>
    pub fn set_glossary_terms(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.glossary_terms = input;
        self
    }
    /// <p>The identifiers of the glossary terms associated with the asset.</p>
    pub fn get_glossary_terms(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.glossary_terms
    }
    /// Adds a key-value pair to `forms`.
    ///
    /// To override the contents of this collection use [`set_forms`](Self::set_forms).
    ///
    /// <p>The forms on the asset, keyed by form name.</p>
    pub fn forms(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AssetFormEntry) -> Self {
        let mut hash_map = self.forms.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.forms = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The forms on the asset, keyed by form name.</p>
    pub fn set_forms(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
    ) -> Self {
        self.forms = input;
        self
    }
    /// <p>The forms on the asset, keyed by form name.</p>
    pub fn get_forms(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
        &self.forms
    }
    /// Adds a key-value pair to `attachments`.
    ///
    /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
    ///
    /// <p>Additional attachments on the asset for more context, keyed by attachment name.</p>
    pub fn attachments(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AssetFormEntry) -> Self {
        let mut hash_map = self.attachments.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.attachments = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>Additional attachments on the asset for more context, keyed by attachment name.</p>
    pub fn set_attachments(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
    ) -> Self {
        self.attachments = input;
        self
    }
    /// <p>Additional attachments on the asset for more context, keyed by attachment name.</p>
    pub fn get_attachments(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
        &self.attachments
    }
    /// Adds a key-value pair to `iterable_forms`.
    ///
    /// To override the contents of this collection use [`set_iterable_forms`](Self::set_iterable_forms).
    ///
    /// <p>The iterable forms available on the asset, keyed by form name (for example, <code>columns</code>). Use the form name with <code>ListIterableForms</code> or <code>BatchGetIterableForms</code> to retrieve the form's items.</p>
    pub fn iterable_forms(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::IterableFormEntry) -> Self {
        let mut hash_map = self.iterable_forms.unwrap_or_default();
        hash_map.insert(k.into(), v);
        self.iterable_forms = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The iterable forms available on the asset, keyed by form name (for example, <code>columns</code>). Use the form name with <code>ListIterableForms</code> or <code>BatchGetIterableForms</code> to retrieve the form's items.</p>
    pub fn set_iterable_forms(
        mut self,
        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>>,
    ) -> Self {
        self.iterable_forms = input;
        self
    }
    /// <p>The iterable forms available on the asset, keyed by form name (for example, <code>columns</code>). Use the form name with <code>ListIterableForms</code> or <code>BatchGetIterableForms</code> to retrieve the form's items.</p>
    pub fn get_iterable_forms(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::IterableFormEntry>> {
        &self.iterable_forms
    }
    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 [`GetAssetOutput`](crate::operation::get_asset::GetAssetOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`id`](crate::operation::get_asset::builders::GetAssetOutputBuilder::id)
    /// - [`asset_type_id`](crate::operation::get_asset::builders::GetAssetOutputBuilder::asset_type_id)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_asset::GetAssetOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_asset::GetAssetOutput {
            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 GetAssetOutput",
                )
            })?,
            name: self.name,
            description: self.description,
            created_at: self.created_at,
            updated_at: self.updated_at,
            asset_type_id: self.asset_type_id.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "asset_type_id",
                    "asset_type_id was not specified but it is required when building GetAssetOutput",
                )
            })?,
            glossary_terms: self.glossary_terms,
            forms: self.forms,
            attachments: self.attachments,
            iterable_forms: self.iterable_forms,
            _request_id: self._request_id,
        })
    }
}