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 status of the Private Connection deletion.
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DeletePrivateConnectionOutput {
    /// The name of the Private Connection.
    pub name: ::std::string::String,
    /// The status of the Private Connection.
    pub status: crate::types::PrivateConnectionStatus,
    _request_id: Option<String>,
}
impl DeletePrivateConnectionOutput {
    /// The name of the Private Connection.
    pub fn name(&self) -> &str {
        use std::ops::Deref;
        self.name.deref()
    }
    /// The status of the Private Connection.
    pub fn status(&self) -> &crate::types::PrivateConnectionStatus {
        &self.status
    }
}
impl ::aws_types::request_id::RequestId for DeletePrivateConnectionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl DeletePrivateConnectionOutput {
    /// Creates a new builder-style object to manufacture [`DeletePrivateConnectionOutput`](crate::operation::delete_private_connection::DeletePrivateConnectionOutput).
    pub fn builder() -> crate::operation::delete_private_connection::builders::DeletePrivateConnectionOutputBuilder {
        crate::operation::delete_private_connection::builders::DeletePrivateConnectionOutputBuilder::default()
    }
}

/// A builder for [`DeletePrivateConnectionOutput`](crate::operation::delete_private_connection::DeletePrivateConnectionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DeletePrivateConnectionOutputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) status: ::std::option::Option<crate::types::PrivateConnectionStatus>,
    _request_id: Option<String>,
}
impl DeletePrivateConnectionOutputBuilder {
    /// 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 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
    }
    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 [`DeletePrivateConnectionOutput`](crate::operation::delete_private_connection::DeletePrivateConnectionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`name`](crate::operation::delete_private_connection::builders::DeletePrivateConnectionOutputBuilder::name)
    /// - [`status`](crate::operation::delete_private_connection::builders::DeletePrivateConnectionOutputBuilder::status)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::delete_private_connection::DeletePrivateConnectionOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::delete_private_connection::DeletePrivateConnectionOutput {
            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 DeletePrivateConnectionOutput",
                )
            })?,
            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 DeletePrivateConnectionOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}