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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285
// 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)]
pub struct CreateServiceTemplateVersionInput {
/// <p>When included, if two identical requests are made with the same client token, Proton returns the service template version that the first request created.</p>
pub client_token: ::std::option::Option<::std::string::String>,
/// <p>The name of the service template.</p>
pub template_name: ::std::option::Option<::std::string::String>,
/// <p>A description of the new version of a service template.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
/// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
pub major_version: ::std::option::Option<::std::string::String>,
/// <p>An object that includes the template bundle S3 bucket path and name for the new version of a service template.</p>
pub source: ::std::option::Option<crate::types::TemplateVersionSourceInput>,
/// <p>An array of environment template objects that are compatible with the new service template version. A service instance based on this service template version can run in environments based on compatible templates.</p>
pub compatible_environment_templates: ::std::option::Option<::std::vec::Vec<crate::types::CompatibleEnvironmentTemplateInput>>,
/// <p>An optional list of metadata items that you can associate with the Proton service template version. A tag is a key-value pair.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
/// <p>An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.</p>
/// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
pub supported_component_sources: ::std::option::Option<::std::vec::Vec<crate::types::ServiceTemplateSupportedComponentSourceType>>,
}
impl CreateServiceTemplateVersionInput {
/// <p>When included, if two identical requests are made with the same client token, Proton returns the service template version that the first request created.</p>
pub fn client_token(&self) -> ::std::option::Option<&str> {
self.client_token.as_deref()
}
/// <p>The name of the service template.</p>
pub fn template_name(&self) -> ::std::option::Option<&str> {
self.template_name.as_deref()
}
/// <p>A description of the new version of a service template.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
/// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
pub fn major_version(&self) -> ::std::option::Option<&str> {
self.major_version.as_deref()
}
/// <p>An object that includes the template bundle S3 bucket path and name for the new version of a service template.</p>
pub fn source(&self) -> ::std::option::Option<&crate::types::TemplateVersionSourceInput> {
self.source.as_ref()
}
/// <p>An array of environment template objects that are compatible with the new service template version. A service instance based on this service template version can run in environments based on compatible templates.</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 `.compatible_environment_templates.is_none()`.
pub fn compatible_environment_templates(&self) -> &[crate::types::CompatibleEnvironmentTemplateInput] {
self.compatible_environment_templates.as_deref().unwrap_or_default()
}
/// <p>An optional list of metadata items that you can associate with the Proton service template version. A tag is a key-value pair.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</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 `.tags.is_none()`.
pub fn tags(&self) -> &[crate::types::Tag] {
self.tags.as_deref().unwrap_or_default()
}
/// <p>An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.</p>
/// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</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 `.supported_component_sources.is_none()`.
pub fn supported_component_sources(&self) -> &[crate::types::ServiceTemplateSupportedComponentSourceType] {
self.supported_component_sources.as_deref().unwrap_or_default()
}
}
impl ::std::fmt::Debug for CreateServiceTemplateVersionInput {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreateServiceTemplateVersionInput");
formatter.field("client_token", &self.client_token);
formatter.field("template_name", &self.template_name);
formatter.field("description", &"*** Sensitive Data Redacted ***");
formatter.field("major_version", &self.major_version);
formatter.field("source", &self.source);
formatter.field("compatible_environment_templates", &self.compatible_environment_templates);
formatter.field("tags", &self.tags);
formatter.field("supported_component_sources", &self.supported_component_sources);
formatter.finish()
}
}
impl CreateServiceTemplateVersionInput {
/// Creates a new builder-style object to manufacture [`CreateServiceTemplateVersionInput`](crate::operation::create_service_template_version::CreateServiceTemplateVersionInput).
pub fn builder() -> crate::operation::create_service_template_version::builders::CreateServiceTemplateVersionInputBuilder {
crate::operation::create_service_template_version::builders::CreateServiceTemplateVersionInputBuilder::default()
}
}
/// A builder for [`CreateServiceTemplateVersionInput`](crate::operation::create_service_template_version::CreateServiceTemplateVersionInput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
pub struct CreateServiceTemplateVersionInputBuilder {
pub(crate) client_token: ::std::option::Option<::std::string::String>,
pub(crate) template_name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) major_version: ::std::option::Option<::std::string::String>,
pub(crate) source: ::std::option::Option<crate::types::TemplateVersionSourceInput>,
pub(crate) compatible_environment_templates: ::std::option::Option<::std::vec::Vec<crate::types::CompatibleEnvironmentTemplateInput>>,
pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) supported_component_sources: ::std::option::Option<::std::vec::Vec<crate::types::ServiceTemplateSupportedComponentSourceType>>,
}
impl CreateServiceTemplateVersionInputBuilder {
/// <p>When included, if two identical requests are made with the same client token, Proton returns the service template version that the first request created.</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>When included, if two identical requests are made with the same client token, Proton returns the service template version that the first request created.</p>
pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.client_token = input;
self
}
/// <p>When included, if two identical requests are made with the same client token, Proton returns the service template version that the first request created.</p>
pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
&self.client_token
}
/// <p>The name of the service template.</p>
/// This field is required.
pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.template_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the service template.</p>
pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.template_name = input;
self
}
/// <p>The name of the service template.</p>
pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
&self.template_name
}
/// <p>A description of the new version of a service template.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>A description of the new version of a service template.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>A description of the new version of a service template.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
/// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
pub fn major_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.major_version = ::std::option::Option::Some(input.into());
self
}
/// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
/// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
pub fn set_major_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.major_version = input;
self
}
/// <p>To create a new minor version of the service template, include a <code>major Version</code>.</p>
/// <p>To create a new major and minor version of the service template, <i>exclude</i> <code>major Version</code>.</p>
pub fn get_major_version(&self) -> &::std::option::Option<::std::string::String> {
&self.major_version
}
/// <p>An object that includes the template bundle S3 bucket path and name for the new version of a service template.</p>
/// This field is required.
pub fn source(mut self, input: crate::types::TemplateVersionSourceInput) -> Self {
self.source = ::std::option::Option::Some(input);
self
}
/// <p>An object that includes the template bundle S3 bucket path and name for the new version of a service template.</p>
pub fn set_source(mut self, input: ::std::option::Option<crate::types::TemplateVersionSourceInput>) -> Self {
self.source = input;
self
}
/// <p>An object that includes the template bundle S3 bucket path and name for the new version of a service template.</p>
pub fn get_source(&self) -> &::std::option::Option<crate::types::TemplateVersionSourceInput> {
&self.source
}
/// Appends an item to `compatible_environment_templates`.
///
/// To override the contents of this collection use [`set_compatible_environment_templates`](Self::set_compatible_environment_templates).
///
/// <p>An array of environment template objects that are compatible with the new service template version. A service instance based on this service template version can run in environments based on compatible templates.</p>
pub fn compatible_environment_templates(mut self, input: crate::types::CompatibleEnvironmentTemplateInput) -> Self {
let mut v = self.compatible_environment_templates.unwrap_or_default();
v.push(input);
self.compatible_environment_templates = ::std::option::Option::Some(v);
self
}
/// <p>An array of environment template objects that are compatible with the new service template version. A service instance based on this service template version can run in environments based on compatible templates.</p>
pub fn set_compatible_environment_templates(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::CompatibleEnvironmentTemplateInput>>,
) -> Self {
self.compatible_environment_templates = input;
self
}
/// <p>An array of environment template objects that are compatible with the new service template version. A service instance based on this service template version can run in environments based on compatible templates.</p>
pub fn get_compatible_environment_templates(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CompatibleEnvironmentTemplateInput>> {
&self.compatible_environment_templates
}
/// Appends an item to `tags`.
///
/// To override the contents of this collection use [`set_tags`](Self::set_tags).
///
/// <p>An optional list of metadata items that you can associate with the Proton service template version. A tag is a key-value pair.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
pub fn tags(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = ::std::option::Option::Some(v);
self
}
/// <p>An optional list of metadata items that you can associate with the Proton service template version. A tag is a key-value pair.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags = input;
self
}
/// <p>An optional list of metadata items that you can associate with the Proton service template version. A tag is a key-value pair.</p>
/// <p>For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/resources.html">Proton resources and tagging</a> in the <i>Proton User Guide</i>.</p>
pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags
}
/// Appends an item to `supported_component_sources`.
///
/// To override the contents of this collection use [`set_supported_component_sources`](Self::set_supported_component_sources).
///
/// <p>An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.</p>
/// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
pub fn supported_component_sources(mut self, input: crate::types::ServiceTemplateSupportedComponentSourceType) -> Self {
let mut v = self.supported_component_sources.unwrap_or_default();
v.push(input);
self.supported_component_sources = ::std::option::Option::Some(v);
self
}
/// <p>An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.</p>
/// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
pub fn set_supported_component_sources(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::ServiceTemplateSupportedComponentSourceType>>,
) -> Self {
self.supported_component_sources = input;
self
}
/// <p>An array of supported component sources. Components with supported sources can be attached to service instances based on this service template version.</p>
/// <p>For more information about components, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-components.html">Proton components</a> in the <i>Proton User Guide</i>.</p>
pub fn get_supported_component_sources(
&self,
) -> &::std::option::Option<::std::vec::Vec<crate::types::ServiceTemplateSupportedComponentSourceType>> {
&self.supported_component_sources
}
/// Consumes the builder and constructs a [`CreateServiceTemplateVersionInput`](crate::operation::create_service_template_version::CreateServiceTemplateVersionInput).
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::create_service_template_version::CreateServiceTemplateVersionInput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(crate::operation::create_service_template_version::CreateServiceTemplateVersionInput {
client_token: self.client_token,
template_name: self.template_name,
description: self.description,
major_version: self.major_version,
source: self.source,
compatible_environment_templates: self.compatible_environment_templates,
tags: self.tags,
supported_component_sources: self.supported_component_sources,
})
}
}
impl ::std::fmt::Debug for CreateServiceTemplateVersionInputBuilder {
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
let mut formatter = f.debug_struct("CreateServiceTemplateVersionInputBuilder");
formatter.field("client_token", &self.client_token);
formatter.field("template_name", &self.template_name);
formatter.field("description", &"*** Sensitive Data Redacted ***");
formatter.field("major_version", &self.major_version);
formatter.field("source", &self.source);
formatter.field("compatible_environment_templates", &self.compatible_environment_templates);
formatter.field("tags", &self.tags);
formatter.field("supported_component_sources", &self.supported_component_sources);
formatter.finish()
}
}