aws_sdk_licensemanager/operation/checkout_license/
_checkout_license_output.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 CheckoutLicenseOutput {
6    /// <p>Checkout type.</p>
7    pub checkout_type: ::std::option::Option<crate::types::CheckoutType>,
8    /// <p>License consumption token.</p>
9    pub license_consumption_token: ::std::option::Option<::std::string::String>,
10    /// <p>Allowed license entitlements.</p>
11    pub entitlements_allowed: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>>,
12    /// <p>Signed token.</p>
13    pub signed_token: ::std::option::Option<::std::string::String>,
14    /// <p>Node ID.</p>
15    pub node_id: ::std::option::Option<::std::string::String>,
16    /// <p>Date and time at which the license checkout is issued.</p>
17    pub issued_at: ::std::option::Option<::std::string::String>,
18    /// <p>Date and time at which the license checkout expires.</p>
19    pub expiration: ::std::option::Option<::std::string::String>,
20    /// <p>Amazon Resource Name (ARN) of the checkout license.</p>
21    pub license_arn: ::std::option::Option<::std::string::String>,
22    _request_id: Option<String>,
23}
24impl CheckoutLicenseOutput {
25    /// <p>Checkout type.</p>
26    pub fn checkout_type(&self) -> ::std::option::Option<&crate::types::CheckoutType> {
27        self.checkout_type.as_ref()
28    }
29    /// <p>License consumption token.</p>
30    pub fn license_consumption_token(&self) -> ::std::option::Option<&str> {
31        self.license_consumption_token.as_deref()
32    }
33    /// <p>Allowed license entitlements.</p>
34    ///
35    /// 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_allowed.is_none()`.
36    pub fn entitlements_allowed(&self) -> &[crate::types::EntitlementData] {
37        self.entitlements_allowed.as_deref().unwrap_or_default()
38    }
39    /// <p>Signed token.</p>
40    pub fn signed_token(&self) -> ::std::option::Option<&str> {
41        self.signed_token.as_deref()
42    }
43    /// <p>Node ID.</p>
44    pub fn node_id(&self) -> ::std::option::Option<&str> {
45        self.node_id.as_deref()
46    }
47    /// <p>Date and time at which the license checkout is issued.</p>
48    pub fn issued_at(&self) -> ::std::option::Option<&str> {
49        self.issued_at.as_deref()
50    }
51    /// <p>Date and time at which the license checkout expires.</p>
52    pub fn expiration(&self) -> ::std::option::Option<&str> {
53        self.expiration.as_deref()
54    }
55    /// <p>Amazon Resource Name (ARN) of the checkout license.</p>
56    pub fn license_arn(&self) -> ::std::option::Option<&str> {
57        self.license_arn.as_deref()
58    }
59}
60impl ::aws_types::request_id::RequestId for CheckoutLicenseOutput {
61    fn request_id(&self) -> Option<&str> {
62        self._request_id.as_deref()
63    }
64}
65impl CheckoutLicenseOutput {
66    /// Creates a new builder-style object to manufacture [`CheckoutLicenseOutput`](crate::operation::checkout_license::CheckoutLicenseOutput).
67    pub fn builder() -> crate::operation::checkout_license::builders::CheckoutLicenseOutputBuilder {
68        crate::operation::checkout_license::builders::CheckoutLicenseOutputBuilder::default()
69    }
70}
71
72/// A builder for [`CheckoutLicenseOutput`](crate::operation::checkout_license::CheckoutLicenseOutput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct CheckoutLicenseOutputBuilder {
76    pub(crate) checkout_type: ::std::option::Option<crate::types::CheckoutType>,
77    pub(crate) license_consumption_token: ::std::option::Option<::std::string::String>,
78    pub(crate) entitlements_allowed: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>>,
79    pub(crate) signed_token: ::std::option::Option<::std::string::String>,
80    pub(crate) node_id: ::std::option::Option<::std::string::String>,
81    pub(crate) issued_at: ::std::option::Option<::std::string::String>,
82    pub(crate) expiration: ::std::option::Option<::std::string::String>,
83    pub(crate) license_arn: ::std::option::Option<::std::string::String>,
84    _request_id: Option<String>,
85}
86impl CheckoutLicenseOutputBuilder {
87    /// <p>Checkout type.</p>
88    pub fn checkout_type(mut self, input: crate::types::CheckoutType) -> Self {
89        self.checkout_type = ::std::option::Option::Some(input);
90        self
91    }
92    /// <p>Checkout type.</p>
93    pub fn set_checkout_type(mut self, input: ::std::option::Option<crate::types::CheckoutType>) -> Self {
94        self.checkout_type = input;
95        self
96    }
97    /// <p>Checkout type.</p>
98    pub fn get_checkout_type(&self) -> &::std::option::Option<crate::types::CheckoutType> {
99        &self.checkout_type
100    }
101    /// <p>License consumption token.</p>
102    pub fn license_consumption_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.license_consumption_token = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>License consumption token.</p>
107    pub fn set_license_consumption_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.license_consumption_token = input;
109        self
110    }
111    /// <p>License consumption token.</p>
112    pub fn get_license_consumption_token(&self) -> &::std::option::Option<::std::string::String> {
113        &self.license_consumption_token
114    }
115    /// Appends an item to `entitlements_allowed`.
116    ///
117    /// To override the contents of this collection use [`set_entitlements_allowed`](Self::set_entitlements_allowed).
118    ///
119    /// <p>Allowed license entitlements.</p>
120    pub fn entitlements_allowed(mut self, input: crate::types::EntitlementData) -> Self {
121        let mut v = self.entitlements_allowed.unwrap_or_default();
122        v.push(input);
123        self.entitlements_allowed = ::std::option::Option::Some(v);
124        self
125    }
126    /// <p>Allowed license entitlements.</p>
127    pub fn set_entitlements_allowed(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>>) -> Self {
128        self.entitlements_allowed = input;
129        self
130    }
131    /// <p>Allowed license entitlements.</p>
132    pub fn get_entitlements_allowed(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>> {
133        &self.entitlements_allowed
134    }
135    /// <p>Signed token.</p>
136    pub fn signed_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.signed_token = ::std::option::Option::Some(input.into());
138        self
139    }
140    /// <p>Signed token.</p>
141    pub fn set_signed_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.signed_token = input;
143        self
144    }
145    /// <p>Signed token.</p>
146    pub fn get_signed_token(&self) -> &::std::option::Option<::std::string::String> {
147        &self.signed_token
148    }
149    /// <p>Node ID.</p>
150    pub fn node_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.node_id = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// <p>Node ID.</p>
155    pub fn set_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.node_id = input;
157        self
158    }
159    /// <p>Node ID.</p>
160    pub fn get_node_id(&self) -> &::std::option::Option<::std::string::String> {
161        &self.node_id
162    }
163    /// <p>Date and time at which the license checkout is issued.</p>
164    pub fn issued_at(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.issued_at = ::std::option::Option::Some(input.into());
166        self
167    }
168    /// <p>Date and time at which the license checkout is issued.</p>
169    pub fn set_issued_at(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.issued_at = input;
171        self
172    }
173    /// <p>Date and time at which the license checkout is issued.</p>
174    pub fn get_issued_at(&self) -> &::std::option::Option<::std::string::String> {
175        &self.issued_at
176    }
177    /// <p>Date and time at which the license checkout expires.</p>
178    pub fn expiration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.expiration = ::std::option::Option::Some(input.into());
180        self
181    }
182    /// <p>Date and time at which the license checkout expires.</p>
183    pub fn set_expiration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.expiration = input;
185        self
186    }
187    /// <p>Date and time at which the license checkout expires.</p>
188    pub fn get_expiration(&self) -> &::std::option::Option<::std::string::String> {
189        &self.expiration
190    }
191    /// <p>Amazon Resource Name (ARN) of the checkout license.</p>
192    pub fn license_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
193        self.license_arn = ::std::option::Option::Some(input.into());
194        self
195    }
196    /// <p>Amazon Resource Name (ARN) of the checkout license.</p>
197    pub fn set_license_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198        self.license_arn = input;
199        self
200    }
201    /// <p>Amazon Resource Name (ARN) of the checkout license.</p>
202    pub fn get_license_arn(&self) -> &::std::option::Option<::std::string::String> {
203        &self.license_arn
204    }
205    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
206        self._request_id = Some(request_id.into());
207        self
208    }
209
210    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
211        self._request_id = request_id;
212        self
213    }
214    /// Consumes the builder and constructs a [`CheckoutLicenseOutput`](crate::operation::checkout_license::CheckoutLicenseOutput).
215    pub fn build(self) -> crate::operation::checkout_license::CheckoutLicenseOutput {
216        crate::operation::checkout_license::CheckoutLicenseOutput {
217            checkout_type: self.checkout_type,
218            license_consumption_token: self.license_consumption_token,
219            entitlements_allowed: self.entitlements_allowed,
220            signed_token: self.signed_token,
221            node_id: self.node_id,
222            issued_at: self.issued_at,
223            expiration: self.expiration,
224            license_arn: self.license_arn,
225            _request_id: self._request_id,
226        }
227    }
228}