aws_sdk_proton/operation/create_service/
_create_service_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateServiceInput {
6    /// <p>The service name.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>A description of the Proton service.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the service template that's used to create the service.</p>
11    pub template_name: ::std::option::Option<::std::string::String>,
12    /// <p>The major version of the service template that was used to create the service.</p>
13    pub template_major_version: ::std::option::Option<::std::string::String>,
14    /// <p>The minor version of the service template that was used to create the service.</p>
15    pub template_minor_version: ::std::option::Option<::std::string::String>,
16    /// <p>A link to a spec file that provides inputs as defined in the service template bundle schema file. The spec file is in YAML format. <i>Don’t</i> include pipeline inputs in the spec if your service template <i>doesn’t</i> include a service pipeline. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-create-svc.html">Create a service</a> in the <i>Proton User Guide</i>.</p>
17    pub spec: ::std::option::Option<::std::string::String>,
18    /// <p>The Amazon Resource Name (ARN) of the repository connection. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol">Setting up an AWS CodeStar connection</a> in the <i>Proton User Guide</i>. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
19    pub repository_connection_arn: ::std::option::Option<::std::string::String>,
20    /// <p>The ID of the code repository. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
21    pub repository_id: ::std::option::Option<::std::string::String>,
22    /// <p>The name of the code repository branch that holds the code that's deployed in Proton. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
23    pub branch_name: ::std::option::Option<::std::string::String>,
24    /// <p>An optional list of metadata items that you can associate with the Proton service. A tag is a key-value pair.</p>
25    /// <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>
26    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
27}
28impl CreateServiceInput {
29    /// <p>The service name.</p>
30    pub fn name(&self) -> ::std::option::Option<&str> {
31        self.name.as_deref()
32    }
33    /// <p>A description of the Proton service.</p>
34    pub fn description(&self) -> ::std::option::Option<&str> {
35        self.description.as_deref()
36    }
37    /// <p>The name of the service template that's used to create the service.</p>
38    pub fn template_name(&self) -> ::std::option::Option<&str> {
39        self.template_name.as_deref()
40    }
41    /// <p>The major version of the service template that was used to create the service.</p>
42    pub fn template_major_version(&self) -> ::std::option::Option<&str> {
43        self.template_major_version.as_deref()
44    }
45    /// <p>The minor version of the service template that was used to create the service.</p>
46    pub fn template_minor_version(&self) -> ::std::option::Option<&str> {
47        self.template_minor_version.as_deref()
48    }
49    /// <p>A link to a spec file that provides inputs as defined in the service template bundle schema file. The spec file is in YAML format. <i>Don’t</i> include pipeline inputs in the spec if your service template <i>doesn’t</i> include a service pipeline. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-create-svc.html">Create a service</a> in the <i>Proton User Guide</i>.</p>
50    pub fn spec(&self) -> ::std::option::Option<&str> {
51        self.spec.as_deref()
52    }
53    /// <p>The Amazon Resource Name (ARN) of the repository connection. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol">Setting up an AWS CodeStar connection</a> in the <i>Proton User Guide</i>. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
54    pub fn repository_connection_arn(&self) -> ::std::option::Option<&str> {
55        self.repository_connection_arn.as_deref()
56    }
57    /// <p>The ID of the code repository. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
58    pub fn repository_id(&self) -> ::std::option::Option<&str> {
59        self.repository_id.as_deref()
60    }
61    /// <p>The name of the code repository branch that holds the code that's deployed in Proton. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
62    pub fn branch_name(&self) -> ::std::option::Option<&str> {
63        self.branch_name.as_deref()
64    }
65    /// <p>An optional list of metadata items that you can associate with the Proton service. A tag is a key-value pair.</p>
66    /// <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>
67    ///
68    /// 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()`.
69    pub fn tags(&self) -> &[crate::types::Tag] {
70        self.tags.as_deref().unwrap_or_default()
71    }
72}
73impl ::std::fmt::Debug for CreateServiceInput {
74    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
75        let mut formatter = f.debug_struct("CreateServiceInput");
76        formatter.field("name", &self.name);
77        formatter.field("description", &"*** Sensitive Data Redacted ***");
78        formatter.field("template_name", &self.template_name);
79        formatter.field("template_major_version", &self.template_major_version);
80        formatter.field("template_minor_version", &self.template_minor_version);
81        formatter.field("spec", &"*** Sensitive Data Redacted ***");
82        formatter.field("repository_connection_arn", &self.repository_connection_arn);
83        formatter.field("repository_id", &self.repository_id);
84        formatter.field("branch_name", &self.branch_name);
85        formatter.field("tags", &self.tags);
86        formatter.finish()
87    }
88}
89impl CreateServiceInput {
90    /// Creates a new builder-style object to manufacture [`CreateServiceInput`](crate::operation::create_service::CreateServiceInput).
91    pub fn builder() -> crate::operation::create_service::builders::CreateServiceInputBuilder {
92        crate::operation::create_service::builders::CreateServiceInputBuilder::default()
93    }
94}
95
96/// A builder for [`CreateServiceInput`](crate::operation::create_service::CreateServiceInput).
97#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
98#[non_exhaustive]
99pub struct CreateServiceInputBuilder {
100    pub(crate) name: ::std::option::Option<::std::string::String>,
101    pub(crate) description: ::std::option::Option<::std::string::String>,
102    pub(crate) template_name: ::std::option::Option<::std::string::String>,
103    pub(crate) template_major_version: ::std::option::Option<::std::string::String>,
104    pub(crate) template_minor_version: ::std::option::Option<::std::string::String>,
105    pub(crate) spec: ::std::option::Option<::std::string::String>,
106    pub(crate) repository_connection_arn: ::std::option::Option<::std::string::String>,
107    pub(crate) repository_id: ::std::option::Option<::std::string::String>,
108    pub(crate) branch_name: ::std::option::Option<::std::string::String>,
109    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
110}
111impl CreateServiceInputBuilder {
112    /// <p>The service name.</p>
113    /// This field is required.
114    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.name = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>The service name.</p>
119    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.name = input;
121        self
122    }
123    /// <p>The service name.</p>
124    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
125        &self.name
126    }
127    /// <p>A description of the Proton service.</p>
128    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.description = ::std::option::Option::Some(input.into());
130        self
131    }
132    /// <p>A description of the Proton service.</p>
133    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.description = input;
135        self
136    }
137    /// <p>A description of the Proton service.</p>
138    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
139        &self.description
140    }
141    /// <p>The name of the service template that's used to create the service.</p>
142    /// This field is required.
143    pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.template_name = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>The name of the service template that's used to create the service.</p>
148    pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.template_name = input;
150        self
151    }
152    /// <p>The name of the service template that's used to create the service.</p>
153    pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
154        &self.template_name
155    }
156    /// <p>The major version of the service template that was used to create the service.</p>
157    /// This field is required.
158    pub fn template_major_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.template_major_version = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>The major version of the service template that was used to create the service.</p>
163    pub fn set_template_major_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.template_major_version = input;
165        self
166    }
167    /// <p>The major version of the service template that was used to create the service.</p>
168    pub fn get_template_major_version(&self) -> &::std::option::Option<::std::string::String> {
169        &self.template_major_version
170    }
171    /// <p>The minor version of the service template that was used to create the service.</p>
172    pub fn template_minor_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.template_minor_version = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The minor version of the service template that was used to create the service.</p>
177    pub fn set_template_minor_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.template_minor_version = input;
179        self
180    }
181    /// <p>The minor version of the service template that was used to create the service.</p>
182    pub fn get_template_minor_version(&self) -> &::std::option::Option<::std::string::String> {
183        &self.template_minor_version
184    }
185    /// <p>A link to a spec file that provides inputs as defined in the service template bundle schema file. The spec file is in YAML format. <i>Don’t</i> include pipeline inputs in the spec if your service template <i>doesn’t</i> include a service pipeline. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-create-svc.html">Create a service</a> in the <i>Proton User Guide</i>.</p>
186    /// This field is required.
187    pub fn spec(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.spec = ::std::option::Option::Some(input.into());
189        self
190    }
191    /// <p>A link to a spec file that provides inputs as defined in the service template bundle schema file. The spec file is in YAML format. <i>Don’t</i> include pipeline inputs in the spec if your service template <i>doesn’t</i> include a service pipeline. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-create-svc.html">Create a service</a> in the <i>Proton User Guide</i>.</p>
192    pub fn set_spec(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.spec = input;
194        self
195    }
196    /// <p>A link to a spec file that provides inputs as defined in the service template bundle schema file. The spec file is in YAML format. <i>Don’t</i> include pipeline inputs in the spec if your service template <i>doesn’t</i> include a service pipeline. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/ag-create-svc.html">Create a service</a> in the <i>Proton User Guide</i>.</p>
197    pub fn get_spec(&self) -> &::std::option::Option<::std::string::String> {
198        &self.spec
199    }
200    /// <p>The Amazon Resource Name (ARN) of the repository connection. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol">Setting up an AWS CodeStar connection</a> in the <i>Proton User Guide</i>. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
201    pub fn repository_connection_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.repository_connection_arn = ::std::option::Option::Some(input.into());
203        self
204    }
205    /// <p>The Amazon Resource Name (ARN) of the repository connection. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol">Setting up an AWS CodeStar connection</a> in the <i>Proton User Guide</i>. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
206    pub fn set_repository_connection_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207        self.repository_connection_arn = input;
208        self
209    }
210    /// <p>The Amazon Resource Name (ARN) of the repository connection. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html#setting-up-vcontrol">Setting up an AWS CodeStar connection</a> in the <i>Proton User Guide</i>. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
211    pub fn get_repository_connection_arn(&self) -> &::std::option::Option<::std::string::String> {
212        &self.repository_connection_arn
213    }
214    /// <p>The ID of the code repository. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
215    pub fn repository_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216        self.repository_id = ::std::option::Option::Some(input.into());
217        self
218    }
219    /// <p>The ID of the code repository. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
220    pub fn set_repository_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221        self.repository_id = input;
222        self
223    }
224    /// <p>The ID of the code repository. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
225    pub fn get_repository_id(&self) -> &::std::option::Option<::std::string::String> {
226        &self.repository_id
227    }
228    /// <p>The name of the code repository branch that holds the code that's deployed in Proton. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
229    pub fn branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.branch_name = ::std::option::Option::Some(input.into());
231        self
232    }
233    /// <p>The name of the code repository branch that holds the code that's deployed in Proton. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
234    pub fn set_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.branch_name = input;
236        self
237    }
238    /// <p>The name of the code repository branch that holds the code that's deployed in Proton. <i>Don't</i> include this parameter if your service template <i>doesn't</i> include a service pipeline.</p>
239    pub fn get_branch_name(&self) -> &::std::option::Option<::std::string::String> {
240        &self.branch_name
241    }
242    /// Appends an item to `tags`.
243    ///
244    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
245    ///
246    /// <p>An optional list of metadata items that you can associate with the Proton service. A tag is a key-value pair.</p>
247    /// <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>
248    pub fn tags(mut self, input: crate::types::Tag) -> Self {
249        let mut v = self.tags.unwrap_or_default();
250        v.push(input);
251        self.tags = ::std::option::Option::Some(v);
252        self
253    }
254    /// <p>An optional list of metadata items that you can associate with the Proton service. A tag is a key-value pair.</p>
255    /// <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>
256    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
257        self.tags = input;
258        self
259    }
260    /// <p>An optional list of metadata items that you can associate with the Proton service. A tag is a key-value pair.</p>
261    /// <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>
262    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
263        &self.tags
264    }
265    /// Consumes the builder and constructs a [`CreateServiceInput`](crate::operation::create_service::CreateServiceInput).
266    pub fn build(
267        self,
268    ) -> ::std::result::Result<crate::operation::create_service::CreateServiceInput, ::aws_smithy_types::error::operation::BuildError> {
269        ::std::result::Result::Ok(crate::operation::create_service::CreateServiceInput {
270            name: self.name,
271            description: self.description,
272            template_name: self.template_name,
273            template_major_version: self.template_major_version,
274            template_minor_version: self.template_minor_version,
275            spec: self.spec,
276            repository_connection_arn: self.repository_connection_arn,
277            repository_id: self.repository_id,
278            branch_name: self.branch_name,
279            tags: self.tags,
280        })
281    }
282}
283impl ::std::fmt::Debug for CreateServiceInputBuilder {
284    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
285        let mut formatter = f.debug_struct("CreateServiceInputBuilder");
286        formatter.field("name", &self.name);
287        formatter.field("description", &"*** Sensitive Data Redacted ***");
288        formatter.field("template_name", &self.template_name);
289        formatter.field("template_major_version", &self.template_major_version);
290        formatter.field("template_minor_version", &self.template_minor_version);
291        formatter.field("spec", &"*** Sensitive Data Redacted ***");
292        formatter.field("repository_connection_arn", &self.repository_connection_arn);
293        formatter.field("repository_id", &self.repository_id);
294        formatter.field("branch_name", &self.branch_name);
295        formatter.field("tags", &self.tags);
296        formatter.finish()
297    }
298}