aws_sdk_iotsitewise/operation/update_asset/
_update_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 UpdateAssetInput {
6    /// <p>The ID of the asset to update. This can be either the actual ID in UUID format, or else <code>externalId:</code> followed by the external ID, if it has one. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references">Referencing objects with external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
7    pub asset_id: ::std::option::Option<::std::string::String>,
8    /// <p>An external ID to assign to the asset. The asset must not already have an external ID. The external ID must be unique within your Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids">Using external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
9    pub asset_external_id: ::std::option::Option<::std::string::String>,
10    /// <p>A friendly name for the asset.</p>
11    pub asset_name: ::std::option::Option<::std::string::String>,
12    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
13    pub client_token: ::std::option::Option<::std::string::String>,
14    /// <p>A description for the asset.</p>
15    pub asset_description: ::std::option::Option<::std::string::String>,
16}
17impl UpdateAssetInput {
18    /// <p>The ID of the asset to update. This can be either the actual ID in UUID format, or else <code>externalId:</code> followed by the external ID, if it has one. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references">Referencing objects with external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
19    pub fn asset_id(&self) -> ::std::option::Option<&str> {
20        self.asset_id.as_deref()
21    }
22    /// <p>An external ID to assign to the asset. The asset must not already have an external ID. The external ID must be unique within your Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids">Using external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
23    pub fn asset_external_id(&self) -> ::std::option::Option<&str> {
24        self.asset_external_id.as_deref()
25    }
26    /// <p>A friendly name for the asset.</p>
27    pub fn asset_name(&self) -> ::std::option::Option<&str> {
28        self.asset_name.as_deref()
29    }
30    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
31    pub fn client_token(&self) -> ::std::option::Option<&str> {
32        self.client_token.as_deref()
33    }
34    /// <p>A description for the asset.</p>
35    pub fn asset_description(&self) -> ::std::option::Option<&str> {
36        self.asset_description.as_deref()
37    }
38}
39impl UpdateAssetInput {
40    /// Creates a new builder-style object to manufacture [`UpdateAssetInput`](crate::operation::update_asset::UpdateAssetInput).
41    pub fn builder() -> crate::operation::update_asset::builders::UpdateAssetInputBuilder {
42        crate::operation::update_asset::builders::UpdateAssetInputBuilder::default()
43    }
44}
45
46/// A builder for [`UpdateAssetInput`](crate::operation::update_asset::UpdateAssetInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct UpdateAssetInputBuilder {
50    pub(crate) asset_id: ::std::option::Option<::std::string::String>,
51    pub(crate) asset_external_id: ::std::option::Option<::std::string::String>,
52    pub(crate) asset_name: ::std::option::Option<::std::string::String>,
53    pub(crate) client_token: ::std::option::Option<::std::string::String>,
54    pub(crate) asset_description: ::std::option::Option<::std::string::String>,
55}
56impl UpdateAssetInputBuilder {
57    /// <p>The ID of the asset to update. This can be either the actual ID in UUID format, or else <code>externalId:</code> followed by the external ID, if it has one. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references">Referencing objects with external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
58    /// This field is required.
59    pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.asset_id = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The ID of the asset to update. This can be either the actual ID in UUID format, or else <code>externalId:</code> followed by the external ID, if it has one. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references">Referencing objects with external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
64    pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.asset_id = input;
66        self
67    }
68    /// <p>The ID of the asset to update. This can be either the actual ID in UUID format, or else <code>externalId:</code> followed by the external ID, if it has one. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references">Referencing objects with external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
69    pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
70        &self.asset_id
71    }
72    /// <p>An external ID to assign to the asset. The asset must not already have an external ID. The external ID must be unique within your Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids">Using external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
73    pub fn asset_external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.asset_external_id = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>An external ID to assign to the asset. The asset must not already have an external ID. The external ID must be unique within your Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids">Using external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
78    pub fn set_asset_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.asset_external_id = input;
80        self
81    }
82    /// <p>An external ID to assign to the asset. The asset must not already have an external ID. The external ID must be unique within your Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids">Using external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
83    pub fn get_asset_external_id(&self) -> &::std::option::Option<::std::string::String> {
84        &self.asset_external_id
85    }
86    /// <p>A friendly name for the asset.</p>
87    /// This field is required.
88    pub fn asset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.asset_name = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>A friendly name for the asset.</p>
93    pub fn set_asset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.asset_name = input;
95        self
96    }
97    /// <p>A friendly name for the asset.</p>
98    pub fn get_asset_name(&self) -> &::std::option::Option<::std::string::String> {
99        &self.asset_name
100    }
101    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
102    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.client_token = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
107    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.client_token = input;
109        self
110    }
111    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
112    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
113        &self.client_token
114    }
115    /// <p>A description for the asset.</p>
116    pub fn asset_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.asset_description = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>A description for the asset.</p>
121    pub fn set_asset_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.asset_description = input;
123        self
124    }
125    /// <p>A description for the asset.</p>
126    pub fn get_asset_description(&self) -> &::std::option::Option<::std::string::String> {
127        &self.asset_description
128    }
129    /// Consumes the builder and constructs a [`UpdateAssetInput`](crate::operation::update_asset::UpdateAssetInput).
130    pub fn build(self) -> ::std::result::Result<crate::operation::update_asset::UpdateAssetInput, ::aws_smithy_types::error::operation::BuildError> {
131        ::std::result::Result::Ok(crate::operation::update_asset::UpdateAssetInput {
132            asset_id: self.asset_id,
133            asset_external_id: self.asset_external_id,
134            asset_name: self.asset_name,
135            client_token: self.client_token,
136            asset_description: self.asset_description,
137        })
138    }
139}