aws-sdk-credentialbroker 1.0.0

AWS SDK for AWS IAM CredentialBroker
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 GetApiKeyOutput {
    /// <p>The API key. Present it to the third-party API however that API expects, commonly a header or query parameter.</p>
    pub api_key: ::std::string::String,
    _request_id: Option<String>,
}
impl GetApiKeyOutput {
    /// <p>The API key. Present it to the third-party API however that API expects, commonly a header or query parameter.</p>
    pub fn api_key(&self) -> &str {
        use std::ops::Deref;
        self.api_key.deref()
    }
}
impl ::std::fmt::Debug for GetApiKeyOutput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetApiKeyOutput");
        formatter.field("api_key", &"*** Sensitive Data Redacted ***");
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}
impl ::aws_types::request_id::RequestId for GetApiKeyOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl GetApiKeyOutput {
    /// Creates a new builder-style object to manufacture [`GetApiKeyOutput`](crate::operation::get_api_key::GetApiKeyOutput).
    pub fn builder() -> crate::operation::get_api_key::builders::GetApiKeyOutputBuilder {
        crate::operation::get_api_key::builders::GetApiKeyOutputBuilder::default()
    }
}

/// A builder for [`GetApiKeyOutput`](crate::operation::get_api_key::GetApiKeyOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetApiKeyOutputBuilder {
    pub(crate) api_key: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl GetApiKeyOutputBuilder {
    /// <p>The API key. Present it to the third-party API however that API expects, commonly a header or query parameter.</p>
    /// This field is required.
    pub fn api_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.api_key = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The API key. Present it to the third-party API however that API expects, commonly a header or query parameter.</p>
    pub fn set_api_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.api_key = input;
        self
    }
    /// <p>The API key. Present it to the third-party API however that API expects, commonly a header or query parameter.</p>
    pub fn get_api_key(&self) -> &::std::option::Option<::std::string::String> {
        &self.api_key
    }
    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 [`GetApiKeyOutput`](crate::operation::get_api_key::GetApiKeyOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`api_key`](crate::operation::get_api_key::builders::GetApiKeyOutputBuilder::api_key)
    pub fn build(self) -> ::std::result::Result<crate::operation::get_api_key::GetApiKeyOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::get_api_key::GetApiKeyOutput {
            api_key: self.api_key.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "api_key",
                    "api_key was not specified but it is required when building GetApiKeyOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}
impl ::std::fmt::Debug for GetApiKeyOutputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("GetApiKeyOutputBuilder");
        formatter.field("api_key", &"*** Sensitive Data Redacted ***");
        formatter.field("_request_id", &self._request_id);
        formatter.finish()
    }
}