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 113 114 115
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>The input for an <code>EstimateTemplateCost</code> action.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct EstimateTemplateCostInput {
/// <p>Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. (For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>.)</p>
/// <p>Conditional: You must pass <code>TemplateBody</code> or <code>TemplateURL</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
pub template_body: ::std::option::Option<::std::string::String>,
/// <p>Location of file containing the template body. The URL must point to a template that's located in an Amazon S3 bucket or a Systems Manager document. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>. The location for an Amazon S3 bucket must start with <code>https://</code>.</p>
/// <p>Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
pub template_url: ::std::option::Option<::std::string::String>,
/// <p>A list of <code>Parameter</code> structures that specify input parameters.</p>
pub parameters: ::std::option::Option<::std::vec::Vec<crate::types::Parameter>>,
}
impl EstimateTemplateCostInput {
/// <p>Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. (For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>.)</p>
/// <p>Conditional: You must pass <code>TemplateBody</code> or <code>TemplateURL</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
pub fn template_body(&self) -> ::std::option::Option<&str> {
self.template_body.as_deref()
}
/// <p>Location of file containing the template body. The URL must point to a template that's located in an Amazon S3 bucket or a Systems Manager document. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>. The location for an Amazon S3 bucket must start with <code>https://</code>.</p>
/// <p>Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
pub fn template_url(&self) -> ::std::option::Option<&str> {
self.template_url.as_deref()
}
/// <p>A list of <code>Parameter</code> structures that specify input parameters.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.parameters.is_none()`.
pub fn parameters(&self) -> &[crate::types::Parameter] {
self.parameters.as_deref().unwrap_or_default()
}
}
impl EstimateTemplateCostInput {
/// Creates a new builder-style object to manufacture [`EstimateTemplateCostInput`](crate::operation::estimate_template_cost::EstimateTemplateCostInput).
pub fn builder() -> crate::operation::estimate_template_cost::builders::EstimateTemplateCostInputBuilder {
crate::operation::estimate_template_cost::builders::EstimateTemplateCostInputBuilder::default()
}
}
/// A builder for [`EstimateTemplateCostInput`](crate::operation::estimate_template_cost::EstimateTemplateCostInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct EstimateTemplateCostInputBuilder {
pub(crate) template_body: ::std::option::Option<::std::string::String>,
pub(crate) template_url: ::std::option::Option<::std::string::String>,
pub(crate) parameters: ::std::option::Option<::std::vec::Vec<crate::types::Parameter>>,
}
impl EstimateTemplateCostInputBuilder {
/// <p>Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. (For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>.)</p>
/// <p>Conditional: You must pass <code>TemplateBody</code> or <code>TemplateURL</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
pub fn template_body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.template_body = ::std::option::Option::Some(input.into());
self
}
/// <p>Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. (For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>.)</p>
/// <p>Conditional: You must pass <code>TemplateBody</code> or <code>TemplateURL</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
pub fn set_template_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.template_body = input;
self
}
/// <p>Structure containing the template body with a minimum length of 1 byte and a maximum length of 51,200 bytes. (For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>.)</p>
/// <p>Conditional: You must pass <code>TemplateBody</code> or <code>TemplateURL</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
pub fn get_template_body(&self) -> &::std::option::Option<::std::string::String> {
&self.template_body
}
/// <p>Location of file containing the template body. The URL must point to a template that's located in an Amazon S3 bucket or a Systems Manager document. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>. The location for an Amazon S3 bucket must start with <code>https://</code>.</p>
/// <p>Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
pub fn template_url(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.template_url = ::std::option::Option::Some(input.into());
self
}
/// <p>Location of file containing the template body. The URL must point to a template that's located in an Amazon S3 bucket or a Systems Manager document. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>. The location for an Amazon S3 bucket must start with <code>https://</code>.</p>
/// <p>Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
pub fn set_template_url(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.template_url = input;
self
}
/// <p>Location of file containing the template body. The URL must point to a template that's located in an Amazon S3 bucket or a Systems Manager document. For more information, go to <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html">Template Anatomy</a> in the <i>CloudFormation User Guide</i>. The location for an Amazon S3 bucket must start with <code>https://</code>.</p>
/// <p>Conditional: You must pass <code>TemplateURL</code> or <code>TemplateBody</code>. If both are passed, only <code>TemplateBody</code> is used.</p>
pub fn get_template_url(&self) -> &::std::option::Option<::std::string::String> {
&self.template_url
}
/// Appends an item to `parameters`.
///
/// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
///
/// <p>A list of <code>Parameter</code> structures that specify input parameters.</p>
pub fn parameters(mut self, input: crate::types::Parameter) -> Self {
let mut v = self.parameters.unwrap_or_default();
v.push(input);
self.parameters = ::std::option::Option::Some(v);
self
}
/// <p>A list of <code>Parameter</code> structures that specify input parameters.</p>
pub fn set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Parameter>>) -> Self {
self.parameters = input;
self
}
/// <p>A list of <code>Parameter</code> structures that specify input parameters.</p>
pub fn get_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Parameter>> {
&self.parameters
}
/// Consumes the builder and constructs a [`EstimateTemplateCostInput`](crate::operation::estimate_template_cost::EstimateTemplateCostInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::estimate_template_cost::EstimateTemplateCostInput, ::aws_smithy_types::error::operation::BuildError>
{
::std::result::Result::Ok(crate::operation::estimate_template_cost::EstimateTemplateCostInput {
template_body: self.template_body,
template_url: self.template_url,
parameters: self.parameters,
})
}
}