aws-sdk-devopsagent 1.4.0

AWS SDK for AWS DevOps Agent Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// Output containing the Private Connection details.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribePrivateConnectionOutput {
    /// The name of the Private Connection.
    pub name: ::std::string::String,
    /// The type of the Private Connection.
    pub r#type: crate::types::PrivateConnectionType,
    /// The service-managed Resource Gateway ARN. Only present for service-managed Private Connections.
    pub resource_gateway_id: ::std::option::Option<::std::string::String>,
    /// IP address or DNS name of the target resource. Only present for service-managed Private Connections.
    pub host_address: ::std::option::Option<::std::string::String>,
    /// VPC identifier of the service-managed Resource Gateway. Only present for service-managed Private Connections.
    pub vpc_id: ::std::option::Option<::std::string::String>,
    /// The Resource Configuration ARN. Only present for self-managed Private Connections.
    pub resource_configuration_id: ::std::option::Option<::std::string::String>,
    /// The status of the Private Connection.
    pub status: crate::types::PrivateConnectionStatus,
    /// The expiry time of the certificate associated with the Private Connection. Only present when a certificate is associated.
    pub certificate_expiry_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// Tags associated with the Private Connection.
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl DescribePrivateConnectionOutput {
    /// The name of the Private Connection.
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// The type of the Private Connection.
    pub fn r#type(&self) -> &crate::types::PrivateConnectionType {
        &self.r#type
    }
    /// The service-managed Resource Gateway ARN. Only present for service-managed Private Connections.
    pub fn resource_gateway_id(&self) -> ::std::option::Option<&str> {
        self.resource_gateway_id.as_deref()
    }
    /// IP address or DNS name of the target resource. Only present for service-managed Private Connections.
    pub fn host_address(&self) -> ::std::option::Option<&str> {
        self.host_address.as_deref()
    }
    /// VPC identifier of the service-managed Resource Gateway. Only present for service-managed Private Connections.
    pub fn vpc_id(&self) -> ::std::option::Option<&str> {
        self.vpc_id.as_deref()
    }
    /// The Resource Configuration ARN. Only present for self-managed Private Connections.
    pub fn resource_configuration_id(&self) -> ::std::option::Option<&str> {
        self.resource_configuration_id.as_deref()
    }
    /// The status of the Private Connection.
    pub fn status(&self) -> &crate::types::PrivateConnectionStatus {
        &self.status
    }
    /// The expiry time of the certificate associated with the Private Connection. Only present when a certificate is associated.
    pub fn certificate_expiry_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.certificate_expiry_time.as_ref()
    }
    /// Tags associated with the Private Connection.
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for DescribePrivateConnectionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DescribePrivateConnectionOutput {
    /// Creates a new builder-style object to manufacture [`DescribePrivateConnectionOutput`](crate::operation::describe_private_connection::DescribePrivateConnectionOutput).
    pub fn builder() -> crate::operation::describe_private_connection::builders::DescribePrivateConnectionOutputBuilder {
        crate::operation::describe_private_connection::builders::DescribePrivateConnectionOutputBuilder::default()
    }
}

