aws_sdk_codeartifact/operation/get_package_version_readme/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_package_version_readme::_get_package_version_readme_output::GetPackageVersionReadmeOutputBuilder;
3
4pub use crate::operation::get_package_version_readme::_get_package_version_readme_input::GetPackageVersionReadmeInputBuilder;
5
6impl crate::operation::get_package_version_readme::builders::GetPackageVersionReadmeInputBuilder {
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_package_version_readme::GetPackageVersionReadmeOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::get_package_version_readme::GetPackageVersionReadmeError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.get_package_version_readme();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `GetPackageVersionReadme`.
24///
25/// <p>Gets the readme file or descriptive text for a package version.</p>
26/// <p>The returned text might contain formatting. For example, it might contain formatting for Markdown or reStructuredText.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct GetPackageVersionReadmeFluentBuilder {
29 handle: ::std::sync::Arc<crate::client::Handle>,
30 inner: crate::operation::get_package_version_readme::builders::GetPackageVersionReadmeInputBuilder,
31 config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34 crate::client::customize::internal::CustomizableSend<
35 crate::operation::get_package_version_readme::GetPackageVersionReadmeOutput,
36 crate::operation::get_package_version_readme::GetPackageVersionReadmeError,
37 > for GetPackageVersionReadmeFluentBuilder
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_package_version_readme::GetPackageVersionReadmeOutput,
45 crate::operation::get_package_version_readme::GetPackageVersionReadmeError,
46 >,
47 > {
48 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49 }
50}
51impl GetPackageVersionReadmeFluentBuilder {
52 /// Creates a new `GetPackageVersionReadmeFluentBuilder`.
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 GetPackageVersionReadme as a reference.
61 pub fn as_input(&self) -> &crate::operation::get_package_version_readme::builders::GetPackageVersionReadmeInputBuilder {
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_package_version_readme::GetPackageVersionReadmeOutput,
76 ::aws_smithy_runtime_api::client::result::SdkError<
77 crate::operation::get_package_version_readme::GetPackageVersionReadmeError,
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_package_version_readme::GetPackageVersionReadme::operation_runtime_plugins(
86 self.handle.runtime_plugins.clone(),
87 &self.handle.conf,
88 self.config_override,
89 );
90 crate::operation::get_package_version_readme::GetPackageVersionReadme::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_package_version_readme::GetPackageVersionReadmeOutput,
98 crate::operation::get_package_version_readme::GetPackageVersionReadmeError,
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 repository that contains the package version with the requested readme file.</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 repository that contains the package version with the requested readme file.</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 repository that contains the package version with the requested readme file.</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 repository that contains the package with the requested readme file.</p>
141 pub fn repository(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
142 self.inner = self.inner.repository(input.into());
143 self
144 }
145 /// <p>The repository that contains the package with the requested readme file.</p>
146 pub fn set_repository(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
147 self.inner = self.inner.set_repository(input);
148 self
149 }
150 /// <p>The repository that contains the package with the requested readme file.</p>
151 pub fn get_repository(&self) -> &::std::option::Option<::std::string::String> {
152 self.inner.get_repository()
153 }
154 /// <p>A format that specifies the type of the package version with the requested readme file.</p>
155 pub fn format(mut self, input: crate::types::PackageFormat) -> Self {
156 self.inner = self.inner.format(input);
157 self
158 }
159 /// <p>A format that specifies the type of the package version with the requested readme file.</p>
160 pub fn set_format(mut self, input: ::std::option::Option<crate::types::PackageFormat>) -> Self {
161 self.inner = self.inner.set_format(input);
162 self
163 }
164 /// <p>A format that specifies the type of the package version with the requested readme file.</p>
165 pub fn get_format(&self) -> &::std::option::Option<crate::types::PackageFormat> {
166 self.inner.get_format()
167 }
168 /// <p>The namespace of the package version with the requested readme file. The package component that specifies its namespace depends on its type. For example:</p><note>
169 /// <p>The namespace is required when requesting the readme from package versions of the following formats:</p>
170 /// <ul>
171 /// <li>
172 /// <p>Maven</p></li>
173 /// <li>
174 /// <p>Swift</p></li>
175 /// <li>
176 /// <p>generic</p></li>
177 /// </ul>
178 /// </note>
179 /// <ul>
180 /// <li>
181 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
182 /// <li>
183 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
184 /// <li>
185 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
186 /// <li>
187 /// <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>
188 /// </ul>
189 pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190 self.inner = self.inner.namespace(input.into());
191 self
192 }
193 /// <p>The namespace of the package version with the requested readme file. The package component that specifies its namespace depends on its type. For example:</p><note>
194 /// <p>The namespace is required when requesting the readme from package versions of the following formats:</p>
195 /// <ul>
196 /// <li>
197 /// <p>Maven</p></li>
198 /// <li>
199 /// <p>Swift</p></li>
200 /// <li>
201 /// <p>generic</p></li>
202 /// </ul>
203 /// </note>
204 /// <ul>
205 /// <li>
206 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
207 /// <li>
208 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
209 /// <li>
210 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
211 /// <li>
212 /// <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>
213 /// </ul>
214 pub fn set_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
215 self.inner = self.inner.set_namespace(input);
216 self
217 }
218 /// <p>The namespace of the package version with the requested readme file. The package component that specifies its namespace depends on its type. For example:</p><note>
219 /// <p>The namespace is required when requesting the readme from package versions of the following formats:</p>
220 /// <ul>
221 /// <li>
222 /// <p>Maven</p></li>
223 /// <li>
224 /// <p>Swift</p></li>
225 /// <li>
226 /// <p>generic</p></li>
227 /// </ul>
228 /// </note>
229 /// <ul>
230 /// <li>
231 /// <p>The namespace of a Maven package version is its <code>groupId</code>.</p></li>
232 /// <li>
233 /// <p>The namespace of an npm or Swift package version is its <code>scope</code>.</p></li>
234 /// <li>
235 /// <p>The namespace of a generic package is its <code>namespace</code>.</p></li>
236 /// <li>
237 /// <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>
238 /// </ul>
239 pub fn get_namespace(&self) -> &::std::option::Option<::std::string::String> {
240 self.inner.get_namespace()
241 }
242 /// <p>The name of the package version that contains the requested readme file.</p>
243 pub fn package(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
244 self.inner = self.inner.package(input.into());
245 self
246 }
247 /// <p>The name of the package version that contains the requested readme file.</p>
248 pub fn set_package(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
249 self.inner = self.inner.set_package(input);
250 self
251 }
252 /// <p>The name of the package version that contains the requested readme file.</p>
253 pub fn get_package(&self) -> &::std::option::Option<::std::string::String> {
254 self.inner.get_package()
255 }
256 /// <p>A string that contains the package version (for example, <code>3.5.2</code>).</p>
257 pub fn package_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
258 self.inner = self.inner.package_version(input.into());
259 self
260 }
261 /// <p>A string that contains the package version (for example, <code>3.5.2</code>).</p>
262 pub fn set_package_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
263 self.inner = self.inner.set_package_version(input);
264 self
265 }
266 /// <p>A string that contains the package version (for example, <code>3.5.2</code>).</p>
267 pub fn get_package_version(&self) -> &::std::option::Option<::std::string::String> {
268 self.inner.get_package_version()
269 }
270}