aws_sdk_verifiedpermissions/operation/get_schema/
_get_schema_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetSchemaOutput {
6 pub policy_store_id: ::std::string::String,
8 pub schema: ::std::string::String,
10 pub created_date: ::aws_smithy_types::DateTime,
12 pub last_updated_date: ::aws_smithy_types::DateTime,
14 pub namespaces: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16 _request_id: Option<String>,
17}
18impl GetSchemaOutput {
19 pub fn policy_store_id(&self) -> &str {
21 use std::ops::Deref;
22 self.policy_store_id.deref()
23 }
24 pub fn schema(&self) -> &str {
26 use std::ops::Deref;
27 self.schema.deref()
28 }
29 pub fn created_date(&self) -> &::aws_smithy_types::DateTime {
31 &self.created_date
32 }
33 pub fn last_updated_date(&self) -> &::aws_smithy_types::DateTime {
35 &self.last_updated_date
36 }
37 pub fn namespaces(&self) -> &[::std::string::String] {
41 self.namespaces.as_deref().unwrap_or_default()
42 }
43}
44impl ::std::fmt::Debug for GetSchemaOutput {
45 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
46 let mut formatter = f.debug_struct("GetSchemaOutput");
47 formatter.field("policy_store_id", &self.policy_store_id);
48 formatter.field("schema", &"*** Sensitive Data Redacted ***");
49 formatter.field("created_date", &self.created_date);
50 formatter.field("last_updated_date", &self.last_updated_date);
51 formatter.field("namespaces", &"*** Sensitive Data Redacted ***");
52 formatter.field("_request_id", &self._request_id);
53 formatter.finish()
54 }
55}
56impl ::aws_types::request_id::RequestId for GetSchemaOutput {
57 fn request_id(&self) -> Option<&str> {
58 self._request_id.as_deref()
59 }
60}
61impl GetSchemaOutput {
62 pub fn builder() -> crate::operation::get_schema::builders::GetSchemaOutputBuilder {
64 crate::operation::get_schema::builders::GetSchemaOutputBuilder::default()
65 }
66}
67
68#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
70#[non_exhaustive]
71pub struct GetSchemaOutputBuilder {
72 pub(crate) policy_store_id: ::std::option::Option<::std::string::String>,
73 pub(crate) schema: ::std::option::Option<::std::string::String>,
74 pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
75 pub(crate) last_updated_date: ::std::option::Option<::aws_smithy_types::DateTime>,
76 pub(crate) namespaces: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
77 _request_id: Option<String>,
78}
79impl GetSchemaOutputBuilder {
80 pub fn policy_store_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.policy_store_id = ::std::option::Option::Some(input.into());
84 self
85 }
86 pub fn set_policy_store_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.policy_store_id = input;
89 self
90 }
91 pub fn get_policy_store_id(&self) -> &::std::option::Option<::std::string::String> {
93 &self.policy_store_id
94 }
95 pub fn schema(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98 self.schema = ::std::option::Option::Some(input.into());
99 self
100 }
101 pub fn set_schema(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103 self.schema = input;
104 self
105 }
106 pub fn get_schema(&self) -> &::std::option::Option<::std::string::String> {
108 &self.schema
109 }
110 pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
113 self.created_date = ::std::option::Option::Some(input);
114 self
115 }
116 pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
118 self.created_date = input;
119 self
120 }
121 pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
123 &self.created_date
124 }
125 pub fn last_updated_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
128 self.last_updated_date = ::std::option::Option::Some(input);
129 self
130 }
131 pub fn set_last_updated_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
133 self.last_updated_date = input;
134 self
135 }
136 pub fn get_last_updated_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
138 &self.last_updated_date
139 }
140 pub fn namespaces(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 let mut v = self.namespaces.unwrap_or_default();
147 v.push(input.into());
148 self.namespaces = ::std::option::Option::Some(v);
149 self
150 }
151 pub fn set_namespaces(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
153 self.namespaces = input;
154 self
155 }
156 pub fn get_namespaces(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
158 &self.namespaces
159 }
160 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
161 self._request_id = Some(request_id.into());
162 self
163 }
164
165 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
166 self._request_id = request_id;
167 self
168 }
169 pub fn build(self) -> ::std::result::Result<crate::operation::get_schema::GetSchemaOutput, ::aws_smithy_types::error::operation::BuildError> {
176 ::std::result::Result::Ok(crate::operation::get_schema::GetSchemaOutput {
177 policy_store_id: self.policy_store_id.ok_or_else(|| {
178 ::aws_smithy_types::error::operation::BuildError::missing_field(
179 "policy_store_id",
180 "policy_store_id was not specified but it is required when building GetSchemaOutput",
181 )
182 })?,
183 schema: self.schema.ok_or_else(|| {
184 ::aws_smithy_types::error::operation::BuildError::missing_field(
185 "schema",
186 "schema was not specified but it is required when building GetSchemaOutput",
187 )
188 })?,
189 created_date: self.created_date.ok_or_else(|| {
190 ::aws_smithy_types::error::operation::BuildError::missing_field(
191 "created_date",
192 "created_date was not specified but it is required when building GetSchemaOutput",
193 )
194 })?,
195 last_updated_date: self.last_updated_date.ok_or_else(|| {
196 ::aws_smithy_types::error::operation::BuildError::missing_field(
197 "last_updated_date",
198 "last_updated_date was not specified but it is required when building GetSchemaOutput",
199 )
200 })?,
201 namespaces: self.namespaces,
202 _request_id: self._request_id,
203 })
204 }
205}
206impl ::std::fmt::Debug for GetSchemaOutputBuilder {
207 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
208 let mut formatter = f.debug_struct("GetSchemaOutputBuilder");
209 formatter.field("policy_store_id", &self.policy_store_id);
210 formatter.field("schema", &"*** Sensitive Data Redacted ***");
211 formatter.field("created_date", &self.created_date);
212 formatter.field("last_updated_date", &self.last_updated_date);
213 formatter.field("namespaces", &"*** Sensitive Data Redacted ***");
214 formatter.field("_request_id", &self._request_id);
215 formatter.finish()
216 }
217}