aws_sdk_iam/operation/upload_signing_certificate/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::upload_signing_certificate::_upload_signing_certificate_output::UploadSigningCertificateOutputBuilder;
3
4pub use crate::operation::upload_signing_certificate::_upload_signing_certificate_input::UploadSigningCertificateInputBuilder;
5
6impl crate::operation::upload_signing_certificate::builders::UploadSigningCertificateInputBuilder {
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::upload_signing_certificate::UploadSigningCertificateOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::upload_signing_certificate::UploadSigningCertificateError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.upload_signing_certificate();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UploadSigningCertificate`.
24///
25/// <p>Uploads an X.509 signing certificate and associates it with the specified IAM user. Some Amazon Web Services services require you to use certificates to validate requests that are signed with a corresponding private key. When you upload the certificate, its default status is <code>Active</code>.</p>
26/// <p>For information about when you would use an X.509 signing certificate, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html">Managing server certificates in IAM</a> in the <i>IAM User Guide</i>.</p>
27/// <p>If the <code>UserName</code> is not specified, the IAM user name is determined implicitly based on the Amazon Web Services access key ID used to sign the request. This operation works for access keys under the Amazon Web Services account. Consequently, you can use this operation to manage Amazon Web Services account root user credentials even if the Amazon Web Services account has no associated users.</p><note>
28/// <p>Because the body of an X.509 certificate can be large, you should use POST rather than GET when calling <code>UploadSigningCertificate</code>. For information about setting up signatures and authorization through the API, see <a href="https://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html">Signing Amazon Web Services API requests</a> in the <i>Amazon Web Services General Reference</i>. For general information about using the Query API with IAM, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html">Making query requests</a> in the <i>IAM User Guide</i>.</p>
29/// </note>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct UploadSigningCertificateFluentBuilder {
32 handle: ::std::sync::Arc<crate::client::Handle>,
33 inner: crate::operation::upload_signing_certificate::builders::UploadSigningCertificateInputBuilder,
34 config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37 crate::client::customize::internal::CustomizableSend<
38 crate::operation::upload_signing_certificate::UploadSigningCertificateOutput,
39 crate::operation::upload_signing_certificate::UploadSigningCertificateError,
40 > for UploadSigningCertificateFluentBuilder
41{
42 fn send(
43 self,
44 config_override: crate::config::Builder,
45 ) -> crate::client::customize::internal::BoxFuture<
46 crate::client::customize::internal::SendResult<
47 crate::operation::upload_signing_certificate::UploadSigningCertificateOutput,
48 crate::operation::upload_signing_certificate::UploadSigningCertificateError,
49 >,
50 > {
51 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52 }
53}
54impl UploadSigningCertificateFluentBuilder {
55 /// Creates a new `UploadSigningCertificateFluentBuilder`.
56 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57 Self {
58 handle,
59 inner: ::std::default::Default::default(),
60 config_override: ::std::option::Option::None,
61 }
62 }
63 /// Access the UploadSigningCertificate as a reference.
64 pub fn as_input(&self) -> &crate::operation::upload_signing_certificate::builders::UploadSigningCertificateInputBuilder {
65 &self.inner
66 }
67 /// Sends the request and returns the response.
68 ///
69 /// If an error occurs, an `SdkError` will be returned with additional details that
70 /// can be matched against.
71 ///
72 /// By default, any retryable failures will be retried twice. Retry behavior
73 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74 /// set when configuring the client.
75 pub async fn send(
76 self,
77 ) -> ::std::result::Result<
78 crate::operation::upload_signing_certificate::UploadSigningCertificateOutput,
79 ::aws_smithy_runtime_api::client::result::SdkError<
80 crate::operation::upload_signing_certificate::UploadSigningCertificateError,
81 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82 >,
83 > {
84 let input = self
85 .inner
86 .build()
87 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88 let runtime_plugins = crate::operation::upload_signing_certificate::UploadSigningCertificate::operation_runtime_plugins(
89 self.handle.runtime_plugins.clone(),
90 &self.handle.conf,
91 self.config_override,
92 );
93 crate::operation::upload_signing_certificate::UploadSigningCertificate::orchestrate(&runtime_plugins, input).await
94 }
95
96 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97 pub fn customize(
98 self,
99 ) -> crate::client::customize::CustomizableOperation<
100 crate::operation::upload_signing_certificate::UploadSigningCertificateOutput,
101 crate::operation::upload_signing_certificate::UploadSigningCertificateError,
102 Self,
103 > {
104 crate::client::customize::CustomizableOperation::new(self)
105 }
106 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107 self.set_config_override(::std::option::Option::Some(config_override.into()));
108 self
109 }
110
111 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112 self.config_override = config_override;
113 self
114 }
115 /// <p>The name of the user the signing certificate is for.</p>
116 /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
117 pub fn user_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.inner = self.inner.user_name(input.into());
119 self
120 }
121 /// <p>The name of the user the signing certificate is for.</p>
122 /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
123 pub fn set_user_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.inner = self.inner.set_user_name(input);
125 self
126 }
127 /// <p>The name of the user the signing certificate is for.</p>
128 /// <p>This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of the following characters: _+=,.@-</p>
129 pub fn get_user_name(&self) -> &::std::option::Option<::std::string::String> {
130 self.inner.get_user_name()
131 }
132 /// <p>The contents of the signing certificate.</p>
133 /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
134 /// <ul>
135 /// <li>
136 /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
137 /// <li>
138 /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
139 /// <li>
140 /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
141 /// </ul>
142 pub fn certificate_body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.inner = self.inner.certificate_body(input.into());
144 self
145 }
146 /// <p>The contents of the signing certificate.</p>
147 /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
148 /// <ul>
149 /// <li>
150 /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
151 /// <li>
152 /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
153 /// <li>
154 /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
155 /// </ul>
156 pub fn set_certificate_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.inner = self.inner.set_certificate_body(input);
158 self
159 }
160 /// <p>The contents of the signing certificate.</p>
161 /// <p>The <a href="http://wikipedia.org/wiki/regex">regex pattern</a> used to validate this parameter is a string of characters consisting of the following:</p>
162 /// <ul>
163 /// <li>
164 /// <p>Any printable ASCII character ranging from the space character (<code>\u0020</code>) through the end of the ASCII character range</p></li>
165 /// <li>
166 /// <p>The printable characters in the Basic Latin and Latin-1 Supplement character set (through <code>\u00FF</code>)</p></li>
167 /// <li>
168 /// <p>The special characters tab (<code>\u0009</code>), line feed (<code>\u000A</code>), and carriage return (<code>\u000D</code>)</p></li>
169 /// </ul>
170 pub fn get_certificate_body(&self) -> &::std::option::Option<::std::string::String> {
171 self.inner.get_certificate_body()
172 }
173}