aws_sdk_lightsail/types/_access_key_last_used.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Describes the last time an access key was used.</p><note>
4/// <p>This object does not include data in the response of a <a href="https://docs.aws.amazon.com/lightsail/2016-11-28/api-reference/API_CreateBucketAccessKey.html">CreateBucketAccessKey</a> action.</p>
5/// </note>
6#[non_exhaustive]
7#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
8pub struct AccessKeyLastUsed {
9 /// <p>The date and time when the access key was most recently used.</p>
10 /// <p>This value is null if the access key has not been used.</p>
11 pub last_used_date: ::std::option::Option<::aws_smithy_types::DateTime>,
12 /// <p>The Amazon Web Services Region where this access key was most recently used.</p>
13 /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
14 pub region: ::std::option::Option<::std::string::String>,
15 /// <p>The name of the Amazon Web Services service with which this access key was most recently used.</p>
16 /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
17 pub service_name: ::std::option::Option<::std::string::String>,
18}
19impl AccessKeyLastUsed {
20 /// <p>The date and time when the access key was most recently used.</p>
21 /// <p>This value is null if the access key has not been used.</p>
22 pub fn last_used_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
23 self.last_used_date.as_ref()
24 }
25 /// <p>The Amazon Web Services Region where this access key was most recently used.</p>
26 /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
27 pub fn region(&self) -> ::std::option::Option<&str> {
28 self.region.as_deref()
29 }
30 /// <p>The name of the Amazon Web Services service with which this access key was most recently used.</p>
31 /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
32 pub fn service_name(&self) -> ::std::option::Option<&str> {
33 self.service_name.as_deref()
34 }
35}
36impl AccessKeyLastUsed {
37 /// Creates a new builder-style object to manufacture [`AccessKeyLastUsed`](crate::types::AccessKeyLastUsed).
38 pub fn builder() -> crate::types::builders::AccessKeyLastUsedBuilder {
39 crate::types::builders::AccessKeyLastUsedBuilder::default()
40 }
41}
42
43/// A builder for [`AccessKeyLastUsed`](crate::types::AccessKeyLastUsed).
44#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
45#[non_exhaustive]
46pub struct AccessKeyLastUsedBuilder {
47 pub(crate) last_used_date: ::std::option::Option<::aws_smithy_types::DateTime>,
48 pub(crate) region: ::std::option::Option<::std::string::String>,
49 pub(crate) service_name: ::std::option::Option<::std::string::String>,
50}
51impl AccessKeyLastUsedBuilder {
52 /// <p>The date and time when the access key was most recently used.</p>
53 /// <p>This value is null if the access key has not been used.</p>
54 pub fn last_used_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
55 self.last_used_date = ::std::option::Option::Some(input);
56 self
57 }
58 /// <p>The date and time when the access key was most recently used.</p>
59 /// <p>This value is null if the access key has not been used.</p>
60 pub fn set_last_used_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
61 self.last_used_date = input;
62 self
63 }
64 /// <p>The date and time when the access key was most recently used.</p>
65 /// <p>This value is null if the access key has not been used.</p>
66 pub fn get_last_used_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
67 &self.last_used_date
68 }
69 /// <p>The Amazon Web Services Region where this access key was most recently used.</p>
70 /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
71 pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
72 self.region = ::std::option::Option::Some(input.into());
73 self
74 }
75 /// <p>The Amazon Web Services Region where this access key was most recently used.</p>
76 /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
77 pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78 self.region = input;
79 self
80 }
81 /// <p>The Amazon Web Services Region where this access key was most recently used.</p>
82 /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
83 pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
84 &self.region
85 }
86 /// <p>The name of the Amazon Web Services service with which this access key was most recently used.</p>
87 /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
88 pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.service_name = ::std::option::Option::Some(input.into());
90 self
91 }
92 /// <p>The name of the Amazon Web Services service with which this access key was most recently used.</p>
93 /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
94 pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95 self.service_name = input;
96 self
97 }
98 /// <p>The name of the Amazon Web Services service with which this access key was most recently used.</p>
99 /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
100 pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
101 &self.service_name
102 }
103 /// Consumes the builder and constructs a [`AccessKeyLastUsed`](crate::types::AccessKeyLastUsed).
104 pub fn build(self) -> crate::types::AccessKeyLastUsed {
105 crate::types::AccessKeyLastUsed {
106 last_used_date: self.last_used_date,
107 region: self.region,
108 service_name: self.service_name,
109 }
110 }
111}