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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutAssetInput {
    /// <p>The identifier of the asset type for the asset.</p>
    pub asset_type_id: ::std::option::Option<::std::string::String>,
    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
    pub identifier: ::std::option::Option<::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 forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
    pub forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl PutAssetInput {
    /// <p>The identifier of the asset type for the asset.</p>
    pub fn asset_type_id(&self) -> ::std::option::Option<&str> {
        self.asset_type_id.as_deref()
    }
    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
    pub fn identifier(&self) -> ::std::option::Option<&str> {
        self.identifier.as_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 forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
    pub fn forms(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
        self.forms.as_ref()
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl PutAssetInput {
    /// Creates a new builder-style object to manufacture [`PutAssetInput`](crate::operation::put_asset::PutAssetInput).
    pub fn builder() -> crate::operation::put_asset::builders::PutAssetInputBuilder {
        crate::operation::put_asset::builders::PutAssetInputBuilder::default()
    }
}

/// A builder for [`PutAssetInput`](crate::operation::put_asset::PutAssetInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutAssetInputBuilder {
    pub(crate) asset_type_id: ::std::option::Option<::std::string::String>,
    pub(crate) identifier: ::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) forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl PutAssetInputBuilder {
    /// <p>The identifier of the asset type for the 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 the 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 the asset.</p>
    pub fn get_asset_type_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.asset_type_id
    }
    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
    /// This field is required.
    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.identifier = input;
        self
    }
    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.identifier
    }
    /// <p>The name of the asset.</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 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
    }
    /// Adds a key-value pair to `forms`.
    ///
    /// To override the contents of this collection use [`set_forms`](Self::set_forms).
    ///
    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</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 to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</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 to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
    pub fn get_forms(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormEntry>> {
        &self.forms
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`PutAssetInput`](crate::operation::put_asset::PutAssetInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::put_asset::PutAssetInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_asset::PutAssetInput {
            asset_type_id: self.asset_type_id,
            identifier: self.identifier,
            name: self.name,
            description: self.description,
            forms: self.forms,
            client_token: self.client_token,
        })
    }
}