/// A builder for [`DescribePrivateConnectionOutput`](crate::operation::describe_private_connection::DescribePrivateConnectionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribePrivateConnectionOutputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) r#type: ::std::option::Option<crate::types::PrivateConnectionType>,
    pub(crate) resource_gateway_id: ::std::option::Option<::std::string::String>,
    pub(crate) host_address: ::std::option::Option<::std::string::String>,
    pub(crate) vpc_id: ::std::option::Option<::std::string::String>,
    pub(crate) resource_configuration_id: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::PrivateConnectionStatus>,
    pub(crate) certificate_expiry_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    _request_id: Option<String>,
}
impl DescribePrivateConnectionOutputBuilder {
    /// The name of the Private Connection.
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// The name of the Private Connection.
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// The name of the Private Connection.
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// The type of the Private Connection.
    /// This field is required.
    pub fn r#type(mut self, input: crate::types::PrivateConnectionType) -> Self {
        self.r#type = ::std::option::Option::Some(input);
        self
    }
    /// The type of the Private Connection.
    pub fn set_type(mut self, input: ::std::option::Option<crate::types::PrivateConnectionType>) -> Self {
        self.r#type = input;
        self
    }
    /// The type of the Private Connection.
    pub fn get_type(&self) -> &::std::option::Option<crate::types::PrivateConnectionType> {
        &self.r#type
    }
    /// The service-managed Resource Gateway ARN. Only present for service-managed Private Connections.
    pub fn resource_gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_gateway_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The service-managed Resource Gateway ARN. Only present for service-managed Private Connections.
    pub fn set_resource_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_gateway_id = input;
        self
    }
    /// The service-managed Resource Gateway ARN. Only present for service-managed Private Connections.
    pub fn get_resource_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_gateway_id
    }
    /// IP address or DNS name of the target resource. Only present for service-managed Private Connections.
    pub fn host_address(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.host_address = ::std::option::Option::Some(input.into());
        self
    }
    /// IP address or DNS name of the target resource. Only present for service-managed Private Connections.
    pub fn set_host_address(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.host_address = input;
        self
    }
    /// IP address or DNS name of the target resource. Only present for service-managed Private Connections.
    pub fn get_host_address(&self) -> &::std::option::Option<::std::string::String> {
        &self.host_address
    }
    /// VPC identifier of the service-managed Resource Gateway. Only present for service-managed Private Connections.
    pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.vpc_id = ::std::option::Option::Some(input.into());
        self
    }
    /// VPC identifier of the service-managed Resource Gateway. Only present for service-managed Private Connections.
    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.vpc_id = input;
        self
    }
    /// VPC identifier of the service-managed Resource Gateway. Only present for service-managed Private Connections.
    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.vpc_id
    }
    /// The Resource Configuration ARN. Only present for self-managed Private Connections.
    pub fn resource_configuration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_configuration_id = ::std::option::Option::Some(input.into());
        self
    }
    /// The Resource Configuration ARN. Only present for self-managed Private Connections.
    pub fn set_resource_configuration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_configuration_id = input;
        self
    }
    /// The Resource Configuration ARN. Only present for self-managed Private Connections.
    pub fn get_resource_configuration_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_configuration_id
    }
    /// The status of the Private Connection.
    /// This field is required.
    pub fn status(mut self, input: crate::types::PrivateConnectionStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// The status of the Private Connection.
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::PrivateConnectionStatus>) -> Self {
        self.status = input;
        self
    }
    /// The status of the Private Connection.
    pub fn get_status(&self) -> &::std::option::Option<crate::types::PrivateConnectionStatus> {
        &self.status
    }
    /// The expiry time of the certificate associated with the Private Connection. Only present when a certificate is associated.
    pub fn certificate_expiry_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.certificate_expiry_time = ::std::option::Option::Some(input);
        self
    }
    /// The expiry time of the certificate associated with the Private Connection. Only present when a certificate is associated.
    pub fn set_certificate_expiry_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.certificate_expiry_time = input;
        self
    }
    /// The expiry time of the certificate associated with the Private Connection. Only present when a certificate is associated.
    pub fn get_certificate_expiry_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.certificate_expiry_time
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// Tags associated with the Private Connection.
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// Tags associated with the Private Connection.
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// Tags associated with the Private Connection.
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`DescribePrivateConnectionOutput`](crate::operation::describe_private_connection::DescribePrivateConnectionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::operation::describe_private_connection::builders::DescribePrivateConnectionOutputBuilder::name)
    /// - [`r#type`](crate::operation::describe_private_connection::builders::DescribePrivateConnectionOutputBuilder::type)
    /// - [`status`](crate::operation::describe_private_connection::builders::DescribePrivateConnectionOutputBuilder::status)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::describe_private_connection::DescribePrivateConnectionOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::describe_private_connection::DescribePrivateConnectionOutput {
            name: self.name.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "name",
                    "name was not specified but it is required when building DescribePrivateConnectionOutput",
                )
            })?,
            r#type: self.r#type.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "r#type",
                    "r#type was not specified but it is required when building DescribePrivateConnectionOutput",
                )
            })?,
            resource_gateway_id: self.resource_gateway_id,
            host_address: self.host_address,
            vpc_id: self.vpc_id,
            resource_configuration_id: self.resource_configuration_id,
            status: self.status.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "status",
                    "status was not specified but it is required when building DescribePrivateConnectionOutput",
                )
            })?,
            certificate_expiry_time: self.certificate_expiry_time,
            tags: self.tags,
            _request_id: self._request_id,
        })
    }
}