1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes the last time an access key was used.</p><note>
/// <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>
/// </note>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct AccessKeyLastUsed {
    /// <p>The date and time when the access key was most recently used.</p>
    /// <p>This value is null if the access key has not been used.</p>
    pub last_used_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The Amazon Web Services Region where this access key was most recently used.</p>
    /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
    pub region: ::std::option::Option<::std::string::String>,
    /// <p>The name of the Amazon Web Services service with which this access key was most recently used.</p>
    /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
    pub service_name: ::std::option::Option<::std::string::String>,
}
impl AccessKeyLastUsed {
    /// <p>The date and time when the access key was most recently used.</p>
    /// <p>This value is null if the access key has not been used.</p>
    pub fn last_used_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.last_used_date.as_ref()
    }
    /// <p>The Amazon Web Services Region where this access key was most recently used.</p>
    /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
    pub fn region(&self) -> ::std::option::Option<&str> {
        self.region.as_deref()
    }
    /// <p>The name of the Amazon Web Services service with which this access key was most recently used.</p>
    /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
    pub fn service_name(&self) -> ::std::option::Option<&str> {
        self.service_name.as_deref()
    }
}
impl AccessKeyLastUsed {
    /// Creates a new builder-style object to manufacture [`AccessKeyLastUsed`](crate::types::AccessKeyLastUsed).
    pub fn builder() -> crate::types::builders::AccessKeyLastUsedBuilder {
        crate::types::builders::AccessKeyLastUsedBuilder::default()
    }
}

/// A builder for [`AccessKeyLastUsed`](crate::types::AccessKeyLastUsed).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct AccessKeyLastUsedBuilder {
    pub(crate) last_used_date: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) region: ::std::option::Option<::std::string::String>,
    pub(crate) service_name: ::std::option::Option<::std::string::String>,
}
impl AccessKeyLastUsedBuilder {
    /// <p>The date and time when the access key was most recently used.</p>
    /// <p>This value is null if the access key has not been used.</p>
    pub fn last_used_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.last_used_date = ::std::option::Option::Some(input);
        self
    }
    /// <p>The date and time when the access key was most recently used.</p>
    /// <p>This value is null if the access key has not been used.</p>
    pub fn set_last_used_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.last_used_date = input;
        self
    }
    /// <p>The date and time when the access key was most recently used.</p>
    /// <p>This value is null if the access key has not been used.</p>
    pub fn get_last_used_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.last_used_date
    }
    /// <p>The Amazon Web Services Region where this access key was most recently used.</p>
    /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.region = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Web Services Region where this access key was most recently used.</p>
    /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.region = input;
        self
    }
    /// <p>The Amazon Web Services Region where this access key was most recently used.</p>
    /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
        &self.region
    }
    /// <p>The name of the Amazon Web Services service with which this access key was most recently used.</p>
    /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.service_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the Amazon Web Services service with which this access key was most recently used.</p>
    /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.service_name = input;
        self
    }
    /// <p>The name of the Amazon Web Services service with which this access key was most recently used.</p>
    /// <p>This value is <code>N/A</code> if the access key has not been used.</p>
    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.service_name
    }
    /// Consumes the builder and constructs a [`AccessKeyLastUsed`](crate::types::AccessKeyLastUsed).
    pub fn build(self) -> crate::types::AccessKeyLastUsed {
        crate::types::AccessKeyLastUsed {
            last_used_date: self.last_used_date,
            region: self.region,
            service_name: self.service_name,
        }
    }
}