aws_sdk_verifiedpermissions/operation/put_schema/
_put_schema_input.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 PutSchemaInput {
6    /// <p>Specifies the ID of the policy store in which to place the schema.</p>
7    pub policy_store_id: ::std::option::Option<::std::string::String>,
8    /// <p>Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.</p>
9    pub definition: ::std::option::Option<crate::types::SchemaDefinition>,
10}
11impl PutSchemaInput {
12    /// <p>Specifies the ID of the policy store in which to place the schema.</p>
13    pub fn policy_store_id(&self) -> ::std::option::Option<&str> {
14        self.policy_store_id.as_deref()
15    }
16    /// <p>Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.</p>
17    pub fn definition(&self) -> ::std::option::Option<&crate::types::SchemaDefinition> {
18        self.definition.as_ref()
19    }
20}
21impl PutSchemaInput {
22    /// Creates a new builder-style object to manufacture [`PutSchemaInput`](crate::operation::put_schema::PutSchemaInput).
23    pub fn builder() -> crate::operation::put_schema::builders::PutSchemaInputBuilder {
24        crate::operation::put_schema::builders::PutSchemaInputBuilder::default()
25    }
26}
27
28/// A builder for [`PutSchemaInput`](crate::operation::put_schema::PutSchemaInput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct PutSchemaInputBuilder {
32    pub(crate) policy_store_id: ::std::option::Option<::std::string::String>,
33    pub(crate) definition: ::std::option::Option<crate::types::SchemaDefinition>,
34}
35impl PutSchemaInputBuilder {
36    /// <p>Specifies the ID of the policy store in which to place the schema.</p>
37    /// This field is required.
38    pub fn policy_store_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.policy_store_id = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>Specifies the ID of the policy store in which to place the schema.</p>
43    pub fn set_policy_store_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.policy_store_id = input;
45        self
46    }
47    /// <p>Specifies the ID of the policy store in which to place the schema.</p>
48    pub fn get_policy_store_id(&self) -> &::std::option::Option<::std::string::String> {
49        &self.policy_store_id
50    }
51    /// <p>Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.</p>
52    /// This field is required.
53    pub fn definition(mut self, input: crate::types::SchemaDefinition) -> Self {
54        self.definition = ::std::option::Option::Some(input);
55        self
56    }
57    /// <p>Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.</p>
58    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::SchemaDefinition>) -> Self {
59        self.definition = input;
60        self
61    }
62    /// <p>Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.</p>
63    pub fn get_definition(&self) -> &::std::option::Option<crate::types::SchemaDefinition> {
64        &self.definition
65    }
66    /// Consumes the builder and constructs a [`PutSchemaInput`](crate::operation::put_schema::PutSchemaInput).
67    pub fn build(self) -> ::std::result::Result<crate::operation::put_schema::PutSchemaInput, ::aws_smithy_types::error::operation::BuildError> {
68        ::std::result::Result::Ok(crate::operation::put_schema::PutSchemaInput {
69            policy_store_id: self.policy_store_id,
70            definition: self.definition,
71        })
72    }
73}