Skip to main content

aws_sdk_evs/operation/create_entitlement/
_create_entitlement_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 CreateEntitlementInput {
6    /// <note>
7    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
8    /// </note>
9    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the entitlement creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
10    pub client_token: ::std::option::Option<::std::string::String>,
11    /// <p>A unique ID for the environment to create the entitlement in.</p>
12    pub environment_id: ::std::option::Option<::std::string::String>,
13    /// <p>A unique ID for the connector associated with the entitlement.</p>
14    pub connector_id: ::std::option::Option<::std::string::String>,
15    /// <p>The type of entitlement to create.</p>
16    pub entitlement_type: ::std::option::Option<crate::types::EntitlementType>,
17    /// <p>The list of VMware vSphere virtual machine managed object IDs to create entitlements for.</p>
18    pub vm_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
19}
20impl CreateEntitlementInput {
21    /// <note>
22    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
23    /// </note>
24    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the entitlement creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
25    pub fn client_token(&self) -> ::std::option::Option<&str> {
26        self.client_token.as_deref()
27    }
28    /// <p>A unique ID for the environment to create the entitlement in.</p>
29    pub fn environment_id(&self) -> ::std::option::Option<&str> {
30        self.environment_id.as_deref()
31    }
32    /// <p>A unique ID for the connector associated with the entitlement.</p>
33    pub fn connector_id(&self) -> ::std::option::Option<&str> {
34        self.connector_id.as_deref()
35    }
36    /// <p>The type of entitlement to create.</p>
37    pub fn entitlement_type(&self) -> ::std::option::Option<&crate::types::EntitlementType> {
38        self.entitlement_type.as_ref()
39    }
40    /// <p>The list of VMware vSphere virtual machine managed object IDs to create entitlements for.</p>
41    ///
42    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.vm_ids.is_none()`.
43    pub fn vm_ids(&self) -> &[::std::string::String] {
44        self.vm_ids.as_deref().unwrap_or_default()
45    }
46}
47impl CreateEntitlementInput {
48    /// Creates a new builder-style object to manufacture [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
49    pub fn builder() -> crate::operation::create_entitlement::builders::CreateEntitlementInputBuilder {
50        crate::operation::create_entitlement::builders::CreateEntitlementInputBuilder::default()
51    }
52}
53
54/// A builder for [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct CreateEntitlementInputBuilder {
58    pub(crate) client_token: ::std::option::Option<::std::string::String>,
59    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
60    pub(crate) connector_id: ::std::option::Option<::std::string::String>,
61    pub(crate) entitlement_type: ::std::option::Option<crate::types::EntitlementType>,
62    pub(crate) vm_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
63}
64impl CreateEntitlementInputBuilder {
65    /// <note>
66    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
67    /// </note>
68    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the entitlement creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
69    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.client_token = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <note>
74    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
75    /// </note>
76    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the entitlement creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
77    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78        self.client_token = input;
79        self
80    }
81    /// <note>
82    /// <p>This parameter is not used in Amazon EVS currently. If you supply input for this parameter, it will have no effect.</p>
83    /// </note>
84    /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the entitlement creation request. If you do not specify a client token, a randomly generated token is used for the request to ensure idempotency.</p>
85    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
86        &self.client_token
87    }
88    /// <p>A unique ID for the environment to create the entitlement in.</p>
89    /// This field is required.
90    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
91        self.environment_id = ::std::option::Option::Some(input.into());
92        self
93    }
94    /// <p>A unique ID for the environment to create the entitlement in.</p>
95    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
96        self.environment_id = input;
97        self
98    }
99    /// <p>A unique ID for the environment to create the entitlement in.</p>
100    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
101        &self.environment_id
102    }
103    /// <p>A unique ID for the connector associated with the entitlement.</p>
104    /// This field is required.
105    pub fn connector_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
106        self.connector_id = ::std::option::Option::Some(input.into());
107        self
108    }
109    /// <p>A unique ID for the connector associated with the entitlement.</p>
110    pub fn set_connector_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
111        self.connector_id = input;
112        self
113    }
114    /// <p>A unique ID for the connector associated with the entitlement.</p>
115    pub fn get_connector_id(&self) -> &::std::option::Option<::std::string::String> {
116        &self.connector_id
117    }
118    /// <p>The type of entitlement to create.</p>
119    /// This field is required.
120    pub fn entitlement_type(mut self, input: crate::types::EntitlementType) -> Self {
121        self.entitlement_type = ::std::option::Option::Some(input);
122        self
123    }
124    /// <p>The type of entitlement to create.</p>
125    pub fn set_entitlement_type(mut self, input: ::std::option::Option<crate::types::EntitlementType>) -> Self {
126        self.entitlement_type = input;
127        self
128    }
129    /// <p>The type of entitlement to create.</p>
130    pub fn get_entitlement_type(&self) -> &::std::option::Option<crate::types::EntitlementType> {
131        &self.entitlement_type
132    }
133    /// Appends an item to `vm_ids`.
134    ///
135    /// To override the contents of this collection use [`set_vm_ids`](Self::set_vm_ids).
136    ///
137    /// <p>The list of VMware vSphere virtual machine managed object IDs to create entitlements for.</p>
138    pub fn vm_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        let mut v = self.vm_ids.unwrap_or_default();
140        v.push(input.into());
141        self.vm_ids = ::std::option::Option::Some(v);
142        self
143    }
144    /// <p>The list of VMware vSphere virtual machine managed object IDs to create entitlements for.</p>
145    pub fn set_vm_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
146        self.vm_ids = input;
147        self
148    }
149    /// <p>The list of VMware vSphere virtual machine managed object IDs to create entitlements for.</p>
150    pub fn get_vm_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
151        &self.vm_ids
152    }
153    /// Consumes the builder and constructs a [`CreateEntitlementInput`](crate::operation::create_entitlement::CreateEntitlementInput).
154    pub fn build(
155        self,
156    ) -> ::std::result::Result<crate::operation::create_entitlement::CreateEntitlementInput, ::aws_smithy_types::error::operation::BuildError> {
157        ::std::result::Result::Ok(crate::operation::create_entitlement::CreateEntitlementInput {
158            client_token: self.client_token,
159            environment_id: self.environment_id,
160            connector_id: self.connector_id,
161            entitlement_type: self.entitlement_type,
162            vm_ids: self.vm_ids,
163        })
164    }
165}