aws_sdk_computeoptimizerautomation/operation/associate_accounts/
_associate_accounts_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 AssociateAccountsInput {
6    /// <p>The IDs of the member accounts to associate. You can specify up to 50 account IDs.</p>
7    pub account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>A unique identifier to ensure idempotency of the request. Valid for 24 hours after creation.</p>
9    pub client_token: ::std::option::Option<::std::string::String>,
10}
11impl AssociateAccountsInput {
12    /// <p>The IDs of the member accounts to associate. You can specify up to 50 account IDs.</p>
13    ///
14    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.account_ids.is_none()`.
15    pub fn account_ids(&self) -> &[::std::string::String] {
16        self.account_ids.as_deref().unwrap_or_default()
17    }
18    /// <p>A unique identifier to ensure idempotency of the request. Valid for 24 hours after creation.</p>
19    pub fn client_token(&self) -> ::std::option::Option<&str> {
20        self.client_token.as_deref()
21    }
22}
23impl AssociateAccountsInput {
24    /// Creates a new builder-style object to manufacture [`AssociateAccountsInput`](crate::operation::associate_accounts::AssociateAccountsInput).
25    pub fn builder() -> crate::operation::associate_accounts::builders::AssociateAccountsInputBuilder {
26        crate::operation::associate_accounts::builders::AssociateAccountsInputBuilder::default()
27    }
28}
29
30/// A builder for [`AssociateAccountsInput`](crate::operation::associate_accounts::AssociateAccountsInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct AssociateAccountsInputBuilder {
34    pub(crate) account_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
35    pub(crate) client_token: ::std::option::Option<::std::string::String>,
36}
37impl AssociateAccountsInputBuilder {
38    /// Appends an item to `account_ids`.
39    ///
40    /// To override the contents of this collection use [`set_account_ids`](Self::set_account_ids).
41    ///
42    /// <p>The IDs of the member accounts to associate. You can specify up to 50 account IDs.</p>
43    pub fn account_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
44        let mut v = self.account_ids.unwrap_or_default();
45        v.push(input.into());
46        self.account_ids = ::std::option::Option::Some(v);
47        self
48    }
49    /// <p>The IDs of the member accounts to associate. You can specify up to 50 account IDs.</p>
50    pub fn set_account_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
51        self.account_ids = input;
52        self
53    }
54    /// <p>The IDs of the member accounts to associate. You can specify up to 50 account IDs.</p>
55    pub fn get_account_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
56        &self.account_ids
57    }
58    /// <p>A unique identifier to ensure idempotency of the request. Valid for 24 hours after creation.</p>
59    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.client_token = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>A unique identifier to ensure idempotency of the request. Valid for 24 hours after creation.</p>
64    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.client_token = input;
66        self
67    }
68    /// <p>A unique identifier to ensure idempotency of the request. Valid for 24 hours after creation.</p>
69    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
70        &self.client_token
71    }
72    /// Consumes the builder and constructs a [`AssociateAccountsInput`](crate::operation::associate_accounts::AssociateAccountsInput).
73    pub fn build(
74        self,
75    ) -> ::std::result::Result<crate::operation::associate_accounts::AssociateAccountsInput, ::aws_smithy_types::error::operation::BuildError> {
76        ::std::result::Result::Ok(crate::operation::associate_accounts::AssociateAccountsInput {
77            account_ids: self.account_ids,
78            client_token: self.client_token,
79        })
80    }
81}