aws_sdk_verifiedpermissions/operation/get_schema/
_get_schema_output.rs#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct GetSchemaOutput {
pub policy_store_id: ::std::string::String,
pub schema: ::std::string::String,
pub created_date: ::aws_smithy_types::DateTime,
pub last_updated_date: ::aws_smithy_types::DateTime,
pub namespaces: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
_request_id: Option<String>,
}
impl GetSchemaOutput {
pub fn policy_store_id(&self) -> &str {
use std::ops::Deref;
self.policy_store_id.deref()
}
pub fn schema(&self) -> &str {
use std::ops::Deref;
self.schema.deref()
}
pub fn created_date(&self) -> &::aws_smithy_types::DateTime {
&self.created_date
}
pub fn last_updated_date(&self) -> &::aws_smithy_types::DateTime {
&self.last_updated_date
}
pub fn namespaces(&self) -> &[::std::string::String] {
self.namespaces.as_deref().unwrap_or_default()
}
}
impl ::std::fmt::Debug for GetSchemaOutput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("GetSchemaOutput");
formatter.field("policy_store_id", &self.policy_store_id);
formatter.field("schema", &"*** Sensitive Data Redacted ***");
formatter.field("created_date", &self.created_date);
formatter.field("last_updated_date", &self.last_updated_date);
formatter.field("namespaces", &"*** Sensitive Data Redacted ***");
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}
impl ::aws_types::request_id::RequestId for GetSchemaOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl GetSchemaOutput {
pub fn builder() -> crate::operation::get_schema::builders::GetSchemaOutputBuilder {
crate::operation::get_schema::builders::GetSchemaOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct GetSchemaOutputBuilder {
pub(crate) policy_store_id: ::std::option::Option<::std::string::String>,
pub(crate) schema: ::std::option::Option<::std::string::String>,
pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) last_updated_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) namespaces: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
_request_id: Option<String>,
}
impl GetSchemaOutputBuilder {
pub fn policy_store_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.policy_store_id = ::std::option::Option::Some(input.into());
self
}
pub fn set_policy_store_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.policy_store_id = input;
self
}
pub fn get_policy_store_id(&self) -> &::std::option::Option<::std::string::String> {
&self.policy_store_id
}
pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.schema = ::std::option::Option::Some(input.into());
self
}
pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.schema = input;
self
}
pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
&self.schema
}
pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.created_date = ::std::option::Option::Some(input);
self
}
pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.created_date = input;
self
}
pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.created_date
}
pub fn last_updated_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.last_updated_date = ::std::option::Option::Some(input);
self
}
pub fn set_last_updated_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.last_updated_date = input;
self
}
pub fn get_last_updated_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.last_updated_date
}
pub fn namespaces(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.namespaces.unwrap_or_default();
v.push(input.into());
self.namespaces = ::std::option::Option::Some(v);
self
}
pub fn set_namespaces(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.namespaces = input;
self
}
pub fn get_namespaces(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.namespaces
}
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_schema::GetSchemaOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::get_schema::GetSchemaOutput {
policy_store_id: self.policy_store_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"policy_store_id",
"policy_store_id was not specified but it is required when building GetSchemaOutput",
)
})?,
schema: self.schema.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"schema",
"schema was not specified but it is required when building GetSchemaOutput",
)
})?,
created_date: self.created_date.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"created_date",
"created_date was not specified but it is required when building GetSchemaOutput",
)
})?,
last_updated_date: self.last_updated_date.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"last_updated_date",
"last_updated_date was not specified but it is required when building GetSchemaOutput",
)
})?,
namespaces: self.namespaces,
_request_id: self._request_id,
})
}
}
impl ::std::fmt::Debug for GetSchemaOutputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("GetSchemaOutputBuilder");
formatter.field("policy_store_id", &self.policy_store_id);
formatter.field("schema", &"*** Sensitive Data Redacted ***");
formatter.field("created_date", &self.created_date);
formatter.field("last_updated_date", &self.last_updated_date);
formatter.field("namespaces", &"*** Sensitive Data Redacted ***");
formatter.field("_request_id", &self._request_id);
formatter.finish()
}
}