Skip to main content

aws_sdk_glue/operation/update_asset/
_update_asset_output.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 UpdateAssetOutput {
6    /// <p>The unique identifier of the asset.</p>
7    pub id: ::std::string::String,
8    /// <p>The name of the asset.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The description of the asset.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The timestamp at which the asset was last updated.</p>
13    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
14    _request_id: Option<String>,
15}
16impl UpdateAssetOutput {
17    /// <p>The unique identifier of the asset.</p>
18    pub fn id(&self) -> &str {
19        use std::ops::Deref;
20        self.id.deref()
21    }
22    /// <p>The name of the asset.</p>
23    pub fn name(&self) -> ::std::option::Option<&str> {
24        self.name.as_deref()
25    }
26    /// <p>The description of the asset.</p>
27    pub fn description(&self) -> ::std::option::Option<&str> {
28        self.description.as_deref()
29    }
30    /// <p>The timestamp at which the asset was last updated.</p>
31    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
32        self.updated_at.as_ref()
33    }
34}
35impl ::aws_types::request_id::RequestId for UpdateAssetOutput {
36    fn request_id(&self) -> Option<&str> {
37        self._request_id.as_deref()
38    }
39}
40impl UpdateAssetOutput {
41    /// Creates a new builder-style object to manufacture [`UpdateAssetOutput`](crate::operation::update_asset::UpdateAssetOutput).
42    pub fn builder() -> crate::operation::update_asset::builders::UpdateAssetOutputBuilder {
43        crate::operation::update_asset::builders::UpdateAssetOutputBuilder::default()
44    }
45}
46
47/// A builder for [`UpdateAssetOutput`](crate::operation::update_asset::UpdateAssetOutput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct UpdateAssetOutputBuilder {
51    pub(crate) id: ::std::option::Option<::std::string::String>,
52    pub(crate) name: ::std::option::Option<::std::string::String>,
53    pub(crate) description: ::std::option::Option<::std::string::String>,
54    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
55    _request_id: Option<String>,
56}
57impl UpdateAssetOutputBuilder {
58    /// <p>The unique identifier of the asset.</p>
59    /// This field is required.
60    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
61        self.id = ::std::option::Option::Some(input.into());
62        self
63    }
64    /// <p>The unique identifier of the asset.</p>
65    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
66        self.id = input;
67        self
68    }
69    /// <p>The unique identifier of the asset.</p>
70    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
71        &self.id
72    }
73    /// <p>The name of the asset.</p>
74    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The name of the asset.</p>
79    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.name = input;
81        self
82    }
83    /// <p>The name of the asset.</p>
84    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.name
86    }
87    /// <p>The description of the asset.</p>
88    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.description = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The description of the asset.</p>
93    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.description = input;
95        self
96    }
97    /// <p>The description of the asset.</p>
98    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
99        &self.description
100    }
101    /// <p>The timestamp at which the asset was last updated.</p>
102    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
103        self.updated_at = ::std::option::Option::Some(input);
104        self
105    }
106    /// <p>The timestamp at which the asset was last updated.</p>
107    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
108        self.updated_at = input;
109        self
110    }
111    /// <p>The timestamp at which the asset was last updated.</p>
112    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
113        &self.updated_at
114    }
115    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
116        self._request_id = Some(request_id.into());
117        self
118    }
119
120    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
121        self._request_id = request_id;
122        self
123    }
124    /// Consumes the builder and constructs a [`UpdateAssetOutput`](crate::operation::update_asset::UpdateAssetOutput).
125    /// This method will fail if any of the following fields are not set:
126    /// - [`id`](crate::operation::update_asset::builders::UpdateAssetOutputBuilder::id)
127    pub fn build(self) -> ::std::result::Result<crate::operation::update_asset::UpdateAssetOutput, ::aws_smithy_types::error::operation::BuildError> {
128        ::std::result::Result::Ok(crate::operation::update_asset::UpdateAssetOutput {
129            id: self.id.ok_or_else(|| {
130                ::aws_smithy_types::error::operation::BuildError::missing_field(
131                    "id",
132                    "id was not specified but it is required when building UpdateAssetOutput",
133                )
134            })?,
135            name: self.name,
136            description: self.description,
137            updated_at: self.updated_at,
138            _request_id: self._request_id,
139        })
140    }
141}