aws_sdk_verifiedpermissions/operation/put_schema/
_put_schema_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct PutSchemaOutput {
6    /// <p>The unique ID of the policy store that contains the schema.</p>
7    pub policy_store_id: ::std::string::String,
8    /// <p>Identifies the namespaces of the entities referenced by this schema.</p>
9    pub namespaces: ::std::vec::Vec<::std::string::String>,
10    /// <p>The date and time that the schema was originally created.</p>
11    pub created_date: ::aws_smithy_types::DateTime,
12    /// <p>The date and time that the schema was last updated.</p>
13    pub last_updated_date: ::aws_smithy_types::DateTime,
14    _request_id: Option<String>,
15}
16impl PutSchemaOutput {
17    /// <p>The unique ID of the policy store that contains the schema.</p>
18    pub fn policy_store_id(&self) -> &str {
19        use std::ops::Deref;
20        self.policy_store_id.deref()
21    }
22    /// <p>Identifies the namespaces of the entities referenced by this schema.</p>
23    pub fn namespaces(&self) -> &[::std::string::String] {
24        use std::ops::Deref;
25        self.namespaces.deref()
26    }
27    /// <p>The date and time that the schema was originally created.</p>
28    pub fn created_date(&self) -> &::aws_smithy_types::DateTime {
29        &self.created_date
30    }
31    /// <p>The date and time that the schema was last updated.</p>
32    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    /// Creates a new builder-style object to manufacture [`PutSchemaOutput`](crate::operation::put_schema::PutSchemaOutput).
43    pub fn builder() -> crate::operation::put_schema::builders::PutSchemaOutputBuilder {
44        crate::operation::put_schema::builders::PutSchemaOutputBuilder::default()
45    }
46}
47
48/// A builder for [`PutSchemaOutput`](crate::operation::put_schema::PutSchemaOutput).
49#[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    /// <p>The unique ID of the policy store that contains the schema.</p>
60    /// This field is required.
61    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    /// <p>The unique ID of the policy store that contains the schema.</p>
66    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    /// <p>The unique ID of the policy store that contains the schema.</p>
71    pub fn get_policy_store_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.policy_store_id
73    }
74    /// Appends an item to `namespaces`.
75    ///
76    /// To override the contents of this collection use [`set_namespaces`](Self::set_namespaces).
77    ///
78    /// <p>Identifies the namespaces of the entities referenced by this schema.</p>
79    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    /// <p>Identifies the namespaces of the entities referenced by this schema.</p>
86    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    /// <p>Identifies the namespaces of the entities referenced by this schema.</p>
91    pub fn get_namespaces(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
92        &self.namespaces
93    }
94    /// <p>The date and time that the schema was originally created.</p>
95    /// This field is required.
96    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    /// <p>The date and time that the schema was originally created.</p>
101    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    /// <p>The date and time that the schema was originally created.</p>
106    pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
107        &self.created_date
108    }
109    /// <p>The date and time that the schema was last updated.</p>
110    /// This field is required.
111    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    /// <p>The date and time that the schema was last updated.</p>
116    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    /// <p>The date and time that the schema was last updated.</p>
121    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    /// Consumes the builder and constructs a [`PutSchemaOutput`](crate::operation::put_schema::PutSchemaOutput).
134    /// This method will fail if any of the following fields are not set:
135    /// - [`policy_store_id`](crate::operation::put_schema::builders::PutSchemaOutputBuilder::policy_store_id)
136    /// - [`namespaces`](crate::operation::put_schema::builders::PutSchemaOutputBuilder::namespaces)
137    /// - [`created_date`](crate::operation::put_schema::builders::PutSchemaOutputBuilder::created_date)
138    /// - [`last_updated_date`](crate::operation::put_schema::builders::PutSchemaOutputBuilder::last_updated_date)
139    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}