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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>Certificate extensions for v4 template schema</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ExtensionsV4 {
/// <p>The key usage extension defines the purpose (e.g., encipherment, signature) of the key contained in the certificate.</p>
pub key_usage: ::std::option::Option<crate::types::KeyUsage>,
/// <p>Application policies specify what the certificate is used for and its purpose.</p>
pub application_policies: ::std::option::Option<crate::types::ApplicationPolicies>,
}
impl ExtensionsV4 {
/// <p>The key usage extension defines the purpose (e.g., encipherment, signature) of the key contained in the certificate.</p>
pub fn key_usage(&self) -> ::std::option::Option<&crate::types::KeyUsage> {
self.key_usage.as_ref()
}
/// <p>Application policies specify what the certificate is used for and its purpose.</p>
pub fn application_policies(&self) -> ::std::option::Option<&crate::types::ApplicationPolicies> {
self.application_policies.as_ref()
}
}
impl ExtensionsV4 {
/// Creates a new builder-style object to manufacture [`ExtensionsV4`](crate::types::ExtensionsV4).
pub fn builder() -> crate::types::builders::ExtensionsV4Builder {
crate::types::builders::ExtensionsV4Builder::default()
}
}
/// A builder for [`ExtensionsV4`](crate::types::ExtensionsV4).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ExtensionsV4Builder {
pub(crate) key_usage: ::std::option::Option<crate::types::KeyUsage>,
pub(crate) application_policies: ::std::option::Option<crate::types::ApplicationPolicies>,
}
impl ExtensionsV4Builder {
/// <p>The key usage extension defines the purpose (e.g., encipherment, signature) of the key contained in the certificate.</p>
/// This field is required.
pub fn key_usage(mut self, input: crate::types::KeyUsage) -> Self {
self.key_usage = ::std::option::Option::Some(input);
self
}
/// <p>The key usage extension defines the purpose (e.g., encipherment, signature) of the key contained in the certificate.</p>
pub fn set_key_usage(mut self, input: ::std::option::Option<crate::types::KeyUsage>) -> Self {
self.key_usage = input;
self
}
/// <p>The key usage extension defines the purpose (e.g., encipherment, signature) of the key contained in the certificate.</p>
pub fn get_key_usage(&self) -> &::std::option::Option<crate::types::KeyUsage> {
&self.key_usage
}
/// <p>Application policies specify what the certificate is used for and its purpose.</p>
pub fn application_policies(mut self, input: crate::types::ApplicationPolicies) -> Self {
self.application_policies = ::std::option::Option::Some(input);
self
}
/// <p>Application policies specify what the certificate is used for and its purpose.</p>
pub fn set_application_policies(mut self, input: ::std::option::Option<crate::types::ApplicationPolicies>) -> Self {
self.application_policies = input;
self
}
/// <p>Application policies specify what the certificate is used for and its purpose.</p>
pub fn get_application_policies(&self) -> &::std::option::Option<crate::types::ApplicationPolicies> {
&self.application_policies
}
/// Consumes the builder and constructs a [`ExtensionsV4`](crate::types::ExtensionsV4).
pub fn build(self) -> crate::types::ExtensionsV4 {
crate::types::ExtensionsV4 {
key_usage: self.key_usage,
application_policies: self.application_policies,
}
}
}