aws_sdk_proton/operation/create_repository/_create_repository_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, ::std::fmt::Debug)]
5pub struct CreateRepositoryInput {
6 /// <p>The repository provider.</p>
7 pub provider: ::std::option::Option<crate::types::RepositoryProvider>,
8 /// <p>The repository name (for example, <code>myrepos/myrepo</code>).</p>
9 pub name: ::std::option::Option<::std::string::String>,
10 /// <p>The Amazon Resource Name (ARN) of your AWS CodeStar connection that connects Proton to your repository provider account. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html">Setting up for Proton</a> in the <i>Proton User Guide</i>.</p>
11 pub connection_arn: ::std::option::Option<::std::string::String>,
12 /// <p>The ARN of your customer Amazon Web Services Key Management Service (Amazon Web Services KMS) key.</p>
13 pub encryption_key: ::std::option::Option<::std::string::String>,
14 /// <p>An optional list of metadata items that you can associate with the Proton repository. A tag is a key-value pair.</p>
15 /// <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>
16 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
17}
18impl CreateRepositoryInput {
19 /// <p>The repository provider.</p>
20 pub fn provider(&self) -> ::std::option::Option<&crate::types::RepositoryProvider> {
21 self.provider.as_ref()
22 }
23 /// <p>The repository name (for example, <code>myrepos/myrepo</code>).</p>
24 pub fn name(&self) -> ::std::option::Option<&str> {
25 self.name.as_deref()
26 }
27 /// <p>The Amazon Resource Name (ARN) of your AWS CodeStar connection that connects Proton to your repository provider account. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html">Setting up for Proton</a> in the <i>Proton User Guide</i>.</p>
28 pub fn connection_arn(&self) -> ::std::option::Option<&str> {
29 self.connection_arn.as_deref()
30 }
31 /// <p>The ARN of your customer Amazon Web Services Key Management Service (Amazon Web Services KMS) key.</p>
32 pub fn encryption_key(&self) -> ::std::option::Option<&str> {
33 self.encryption_key.as_deref()
34 }
35 /// <p>An optional list of metadata items that you can associate with the Proton repository. A tag is a key-value pair.</p>
36 /// <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>
37 ///
38 /// 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()`.
39 pub fn tags(&self) -> &[crate::types::Tag] {
40 self.tags.as_deref().unwrap_or_default()
41 }
42}
43impl CreateRepositoryInput {
44 /// Creates a new builder-style object to manufacture [`CreateRepositoryInput`](crate::operation::create_repository::CreateRepositoryInput).
45 pub fn builder() -> crate::operation::create_repository::builders::CreateRepositoryInputBuilder {
46 crate::operation::create_repository::builders::CreateRepositoryInputBuilder::default()
47 }
48}
49
50/// A builder for [`CreateRepositoryInput`](crate::operation::create_repository::CreateRepositoryInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct CreateRepositoryInputBuilder {
54 pub(crate) provider: ::std::option::Option<crate::types::RepositoryProvider>,
55 pub(crate) name: ::std::option::Option<::std::string::String>,
56 pub(crate) connection_arn: ::std::option::Option<::std::string::String>,
57 pub(crate) encryption_key: ::std::option::Option<::std::string::String>,
58 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
59}
60impl CreateRepositoryInputBuilder {
61 /// <p>The repository provider.</p>
62 /// This field is required.
63 pub fn provider(mut self, input: crate::types::RepositoryProvider) -> Self {
64 self.provider = ::std::option::Option::Some(input);
65 self
66 }
67 /// <p>The repository provider.</p>
68 pub fn set_provider(mut self, input: ::std::option::Option<crate::types::RepositoryProvider>) -> Self {
69 self.provider = input;
70 self
71 }
72 /// <p>The repository provider.</p>
73 pub fn get_provider(&self) -> &::std::option::Option<crate::types::RepositoryProvider> {
74 &self.provider
75 }
76 /// <p>The repository name (for example, <code>myrepos/myrepo</code>).</p>
77 /// This field is required.
78 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79 self.name = ::std::option::Option::Some(input.into());
80 self
81 }
82 /// <p>The repository name (for example, <code>myrepos/myrepo</code>).</p>
83 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84 self.name = input;
85 self
86 }
87 /// <p>The repository name (for example, <code>myrepos/myrepo</code>).</p>
88 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
89 &self.name
90 }
91 /// <p>The Amazon Resource Name (ARN) of your AWS CodeStar connection that connects Proton to your repository provider account. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html">Setting up for Proton</a> in the <i>Proton User Guide</i>.</p>
92 /// This field is required.
93 pub fn connection_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94 self.connection_arn = ::std::option::Option::Some(input.into());
95 self
96 }
97 /// <p>The Amazon Resource Name (ARN) of your AWS CodeStar connection that connects Proton to your repository provider account. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html">Setting up for Proton</a> in the <i>Proton User Guide</i>.</p>
98 pub fn set_connection_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
99 self.connection_arn = input;
100 self
101 }
102 /// <p>The Amazon Resource Name (ARN) of your AWS CodeStar connection that connects Proton to your repository provider account. For more information, see <a href="https://docs.aws.amazon.com/proton/latest/userguide/setting-up-for-service.html">Setting up for Proton</a> in the <i>Proton User Guide</i>.</p>
103 pub fn get_connection_arn(&self) -> &::std::option::Option<::std::string::String> {
104 &self.connection_arn
105 }
106 /// <p>The ARN of your customer Amazon Web Services Key Management Service (Amazon Web Services KMS) key.</p>
107 pub fn encryption_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
108 self.encryption_key = ::std::option::Option::Some(input.into());
109 self
110 }
111 /// <p>The ARN of your customer Amazon Web Services Key Management Service (Amazon Web Services KMS) key.</p>
112 pub fn set_encryption_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113 self.encryption_key = input;
114 self
115 }
116 /// <p>The ARN of your customer Amazon Web Services Key Management Service (Amazon Web Services KMS) key.</p>
117 pub fn get_encryption_key(&self) -> &::std::option::Option<::std::string::String> {
118 &self.encryption_key
119 }
120 /// Appends an item to `tags`.
121 ///
122 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
123 ///
124 /// <p>An optional list of metadata items that you can associate with the Proton repository. A tag is a key-value pair.</p>
125 /// <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>
126 pub fn tags(mut self, input: crate::types::Tag) -> Self {
127 let mut v = self.tags.unwrap_or_default();
128 v.push(input);
129 self.tags = ::std::option::Option::Some(v);
130 self
131 }
132 /// <p>An optional list of metadata items that you can associate with the Proton repository. A tag is a key-value pair.</p>
133 /// <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>
134 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
135 self.tags = input;
136 self
137 }
138 /// <p>An optional list of metadata items that you can associate with the Proton repository. A tag is a key-value pair.</p>
139 /// <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>
140 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
141 &self.tags
142 }
143 /// Consumes the builder and constructs a [`CreateRepositoryInput`](crate::operation::create_repository::CreateRepositoryInput).
144 pub fn build(
145 self,
146 ) -> ::std::result::Result<crate::operation::create_repository::CreateRepositoryInput, ::aws_smithy_types::error::operation::BuildError> {
147 ::std::result::Result::Ok(crate::operation::create_repository::CreateRepositoryInput {
148 provider: self.provider,
149 name: self.name,
150 connection_arn: self.connection_arn,
151 encryption_key: self.encryption_key,
152 tags: self.tags,
153 })
154 }
155}