aws_sdk_codeartifact/operation/get_associated_package_group/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_associated_package_group::_get_associated_package_group_output::GetAssociatedPackageGroupOutputBuilder;
3
4pub use crate::operation::get_associated_package_group::_get_associated_package_group_input::GetAssociatedPackageGroupInputBuilder;
5
6impl crate::operation::get_associated_package_group::builders::GetAssociatedPackageGroupInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::get_associated_package_group::GetAssociatedPackageGroupOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::get_associated_package_group::GetAssociatedPackageGroupError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.get_associated_package_group();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `GetAssociatedPackageGroup`.
24///
25/// <p>Returns the most closely associated package group to the specified package. This API does not require that the package exist in any repository in the domain. As such, <code>GetAssociatedPackageGroup</code> can be used to see which package group's origin configuration applies to a package before that package is in a repository. This can be helpful to check if public packages are blocked without ingesting them.</p>
26/// <p>For information package group association and matching, see <a href="https://docs.aws.amazon.com/codeartifact/latest/ug/package-group-definition-syntax-matching-behavior.html">Package group definition syntax and matching behavior</a> in the <i>CodeArtifact User Guide</i>.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct GetAssociatedPackageGroupFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::get_associated_package_group::builders::GetAssociatedPackageGroupInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::get_associated_package_group::GetAssociatedPackageGroupOutput,
36 crate::operation::get_associated_package_group::GetAssociatedPackageGroupError,
37 > for GetAssociatedPackageGroupFluentBuilder
38{
39 fn send(
40 self,
41 config_override: crate::config::Builder,
42 ) -> crate::client::customize::internal::BoxFuture<
43 crate::client::customize::internal::SendResult<
44 crate::operation::get_associated_package_group::GetAssociatedPackageGroupOutput,
45 crate::operation::get_associated_package_group::GetAssociatedPackageGroupError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl GetAssociatedPackageGroupFluentBuilder {
52 /// Creates a new `GetAssociatedPackageGroupFluentBuilder`.
53 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54 Self {
55 handle,
56 inner: ::std::default::Default::default(),
57 config_override: ::std::option::Option::None,
58 }
59 }
60 /// Access the GetAssociatedPackageGroup as a reference.
61 pub fn as_input(&self) -> &crate::operation::get_associated_package_group::builders::GetAssociatedPackageGroupInputBuilder {
62 &self.inner
63 }
64 /// Sends the request and returns the response.
65 ///
66 /// If an error occurs, an `SdkError` will be returned with additional details that
67 /// can be matched against.
68 ///
69 /// By default, any retryable failures will be retried twice. Retry behavior
70 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71 /// set when configuring the client.
72 pub async fn send(
73 self,
74 ) -> ::std::result::Result<
75 crate::operation::get_associated_package_group::GetAssociatedPackageGroupOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::get_associated_package_group::GetAssociatedPackageGroupError,
78 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79 >,
80 > {
81 let input = self
82 .inner
83 .build()
84 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85 let runtime_plugins = crate::operation::get_associated_package_group::GetAssociatedPackageGroup::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::get_associated_package_group::GetAssociatedPackageGroup::orchestrate(&runtime_plugins, input).await
91 }
92
93 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94 pub fn customize(
95 self,
96 ) -> crate::client::customize::CustomizableOperation<
97 crate::operation::get_associated_package_group::GetAssociatedPackageGroupOutput,
98 crate::operation::get_associated_package_group::GetAssociatedPackageGroupError,
99 Self,
100 > {
101 crate::client::customize::CustomizableOperation::new(self)
102 }
103 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104 self.set_config_override(::std::option::Option::Some(config_override.into()));
105 self
106 }
107
108 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109 self.config_override = config_override;
110 self
111 }
112 /// <p>The name of the domain that contains the package from which to get the associated package group.</p>
113 pub fn domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.domain(input.into());
115 self
116 }
117 /// <p>The name of the domain that contains the package from which to get the associated package group.</p>
118 pub fn set_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.inner = self.inner.set_domain(input);
120 self
121 }
122 /// <p>The name of the domain that contains the package from which to get the associated package group.</p>
123 pub fn get_domain(&self) -> &::std::option::Option<::std::string::String> {
124 self.inner.get_domain()
125 }
126 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
127 pub fn domain_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.inner = self.inner.domain_owner(input.into());
129 self
130 }
131 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
132 pub fn set_domain_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.inner = self.inner.set_domain_owner(input);
134 self
135 }
136 /// <p>The 12-digit account number of the Amazon Web Services account that owns the domain. It does not include dashes or spaces.</p>
137 pub fn get_domain_owner(&self) -> &::std::option::Option<::std::string::String> {
138 self.inner.get_domain_owner()
139 }
140 /// <p>The format of the package from which to get the associated package group.</p>
141 pub fn format(mut self, input: crate::types::PackageFormat) -> Self {
142 self.inner = self.inner.format(input);
143 self
144 }
145 /// <p>The format of the package from which to get the associated package group.</p>
146 pub fn set_format(mut self, input: ::std::option::Option<crate::types::PackageFormat>) -> Self {
147 self.inner = self.inner.set_format(input);
148 self
149 }
150 /// <p>The format of the package from which to get the associated package group.</p>
151 pub fn get_format(&self) -> &::std::option::Option<crate::types::PackageFormat> {
152 self.inner.get_format()
153 }
154 /// <p>The namespace of the package from which to get the associated package group. The package component that specifies its namespace depends on its type. For example:</p><note>
155 /// <p>The namespace is required when getting associated package groups from packages of the following formats:</p>
156 /// <ul>
157 /// <li>
158 /// <p>Maven</p></li>
159 /// <li>
160 /// <p>Swift</p></li>
161 /// <li>
162 /// <p>generic</p></li>
163 /// </ul>
164 /// </note>
165 /// <ul>
166 /// <li>
167 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
168 /// <li>
169 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
170 /// <li>
171 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
172 /// <li>
173 /// <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>
174 /// </ul>
175 pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176 self.inner = self.inner.namespace(input.into());
177 self
178 }
179 /// <p>The namespace of the package from which to get the associated package group. The package component that specifies its namespace depends on its type. For example:</p><note>
180 /// <p>The namespace is required when getting associated package groups from packages of the following formats:</p>
181 /// <ul>
182 /// <li>
183 /// <p>Maven</p></li>
184 /// <li>
185 /// <p>Swift</p></li>
186 /// <li>
187 /// <p>generic</p></li>
188 /// </ul>
189 /// </note>
190 /// <ul>
191 /// <li>
192 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
193 /// <li>
194 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
195 /// <li>
196 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
197 /// <li>
198 /// <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>
199 /// </ul>
200 pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201 self.inner = self.inner.set_namespace(input);
202 self
203 }
204 /// <p>The namespace of the package from which to get the associated package group. The package component that specifies its namespace depends on its type. For example:</p><note>
205 /// <p>The namespace is required when getting associated package groups from packages of the following formats:</p>
206 /// <ul>
207 /// <li>
208 /// <p>Maven</p></li>
209 /// <li>
210 /// <p>Swift</p></li>
211 /// <li>
212 /// <p>generic</p></li>
213 /// </ul>
214 /// </note>
215 /// <ul>
216 /// <li>
217 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
218 /// <li>
219 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
220 /// <li>
221 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
222 /// <li>
223 /// <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>
224 /// </ul>
225 pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
226 self.inner.get_namespace()
227 }
228 /// <p>The package from which to get the associated package group.</p>
229 pub fn package(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230 self.inner = self.inner.package(input.into());
231 self
232 }
233 /// <p>The package from which to get the associated package group.</p>
234 pub fn set_package(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235 self.inner = self.inner.set_package(input);
236 self
237 }
238 /// <p>The package from which to get the associated package group.</p>
239 pub fn get_package(&self) -> &::std::option::Option<::std::string::String> {
240 self.inner.get_package()
241 }
242}