aws_sdk_iotsitewise/operation/batch_disassociate_project_assets/
_batch_disassociate_project_assets_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 BatchDisassociateProjectAssetsInput {
6    /// <p>The ID of the project from which to disassociate the assets.</p>
7    pub project_id: ::std::option::Option<::std::string::String>,
8    /// <p>The IDs of the assets to be disassociated from the project.</p>
9    pub asset_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10    /// <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>
11    pub client_token: ::std::option::Option<::std::string::String>,
12}
13impl BatchDisassociateProjectAssetsInput {
14    /// <p>The ID of the project from which to disassociate the assets.</p>
15    pub fn project_id(&self) -> ::std::option::Option<&str> {
16        self.project_id.as_deref()
17    }
18    /// <p>The IDs of the assets to be disassociated from the project.</p>
19    ///
20    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.asset_ids.is_none()`.
21    pub fn asset_ids(&self) -> &[::std::string::String] {
22        self.asset_ids.as_deref().unwrap_or_default()
23    }
24    /// <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>
25    pub fn client_token(&self) -> ::std::option::Option<&str> {
26        self.client_token.as_deref()
27    }
28}
29impl BatchDisassociateProjectAssetsInput {
30    /// Creates a new builder-style object to manufacture [`BatchDisassociateProjectAssetsInput`](crate::operation::batch_disassociate_project_assets::BatchDisassociateProjectAssetsInput).
31    pub fn builder() -> crate::operation::batch_disassociate_project_assets::builders::BatchDisassociateProjectAssetsInputBuilder {
32        crate::operation::batch_disassociate_project_assets::builders::BatchDisassociateProjectAssetsInputBuilder::default()
33    }
34}
35
36/// A builder for [`BatchDisassociateProjectAssetsInput`](crate::operation::batch_disassociate_project_assets::BatchDisassociateProjectAssetsInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct BatchDisassociateProjectAssetsInputBuilder {
40    pub(crate) project_id: ::std::option::Option<::std::string::String>,
41    pub(crate) asset_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
42    pub(crate) client_token: ::std::option::Option<::std::string::String>,
43}
44impl BatchDisassociateProjectAssetsInputBuilder {
45    /// <p>The ID of the project from which to disassociate the assets.</p>
46    /// This field is required.
47    pub fn project_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48        self.project_id = ::std::option::Option::Some(input.into());
49        self
50    }
51    /// <p>The ID of the project from which to disassociate the assets.</p>
52    pub fn set_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.project_id = input;
54        self
55    }
56    /// <p>The ID of the project from which to disassociate the assets.</p>
57    pub fn get_project_id(&self) -> &::std::option::Option<::std::string::String> {
58        &self.project_id
59    }
60    /// Appends an item to `asset_ids`.
61    ///
62    /// To override the contents of this collection use [`set_asset_ids`](Self::set_asset_ids).
63    ///
64    /// <p>The IDs of the assets to be disassociated from the project.</p>
65    pub fn asset_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        let mut v = self.asset_ids.unwrap_or_default();
67        v.push(input.into());
68        self.asset_ids = ::std::option::Option::Some(v);
69        self
70    }
71    /// <p>The IDs of the assets to be disassociated from the project.</p>
72    pub fn set_asset_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
73        self.asset_ids = input;
74        self
75    }
76    /// <p>The IDs of the assets to be disassociated from the project.</p>
77    pub fn get_asset_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
78        &self.asset_ids
79    }
80    /// <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>
81    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.client_token = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <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>
86    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.client_token = input;
88        self
89    }
90    /// <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>
91    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
92        &self.client_token
93    }
94    /// Consumes the builder and constructs a [`BatchDisassociateProjectAssetsInput`](crate::operation::batch_disassociate_project_assets::BatchDisassociateProjectAssetsInput).
95    pub fn build(
96        self,
97    ) -> ::std::result::Result<
98        crate::operation::batch_disassociate_project_assets::BatchDisassociateProjectAssetsInput,
99        ::aws_smithy_types::error::operation::BuildError,
100    > {
101        ::std::result::Result::Ok(crate::operation::batch_disassociate_project_assets::BatchDisassociateProjectAssetsInput {
102            project_id: self.project_id,
103            asset_ids: self.asset_ids,
104            client_token: self.client_token,
105        })
106    }
107}