aws_sdk_verifiedpermissions/operation/put_schema/
_put_schema_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct PutSchemaOutput {
6 pub policy_store_id: ::std::string::String,
8 pub namespaces: ::std::vec::Vec<::std::string::String>,
10 pub created_date: ::aws_smithy_types::DateTime,
12 pub last_updated_date: ::aws_smithy_types::DateTime,
14 _request_id: Option<String>,
15}
16impl PutSchemaOutput {
17 pub fn policy_store_id(&self) -> &str {
19 use std::ops::Deref;
20 self.policy_store_id.deref()
21 }
22 pub fn namespaces(&self) -> &[::std::string::String] {
24 use std::ops::Deref;
25 self.namespaces.deref()
26 }
27 pub fn created_date(&self) -> &::aws_smithy_types::DateTime {
29 &self.created_date
30 }
31 pub fn last_updated_date(&self) -> &::aws_smithy_types::DateTime {
33 &self.last_updated_date
34 }
35}
36impl ::aws_types::request_id::RequestId for PutSchemaOutput {
37 fn request_id(&self) -> Option<&str> {
38 self._request_id.as_deref()
39 }
40}
41impl PutSchemaOutput {
42 pub fn builder() -> crate::operation::put_schema::builders::PutSchemaOutputBuilder {
44 crate::operation::put_schema::builders::PutSchemaOutputBuilder::default()
45 }
46}
47
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct PutSchemaOutputBuilder {
52 pub(crate) policy_store_id: ::std::option::Option<::std::string::String>,
53 pub(crate) namespaces: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
54 pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
55 pub(crate) last_updated_date: ::std::option::Option<::aws_smithy_types::DateTime>,
56 _request_id: Option<String>,
57}
58impl PutSchemaOutputBuilder {
59 pub fn policy_store_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.policy_store_id = ::std::option::Option::Some(input.into());
63 self
64 }
65 pub fn set_policy_store_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.policy_store_id = input;
68 self
69 }
70 pub fn get_policy_store_id(&self) -> &::std::option::Option<::std::string::String> {
72 &self.policy_store_id
73 }
74 pub fn namespaces(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80 let mut v = self.namespaces.unwrap_or_default();
81 v.push(input.into());
82 self.namespaces = ::std::option::Option::Some(v);
83 self
84 }
85 pub fn set_namespaces(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
87 self.namespaces = input;
88 self
89 }
90 pub fn get_namespaces(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
92 &self.namespaces
93 }
94 pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
97 self.created_date = ::std::option::Option::Some(input);
98 self
99 }
100 pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
102 self.created_date = input;
103 self
104 }
105 pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
107 &self.created_date
108 }
109 pub fn last_updated_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
112 self.last_updated_date = ::std::option::Option::Some(input);
113 self
114 }
115 pub fn set_last_updated_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
117 self.last_updated_date = input;
118 self
119 }
120 pub fn get_last_updated_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
122 &self.last_updated_date
123 }
124 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
125 self._request_id = Some(request_id.into());
126 self
127 }
128
129 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
130 self._request_id = request_id;
131 self
132 }
133 pub fn build(self) -> ::std::result::Result<crate::operation::put_schema::PutSchemaOutput, ::aws_smithy_types::error::operation::BuildError> {
140 ::std::result::Result::Ok(crate::operation::put_schema::PutSchemaOutput {
141 policy_store_id: self.policy_store_id.ok_or_else(|| {
142 ::aws_smithy_types::error::operation::BuildError::missing_field(
143 "policy_store_id",
144 "policy_store_id was not specified but it is required when building PutSchemaOutput",
145 )
146 })?,
147 namespaces: self.namespaces.ok_or_else(|| {
148 ::aws_smithy_types::error::operation::BuildError::missing_field(
149 "namespaces",
150 "namespaces was not specified but it is required when building PutSchemaOutput",
151 )
152 })?,
153 created_date: self.created_date.ok_or_else(|| {
154 ::aws_smithy_types::error::operation::BuildError::missing_field(
155 "created_date",
156 "created_date was not specified but it is required when building PutSchemaOutput",
157 )
158 })?,
159 last_updated_date: self.last_updated_date.ok_or_else(|| {
160 ::aws_smithy_types::error::operation::BuildError::missing_field(
161 "last_updated_date",
162 "last_updated_date was not specified but it is required when building PutSchemaOutput",
163 )
164 })?,
165 _request_id: self._request_id,
166 })
167 }
168}