aws_sdk_licensemanager/operation/create_license/
_create_license_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 CreateLicenseInput {
6    /// <p>License name.</p>
7    pub license_name: ::std::option::Option<::std::string::String>,
8    /// <p>Product name.</p>
9    pub product_name: ::std::option::Option<::std::string::String>,
10    /// <p>Product SKU.</p>
11    pub product_sku: ::std::option::Option<::std::string::String>,
12    /// <p>License issuer.</p>
13    pub issuer: ::std::option::Option<crate::types::Issuer>,
14    /// <p>Home Region for the license.</p>
15    pub home_region: ::std::option::Option<::std::string::String>,
16    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
17    pub validity: ::std::option::Option<crate::types::DatetimeRange>,
18    /// <p>License entitlements.</p>
19    pub entitlements: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>,
20    /// <p>License beneficiary.</p>
21    pub beneficiary: ::std::option::Option<::std::string::String>,
22    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
23    pub consumption_configuration: ::std::option::Option<crate::types::ConsumptionConfiguration>,
24    /// <p>Information about the license.</p>
25    pub license_metadata: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>,
26    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
27    pub client_token: ::std::option::Option<::std::string::String>,
28    /// <p>Tags to add to the license. For more information about tagging support in License Manager, see the <a href="https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html">TagResource</a> operation.</p>
29    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
30}
31impl CreateLicenseInput {
32    /// <p>License name.</p>
33    pub fn license_name(&self) -> ::std::option::Option<&str> {
34        self.license_name.as_deref()
35    }
36    /// <p>Product name.</p>
37    pub fn product_name(&self) -> ::std::option::Option<&str> {
38        self.product_name.as_deref()
39    }
40    /// <p>Product SKU.</p>
41    pub fn product_sku(&self) -> ::std::option::Option<&str> {
42        self.product_sku.as_deref()
43    }
44    /// <p>License issuer.</p>
45    pub fn issuer(&self) -> ::std::option::Option<&crate::types::Issuer> {
46        self.issuer.as_ref()
47    }
48    /// <p>Home Region for the license.</p>
49    pub fn home_region(&self) -> ::std::option::Option<&str> {
50        self.home_region.as_deref()
51    }
52    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
53    pub fn validity(&self) -> ::std::option::Option<&crate::types::DatetimeRange> {
54        self.validity.as_ref()
55    }
56    /// <p>License entitlements.</p>
57    ///
58    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.entitlements.is_none()`.
59    pub fn entitlements(&self) -> &[crate::types::Entitlement] {
60        self.entitlements.as_deref().unwrap_or_default()
61    }
62    /// <p>License beneficiary.</p>
63    pub fn beneficiary(&self) -> ::std::option::Option<&str> {
64        self.beneficiary.as_deref()
65    }
66    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
67    pub fn consumption_configuration(&self) -> ::std::option::Option<&crate::types::ConsumptionConfiguration> {
68        self.consumption_configuration.as_ref()
69    }
70    /// <p>Information about the license.</p>
71    ///
72    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.license_metadata.is_none()`.
73    pub fn license_metadata(&self) -> &[crate::types::Metadata] {
74        self.license_metadata.as_deref().unwrap_or_default()
75    }
76    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
77    pub fn client_token(&self) -> ::std::option::Option<&str> {
78        self.client_token.as_deref()
79    }
80    /// <p>Tags to add to the license. For more information about tagging support in License Manager, see the <a href="https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html">TagResource</a> operation.</p>
81    ///
82    /// 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()`.
83    pub fn tags(&self) -> &[crate::types::Tag] {
84        self.tags.as_deref().unwrap_or_default()
85    }
86}
87impl CreateLicenseInput {
88    /// Creates a new builder-style object to manufacture [`CreateLicenseInput`](crate::operation::create_license::CreateLicenseInput).
89    pub fn builder() -> crate::operation::create_license::builders::CreateLicenseInputBuilder {
90        crate::operation::create_license::builders::CreateLicenseInputBuilder::default()
91    }
92}
93
94/// A builder for [`CreateLicenseInput`](crate::operation::create_license::CreateLicenseInput).
95#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
96#[non_exhaustive]
97pub struct CreateLicenseInputBuilder {
98    pub(crate) license_name: ::std::option::Option<::std::string::String>,
99    pub(crate) product_name: ::std::option::Option<::std::string::String>,
100    pub(crate) product_sku: ::std::option::Option<::std::string::String>,
101    pub(crate) issuer: ::std::option::Option<crate::types::Issuer>,
102    pub(crate) home_region: ::std::option::Option<::std::string::String>,
103    pub(crate) validity: ::std::option::Option<crate::types::DatetimeRange>,
104    pub(crate) entitlements: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>,
105    pub(crate) beneficiary: ::std::option::Option<::std::string::String>,
106    pub(crate) consumption_configuration: ::std::option::Option<crate::types::ConsumptionConfiguration>,
107    pub(crate) license_metadata: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>,
108    pub(crate) client_token: ::std::option::Option<::std::string::String>,
109    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
110}
111impl CreateLicenseInputBuilder {
112    /// <p>License name.</p>
113    /// This field is required.
114    pub fn license_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.license_name = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>License name.</p>
119    pub fn set_license_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.license_name = input;
121        self
122    }
123    /// <p>License name.</p>
124    pub fn get_license_name(&self) -> &::std::option::Option<::std::string::String> {
125        &self.license_name
126    }
127    /// <p>Product name.</p>
128    /// This field is required.
129    pub fn product_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.product_name = ::std::option::Option::Some(input.into());
131        self
132    }
133    /// <p>Product name.</p>
134    pub fn set_product_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.product_name = input;
136        self
137    }
138    /// <p>Product name.</p>
139    pub fn get_product_name(&self) -> &::std::option::Option<::std::string::String> {
140        &self.product_name
141    }
142    /// <p>Product SKU.</p>
143    /// This field is required.
144    pub fn product_sku(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.product_sku = ::std::option::Option::Some(input.into());
146        self
147    }
148    /// <p>Product SKU.</p>
149    pub fn set_product_sku(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.product_sku = input;
151        self
152    }
153    /// <p>Product SKU.</p>
154    pub fn get_product_sku(&self) -> &::std::option::Option<::std::string::String> {
155        &self.product_sku
156    }
157    /// <p>License issuer.</p>
158    /// This field is required.
159    pub fn issuer(mut self, input: crate::types::Issuer) -> Self {
160        self.issuer = ::std::option::Option::Some(input);
161        self
162    }
163    /// <p>License issuer.</p>
164    pub fn set_issuer(mut self, input: ::std::option::Option<crate::types::Issuer>) -> Self {
165        self.issuer = input;
166        self
167    }
168    /// <p>License issuer.</p>
169    pub fn get_issuer(&self) -> &::std::option::Option<crate::types::Issuer> {
170        &self.issuer
171    }
172    /// <p>Home Region for the license.</p>
173    /// This field is required.
174    pub fn home_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
175        self.home_region = ::std::option::Option::Some(input.into());
176        self
177    }
178    /// <p>Home Region for the license.</p>
179    pub fn set_home_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
180        self.home_region = input;
181        self
182    }
183    /// <p>Home Region for the license.</p>
184    pub fn get_home_region(&self) -> &::std::option::Option<::std::string::String> {
185        &self.home_region
186    }
187    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
188    /// This field is required.
189    pub fn validity(mut self, input: crate::types::DatetimeRange) -> Self {
190        self.validity = ::std::option::Option::Some(input);
191        self
192    }
193    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
194    pub fn set_validity(mut self, input: ::std::option::Option<crate::types::DatetimeRange>) -> Self {
195        self.validity = input;
196        self
197    }
198    /// <p>Date and time range during which the license is valid, in ISO8601-UTC format.</p>
199    pub fn get_validity(&self) -> &::std::option::Option<crate::types::DatetimeRange> {
200        &self.validity
201    }
202    /// Appends an item to `entitlements`.
203    ///
204    /// To override the contents of this collection use [`set_entitlements`](Self::set_entitlements).
205    ///
206    /// <p>License entitlements.</p>
207    pub fn entitlements(mut self, input: crate::types::Entitlement) -> Self {
208        let mut v = self.entitlements.unwrap_or_default();
209        v.push(input);
210        self.entitlements = ::std::option::Option::Some(v);
211        self
212    }
213    /// <p>License entitlements.</p>
214    pub fn set_entitlements(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Entitlement>>) -> Self {
215        self.entitlements = input;
216        self
217    }
218    /// <p>License entitlements.</p>
219    pub fn get_entitlements(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Entitlement>> {
220        &self.entitlements
221    }
222    /// <p>License beneficiary.</p>
223    /// This field is required.
224    pub fn beneficiary(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225        self.beneficiary = ::std::option::Option::Some(input.into());
226        self
227    }
228    /// <p>License beneficiary.</p>
229    pub fn set_beneficiary(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
230        self.beneficiary = input;
231        self
232    }
233    /// <p>License beneficiary.</p>
234    pub fn get_beneficiary(&self) -> &::std::option::Option<::std::string::String> {
235        &self.beneficiary
236    }
237    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
238    /// This field is required.
239    pub fn consumption_configuration(mut self, input: crate::types::ConsumptionConfiguration) -> Self {
240        self.consumption_configuration = ::std::option::Option::Some(input);
241        self
242    }
243    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
244    pub fn set_consumption_configuration(mut self, input: ::std::option::Option<crate::types::ConsumptionConfiguration>) -> Self {
245        self.consumption_configuration = input;
246        self
247    }
248    /// <p>Configuration for consumption of the license. Choose a provisional configuration for workloads running with continuous connectivity. Choose a borrow configuration for workloads with offline usage.</p>
249    pub fn get_consumption_configuration(&self) -> &::std::option::Option<crate::types::ConsumptionConfiguration> {
250        &self.consumption_configuration
251    }
252    /// Appends an item to `license_metadata`.
253    ///
254    /// To override the contents of this collection use [`set_license_metadata`](Self::set_license_metadata).
255    ///
256    /// <p>Information about the license.</p>
257    pub fn license_metadata(mut self, input: crate::types::Metadata) -> Self {
258        let mut v = self.license_metadata.unwrap_or_default();
259        v.push(input);
260        self.license_metadata = ::std::option::Option::Some(v);
261        self
262    }
263    /// <p>Information about the license.</p>
264    pub fn set_license_metadata(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Metadata>>) -> Self {
265        self.license_metadata = input;
266        self
267    }
268    /// <p>Information about the license.</p>
269    pub fn get_license_metadata(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Metadata>> {
270        &self.license_metadata
271    }
272    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
273    /// This field is required.
274    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
275        self.client_token = ::std::option::Option::Some(input.into());
276        self
277    }
278    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
279    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
280        self.client_token = input;
281        self
282    }
283    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
284    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
285        &self.client_token
286    }
287    /// Appends an item to `tags`.
288    ///
289    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
290    ///
291    /// <p>Tags to add to the license. For more information about tagging support in License Manager, see the <a href="https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html">TagResource</a> operation.</p>
292    pub fn tags(mut self, input: crate::types::Tag) -> Self {
293        let mut v = self.tags.unwrap_or_default();
294        v.push(input);
295        self.tags = ::std::option::Option::Some(v);
296        self
297    }
298    /// <p>Tags to add to the license. For more information about tagging support in License Manager, see the <a href="https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html">TagResource</a> operation.</p>
299    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
300        self.tags = input;
301        self
302    }
303    /// <p>Tags to add to the license. For more information about tagging support in License Manager, see the <a href="https://docs.aws.amazon.com/license-manager/latest/APIReference/API_TagResource.html">TagResource</a> operation.</p>
304    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
305        &self.tags
306    }
307    /// Consumes the builder and constructs a [`CreateLicenseInput`](crate::operation::create_license::CreateLicenseInput).
308    pub fn build(
309        self,
310    ) -> ::std::result::Result<crate::operation::create_license::CreateLicenseInput, ::aws_smithy_types::error::operation::BuildError> {
311        ::std::result::Result::Ok(crate::operation::create_license::CreateLicenseInput {
312            license_name: self.license_name,
313            product_name: self.product_name,
314            product_sku: self.product_sku,
315            issuer: self.issuer,
316            home_region: self.home_region,
317            validity: self.validity,
318            entitlements: self.entitlements,
319            beneficiary: self.beneficiary,
320            consumption_configuration: self.consumption_configuration,
321            license_metadata: self.license_metadata,
322            client_token: self.client_token,
323            tags: self.tags,
324        })
325    }
326}