Skip to main content

aws_sdk_cloudtrail/types/
_public_key.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains information about a returned public key.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PublicKey {
7    /// <p>The DER encoded public key value in PKCS#1 format.</p>
8    pub value: ::std::option::Option<::aws_smithy_types::Blob>,
9    /// <p>The starting time of validity of the public key.</p>
10    pub validity_start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
11    /// <p>The ending time of validity of the public key.</p>
12    pub validity_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
13    /// <p>The fingerprint of the public key.</p>
14    pub fingerprint: ::std::option::Option<::std::string::String>,
15}
16impl PublicKey {
17    /// <p>The DER encoded public key value in PKCS#1 format.</p>
18    pub fn value(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
19        self.value.as_ref()
20    }
21    /// <p>The starting time of validity of the public key.</p>
22    pub fn validity_start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
23        self.validity_start_time.as_ref()
24    }
25    /// <p>The ending time of validity of the public key.</p>
26    pub fn validity_end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
27        self.validity_end_time.as_ref()
28    }
29    /// <p>The fingerprint of the public key.</p>
30    pub fn fingerprint(&self) -> ::std::option::Option<&str> {
31        self.fingerprint.as_deref()
32    }
33}
34impl PublicKey {
35    /// Creates a new builder-style object to manufacture [`PublicKey`](crate::types::PublicKey).
36    pub fn builder() -> crate::types::builders::PublicKeyBuilder {
37        crate::types::builders::PublicKeyBuilder::default()
38    }
39}
40
41/// A builder for [`PublicKey`](crate::types::PublicKey).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct PublicKeyBuilder {
45    pub(crate) value: ::std::option::Option<::aws_smithy_types::Blob>,
46    pub(crate) validity_start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
47    pub(crate) validity_end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
48    pub(crate) fingerprint: ::std::option::Option<::std::string::String>,
49}
50impl PublicKeyBuilder {
51    /// <p>The DER encoded public key value in PKCS#1 format.</p>
52    pub fn value(mut self, input: ::aws_smithy_types::Blob) -> Self {
53        self.value = ::std::option::Option::Some(input);
54        self
55    }
56    /// <p>The DER encoded public key value in PKCS#1 format.</p>
57    pub fn set_value(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
58        self.value = input;
59        self
60    }
61    /// <p>The DER encoded public key value in PKCS#1 format.</p>
62    pub fn get_value(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
63        &self.value
64    }
65    /// <p>The starting time of validity of the public key.</p>
66    pub fn validity_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
67        self.validity_start_time = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The starting time of validity of the public key.</p>
71    pub fn set_validity_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
72        self.validity_start_time = input;
73        self
74    }
75    /// <p>The starting time of validity of the public key.</p>
76    pub fn get_validity_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
77        &self.validity_start_time
78    }
79    /// <p>The ending time of validity of the public key.</p>
80    pub fn validity_end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
81        self.validity_end_time = ::std::option::Option::Some(input);
82        self
83    }
84    /// <p>The ending time of validity of the public key.</p>
85    pub fn set_validity_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
86        self.validity_end_time = input;
87        self
88    }
89    /// <p>The ending time of validity of the public key.</p>
90    pub fn get_validity_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
91        &self.validity_end_time
92    }
93    /// <p>The fingerprint of the public key.</p>
94    pub fn fingerprint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.fingerprint = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>The fingerprint of the public key.</p>
99    pub fn set_fingerprint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.fingerprint = input;
101        self
102    }
103    /// <p>The fingerprint of the public key.</p>
104    pub fn get_fingerprint(&self) -> &::std::option::Option<::std::string::String> {
105        &self.fingerprint
106    }
107    /// Consumes the builder and constructs a [`PublicKey`](crate::types::PublicKey).
108    pub fn build(self) -> crate::types::PublicKey {
109        crate::types::PublicKey {
110            value: self.value,
111            validity_start_time: self.validity_start_time,
112            validity_end_time: self.validity_end_time,
113            fingerprint: self.fingerprint,
114        }
115    }
116}