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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The input for the <code>SetStackPolicy</code> action.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SetStackPolicyInput {
/// <p>The name or unique stack ID that you want to associate a policy with.</p>
pub stack_name: ::std::option::Option<::std::string::String>,
/// <p>Structure containing the stack policy body. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html"> Prevent updates to stack resources</a> in the <i>CloudFormation User Guide</i>. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code> parameter, but not both.</p>
pub stack_policy_body: ::std::option::Option<::std::string::String>,
/// <p>Location of a file containing the stack policy. The URL must point to a policy (maximum size: 16 KB) located in an Amazon S3 bucket in the same Amazon Web Services Region as the stack. The location for an Amazon S3 bucket must start with <code>https://</code>. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code> parameter, but not both.</p>
pub stack_policy_url: ::std::option::Option<::std::string::String>,
}
impl SetStackPolicyInput {
/// <p>The name or unique stack ID that you want to associate a policy with.</p>
pub fn stack_name(&self) -> ::std::option::Option<&str> {
self.stack_name.as_deref()
}
/// <p>Structure containing the stack policy body. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html"> Prevent updates to stack resources</a> in the <i>CloudFormation User Guide</i>. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code> parameter, but not both.</p>
pub fn stack_policy_body(&self) -> ::std::option::Option<&str> {
self.stack_policy_body.as_deref()
}
/// <p>Location of a file containing the stack policy. The URL must point to a policy (maximum size: 16 KB) located in an Amazon S3 bucket in the same Amazon Web Services Region as the stack. The location for an Amazon S3 bucket must start with <code>https://</code>. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code> parameter, but not both.</p>
pub fn stack_policy_url(&self) -> ::std::option::Option<&str> {
self.stack_policy_url.as_deref()
}
}
impl SetStackPolicyInput {
/// Creates a new builder-style object to manufacture [`SetStackPolicyInput`](crate::operation::set_stack_policy::SetStackPolicyInput).
pub fn builder() -> crate::operation::set_stack_policy::builders::SetStackPolicyInputBuilder {
crate::operation::set_stack_policy::builders::SetStackPolicyInputBuilder::default()
}
}
/// A builder for [`SetStackPolicyInput`](crate::operation::set_stack_policy::SetStackPolicyInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct SetStackPolicyInputBuilder {
pub(crate) stack_name: ::std::option::Option<::std::string::String>,
pub(crate) stack_policy_body: ::std::option::Option<::std::string::String>,
pub(crate) stack_policy_url: ::std::option::Option<::std::string::String>,
}
impl SetStackPolicyInputBuilder {
/// <p>The name or unique stack ID that you want to associate a policy with.</p>
/// This field is required.
pub fn stack_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.stack_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name or unique stack ID that you want to associate a policy with.</p>
pub fn set_stack_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.stack_name = input;
self
}
/// <p>The name or unique stack ID that you want to associate a policy with.</p>
pub fn get_stack_name(&self) -> &::std::option::Option<::std::string::String> {
&self.stack_name
}
/// <p>Structure containing the stack policy body. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html"> Prevent updates to stack resources</a> in the <i>CloudFormation User Guide</i>. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code> parameter, but not both.</p>
pub fn stack_policy_body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.stack_policy_body = ::std::option::Option::Some(input.into());
self
}
/// <p>Structure containing the stack policy body. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html"> Prevent updates to stack resources</a> in the <i>CloudFormation User Guide</i>. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code> parameter, but not both.</p>
pub fn set_stack_policy_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.stack_policy_body = input;
self
}
/// <p>Structure containing the stack policy body. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/protect-stack-resources.html"> Prevent updates to stack resources</a> in the <i>CloudFormation User Guide</i>. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code> parameter, but not both.</p>
pub fn get_stack_policy_body(&self) -> &::std::option::Option<::std::string::String> {
&self.stack_policy_body
}
/// <p>Location of a file containing the stack policy. The URL must point to a policy (maximum size: 16 KB) located in an Amazon S3 bucket in the same Amazon Web Services Region as the stack. The location for an Amazon S3 bucket must start with <code>https://</code>. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code> parameter, but not both.</p>
pub fn stack_policy_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.stack_policy_url = ::std::option::Option::Some(input.into());
self
}
/// <p>Location of a file containing the stack policy. The URL must point to a policy (maximum size: 16 KB) located in an Amazon S3 bucket in the same Amazon Web Services Region as the stack. The location for an Amazon S3 bucket must start with <code>https://</code>. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code> parameter, but not both.</p>
pub fn set_stack_policy_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.stack_policy_url = input;
self
}
/// <p>Location of a file containing the stack policy. The URL must point to a policy (maximum size: 16 KB) located in an Amazon S3 bucket in the same Amazon Web Services Region as the stack. The location for an Amazon S3 bucket must start with <code>https://</code>. You can specify either the <code>StackPolicyBody</code> or the <code>StackPolicyURL</code> parameter, but not both.</p>
pub fn get_stack_policy_url(&self) -> &::std::option::Option<::std::string::String> {
&self.stack_policy_url
}
/// Consumes the builder and constructs a [`SetStackPolicyInput`](crate::operation::set_stack_policy::SetStackPolicyInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::set_stack_policy::SetStackPolicyInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::set_stack_policy::SetStackPolicyInput {
stack_name: self.stack_name,
stack_policy_body: self.stack_policy_body,
stack_policy_url: self.stack_policy_url,
})
}
}