aws_sdk_codeartifact/operation/delete_package/_delete_package_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 DeletePackageInput {
6 /// <p>The name of the domain that contains the package to delete.</p>
7 pub domain: ::std::option::Option<::std::string::String>,
8 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
9 pub domain_owner: ::std::option::Option<::std::string::String>,
10 /// <p>The name of the repository that contains the package to delete.</p>
11 pub repository: ::std::option::Option<::std::string::String>,
12 /// <p>The format of the requested package to delete.</p>
13 pub format: ::std::option::Option<crate::types::PackageFormat>,
14 /// <p>The namespace of the package to delete. The package component that specifies its namespace depends on its type. For example:</p><note>
15 /// <p>The namespace is required when deleting packages of the following formats:</p>
16 /// <ul>
17 /// <li>
18 /// <p>Maven</p></li>
19 /// <li>
20 /// <p>Swift</p></li>
21 /// <li>
22 /// <p>generic</p></li>
23 /// </ul>
24 /// </note>
25 /// <ul>
26 /// <li>
27 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
28 /// <li>
29 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
30 /// <li>
31 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
32 /// <li>
33 /// <p>Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.</p></li>
34 /// </ul>
35 pub namespace: ::std::option::Option<::std::string::String>,
36 /// <p>The name of the package to delete.</p>
37 pub package: ::std::option::Option<::std::string::String>,
38}
39impl DeletePackageInput {
40 /// <p>The name of the domain that contains the package to delete.</p>
41 pub fn domain(&self) -> ::std::option::Option<&str> {
42 self.domain.as_deref()
43 }
44 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
45 pub fn domain_owner(&self) -> ::std::option::Option<&str> {
46 self.domain_owner.as_deref()
47 }
48 /// <p>The name of the repository that contains the package to delete.</p>
49 pub fn repository(&self) -> ::std::option::Option<&str> {
50 self.repository.as_deref()
51 }
52 /// <p>The format of the requested package to delete.</p>
53 pub fn format(&self) -> ::std::option::Option<&crate::types::PackageFormat> {
54 self.format.as_ref()
55 }
56 /// <p>The namespace of the package to delete. The package component that specifies its namespace depends on its type. For example:</p><note>
57 /// <p>The namespace is required when deleting packages of the following formats:</p>
58 /// <ul>
59 /// <li>
60 /// <p>Maven</p></li>
61 /// <li>
62 /// <p>Swift</p></li>
63 /// <li>
64 /// <p>generic</p></li>
65 /// </ul>
66 /// </note>
67 /// <ul>
68 /// <li>
69 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
70 /// <li>
71 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
72 /// <li>
73 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
74 /// <li>
75 /// <p>Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.</p></li>
76 /// </ul>
77 pub fn namespace(&self) -> ::std::option::Option<&str> {
78 self.namespace.as_deref()
79 }
80 /// <p>The name of the package to delete.</p>
81 pub fn package(&self) -> ::std::option::Option<&str> {
82 self.package.as_deref()
83 }
84}
85impl DeletePackageInput {
86 /// Creates a new builder-style object to manufacture [`DeletePackageInput`](crate::operation::delete_package::DeletePackageInput).
87 pub fn builder() -> crate::operation::delete_package::builders::DeletePackageInputBuilder {
88 crate::operation::delete_package::builders::DeletePackageInputBuilder::default()
89 }
90}
91
92/// A builder for [`DeletePackageInput`](crate::operation::delete_package::DeletePackageInput).
93#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
94#[non_exhaustive]
95pub struct DeletePackageInputBuilder {
96 pub(crate) domain: ::std::option::Option<::std::string::String>,
97 pub(crate) domain_owner: ::std::option::Option<::std::string::String>,
98 pub(crate) repository: ::std::option::Option<::std::string::String>,
99 pub(crate) format: ::std::option::Option<crate::types::PackageFormat>,
100 pub(crate) namespace: ::std::option::Option<::std::string::String>,
101 pub(crate) package: ::std::option::Option<::std::string::String>,
102}
103impl DeletePackageInputBuilder {
104 /// <p>The name of the domain that contains the package to delete.</p>
105 /// This field is required.
106 pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107 self.domain = ::std::option::Option::Some(input.into());
108 self
109 }
110 /// <p>The name of the domain that contains the package to delete.</p>
111 pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112 self.domain = input;
113 self
114 }
115 /// <p>The name of the domain that contains the package to delete.</p>
116 pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
117 &self.domain
118 }
119 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
120 pub fn domain_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.domain_owner = ::std::option::Option::Some(input.into());
122 self
123 }
124 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
125 pub fn set_domain_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.domain_owner = input;
127 self
128 }
129 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
130 pub fn get_domain_owner(&self) -> &::std::option::Option<::std::string::String> {
131 &self.domain_owner
132 }
133 /// <p>The name of the repository that contains the package to delete.</p>
134 /// This field is required.
135 pub fn repository(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.repository = ::std::option::Option::Some(input.into());
137 self
138 }
139 /// <p>The name of the repository that contains the package to delete.</p>
140 pub fn set_repository(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.repository = input;
142 self
143 }
144 /// <p>The name of the repository that contains the package to delete.</p>
145 pub fn get_repository(&self) -> &::std::option::Option<::std::string::String> {
146 &self.repository
147 }
148 /// <p>The format of the requested package to delete.</p>
149 /// This field is required.
150 pub fn format(mut self, input: crate::types::PackageFormat) -> Self {
151 self.format = ::std::option::Option::Some(input);
152 self
153 }
154 /// <p>The format of the requested package to delete.</p>
155 pub fn set_format(mut self, input: ::std::option::Option<crate::types::PackageFormat>) -> Self {
156 self.format = input;
157 self
158 }
159 /// <p>The format of the requested package to delete.</p>
160 pub fn get_format(&self) -> &::std::option::Option<crate::types::PackageFormat> {
161 &self.format
162 }
163 /// <p>The namespace of the package to delete. The package component that specifies its namespace depends on its type. For example:</p><note>
164 /// <p>The namespace is required when deleting packages of the following formats:</p>
165 /// <ul>
166 /// <li>
167 /// <p>Maven</p></li>
168 /// <li>
169 /// <p>Swift</p></li>
170 /// <li>
171 /// <p>generic</p></li>
172 /// </ul>
173 /// </note>
174 /// <ul>
175 /// <li>
176 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
177 /// <li>
178 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
179 /// <li>
180 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
181 /// <li>
182 /// <p>Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.</p></li>
183 /// </ul>
184 pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185 self.namespace = ::std::option::Option::Some(input.into());
186 self
187 }
188 /// <p>The namespace of the package to delete. The package component that specifies its namespace depends on its type. For example:</p><note>
189 /// <p>The namespace is required when deleting packages of the following formats:</p>
190 /// <ul>
191 /// <li>
192 /// <p>Maven</p></li>
193 /// <li>
194 /// <p>Swift</p></li>
195 /// <li>
196 /// <p>generic</p></li>
197 /// </ul>
198 /// </note>
199 /// <ul>
200 /// <li>
201 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
202 /// <li>
203 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
204 /// <li>
205 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
206 /// <li>
207 /// <p>Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.</p></li>
208 /// </ul>
209 pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210 self.namespace = input;
211 self
212 }
213 /// <p>The namespace of the package to delete. The package component that specifies its namespace depends on its type. For example:</p><note>
214 /// <p>The namespace is required when deleting packages of the following formats:</p>
215 /// <ul>
216 /// <li>
217 /// <p>Maven</p></li>
218 /// <li>
219 /// <p>Swift</p></li>
220 /// <li>
221 /// <p>generic</p></li>
222 /// </ul>
223 /// </note>
224 /// <ul>
225 /// <li>
226 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
227 /// <li>
228 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
229 /// <li>
230 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
231 /// <li>
232 /// <p>Python, NuGet, Ruby, and Cargo package versions do not contain a corresponding component, package versions of those formats do not have a namespace.</p></li>
233 /// </ul>
234 pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
235 &self.namespace
236 }
237 /// <p>The name of the package to delete.</p>
238 /// This field is required.
239 pub fn package(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240 self.package = ::std::option::Option::Some(input.into());
241 self
242 }
243 /// <p>The name of the package to delete.</p>
244 pub fn set_package(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
245 self.package = input;
246 self
247 }
248 /// <p>The name of the package to delete.</p>
249 pub fn get_package(&self) -> &::std::option::Option<::std::string::String> {
250 &self.package
251 }
252 /// Consumes the builder and constructs a [`DeletePackageInput`](crate::operation::delete_package::DeletePackageInput).
253 pub fn build(
254 self,
255 ) -> ::std::result::Result<crate::operation::delete_package::DeletePackageInput, ::aws_smithy_types::error::operation::BuildError> {
256 ::std::result::Result::Ok(crate::operation::delete_package::DeletePackageInput {
257 domain: self.domain,
258 domain_owner: self.domain_owner,
259 repository: self.repository,
260 format: self.format,
261 namespace: self.namespace,
262 package: self.package,
263 })
264 }
265}