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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>An object that represents a local file certificate. The certificate must meet specific requirements and you must have proxy authorization enabled. For more information, see <a href="https://docs.aws.amazon.com/app-mesh/latest/userguide/tls.html#virtual-node-tls-prerequisites">Transport Layer Security (TLS)</a>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct VirtualGatewayListenerTlsFileCertificate {
/// <p>The certificate chain for the certificate.</p>
pub certificate_chain: ::std::string::String,
/// <p>The private key for a certificate stored on the file system of the mesh endpoint that the proxy is running on.</p>
pub private_key: ::std::string::String,
}
impl VirtualGatewayListenerTlsFileCertificate {
/// <p>The certificate chain for the certificate.</p>
pub fn certificate_chain(&self) -> &str {
use std::ops::Deref;
self.certificate_chain.deref()
}
/// <p>The private key for a certificate stored on the file system of the mesh endpoint that the proxy is running on.</p>
pub fn private_key(&self) -> &str {
use std::ops::Deref;
self.private_key.deref()
}
}
impl VirtualGatewayListenerTlsFileCertificate {
/// Creates a new builder-style object to manufacture [`VirtualGatewayListenerTlsFileCertificate`](crate::types::VirtualGatewayListenerTlsFileCertificate).
pub fn builder() -> crate::types::builders::VirtualGatewayListenerTlsFileCertificateBuilder {
crate::types::builders::VirtualGatewayListenerTlsFileCertificateBuilder::default()
}
}
/// A builder for [`VirtualGatewayListenerTlsFileCertificate`](crate::types::VirtualGatewayListenerTlsFileCertificate).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct VirtualGatewayListenerTlsFileCertificateBuilder {
pub(crate) certificate_chain: ::std::option::Option<::std::string::String>,
pub(crate) private_key: ::std::option::Option<::std::string::String>,
}
impl VirtualGatewayListenerTlsFileCertificateBuilder {
/// <p>The certificate chain for the certificate.</p>
/// This field is required.
pub fn certificate_chain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.certificate_chain = ::std::option::Option::Some(input.into());
self
}
/// <p>The certificate chain for the certificate.</p>
pub fn set_certificate_chain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.certificate_chain = input;
self
}
/// <p>The certificate chain for the certificate.</p>
pub fn get_certificate_chain(&self) -> &::std::option::Option<::std::string::String> {
&self.certificate_chain
}
/// <p>The private key for a certificate stored on the file system of the mesh endpoint that the proxy is running on.</p>
/// This field is required.
pub fn private_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.private_key = ::std::option::Option::Some(input.into());
self
}
/// <p>The private key for a certificate stored on the file system of the mesh endpoint that the proxy is running on.</p>
pub fn set_private_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.private_key = input;
self
}
/// <p>The private key for a certificate stored on the file system of the mesh endpoint that the proxy is running on.</p>
pub fn get_private_key(&self) -> &::std::option::Option<::std::string::String> {
&self.private_key
}
/// Consumes the builder and constructs a [`VirtualGatewayListenerTlsFileCertificate`](crate::types::VirtualGatewayListenerTlsFileCertificate).
/// This method will fail if any of the following fields are not set:
/// - [`certificate_chain`](crate::types::builders::VirtualGatewayListenerTlsFileCertificateBuilder::certificate_chain)
/// - [`private_key`](crate::types::builders::VirtualGatewayListenerTlsFileCertificateBuilder::private_key)
pub fn build(
self,
) -> ::std::result::Result<crate::types::VirtualGatewayListenerTlsFileCertificate, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::VirtualGatewayListenerTlsFileCertificate {
certificate_chain: self.certificate_chain.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"certificate_chain",
"certificate_chain was not specified but it is required when building VirtualGatewayListenerTlsFileCertificate",
)
})?,
private_key: self.private_key.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"private_key",
"private_key was not specified but it is required when building VirtualGatewayListenerTlsFileCertificate",
)
})?,
})
}
}