aws_sdk_verifiedpermissions/operation/put_schema/
_put_schema_input.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct PutSchemaInput {
    /// <p>Specifies the ID of the policy store in which to place the schema.</p>
    pub policy_store_id: ::std::option::Option<::std::string::String>,
    /// <p>Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.</p>
    pub definition: ::std::option::Option<crate::types::SchemaDefinition>,
}
impl PutSchemaInput {
    /// <p>Specifies the ID of the policy store in which to place the schema.</p>
    pub fn policy_store_id(&self) -> ::std::option::Option<&str> {
        self.policy_store_id.as_deref()
    }
    /// <p>Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.</p>
    pub fn definition(&self) -> ::std::option::Option<&crate::types::SchemaDefinition> {
        self.definition.as_ref()
    }
}
impl PutSchemaInput {
    /// Creates a new builder-style object to manufacture [`PutSchemaInput`](crate::operation::put_schema::PutSchemaInput).
    pub fn builder() -> crate::operation::put_schema::builders::PutSchemaInputBuilder {
        crate::operation::put_schema::builders::PutSchemaInputBuilder::default()
    }
}

/// A builder for [`PutSchemaInput`](crate::operation::put_schema::PutSchemaInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PutSchemaInputBuilder {
    pub(crate) policy_store_id: ::std::option::Option<::std::string::String>,
    pub(crate) definition: ::std::option::Option<crate::types::SchemaDefinition>,
}
impl PutSchemaInputBuilder {
    /// <p>Specifies the ID of the policy store in which to place the schema.</p>
    /// This field is required.
    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
    }
    /// <p>Specifies the ID of the policy store in which to place the schema.</p>
    pub fn set_policy_store_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.policy_store_id = input;
        self
    }
    /// <p>Specifies the ID of the policy store in which to place the schema.</p>
    pub fn get_policy_store_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.policy_store_id
    }
    /// <p>Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.</p>
    /// This field is required.
    pub fn definition(mut self, input: crate::types::SchemaDefinition) -> Self {
        self.definition = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.</p>
    pub fn set_definition(mut self, input: ::std::option::Option<crate::types::SchemaDefinition>) -> Self {
        self.definition = input;
        self
    }
    /// <p>Specifies the definition of the schema to be stored. The schema definition must be written in Cedar schema JSON.</p>
    pub fn get_definition(&self) -> &::std::option::Option<crate::types::SchemaDefinition> {
        &self.definition
    }
    /// Consumes the builder and constructs a [`PutSchemaInput`](crate::operation::put_schema::PutSchemaInput).
    pub fn build(self) -> ::std::result::Result<crate::operation::put_schema::PutSchemaInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::put_schema::PutSchemaInput {
            policy_store_id: self.policy_store_id,
            definition: self.definition,
        })
    }
}