aws_sdk_verifiedpermissions/operation/put_schema/
_put_schema_output.rs#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutSchemaOutput {
pub policy_store_id: ::std::string::String,
pub namespaces: ::std::vec::Vec<::std::string::String>,
pub created_date: ::aws_smithy_types::DateTime,
pub last_updated_date: ::aws_smithy_types::DateTime,
_request_id: Option<String>,
}
impl PutSchemaOutput {
pub fn policy_store_id(&self) -> &str {
use std::ops::Deref;
self.policy_store_id.deref()
}
pub fn namespaces(&self) -> &[::std::string::String] {
use std::ops::Deref;
self.namespaces.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
}
}
impl ::aws_types::request_id::RequestId for PutSchemaOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl PutSchemaOutput {
pub fn builder() -> crate::operation::put_schema::builders::PutSchemaOutputBuilder {
crate::operation::put_schema::builders::PutSchemaOutputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutSchemaOutputBuilder {
pub(crate) policy_store_id: ::std::option::Option<::std::string::String>,
pub(crate) namespaces: ::std::option::Option<::std::vec::Vec<::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>,
_request_id: Option<String>,
}
impl PutSchemaOutputBuilder {
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 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 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(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::put_schema::PutSchemaOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::put_schema::PutSchemaOutput {
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 PutSchemaOutput",
)
})?,
namespaces: self.namespaces.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"namespaces",
"namespaces was not specified but it is required when building PutSchemaOutput",
)
})?,
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 PutSchemaOutput",
)
})?,
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 PutSchemaOutput",
)
})?,
_request_id: self._request_id,
})
}
}