aws_sdk_ssoadmin/operation/create_instance/
_create_instance_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 CreateInstanceInput {
6    /// <p>The name of the instance of IAM Identity Center.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p>
9    /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
10    /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
11    pub client_token: ::std::option::Option<::std::string::String>,
12    /// <p>Specifies tags to be attached to the instance of IAM Identity Center.</p>
13    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
14}
15impl CreateInstanceInput {
16    /// <p>The name of the instance of IAM Identity Center.</p>
17    pub fn name(&self) -> ::std::option::Option<&str> {
18        self.name.as_deref()
19    }
20    /// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p>
21    /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
22    /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
23    pub fn client_token(&self) -> ::std::option::Option<&str> {
24        self.client_token.as_deref()
25    }
26    /// <p>Specifies tags to be attached to the instance of IAM Identity Center.</p>
27    ///
28    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
29    pub fn tags(&self) -> &[crate::types::Tag] {
30        self.tags.as_deref().unwrap_or_default()
31    }
32}
33impl CreateInstanceInput {
34    /// Creates a new builder-style object to manufacture [`CreateInstanceInput`](crate::operation::create_instance::CreateInstanceInput).
35    pub fn builder() -> crate::operation::create_instance::builders::CreateInstanceInputBuilder {
36        crate::operation::create_instance::builders::CreateInstanceInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreateInstanceInput`](crate::operation::create_instance::CreateInstanceInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreateInstanceInputBuilder {
44    pub(crate) name: ::std::option::Option<::std::string::String>,
45    pub(crate) client_token: ::std::option::Option<::std::string::String>,
46    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
47}
48impl CreateInstanceInputBuilder {
49    /// <p>The name of the instance of IAM Identity Center.</p>
50    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
51        self.name = ::std::option::Option::Some(input.into());
52        self
53    }
54    /// <p>The name of the instance of IAM Identity Center.</p>
55    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
56        self.name = input;
57        self
58    }
59    /// <p>The name of the instance of IAM Identity Center.</p>
60    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
61        &self.name
62    }
63    /// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p>
64    /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
65    /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
66    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.client_token = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p>
71    /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
72    /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
73    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.client_token = input;
75        self
76    }
77    /// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value</a>.</p>
78    /// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
79    /// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>IdempotentParameterMismatch</code> error.</p>
80    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
81        &self.client_token
82    }
83    /// Appends an item to `tags`.
84    ///
85    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
86    ///
87    /// <p>Specifies tags to be attached to the instance of IAM Identity Center.</p>
88    pub fn tags(mut self, input: crate::types::Tag) -> Self {
89        let mut v = self.tags.unwrap_or_default();
90        v.push(input);
91        self.tags = ::std::option::Option::Some(v);
92        self
93    }
94    /// <p>Specifies tags to be attached to the instance of IAM Identity Center.</p>
95    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
96        self.tags = input;
97        self
98    }
99    /// <p>Specifies tags to be attached to the instance of IAM Identity Center.</p>
100    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
101        &self.tags
102    }
103    /// Consumes the builder and constructs a [`CreateInstanceInput`](crate::operation::create_instance::CreateInstanceInput).
104    pub fn build(
105        self,
106    ) -> ::std::result::Result<crate::operation::create_instance::CreateInstanceInput, ::aws_smithy_types::error::operation::BuildError> {
107        ::std::result::Result::Ok(crate::operation::create_instance::CreateInstanceInput {
108            name: self.name,
109            client_token: self.client_token,
110            tags: self.tags,
111        })
112    }
113}