aws-sdk-assurance 1.0.0

AWS SDK for AWS Assurance
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct CreateEnvironmentConnectionOutput {
    /// <p>The status of the connection. To get the other attributes of the connection, call <code>ListEnvironmentConnections</code>.</p>
    pub status: crate::types::ConnectionStatus,
    /// <p>The URL to open in a browser to approve access at GitHub or Microsoft. The response includes this URL only for a <code>github</code> or <code>sharepoint</code> connection with a status of <code>PENDING</code>. The connection becomes <code>ACTIVE</code> after you approve access.</p>
    /// <p>The response includes this URL only once. If you lose it, call <code>CreateEnvironmentConnection</code> again.</p>
    pub authorization_url: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateEnvironmentConnectionOutput {
    /// <p>The status of the connection. To get the other attributes of the connection, call <code>ListEnvironmentConnections</code>.</p>
    pub fn status(&self) -> &crate::types::ConnectionStatus {
        &self.status
    }
    /// <p>The URL to open in a browser to approve access at GitHub or Microsoft. The response includes this URL only for a <code>github</code> or <code>sharepoint</code> connection with a status of <code>PENDING</code>. The connection becomes <code>ACTIVE</code> after you approve access.</p>
    /// <p>The response includes this URL only once. If you lose it, call <code>CreateEnvironmentConnection</code> again.</p>
    pub fn authorization_url(&self) -> ::std::option::Option<&str> {
        self.authorization_url.as_deref()
    }
}
impl ::std::fmt::Debug for CreateEnvironmentConnectionOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateEnvironmentConnectionOutput");
        formatter.field("status", &self.status);
        formatter.field("authorization_url", &"*** Sensitive Data Redacted ***");
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for CreateEnvironmentConnectionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateEnvironmentConnectionOutput {
    /// Creates a new builder-style object to manufacture [`CreateEnvironmentConnectionOutput`](crate::operation::create_environment_connection::CreateEnvironmentConnectionOutput).
    pub fn builder() -> crate::operation::create_environment_connection::builders::CreateEnvironmentConnectionOutputBuilder {
        crate::operation::create_environment_connection::builders::CreateEnvironmentConnectionOutputBuilder::default()
    }
}

/// A builder for [`CreateEnvironmentConnectionOutput`](crate::operation::create_environment_connection::CreateEnvironmentConnectionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct CreateEnvironmentConnectionOutputBuilder {
    pub(crate) status: ::std::option::Option<crate::types::ConnectionStatus>,
    pub(crate) authorization_url: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateEnvironmentConnectionOutputBuilder {
    /// <p>The status of the connection. To get the other attributes of the connection, call <code>ListEnvironmentConnections</code>.</p>
    /// This field is required.
    pub fn status(mut self, input: crate::types::ConnectionStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>The status of the connection. To get the other attributes of the connection, call <code>ListEnvironmentConnections</code>.</p>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ConnectionStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>The status of the connection. To get the other attributes of the connection, call <code>ListEnvironmentConnections</code>.</p>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ConnectionStatus> {
        &self.status
    }
    /// <p>The URL to open in a browser to approve access at GitHub or Microsoft. The response includes this URL only for a <code>github</code> or <code>sharepoint</code> connection with a status of <code>PENDING</code>. The connection becomes <code>ACTIVE</code> after you approve access.</p>
    /// <p>The response includes this URL only once. If you lose it, call <code>CreateEnvironmentConnection</code> again.</p>
    pub fn authorization_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.authorization_url = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The URL to open in a browser to approve access at GitHub or Microsoft. The response includes this URL only for a <code>github</code> or <code>sharepoint</code> connection with a status of <code>PENDING</code>. The connection becomes <code>ACTIVE</code> after you approve access.</p>
    /// <p>The response includes this URL only once. If you lose it, call <code>CreateEnvironmentConnection</code> again.</p>
    pub fn set_authorization_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.authorization_url = input;
        self
    }
    /// <p>The URL to open in a browser to approve access at GitHub or Microsoft. The response includes this URL only for a <code>github</code> or <code>sharepoint</code> connection with a status of <code>PENDING</code>. The connection becomes <code>ACTIVE</code> after you approve access.</p>
    /// <p>The response includes this URL only once. If you lose it, call <code>CreateEnvironmentConnection</code> again.</p>
    pub fn get_authorization_url(&self) -> &::std::option::Option<::std::string::String> {
        &self.authorization_url
    }
    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 [`CreateEnvironmentConnectionOutput`](crate::operation::create_environment_connection::CreateEnvironmentConnectionOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`status`](crate::operation::create_environment_connection::builders::CreateEnvironmentConnectionOutputBuilder::status)
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_environment_connection::CreateEnvironmentConnectionOutput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_environment_connection::CreateEnvironmentConnectionOutput {
            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 CreateEnvironmentConnectionOutput",
                )
            })?,
            authorization_url: self.authorization_url,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for CreateEnvironmentConnectionOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("CreateEnvironmentConnectionOutputBuilder");
        formatter.field("status", &self.status);
        formatter.field("authorization_url", &"*** Sensitive Data Redacted ***");
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}