rusoto_acm/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::proto;
23use rusoto_core::request::HttpResponse;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27
28impl AcmClient {
29    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30        let mut request = SignedRequest::new(http_method, "acm", &self.region, request_uri);
31
32        request.set_content_type("application/x-amz-json-1.1".to_owned());
33
34        request
35    }
36
37    async fn sign_and_dispatch<E>(
38        &self,
39        request: SignedRequest,
40        from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
41    ) -> Result<HttpResponse, RusotoError<E>> {
42        let mut response = self.client.sign_and_dispatch(request).await?;
43        if !response.status.is_success() {
44            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
45            return Err(from_response(response));
46        }
47
48        Ok(response)
49    }
50}
51
52use serde_json;
53#[derive(Clone, Debug, Default, PartialEq, Serialize)]
54#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
55pub struct AddTagsToCertificateRequest {
56    /// <p>String that contains the ARN of the ACM certificate to which the tag is to be applied. This must be of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>. </p>
57    #[serde(rename = "CertificateArn")]
58    pub certificate_arn: String,
59    /// <p>The key-value pair that defines the tag. The tag value is optional.</p>
60    #[serde(rename = "Tags")]
61    pub tags: Vec<Tag>,
62}
63
64/// <p>Contains metadata about an ACM certificate. This structure is returned in the response to a <a>DescribeCertificate</a> request. </p>
65#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
66#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
67pub struct CertificateDetail {
68    /// <p>The Amazon Resource Name (ARN) of the certificate. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a> in the <i>AWS General Reference</i>.</p>
69    #[serde(rename = "CertificateArn")]
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub certificate_arn: Option<String>,
72    /// <p>The Amazon Resource Name (ARN) of the ACM PCA private certificate authority (CA) that issued the certificate. This has the following format: </p> <p> <code>arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012</code> </p>
73    #[serde(rename = "CertificateAuthorityArn")]
74    #[serde(skip_serializing_if = "Option::is_none")]
75    pub certificate_authority_arn: Option<String>,
76    /// <p>The time at which the certificate was requested. This value exists only when the certificate type is <code>AMAZON_ISSUED</code>. </p>
77    #[serde(rename = "CreatedAt")]
78    #[serde(skip_serializing_if = "Option::is_none")]
79    pub created_at: Option<f64>,
80    /// <p>The fully qualified domain name for the certificate, such as www.example.com or example.com.</p>
81    #[serde(rename = "DomainName")]
82    #[serde(skip_serializing_if = "Option::is_none")]
83    pub domain_name: Option<String>,
84    /// <p>Contains information about the initial validation of each domain name that occurs as a result of the <a>RequestCertificate</a> request. This field exists only when the certificate type is <code>AMAZON_ISSUED</code>. </p>
85    #[serde(rename = "DomainValidationOptions")]
86    #[serde(skip_serializing_if = "Option::is_none")]
87    pub domain_validation_options: Option<Vec<DomainValidation>>,
88    /// <p>Contains a list of Extended Key Usage X.509 v3 extension objects. Each object specifies a purpose for which the certificate public key can be used and consists of a name and an object identifier (OID). </p>
89    #[serde(rename = "ExtendedKeyUsages")]
90    #[serde(skip_serializing_if = "Option::is_none")]
91    pub extended_key_usages: Option<Vec<ExtendedKeyUsage>>,
92    /// <p>The reason the certificate request failed. This value exists only when the certificate status is <code>FAILED</code>. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/troubleshooting.html#troubleshooting-failed">Certificate Request Failed</a> in the <i>AWS Certificate Manager User Guide</i>. </p>
93    #[serde(rename = "FailureReason")]
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub failure_reason: Option<String>,
96    /// <p>The date and time at which the certificate was imported. This value exists only when the certificate type is <code>IMPORTED</code>. </p>
97    #[serde(rename = "ImportedAt")]
98    #[serde(skip_serializing_if = "Option::is_none")]
99    pub imported_at: Option<f64>,
100    /// <p>A list of ARNs for the AWS resources that are using the certificate. A certificate can be used by multiple AWS resources. </p>
101    #[serde(rename = "InUseBy")]
102    #[serde(skip_serializing_if = "Option::is_none")]
103    pub in_use_by: Option<Vec<String>>,
104    /// <p>The time at which the certificate was issued. This value exists only when the certificate type is <code>AMAZON_ISSUED</code>. </p>
105    #[serde(rename = "IssuedAt")]
106    #[serde(skip_serializing_if = "Option::is_none")]
107    pub issued_at: Option<f64>,
108    /// <p>The name of the certificate authority that issued and signed the certificate.</p>
109    #[serde(rename = "Issuer")]
110    #[serde(skip_serializing_if = "Option::is_none")]
111    pub issuer: Option<String>,
112    /// <p>The algorithm that was used to generate the public-private key pair.</p>
113    #[serde(rename = "KeyAlgorithm")]
114    #[serde(skip_serializing_if = "Option::is_none")]
115    pub key_algorithm: Option<String>,
116    /// <p>A list of Key Usage X.509 v3 extension objects. Each object is a string value that identifies the purpose of the public key contained in the certificate. Possible extension values include DIGITAL_SIGNATURE, KEY_ENCHIPHERMENT, NON_REPUDIATION, and more.</p>
117    #[serde(rename = "KeyUsages")]
118    #[serde(skip_serializing_if = "Option::is_none")]
119    pub key_usages: Option<Vec<KeyUsage>>,
120    /// <p>The time after which the certificate is not valid.</p>
121    #[serde(rename = "NotAfter")]
122    #[serde(skip_serializing_if = "Option::is_none")]
123    pub not_after: Option<f64>,
124    /// <p>The time before which the certificate is not valid.</p>
125    #[serde(rename = "NotBefore")]
126    #[serde(skip_serializing_if = "Option::is_none")]
127    pub not_before: Option<f64>,
128    /// <p>Value that specifies whether to add the certificate to a transparency log. Certificate transparency makes it possible to detect SSL certificates that have been mistakenly or maliciously issued. A browser might respond to certificate that has not been logged by showing an error message. The logs are cryptographically secure. </p>
129    #[serde(rename = "Options")]
130    #[serde(skip_serializing_if = "Option::is_none")]
131    pub options: Option<CertificateOptions>,
132    /// <p>Specifies whether the certificate is eligible for renewal. At this time, only exported private certificates can be renewed with the <a>RenewCertificate</a> command.</p>
133    #[serde(rename = "RenewalEligibility")]
134    #[serde(skip_serializing_if = "Option::is_none")]
135    pub renewal_eligibility: Option<String>,
136    /// <p>Contains information about the status of ACM's <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html">managed renewal</a> for the certificate. This field exists only when the certificate type is <code>AMAZON_ISSUED</code>.</p>
137    #[serde(rename = "RenewalSummary")]
138    #[serde(skip_serializing_if = "Option::is_none")]
139    pub renewal_summary: Option<RenewalSummary>,
140    /// <p>The reason the certificate was revoked. This value exists only when the certificate status is <code>REVOKED</code>. </p>
141    #[serde(rename = "RevocationReason")]
142    #[serde(skip_serializing_if = "Option::is_none")]
143    pub revocation_reason: Option<String>,
144    /// <p>The time at which the certificate was revoked. This value exists only when the certificate status is <code>REVOKED</code>. </p>
145    #[serde(rename = "RevokedAt")]
146    #[serde(skip_serializing_if = "Option::is_none")]
147    pub revoked_at: Option<f64>,
148    /// <p>The serial number of the certificate.</p>
149    #[serde(rename = "Serial")]
150    #[serde(skip_serializing_if = "Option::is_none")]
151    pub serial: Option<String>,
152    /// <p>The algorithm that was used to sign the certificate.</p>
153    #[serde(rename = "SignatureAlgorithm")]
154    #[serde(skip_serializing_if = "Option::is_none")]
155    pub signature_algorithm: Option<String>,
156    /// <p>The status of the certificate.</p>
157    #[serde(rename = "Status")]
158    #[serde(skip_serializing_if = "Option::is_none")]
159    pub status: Option<String>,
160    /// <p>The name of the entity that is associated with the public key contained in the certificate.</p>
161    #[serde(rename = "Subject")]
162    #[serde(skip_serializing_if = "Option::is_none")]
163    pub subject: Option<String>,
164    /// <p>One or more domain names (subject alternative names) included in the certificate. This list contains the domain names that are bound to the public key that is contained in the certificate. The subject alternative names include the canonical domain name (CN) of the certificate and additional domain names that can be used to connect to the website. </p>
165    #[serde(rename = "SubjectAlternativeNames")]
166    #[serde(skip_serializing_if = "Option::is_none")]
167    pub subject_alternative_names: Option<Vec<String>>,
168    /// <p>The source of the certificate. For certificates provided by ACM, this value is <code>AMAZON_ISSUED</code>. For certificates that you imported with <a>ImportCertificate</a>, this value is <code>IMPORTED</code>. ACM does not provide <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html">managed renewal</a> for imported certificates. For more information about the differences between certificates that you import and those that ACM provides, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing Certificates</a> in the <i>AWS Certificate Manager User Guide</i>. </p>
169    #[serde(rename = "Type")]
170    #[serde(skip_serializing_if = "Option::is_none")]
171    pub type_: Option<String>,
172}
173
174/// <p>Structure that contains options for your certificate. Currently, you can use this only to specify whether to opt in to or out of certificate transparency logging. Some browsers require that public certificates issued for your domain be recorded in a log. Certificates that are not logged typically generate a browser error. Transparency makes it possible for you to detect SSL/TLS certificates that have been mistakenly or maliciously issued for your domain. For general information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-concepts.html#concept-transparency">Certificate Transparency Logging</a>. </p>
175#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
176pub struct CertificateOptions {
177    /// <p>You can opt out of certificate transparency logging by specifying the <code>DISABLED</code> option. Opt in by specifying <code>ENABLED</code>. </p>
178    #[serde(rename = "CertificateTransparencyLoggingPreference")]
179    #[serde(skip_serializing_if = "Option::is_none")]
180    pub certificate_transparency_logging_preference: Option<String>,
181}
182
183/// <p>This structure is returned in the response object of <a>ListCertificates</a> action. </p>
184#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
185#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
186pub struct CertificateSummary {
187    /// <p>Amazon Resource Name (ARN) of the certificate. This is of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>. </p>
188    #[serde(rename = "CertificateArn")]
189    #[serde(skip_serializing_if = "Option::is_none")]
190    pub certificate_arn: Option<String>,
191    /// <p>Fully qualified domain name (FQDN), such as www.example.com or example.com, for the certificate.</p>
192    #[serde(rename = "DomainName")]
193    #[serde(skip_serializing_if = "Option::is_none")]
194    pub domain_name: Option<String>,
195}
196
197#[derive(Clone, Debug, Default, PartialEq, Serialize)]
198#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
199pub struct DeleteCertificateRequest {
200    /// <p>String that contains the ARN of the ACM certificate to be deleted. This must be of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>.</p>
201    #[serde(rename = "CertificateArn")]
202    pub certificate_arn: String,
203}
204
205#[derive(Clone, Debug, Default, PartialEq, Serialize)]
206#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
207pub struct DescribeCertificateRequest {
208    /// <p>The Amazon Resource Name (ARN) of the ACM certificate. The ARN must have the following form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>.</p>
209    #[serde(rename = "CertificateArn")]
210    pub certificate_arn: String,
211}
212
213#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
214#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
215pub struct DescribeCertificateResponse {
216    /// <p>Metadata about an ACM certificate.</p>
217    #[serde(rename = "Certificate")]
218    #[serde(skip_serializing_if = "Option::is_none")]
219    pub certificate: Option<CertificateDetail>,
220}
221
222/// <p>Contains information about the validation of each domain name in the certificate.</p>
223#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
224#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
225pub struct DomainValidation {
226    /// <p>A fully qualified domain name (FQDN) in the certificate. For example, <code>www.example.com</code> or <code>example.com</code>. </p>
227    #[serde(rename = "DomainName")]
228    pub domain_name: String,
229    /// <p>Contains the CNAME record that you add to your DNS database for domain validation. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html">Use DNS to Validate Domain Ownership</a>.</p> <p>Note: The CNAME information that you need does not include the name of your domain. If you include&#x2028; your domain name in the DNS database CNAME record, validation fails.&#x2028; For example, if the name is "_a79865eb4cd1a6ab990a45779b4e0b96.yourdomain.com", only "_a79865eb4cd1a6ab990a45779b4e0b96" must be used.</p>
230    #[serde(rename = "ResourceRecord")]
231    #[serde(skip_serializing_if = "Option::is_none")]
232    pub resource_record: Option<ResourceRecord>,
233    /// <p>The domain name that ACM used to send domain validation emails.</p>
234    #[serde(rename = "ValidationDomain")]
235    #[serde(skip_serializing_if = "Option::is_none")]
236    pub validation_domain: Option<String>,
237    /// <p>A list of email addresses that ACM used to send domain validation emails.</p>
238    #[serde(rename = "ValidationEmails")]
239    #[serde(skip_serializing_if = "Option::is_none")]
240    pub validation_emails: Option<Vec<String>>,
241    /// <p>Specifies the domain validation method.</p>
242    #[serde(rename = "ValidationMethod")]
243    #[serde(skip_serializing_if = "Option::is_none")]
244    pub validation_method: Option<String>,
245    /// <p><p>The validation status of the domain name. This can be one of the following values:</p> <ul> <li> <p> <code>PENDING_VALIDATION</code> </p> </li> <li> <p> <code/>SUCCESS</p> </li> <li> <p> <code/>FAILED</p> </li> </ul></p>
246    #[serde(rename = "ValidationStatus")]
247    #[serde(skip_serializing_if = "Option::is_none")]
248    pub validation_status: Option<String>,
249}
250
251/// <p>Contains information about the domain names that you want ACM to use to send you emails that enable you to validate domain ownership.</p>
252#[derive(Clone, Debug, Default, PartialEq, Serialize)]
253#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
254pub struct DomainValidationOption {
255    /// <p>A fully qualified domain name (FQDN) in the certificate request.</p>
256    #[serde(rename = "DomainName")]
257    pub domain_name: String,
258    /// <p><p>The domain name that you want ACM to use to send you validation emails. This domain name is the suffix of the email addresses that you want ACM to use. This must be the same as the <code>DomainName</code> value or a superdomain of the <code>DomainName</code> value. For example, if you request a certificate for <code>testing.example.com</code>, you can specify <code>example.com</code> for this value. In that case, ACM sends domain validation emails to the following five addresses:</p> <ul> <li> <p>admin@example.com</p> </li> <li> <p>administrator@example.com</p> </li> <li> <p>hostmaster@example.com</p> </li> <li> <p>postmaster@example.com</p> </li> <li> <p>webmaster@example.com</p> </li> </ul></p>
259    #[serde(rename = "ValidationDomain")]
260    pub validation_domain: String,
261}
262
263#[derive(Clone, Debug, Default, PartialEq, Serialize)]
264#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
265pub struct ExportCertificateRequest {
266    /// <p>An Amazon Resource Name (ARN) of the issued certificate. This must be of the form:</p> <p> <code>arn:aws:acm:region:account:certificate/12345678-1234-1234-1234-123456789012</code> </p>
267    #[serde(rename = "CertificateArn")]
268    pub certificate_arn: String,
269    /// <p>Passphrase to associate with the encrypted exported private key. If you want to later decrypt the private key, you must have the passphrase. You can use the following OpenSSL command to decrypt a private key: </p> <p> <code>openssl rsa -in encrypted_key.pem -out decrypted_key.pem</code> </p>
270    #[serde(rename = "Passphrase")]
271    #[serde(
272        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
273        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
274        default
275    )]
276    pub passphrase: bytes::Bytes,
277}
278
279#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
280#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
281pub struct ExportCertificateResponse {
282    /// <p>The base64 PEM-encoded certificate.</p>
283    #[serde(rename = "Certificate")]
284    #[serde(skip_serializing_if = "Option::is_none")]
285    pub certificate: Option<String>,
286    /// <p>The base64 PEM-encoded certificate chain. This does not include the certificate that you are exporting.</p>
287    #[serde(rename = "CertificateChain")]
288    #[serde(skip_serializing_if = "Option::is_none")]
289    pub certificate_chain: Option<String>,
290    /// <p>The encrypted private key associated with the public key in the certificate. The key is output in PKCS #8 format and is base64 PEM-encoded. </p>
291    #[serde(rename = "PrivateKey")]
292    #[serde(skip_serializing_if = "Option::is_none")]
293    pub private_key: Option<String>,
294}
295
296/// <p>The Extended Key Usage X.509 v3 extension defines one or more purposes for which the public key can be used. This is in addition to or in place of the basic purposes specified by the Key Usage extension. </p>
297#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
298#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
299pub struct ExtendedKeyUsage {
300    /// <p>The name of an Extended Key Usage value.</p>
301    #[serde(rename = "Name")]
302    #[serde(skip_serializing_if = "Option::is_none")]
303    pub name: Option<String>,
304    /// <p><p>An object identifier (OID) for the extension value. OIDs are strings of numbers separated by periods. The following OIDs are defined in RFC 3280 and RFC 5280. </p> <ul> <li> <p> <code>1.3.6.1.5.5.7.3.1 (TLS<em>WEB</em>SERVER<em>AUTHENTICATION)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.2 (TLS</em>WEB<em>CLIENT</em>AUTHENTICATION)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.3 (CODE<em>SIGNING)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.4 (EMAIL</em>PROTECTION)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.8 (TIME<em>STAMPING)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.9 (OCSP</em>SIGNING)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.5 (IPSEC<em>END</em>SYSTEM)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.6 (IPSEC<em>TUNNEL)</code> </p> </li> <li> <p> <code>1.3.6.1.5.5.7.3.7 (IPSEC</em>USER)</code> </p> </li> </ul></p>
305    #[serde(rename = "OID")]
306    #[serde(skip_serializing_if = "Option::is_none")]
307    pub oid: Option<String>,
308}
309
310/// <p>This structure can be used in the <a>ListCertificates</a> action to filter the output of the certificate list. </p>
311#[derive(Clone, Debug, Default, PartialEq, Serialize)]
312#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
313pub struct Filters {
314    /// <p>Specify one or more <a>ExtendedKeyUsage</a> extension values.</p>
315    #[serde(rename = "extendedKeyUsage")]
316    #[serde(skip_serializing_if = "Option::is_none")]
317    pub extended_key_usage: Option<Vec<String>>,
318    /// <p>Specify one or more algorithms that can be used to generate key pairs.</p> <p>Default filtering returns only <code>RSA_2048</code> certificates. To return other certificate types, provide the desired type signatures in a comma-separated list. For example, <code>"keyTypes": ["RSA_2048,RSA_4096"]</code> returns both <code>RSA_2048</code> and <code>RSA_4096</code> certificates.</p>
319    #[serde(rename = "keyTypes")]
320    #[serde(skip_serializing_if = "Option::is_none")]
321    pub key_types: Option<Vec<String>>,
322    /// <p>Specify one or more <a>KeyUsage</a> extension values.</p>
323    #[serde(rename = "keyUsage")]
324    #[serde(skip_serializing_if = "Option::is_none")]
325    pub key_usage: Option<Vec<String>>,
326}
327
328#[derive(Clone, Debug, Default, PartialEq, Serialize)]
329#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
330pub struct GetCertificateRequest {
331    /// <p>String that contains a certificate ARN in the following format:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>.</p>
332    #[serde(rename = "CertificateArn")]
333    pub certificate_arn: String,
334}
335
336#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
337#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
338pub struct GetCertificateResponse {
339    /// <p>The ACM-issued certificate corresponding to the ARN specified as input.</p>
340    #[serde(rename = "Certificate")]
341    #[serde(skip_serializing_if = "Option::is_none")]
342    pub certificate: Option<String>,
343    /// <p>Certificates forming the requested certificate's chain of trust. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs. </p>
344    #[serde(rename = "CertificateChain")]
345    #[serde(skip_serializing_if = "Option::is_none")]
346    pub certificate_chain: Option<String>,
347}
348
349#[derive(Clone, Debug, Default, PartialEq, Serialize)]
350#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
351pub struct ImportCertificateRequest {
352    /// <p>The certificate to import.</p>
353    #[serde(rename = "Certificate")]
354    #[serde(
355        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
356        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
357        default
358    )]
359    pub certificate: bytes::Bytes,
360    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of an imported certificate to replace. To import a new certificate, omit this field. </p>
361    #[serde(rename = "CertificateArn")]
362    #[serde(skip_serializing_if = "Option::is_none")]
363    pub certificate_arn: Option<String>,
364    /// <p>The PEM encoded certificate chain.</p>
365    #[serde(rename = "CertificateChain")]
366    #[serde(
367        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
368        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
369        default
370    )]
371    #[serde(skip_serializing_if = "Option::is_none")]
372    pub certificate_chain: Option<bytes::Bytes>,
373    /// <p>The private key that matches the public key in the certificate.</p>
374    #[serde(rename = "PrivateKey")]
375    #[serde(
376        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
377        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
378        default
379    )]
380    pub private_key: bytes::Bytes,
381    /// <p>One or more resource tags to associate with the imported certificate. </p> <p>Note: You cannot apply tags when reimporting a certificate.</p>
382    #[serde(rename = "Tags")]
383    #[serde(skip_serializing_if = "Option::is_none")]
384    pub tags: Option<Vec<Tag>>,
385}
386
387#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
388#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
389pub struct ImportCertificateResponse {
390    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the imported certificate.</p>
391    #[serde(rename = "CertificateArn")]
392    #[serde(skip_serializing_if = "Option::is_none")]
393    pub certificate_arn: Option<String>,
394}
395
396/// <p>The Key Usage X.509 v3 extension defines the purpose of the public key contained in the certificate.</p>
397#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
398#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
399pub struct KeyUsage {
400    /// <p>A string value that contains a Key Usage extension name.</p>
401    #[serde(rename = "Name")]
402    #[serde(skip_serializing_if = "Option::is_none")]
403    pub name: Option<String>,
404}
405
406#[derive(Clone, Debug, Default, PartialEq, Serialize)]
407#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
408pub struct ListCertificatesRequest {
409    /// <p>Filter the certificate list by status value.</p>
410    #[serde(rename = "CertificateStatuses")]
411    #[serde(skip_serializing_if = "Option::is_none")]
412    pub certificate_statuses: Option<Vec<String>>,
413    /// <p>Filter the certificate list. For more information, see the <a>Filters</a> structure.</p>
414    #[serde(rename = "Includes")]
415    #[serde(skip_serializing_if = "Option::is_none")]
416    pub includes: Option<Filters>,
417    /// <p>Use this parameter when paginating results to specify the maximum number of items to return in the response. If additional items exist beyond the number you specify, the <code>NextToken</code> element is sent in the response. Use this <code>NextToken</code> value in a subsequent request to retrieve additional items.</p>
418    #[serde(rename = "MaxItems")]
419    #[serde(skip_serializing_if = "Option::is_none")]
420    pub max_items: Option<i64>,
421    /// <p>Use this parameter only when paginating results and only in a subsequent request after you receive a response with truncated results. Set it to the value of <code>NextToken</code> from the response you just received.</p>
422    #[serde(rename = "NextToken")]
423    #[serde(skip_serializing_if = "Option::is_none")]
424    pub next_token: Option<String>,
425}
426
427#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
428#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
429pub struct ListCertificatesResponse {
430    /// <p>A list of ACM certificates.</p>
431    #[serde(rename = "CertificateSummaryList")]
432    #[serde(skip_serializing_if = "Option::is_none")]
433    pub certificate_summary_list: Option<Vec<CertificateSummary>>,
434    /// <p>When the list is truncated, this value is present and contains the value to use for the <code>NextToken</code> parameter in a subsequent pagination request.</p>
435    #[serde(rename = "NextToken")]
436    #[serde(skip_serializing_if = "Option::is_none")]
437    pub next_token: Option<String>,
438}
439
440#[derive(Clone, Debug, Default, PartialEq, Serialize)]
441#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
442pub struct ListTagsForCertificateRequest {
443    /// <p>String that contains the ARN of the ACM certificate for which you want to list the tags. This must have the following form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>. </p>
444    #[serde(rename = "CertificateArn")]
445    pub certificate_arn: String,
446}
447
448#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
449#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
450pub struct ListTagsForCertificateResponse {
451    /// <p>The key-value pairs that define the applied tags.</p>
452    #[serde(rename = "Tags")]
453    #[serde(skip_serializing_if = "Option::is_none")]
454    pub tags: Option<Vec<Tag>>,
455}
456
457#[derive(Clone, Debug, Default, PartialEq, Serialize)]
458#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
459pub struct RemoveTagsFromCertificateRequest {
460    /// <p>String that contains the ARN of the ACM Certificate with one or more tags that you want to remove. This must be of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>. </p>
461    #[serde(rename = "CertificateArn")]
462    pub certificate_arn: String,
463    /// <p>The key-value pair that defines the tag to remove.</p>
464    #[serde(rename = "Tags")]
465    pub tags: Vec<Tag>,
466}
467
468#[derive(Clone, Debug, Default, PartialEq, Serialize)]
469#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
470pub struct RenewCertificateRequest {
471    /// <p>String that contains the ARN of the ACM certificate to be renewed. This must be of the form:</p> <p> <code>arn:aws:acm:region:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs) and AWS Service Namespaces</a>.</p>
472    #[serde(rename = "CertificateArn")]
473    pub certificate_arn: String,
474}
475
476/// <p>Contains information about the status of ACM's <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html">managed renewal</a> for the certificate. This structure exists only when the certificate type is <code>AMAZON_ISSUED</code>.</p>
477#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
478#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
479pub struct RenewalSummary {
480    /// <p>Contains information about the validation of each domain name in the certificate, as it pertains to ACM's <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html">managed renewal</a>. This is different from the initial validation that occurs as a result of the <a>RequestCertificate</a> request. This field exists only when the certificate type is <code>AMAZON_ISSUED</code>.</p>
481    #[serde(rename = "DomainValidationOptions")]
482    pub domain_validation_options: Vec<DomainValidation>,
483    /// <p>The status of ACM's <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html">managed renewal</a> of the certificate.</p>
484    #[serde(rename = "RenewalStatus")]
485    pub renewal_status: String,
486    /// <p>The reason that a renewal request was unsuccessful.</p>
487    #[serde(rename = "RenewalStatusReason")]
488    #[serde(skip_serializing_if = "Option::is_none")]
489    pub renewal_status_reason: Option<String>,
490    /// <p>The time at which the renewal summary was last updated.</p>
491    #[serde(rename = "UpdatedAt")]
492    pub updated_at: f64,
493}
494
495#[derive(Clone, Debug, Default, PartialEq, Serialize)]
496#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
497pub struct RequestCertificateRequest {
498    /// <p>The Amazon Resource Name (ARN) of the private certificate authority (CA) that will be used to issue the certificate. If you do not provide an ARN and you are trying to request a private certificate, ACM will attempt to issue a public certificate. For more information about private CAs, see the <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaWelcome.html">AWS Certificate Manager Private Certificate Authority (PCA)</a> user guide. The ARN must have the following form: </p> <p> <code>arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012</code> </p>
499    #[serde(rename = "CertificateAuthorityArn")]
500    #[serde(skip_serializing_if = "Option::is_none")]
501    pub certificate_authority_arn: Option<String>,
502    /// <p> Fully qualified domain name (FQDN), such as www.example.com, that you want to secure with an ACM certificate. Use an asterisk (*) to create a wildcard certificate that protects several sites in the same domain. For example, *.example.com protects www.example.com, site.example.com, and images.example.com. </p> <p> The first domain name you enter cannot exceed 64 octets, including periods. Each subsequent Subject Alternative Name (SAN), however, can be up to 253 octets in length. </p>
503    #[serde(rename = "DomainName")]
504    pub domain_name: String,
505    /// <p>The domain name that you want ACM to use to send you emails so that you can validate domain ownership.</p>
506    #[serde(rename = "DomainValidationOptions")]
507    #[serde(skip_serializing_if = "Option::is_none")]
508    pub domain_validation_options: Option<Vec<DomainValidationOption>>,
509    /// <p>Customer chosen string that can be used to distinguish between calls to <code>RequestCertificate</code>. Idempotency tokens time out after one hour. Therefore, if you call <code>RequestCertificate</code> multiple times with the same idempotency token within one hour, ACM recognizes that you are requesting only one certificate and will issue only one. If you change the idempotency token for each call, ACM recognizes that you are requesting multiple certificates.</p>
510    #[serde(rename = "IdempotencyToken")]
511    #[serde(skip_serializing_if = "Option::is_none")]
512    pub idempotency_token: Option<String>,
513    /// <p>Currently, you can use this parameter to specify whether to add the certificate to a certificate transparency log. Certificate transparency makes it possible to detect SSL/TLS certificates that have been mistakenly or maliciously issued. Certificates that have not been logged typically produce an error message in a browser. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-bestpractices.html#best-practices-transparency">Opting Out of Certificate Transparency Logging</a>.</p>
514    #[serde(rename = "Options")]
515    #[serde(skip_serializing_if = "Option::is_none")]
516    pub options: Option<CertificateOptions>,
517    /// <p><p>Additional FQDNs to be included in the Subject Alternative Name extension of the ACM certificate. For example, add the name www.example.net to a certificate for which the <code>DomainName</code> field is www.example.com if users can reach your site by using either name. The maximum number of domain names that you can add to an ACM certificate is 100. However, the initial quota is 10 domain names. If you need more than 10 names, you must request a quota increase. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-limits.html">Quotas</a>.</p> <p> The maximum length of a SAN DNS name is 253 octets. The name is made up of multiple labels separated by periods. No label can be longer than 63 octets. Consider the following examples: </p> <ul> <li> <p> <code>(63 octets).(63 octets).(63 octets).(61 octets)</code> is legal because the total length is 253 octets (63+1+63+1+63+1+61) and no label exceeds 63 octets.</p> </li> <li> <p> <code>(64 octets).(63 octets).(63 octets).(61 octets)</code> is not legal because the total length exceeds 253 octets (64+1+63+1+63+1+61) and the first label exceeds 63 octets.</p> </li> <li> <p> <code>(63 octets).(63 octets).(63 octets).(62 octets)</code> is not legal because the total length of the DNS name (63+1+63+1+63+1+62) exceeds 253 octets.</p> </li> </ul></p>
518    #[serde(rename = "SubjectAlternativeNames")]
519    #[serde(skip_serializing_if = "Option::is_none")]
520    pub subject_alternative_names: Option<Vec<String>>,
521    /// <p>One or more resource tags to associate with the certificate.</p>
522    #[serde(rename = "Tags")]
523    #[serde(skip_serializing_if = "Option::is_none")]
524    pub tags: Option<Vec<Tag>>,
525    /// <p>The method you want to use if you are requesting a public certificate to validate that you own or control domain. You can <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html">validate with DNS</a> or <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html">validate with email</a>. We recommend that you use DNS validation. </p>
526    #[serde(rename = "ValidationMethod")]
527    #[serde(skip_serializing_if = "Option::is_none")]
528    pub validation_method: Option<String>,
529}
530
531#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
532#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
533pub struct RequestCertificateResponse {
534    /// <p>String that contains the ARN of the issued certificate. This must be of the form:</p> <p> <code>arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p>
535    #[serde(rename = "CertificateArn")]
536    #[serde(skip_serializing_if = "Option::is_none")]
537    pub certificate_arn: Option<String>,
538}
539
540#[derive(Clone, Debug, Default, PartialEq, Serialize)]
541#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
542pub struct ResendValidationEmailRequest {
543    /// <p>String that contains the ARN of the requested certificate. The certificate ARN is generated and returned by the <a>RequestCertificate</a> action as soon as the request is made. By default, using this parameter causes email to be sent to all top-level domains you specified in the certificate request. The ARN must be of the form: </p> <p> <code>arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012</code> </p>
544    #[serde(rename = "CertificateArn")]
545    pub certificate_arn: String,
546    /// <p>The fully qualified domain name (FQDN) of the certificate that needs to be validated.</p>
547    #[serde(rename = "Domain")]
548    pub domain: String,
549    /// <p><p>The base validation domain that will act as the suffix of the email addresses that are used to send the emails. This must be the same as the <code>Domain</code> value or a superdomain of the <code>Domain</code> value. For example, if you requested a certificate for <code>site.subdomain.example.com</code> and specify a <b>ValidationDomain</b> of <code>subdomain.example.com</code>, ACM sends email to the domain registrant, technical contact, and administrative contact in WHOIS and the following five addresses:</p> <ul> <li> <p>admin@subdomain.example.com</p> </li> <li> <p>administrator@subdomain.example.com</p> </li> <li> <p>hostmaster@subdomain.example.com</p> </li> <li> <p>postmaster@subdomain.example.com</p> </li> <li> <p>webmaster@subdomain.example.com</p> </li> </ul></p>
550    #[serde(rename = "ValidationDomain")]
551    pub validation_domain: String,
552}
553
554/// <p>Contains a DNS record value that you can use to can use to validate ownership or control of a domain. This is used by the <a>DescribeCertificate</a> action. </p>
555#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
556#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
557pub struct ResourceRecord {
558    /// <p>The name of the DNS record to create in your domain. This is supplied by ACM.</p>
559    #[serde(rename = "Name")]
560    pub name: String,
561    /// <p>The type of DNS record. Currently this can be <code>CNAME</code>.</p>
562    #[serde(rename = "Type")]
563    pub type_: String,
564    /// <p>The value of the CNAME record to add to your DNS database. This is supplied by ACM.</p>
565    #[serde(rename = "Value")]
566    pub value: String,
567}
568
569/// <p>A key-value pair that identifies or specifies metadata about an ACM resource.</p>
570#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
571pub struct Tag {
572    /// <p>The key of the tag.</p>
573    #[serde(rename = "Key")]
574    pub key: String,
575    /// <p>The value of the tag.</p>
576    #[serde(rename = "Value")]
577    #[serde(skip_serializing_if = "Option::is_none")]
578    pub value: Option<String>,
579}
580
581#[derive(Clone, Debug, Default, PartialEq, Serialize)]
582#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
583pub struct UpdateCertificateOptionsRequest {
584    /// <p>ARN of the requested certificate to update. This must be of the form:</p> <p> <code>arn:aws:acm:us-east-1:<i>account</i>:certificate/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
585    #[serde(rename = "CertificateArn")]
586    pub certificate_arn: String,
587    /// <p>Use to update the options for your certificate. Currently, you can specify whether to add your certificate to a transparency log. Certificate transparency makes it possible to detect SSL/TLS certificates that have been mistakenly or maliciously issued. Certificates that have not been logged typically produce an error message in a browser. </p>
588    #[serde(rename = "Options")]
589    pub options: CertificateOptions,
590}
591
592/// Errors returned by AddTagsToCertificate
593#[derive(Debug, PartialEq)]
594pub enum AddTagsToCertificateError {
595    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
596    InvalidArn(String),
597    /// <p>An input parameter was invalid.</p>
598    InvalidParameter(String),
599    /// <p>One or both of the values that make up the key-value pair is not valid. For example, you cannot specify a tag value that begins with <code>aws:</code>.</p>
600    InvalidTag(String),
601    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
602    ResourceNotFound(String),
603    /// <p>A specified tag did not comply with an existing tag policy and was rejected.</p>
604    TagPolicy(String),
605    /// <p>The request contains too many tags. Try the request again with fewer tags.</p>
606    TooManyTags(String),
607}
608
609impl AddTagsToCertificateError {
610    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AddTagsToCertificateError> {
611        if let Some(err) = proto::json::Error::parse(&res) {
612            match err.typ.as_str() {
613                "InvalidArnException" => {
614                    return RusotoError::Service(AddTagsToCertificateError::InvalidArn(err.msg))
615                }
616                "InvalidParameterException" => {
617                    return RusotoError::Service(AddTagsToCertificateError::InvalidParameter(
618                        err.msg,
619                    ))
620                }
621                "InvalidTagException" => {
622                    return RusotoError::Service(AddTagsToCertificateError::InvalidTag(err.msg))
623                }
624                "ResourceNotFoundException" => {
625                    return RusotoError::Service(AddTagsToCertificateError::ResourceNotFound(
626                        err.msg,
627                    ))
628                }
629                "TagPolicyException" => {
630                    return RusotoError::Service(AddTagsToCertificateError::TagPolicy(err.msg))
631                }
632                "TooManyTagsException" => {
633                    return RusotoError::Service(AddTagsToCertificateError::TooManyTags(err.msg))
634                }
635                "ValidationException" => return RusotoError::Validation(err.msg),
636                _ => {}
637            }
638        }
639        RusotoError::Unknown(res)
640    }
641}
642impl fmt::Display for AddTagsToCertificateError {
643    #[allow(unused_variables)]
644    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
645        match *self {
646            AddTagsToCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
647            AddTagsToCertificateError::InvalidParameter(ref cause) => write!(f, "{}", cause),
648            AddTagsToCertificateError::InvalidTag(ref cause) => write!(f, "{}", cause),
649            AddTagsToCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
650            AddTagsToCertificateError::TagPolicy(ref cause) => write!(f, "{}", cause),
651            AddTagsToCertificateError::TooManyTags(ref cause) => write!(f, "{}", cause),
652        }
653    }
654}
655impl Error for AddTagsToCertificateError {}
656/// Errors returned by DeleteCertificate
657#[derive(Debug, PartialEq)]
658pub enum DeleteCertificateError {
659    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
660    InvalidArn(String),
661    /// <p>The certificate is in use by another AWS service in the caller's account. Remove the association and try again.</p>
662    ResourceInUse(String),
663    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
664    ResourceNotFound(String),
665}
666
667impl DeleteCertificateError {
668    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteCertificateError> {
669        if let Some(err) = proto::json::Error::parse(&res) {
670            match err.typ.as_str() {
671                "InvalidArnException" => {
672                    return RusotoError::Service(DeleteCertificateError::InvalidArn(err.msg))
673                }
674                "ResourceInUseException" => {
675                    return RusotoError::Service(DeleteCertificateError::ResourceInUse(err.msg))
676                }
677                "ResourceNotFoundException" => {
678                    return RusotoError::Service(DeleteCertificateError::ResourceNotFound(err.msg))
679                }
680                "ValidationException" => return RusotoError::Validation(err.msg),
681                _ => {}
682            }
683        }
684        RusotoError::Unknown(res)
685    }
686}
687impl fmt::Display for DeleteCertificateError {
688    #[allow(unused_variables)]
689    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
690        match *self {
691            DeleteCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
692            DeleteCertificateError::ResourceInUse(ref cause) => write!(f, "{}", cause),
693            DeleteCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
694        }
695    }
696}
697impl Error for DeleteCertificateError {}
698/// Errors returned by DescribeCertificate
699#[derive(Debug, PartialEq)]
700pub enum DescribeCertificateError {
701    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
702    InvalidArn(String),
703    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
704    ResourceNotFound(String),
705}
706
707impl DescribeCertificateError {
708    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeCertificateError> {
709        if let Some(err) = proto::json::Error::parse(&res) {
710            match err.typ.as_str() {
711                "InvalidArnException" => {
712                    return RusotoError::Service(DescribeCertificateError::InvalidArn(err.msg))
713                }
714                "ResourceNotFoundException" => {
715                    return RusotoError::Service(DescribeCertificateError::ResourceNotFound(
716                        err.msg,
717                    ))
718                }
719                "ValidationException" => return RusotoError::Validation(err.msg),
720                _ => {}
721            }
722        }
723        RusotoError::Unknown(res)
724    }
725}
726impl fmt::Display for DescribeCertificateError {
727    #[allow(unused_variables)]
728    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
729        match *self {
730            DescribeCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
731            DescribeCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
732        }
733    }
734}
735impl Error for DescribeCertificateError {}
736/// Errors returned by ExportCertificate
737#[derive(Debug, PartialEq)]
738pub enum ExportCertificateError {
739    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
740    InvalidArn(String),
741    /// <p>The certificate request is in process and the certificate in your account has not yet been issued.</p>
742    RequestInProgress(String),
743    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
744    ResourceNotFound(String),
745}
746
747impl ExportCertificateError {
748    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ExportCertificateError> {
749        if let Some(err) = proto::json::Error::parse(&res) {
750            match err.typ.as_str() {
751                "InvalidArnException" => {
752                    return RusotoError::Service(ExportCertificateError::InvalidArn(err.msg))
753                }
754                "RequestInProgressException" => {
755                    return RusotoError::Service(ExportCertificateError::RequestInProgress(err.msg))
756                }
757                "ResourceNotFoundException" => {
758                    return RusotoError::Service(ExportCertificateError::ResourceNotFound(err.msg))
759                }
760                "ValidationException" => return RusotoError::Validation(err.msg),
761                _ => {}
762            }
763        }
764        RusotoError::Unknown(res)
765    }
766}
767impl fmt::Display for ExportCertificateError {
768    #[allow(unused_variables)]
769    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
770        match *self {
771            ExportCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
772            ExportCertificateError::RequestInProgress(ref cause) => write!(f, "{}", cause),
773            ExportCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
774        }
775    }
776}
777impl Error for ExportCertificateError {}
778/// Errors returned by GetCertificate
779#[derive(Debug, PartialEq)]
780pub enum GetCertificateError {
781    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
782    InvalidArn(String),
783    /// <p>The certificate request is in process and the certificate in your account has not yet been issued.</p>
784    RequestInProgress(String),
785    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
786    ResourceNotFound(String),
787}
788
789impl GetCertificateError {
790    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetCertificateError> {
791        if let Some(err) = proto::json::Error::parse(&res) {
792            match err.typ.as_str() {
793                "InvalidArnException" => {
794                    return RusotoError::Service(GetCertificateError::InvalidArn(err.msg))
795                }
796                "RequestInProgressException" => {
797                    return RusotoError::Service(GetCertificateError::RequestInProgress(err.msg))
798                }
799                "ResourceNotFoundException" => {
800                    return RusotoError::Service(GetCertificateError::ResourceNotFound(err.msg))
801                }
802                "ValidationException" => return RusotoError::Validation(err.msg),
803                _ => {}
804            }
805        }
806        RusotoError::Unknown(res)
807    }
808}
809impl fmt::Display for GetCertificateError {
810    #[allow(unused_variables)]
811    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
812        match *self {
813            GetCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
814            GetCertificateError::RequestInProgress(ref cause) => write!(f, "{}", cause),
815            GetCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
816        }
817    }
818}
819impl Error for GetCertificateError {}
820/// Errors returned by ImportCertificate
821#[derive(Debug, PartialEq)]
822pub enum ImportCertificateError {
823    /// <p>An input parameter was invalid.</p>
824    InvalidParameter(String),
825    /// <p>One or both of the values that make up the key-value pair is not valid. For example, you cannot specify a tag value that begins with <code>aws:</code>.</p>
826    InvalidTag(String),
827    /// <p>An ACM quota has been exceeded.</p>
828    LimitExceeded(String),
829    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
830    ResourceNotFound(String),
831    /// <p>A specified tag did not comply with an existing tag policy and was rejected.</p>
832    TagPolicy(String),
833    /// <p>The request contains too many tags. Try the request again with fewer tags.</p>
834    TooManyTags(String),
835}
836
837impl ImportCertificateError {
838    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ImportCertificateError> {
839        if let Some(err) = proto::json::Error::parse(&res) {
840            match err.typ.as_str() {
841                "InvalidParameterException" => {
842                    return RusotoError::Service(ImportCertificateError::InvalidParameter(err.msg))
843                }
844                "InvalidTagException" => {
845                    return RusotoError::Service(ImportCertificateError::InvalidTag(err.msg))
846                }
847                "LimitExceededException" => {
848                    return RusotoError::Service(ImportCertificateError::LimitExceeded(err.msg))
849                }
850                "ResourceNotFoundException" => {
851                    return RusotoError::Service(ImportCertificateError::ResourceNotFound(err.msg))
852                }
853                "TagPolicyException" => {
854                    return RusotoError::Service(ImportCertificateError::TagPolicy(err.msg))
855                }
856                "TooManyTagsException" => {
857                    return RusotoError::Service(ImportCertificateError::TooManyTags(err.msg))
858                }
859                "ValidationException" => return RusotoError::Validation(err.msg),
860                _ => {}
861            }
862        }
863        RusotoError::Unknown(res)
864    }
865}
866impl fmt::Display for ImportCertificateError {
867    #[allow(unused_variables)]
868    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
869        match *self {
870            ImportCertificateError::InvalidParameter(ref cause) => write!(f, "{}", cause),
871            ImportCertificateError::InvalidTag(ref cause) => write!(f, "{}", cause),
872            ImportCertificateError::LimitExceeded(ref cause) => write!(f, "{}", cause),
873            ImportCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
874            ImportCertificateError::TagPolicy(ref cause) => write!(f, "{}", cause),
875            ImportCertificateError::TooManyTags(ref cause) => write!(f, "{}", cause),
876        }
877    }
878}
879impl Error for ImportCertificateError {}
880/// Errors returned by ListCertificates
881#[derive(Debug, PartialEq)]
882pub enum ListCertificatesError {
883    /// <p>One or more of of request parameters specified is not valid.</p>
884    InvalidArgs(String),
885}
886
887impl ListCertificatesError {
888    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListCertificatesError> {
889        if let Some(err) = proto::json::Error::parse(&res) {
890            match err.typ.as_str() {
891                "InvalidArgsException" => {
892                    return RusotoError::Service(ListCertificatesError::InvalidArgs(err.msg))
893                }
894                "ValidationException" => return RusotoError::Validation(err.msg),
895                _ => {}
896            }
897        }
898        RusotoError::Unknown(res)
899    }
900}
901impl fmt::Display for ListCertificatesError {
902    #[allow(unused_variables)]
903    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
904        match *self {
905            ListCertificatesError::InvalidArgs(ref cause) => write!(f, "{}", cause),
906        }
907    }
908}
909impl Error for ListCertificatesError {}
910/// Errors returned by ListTagsForCertificate
911#[derive(Debug, PartialEq)]
912pub enum ListTagsForCertificateError {
913    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
914    InvalidArn(String),
915    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
916    ResourceNotFound(String),
917}
918
919impl ListTagsForCertificateError {
920    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForCertificateError> {
921        if let Some(err) = proto::json::Error::parse(&res) {
922            match err.typ.as_str() {
923                "InvalidArnException" => {
924                    return RusotoError::Service(ListTagsForCertificateError::InvalidArn(err.msg))
925                }
926                "ResourceNotFoundException" => {
927                    return RusotoError::Service(ListTagsForCertificateError::ResourceNotFound(
928                        err.msg,
929                    ))
930                }
931                "ValidationException" => return RusotoError::Validation(err.msg),
932                _ => {}
933            }
934        }
935        RusotoError::Unknown(res)
936    }
937}
938impl fmt::Display for ListTagsForCertificateError {
939    #[allow(unused_variables)]
940    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
941        match *self {
942            ListTagsForCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
943            ListTagsForCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
944        }
945    }
946}
947impl Error for ListTagsForCertificateError {}
948/// Errors returned by RemoveTagsFromCertificate
949#[derive(Debug, PartialEq)]
950pub enum RemoveTagsFromCertificateError {
951    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
952    InvalidArn(String),
953    /// <p>An input parameter was invalid.</p>
954    InvalidParameter(String),
955    /// <p>One or both of the values that make up the key-value pair is not valid. For example, you cannot specify a tag value that begins with <code>aws:</code>.</p>
956    InvalidTag(String),
957    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
958    ResourceNotFound(String),
959    /// <p>A specified tag did not comply with an existing tag policy and was rejected.</p>
960    TagPolicy(String),
961}
962
963impl RemoveTagsFromCertificateError {
964    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RemoveTagsFromCertificateError> {
965        if let Some(err) = proto::json::Error::parse(&res) {
966            match err.typ.as_str() {
967                "InvalidArnException" => {
968                    return RusotoError::Service(RemoveTagsFromCertificateError::InvalidArn(
969                        err.msg,
970                    ))
971                }
972                "InvalidParameterException" => {
973                    return RusotoError::Service(RemoveTagsFromCertificateError::InvalidParameter(
974                        err.msg,
975                    ))
976                }
977                "InvalidTagException" => {
978                    return RusotoError::Service(RemoveTagsFromCertificateError::InvalidTag(
979                        err.msg,
980                    ))
981                }
982                "ResourceNotFoundException" => {
983                    return RusotoError::Service(RemoveTagsFromCertificateError::ResourceNotFound(
984                        err.msg,
985                    ))
986                }
987                "TagPolicyException" => {
988                    return RusotoError::Service(RemoveTagsFromCertificateError::TagPolicy(err.msg))
989                }
990                "ValidationException" => return RusotoError::Validation(err.msg),
991                _ => {}
992            }
993        }
994        RusotoError::Unknown(res)
995    }
996}
997impl fmt::Display for RemoveTagsFromCertificateError {
998    #[allow(unused_variables)]
999    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1000        match *self {
1001            RemoveTagsFromCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
1002            RemoveTagsFromCertificateError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1003            RemoveTagsFromCertificateError::InvalidTag(ref cause) => write!(f, "{}", cause),
1004            RemoveTagsFromCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1005            RemoveTagsFromCertificateError::TagPolicy(ref cause) => write!(f, "{}", cause),
1006        }
1007    }
1008}
1009impl Error for RemoveTagsFromCertificateError {}
1010/// Errors returned by RenewCertificate
1011#[derive(Debug, PartialEq)]
1012pub enum RenewCertificateError {
1013    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1014    InvalidArn(String),
1015    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
1016    ResourceNotFound(String),
1017}
1018
1019impl RenewCertificateError {
1020    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RenewCertificateError> {
1021        if let Some(err) = proto::json::Error::parse(&res) {
1022            match err.typ.as_str() {
1023                "InvalidArnException" => {
1024                    return RusotoError::Service(RenewCertificateError::InvalidArn(err.msg))
1025                }
1026                "ResourceNotFoundException" => {
1027                    return RusotoError::Service(RenewCertificateError::ResourceNotFound(err.msg))
1028                }
1029                "ValidationException" => return RusotoError::Validation(err.msg),
1030                _ => {}
1031            }
1032        }
1033        RusotoError::Unknown(res)
1034    }
1035}
1036impl fmt::Display for RenewCertificateError {
1037    #[allow(unused_variables)]
1038    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1039        match *self {
1040            RenewCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
1041            RenewCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1042        }
1043    }
1044}
1045impl Error for RenewCertificateError {}
1046/// Errors returned by RequestCertificate
1047#[derive(Debug, PartialEq)]
1048pub enum RequestCertificateError {
1049    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1050    InvalidArn(String),
1051    /// <p>One or more values in the <a>DomainValidationOption</a> structure is incorrect.</p>
1052    InvalidDomainValidationOptions(String),
1053    /// <p>An input parameter was invalid.</p>
1054    InvalidParameter(String),
1055    /// <p>One or both of the values that make up the key-value pair is not valid. For example, you cannot specify a tag value that begins with <code>aws:</code>.</p>
1056    InvalidTag(String),
1057    /// <p>An ACM quota has been exceeded.</p>
1058    LimitExceeded(String),
1059    /// <p>A specified tag did not comply with an existing tag policy and was rejected.</p>
1060    TagPolicy(String),
1061    /// <p>The request contains too many tags. Try the request again with fewer tags.</p>
1062    TooManyTags(String),
1063}
1064
1065impl RequestCertificateError {
1066    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RequestCertificateError> {
1067        if let Some(err) = proto::json::Error::parse(&res) {
1068            match err.typ.as_str() {
1069                "InvalidArnException" => {
1070                    return RusotoError::Service(RequestCertificateError::InvalidArn(err.msg))
1071                }
1072                "InvalidDomainValidationOptionsException" => {
1073                    return RusotoError::Service(
1074                        RequestCertificateError::InvalidDomainValidationOptions(err.msg),
1075                    )
1076                }
1077                "InvalidParameterException" => {
1078                    return RusotoError::Service(RequestCertificateError::InvalidParameter(err.msg))
1079                }
1080                "InvalidTagException" => {
1081                    return RusotoError::Service(RequestCertificateError::InvalidTag(err.msg))
1082                }
1083                "LimitExceededException" => {
1084                    return RusotoError::Service(RequestCertificateError::LimitExceeded(err.msg))
1085                }
1086                "TagPolicyException" => {
1087                    return RusotoError::Service(RequestCertificateError::TagPolicy(err.msg))
1088                }
1089                "TooManyTagsException" => {
1090                    return RusotoError::Service(RequestCertificateError::TooManyTags(err.msg))
1091                }
1092                "ValidationException" => return RusotoError::Validation(err.msg),
1093                _ => {}
1094            }
1095        }
1096        RusotoError::Unknown(res)
1097    }
1098}
1099impl fmt::Display for RequestCertificateError {
1100    #[allow(unused_variables)]
1101    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1102        match *self {
1103            RequestCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
1104            RequestCertificateError::InvalidDomainValidationOptions(ref cause) => {
1105                write!(f, "{}", cause)
1106            }
1107            RequestCertificateError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1108            RequestCertificateError::InvalidTag(ref cause) => write!(f, "{}", cause),
1109            RequestCertificateError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1110            RequestCertificateError::TagPolicy(ref cause) => write!(f, "{}", cause),
1111            RequestCertificateError::TooManyTags(ref cause) => write!(f, "{}", cause),
1112        }
1113    }
1114}
1115impl Error for RequestCertificateError {}
1116/// Errors returned by ResendValidationEmail
1117#[derive(Debug, PartialEq)]
1118pub enum ResendValidationEmailError {
1119    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1120    InvalidArn(String),
1121    /// <p>One or more values in the <a>DomainValidationOption</a> structure is incorrect.</p>
1122    InvalidDomainValidationOptions(String),
1123    /// <p>Processing has reached an invalid state.</p>
1124    InvalidState(String),
1125    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
1126    ResourceNotFound(String),
1127}
1128
1129impl ResendValidationEmailError {
1130    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ResendValidationEmailError> {
1131        if let Some(err) = proto::json::Error::parse(&res) {
1132            match err.typ.as_str() {
1133                "InvalidArnException" => {
1134                    return RusotoError::Service(ResendValidationEmailError::InvalidArn(err.msg))
1135                }
1136                "InvalidDomainValidationOptionsException" => {
1137                    return RusotoError::Service(
1138                        ResendValidationEmailError::InvalidDomainValidationOptions(err.msg),
1139                    )
1140                }
1141                "InvalidStateException" => {
1142                    return RusotoError::Service(ResendValidationEmailError::InvalidState(err.msg))
1143                }
1144                "ResourceNotFoundException" => {
1145                    return RusotoError::Service(ResendValidationEmailError::ResourceNotFound(
1146                        err.msg,
1147                    ))
1148                }
1149                "ValidationException" => return RusotoError::Validation(err.msg),
1150                _ => {}
1151            }
1152        }
1153        RusotoError::Unknown(res)
1154    }
1155}
1156impl fmt::Display for ResendValidationEmailError {
1157    #[allow(unused_variables)]
1158    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1159        match *self {
1160            ResendValidationEmailError::InvalidArn(ref cause) => write!(f, "{}", cause),
1161            ResendValidationEmailError::InvalidDomainValidationOptions(ref cause) => {
1162                write!(f, "{}", cause)
1163            }
1164            ResendValidationEmailError::InvalidState(ref cause) => write!(f, "{}", cause),
1165            ResendValidationEmailError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1166        }
1167    }
1168}
1169impl Error for ResendValidationEmailError {}
1170/// Errors returned by UpdateCertificateOptions
1171#[derive(Debug, PartialEq)]
1172pub enum UpdateCertificateOptionsError {
1173    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1174    InvalidArn(String),
1175    /// <p>Processing has reached an invalid state.</p>
1176    InvalidState(String),
1177    /// <p>An ACM quota has been exceeded.</p>
1178    LimitExceeded(String),
1179    /// <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
1180    ResourceNotFound(String),
1181}
1182
1183impl UpdateCertificateOptionsError {
1184    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateCertificateOptionsError> {
1185        if let Some(err) = proto::json::Error::parse(&res) {
1186            match err.typ.as_str() {
1187                "InvalidArnException" => {
1188                    return RusotoError::Service(UpdateCertificateOptionsError::InvalidArn(err.msg))
1189                }
1190                "InvalidStateException" => {
1191                    return RusotoError::Service(UpdateCertificateOptionsError::InvalidState(
1192                        err.msg,
1193                    ))
1194                }
1195                "LimitExceededException" => {
1196                    return RusotoError::Service(UpdateCertificateOptionsError::LimitExceeded(
1197                        err.msg,
1198                    ))
1199                }
1200                "ResourceNotFoundException" => {
1201                    return RusotoError::Service(UpdateCertificateOptionsError::ResourceNotFound(
1202                        err.msg,
1203                    ))
1204                }
1205                "ValidationException" => return RusotoError::Validation(err.msg),
1206                _ => {}
1207            }
1208        }
1209        RusotoError::Unknown(res)
1210    }
1211}
1212impl fmt::Display for UpdateCertificateOptionsError {
1213    #[allow(unused_variables)]
1214    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1215        match *self {
1216            UpdateCertificateOptionsError::InvalidArn(ref cause) => write!(f, "{}", cause),
1217            UpdateCertificateOptionsError::InvalidState(ref cause) => write!(f, "{}", cause),
1218            UpdateCertificateOptionsError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1219            UpdateCertificateOptionsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1220        }
1221    }
1222}
1223impl Error for UpdateCertificateOptionsError {}
1224/// Trait representing the capabilities of the ACM API. ACM clients implement this trait.
1225#[async_trait]
1226pub trait Acm {
1227    /// <p>Adds one or more tags to an ACM certificate. Tags are labels that you can use to identify and organize your AWS resources. Each tag consists of a <code>key</code> and an optional <code>value</code>. You specify the certificate on input by its Amazon Resource Name (ARN). You specify the tag by using a key-value pair. </p> <p>You can apply a tag to just one certificate if you want to identify a specific characteristic of that certificate, or you can apply the same tag to multiple certificates if you want to filter for a common relationship among those certificates. Similarly, you can apply the same tag to multiple resources if you want to specify a relationship among those resources. For example, you can add the same tag to an ACM certificate and an Elastic Load Balancing load balancer to indicate that they are both used by the same website. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/tags.html">Tagging ACM certificates</a>. </p> <p>To remove one or more tags, use the <a>RemoveTagsFromCertificate</a> action. To view all of the tags that have been applied to the certificate, use the <a>ListTagsForCertificate</a> action. </p>
1228    async fn add_tags_to_certificate(
1229        &self,
1230        input: AddTagsToCertificateRequest,
1231    ) -> Result<(), RusotoError<AddTagsToCertificateError>>;
1232
1233    /// <p><p>Deletes a certificate and its associated private key. If this action succeeds, the certificate no longer appears in the list that can be displayed by calling the <a>ListCertificates</a> action or be retrieved by calling the <a>GetCertificate</a> action. The certificate will not be available for use by AWS services integrated with ACM. </p> <note> <p>You cannot delete an ACM certificate that is being used by another AWS service. To delete a certificate that is in use, the certificate association must first be removed.</p> </note></p>
1234    async fn delete_certificate(
1235        &self,
1236        input: DeleteCertificateRequest,
1237    ) -> Result<(), RusotoError<DeleteCertificateError>>;
1238
1239    /// <p>Returns detailed metadata about the specified ACM certificate.</p>
1240    async fn describe_certificate(
1241        &self,
1242        input: DescribeCertificateRequest,
1243    ) -> Result<DescribeCertificateResponse, RusotoError<DescribeCertificateError>>;
1244
1245    /// <p>Exports a private certificate issued by a private certificate authority (CA) for use anywhere. The exported file contains the certificate, the certificate chain, and the encrypted private 2048-bit RSA key associated with the public key that is embedded in the certificate. For security, you must assign a passphrase for the private key when exporting it. </p> <p>For information about exporting and formatting a certificate using the ACM console or CLI, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-export-private.html">Export a Private Certificate</a>.</p>
1246    async fn export_certificate(
1247        &self,
1248        input: ExportCertificateRequest,
1249    ) -> Result<ExportCertificateResponse, RusotoError<ExportCertificateError>>;
1250
1251    /// <p>Retrieves an Amazon-issued certificate and its certificate chain. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs. All of the certificates are base64 encoded. You can use <a href="https://wiki.openssl.org/index.php/Command_Line_Utilities">OpenSSL</a> to decode the certificates and inspect individual fields.</p>
1252    async fn get_certificate(
1253        &self,
1254        input: GetCertificateRequest,
1255    ) -> Result<GetCertificateResponse, RusotoError<GetCertificateError>>;
1256
1257    /// <p>Imports a certificate into AWS Certificate Manager (ACM) to use with services that are integrated with ACM. Note that <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-services.html">integrated services</a> allow only certificate types and keys they support to be associated with their resources. Further, their support differs depending on whether the certificate is imported into IAM or into ACM. For more information, see the documentation for each service. For more information about importing certificates into ACM, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing Certificates</a> in the <i>AWS Certificate Manager User Guide</i>. </p> <note> <p>ACM does not provide <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html">managed renewal</a> for certificates that you import.</p> </note> <p>Note the following guidelines when importing third party certificates:</p> <ul> <li> <p>You must enter the private key that matches the certificate you are importing.</p> </li> <li> <p>The private key must be unencrypted. You cannot import a private key that is protected by a password or a passphrase.</p> </li> <li> <p>If the certificate you are importing is not self-signed, you must enter its certificate chain.</p> </li> <li> <p>If a certificate chain is included, the issuer must be the subject of one of the certificates in the chain.</p> </li> <li> <p>The certificate, private key, and certificate chain must be PEM-encoded.</p> </li> <li> <p>The current time must be between the <code>Not Before</code> and <code>Not After</code> certificate fields.</p> </li> <li> <p>The <code>Issuer</code> field must not be empty.</p> </li> <li> <p>The OCSP authority URL, if present, must not exceed 1000 characters.</p> </li> <li> <p>To import a new certificate, omit the <code>CertificateArn</code> argument. Include this argument only when you want to replace a previously imported certifica</p> </li> <li> <p>When you import a certificate by using the CLI, you must specify the certificate, the certificate chain, and the private key by their file names preceded by <code>file://</code>. For example, you can specify a certificate saved in the <code>C:\temp</code> folder as <code>file://C:\temp\certificate_to_import.pem</code>. If you are making an HTTP or HTTPS Query request, include these arguments as BLOBs. </p> </li> <li> <p>When you import a certificate by using an SDK, you must specify the certificate, the certificate chain, and the private key files in the manner required by the programming language you're using. </p> </li> <li> <p>The cryptographic algorithm of an imported certificate must match the algorithm of the signing CA. For example, if the signing CA key type is RSA, then the certificate key type must also be RSA.</p> </li> </ul> <p>This operation returns the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the imported certificate.</p>
1258    async fn import_certificate(
1259        &self,
1260        input: ImportCertificateRequest,
1261    ) -> Result<ImportCertificateResponse, RusotoError<ImportCertificateError>>;
1262
1263    /// <p>Retrieves a list of certificate ARNs and domain names. You can request that only certificates that match a specific status be listed. You can also filter by specific attributes of the certificate. Default filtering returns only <code>RSA_2048</code> certificates. For more information, see <a>Filters</a>.</p>
1264    async fn list_certificates(
1265        &self,
1266        input: ListCertificatesRequest,
1267    ) -> Result<ListCertificatesResponse, RusotoError<ListCertificatesError>>;
1268
1269    /// <p>Lists the tags that have been applied to the ACM certificate. Use the certificate's Amazon Resource Name (ARN) to specify the certificate. To add a tag to an ACM certificate, use the <a>AddTagsToCertificate</a> action. To delete a tag, use the <a>RemoveTagsFromCertificate</a> action. </p>
1270    async fn list_tags_for_certificate(
1271        &self,
1272        input: ListTagsForCertificateRequest,
1273    ) -> Result<ListTagsForCertificateResponse, RusotoError<ListTagsForCertificateError>>;
1274
1275    /// <p>Remove one or more tags from an ACM certificate. A tag consists of a key-value pair. If you do not specify the value portion of the tag when calling this function, the tag will be removed regardless of value. If you specify a value, the tag is removed only if it is associated with the specified value. </p> <p>To add tags to a certificate, use the <a>AddTagsToCertificate</a> action. To view all of the tags that have been applied to a specific ACM certificate, use the <a>ListTagsForCertificate</a> action. </p>
1276    async fn remove_tags_from_certificate(
1277        &self,
1278        input: RemoveTagsFromCertificateRequest,
1279    ) -> Result<(), RusotoError<RemoveTagsFromCertificateError>>;
1280
1281    /// <p>Renews an eligable ACM certificate. At this time, only exported private certificates can be renewed with this operation. In order to renew your ACM PCA certificates with ACM, you must first <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaPermissions.html">grant the ACM service principal permission to do so</a>. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/manual-renewal.html">Testing Managed Renewal</a> in the ACM User Guide.</p>
1282    async fn renew_certificate(
1283        &self,
1284        input: RenewCertificateRequest,
1285    ) -> Result<(), RusotoError<RenewCertificateError>>;
1286
1287    /// <p>Requests an ACM certificate for use with other AWS services. To request an ACM certificate, you must specify a fully qualified domain name (FQDN) in the <code>DomainName</code> parameter. You can also specify additional FQDNs in the <code>SubjectAlternativeNames</code> parameter. </p> <p>If you are requesting a private certificate, domain validation is not required. If you are requesting a public certificate, each domain name that you specify must be validated to verify that you own or control the domain. You can use <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html">DNS validation</a> or <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html">email validation</a>. We recommend that you use DNS validation. ACM issues public certificates after receiving approval from the domain owner. </p>
1288    async fn request_certificate(
1289        &self,
1290        input: RequestCertificateRequest,
1291    ) -> Result<RequestCertificateResponse, RusotoError<RequestCertificateError>>;
1292
1293    /// <p>Resends the email that requests domain ownership validation. The domain owner or an authorized representative must approve the ACM certificate before it can be issued. The certificate can be approved by clicking a link in the mail to navigate to the Amazon certificate approval website and then clicking <b>I Approve</b>. However, the validation email can be blocked by spam filters. Therefore, if you do not receive the original mail, you can request that the mail be resent within 72 hours of requesting the ACM certificate. If more than 72 hours have elapsed since your original request or since your last attempt to resend validation mail, you must request a new certificate. For more information about setting up your contact email addresses, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/setup-email.html">Configure Email for your Domain</a>. </p>
1294    async fn resend_validation_email(
1295        &self,
1296        input: ResendValidationEmailRequest,
1297    ) -> Result<(), RusotoError<ResendValidationEmailError>>;
1298
1299    /// <p>Updates a certificate. Currently, you can use this function to specify whether to opt in to or out of recording your certificate in a certificate transparency log. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-bestpractices.html#best-practices-transparency"> Opting Out of Certificate Transparency Logging</a>. </p>
1300    async fn update_certificate_options(
1301        &self,
1302        input: UpdateCertificateOptionsRequest,
1303    ) -> Result<(), RusotoError<UpdateCertificateOptionsError>>;
1304}
1305/// A client for the ACM API.
1306#[derive(Clone)]
1307pub struct AcmClient {
1308    client: Client,
1309    region: region::Region,
1310}
1311
1312impl AcmClient {
1313    /// Creates a client backed by the default tokio event loop.
1314    ///
1315    /// The client will use the default credentials provider and tls client.
1316    pub fn new(region: region::Region) -> AcmClient {
1317        AcmClient {
1318            client: Client::shared(),
1319            region,
1320        }
1321    }
1322
1323    pub fn new_with<P, D>(
1324        request_dispatcher: D,
1325        credentials_provider: P,
1326        region: region::Region,
1327    ) -> AcmClient
1328    where
1329        P: ProvideAwsCredentials + Send + Sync + 'static,
1330        D: DispatchSignedRequest + Send + Sync + 'static,
1331    {
1332        AcmClient {
1333            client: Client::new_with(credentials_provider, request_dispatcher),
1334            region,
1335        }
1336    }
1337
1338    pub fn new_with_client(client: Client, region: region::Region) -> AcmClient {
1339        AcmClient { client, region }
1340    }
1341}
1342
1343#[async_trait]
1344impl Acm for AcmClient {
1345    /// <p>Adds one or more tags to an ACM certificate. Tags are labels that you can use to identify and organize your AWS resources. Each tag consists of a <code>key</code> and an optional <code>value</code>. You specify the certificate on input by its Amazon Resource Name (ARN). You specify the tag by using a key-value pair. </p> <p>You can apply a tag to just one certificate if you want to identify a specific characteristic of that certificate, or you can apply the same tag to multiple certificates if you want to filter for a common relationship among those certificates. Similarly, you can apply the same tag to multiple resources if you want to specify a relationship among those resources. For example, you can add the same tag to an ACM certificate and an Elastic Load Balancing load balancer to indicate that they are both used by the same website. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/tags.html">Tagging ACM certificates</a>. </p> <p>To remove one or more tags, use the <a>RemoveTagsFromCertificate</a> action. To view all of the tags that have been applied to the certificate, use the <a>ListTagsForCertificate</a> action. </p>
1346    async fn add_tags_to_certificate(
1347        &self,
1348        input: AddTagsToCertificateRequest,
1349    ) -> Result<(), RusotoError<AddTagsToCertificateError>> {
1350        let mut request = self.new_signed_request("POST", "/");
1351        request.add_header("x-amz-target", "CertificateManager.AddTagsToCertificate");
1352        let encoded = serde_json::to_string(&input).unwrap();
1353        request.set_payload(Some(encoded));
1354
1355        let response = self
1356            .sign_and_dispatch(request, AddTagsToCertificateError::from_response)
1357            .await?;
1358        std::mem::drop(response);
1359        Ok(())
1360    }
1361
1362    /// <p><p>Deletes a certificate and its associated private key. If this action succeeds, the certificate no longer appears in the list that can be displayed by calling the <a>ListCertificates</a> action or be retrieved by calling the <a>GetCertificate</a> action. The certificate will not be available for use by AWS services integrated with ACM. </p> <note> <p>You cannot delete an ACM certificate that is being used by another AWS service. To delete a certificate that is in use, the certificate association must first be removed.</p> </note></p>
1363    async fn delete_certificate(
1364        &self,
1365        input: DeleteCertificateRequest,
1366    ) -> Result<(), RusotoError<DeleteCertificateError>> {
1367        let mut request = self.new_signed_request("POST", "/");
1368        request.add_header("x-amz-target", "CertificateManager.DeleteCertificate");
1369        let encoded = serde_json::to_string(&input).unwrap();
1370        request.set_payload(Some(encoded));
1371
1372        let response = self
1373            .sign_and_dispatch(request, DeleteCertificateError::from_response)
1374            .await?;
1375        std::mem::drop(response);
1376        Ok(())
1377    }
1378
1379    /// <p>Returns detailed metadata about the specified ACM certificate.</p>
1380    async fn describe_certificate(
1381        &self,
1382        input: DescribeCertificateRequest,
1383    ) -> Result<DescribeCertificateResponse, RusotoError<DescribeCertificateError>> {
1384        let mut request = self.new_signed_request("POST", "/");
1385        request.add_header("x-amz-target", "CertificateManager.DescribeCertificate");
1386        let encoded = serde_json::to_string(&input).unwrap();
1387        request.set_payload(Some(encoded));
1388
1389        let response = self
1390            .sign_and_dispatch(request, DescribeCertificateError::from_response)
1391            .await?;
1392        let mut response = response;
1393        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1394        proto::json::ResponsePayload::new(&response).deserialize::<DescribeCertificateResponse, _>()
1395    }
1396
1397    /// <p>Exports a private certificate issued by a private certificate authority (CA) for use anywhere. The exported file contains the certificate, the certificate chain, and the encrypted private 2048-bit RSA key associated with the public key that is embedded in the certificate. For security, you must assign a passphrase for the private key when exporting it. </p> <p>For information about exporting and formatting a certificate using the ACM console or CLI, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-export-private.html">Export a Private Certificate</a>.</p>
1398    async fn export_certificate(
1399        &self,
1400        input: ExportCertificateRequest,
1401    ) -> Result<ExportCertificateResponse, RusotoError<ExportCertificateError>> {
1402        let mut request = self.new_signed_request("POST", "/");
1403        request.add_header("x-amz-target", "CertificateManager.ExportCertificate");
1404        let encoded = serde_json::to_string(&input).unwrap();
1405        request.set_payload(Some(encoded));
1406
1407        let response = self
1408            .sign_and_dispatch(request, ExportCertificateError::from_response)
1409            .await?;
1410        let mut response = response;
1411        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1412        proto::json::ResponsePayload::new(&response).deserialize::<ExportCertificateResponse, _>()
1413    }
1414
1415    /// <p>Retrieves an Amazon-issued certificate and its certificate chain. The chain consists of the certificate of the issuing CA and the intermediate certificates of any other subordinate CAs. All of the certificates are base64 encoded. You can use <a href="https://wiki.openssl.org/index.php/Command_Line_Utilities">OpenSSL</a> to decode the certificates and inspect individual fields.</p>
1416    async fn get_certificate(
1417        &self,
1418        input: GetCertificateRequest,
1419    ) -> Result<GetCertificateResponse, RusotoError<GetCertificateError>> {
1420        let mut request = self.new_signed_request("POST", "/");
1421        request.add_header("x-amz-target", "CertificateManager.GetCertificate");
1422        let encoded = serde_json::to_string(&input).unwrap();
1423        request.set_payload(Some(encoded));
1424
1425        let response = self
1426            .sign_and_dispatch(request, GetCertificateError::from_response)
1427            .await?;
1428        let mut response = response;
1429        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1430        proto::json::ResponsePayload::new(&response).deserialize::<GetCertificateResponse, _>()
1431    }
1432
1433    /// <p>Imports a certificate into AWS Certificate Manager (ACM) to use with services that are integrated with ACM. Note that <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-services.html">integrated services</a> allow only certificate types and keys they support to be associated with their resources. Further, their support differs depending on whether the certificate is imported into IAM or into ACM. For more information, see the documentation for each service. For more information about importing certificates into ACM, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/import-certificate.html">Importing Certificates</a> in the <i>AWS Certificate Manager User Guide</i>. </p> <note> <p>ACM does not provide <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-renewal.html">managed renewal</a> for certificates that you import.</p> </note> <p>Note the following guidelines when importing third party certificates:</p> <ul> <li> <p>You must enter the private key that matches the certificate you are importing.</p> </li> <li> <p>The private key must be unencrypted. You cannot import a private key that is protected by a password or a passphrase.</p> </li> <li> <p>If the certificate you are importing is not self-signed, you must enter its certificate chain.</p> </li> <li> <p>If a certificate chain is included, the issuer must be the subject of one of the certificates in the chain.</p> </li> <li> <p>The certificate, private key, and certificate chain must be PEM-encoded.</p> </li> <li> <p>The current time must be between the <code>Not Before</code> and <code>Not After</code> certificate fields.</p> </li> <li> <p>The <code>Issuer</code> field must not be empty.</p> </li> <li> <p>The OCSP authority URL, if present, must not exceed 1000 characters.</p> </li> <li> <p>To import a new certificate, omit the <code>CertificateArn</code> argument. Include this argument only when you want to replace a previously imported certifica</p> </li> <li> <p>When you import a certificate by using the CLI, you must specify the certificate, the certificate chain, and the private key by their file names preceded by <code>file://</code>. For example, you can specify a certificate saved in the <code>C:\temp</code> folder as <code>file://C:\temp\certificate_to_import.pem</code>. If you are making an HTTP or HTTPS Query request, include these arguments as BLOBs. </p> </li> <li> <p>When you import a certificate by using an SDK, you must specify the certificate, the certificate chain, and the private key files in the manner required by the programming language you're using. </p> </li> <li> <p>The cryptographic algorithm of an imported certificate must match the algorithm of the signing CA. For example, if the signing CA key type is RSA, then the certificate key type must also be RSA.</p> </li> </ul> <p>This operation returns the <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Name (ARN)</a> of the imported certificate.</p>
1434    async fn import_certificate(
1435        &self,
1436        input: ImportCertificateRequest,
1437    ) -> Result<ImportCertificateResponse, RusotoError<ImportCertificateError>> {
1438        let mut request = self.new_signed_request("POST", "/");
1439        request.add_header("x-amz-target", "CertificateManager.ImportCertificate");
1440        let encoded = serde_json::to_string(&input).unwrap();
1441        request.set_payload(Some(encoded));
1442
1443        let response = self
1444            .sign_and_dispatch(request, ImportCertificateError::from_response)
1445            .await?;
1446        let mut response = response;
1447        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1448        proto::json::ResponsePayload::new(&response).deserialize::<ImportCertificateResponse, _>()
1449    }
1450
1451    /// <p>Retrieves a list of certificate ARNs and domain names. You can request that only certificates that match a specific status be listed. You can also filter by specific attributes of the certificate. Default filtering returns only <code>RSA_2048</code> certificates. For more information, see <a>Filters</a>.</p>
1452    async fn list_certificates(
1453        &self,
1454        input: ListCertificatesRequest,
1455    ) -> Result<ListCertificatesResponse, RusotoError<ListCertificatesError>> {
1456        let mut request = self.new_signed_request("POST", "/");
1457        request.add_header("x-amz-target", "CertificateManager.ListCertificates");
1458        let encoded = serde_json::to_string(&input).unwrap();
1459        request.set_payload(Some(encoded));
1460
1461        let response = self
1462            .sign_and_dispatch(request, ListCertificatesError::from_response)
1463            .await?;
1464        let mut response = response;
1465        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1466        proto::json::ResponsePayload::new(&response).deserialize::<ListCertificatesResponse, _>()
1467    }
1468
1469    /// <p>Lists the tags that have been applied to the ACM certificate. Use the certificate's Amazon Resource Name (ARN) to specify the certificate. To add a tag to an ACM certificate, use the <a>AddTagsToCertificate</a> action. To delete a tag, use the <a>RemoveTagsFromCertificate</a> action. </p>
1470    async fn list_tags_for_certificate(
1471        &self,
1472        input: ListTagsForCertificateRequest,
1473    ) -> Result<ListTagsForCertificateResponse, RusotoError<ListTagsForCertificateError>> {
1474        let mut request = self.new_signed_request("POST", "/");
1475        request.add_header("x-amz-target", "CertificateManager.ListTagsForCertificate");
1476        let encoded = serde_json::to_string(&input).unwrap();
1477        request.set_payload(Some(encoded));
1478
1479        let response = self
1480            .sign_and_dispatch(request, ListTagsForCertificateError::from_response)
1481            .await?;
1482        let mut response = response;
1483        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1484        proto::json::ResponsePayload::new(&response)
1485            .deserialize::<ListTagsForCertificateResponse, _>()
1486    }
1487
1488    /// <p>Remove one or more tags from an ACM certificate. A tag consists of a key-value pair. If you do not specify the value portion of the tag when calling this function, the tag will be removed regardless of value. If you specify a value, the tag is removed only if it is associated with the specified value. </p> <p>To add tags to a certificate, use the <a>AddTagsToCertificate</a> action. To view all of the tags that have been applied to a specific ACM certificate, use the <a>ListTagsForCertificate</a> action. </p>
1489    async fn remove_tags_from_certificate(
1490        &self,
1491        input: RemoveTagsFromCertificateRequest,
1492    ) -> Result<(), RusotoError<RemoveTagsFromCertificateError>> {
1493        let mut request = self.new_signed_request("POST", "/");
1494        request.add_header(
1495            "x-amz-target",
1496            "CertificateManager.RemoveTagsFromCertificate",
1497        );
1498        let encoded = serde_json::to_string(&input).unwrap();
1499        request.set_payload(Some(encoded));
1500
1501        let response = self
1502            .sign_and_dispatch(request, RemoveTagsFromCertificateError::from_response)
1503            .await?;
1504        std::mem::drop(response);
1505        Ok(())
1506    }
1507
1508    /// <p>Renews an eligable ACM certificate. At this time, only exported private certificates can be renewed with this operation. In order to renew your ACM PCA certificates with ACM, you must first <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/PcaPermissions.html">grant the ACM service principal permission to do so</a>. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/manual-renewal.html">Testing Managed Renewal</a> in the ACM User Guide.</p>
1509    async fn renew_certificate(
1510        &self,
1511        input: RenewCertificateRequest,
1512    ) -> Result<(), RusotoError<RenewCertificateError>> {
1513        let mut request = self.new_signed_request("POST", "/");
1514        request.add_header("x-amz-target", "CertificateManager.RenewCertificate");
1515        let encoded = serde_json::to_string(&input).unwrap();
1516        request.set_payload(Some(encoded));
1517
1518        let response = self
1519            .sign_and_dispatch(request, RenewCertificateError::from_response)
1520            .await?;
1521        std::mem::drop(response);
1522        Ok(())
1523    }
1524
1525    /// <p>Requests an ACM certificate for use with other AWS services. To request an ACM certificate, you must specify a fully qualified domain name (FQDN) in the <code>DomainName</code> parameter. You can also specify additional FQDNs in the <code>SubjectAlternativeNames</code> parameter. </p> <p>If you are requesting a private certificate, domain validation is not required. If you are requesting a public certificate, each domain name that you specify must be validated to verify that you own or control the domain. You can use <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html">DNS validation</a> or <a href="https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html">email validation</a>. We recommend that you use DNS validation. ACM issues public certificates after receiving approval from the domain owner. </p>
1526    async fn request_certificate(
1527        &self,
1528        input: RequestCertificateRequest,
1529    ) -> Result<RequestCertificateResponse, RusotoError<RequestCertificateError>> {
1530        let mut request = self.new_signed_request("POST", "/");
1531        request.add_header("x-amz-target", "CertificateManager.RequestCertificate");
1532        let encoded = serde_json::to_string(&input).unwrap();
1533        request.set_payload(Some(encoded));
1534
1535        let response = self
1536            .sign_and_dispatch(request, RequestCertificateError::from_response)
1537            .await?;
1538        let mut response = response;
1539        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1540        proto::json::ResponsePayload::new(&response).deserialize::<RequestCertificateResponse, _>()
1541    }
1542
1543    /// <p>Resends the email that requests domain ownership validation. The domain owner or an authorized representative must approve the ACM certificate before it can be issued. The certificate can be approved by clicking a link in the mail to navigate to the Amazon certificate approval website and then clicking <b>I Approve</b>. However, the validation email can be blocked by spam filters. Therefore, if you do not receive the original mail, you can request that the mail be resent within 72 hours of requesting the ACM certificate. If more than 72 hours have elapsed since your original request or since your last attempt to resend validation mail, you must request a new certificate. For more information about setting up your contact email addresses, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/setup-email.html">Configure Email for your Domain</a>. </p>
1544    async fn resend_validation_email(
1545        &self,
1546        input: ResendValidationEmailRequest,
1547    ) -> Result<(), RusotoError<ResendValidationEmailError>> {
1548        let mut request = self.new_signed_request("POST", "/");
1549        request.add_header("x-amz-target", "CertificateManager.ResendValidationEmail");
1550        let encoded = serde_json::to_string(&input).unwrap();
1551        request.set_payload(Some(encoded));
1552
1553        let response = self
1554            .sign_and_dispatch(request, ResendValidationEmailError::from_response)
1555            .await?;
1556        std::mem::drop(response);
1557        Ok(())
1558    }
1559
1560    /// <p>Updates a certificate. Currently, you can use this function to specify whether to opt in to or out of recording your certificate in a certificate transparency log. For more information, see <a href="https://docs.aws.amazon.com/acm/latest/userguide/acm-bestpractices.html#best-practices-transparency"> Opting Out of Certificate Transparency Logging</a>. </p>
1561    async fn update_certificate_options(
1562        &self,
1563        input: UpdateCertificateOptionsRequest,
1564    ) -> Result<(), RusotoError<UpdateCertificateOptionsError>> {
1565        let mut request = self.new_signed_request("POST", "/");
1566        request.add_header(
1567            "x-amz-target",
1568            "CertificateManager.UpdateCertificateOptions",
1569        );
1570        let encoded = serde_json::to_string(&input).unwrap();
1571        request.set_payload(Some(encoded));
1572
1573        let response = self
1574            .sign_and_dispatch(request, UpdateCertificateOptionsError::from_response)
1575            .await?;
1576        std::mem::drop(response);
1577        Ok(())
1578    }
1579}