Skip to main content

aws_sdk_licensemanagerlinuxsubscriptions/types/
_instance.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Details discovered information about a running instance using Linux subscriptions.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Instance {
7    /// <p>The AMI ID used to launch the instance.</p>
8    pub ami_id: ::std::option::Option<::std::string::String>,
9    /// <p>The instance ID of the resource.</p>
10    pub instance_id: ::std::option::Option<::std::string::String>,
11    /// <p>The instance type of the resource.</p>
12    pub instance_type: ::std::option::Option<::std::string::String>,
13    /// <p>The account ID which owns the instance.</p>
14    pub account_id: ::std::option::Option<::std::string::String>,
15    /// <p>The status of the instance.</p>
16    pub status: ::std::option::Option<::std::string::String>,
17    /// <p>The Region the instance is running in.</p>
18    pub region: ::std::option::Option<::std::string::String>,
19    /// <p>The usage operation of the instance. For more information, see For more information, see <a href="https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html">Usage operation values</a> in the <i>License Manager User Guide</i>.</p>
20    pub usage_operation: ::std::option::Option<::std::string::String>,
21    /// <p>The product code for the instance. For more information, see <a href="https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html">Usage operation values</a> in the <i>License Manager User Guide</i> .</p>
22    pub product_code: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
23    /// <p>The time in which the last discovery updated the instance details.</p>
24    pub last_updated_time: ::std::option::Option<::std::string::String>,
25    /// <p>The name of the license subscription that the instance uses.</p>
26    pub subscription_name: ::std::option::Option<::std::string::String>,
27    /// <p>The operating system software version that runs on your instance.</p>
28    pub os_version: ::std::option::Option<::std::string::String>,
29    /// <p>The timestamp when you registered the third-party Linux subscription provider for the subscription that the instance uses.</p>
30    pub subscription_provider_create_time: ::std::option::Option<::std::string::String>,
31    /// <p>The timestamp from the last time that the instance synced with the registered third-party Linux subscription provider.</p>
32    pub subscription_provider_update_time: ::std::option::Option<::std::string::String>,
33    /// <p>Indicates that you have two different license subscriptions for the same software on your instance.</p>
34    pub dual_subscription: ::std::option::Option<::std::string::String>,
35    /// <p>Indicates that your instance uses a BYOL license subscription from a third-party Linux subscription provider that you've registered with License Manager.</p>
36    pub registered_with_subscription_provider: ::std::option::Option<::std::string::String>,
37}
38impl Instance {
39    /// <p>The AMI ID used to launch the instance.</p>
40    pub fn ami_id(&self) -> ::std::option::Option<&str> {
41        self.ami_id.as_deref()
42    }
43    /// <p>The instance ID of the resource.</p>
44    pub fn instance_id(&self) -> ::std::option::Option<&str> {
45        self.instance_id.as_deref()
46    }
47    /// <p>The instance type of the resource.</p>
48    pub fn instance_type(&self) -> ::std::option::Option<&str> {
49        self.instance_type.as_deref()
50    }
51    /// <p>The account ID which owns the instance.</p>
52    pub fn account_id(&self) -> ::std::option::Option<&str> {
53        self.account_id.as_deref()
54    }
55    /// <p>The status of the instance.</p>
56    pub fn status(&self) -> ::std::option::Option<&str> {
57        self.status.as_deref()
58    }
59    /// <p>The Region the instance is running in.</p>
60    pub fn region(&self) -> ::std::option::Option<&str> {
61        self.region.as_deref()
62    }
63    /// <p>The usage operation of the instance. For more information, see For more information, see <a href="https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html">Usage operation values</a> in the <i>License Manager User Guide</i>.</p>
64    pub fn usage_operation(&self) -> ::std::option::Option<&str> {
65        self.usage_operation.as_deref()
66    }
67    /// <p>The product code for the instance. For more information, see <a href="https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html">Usage operation values</a> in the <i>License Manager User Guide</i> .</p>
68    ///
69    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.product_code.is_none()`.
70    pub fn product_code(&self) -> &[::std::string::String] {
71        self.product_code.as_deref().unwrap_or_default()
72    }
73    /// <p>The time in which the last discovery updated the instance details.</p>
74    pub fn last_updated_time(&self) -> ::std::option::Option<&str> {
75        self.last_updated_time.as_deref()
76    }
77    /// <p>The name of the license subscription that the instance uses.</p>
78    pub fn subscription_name(&self) -> ::std::option::Option<&str> {
79        self.subscription_name.as_deref()
80    }
81    /// <p>The operating system software version that runs on your instance.</p>
82    pub fn os_version(&self) -> ::std::option::Option<&str> {
83        self.os_version.as_deref()
84    }
85    /// <p>The timestamp when you registered the third-party Linux subscription provider for the subscription that the instance uses.</p>
86    pub fn subscription_provider_create_time(&self) -> ::std::option::Option<&str> {
87        self.subscription_provider_create_time.as_deref()
88    }
89    /// <p>The timestamp from the last time that the instance synced with the registered third-party Linux subscription provider.</p>
90    pub fn subscription_provider_update_time(&self) -> ::std::option::Option<&str> {
91        self.subscription_provider_update_time.as_deref()
92    }
93    /// <p>Indicates that you have two different license subscriptions for the same software on your instance.</p>
94    pub fn dual_subscription(&self) -> ::std::option::Option<&str> {
95        self.dual_subscription.as_deref()
96    }
97    /// <p>Indicates that your instance uses a BYOL license subscription from a third-party Linux subscription provider that you've registered with License Manager.</p>
98    pub fn registered_with_subscription_provider(&self) -> ::std::option::Option<&str> {
99        self.registered_with_subscription_provider.as_deref()
100    }
101}
102impl Instance {
103    /// Creates a new builder-style object to manufacture [`Instance`](crate::types::Instance).
104    pub fn builder() -> crate::types::builders::InstanceBuilder {
105        crate::types::builders::InstanceBuilder::default()
106    }
107}
108
109/// A builder for [`Instance`](crate::types::Instance).
110#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
111#[non_exhaustive]
112pub struct InstanceBuilder {
113    pub(crate) ami_id: ::std::option::Option<::std::string::String>,
114    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
115    pub(crate) instance_type: ::std::option::Option<::std::string::String>,
116    pub(crate) account_id: ::std::option::Option<::std::string::String>,
117    pub(crate) status: ::std::option::Option<::std::string::String>,
118    pub(crate) region: ::std::option::Option<::std::string::String>,
119    pub(crate) usage_operation: ::std::option::Option<::std::string::String>,
120    pub(crate) product_code: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
121    pub(crate) last_updated_time: ::std::option::Option<::std::string::String>,
122    pub(crate) subscription_name: ::std::option::Option<::std::string::String>,
123    pub(crate) os_version: ::std::option::Option<::std::string::String>,
124    pub(crate) subscription_provider_create_time: ::std::option::Option<::std::string::String>,
125    pub(crate) subscription_provider_update_time: ::std::option::Option<::std::string::String>,
126    pub(crate) dual_subscription: ::std::option::Option<::std::string::String>,
127    pub(crate) registered_with_subscription_provider: ::std::option::Option<::std::string::String>,
128}
129impl InstanceBuilder {
130    /// <p>The AMI ID used to launch the instance.</p>
131    pub fn ami_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.ami_id = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>The AMI ID used to launch the instance.</p>
136    pub fn set_ami_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.ami_id = input;
138        self
139    }
140    /// <p>The AMI ID used to launch the instance.</p>
141    pub fn get_ami_id(&self) -> &::std::option::Option<::std::string::String> {
142        &self.ami_id
143    }
144    /// <p>The instance ID of the resource.</p>
145    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.instance_id = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>The instance ID of the resource.</p>
150    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.instance_id = input;
152        self
153    }
154    /// <p>The instance ID of the resource.</p>
155    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
156        &self.instance_id
157    }
158    /// <p>The instance type of the resource.</p>
159    pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.instance_type = ::std::option::Option::Some(input.into());
161        self
162    }
163    /// <p>The instance type of the resource.</p>
164    pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.instance_type = input;
166        self
167    }
168    /// <p>The instance type of the resource.</p>
169    pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
170        &self.instance_type
171    }
172    /// <p>The account ID which owns the instance.</p>
173    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.account_id = ::std::option::Option::Some(input.into());
175        self
176    }
177    /// <p>The account ID which owns the instance.</p>
178    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.account_id = input;
180        self
181    }
182    /// <p>The account ID which owns the instance.</p>
183    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
184        &self.account_id
185    }
186    /// <p>The status of the instance.</p>
187    pub fn status(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.status = ::std::option::Option::Some(input.into());
189        self
190    }
191    /// <p>The status of the instance.</p>
192    pub fn set_status(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.status = input;
194        self
195    }
196    /// <p>The status of the instance.</p>
197    pub fn get_status(&self) -> &::std::option::Option<::std::string::String> {
198        &self.status
199    }
200    /// <p>The Region the instance is running in.</p>
201    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.region = ::std::option::Option::Some(input.into());
203        self
204    }
205    /// <p>The Region the instance is running in.</p>
206    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207        self.region = input;
208        self
209    }
210    /// <p>The Region the instance is running in.</p>
211    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
212        &self.region
213    }
214    /// <p>The usage operation of the instance. For more information, see For more information, see <a href="https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html">Usage operation values</a> in the <i>License Manager User Guide</i>.</p>
215    pub fn usage_operation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.usage_operation = ::std::option::Option::Some(input.into());
217        self
218    }
219    /// <p>The usage operation of the instance. For more information, see For more information, see <a href="https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html">Usage operation values</a> in the <i>License Manager User Guide</i>.</p>
220    pub fn set_usage_operation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.usage_operation = input;
222        self
223    }
224    /// <p>The usage operation of the instance. For more information, see For more information, see <a href="https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html">Usage operation values</a> in the <i>License Manager User Guide</i>.</p>
225    pub fn get_usage_operation(&self) -> &::std::option::Option<::std::string::String> {
226        &self.usage_operation
227    }
228    /// Appends an item to `product_code`.
229    ///
230    /// To override the contents of this collection use [`set_product_code`](Self::set_product_code).
231    ///
232    /// <p>The product code for the instance. For more information, see <a href="https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html">Usage operation values</a> in the <i>License Manager User Guide</i> .</p>
233    pub fn product_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
234        let mut v = self.product_code.unwrap_or_default();
235        v.push(input.into());
236        self.product_code = ::std::option::Option::Some(v);
237        self
238    }
239    /// <p>The product code for the instance. For more information, see <a href="https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html">Usage operation values</a> in the <i>License Manager User Guide</i> .</p>
240    pub fn set_product_code(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
241        self.product_code = input;
242        self
243    }
244    /// <p>The product code for the instance. For more information, see <a href="https://docs.aws.amazon.com/license-manager/latest/userguide/linux-subscriptions-usage-operation.html">Usage operation values</a> in the <i>License Manager User Guide</i> .</p>
245    pub fn get_product_code(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
246        &self.product_code
247    }
248    /// <p>The time in which the last discovery updated the instance details.</p>
249    pub fn last_updated_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
250        self.last_updated_time = ::std::option::Option::Some(input.into());
251        self
252    }
253    /// <p>The time in which the last discovery updated the instance details.</p>
254    pub fn set_last_updated_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
255        self.last_updated_time = input;
256        self
257    }
258    /// <p>The time in which the last discovery updated the instance details.</p>
259    pub fn get_last_updated_time(&self) -> &::std::option::Option<::std::string::String> {
260        &self.last_updated_time
261    }
262    /// <p>The name of the license subscription that the instance uses.</p>
263    pub fn subscription_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
264        self.subscription_name = ::std::option::Option::Some(input.into());
265        self
266    }
267    /// <p>The name of the license subscription that the instance uses.</p>
268    pub fn set_subscription_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
269        self.subscription_name = input;
270        self
271    }
272    /// <p>The name of the license subscription that the instance uses.</p>
273    pub fn get_subscription_name(&self) -> &::std::option::Option<::std::string::String> {
274        &self.subscription_name
275    }
276    /// <p>The operating system software version that runs on your instance.</p>
277    pub fn os_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
278        self.os_version = ::std::option::Option::Some(input.into());
279        self
280    }
281    /// <p>The operating system software version that runs on your instance.</p>
282    pub fn set_os_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
283        self.os_version = input;
284        self
285    }
286    /// <p>The operating system software version that runs on your instance.</p>
287    pub fn get_os_version(&self) -> &::std::option::Option<::std::string::String> {
288        &self.os_version
289    }
290    /// <p>The timestamp when you registered the third-party Linux subscription provider for the subscription that the instance uses.</p>
291    pub fn subscription_provider_create_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
292        self.subscription_provider_create_time = ::std::option::Option::Some(input.into());
293        self
294    }
295    /// <p>The timestamp when you registered the third-party Linux subscription provider for the subscription that the instance uses.</p>
296    pub fn set_subscription_provider_create_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
297        self.subscription_provider_create_time = input;
298        self
299    }
300    /// <p>The timestamp when you registered the third-party Linux subscription provider for the subscription that the instance uses.</p>
301    pub fn get_subscription_provider_create_time(&self) -> &::std::option::Option<::std::string::String> {
302        &self.subscription_provider_create_time
303    }
304    /// <p>The timestamp from the last time that the instance synced with the registered third-party Linux subscription provider.</p>
305    pub fn subscription_provider_update_time(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
306        self.subscription_provider_update_time = ::std::option::Option::Some(input.into());
307        self
308    }
309    /// <p>The timestamp from the last time that the instance synced with the registered third-party Linux subscription provider.</p>
310    pub fn set_subscription_provider_update_time(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
311        self.subscription_provider_update_time = input;
312        self
313    }
314    /// <p>The timestamp from the last time that the instance synced with the registered third-party Linux subscription provider.</p>
315    pub fn get_subscription_provider_update_time(&self) -> &::std::option::Option<::std::string::String> {
316        &self.subscription_provider_update_time
317    }
318    /// <p>Indicates that you have two different license subscriptions for the same software on your instance.</p>
319    pub fn dual_subscription(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
320        self.dual_subscription = ::std::option::Option::Some(input.into());
321        self
322    }
323    /// <p>Indicates that you have two different license subscriptions for the same software on your instance.</p>
324    pub fn set_dual_subscription(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
325        self.dual_subscription = input;
326        self
327    }
328    /// <p>Indicates that you have two different license subscriptions for the same software on your instance.</p>
329    pub fn get_dual_subscription(&self) -> &::std::option::Option<::std::string::String> {
330        &self.dual_subscription
331    }
332    /// <p>Indicates that your instance uses a BYOL license subscription from a third-party Linux subscription provider that you've registered with License Manager.</p>
333    pub fn registered_with_subscription_provider(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
334        self.registered_with_subscription_provider = ::std::option::Option::Some(input.into());
335        self
336    }
337    /// <p>Indicates that your instance uses a BYOL license subscription from a third-party Linux subscription provider that you've registered with License Manager.</p>
338    pub fn set_registered_with_subscription_provider(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
339        self.registered_with_subscription_provider = input;
340        self
341    }
342    /// <p>Indicates that your instance uses a BYOL license subscription from a third-party Linux subscription provider that you've registered with License Manager.</p>
343    pub fn get_registered_with_subscription_provider(&self) -> &::std::option::Option<::std::string::String> {
344        &self.registered_with_subscription_provider
345    }
346    /// Consumes the builder and constructs a [`Instance`](crate::types::Instance).
347    pub fn build(self) -> crate::types::Instance {
348        crate::types::Instance {
349            ami_id: self.ami_id,
350            instance_id: self.instance_id,
351            instance_type: self.instance_type,
352            account_id: self.account_id,
353            status: self.status,
354            region: self.region,
355            usage_operation: self.usage_operation,
356            product_code: self.product_code,
357            last_updated_time: self.last_updated_time,
358            subscription_name: self.subscription_name,
359            os_version: self.os_version,
360            subscription_provider_create_time: self.subscription_provider_create_time,
361            subscription_provider_update_time: self.subscription_provider_update_time,
362            dual_subscription: self.dual_subscription,
363            registered_with_subscription_provider: self.registered_with_subscription_provider,
364        }
365    }
366}