aws_sdk_licensemanager/operation/checkout_license/
_checkout_license_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CheckoutLicenseOutput {
6 pub checkout_type: ::std::option::Option<crate::types::CheckoutType>,
8 pub license_consumption_token: ::std::option::Option<::std::string::String>,
10 pub entitlements_allowed: ::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>>,
12 pub signed_token: ::std::option::Option<::std::string::String>,
14 pub node_id: ::std::option::Option<::std::string::String>,
16 pub issued_at: ::std::option::Option<::std::string::String>,
18 pub expiration: ::std::option::Option<::std::string::String>,
20 pub license_arn: ::std::option::Option<::std::string::String>,
22 _request_id: Option<String>,
23}
24impl CheckoutLicenseOutput {
25 pub fn checkout_type(&self) -> ::std::option::Option<&crate::types::CheckoutType> {
27 self.checkout_type.as_ref()
28 }
29 pub fn license_consumption_token(&self) -> ::std::option::Option<&str> {
31 self.license_consumption_token.as_deref()
32 }
33 pub fn entitlements_allowed(&self) -> &[crate::types::EntitlementData] {
37 self.entitlements_allowed.as_deref().unwrap_or_default()
38 }
39 pub fn signed_token(&self) -> ::std::option::Option<&str> {
41 self.signed_token.as_deref()
42 }
43 pub fn node_id(&self) -> ::std::option::Option<&str> {
45 self.node_id.as_deref()
46 }
47 pub fn issued_at(&self) -> ::std::option::Option<&str> {
49 self.issued_at.as_deref()
50 }
51 pub fn expiration(&self) -> ::std::option::Option<&str> {
53 self.expiration.as_deref()
54 }
55 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 pub fn builder() -> crate::operation::checkout_license::builders::CheckoutLicenseOutputBuilder {
68 crate::operation::checkout_license::builders::CheckoutLicenseOutputBuilder::default()
69 }
70}
71
72#[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 pub fn checkout_type(mut self, input: crate::types::CheckoutType) -> Self {
89 self.checkout_type = ::std::option::Option::Some(input);
90 self
91 }
92 pub fn set_checkout_type(mut self, input: ::std::option::Option<crate::types::CheckoutType>) -> Self {
94 self.checkout_type = input;
95 self
96 }
97 pub fn get_checkout_type(&self) -> &::std::option::Option<crate::types::CheckoutType> {
99 &self.checkout_type
100 }
101 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 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 pub fn get_license_consumption_token(&self) -> &::std::option::Option<::std::string::String> {
113 &self.license_consumption_token
114 }
115 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 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 pub fn get_entitlements_allowed(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EntitlementData>> {
133 &self.entitlements_allowed
134 }
135 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 pub fn set_signed_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.signed_token = input;
143 self
144 }
145 pub fn get_signed_token(&self) -> &::std::option::Option<::std::string::String> {
147 &self.signed_token
148 }
149 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 pub fn set_node_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.node_id = input;
157 self
158 }
159 pub fn get_node_id(&self) -> &::std::option::Option<::std::string::String> {
161 &self.node_id
162 }
163 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 pub fn set_issued_at(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170 self.issued_at = input;
171 self
172 }
173 pub fn get_issued_at(&self) -> &::std::option::Option<::std::string::String> {
175 &self.issued_at
176 }
177 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 pub fn set_expiration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184 self.expiration = input;
185 self
186 }
187 pub fn get_expiration(&self) -> &::std::option::Option<::std::string::String> {
189 &self.expiration
190 }
191 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 pub fn set_license_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
198 self.license_arn = input;
199 self
200 }
201 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 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}