#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetApiKeyOutput {
pub api_key: ::std::string::String,
pub api_key_id: ::std::string::String,
pub created_at: ::aws_smithy_types::DateTime,
pub status: crate::types::ApiKeyStatus,
pub updated_at: ::aws_smithy_types::DateTime,
_request_id: Option<String>,
}
impl GetApiKeyOutput {
pub fn api_key(&self) -> &str {
use std::ops::Deref;
self.api_key.deref()
}
pub fn api_key_id(&self) -> &str {
use std::ops::Deref;
self.api_key_id.deref()
}
pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
&self.created_at
}
pub fn status(&self) -> &crate::types::ApiKeyStatus {
&self.status
}
pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
&self.updated_at
}
}
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("api_key_id", &self.api_key_id);
formatter.field("created_at", &self.created_at);
formatter.field("status", &self.status);
formatter.field("updated_at", &self.updated_at);
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 {
pub fn builder() -> crate::operation::get_api_key::builders::GetApiKeyOutputBuilder {
crate::operation::get_api_key::builders::GetApiKeyOutputBuilder::default()
}
}
#[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>,
pub(crate) api_key_id: ::std::option::Option<::std::string::String>,
pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) status: ::std::option::Option<crate::types::ApiKeyStatus>,
pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
_request_id: Option<String>,
}
impl GetApiKeyOutputBuilder {
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
}
pub fn set_api_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.api_key = input;
self
}
pub fn get_api_key(&self) -> &::std::option::Option<::std::string::String> {
&self.api_key
}
pub fn api_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.api_key_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_api_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.api_key_id = input;
self
}
pub fn get_api_key_id(&self) -> &::std::option::Option<::std::string::String> {
&self.api_key_id
}
pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_at = ::std::option::Option::Some(input);
self
}
pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_at = input;
self
}
pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_at
}
pub fn status(mut self, input: crate::types::ApiKeyStatus) -> Self {
self.status = ::std::option::Option::Some(input);
self
}
pub fn set_status(mut self, input: ::std::option::Option<crate::types::ApiKeyStatus>) -> Self {
self.status = input;
self
}
pub fn get_status(&self) -> &::std::option::Option<crate::types::ApiKeyStatus> {
&self.status
}
pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.updated_at = ::std::option::Option::Some(input);
self
}
pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.updated_at = input;
self
}
pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.updated_at
}
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
}
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",
)
})?,
api_key_id: self.api_key_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"api_key_id",
"api_key_id was not specified but it is required when building GetApiKeyOutput",
)
})?,
created_at: self.created_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_at",
"created_at was not specified but it is required when building GetApiKeyOutput",
)
})?,
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 GetApiKeyOutput",
)
})?,
updated_at: self.updated_at.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"updated_at",
"updated_at 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("api_key_id", &self.api_key_id);
formatter.field("created_at", &self.created_at);
formatter.field("status", &self.status);
formatter.field("updated_at", &self.updated_at);
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}