Skip to main content

aws_sdk_glue/operation/put_asset/
_put_asset_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct PutAssetInput {
6    /// <p>The identifier of the asset type for the asset. This field is required.</p>
7    pub asset_type_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
9    pub identifier: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the asset.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the asset.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
15    pub forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormInput>>,
16    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
17    pub client_token: ::std::option::Option<::std::string::String>,
18}
19impl PutAssetInput {
20    /// <p>The identifier of the asset type for the asset. This field is required.</p>
21    pub fn asset_type_identifier(&self) -> ::std::option::Option<&str> {
22        self.asset_type_identifier.as_deref()
23    }
24    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
25    pub fn identifier(&self) -> ::std::option::Option<&str> {
26        self.identifier.as_deref()
27    }
28    /// <p>The name of the asset.</p>
29    pub fn name(&self) -> ::std::option::Option<&str> {
30        self.name.as_deref()
31    }
32    /// <p>The description of the asset.</p>
33    pub fn description(&self) -> ::std::option::Option<&str> {
34        self.description.as_deref()
35    }
36    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
37    pub fn forms(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AssetFormInput>> {
38        self.forms.as_ref()
39    }
40    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
41    pub fn client_token(&self) -> ::std::option::Option<&str> {
42        self.client_token.as_deref()
43    }
44}
45impl PutAssetInput {
46    /// Creates a new builder-style object to manufacture [`PutAssetInput`](crate::operation::put_asset::PutAssetInput).
47    pub fn builder() -> crate::operation::put_asset::builders::PutAssetInputBuilder {
48        crate::operation::put_asset::builders::PutAssetInputBuilder::default()
49    }
50}
51
52/// A builder for [`PutAssetInput`](crate::operation::put_asset::PutAssetInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct PutAssetInputBuilder {
56    pub(crate) asset_type_identifier: ::std::option::Option<::std::string::String>,
57    pub(crate) identifier: ::std::option::Option<::std::string::String>,
58    pub(crate) name: ::std::option::Option<::std::string::String>,
59    pub(crate) description: ::std::option::Option<::std::string::String>,
60    pub(crate) forms: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormInput>>,
61    pub(crate) client_token: ::std::option::Option<::std::string::String>,
62}
63impl PutAssetInputBuilder {
64    /// <p>The identifier of the asset type for the asset. This field is required.</p>
65    pub fn asset_type_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.asset_type_identifier = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The identifier of the asset type for the asset. This field is required.</p>
70    pub fn set_asset_type_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.asset_type_identifier = input;
72        self
73    }
74    /// <p>The identifier of the asset type for the asset. This field is required.</p>
75    pub fn get_asset_type_identifier(&self) -> &::std::option::Option<::std::string::String> {
76        &self.asset_type_identifier
77    }
78    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
79    /// This field is required.
80    pub fn identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.identifier = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
85    pub fn set_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.identifier = input;
87        self
88    }
89    /// <p>The unique identifier of the asset. If an asset with this identifier already exists, it is updated.</p>
90    pub fn get_identifier(&self) -> &::std::option::Option<::std::string::String> {
91        &self.identifier
92    }
93    /// <p>The name of the asset.</p>
94    /// This field is required.
95    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.name = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The name of the asset.</p>
100    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.name = input;
102        self
103    }
104    /// <p>The name of the asset.</p>
105    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
106        &self.name
107    }
108    /// <p>The description of the asset.</p>
109    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.description = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The description of the asset.</p>
114    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.description = input;
116        self
117    }
118    /// <p>The description of the asset.</p>
119    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
120        &self.description
121    }
122    /// Adds a key-value pair to `forms`.
123    ///
124    /// To override the contents of this collection use [`set_forms`](Self::set_forms).
125    ///
126    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
127    pub fn forms(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AssetFormInput) -> Self {
128        let mut hash_map = self.forms.unwrap_or_default();
129        hash_map.insert(k.into(), v);
130        self.forms = ::std::option::Option::Some(hash_map);
131        self
132    }
133    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
134    pub fn set_forms(
135        mut self,
136        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormInput>>,
137    ) -> Self {
138        self.forms = input;
139        self
140    }
141    /// <p>The forms to set on the asset, keyed by form name. Each entry specifies the form type and its JSON content.</p>
142    pub fn get_forms(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AssetFormInput>> {
143        &self.forms
144    }
145    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
146    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.client_token = ::std::option::Option::Some(input.into());
148        self
149    }
150    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
151    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.client_token = input;
153        self
154    }
155    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
156    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
157        &self.client_token
158    }
159    /// Consumes the builder and constructs a [`PutAssetInput`](crate::operation::put_asset::PutAssetInput).
160    pub fn build(self) -> ::std::result::Result<crate::operation::put_asset::PutAssetInput, ::aws_smithy_types::error::operation::BuildError> {
161        ::std::result::Result::Ok(crate::operation::put_asset::PutAssetInput {
162            asset_type_identifier: self.asset_type_identifier,
163            identifier: self.identifier,
164            name: self.name,
165            description: self.description,
166            forms: self.forms,
167            client_token: self.client_token,
168        })
169    }
170}