aws_sdk_verifiedpermissions/operation/create_policy/_create_policy_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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
// 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 CreatePolicyInput {
/// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value.</a>.</p>
/// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
/// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>ConflictException</code> error.</p>
/// <p>Verified Permissions recognizes a <code>ClientToken</code> for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of <code>ClientToken</code>.</p>
pub client_token: ::std::option::Option<::std::string::String>,
/// <p>Specifies the <code>PolicyStoreId</code> of the policy store you want to store the policy in.</p>
pub policy_store_id: ::std::option::Option<::std::string::String>,
/// <p>A structure that specifies the policy type and content to use for the new policy. You must include either a static or a templateLinked element. The policy content must be written in the Cedar policy language.</p>
pub definition: ::std::option::Option<crate::types::PolicyDefinition>,
}
impl CreatePolicyInput {
/// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value.</a>.</p>
/// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
/// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>ConflictException</code> error.</p>
/// <p>Verified Permissions recognizes a <code>ClientToken</code> for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of <code>ClientToken</code>.</p>
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
/// <p>Specifies the <code>PolicyStoreId</code> of the policy store you want to store the policy in.</p>
pub fn policy_store_id(&self) -> ::std::option::Option<&str> {
self.policy_store_id.as_deref()
}
/// <p>A structure that specifies the policy type and content to use for the new policy. You must include either a static or a templateLinked element. The policy content must be written in the Cedar policy language.</p>
pub fn definition(&self) -> ::std::option::Option<&crate::types::PolicyDefinition> {
self.definition.as_ref()
}
}
impl CreatePolicyInput {
/// Creates a new builder-style object to manufacture [`CreatePolicyInput`](crate::operation::create_policy::CreatePolicyInput).
pub fn builder() -> crate::operation::create_policy::builders::CreatePolicyInputBuilder {
crate::operation::create_policy::builders::CreatePolicyInputBuilder::default()
}
}
/// A builder for [`CreatePolicyInput`](crate::operation::create_policy::CreatePolicyInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreatePolicyInputBuilder {
pub(crate) client_token: ::std::option::Option<::std::string::String>,
pub(crate) policy_store_id: ::std::option::Option<::std::string::String>,
pub(crate) definition: ::std::option::Option<crate::types::PolicyDefinition>,
}
impl CreatePolicyInputBuilder {
/// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value.</a>.</p>
/// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
/// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>ConflictException</code> error.</p>
/// <p>Verified Permissions recognizes a <code>ClientToken</code> for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of <code>ClientToken</code>.</p>
pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.client_token = ::std::option::Option::Some(input.into());
self
}
/// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value.</a>.</p>
/// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
/// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>ConflictException</code> error.</p>
/// <p>Verified Permissions recognizes a <code>ClientToken</code> for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of <code>ClientToken</code>.</p>
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
/// <p>Specifies a unique, case-sensitive ID that you provide to ensure the idempotency of the request. This lets you safely retry the request without accidentally performing the same operation a second time. Passing the same value to a later call to an operation requires that you also pass the same value for all other parameters. We recommend that you use a <a href="https://wikipedia.org/wiki/Universally_unique_identifier">UUID type of value.</a>.</p>
/// <p>If you don't provide this value, then Amazon Web Services generates a random one for you.</p>
/// <p>If you retry the operation with the same <code>ClientToken</code>, but with different parameters, the retry fails with an <code>ConflictException</code> error.</p>
/// <p>Verified Permissions recognizes a <code>ClientToken</code> for eight hours. After eight hours, the next request with the same parameters performs the operation again regardless of the value of <code>ClientToken</code>.</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
/// <p>Specifies the <code>PolicyStoreId</code> of the policy store you want to store the policy in.</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 <code>PolicyStoreId</code> of the policy store you want to store the policy in.</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 <code>PolicyStoreId</code> of the policy store you want to store the policy in.</p>
pub fn get_policy_store_id(&self) -> &::std::option::Option<::std::string::String> {
&self.policy_store_id
}
/// <p>A structure that specifies the policy type and content to use for the new policy. You must include either a static or a templateLinked element. The policy content must be written in the Cedar policy language.</p>
/// This field is required.
pub fn definition(mut self, input: crate::types::PolicyDefinition) -> Self {
self.definition = ::std::option::Option::Some(input);
self
}
/// <p>A structure that specifies the policy type and content to use for the new policy. You must include either a static or a templateLinked element. The policy content must be written in the Cedar policy language.</p>
pub fn set_definition(mut self, input: ::std::option::Option<crate::types::PolicyDefinition>) -> Self {
self.definition = input;
self
}
/// <p>A structure that specifies the policy type and content to use for the new policy. You must include either a static or a templateLinked element. The policy content must be written in the Cedar policy language.</p>
pub fn get_definition(&self) -> &::std::option::Option<crate::types::PolicyDefinition> {
&self.definition
}
/// Consumes the builder and constructs a [`CreatePolicyInput`](crate::operation::create_policy::CreatePolicyInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_policy::CreatePolicyInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_policy::CreatePolicyInput {
client_token: self.client_token,
policy_store_id: self.policy_store_id,
definition: self.definition,
})
}
}