rusoto_acm_pca/
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 AcmPcaClient {
29    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30        let mut request = SignedRequest::new(http_method, "acm-pca", &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/// <p>Contains information about the certificate subject. The certificate can be one issued by your private certificate authority (CA) or it can be your private CA certificate. The <b>Subject</b> field in the certificate identifies the entity that owns or controls the public key in the certificate. The entity can be a user, computer, device, or service. The <b>Subject</b> must contain an X.500 distinguished name (DN). A DN is a sequence of relative distinguished names (RDNs). The RDNs are separated by commas in the certificate. The DN must be unique for each entity, but your private CA can issue more than one certificate with the same DN to the same entity. </p>
54#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
55pub struct ASN1Subject {
56    /// <p>Fully qualified domain name (FQDN) associated with the certificate subject.</p>
57    #[serde(rename = "CommonName")]
58    #[serde(skip_serializing_if = "Option::is_none")]
59    pub common_name: Option<String>,
60    /// <p>Two-digit code that specifies the country in which the certificate subject located.</p>
61    #[serde(rename = "Country")]
62    #[serde(skip_serializing_if = "Option::is_none")]
63    pub country: Option<String>,
64    /// <p>Disambiguating information for the certificate subject.</p>
65    #[serde(rename = "DistinguishedNameQualifier")]
66    #[serde(skip_serializing_if = "Option::is_none")]
67    pub distinguished_name_qualifier: Option<String>,
68    /// <p>Typically a qualifier appended to the name of an individual. Examples include Jr. for junior, Sr. for senior, and III for third.</p>
69    #[serde(rename = "GenerationQualifier")]
70    #[serde(skip_serializing_if = "Option::is_none")]
71    pub generation_qualifier: Option<String>,
72    /// <p>First name.</p>
73    #[serde(rename = "GivenName")]
74    #[serde(skip_serializing_if = "Option::is_none")]
75    pub given_name: Option<String>,
76    /// <p>Concatenation that typically contains the first letter of the <b>GivenName</b>, the first letter of the middle name if one exists, and the first letter of the <b>SurName</b>.</p>
77    #[serde(rename = "Initials")]
78    #[serde(skip_serializing_if = "Option::is_none")]
79    pub initials: Option<String>,
80    /// <p>The locality (such as a city or town) in which the certificate subject is located.</p>
81    #[serde(rename = "Locality")]
82    #[serde(skip_serializing_if = "Option::is_none")]
83    pub locality: Option<String>,
84    /// <p>Legal name of the organization with which the certificate subject is affiliated. </p>
85    #[serde(rename = "Organization")]
86    #[serde(skip_serializing_if = "Option::is_none")]
87    pub organization: Option<String>,
88    /// <p>A subdivision or unit of the organization (such as sales or finance) with which the certificate subject is affiliated.</p>
89    #[serde(rename = "OrganizationalUnit")]
90    #[serde(skip_serializing_if = "Option::is_none")]
91    pub organizational_unit: Option<String>,
92    /// <p>Typically a shortened version of a longer <b>GivenName</b>. For example, Jonathan is often shortened to John. Elizabeth is often shortened to Beth, Liz, or Eliza.</p>
93    #[serde(rename = "Pseudonym")]
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub pseudonym: Option<String>,
96    /// <p>The certificate serial number.</p>
97    #[serde(rename = "SerialNumber")]
98    #[serde(skip_serializing_if = "Option::is_none")]
99    pub serial_number: Option<String>,
100    /// <p>State in which the subject of the certificate is located.</p>
101    #[serde(rename = "State")]
102    #[serde(skip_serializing_if = "Option::is_none")]
103    pub state: Option<String>,
104    /// <p>Family name. In the US and the UK, for example, the surname of an individual is ordered last. In Asian cultures the surname is typically ordered first.</p>
105    #[serde(rename = "Surname")]
106    #[serde(skip_serializing_if = "Option::is_none")]
107    pub surname: Option<String>,
108    /// <p>A title such as Mr. or Ms., which is pre-pended to the name to refer formally to the certificate subject.</p>
109    #[serde(rename = "Title")]
110    #[serde(skip_serializing_if = "Option::is_none")]
111    pub title: Option<String>,
112}
113
114/// <p>Contains information about your private certificate authority (CA). Your private CA can issue and revoke X.509 digital certificates. Digital certificates verify that the entity named in the certificate <b>Subject</b> field owns or controls the public key contained in the <b>Subject Public Key Info</b> field. Call the <a>CreateCertificateAuthority</a> action to create your private CA. You must then call the <a>GetCertificateAuthorityCertificate</a> action to retrieve a private CA certificate signing request (CSR). Sign the CSR with your ACM Private CA-hosted or on-premises root or subordinate CA certificate. Call the <a>ImportCertificateAuthorityCertificate</a> action to import the signed certificate into AWS Certificate Manager (ACM). </p>
115#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
116#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
117pub struct CertificateAuthority {
118    /// <p>Amazon Resource Name (ARN) for your private certificate authority (CA). The format is <code> <i>12345678-1234-1234-1234-123456789012</i> </code>.</p>
119    #[serde(rename = "Arn")]
120    #[serde(skip_serializing_if = "Option::is_none")]
121    pub arn: Option<String>,
122    /// <p>Your private CA configuration.</p>
123    #[serde(rename = "CertificateAuthorityConfiguration")]
124    #[serde(skip_serializing_if = "Option::is_none")]
125    pub certificate_authority_configuration: Option<CertificateAuthorityConfiguration>,
126    /// <p>Date and time at which your private CA was created.</p>
127    #[serde(rename = "CreatedAt")]
128    #[serde(skip_serializing_if = "Option::is_none")]
129    pub created_at: Option<f64>,
130    /// <p>Reason the request to create your private CA failed.</p>
131    #[serde(rename = "FailureReason")]
132    #[serde(skip_serializing_if = "Option::is_none")]
133    pub failure_reason: Option<String>,
134    /// <p>Date and time at which your private CA was last updated.</p>
135    #[serde(rename = "LastStateChangeAt")]
136    #[serde(skip_serializing_if = "Option::is_none")]
137    pub last_state_change_at: Option<f64>,
138    /// <p>Date and time after which your private CA certificate is not valid.</p>
139    #[serde(rename = "NotAfter")]
140    #[serde(skip_serializing_if = "Option::is_none")]
141    pub not_after: Option<f64>,
142    /// <p>Date and time before which your private CA certificate is not valid.</p>
143    #[serde(rename = "NotBefore")]
144    #[serde(skip_serializing_if = "Option::is_none")]
145    pub not_before: Option<f64>,
146    /// <p>The period during which a deleted CA can be restored. For more information, see the <code>PermanentDeletionTimeInDays</code> parameter of the <a>DeleteCertificateAuthorityRequest</a> action. </p>
147    #[serde(rename = "RestorableUntil")]
148    #[serde(skip_serializing_if = "Option::is_none")]
149    pub restorable_until: Option<f64>,
150    /// <p>Information about the certificate revocation list (CRL) created and maintained by your private CA. </p>
151    #[serde(rename = "RevocationConfiguration")]
152    #[serde(skip_serializing_if = "Option::is_none")]
153    pub revocation_configuration: Option<RevocationConfiguration>,
154    /// <p>Serial number of your private CA.</p>
155    #[serde(rename = "Serial")]
156    #[serde(skip_serializing_if = "Option::is_none")]
157    pub serial: Option<String>,
158    /// <p>Status of your private CA.</p>
159    #[serde(rename = "Status")]
160    #[serde(skip_serializing_if = "Option::is_none")]
161    pub status: Option<String>,
162    /// <p>Type of your private CA.</p>
163    #[serde(rename = "Type")]
164    #[serde(skip_serializing_if = "Option::is_none")]
165    pub type_: Option<String>,
166}
167
168/// <p>Contains configuration information for your private certificate authority (CA). This includes information about the class of public key algorithm and the key pair that your private CA creates when it issues a certificate. It also includes the signature algorithm that it uses when issuing certificates, and its X.500 distinguished name. You must specify this information when you call the <a>CreateCertificateAuthority</a> action. </p>
169#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
170pub struct CertificateAuthorityConfiguration {
171    /// <p>Type of the public key algorithm and size, in bits, of the key pair that your CA creates when it issues a certificate. When you create a subordinate CA, you must use a key algorithm supported by the parent CA.</p>
172    #[serde(rename = "KeyAlgorithm")]
173    pub key_algorithm: String,
174    /// <p>Name of the algorithm your private CA uses to sign certificate requests.</p>
175    #[serde(rename = "SigningAlgorithm")]
176    pub signing_algorithm: String,
177    /// <p>Structure that contains X.500 distinguished name information for your private CA.</p>
178    #[serde(rename = "Subject")]
179    pub subject: ASN1Subject,
180}
181
182#[derive(Clone, Debug, Default, PartialEq, Serialize)]
183#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
184pub struct CreateCertificateAuthorityAuditReportRequest {
185    /// <p>The format in which to create the report. This can be either <b>JSON</b> or <b>CSV</b>.</p>
186    #[serde(rename = "AuditReportResponseFormat")]
187    pub audit_report_response_format: String,
188    /// <p>The Amazon Resource Name (ARN) of the CA to be audited. This is of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>.</p>
189    #[serde(rename = "CertificateAuthorityArn")]
190    pub certificate_authority_arn: String,
191    /// <p>The name of the S3 bucket that will contain the audit report.</p>
192    #[serde(rename = "S3BucketName")]
193    pub s3_bucket_name: String,
194}
195
196#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
197#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
198pub struct CreateCertificateAuthorityAuditReportResponse {
199    /// <p>An alphanumeric string that contains a report identifier.</p>
200    #[serde(rename = "AuditReportId")]
201    #[serde(skip_serializing_if = "Option::is_none")]
202    pub audit_report_id: Option<String>,
203    /// <p>The <b>key</b> that uniquely identifies the report file in your S3 bucket.</p>
204    #[serde(rename = "S3Key")]
205    #[serde(skip_serializing_if = "Option::is_none")]
206    pub s3_key: Option<String>,
207}
208
209#[derive(Clone, Debug, Default, PartialEq, Serialize)]
210#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
211pub struct CreateCertificateAuthorityRequest {
212    /// <p>Name and bit size of the private key algorithm, the name of the signing algorithm, and X.500 certificate subject information.</p>
213    #[serde(rename = "CertificateAuthorityConfiguration")]
214    pub certificate_authority_configuration: CertificateAuthorityConfiguration,
215    /// <p>The type of the certificate authority.</p>
216    #[serde(rename = "CertificateAuthorityType")]
217    pub certificate_authority_type: String,
218    /// <p>Alphanumeric string that can be used to distinguish between calls to <b>CreateCertificateAuthority</b>. Idempotency tokens time out after five minutes. Therefore, if you call <b>CreateCertificateAuthority</b> multiple times with the same idempotency token within a five minute period, ACM Private CA recognizes that you are requesting only one certificate. As a result, ACM Private CA issues only one. If you change the idempotency token for each call, however, ACM Private CA recognizes that you are requesting multiple certificates.</p>
219    #[serde(rename = "IdempotencyToken")]
220    #[serde(skip_serializing_if = "Option::is_none")]
221    pub idempotency_token: Option<String>,
222    /// <p>Contains a Boolean value that you can use to enable a certification revocation list (CRL) for the CA, the name of the S3 bucket to which ACM Private CA will write the CRL, and an optional CNAME alias that you can use to hide the name of your bucket in the <b>CRL Distribution Points</b> extension of your CA certificate. For more information, see the <a>CrlConfiguration</a> structure. </p>
223    #[serde(rename = "RevocationConfiguration")]
224    #[serde(skip_serializing_if = "Option::is_none")]
225    pub revocation_configuration: Option<RevocationConfiguration>,
226    /// <p>Key-value pairs that will be attached to the new private CA. You can associate up to 50 tags with a private CA. For information using tags with </p> <p>IAM to manage permissions, see <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html">Controlling Access Using IAM Tags</a>.</p>
227    #[serde(rename = "Tags")]
228    #[serde(skip_serializing_if = "Option::is_none")]
229    pub tags: Option<Vec<Tag>>,
230}
231
232#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
233#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
234pub struct CreateCertificateAuthorityResponse {
235    /// <p>If successful, the Amazon Resource Name (ARN) of the certificate authority (CA). This is of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
236    #[serde(rename = "CertificateAuthorityArn")]
237    #[serde(skip_serializing_if = "Option::is_none")]
238    pub certificate_authority_arn: Option<String>,
239}
240
241#[derive(Clone, Debug, Default, PartialEq, Serialize)]
242#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
243pub struct CreatePermissionRequest {
244    /// <p>The actions that the specified AWS service principal can use. These include <code>IssueCertificate</code>, <code>GetCertificate</code>, and <code>ListPermissions</code>.</p>
245    #[serde(rename = "Actions")]
246    pub actions: Vec<String>,
247    /// <p>The Amazon Resource Name (ARN) of the CA that grants the permissions. You can find the ARN by calling the <a>ListCertificateAuthorities</a> action. This must have the following form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
248    #[serde(rename = "CertificateAuthorityArn")]
249    pub certificate_authority_arn: String,
250    /// <p>The AWS service or identity that receives the permission. At this time, the only valid principal is <code>acm.amazonaws.com</code>.</p>
251    #[serde(rename = "Principal")]
252    pub principal: String,
253    /// <p>The ID of the calling account.</p>
254    #[serde(rename = "SourceAccount")]
255    #[serde(skip_serializing_if = "Option::is_none")]
256    pub source_account: Option<String>,
257}
258
259/// <p>Contains configuration information for a certificate revocation list (CRL). Your private certificate authority (CA) creates base CRLs. Delta CRLs are not supported. You can enable CRLs for your new or an existing private CA by setting the <b>Enabled</b> parameter to <code>true</code>. Your private CA writes CRLs to an S3 bucket that you specify in the <b>S3BucketName</b> parameter. You can hide the name of your bucket by specifying a value for the <b>CustomCname</b> parameter. Your private CA copies the CNAME or the S3 bucket name to the <b>CRL Distribution Points</b> extension of each certificate it issues. Your S3 bucket policy must give write permission to ACM Private CA. </p> <p>Your private CA uses the value in the <b>ExpirationInDays</b> parameter to calculate the <b>nextUpdate</b> field in the CRL. The CRL is refreshed at 1/2 the age of next update or when a certificate is revoked. When a certificate is revoked, it is recorded in the next CRL that is generated and in the next audit report. Only time valid certificates are listed in the CRL. Expired certificates are not included. </p> <p>CRLs contain the following fields:</p> <ul> <li> <p> <b>Version</b>: The current version number defined in RFC 5280 is V2. The integer value is 0x1. </p> </li> <li> <p> <b>Signature Algorithm</b>: The name of the algorithm used to sign the CRL.</p> </li> <li> <p> <b>Issuer</b>: The X.500 distinguished name of your private CA that issued the CRL.</p> </li> <li> <p> <b>Last Update</b>: The issue date and time of this CRL.</p> </li> <li> <p> <b>Next Update</b>: The day and time by which the next CRL will be issued.</p> </li> <li> <p> <b>Revoked Certificates</b>: List of revoked certificates. Each list item contains the following information.</p> <ul> <li> <p> <b>Serial Number</b>: The serial number, in hexadecimal format, of the revoked certificate.</p> </li> <li> <p> <b>Revocation Date</b>: Date and time the certificate was revoked.</p> </li> <li> <p> <b>CRL Entry Extensions</b>: Optional extensions for the CRL entry.</p> <ul> <li> <p> <b>X509v3 CRL Reason Code</b>: Reason the certificate was revoked.</p> </li> </ul> </li> </ul> </li> <li> <p> <b>CRL Extensions</b>: Optional extensions for the CRL.</p> <ul> <li> <p> <b>X509v3 Authority Key Identifier</b>: Identifies the public key associated with the private key used to sign the certificate.</p> </li> <li> <p> <b>X509v3 CRL Number:</b>: Decimal sequence number for the CRL.</p> </li> </ul> </li> <li> <p> <b>Signature Algorithm</b>: Algorithm used by your private CA to sign the CRL.</p> </li> <li> <p> <b>Signature Value</b>: Signature computed over the CRL.</p> </li> </ul> <p>Certificate revocation lists created by ACM Private CA are DER-encoded. You can use the following OpenSSL command to list a CRL.</p> <p> <code>openssl crl -inform DER -text -in <i>crl_path</i> -noout</code> </p>
260#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
261pub struct CrlConfiguration {
262    /// <p>Name inserted into the certificate <b>CRL Distribution Points</b> extension that enables the use of an alias for the CRL distribution point. Use this value if you don't want the name of your S3 bucket to be public.</p>
263    #[serde(rename = "CustomCname")]
264    #[serde(skip_serializing_if = "Option::is_none")]
265    pub custom_cname: Option<String>,
266    /// <p>Boolean value that specifies whether certificate revocation lists (CRLs) are enabled. You can use this value to enable certificate revocation for a new CA when you call the <a>CreateCertificateAuthority</a> action or for an existing CA when you call the <a>UpdateCertificateAuthority</a> action. </p>
267    #[serde(rename = "Enabled")]
268    pub enabled: bool,
269    /// <p>Number of days until a certificate expires.</p>
270    #[serde(rename = "ExpirationInDays")]
271    #[serde(skip_serializing_if = "Option::is_none")]
272    pub expiration_in_days: Option<i64>,
273    /// <p>Name of the S3 bucket that contains the CRL. If you do not provide a value for the <b>CustomCname</b> argument, the name of your S3 bucket is placed into the <b>CRL Distribution Points</b> extension of the issued certificate. You can change the name of your bucket by calling the <a>UpdateCertificateAuthority</a> action. You must specify a bucket policy that allows ACM Private CA to write the CRL to your bucket.</p>
274    #[serde(rename = "S3BucketName")]
275    #[serde(skip_serializing_if = "Option::is_none")]
276    pub s3_bucket_name: Option<String>,
277}
278
279#[derive(Clone, Debug, Default, PartialEq, Serialize)]
280#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
281pub struct DeleteCertificateAuthorityRequest {
282    /// <p>The Amazon Resource Name (ARN) that was returned when you called <a>CreateCertificateAuthority</a>. This must have the following form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
283    #[serde(rename = "CertificateAuthorityArn")]
284    pub certificate_authority_arn: String,
285    /// <p>The number of days to make a CA restorable after it has been deleted. This can be anywhere from 7 to 30 days, with 30 being the default.</p>
286    #[serde(rename = "PermanentDeletionTimeInDays")]
287    #[serde(skip_serializing_if = "Option::is_none")]
288    pub permanent_deletion_time_in_days: Option<i64>,
289}
290
291#[derive(Clone, Debug, Default, PartialEq, Serialize)]
292#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
293pub struct DeletePermissionRequest {
294    /// <p>The Amazon Resource Number (ARN) of the private CA that issued the permissions. You can find the CA's ARN by calling the <a>ListCertificateAuthorities</a> action. This must have the following form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
295    #[serde(rename = "CertificateAuthorityArn")]
296    pub certificate_authority_arn: String,
297    /// <p>The AWS service or identity that will have its CA permissions revoked. At this time, the only valid service principal is <code>acm.amazonaws.com</code> </p>
298    #[serde(rename = "Principal")]
299    pub principal: String,
300    /// <p>The AWS account that calls this action.</p>
301    #[serde(rename = "SourceAccount")]
302    #[serde(skip_serializing_if = "Option::is_none")]
303    pub source_account: Option<String>,
304}
305
306#[derive(Clone, Debug, Default, PartialEq, Serialize)]
307#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
308pub struct DescribeCertificateAuthorityAuditReportRequest {
309    /// <p>The report ID returned by calling the <a>CreateCertificateAuthorityAuditReport</a> action.</p>
310    #[serde(rename = "AuditReportId")]
311    pub audit_report_id: String,
312    /// <p>The Amazon Resource Name (ARN) of the private CA. This must be of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
313    #[serde(rename = "CertificateAuthorityArn")]
314    pub certificate_authority_arn: String,
315}
316
317#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
318#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
319pub struct DescribeCertificateAuthorityAuditReportResponse {
320    /// <p>Specifies whether report creation is in progress, has succeeded, or has failed.</p>
321    #[serde(rename = "AuditReportStatus")]
322    #[serde(skip_serializing_if = "Option::is_none")]
323    pub audit_report_status: Option<String>,
324    /// <p>The date and time at which the report was created.</p>
325    #[serde(rename = "CreatedAt")]
326    #[serde(skip_serializing_if = "Option::is_none")]
327    pub created_at: Option<f64>,
328    /// <p>Name of the S3 bucket that contains the report.</p>
329    #[serde(rename = "S3BucketName")]
330    #[serde(skip_serializing_if = "Option::is_none")]
331    pub s3_bucket_name: Option<String>,
332    /// <p>S3 <b>key</b> that uniquely identifies the report file in your S3 bucket.</p>
333    #[serde(rename = "S3Key")]
334    #[serde(skip_serializing_if = "Option::is_none")]
335    pub s3_key: Option<String>,
336}
337
338#[derive(Clone, Debug, Default, PartialEq, Serialize)]
339#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
340pub struct DescribeCertificateAuthorityRequest {
341    /// <p>The Amazon Resource Name (ARN) that was returned when you called <a>CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
342    #[serde(rename = "CertificateAuthorityArn")]
343    pub certificate_authority_arn: String,
344}
345
346#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
347#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
348pub struct DescribeCertificateAuthorityResponse {
349    /// <p>A <a>CertificateAuthority</a> structure that contains information about your private CA.</p>
350    #[serde(rename = "CertificateAuthority")]
351    #[serde(skip_serializing_if = "Option::is_none")]
352    pub certificate_authority: Option<CertificateAuthority>,
353}
354
355#[derive(Clone, Debug, Default, PartialEq, Serialize)]
356#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
357pub struct GetCertificateAuthorityCertificateRequest {
358    /// <p>The Amazon Resource Name (ARN) of your private CA. This is of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
359    #[serde(rename = "CertificateAuthorityArn")]
360    pub certificate_authority_arn: String,
361}
362
363#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
364#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
365pub struct GetCertificateAuthorityCertificateResponse {
366    /// <p>Base64-encoded certificate authority (CA) certificate.</p>
367    #[serde(rename = "Certificate")]
368    #[serde(skip_serializing_if = "Option::is_none")]
369    pub certificate: Option<String>,
370    /// <p>Base64-encoded certificate chain that includes any intermediate certificates and chains up to root on-premises certificate that you used to sign your private CA certificate. The chain does not include your private CA certificate. If this is a root CA, the value will be null.</p>
371    #[serde(rename = "CertificateChain")]
372    #[serde(skip_serializing_if = "Option::is_none")]
373    pub certificate_chain: Option<String>,
374}
375
376#[derive(Clone, Debug, Default, PartialEq, Serialize)]
377#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
378pub struct GetCertificateAuthorityCsrRequest {
379    /// <p>The Amazon Resource Name (ARN) that was returned when you called the <a>CreateCertificateAuthority</a> action. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
380    #[serde(rename = "CertificateAuthorityArn")]
381    pub certificate_authority_arn: String,
382}
383
384#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
385#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
386pub struct GetCertificateAuthorityCsrResponse {
387    /// <p>The base64 PEM-encoded certificate signing request (CSR) for your private CA certificate.</p>
388    #[serde(rename = "Csr")]
389    #[serde(skip_serializing_if = "Option::is_none")]
390    pub csr: Option<String>,
391}
392
393#[derive(Clone, Debug, Default, PartialEq, Serialize)]
394#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
395pub struct GetCertificateRequest {
396    /// <p>The ARN of the issued certificate. The ARN contains the certificate serial number and must be in the following form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>/certificate/<i>286535153982981100925020015808220737245</i> </code> </p>
397    #[serde(rename = "CertificateArn")]
398    pub certificate_arn: String,
399    /// <p>The Amazon Resource Name (ARN) that was returned when you called <a>CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code>. </p>
400    #[serde(rename = "CertificateAuthorityArn")]
401    pub certificate_authority_arn: String,
402}
403
404#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
405#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
406pub struct GetCertificateResponse {
407    /// <p>The base64 PEM-encoded certificate specified by the <code>CertificateArn</code> parameter.</p>
408    #[serde(rename = "Certificate")]
409    #[serde(skip_serializing_if = "Option::is_none")]
410    pub certificate: Option<String>,
411    /// <p>The base64 PEM-encoded certificate chain that chains up to the on-premises root CA certificate that you used to sign your private CA certificate. </p>
412    #[serde(rename = "CertificateChain")]
413    #[serde(skip_serializing_if = "Option::is_none")]
414    pub certificate_chain: Option<String>,
415}
416
417#[derive(Clone, Debug, Default, PartialEq, Serialize)]
418#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
419pub struct ImportCertificateAuthorityCertificateRequest {
420    /// <p>The PEM-encoded certificate for a private CA. This may be a self-signed certificate in the case of a root CA, or it may be signed by another CA that you control.</p>
421    #[serde(rename = "Certificate")]
422    #[serde(
423        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
424        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
425        default
426    )]
427    pub certificate: bytes::Bytes,
428    /// <p>The Amazon Resource Name (ARN) that was returned when you called <a>CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
429    #[serde(rename = "CertificateAuthorityArn")]
430    pub certificate_authority_arn: String,
431    /// <p>A PEM-encoded file that contains all of your certificates, other than the certificate you're importing, chaining up to your root CA. Your ACM Private CA-hosted or on-premises root certificate is the last in the chain, and each certificate in the chain signs the one preceding. </p> <p>This parameter must be supplied when you import a subordinate CA. When you import a root CA, there is no chain.</p>
432    #[serde(rename = "CertificateChain")]
433    #[serde(
434        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
435        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
436        default
437    )]
438    #[serde(skip_serializing_if = "Option::is_none")]
439    pub certificate_chain: Option<bytes::Bytes>,
440}
441
442#[derive(Clone, Debug, Default, PartialEq, Serialize)]
443#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
444pub struct IssueCertificateRequest {
445    /// <p>The Amazon Resource Name (ARN) that was returned when you called <a>CreateCertificateAuthority</a>. This must be of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
446    #[serde(rename = "CertificateAuthorityArn")]
447    pub certificate_authority_arn: String,
448    /// <p>The certificate signing request (CSR) for the certificate you want to issue. You can use the following OpenSSL command to create the CSR and a 2048 bit RSA private key. </p> <p> <code>openssl req -new -newkey rsa:2048 -days 365 -keyout private/test_cert_priv_key.pem -out csr/test_cert_.csr</code> </p> <p>If you have a configuration file, you can use the following OpenSSL command. The <code>usr_cert</code> block in the configuration file contains your X509 version 3 extensions. </p> <p> <code>openssl req -new -config openssl_rsa.cnf -extensions usr_cert -newkey rsa:2048 -days -365 -keyout private/test_cert_priv_key.pem -out csr/test_cert_.csr</code> </p>
449    #[serde(rename = "Csr")]
450    #[serde(
451        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
452        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
453        default
454    )]
455    pub csr: bytes::Bytes,
456    /// <p>Custom string that can be used to distinguish between calls to the <b>IssueCertificate</b> action. Idempotency tokens time out after one hour. Therefore, if you call <b>IssueCertificate</b> multiple times with the same idempotency token within 5 minutes, ACM Private CA recognizes that you are requesting only one certificate and will issue only one. If you change the idempotency token for each call, PCA recognizes that you are requesting multiple certificates.</p>
457    #[serde(rename = "IdempotencyToken")]
458    #[serde(skip_serializing_if = "Option::is_none")]
459    pub idempotency_token: Option<String>,
460    /// <p>The name of the algorithm that will be used to sign the certificate to be issued.</p>
461    #[serde(rename = "SigningAlgorithm")]
462    pub signing_algorithm: String,
463    /// <p>Specifies a custom configuration template to use when issuing a certificate. If this parameter is not provided, ACM Private CA defaults to the <code>EndEntityCertificate/V1</code> template.</p> <p>The following service-owned <code>TemplateArn</code> values are supported by ACM Private CA: </p> <ul> <li> <p>arn:aws:acm-pca:::template/EndEntityCertificate/V1</p> </li> <li> <p>arn:aws:acm-pca:::template/SubordinateCACertificate_PathLen0/V1</p> </li> <li> <p>arn:aws:acm-pca:::template/SubordinateCACertificate_PathLen1/V1</p> </li> <li> <p>arn:aws:acm-pca:::template/SubordinateCACertificate_PathLen2/V1</p> </li> <li> <p>arn:aws:acm-pca:::template/SubordinateCACertificate_PathLen3/V1</p> </li> <li> <p>arn:aws:acm-pca:::template/RootCACertificate/V1</p> </li> </ul> <p>For more information, see <a href="https://docs.aws.amazon.com/acm-pca/latest/userguide/UsingTemplates.html">Using Templates</a>.</p>
464    #[serde(rename = "TemplateArn")]
465    #[serde(skip_serializing_if = "Option::is_none")]
466    pub template_arn: Option<String>,
467    /// <p>The type of the validity period.</p>
468    #[serde(rename = "Validity")]
469    pub validity: Validity,
470}
471
472#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
473#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
474pub struct IssueCertificateResponse {
475    /// <p>The Amazon Resource Name (ARN) of the issued certificate and the certificate serial number. This is of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i>/certificate/<i>286535153982981100925020015808220737245</i> </code> </p>
476    #[serde(rename = "CertificateArn")]
477    #[serde(skip_serializing_if = "Option::is_none")]
478    pub certificate_arn: Option<String>,
479}
480
481#[derive(Clone, Debug, Default, PartialEq, Serialize)]
482#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
483pub struct ListCertificateAuthoritiesRequest {
484    /// <p>Use this parameter when paginating results to specify the maximum number of items to return in the response on each page. 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>
485    #[serde(rename = "MaxResults")]
486    #[serde(skip_serializing_if = "Option::is_none")]
487    pub max_results: Option<i64>,
488    /// <p>Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of the <code>NextToken</code> parameter from the response you just received.</p>
489    #[serde(rename = "NextToken")]
490    #[serde(skip_serializing_if = "Option::is_none")]
491    pub next_token: Option<String>,
492}
493
494#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
495#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
496pub struct ListCertificateAuthoritiesResponse {
497    /// <p>Summary information about each certificate authority you have created.</p>
498    #[serde(rename = "CertificateAuthorities")]
499    #[serde(skip_serializing_if = "Option::is_none")]
500    pub certificate_authorities: Option<Vec<CertificateAuthority>>,
501    /// <p>When the list is truncated, this value is present and should be used for the <code>NextToken</code> parameter in a subsequent pagination request.</p>
502    #[serde(rename = "NextToken")]
503    #[serde(skip_serializing_if = "Option::is_none")]
504    pub next_token: Option<String>,
505}
506
507#[derive(Clone, Debug, Default, PartialEq, Serialize)]
508#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
509pub struct ListPermissionsRequest {
510    /// <p>The Amazon Resource Number (ARN) of the private CA to inspect. You can find the ARN by calling the <a>ListCertificateAuthorities</a> action. This must be of the form: <code>arn:aws:acm-pca:region:account:certificate-authority/12345678-1234-1234-1234-123456789012</code> You can get a private CA's ARN by running the <a>ListCertificateAuthorities</a> action.</p>
511    #[serde(rename = "CertificateAuthorityArn")]
512    pub certificate_authority_arn: String,
513    /// <p>When paginating results, use this parameter to specify the maximum number of items to return in the response. If additional items exist beyond the number you specify, the <b>NextToken</b> element is sent in the response. Use this <b>NextToken</b> value in a subsequent request to retrieve additional items.</p>
514    #[serde(rename = "MaxResults")]
515    #[serde(skip_serializing_if = "Option::is_none")]
516    pub max_results: Option<i64>,
517    /// <p>When paginating results, use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of <b>NextToken</b> from the response you just received.</p>
518    #[serde(rename = "NextToken")]
519    #[serde(skip_serializing_if = "Option::is_none")]
520    pub next_token: Option<String>,
521}
522
523#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
524#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
525pub struct ListPermissionsResponse {
526    /// <p>When the list is truncated, this value is present and should be used for the <b>NextToken</b> parameter in a subsequent pagination request. </p>
527    #[serde(rename = "NextToken")]
528    #[serde(skip_serializing_if = "Option::is_none")]
529    pub next_token: Option<String>,
530    /// <p>Summary information about each permission assigned by the specified private CA, including the action enabled, the policy provided, and the time of creation.</p>
531    #[serde(rename = "Permissions")]
532    #[serde(skip_serializing_if = "Option::is_none")]
533    pub permissions: Option<Vec<Permission>>,
534}
535
536#[derive(Clone, Debug, Default, PartialEq, Serialize)]
537#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
538pub struct ListTagsRequest {
539    /// <p>The Amazon Resource Name (ARN) that was returned when you called the <a>CreateCertificateAuthority</a> action. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
540    #[serde(rename = "CertificateAuthorityArn")]
541    pub certificate_authority_arn: String,
542    /// <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 <b>NextToken</b> element is sent in the response. Use this <b>NextToken</b> value in a subsequent request to retrieve additional items.</p>
543    #[serde(rename = "MaxResults")]
544    #[serde(skip_serializing_if = "Option::is_none")]
545    pub max_results: Option<i64>,
546    /// <p>Use this parameter when paginating results in a subsequent request after you receive a response with truncated results. Set it to the value of <b>NextToken</b> from the response you just received.</p>
547    #[serde(rename = "NextToken")]
548    #[serde(skip_serializing_if = "Option::is_none")]
549    pub next_token: Option<String>,
550}
551
552#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
553#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
554pub struct ListTagsResponse {
555    /// <p>When the list is truncated, this value is present and should be used for the <b>NextToken</b> parameter in a subsequent pagination request. </p>
556    #[serde(rename = "NextToken")]
557    #[serde(skip_serializing_if = "Option::is_none")]
558    pub next_token: Option<String>,
559    /// <p>The tags associated with your private CA.</p>
560    #[serde(rename = "Tags")]
561    #[serde(skip_serializing_if = "Option::is_none")]
562    pub tags: Option<Vec<Tag>>,
563}
564
565/// <p>Permissions designate which private CA actions can be performed by an AWS service or entity. In order for ACM to automatically renew private certificates, you must give the ACM service principal all available permissions (<code>IssueCertificate</code>, <code>GetCertificate</code>, and <code>ListPermissions</code>). Permissions can be assigned with the <a>CreatePermission</a> action, removed with the <a>DeletePermission</a> action, and listed with the <a>ListPermissions</a> action.</p>
566#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
567#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
568pub struct Permission {
569    /// <p>The private CA actions that can be performed by the designated AWS service.</p>
570    #[serde(rename = "Actions")]
571    #[serde(skip_serializing_if = "Option::is_none")]
572    pub actions: Option<Vec<String>>,
573    /// <p>The Amazon Resource Number (ARN) of the private CA from which the permission was issued.</p>
574    #[serde(rename = "CertificateAuthorityArn")]
575    #[serde(skip_serializing_if = "Option::is_none")]
576    pub certificate_authority_arn: Option<String>,
577    /// <p>The time at which the permission was created.</p>
578    #[serde(rename = "CreatedAt")]
579    #[serde(skip_serializing_if = "Option::is_none")]
580    pub created_at: Option<f64>,
581    /// <p>The name of the policy that is associated with the permission.</p>
582    #[serde(rename = "Policy")]
583    #[serde(skip_serializing_if = "Option::is_none")]
584    pub policy: Option<String>,
585    /// <p>The AWS service or entity that holds the permission. At this time, the only valid principal is <code>acm.amazonaws.com</code>.</p>
586    #[serde(rename = "Principal")]
587    #[serde(skip_serializing_if = "Option::is_none")]
588    pub principal: Option<String>,
589    /// <p>The ID of the account that assigned the permission.</p>
590    #[serde(rename = "SourceAccount")]
591    #[serde(skip_serializing_if = "Option::is_none")]
592    pub source_account: Option<String>,
593}
594
595#[derive(Clone, Debug, Default, PartialEq, Serialize)]
596#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
597pub struct RestoreCertificateAuthorityRequest {
598    /// <p>The Amazon Resource Name (ARN) that was returned when you called the <a>CreateCertificateAuthority</a> action. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
599    #[serde(rename = "CertificateAuthorityArn")]
600    pub certificate_authority_arn: String,
601}
602
603/// <p>Certificate revocation information used by the <a>CreateCertificateAuthority</a> and <a>UpdateCertificateAuthority</a> actions. Your private certificate authority (CA) can create and maintain a certificate revocation list (CRL). A CRL contains information about certificates revoked by your CA. For more information, see <a>RevokeCertificate</a>.</p>
604#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
605pub struct RevocationConfiguration {
606    /// <p>Configuration of the certificate revocation list (CRL), if any, maintained by your private CA.</p>
607    #[serde(rename = "CrlConfiguration")]
608    #[serde(skip_serializing_if = "Option::is_none")]
609    pub crl_configuration: Option<CrlConfiguration>,
610}
611
612#[derive(Clone, Debug, Default, PartialEq, Serialize)]
613#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
614pub struct RevokeCertificateRequest {
615    /// <p>Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
616    #[serde(rename = "CertificateAuthorityArn")]
617    pub certificate_authority_arn: String,
618    /// <p>Serial number of the certificate to be revoked. This must be in hexadecimal format. You can retrieve the serial number by calling <a>GetCertificate</a> with the Amazon Resource Name (ARN) of the certificate you want and the ARN of your private CA. The <b>GetCertificate</b> action retrieves the certificate in the PEM format. You can use the following OpenSSL command to list the certificate in text format and copy the hexadecimal serial number. </p> <p> <code>openssl x509 -in <i>file_path</i> -text -noout</code> </p> <p>You can also copy the serial number from the console or use the <a href="https://docs.aws.amazon.com/acm/latest/APIReference/API_DescribeCertificate.html">DescribeCertificate</a> action in the <i>AWS Certificate Manager API Reference</i>. </p>
619    #[serde(rename = "CertificateSerial")]
620    pub certificate_serial: String,
621    /// <p>Specifies why you revoked the certificate.</p>
622    #[serde(rename = "RevocationReason")]
623    pub revocation_reason: String,
624}
625
626/// <p>Tags are labels that you can use to identify and organize your private CAs. Each tag consists of a key and an optional value. You can associate up to 50 tags with a private CA. To add one or more tags to a private CA, call the <a>TagCertificateAuthority</a> action. To remove a tag, call the <a>UntagCertificateAuthority</a> action. </p>
627#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
628pub struct Tag {
629    /// <p>Key (name) of the tag.</p>
630    #[serde(rename = "Key")]
631    pub key: String,
632    /// <p>Value of the tag.</p>
633    #[serde(rename = "Value")]
634    #[serde(skip_serializing_if = "Option::is_none")]
635    pub value: Option<String>,
636}
637
638#[derive(Clone, Debug, Default, PartialEq, Serialize)]
639#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
640pub struct TagCertificateAuthorityRequest {
641    /// <p>The Amazon Resource Name (ARN) that was returned when you called <a>CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
642    #[serde(rename = "CertificateAuthorityArn")]
643    pub certificate_authority_arn: String,
644    /// <p>List of tags to be associated with the CA.</p>
645    #[serde(rename = "Tags")]
646    pub tags: Vec<Tag>,
647}
648
649#[derive(Clone, Debug, Default, PartialEq, Serialize)]
650#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
651pub struct UntagCertificateAuthorityRequest {
652    /// <p>The Amazon Resource Name (ARN) that was returned when you called <a>CreateCertificateAuthority</a>. This must be of the form: </p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
653    #[serde(rename = "CertificateAuthorityArn")]
654    pub certificate_authority_arn: String,
655    /// <p>List of tags to be removed from the CA.</p>
656    #[serde(rename = "Tags")]
657    pub tags: Vec<Tag>,
658}
659
660#[derive(Clone, Debug, Default, PartialEq, Serialize)]
661#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
662pub struct UpdateCertificateAuthorityRequest {
663    /// <p>Amazon Resource Name (ARN) of the private CA that issued the certificate to be revoked. This must be of the form:</p> <p> <code>arn:aws:acm-pca:<i>region</i>:<i>account</i>:certificate-authority/<i>12345678-1234-1234-1234-123456789012</i> </code> </p>
664    #[serde(rename = "CertificateAuthorityArn")]
665    pub certificate_authority_arn: String,
666    /// <p>Revocation information for your private CA.</p>
667    #[serde(rename = "RevocationConfiguration")]
668    #[serde(skip_serializing_if = "Option::is_none")]
669    pub revocation_configuration: Option<RevocationConfiguration>,
670    /// <p>Status of your private CA.</p>
671    #[serde(rename = "Status")]
672    #[serde(skip_serializing_if = "Option::is_none")]
673    pub status: Option<String>,
674}
675
676/// <p>Length of time for which the certificate issued by your private certificate authority (CA), or by the private CA itself, is valid in days, months, or years. You can issue a certificate by calling the <a>IssueCertificate</a> action.</p>
677#[derive(Clone, Debug, Default, PartialEq, Serialize)]
678#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
679pub struct Validity {
680    /// <p>Specifies whether the <code>Value</code> parameter represents days, months, or years.</p>
681    #[serde(rename = "Type")]
682    pub type_: String,
683    /// <p>Time period.</p>
684    #[serde(rename = "Value")]
685    pub value: i64,
686}
687
688/// Errors returned by CreateCertificateAuthority
689#[derive(Debug, PartialEq)]
690pub enum CreateCertificateAuthorityError {
691    /// <p>One or more of the specified arguments was not valid.</p>
692    InvalidArgs(String),
693    /// <p>The S3 bucket policy is not valid. The policy must give ACM Private CA rights to read from and write to the bucket and find the bucket location.</p>
694    InvalidPolicy(String),
695    /// <p>The tag associated with the CA is not valid. The invalid argument is contained in the message field.</p>
696    InvalidTag(String),
697    /// <p>An ACM Private CA limit has been exceeded. See the exception message returned to determine the limit that was exceeded.</p>
698    LimitExceeded(String),
699}
700
701impl CreateCertificateAuthorityError {
702    pub fn from_response(
703        res: BufferedHttpResponse,
704    ) -> RusotoError<CreateCertificateAuthorityError> {
705        if let Some(err) = proto::json::Error::parse(&res) {
706            match err.typ.as_str() {
707                "InvalidArgsException" => {
708                    return RusotoError::Service(CreateCertificateAuthorityError::InvalidArgs(
709                        err.msg,
710                    ))
711                }
712                "InvalidPolicyException" => {
713                    return RusotoError::Service(CreateCertificateAuthorityError::InvalidPolicy(
714                        err.msg,
715                    ))
716                }
717                "InvalidTagException" => {
718                    return RusotoError::Service(CreateCertificateAuthorityError::InvalidTag(
719                        err.msg,
720                    ))
721                }
722                "LimitExceededException" => {
723                    return RusotoError::Service(CreateCertificateAuthorityError::LimitExceeded(
724                        err.msg,
725                    ))
726                }
727                "ValidationException" => return RusotoError::Validation(err.msg),
728                _ => {}
729            }
730        }
731        RusotoError::Unknown(res)
732    }
733}
734impl fmt::Display for CreateCertificateAuthorityError {
735    #[allow(unused_variables)]
736    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
737        match *self {
738            CreateCertificateAuthorityError::InvalidArgs(ref cause) => write!(f, "{}", cause),
739            CreateCertificateAuthorityError::InvalidPolicy(ref cause) => write!(f, "{}", cause),
740            CreateCertificateAuthorityError::InvalidTag(ref cause) => write!(f, "{}", cause),
741            CreateCertificateAuthorityError::LimitExceeded(ref cause) => write!(f, "{}", cause),
742        }
743    }
744}
745impl Error for CreateCertificateAuthorityError {}
746/// Errors returned by CreateCertificateAuthorityAuditReport
747#[derive(Debug, PartialEq)]
748pub enum CreateCertificateAuthorityAuditReportError {
749    /// <p>One or more of the specified arguments was not valid.</p>
750    InvalidArgs(String),
751    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
752    InvalidArn(String),
753    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
754    InvalidState(String),
755    /// <p>The request has failed for an unspecified reason.</p>
756    RequestFailed(String),
757    /// <p>Your request is already in progress.</p>
758    RequestInProgress(String),
759    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
760    ResourceNotFound(String),
761}
762
763impl CreateCertificateAuthorityAuditReportError {
764    pub fn from_response(
765        res: BufferedHttpResponse,
766    ) -> RusotoError<CreateCertificateAuthorityAuditReportError> {
767        if let Some(err) = proto::json::Error::parse(&res) {
768            match err.typ.as_str() {
769                "InvalidArgsException" => {
770                    return RusotoError::Service(
771                        CreateCertificateAuthorityAuditReportError::InvalidArgs(err.msg),
772                    )
773                }
774                "InvalidArnException" => {
775                    return RusotoError::Service(
776                        CreateCertificateAuthorityAuditReportError::InvalidArn(err.msg),
777                    )
778                }
779                "InvalidStateException" => {
780                    return RusotoError::Service(
781                        CreateCertificateAuthorityAuditReportError::InvalidState(err.msg),
782                    )
783                }
784                "RequestFailedException" => {
785                    return RusotoError::Service(
786                        CreateCertificateAuthorityAuditReportError::RequestFailed(err.msg),
787                    )
788                }
789                "RequestInProgressException" => {
790                    return RusotoError::Service(
791                        CreateCertificateAuthorityAuditReportError::RequestInProgress(err.msg),
792                    )
793                }
794                "ResourceNotFoundException" => {
795                    return RusotoError::Service(
796                        CreateCertificateAuthorityAuditReportError::ResourceNotFound(err.msg),
797                    )
798                }
799                "ValidationException" => return RusotoError::Validation(err.msg),
800                _ => {}
801            }
802        }
803        RusotoError::Unknown(res)
804    }
805}
806impl fmt::Display for CreateCertificateAuthorityAuditReportError {
807    #[allow(unused_variables)]
808    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
809        match *self {
810            CreateCertificateAuthorityAuditReportError::InvalidArgs(ref cause) => {
811                write!(f, "{}", cause)
812            }
813            CreateCertificateAuthorityAuditReportError::InvalidArn(ref cause) => {
814                write!(f, "{}", cause)
815            }
816            CreateCertificateAuthorityAuditReportError::InvalidState(ref cause) => {
817                write!(f, "{}", cause)
818            }
819            CreateCertificateAuthorityAuditReportError::RequestFailed(ref cause) => {
820                write!(f, "{}", cause)
821            }
822            CreateCertificateAuthorityAuditReportError::RequestInProgress(ref cause) => {
823                write!(f, "{}", cause)
824            }
825            CreateCertificateAuthorityAuditReportError::ResourceNotFound(ref cause) => {
826                write!(f, "{}", cause)
827            }
828        }
829    }
830}
831impl Error for CreateCertificateAuthorityAuditReportError {}
832/// Errors returned by CreatePermission
833#[derive(Debug, PartialEq)]
834pub enum CreatePermissionError {
835    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
836    InvalidArn(String),
837    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
838    InvalidState(String),
839    /// <p>An ACM Private CA limit has been exceeded. See the exception message returned to determine the limit that was exceeded.</p>
840    LimitExceeded(String),
841    /// <p>The designated permission has already been given to the user.</p>
842    PermissionAlreadyExists(String),
843    /// <p>The request has failed for an unspecified reason.</p>
844    RequestFailed(String),
845    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
846    ResourceNotFound(String),
847}
848
849impl CreatePermissionError {
850    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreatePermissionError> {
851        if let Some(err) = proto::json::Error::parse(&res) {
852            match err.typ.as_str() {
853                "InvalidArnException" => {
854                    return RusotoError::Service(CreatePermissionError::InvalidArn(err.msg))
855                }
856                "InvalidStateException" => {
857                    return RusotoError::Service(CreatePermissionError::InvalidState(err.msg))
858                }
859                "LimitExceededException" => {
860                    return RusotoError::Service(CreatePermissionError::LimitExceeded(err.msg))
861                }
862                "PermissionAlreadyExistsException" => {
863                    return RusotoError::Service(CreatePermissionError::PermissionAlreadyExists(
864                        err.msg,
865                    ))
866                }
867                "RequestFailedException" => {
868                    return RusotoError::Service(CreatePermissionError::RequestFailed(err.msg))
869                }
870                "ResourceNotFoundException" => {
871                    return RusotoError::Service(CreatePermissionError::ResourceNotFound(err.msg))
872                }
873                "ValidationException" => return RusotoError::Validation(err.msg),
874                _ => {}
875            }
876        }
877        RusotoError::Unknown(res)
878    }
879}
880impl fmt::Display for CreatePermissionError {
881    #[allow(unused_variables)]
882    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
883        match *self {
884            CreatePermissionError::InvalidArn(ref cause) => write!(f, "{}", cause),
885            CreatePermissionError::InvalidState(ref cause) => write!(f, "{}", cause),
886            CreatePermissionError::LimitExceeded(ref cause) => write!(f, "{}", cause),
887            CreatePermissionError::PermissionAlreadyExists(ref cause) => write!(f, "{}", cause),
888            CreatePermissionError::RequestFailed(ref cause) => write!(f, "{}", cause),
889            CreatePermissionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
890        }
891    }
892}
893impl Error for CreatePermissionError {}
894/// Errors returned by DeleteCertificateAuthority
895#[derive(Debug, PartialEq)]
896pub enum DeleteCertificateAuthorityError {
897    /// <p>A previous update to your private CA is still ongoing.</p>
898    ConcurrentModification(String),
899    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
900    InvalidArn(String),
901    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
902    InvalidState(String),
903    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
904    ResourceNotFound(String),
905}
906
907impl DeleteCertificateAuthorityError {
908    pub fn from_response(
909        res: BufferedHttpResponse,
910    ) -> RusotoError<DeleteCertificateAuthorityError> {
911        if let Some(err) = proto::json::Error::parse(&res) {
912            match err.typ.as_str() {
913                "ConcurrentModificationException" => {
914                    return RusotoError::Service(
915                        DeleteCertificateAuthorityError::ConcurrentModification(err.msg),
916                    )
917                }
918                "InvalidArnException" => {
919                    return RusotoError::Service(DeleteCertificateAuthorityError::InvalidArn(
920                        err.msg,
921                    ))
922                }
923                "InvalidStateException" => {
924                    return RusotoError::Service(DeleteCertificateAuthorityError::InvalidState(
925                        err.msg,
926                    ))
927                }
928                "ResourceNotFoundException" => {
929                    return RusotoError::Service(DeleteCertificateAuthorityError::ResourceNotFound(
930                        err.msg,
931                    ))
932                }
933                "ValidationException" => return RusotoError::Validation(err.msg),
934                _ => {}
935            }
936        }
937        RusotoError::Unknown(res)
938    }
939}
940impl fmt::Display for DeleteCertificateAuthorityError {
941    #[allow(unused_variables)]
942    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
943        match *self {
944            DeleteCertificateAuthorityError::ConcurrentModification(ref cause) => {
945                write!(f, "{}", cause)
946            }
947            DeleteCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
948            DeleteCertificateAuthorityError::InvalidState(ref cause) => write!(f, "{}", cause),
949            DeleteCertificateAuthorityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
950        }
951    }
952}
953impl Error for DeleteCertificateAuthorityError {}
954/// Errors returned by DeletePermission
955#[derive(Debug, PartialEq)]
956pub enum DeletePermissionError {
957    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
958    InvalidArn(String),
959    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
960    InvalidState(String),
961    /// <p>The request has failed for an unspecified reason.</p>
962    RequestFailed(String),
963    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
964    ResourceNotFound(String),
965}
966
967impl DeletePermissionError {
968    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeletePermissionError> {
969        if let Some(err) = proto::json::Error::parse(&res) {
970            match err.typ.as_str() {
971                "InvalidArnException" => {
972                    return RusotoError::Service(DeletePermissionError::InvalidArn(err.msg))
973                }
974                "InvalidStateException" => {
975                    return RusotoError::Service(DeletePermissionError::InvalidState(err.msg))
976                }
977                "RequestFailedException" => {
978                    return RusotoError::Service(DeletePermissionError::RequestFailed(err.msg))
979                }
980                "ResourceNotFoundException" => {
981                    return RusotoError::Service(DeletePermissionError::ResourceNotFound(err.msg))
982                }
983                "ValidationException" => return RusotoError::Validation(err.msg),
984                _ => {}
985            }
986        }
987        RusotoError::Unknown(res)
988    }
989}
990impl fmt::Display for DeletePermissionError {
991    #[allow(unused_variables)]
992    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
993        match *self {
994            DeletePermissionError::InvalidArn(ref cause) => write!(f, "{}", cause),
995            DeletePermissionError::InvalidState(ref cause) => write!(f, "{}", cause),
996            DeletePermissionError::RequestFailed(ref cause) => write!(f, "{}", cause),
997            DeletePermissionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
998        }
999    }
1000}
1001impl Error for DeletePermissionError {}
1002/// Errors returned by DescribeCertificateAuthority
1003#[derive(Debug, PartialEq)]
1004pub enum DescribeCertificateAuthorityError {
1005    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1006    InvalidArn(String),
1007    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1008    ResourceNotFound(String),
1009}
1010
1011impl DescribeCertificateAuthorityError {
1012    pub fn from_response(
1013        res: BufferedHttpResponse,
1014    ) -> RusotoError<DescribeCertificateAuthorityError> {
1015        if let Some(err) = proto::json::Error::parse(&res) {
1016            match err.typ.as_str() {
1017                "InvalidArnException" => {
1018                    return RusotoError::Service(DescribeCertificateAuthorityError::InvalidArn(
1019                        err.msg,
1020                    ))
1021                }
1022                "ResourceNotFoundException" => {
1023                    return RusotoError::Service(
1024                        DescribeCertificateAuthorityError::ResourceNotFound(err.msg),
1025                    )
1026                }
1027                "ValidationException" => return RusotoError::Validation(err.msg),
1028                _ => {}
1029            }
1030        }
1031        RusotoError::Unknown(res)
1032    }
1033}
1034impl fmt::Display for DescribeCertificateAuthorityError {
1035    #[allow(unused_variables)]
1036    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1037        match *self {
1038            DescribeCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
1039            DescribeCertificateAuthorityError::ResourceNotFound(ref cause) => {
1040                write!(f, "{}", cause)
1041            }
1042        }
1043    }
1044}
1045impl Error for DescribeCertificateAuthorityError {}
1046/// Errors returned by DescribeCertificateAuthorityAuditReport
1047#[derive(Debug, PartialEq)]
1048pub enum DescribeCertificateAuthorityAuditReportError {
1049    /// <p>One or more of the specified arguments was not valid.</p>
1050    InvalidArgs(String),
1051    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1052    InvalidArn(String),
1053    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1054    ResourceNotFound(String),
1055}
1056
1057impl DescribeCertificateAuthorityAuditReportError {
1058    pub fn from_response(
1059        res: BufferedHttpResponse,
1060    ) -> RusotoError<DescribeCertificateAuthorityAuditReportError> {
1061        if let Some(err) = proto::json::Error::parse(&res) {
1062            match err.typ.as_str() {
1063                "InvalidArgsException" => {
1064                    return RusotoError::Service(
1065                        DescribeCertificateAuthorityAuditReportError::InvalidArgs(err.msg),
1066                    )
1067                }
1068                "InvalidArnException" => {
1069                    return RusotoError::Service(
1070                        DescribeCertificateAuthorityAuditReportError::InvalidArn(err.msg),
1071                    )
1072                }
1073                "ResourceNotFoundException" => {
1074                    return RusotoError::Service(
1075                        DescribeCertificateAuthorityAuditReportError::ResourceNotFound(err.msg),
1076                    )
1077                }
1078                "ValidationException" => return RusotoError::Validation(err.msg),
1079                _ => {}
1080            }
1081        }
1082        RusotoError::Unknown(res)
1083    }
1084}
1085impl fmt::Display for DescribeCertificateAuthorityAuditReportError {
1086    #[allow(unused_variables)]
1087    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1088        match *self {
1089            DescribeCertificateAuthorityAuditReportError::InvalidArgs(ref cause) => {
1090                write!(f, "{}", cause)
1091            }
1092            DescribeCertificateAuthorityAuditReportError::InvalidArn(ref cause) => {
1093                write!(f, "{}", cause)
1094            }
1095            DescribeCertificateAuthorityAuditReportError::ResourceNotFound(ref cause) => {
1096                write!(f, "{}", cause)
1097            }
1098        }
1099    }
1100}
1101impl Error for DescribeCertificateAuthorityAuditReportError {}
1102/// Errors returned by GetCertificate
1103#[derive(Debug, PartialEq)]
1104pub enum GetCertificateError {
1105    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1106    InvalidArn(String),
1107    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1108    InvalidState(String),
1109    /// <p>The request has failed for an unspecified reason.</p>
1110    RequestFailed(String),
1111    /// <p>Your request is already in progress.</p>
1112    RequestInProgress(String),
1113    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1114    ResourceNotFound(String),
1115}
1116
1117impl GetCertificateError {
1118    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetCertificateError> {
1119        if let Some(err) = proto::json::Error::parse(&res) {
1120            match err.typ.as_str() {
1121                "InvalidArnException" => {
1122                    return RusotoError::Service(GetCertificateError::InvalidArn(err.msg))
1123                }
1124                "InvalidStateException" => {
1125                    return RusotoError::Service(GetCertificateError::InvalidState(err.msg))
1126                }
1127                "RequestFailedException" => {
1128                    return RusotoError::Service(GetCertificateError::RequestFailed(err.msg))
1129                }
1130                "RequestInProgressException" => {
1131                    return RusotoError::Service(GetCertificateError::RequestInProgress(err.msg))
1132                }
1133                "ResourceNotFoundException" => {
1134                    return RusotoError::Service(GetCertificateError::ResourceNotFound(err.msg))
1135                }
1136                "ValidationException" => return RusotoError::Validation(err.msg),
1137                _ => {}
1138            }
1139        }
1140        RusotoError::Unknown(res)
1141    }
1142}
1143impl fmt::Display for GetCertificateError {
1144    #[allow(unused_variables)]
1145    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1146        match *self {
1147            GetCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
1148            GetCertificateError::InvalidState(ref cause) => write!(f, "{}", cause),
1149            GetCertificateError::RequestFailed(ref cause) => write!(f, "{}", cause),
1150            GetCertificateError::RequestInProgress(ref cause) => write!(f, "{}", cause),
1151            GetCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1152        }
1153    }
1154}
1155impl Error for GetCertificateError {}
1156/// Errors returned by GetCertificateAuthorityCertificate
1157#[derive(Debug, PartialEq)]
1158pub enum GetCertificateAuthorityCertificateError {
1159    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1160    InvalidArn(String),
1161    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1162    InvalidState(String),
1163    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1164    ResourceNotFound(String),
1165}
1166
1167impl GetCertificateAuthorityCertificateError {
1168    pub fn from_response(
1169        res: BufferedHttpResponse,
1170    ) -> RusotoError<GetCertificateAuthorityCertificateError> {
1171        if let Some(err) = proto::json::Error::parse(&res) {
1172            match err.typ.as_str() {
1173                "InvalidArnException" => {
1174                    return RusotoError::Service(
1175                        GetCertificateAuthorityCertificateError::InvalidArn(err.msg),
1176                    )
1177                }
1178                "InvalidStateException" => {
1179                    return RusotoError::Service(
1180                        GetCertificateAuthorityCertificateError::InvalidState(err.msg),
1181                    )
1182                }
1183                "ResourceNotFoundException" => {
1184                    return RusotoError::Service(
1185                        GetCertificateAuthorityCertificateError::ResourceNotFound(err.msg),
1186                    )
1187                }
1188                "ValidationException" => return RusotoError::Validation(err.msg),
1189                _ => {}
1190            }
1191        }
1192        RusotoError::Unknown(res)
1193    }
1194}
1195impl fmt::Display for GetCertificateAuthorityCertificateError {
1196    #[allow(unused_variables)]
1197    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1198        match *self {
1199            GetCertificateAuthorityCertificateError::InvalidArn(ref cause) => {
1200                write!(f, "{}", cause)
1201            }
1202            GetCertificateAuthorityCertificateError::InvalidState(ref cause) => {
1203                write!(f, "{}", cause)
1204            }
1205            GetCertificateAuthorityCertificateError::ResourceNotFound(ref cause) => {
1206                write!(f, "{}", cause)
1207            }
1208        }
1209    }
1210}
1211impl Error for GetCertificateAuthorityCertificateError {}
1212/// Errors returned by GetCertificateAuthorityCsr
1213#[derive(Debug, PartialEq)]
1214pub enum GetCertificateAuthorityCsrError {
1215    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1216    InvalidArn(String),
1217    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1218    InvalidState(String),
1219    /// <p>The request has failed for an unspecified reason.</p>
1220    RequestFailed(String),
1221    /// <p>Your request is already in progress.</p>
1222    RequestInProgress(String),
1223    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1224    ResourceNotFound(String),
1225}
1226
1227impl GetCertificateAuthorityCsrError {
1228    pub fn from_response(
1229        res: BufferedHttpResponse,
1230    ) -> RusotoError<GetCertificateAuthorityCsrError> {
1231        if let Some(err) = proto::json::Error::parse(&res) {
1232            match err.typ.as_str() {
1233                "InvalidArnException" => {
1234                    return RusotoError::Service(GetCertificateAuthorityCsrError::InvalidArn(
1235                        err.msg,
1236                    ))
1237                }
1238                "InvalidStateException" => {
1239                    return RusotoError::Service(GetCertificateAuthorityCsrError::InvalidState(
1240                        err.msg,
1241                    ))
1242                }
1243                "RequestFailedException" => {
1244                    return RusotoError::Service(GetCertificateAuthorityCsrError::RequestFailed(
1245                        err.msg,
1246                    ))
1247                }
1248                "RequestInProgressException" => {
1249                    return RusotoError::Service(
1250                        GetCertificateAuthorityCsrError::RequestInProgress(err.msg),
1251                    )
1252                }
1253                "ResourceNotFoundException" => {
1254                    return RusotoError::Service(GetCertificateAuthorityCsrError::ResourceNotFound(
1255                        err.msg,
1256                    ))
1257                }
1258                "ValidationException" => return RusotoError::Validation(err.msg),
1259                _ => {}
1260            }
1261        }
1262        RusotoError::Unknown(res)
1263    }
1264}
1265impl fmt::Display for GetCertificateAuthorityCsrError {
1266    #[allow(unused_variables)]
1267    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1268        match *self {
1269            GetCertificateAuthorityCsrError::InvalidArn(ref cause) => write!(f, "{}", cause),
1270            GetCertificateAuthorityCsrError::InvalidState(ref cause) => write!(f, "{}", cause),
1271            GetCertificateAuthorityCsrError::RequestFailed(ref cause) => write!(f, "{}", cause),
1272            GetCertificateAuthorityCsrError::RequestInProgress(ref cause) => write!(f, "{}", cause),
1273            GetCertificateAuthorityCsrError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1274        }
1275    }
1276}
1277impl Error for GetCertificateAuthorityCsrError {}
1278/// Errors returned by ImportCertificateAuthorityCertificate
1279#[derive(Debug, PartialEq)]
1280pub enum ImportCertificateAuthorityCertificateError {
1281    /// <p>The certificate authority certificate you are importing does not comply with conditions specified in the certificate that signed it.</p>
1282    CertificateMismatch(String),
1283    /// <p>A previous update to your private CA is still ongoing.</p>
1284    ConcurrentModification(String),
1285    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1286    InvalidArn(String),
1287    /// <p>The request action cannot be performed or is prohibited.</p>
1288    InvalidRequest(String),
1289    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1290    InvalidState(String),
1291    /// <p>One or more fields in the certificate are invalid.</p>
1292    MalformedCertificate(String),
1293    /// <p>The request has failed for an unspecified reason.</p>
1294    RequestFailed(String),
1295    /// <p>Your request is already in progress.</p>
1296    RequestInProgress(String),
1297    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1298    ResourceNotFound(String),
1299}
1300
1301impl ImportCertificateAuthorityCertificateError {
1302    pub fn from_response(
1303        res: BufferedHttpResponse,
1304    ) -> RusotoError<ImportCertificateAuthorityCertificateError> {
1305        if let Some(err) = proto::json::Error::parse(&res) {
1306            match err.typ.as_str() {
1307                "CertificateMismatchException" => {
1308                    return RusotoError::Service(
1309                        ImportCertificateAuthorityCertificateError::CertificateMismatch(err.msg),
1310                    )
1311                }
1312                "ConcurrentModificationException" => {
1313                    return RusotoError::Service(
1314                        ImportCertificateAuthorityCertificateError::ConcurrentModification(err.msg),
1315                    )
1316                }
1317                "InvalidArnException" => {
1318                    return RusotoError::Service(
1319                        ImportCertificateAuthorityCertificateError::InvalidArn(err.msg),
1320                    )
1321                }
1322                "InvalidRequestException" => {
1323                    return RusotoError::Service(
1324                        ImportCertificateAuthorityCertificateError::InvalidRequest(err.msg),
1325                    )
1326                }
1327                "InvalidStateException" => {
1328                    return RusotoError::Service(
1329                        ImportCertificateAuthorityCertificateError::InvalidState(err.msg),
1330                    )
1331                }
1332                "MalformedCertificateException" => {
1333                    return RusotoError::Service(
1334                        ImportCertificateAuthorityCertificateError::MalformedCertificate(err.msg),
1335                    )
1336                }
1337                "RequestFailedException" => {
1338                    return RusotoError::Service(
1339                        ImportCertificateAuthorityCertificateError::RequestFailed(err.msg),
1340                    )
1341                }
1342                "RequestInProgressException" => {
1343                    return RusotoError::Service(
1344                        ImportCertificateAuthorityCertificateError::RequestInProgress(err.msg),
1345                    )
1346                }
1347                "ResourceNotFoundException" => {
1348                    return RusotoError::Service(
1349                        ImportCertificateAuthorityCertificateError::ResourceNotFound(err.msg),
1350                    )
1351                }
1352                "ValidationException" => return RusotoError::Validation(err.msg),
1353                _ => {}
1354            }
1355        }
1356        RusotoError::Unknown(res)
1357    }
1358}
1359impl fmt::Display for ImportCertificateAuthorityCertificateError {
1360    #[allow(unused_variables)]
1361    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1362        match *self {
1363            ImportCertificateAuthorityCertificateError::CertificateMismatch(ref cause) => {
1364                write!(f, "{}", cause)
1365            }
1366            ImportCertificateAuthorityCertificateError::ConcurrentModification(ref cause) => {
1367                write!(f, "{}", cause)
1368            }
1369            ImportCertificateAuthorityCertificateError::InvalidArn(ref cause) => {
1370                write!(f, "{}", cause)
1371            }
1372            ImportCertificateAuthorityCertificateError::InvalidRequest(ref cause) => {
1373                write!(f, "{}", cause)
1374            }
1375            ImportCertificateAuthorityCertificateError::InvalidState(ref cause) => {
1376                write!(f, "{}", cause)
1377            }
1378            ImportCertificateAuthorityCertificateError::MalformedCertificate(ref cause) => {
1379                write!(f, "{}", cause)
1380            }
1381            ImportCertificateAuthorityCertificateError::RequestFailed(ref cause) => {
1382                write!(f, "{}", cause)
1383            }
1384            ImportCertificateAuthorityCertificateError::RequestInProgress(ref cause) => {
1385                write!(f, "{}", cause)
1386            }
1387            ImportCertificateAuthorityCertificateError::ResourceNotFound(ref cause) => {
1388                write!(f, "{}", cause)
1389            }
1390        }
1391    }
1392}
1393impl Error for ImportCertificateAuthorityCertificateError {}
1394/// Errors returned by IssueCertificate
1395#[derive(Debug, PartialEq)]
1396pub enum IssueCertificateError {
1397    /// <p>One or more of the specified arguments was not valid.</p>
1398    InvalidArgs(String),
1399    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1400    InvalidArn(String),
1401    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1402    InvalidState(String),
1403    /// <p>An ACM Private CA limit has been exceeded. See the exception message returned to determine the limit that was exceeded.</p>
1404    LimitExceeded(String),
1405    /// <p>The certificate signing request is invalid.</p>
1406    MalformedCSR(String),
1407    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1408    ResourceNotFound(String),
1409}
1410
1411impl IssueCertificateError {
1412    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<IssueCertificateError> {
1413        if let Some(err) = proto::json::Error::parse(&res) {
1414            match err.typ.as_str() {
1415                "InvalidArgsException" => {
1416                    return RusotoError::Service(IssueCertificateError::InvalidArgs(err.msg))
1417                }
1418                "InvalidArnException" => {
1419                    return RusotoError::Service(IssueCertificateError::InvalidArn(err.msg))
1420                }
1421                "InvalidStateException" => {
1422                    return RusotoError::Service(IssueCertificateError::InvalidState(err.msg))
1423                }
1424                "LimitExceededException" => {
1425                    return RusotoError::Service(IssueCertificateError::LimitExceeded(err.msg))
1426                }
1427                "MalformedCSRException" => {
1428                    return RusotoError::Service(IssueCertificateError::MalformedCSR(err.msg))
1429                }
1430                "ResourceNotFoundException" => {
1431                    return RusotoError::Service(IssueCertificateError::ResourceNotFound(err.msg))
1432                }
1433                "ValidationException" => return RusotoError::Validation(err.msg),
1434                _ => {}
1435            }
1436        }
1437        RusotoError::Unknown(res)
1438    }
1439}
1440impl fmt::Display for IssueCertificateError {
1441    #[allow(unused_variables)]
1442    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1443        match *self {
1444            IssueCertificateError::InvalidArgs(ref cause) => write!(f, "{}", cause),
1445            IssueCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
1446            IssueCertificateError::InvalidState(ref cause) => write!(f, "{}", cause),
1447            IssueCertificateError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1448            IssueCertificateError::MalformedCSR(ref cause) => write!(f, "{}", cause),
1449            IssueCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1450        }
1451    }
1452}
1453impl Error for IssueCertificateError {}
1454/// Errors returned by ListCertificateAuthorities
1455#[derive(Debug, PartialEq)]
1456pub enum ListCertificateAuthoritiesError {
1457    /// <p>The token specified in the <code>NextToken</code> argument is not valid. Use the token returned from your previous call to <a>ListCertificateAuthorities</a>.</p>
1458    InvalidNextToken(String),
1459}
1460
1461impl ListCertificateAuthoritiesError {
1462    pub fn from_response(
1463        res: BufferedHttpResponse,
1464    ) -> RusotoError<ListCertificateAuthoritiesError> {
1465        if let Some(err) = proto::json::Error::parse(&res) {
1466            match err.typ.as_str() {
1467                "InvalidNextTokenException" => {
1468                    return RusotoError::Service(ListCertificateAuthoritiesError::InvalidNextToken(
1469                        err.msg,
1470                    ))
1471                }
1472                "ValidationException" => return RusotoError::Validation(err.msg),
1473                _ => {}
1474            }
1475        }
1476        RusotoError::Unknown(res)
1477    }
1478}
1479impl fmt::Display for ListCertificateAuthoritiesError {
1480    #[allow(unused_variables)]
1481    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1482        match *self {
1483            ListCertificateAuthoritiesError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
1484        }
1485    }
1486}
1487impl Error for ListCertificateAuthoritiesError {}
1488/// Errors returned by ListPermissions
1489#[derive(Debug, PartialEq)]
1490pub enum ListPermissionsError {
1491    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1492    InvalidArn(String),
1493    /// <p>The token specified in the <code>NextToken</code> argument is not valid. Use the token returned from your previous call to <a>ListCertificateAuthorities</a>.</p>
1494    InvalidNextToken(String),
1495    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1496    InvalidState(String),
1497    /// <p>The request has failed for an unspecified reason.</p>
1498    RequestFailed(String),
1499    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1500    ResourceNotFound(String),
1501}
1502
1503impl ListPermissionsError {
1504    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListPermissionsError> {
1505        if let Some(err) = proto::json::Error::parse(&res) {
1506            match err.typ.as_str() {
1507                "InvalidArnException" => {
1508                    return RusotoError::Service(ListPermissionsError::InvalidArn(err.msg))
1509                }
1510                "InvalidNextTokenException" => {
1511                    return RusotoError::Service(ListPermissionsError::InvalidNextToken(err.msg))
1512                }
1513                "InvalidStateException" => {
1514                    return RusotoError::Service(ListPermissionsError::InvalidState(err.msg))
1515                }
1516                "RequestFailedException" => {
1517                    return RusotoError::Service(ListPermissionsError::RequestFailed(err.msg))
1518                }
1519                "ResourceNotFoundException" => {
1520                    return RusotoError::Service(ListPermissionsError::ResourceNotFound(err.msg))
1521                }
1522                "ValidationException" => return RusotoError::Validation(err.msg),
1523                _ => {}
1524            }
1525        }
1526        RusotoError::Unknown(res)
1527    }
1528}
1529impl fmt::Display for ListPermissionsError {
1530    #[allow(unused_variables)]
1531    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1532        match *self {
1533            ListPermissionsError::InvalidArn(ref cause) => write!(f, "{}", cause),
1534            ListPermissionsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
1535            ListPermissionsError::InvalidState(ref cause) => write!(f, "{}", cause),
1536            ListPermissionsError::RequestFailed(ref cause) => write!(f, "{}", cause),
1537            ListPermissionsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1538        }
1539    }
1540}
1541impl Error for ListPermissionsError {}
1542/// Errors returned by ListTags
1543#[derive(Debug, PartialEq)]
1544pub enum ListTagsError {
1545    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1546    InvalidArn(String),
1547    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1548    InvalidState(String),
1549    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1550    ResourceNotFound(String),
1551}
1552
1553impl ListTagsError {
1554    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsError> {
1555        if let Some(err) = proto::json::Error::parse(&res) {
1556            match err.typ.as_str() {
1557                "InvalidArnException" => {
1558                    return RusotoError::Service(ListTagsError::InvalidArn(err.msg))
1559                }
1560                "InvalidStateException" => {
1561                    return RusotoError::Service(ListTagsError::InvalidState(err.msg))
1562                }
1563                "ResourceNotFoundException" => {
1564                    return RusotoError::Service(ListTagsError::ResourceNotFound(err.msg))
1565                }
1566                "ValidationException" => return RusotoError::Validation(err.msg),
1567                _ => {}
1568            }
1569        }
1570        RusotoError::Unknown(res)
1571    }
1572}
1573impl fmt::Display for ListTagsError {
1574    #[allow(unused_variables)]
1575    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1576        match *self {
1577            ListTagsError::InvalidArn(ref cause) => write!(f, "{}", cause),
1578            ListTagsError::InvalidState(ref cause) => write!(f, "{}", cause),
1579            ListTagsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1580        }
1581    }
1582}
1583impl Error for ListTagsError {}
1584/// Errors returned by RestoreCertificateAuthority
1585#[derive(Debug, PartialEq)]
1586pub enum RestoreCertificateAuthorityError {
1587    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1588    InvalidArn(String),
1589    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1590    InvalidState(String),
1591    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1592    ResourceNotFound(String),
1593}
1594
1595impl RestoreCertificateAuthorityError {
1596    pub fn from_response(
1597        res: BufferedHttpResponse,
1598    ) -> RusotoError<RestoreCertificateAuthorityError> {
1599        if let Some(err) = proto::json::Error::parse(&res) {
1600            match err.typ.as_str() {
1601                "InvalidArnException" => {
1602                    return RusotoError::Service(RestoreCertificateAuthorityError::InvalidArn(
1603                        err.msg,
1604                    ))
1605                }
1606                "InvalidStateException" => {
1607                    return RusotoError::Service(RestoreCertificateAuthorityError::InvalidState(
1608                        err.msg,
1609                    ))
1610                }
1611                "ResourceNotFoundException" => {
1612                    return RusotoError::Service(
1613                        RestoreCertificateAuthorityError::ResourceNotFound(err.msg),
1614                    )
1615                }
1616                "ValidationException" => return RusotoError::Validation(err.msg),
1617                _ => {}
1618            }
1619        }
1620        RusotoError::Unknown(res)
1621    }
1622}
1623impl fmt::Display for RestoreCertificateAuthorityError {
1624    #[allow(unused_variables)]
1625    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1626        match *self {
1627            RestoreCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
1628            RestoreCertificateAuthorityError::InvalidState(ref cause) => write!(f, "{}", cause),
1629            RestoreCertificateAuthorityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1630        }
1631    }
1632}
1633impl Error for RestoreCertificateAuthorityError {}
1634/// Errors returned by RevokeCertificate
1635#[derive(Debug, PartialEq)]
1636pub enum RevokeCertificateError {
1637    /// <p>A previous update to your private CA is still ongoing.</p>
1638    ConcurrentModification(String),
1639    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1640    InvalidArn(String),
1641    /// <p>The request action cannot be performed or is prohibited.</p>
1642    InvalidRequest(String),
1643    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1644    InvalidState(String),
1645    /// <p>An ACM Private CA limit has been exceeded. See the exception message returned to determine the limit that was exceeded.</p>
1646    LimitExceeded(String),
1647    /// <p>Your request has already been completed.</p>
1648    RequestAlreadyProcessed(String),
1649    /// <p>The request has failed for an unspecified reason.</p>
1650    RequestFailed(String),
1651    /// <p>Your request is already in progress.</p>
1652    RequestInProgress(String),
1653    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1654    ResourceNotFound(String),
1655}
1656
1657impl RevokeCertificateError {
1658    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RevokeCertificateError> {
1659        if let Some(err) = proto::json::Error::parse(&res) {
1660            match err.typ.as_str() {
1661                "ConcurrentModificationException" => {
1662                    return RusotoError::Service(RevokeCertificateError::ConcurrentModification(
1663                        err.msg,
1664                    ))
1665                }
1666                "InvalidArnException" => {
1667                    return RusotoError::Service(RevokeCertificateError::InvalidArn(err.msg))
1668                }
1669                "InvalidRequestException" => {
1670                    return RusotoError::Service(RevokeCertificateError::InvalidRequest(err.msg))
1671                }
1672                "InvalidStateException" => {
1673                    return RusotoError::Service(RevokeCertificateError::InvalidState(err.msg))
1674                }
1675                "LimitExceededException" => {
1676                    return RusotoError::Service(RevokeCertificateError::LimitExceeded(err.msg))
1677                }
1678                "RequestAlreadyProcessedException" => {
1679                    return RusotoError::Service(RevokeCertificateError::RequestAlreadyProcessed(
1680                        err.msg,
1681                    ))
1682                }
1683                "RequestFailedException" => {
1684                    return RusotoError::Service(RevokeCertificateError::RequestFailed(err.msg))
1685                }
1686                "RequestInProgressException" => {
1687                    return RusotoError::Service(RevokeCertificateError::RequestInProgress(err.msg))
1688                }
1689                "ResourceNotFoundException" => {
1690                    return RusotoError::Service(RevokeCertificateError::ResourceNotFound(err.msg))
1691                }
1692                "ValidationException" => return RusotoError::Validation(err.msg),
1693                _ => {}
1694            }
1695        }
1696        RusotoError::Unknown(res)
1697    }
1698}
1699impl fmt::Display for RevokeCertificateError {
1700    #[allow(unused_variables)]
1701    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1702        match *self {
1703            RevokeCertificateError::ConcurrentModification(ref cause) => write!(f, "{}", cause),
1704            RevokeCertificateError::InvalidArn(ref cause) => write!(f, "{}", cause),
1705            RevokeCertificateError::InvalidRequest(ref cause) => write!(f, "{}", cause),
1706            RevokeCertificateError::InvalidState(ref cause) => write!(f, "{}", cause),
1707            RevokeCertificateError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1708            RevokeCertificateError::RequestAlreadyProcessed(ref cause) => write!(f, "{}", cause),
1709            RevokeCertificateError::RequestFailed(ref cause) => write!(f, "{}", cause),
1710            RevokeCertificateError::RequestInProgress(ref cause) => write!(f, "{}", cause),
1711            RevokeCertificateError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1712        }
1713    }
1714}
1715impl Error for RevokeCertificateError {}
1716/// Errors returned by TagCertificateAuthority
1717#[derive(Debug, PartialEq)]
1718pub enum TagCertificateAuthorityError {
1719    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1720    InvalidArn(String),
1721    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1722    InvalidState(String),
1723    /// <p>The tag associated with the CA is not valid. The invalid argument is contained in the message field.</p>
1724    InvalidTag(String),
1725    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1726    ResourceNotFound(String),
1727    /// <p>You can associate up to 50 tags with a private CA. Exception information is contained in the exception message field.</p>
1728    TooManyTags(String),
1729}
1730
1731impl TagCertificateAuthorityError {
1732    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagCertificateAuthorityError> {
1733        if let Some(err) = proto::json::Error::parse(&res) {
1734            match err.typ.as_str() {
1735                "InvalidArnException" => {
1736                    return RusotoError::Service(TagCertificateAuthorityError::InvalidArn(err.msg))
1737                }
1738                "InvalidStateException" => {
1739                    return RusotoError::Service(TagCertificateAuthorityError::InvalidState(
1740                        err.msg,
1741                    ))
1742                }
1743                "InvalidTagException" => {
1744                    return RusotoError::Service(TagCertificateAuthorityError::InvalidTag(err.msg))
1745                }
1746                "ResourceNotFoundException" => {
1747                    return RusotoError::Service(TagCertificateAuthorityError::ResourceNotFound(
1748                        err.msg,
1749                    ))
1750                }
1751                "TooManyTagsException" => {
1752                    return RusotoError::Service(TagCertificateAuthorityError::TooManyTags(err.msg))
1753                }
1754                "ValidationException" => return RusotoError::Validation(err.msg),
1755                _ => {}
1756            }
1757        }
1758        RusotoError::Unknown(res)
1759    }
1760}
1761impl fmt::Display for TagCertificateAuthorityError {
1762    #[allow(unused_variables)]
1763    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1764        match *self {
1765            TagCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
1766            TagCertificateAuthorityError::InvalidState(ref cause) => write!(f, "{}", cause),
1767            TagCertificateAuthorityError::InvalidTag(ref cause) => write!(f, "{}", cause),
1768            TagCertificateAuthorityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1769            TagCertificateAuthorityError::TooManyTags(ref cause) => write!(f, "{}", cause),
1770        }
1771    }
1772}
1773impl Error for TagCertificateAuthorityError {}
1774/// Errors returned by UntagCertificateAuthority
1775#[derive(Debug, PartialEq)]
1776pub enum UntagCertificateAuthorityError {
1777    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1778    InvalidArn(String),
1779    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1780    InvalidState(String),
1781    /// <p>The tag associated with the CA is not valid. The invalid argument is contained in the message field.</p>
1782    InvalidTag(String),
1783    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1784    ResourceNotFound(String),
1785}
1786
1787impl UntagCertificateAuthorityError {
1788    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagCertificateAuthorityError> {
1789        if let Some(err) = proto::json::Error::parse(&res) {
1790            match err.typ.as_str() {
1791                "InvalidArnException" => {
1792                    return RusotoError::Service(UntagCertificateAuthorityError::InvalidArn(
1793                        err.msg,
1794                    ))
1795                }
1796                "InvalidStateException" => {
1797                    return RusotoError::Service(UntagCertificateAuthorityError::InvalidState(
1798                        err.msg,
1799                    ))
1800                }
1801                "InvalidTagException" => {
1802                    return RusotoError::Service(UntagCertificateAuthorityError::InvalidTag(
1803                        err.msg,
1804                    ))
1805                }
1806                "ResourceNotFoundException" => {
1807                    return RusotoError::Service(UntagCertificateAuthorityError::ResourceNotFound(
1808                        err.msg,
1809                    ))
1810                }
1811                "ValidationException" => return RusotoError::Validation(err.msg),
1812                _ => {}
1813            }
1814        }
1815        RusotoError::Unknown(res)
1816    }
1817}
1818impl fmt::Display for UntagCertificateAuthorityError {
1819    #[allow(unused_variables)]
1820    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1821        match *self {
1822            UntagCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
1823            UntagCertificateAuthorityError::InvalidState(ref cause) => write!(f, "{}", cause),
1824            UntagCertificateAuthorityError::InvalidTag(ref cause) => write!(f, "{}", cause),
1825            UntagCertificateAuthorityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1826        }
1827    }
1828}
1829impl Error for UntagCertificateAuthorityError {}
1830/// Errors returned by UpdateCertificateAuthority
1831#[derive(Debug, PartialEq)]
1832pub enum UpdateCertificateAuthorityError {
1833    /// <p>A previous update to your private CA is still ongoing.</p>
1834    ConcurrentModification(String),
1835    /// <p>One or more of the specified arguments was not valid.</p>
1836    InvalidArgs(String),
1837    /// <p>The requested Amazon Resource Name (ARN) does not refer to an existing resource.</p>
1838    InvalidArn(String),
1839    /// <p>The S3 bucket policy is not valid. The policy must give ACM Private CA rights to read from and write to the bucket and find the bucket location.</p>
1840    InvalidPolicy(String),
1841    /// <p>The private CA is in a state during which a report or certificate cannot be generated.</p>
1842    InvalidState(String),
1843    /// <p>A resource such as a private CA, S3 bucket, certificate, or audit report cannot be found.</p>
1844    ResourceNotFound(String),
1845}
1846
1847impl UpdateCertificateAuthorityError {
1848    pub fn from_response(
1849        res: BufferedHttpResponse,
1850    ) -> RusotoError<UpdateCertificateAuthorityError> {
1851        if let Some(err) = proto::json::Error::parse(&res) {
1852            match err.typ.as_str() {
1853                "ConcurrentModificationException" => {
1854                    return RusotoError::Service(
1855                        UpdateCertificateAuthorityError::ConcurrentModification(err.msg),
1856                    )
1857                }
1858                "InvalidArgsException" => {
1859                    return RusotoError::Service(UpdateCertificateAuthorityError::InvalidArgs(
1860                        err.msg,
1861                    ))
1862                }
1863                "InvalidArnException" => {
1864                    return RusotoError::Service(UpdateCertificateAuthorityError::InvalidArn(
1865                        err.msg,
1866                    ))
1867                }
1868                "InvalidPolicyException" => {
1869                    return RusotoError::Service(UpdateCertificateAuthorityError::InvalidPolicy(
1870                        err.msg,
1871                    ))
1872                }
1873                "InvalidStateException" => {
1874                    return RusotoError::Service(UpdateCertificateAuthorityError::InvalidState(
1875                        err.msg,
1876                    ))
1877                }
1878                "ResourceNotFoundException" => {
1879                    return RusotoError::Service(UpdateCertificateAuthorityError::ResourceNotFound(
1880                        err.msg,
1881                    ))
1882                }
1883                "ValidationException" => return RusotoError::Validation(err.msg),
1884                _ => {}
1885            }
1886        }
1887        RusotoError::Unknown(res)
1888    }
1889}
1890impl fmt::Display for UpdateCertificateAuthorityError {
1891    #[allow(unused_variables)]
1892    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1893        match *self {
1894            UpdateCertificateAuthorityError::ConcurrentModification(ref cause) => {
1895                write!(f, "{}", cause)
1896            }
1897            UpdateCertificateAuthorityError::InvalidArgs(ref cause) => write!(f, "{}", cause),
1898            UpdateCertificateAuthorityError::InvalidArn(ref cause) => write!(f, "{}", cause),
1899            UpdateCertificateAuthorityError::InvalidPolicy(ref cause) => write!(f, "{}", cause),
1900            UpdateCertificateAuthorityError::InvalidState(ref cause) => write!(f, "{}", cause),
1901            UpdateCertificateAuthorityError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1902        }
1903    }
1904}
1905impl Error for UpdateCertificateAuthorityError {}
1906/// Trait representing the capabilities of the ACM-PCA API. ACM-PCA clients implement this trait.
1907#[async_trait]
1908pub trait AcmPca {
1909    /// <p>Creates a root or subordinate private certificate authority (CA). You must specify the CA configuration, the certificate revocation list (CRL) configuration, the CA type, and an optional idempotency token to avoid accidental creation of multiple CAs. The CA configuration specifies the name of the algorithm and key size to be used to create the CA private key, the type of signing algorithm that the CA uses, and X.500 subject information. The CRL configuration specifies the CRL expiration period in days (the validity period of the CRL), the Amazon S3 bucket that will contain the CRL, and a CNAME alias for the S3 bucket that is included in certificates issued by the CA. If successful, this action returns the Amazon Resource Name (ARN) of the CA.</p>
1910    async fn create_certificate_authority(
1911        &self,
1912        input: CreateCertificateAuthorityRequest,
1913    ) -> Result<CreateCertificateAuthorityResponse, RusotoError<CreateCertificateAuthorityError>>;
1914
1915    /// <p>Creates an audit report that lists every time that your CA private key is used. The report is saved in the Amazon S3 bucket that you specify on input. The <a>IssueCertificate</a> and <a>RevokeCertificate</a> actions use the private key.</p>
1916    async fn create_certificate_authority_audit_report(
1917        &self,
1918        input: CreateCertificateAuthorityAuditReportRequest,
1919    ) -> Result<
1920        CreateCertificateAuthorityAuditReportResponse,
1921        RusotoError<CreateCertificateAuthorityAuditReportError>,
1922    >;
1923
1924    /// <p>Assigns permissions from a private CA to a designated AWS service. Services are specified by their service principals and can be given permission to create and retrieve certificates on a private CA. Services can also be given permission to list the active permissions that the private CA has granted. For ACM to automatically renew your private CA's certificates, you must assign all possible permissions from the CA to the ACM service principal.</p> <p>At this time, you can only assign permissions to ACM (<code>acm.amazonaws.com</code>). Permissions can be revoked with the <a>DeletePermission</a> action and listed with the <a>ListPermissions</a> action.</p>
1925    async fn create_permission(
1926        &self,
1927        input: CreatePermissionRequest,
1928    ) -> Result<(), RusotoError<CreatePermissionError>>;
1929
1930    /// <p>Deletes a private certificate authority (CA). You must provide the Amazon Resource Name (ARN) of the private CA that you want to delete. You can find the ARN by calling the <a>ListCertificateAuthorities</a> action. </p> <note> <p>Deleting a CA will invalidate other CAs and certificates below it in your CA hierarchy.</p> </note> <p>Before you can delete a CA that you have created and activated, you must disable it. To do this, call the <a>UpdateCertificateAuthority</a> action and set the <b>CertificateAuthorityStatus</b> parameter to <code>DISABLED</code>. </p> <p>Additionally, you can delete a CA if you are waiting for it to be created (that is, the status of the CA is <code>CREATING</code>). You can also delete it if the CA has been created but you haven't yet imported the signed certificate into ACM Private CA (that is, the status of the CA is <code>PENDING_CERTIFICATE</code>). </p> <p>When you successfully call <a>DeleteCertificateAuthority</a>, the CA's status changes to <code>DELETED</code>. However, the CA won't be permanently deleted until the restoration period has passed. By default, if you do not set the <code>PermanentDeletionTimeInDays</code> parameter, the CA remains restorable for 30 days. You can set the parameter from 7 to 30 days. The <a>DescribeCertificateAuthority</a> action returns the time remaining in the restoration window of a private CA in the <code>DELETED</code> state. To restore an eligible CA, call the <a>RestoreCertificateAuthority</a> action.</p>
1931    async fn delete_certificate_authority(
1932        &self,
1933        input: DeleteCertificateAuthorityRequest,
1934    ) -> Result<(), RusotoError<DeleteCertificateAuthorityError>>;
1935
1936    /// <p>Revokes permissions that a private CA assigned to a designated AWS service. Permissions can be created with the <a>CreatePermission</a> action and listed with the <a>ListPermissions</a> action. </p>
1937    async fn delete_permission(
1938        &self,
1939        input: DeletePermissionRequest,
1940    ) -> Result<(), RusotoError<DeletePermissionError>>;
1941
1942    /// <p><p>Lists information about your private certificate authority (CA). You specify the private CA on input by its ARN (Amazon Resource Name). The output contains the status of your CA. This can be any of the following: </p> <ul> <li> <p> <code>CREATING</code> - ACM Private CA is creating your private certificate authority.</p> </li> <li> <p> <code>PENDING_CERTIFICATE</code> - The certificate is pending. You must use your ACM Private CA-hosted or on-premises root or subordinate CA to sign your private CA CSR and then import it into PCA. </p> </li> <li> <p> <code>ACTIVE</code> - Your private CA is active.</p> </li> <li> <p> <code>DISABLED</code> - Your private CA has been disabled.</p> </li> <li> <p> <code>EXPIRED</code> - Your private CA certificate has expired.</p> </li> <li> <p> <code>FAILED</code> - Your private CA has failed. Your CA can fail because of problems such a network outage or backend AWS failure or other errors. A failed CA can never return to the pending state. You must create a new CA. </p> </li> <li> <p> <code>DELETED</code> - Your private CA is within the restoration period, after which it is permanently deleted. The length of time remaining in the CA&#39;s restoration period is also included in this action&#39;s output.</p> </li> </ul></p>
1943    async fn describe_certificate_authority(
1944        &self,
1945        input: DescribeCertificateAuthorityRequest,
1946    ) -> Result<DescribeCertificateAuthorityResponse, RusotoError<DescribeCertificateAuthorityError>>;
1947
1948    /// <p>Lists information about a specific audit report created by calling the <a>CreateCertificateAuthorityAuditReport</a> action. Audit information is created every time the certificate authority (CA) private key is used. The private key is used when you call the <a>IssueCertificate</a> action or the <a>RevokeCertificate</a> action. </p>
1949    async fn describe_certificate_authority_audit_report(
1950        &self,
1951        input: DescribeCertificateAuthorityAuditReportRequest,
1952    ) -> Result<
1953        DescribeCertificateAuthorityAuditReportResponse,
1954        RusotoError<DescribeCertificateAuthorityAuditReportError>,
1955    >;
1956
1957    /// <p>Retrieves a certificate from your private CA. The ARN of the certificate is returned when you call the <a>IssueCertificate</a> action. You must specify both the ARN of your private CA and the ARN of the issued certificate when calling the <b>GetCertificate</b> action. You can retrieve the certificate if it is in the <b>ISSUED</b> state. You can call the <a>CreateCertificateAuthorityAuditReport</a> action to create a report that contains information about all of the certificates issued and revoked by your private CA. </p>
1958    async fn get_certificate(
1959        &self,
1960        input: GetCertificateRequest,
1961    ) -> Result<GetCertificateResponse, RusotoError<GetCertificateError>>;
1962
1963    /// <p>Retrieves the certificate and certificate chain for your private certificate authority (CA). Both the certificate and the chain are base64 PEM-encoded. The chain does not include the CA certificate. Each certificate in the chain signs the one before it. </p>
1964    async fn get_certificate_authority_certificate(
1965        &self,
1966        input: GetCertificateAuthorityCertificateRequest,
1967    ) -> Result<
1968        GetCertificateAuthorityCertificateResponse,
1969        RusotoError<GetCertificateAuthorityCertificateError>,
1970    >;
1971
1972    /// <p>Retrieves the certificate signing request (CSR) for your private certificate authority (CA). The CSR is created when you call the <a>CreateCertificateAuthority</a> action. Sign the CSR with your ACM Private CA-hosted or on-premises root or subordinate CA. Then import the signed certificate back into ACM Private CA by calling the <a>ImportCertificateAuthorityCertificate</a> action. The CSR is returned as a base64 PEM-encoded string. </p>
1973    async fn get_certificate_authority_csr(
1974        &self,
1975        input: GetCertificateAuthorityCsrRequest,
1976    ) -> Result<GetCertificateAuthorityCsrResponse, RusotoError<GetCertificateAuthorityCsrError>>;
1977
1978    /// <p><p>Imports a signed private CA certificate into ACM Private CA. This action is used when you are using a chain of trust whose root is located outside ACM Private CA. Before you can call this action, the following preparations must in place:</p> <ol> <li> <p>In ACM Private CA, call the <a>CreateCertificateAuthority</a> action to create the private CA that that you plan to back with the imported certificate.</p> </li> <li> <p>Call the <a>GetCertificateAuthorityCsr</a> action to generate a certificate signing request (CSR).</p> </li> <li> <p>Sign the CSR using a root or intermediate CA hosted either by an on-premises PKI hierarchy or a commercial CA..</p> </li> <li> <p>Create a certificate chain and copy the signed certificate and the certificate chain to your working directory.</p> </li> </ol> <p>The following requirements apply when you import a CA certificate.</p> <ul> <li> <p>You cannot import a non-self-signed certificate for use as a root CA.</p> </li> <li> <p>You cannot import a self-signed certificate for use as a subordinate CA.</p> </li> <li> <p>Your certificate chain must not include the private CA certificate that you are importing.</p> </li> <li> <p>Your ACM Private CA-hosted or on-premises CA certificate must be the last certificate in your chain. The subordinate certificate, if any, that your root CA signed must be next to last. The subordinate certificate signed by the preceding subordinate CA must come next, and so on until your chain is built. </p> </li> <li> <p>The chain must be PEM-encoded.</p> </li> </ul></p>
1979    async fn import_certificate_authority_certificate(
1980        &self,
1981        input: ImportCertificateAuthorityCertificateRequest,
1982    ) -> Result<(), RusotoError<ImportCertificateAuthorityCertificateError>>;
1983
1984    /// <p><p>Uses your private certificate authority (CA) to issue a client certificate. This action returns the Amazon Resource Name (ARN) of the certificate. You can retrieve the certificate by calling the <a>GetCertificate</a> action and specifying the ARN. </p> <note> <p>You cannot use the ACM <b>ListCertificateAuthorities</b> action to retrieve the ARNs of the certificates that you issue by using ACM Private CA.</p> </note></p>
1985    async fn issue_certificate(
1986        &self,
1987        input: IssueCertificateRequest,
1988    ) -> Result<IssueCertificateResponse, RusotoError<IssueCertificateError>>;
1989
1990    /// <p>Lists the private certificate authorities that you created by using the <a>CreateCertificateAuthority</a> action.</p>
1991    async fn list_certificate_authorities(
1992        &self,
1993        input: ListCertificateAuthoritiesRequest,
1994    ) -> Result<ListCertificateAuthoritiesResponse, RusotoError<ListCertificateAuthoritiesError>>;
1995
1996    /// <p>Lists all the permissions, if any, that have been assigned by a private CA. Permissions can be granted with the <a>CreatePermission</a> action and revoked with the <a>DeletePermission</a> action.</p>
1997    async fn list_permissions(
1998        &self,
1999        input: ListPermissionsRequest,
2000    ) -> Result<ListPermissionsResponse, RusotoError<ListPermissionsError>>;
2001
2002    /// <p>Lists the tags, if any, that are associated with your private CA. Tags are labels that you can use to identify and organize your CAs. Each tag consists of a key and an optional value. Call the <a>TagCertificateAuthority</a> action to add one or more tags to your CA. Call the <a>UntagCertificateAuthority</a> action to remove tags. </p>
2003    async fn list_tags(
2004        &self,
2005        input: ListTagsRequest,
2006    ) -> Result<ListTagsResponse, RusotoError<ListTagsError>>;
2007
2008    /// <p>Restores a certificate authority (CA) that is in the <code>DELETED</code> state. You can restore a CA during the period that you defined in the <b>PermanentDeletionTimeInDays</b> parameter of the <a>DeleteCertificateAuthority</a> action. Currently, you can specify 7 to 30 days. If you did not specify a <b>PermanentDeletionTimeInDays</b> value, by default you can restore the CA at any time in a 30 day period. You can check the time remaining in the restoration period of a private CA in the <code>DELETED</code> state by calling the <a>DescribeCertificateAuthority</a> or <a>ListCertificateAuthorities</a> actions. The status of a restored CA is set to its pre-deletion status when the <b>RestoreCertificateAuthority</b> action returns. To change its status to <code>ACTIVE</code>, call the <a>UpdateCertificateAuthority</a> action. If the private CA was in the <code>PENDING_CERTIFICATE</code> state at deletion, you must use the <a>ImportCertificateAuthorityCertificate</a> action to import a certificate authority into the private CA before it can be activated. You cannot restore a CA after the restoration period has ended.</p>
2009    async fn restore_certificate_authority(
2010        &self,
2011        input: RestoreCertificateAuthorityRequest,
2012    ) -> Result<(), RusotoError<RestoreCertificateAuthorityError>>;
2013
2014    /// <p><p>Revokes a certificate that was issued inside ACM Private CA. If you enable a certificate revocation list (CRL) when you create or update your private CA, information about the revoked certificates will be included in the CRL. ACM Private CA writes the CRL to an S3 bucket that you specify. For more information about revocation, see the <a>CrlConfiguration</a> structure. ACM Private CA also writes revocation information to the audit report. For more information, see <a>CreateCertificateAuthorityAuditReport</a>. </p> <note> <p>You cannot revoke a root CA self-signed certificate.</p> </note></p>
2015    async fn revoke_certificate(
2016        &self,
2017        input: RevokeCertificateRequest,
2018    ) -> Result<(), RusotoError<RevokeCertificateError>>;
2019
2020    /// <p>Adds one or more tags to your private CA. Tags are labels that you can use to identify and organize your AWS resources. Each tag consists of a key and an optional value. You specify the private CA on input by its Amazon Resource Name (ARN). You specify the tag by using a key-value pair. You can apply a tag to just one private CA if you want to identify a specific characteristic of that CA, or you can apply the same tag to multiple private CAs if you want to filter for a common relationship among those CAs. To remove one or more tags, use the <a>UntagCertificateAuthority</a> action. Call the <a>ListTags</a> action to see what tags are associated with your CA. </p>
2021    async fn tag_certificate_authority(
2022        &self,
2023        input: TagCertificateAuthorityRequest,
2024    ) -> Result<(), RusotoError<TagCertificateAuthorityError>>;
2025
2026    /// <p>Remove one or more tags from your private CA. A tag consists of a key-value pair. If you do not specify the value portion of the tag when calling this action, 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. To add tags to a private CA, use the <a>TagCertificateAuthority</a>. Call the <a>ListTags</a> action to see what tags are associated with your CA. </p>
2027    async fn untag_certificate_authority(
2028        &self,
2029        input: UntagCertificateAuthorityRequest,
2030    ) -> Result<(), RusotoError<UntagCertificateAuthorityError>>;
2031
2032    /// <p>Updates the status or configuration of a private certificate authority (CA). Your private CA must be in the <code>ACTIVE</code> or <code>DISABLED</code> state before you can update it. You can disable a private CA that is in the <code>ACTIVE</code> state or make a CA that is in the <code>DISABLED</code> state active again.</p>
2033    async fn update_certificate_authority(
2034        &self,
2035        input: UpdateCertificateAuthorityRequest,
2036    ) -> Result<(), RusotoError<UpdateCertificateAuthorityError>>;
2037}
2038/// A client for the ACM-PCA API.
2039#[derive(Clone)]
2040pub struct AcmPcaClient {
2041    client: Client,
2042    region: region::Region,
2043}
2044
2045impl AcmPcaClient {
2046    /// Creates a client backed by the default tokio event loop.
2047    ///
2048    /// The client will use the default credentials provider and tls client.
2049    pub fn new(region: region::Region) -> AcmPcaClient {
2050        AcmPcaClient {
2051            client: Client::shared(),
2052            region,
2053        }
2054    }
2055
2056    pub fn new_with<P, D>(
2057        request_dispatcher: D,
2058        credentials_provider: P,
2059        region: region::Region,
2060    ) -> AcmPcaClient
2061    where
2062        P: ProvideAwsCredentials + Send + Sync + 'static,
2063        D: DispatchSignedRequest + Send + Sync + 'static,
2064    {
2065        AcmPcaClient {
2066            client: Client::new_with(credentials_provider, request_dispatcher),
2067            region,
2068        }
2069    }
2070
2071    pub fn new_with_client(client: Client, region: region::Region) -> AcmPcaClient {
2072        AcmPcaClient { client, region }
2073    }
2074}
2075
2076#[async_trait]
2077impl AcmPca for AcmPcaClient {
2078    /// <p>Creates a root or subordinate private certificate authority (CA). You must specify the CA configuration, the certificate revocation list (CRL) configuration, the CA type, and an optional idempotency token to avoid accidental creation of multiple CAs. The CA configuration specifies the name of the algorithm and key size to be used to create the CA private key, the type of signing algorithm that the CA uses, and X.500 subject information. The CRL configuration specifies the CRL expiration period in days (the validity period of the CRL), the Amazon S3 bucket that will contain the CRL, and a CNAME alias for the S3 bucket that is included in certificates issued by the CA. If successful, this action returns the Amazon Resource Name (ARN) of the CA.</p>
2079    async fn create_certificate_authority(
2080        &self,
2081        input: CreateCertificateAuthorityRequest,
2082    ) -> Result<CreateCertificateAuthorityResponse, RusotoError<CreateCertificateAuthorityError>>
2083    {
2084        let mut request = self.new_signed_request("POST", "/");
2085        request.add_header("x-amz-target", "ACMPrivateCA.CreateCertificateAuthority");
2086        let encoded = serde_json::to_string(&input).unwrap();
2087        request.set_payload(Some(encoded));
2088
2089        let response = self
2090            .sign_and_dispatch(request, CreateCertificateAuthorityError::from_response)
2091            .await?;
2092        let mut response = response;
2093        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2094        proto::json::ResponsePayload::new(&response)
2095            .deserialize::<CreateCertificateAuthorityResponse, _>()
2096    }
2097
2098    /// <p>Creates an audit report that lists every time that your CA private key is used. The report is saved in the Amazon S3 bucket that you specify on input. The <a>IssueCertificate</a> and <a>RevokeCertificate</a> actions use the private key.</p>
2099    async fn create_certificate_authority_audit_report(
2100        &self,
2101        input: CreateCertificateAuthorityAuditReportRequest,
2102    ) -> Result<
2103        CreateCertificateAuthorityAuditReportResponse,
2104        RusotoError<CreateCertificateAuthorityAuditReportError>,
2105    > {
2106        let mut request = self.new_signed_request("POST", "/");
2107        request.add_header(
2108            "x-amz-target",
2109            "ACMPrivateCA.CreateCertificateAuthorityAuditReport",
2110        );
2111        let encoded = serde_json::to_string(&input).unwrap();
2112        request.set_payload(Some(encoded));
2113
2114        let response = self
2115            .sign_and_dispatch(
2116                request,
2117                CreateCertificateAuthorityAuditReportError::from_response,
2118            )
2119            .await?;
2120        let mut response = response;
2121        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2122        proto::json::ResponsePayload::new(&response)
2123            .deserialize::<CreateCertificateAuthorityAuditReportResponse, _>()
2124    }
2125
2126    /// <p>Assigns permissions from a private CA to a designated AWS service. Services are specified by their service principals and can be given permission to create and retrieve certificates on a private CA. Services can also be given permission to list the active permissions that the private CA has granted. For ACM to automatically renew your private CA's certificates, you must assign all possible permissions from the CA to the ACM service principal.</p> <p>At this time, you can only assign permissions to ACM (<code>acm.amazonaws.com</code>). Permissions can be revoked with the <a>DeletePermission</a> action and listed with the <a>ListPermissions</a> action.</p>
2127    async fn create_permission(
2128        &self,
2129        input: CreatePermissionRequest,
2130    ) -> Result<(), RusotoError<CreatePermissionError>> {
2131        let mut request = self.new_signed_request("POST", "/");
2132        request.add_header("x-amz-target", "ACMPrivateCA.CreatePermission");
2133        let encoded = serde_json::to_string(&input).unwrap();
2134        request.set_payload(Some(encoded));
2135
2136        let response = self
2137            .sign_and_dispatch(request, CreatePermissionError::from_response)
2138            .await?;
2139        std::mem::drop(response);
2140        Ok(())
2141    }
2142
2143    /// <p>Deletes a private certificate authority (CA). You must provide the Amazon Resource Name (ARN) of the private CA that you want to delete. You can find the ARN by calling the <a>ListCertificateAuthorities</a> action. </p> <note> <p>Deleting a CA will invalidate other CAs and certificates below it in your CA hierarchy.</p> </note> <p>Before you can delete a CA that you have created and activated, you must disable it. To do this, call the <a>UpdateCertificateAuthority</a> action and set the <b>CertificateAuthorityStatus</b> parameter to <code>DISABLED</code>. </p> <p>Additionally, you can delete a CA if you are waiting for it to be created (that is, the status of the CA is <code>CREATING</code>). You can also delete it if the CA has been created but you haven't yet imported the signed certificate into ACM Private CA (that is, the status of the CA is <code>PENDING_CERTIFICATE</code>). </p> <p>When you successfully call <a>DeleteCertificateAuthority</a>, the CA's status changes to <code>DELETED</code>. However, the CA won't be permanently deleted until the restoration period has passed. By default, if you do not set the <code>PermanentDeletionTimeInDays</code> parameter, the CA remains restorable for 30 days. You can set the parameter from 7 to 30 days. The <a>DescribeCertificateAuthority</a> action returns the time remaining in the restoration window of a private CA in the <code>DELETED</code> state. To restore an eligible CA, call the <a>RestoreCertificateAuthority</a> action.</p>
2144    async fn delete_certificate_authority(
2145        &self,
2146        input: DeleteCertificateAuthorityRequest,
2147    ) -> Result<(), RusotoError<DeleteCertificateAuthorityError>> {
2148        let mut request = self.new_signed_request("POST", "/");
2149        request.add_header("x-amz-target", "ACMPrivateCA.DeleteCertificateAuthority");
2150        let encoded = serde_json::to_string(&input).unwrap();
2151        request.set_payload(Some(encoded));
2152
2153        let response = self
2154            .sign_and_dispatch(request, DeleteCertificateAuthorityError::from_response)
2155            .await?;
2156        std::mem::drop(response);
2157        Ok(())
2158    }
2159
2160    /// <p>Revokes permissions that a private CA assigned to a designated AWS service. Permissions can be created with the <a>CreatePermission</a> action and listed with the <a>ListPermissions</a> action. </p>
2161    async fn delete_permission(
2162        &self,
2163        input: DeletePermissionRequest,
2164    ) -> Result<(), RusotoError<DeletePermissionError>> {
2165        let mut request = self.new_signed_request("POST", "/");
2166        request.add_header("x-amz-target", "ACMPrivateCA.DeletePermission");
2167        let encoded = serde_json::to_string(&input).unwrap();
2168        request.set_payload(Some(encoded));
2169
2170        let response = self
2171            .sign_and_dispatch(request, DeletePermissionError::from_response)
2172            .await?;
2173        std::mem::drop(response);
2174        Ok(())
2175    }
2176
2177    /// <p><p>Lists information about your private certificate authority (CA). You specify the private CA on input by its ARN (Amazon Resource Name). The output contains the status of your CA. This can be any of the following: </p> <ul> <li> <p> <code>CREATING</code> - ACM Private CA is creating your private certificate authority.</p> </li> <li> <p> <code>PENDING_CERTIFICATE</code> - The certificate is pending. You must use your ACM Private CA-hosted or on-premises root or subordinate CA to sign your private CA CSR and then import it into PCA. </p> </li> <li> <p> <code>ACTIVE</code> - Your private CA is active.</p> </li> <li> <p> <code>DISABLED</code> - Your private CA has been disabled.</p> </li> <li> <p> <code>EXPIRED</code> - Your private CA certificate has expired.</p> </li> <li> <p> <code>FAILED</code> - Your private CA has failed. Your CA can fail because of problems such a network outage or backend AWS failure or other errors. A failed CA can never return to the pending state. You must create a new CA. </p> </li> <li> <p> <code>DELETED</code> - Your private CA is within the restoration period, after which it is permanently deleted. The length of time remaining in the CA&#39;s restoration period is also included in this action&#39;s output.</p> </li> </ul></p>
2178    async fn describe_certificate_authority(
2179        &self,
2180        input: DescribeCertificateAuthorityRequest,
2181    ) -> Result<DescribeCertificateAuthorityResponse, RusotoError<DescribeCertificateAuthorityError>>
2182    {
2183        let mut request = self.new_signed_request("POST", "/");
2184        request.add_header("x-amz-target", "ACMPrivateCA.DescribeCertificateAuthority");
2185        let encoded = serde_json::to_string(&input).unwrap();
2186        request.set_payload(Some(encoded));
2187
2188        let response = self
2189            .sign_and_dispatch(request, DescribeCertificateAuthorityError::from_response)
2190            .await?;
2191        let mut response = response;
2192        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2193        proto::json::ResponsePayload::new(&response)
2194            .deserialize::<DescribeCertificateAuthorityResponse, _>()
2195    }
2196
2197    /// <p>Lists information about a specific audit report created by calling the <a>CreateCertificateAuthorityAuditReport</a> action. Audit information is created every time the certificate authority (CA) private key is used. The private key is used when you call the <a>IssueCertificate</a> action or the <a>RevokeCertificate</a> action. </p>
2198    async fn describe_certificate_authority_audit_report(
2199        &self,
2200        input: DescribeCertificateAuthorityAuditReportRequest,
2201    ) -> Result<
2202        DescribeCertificateAuthorityAuditReportResponse,
2203        RusotoError<DescribeCertificateAuthorityAuditReportError>,
2204    > {
2205        let mut request = self.new_signed_request("POST", "/");
2206        request.add_header(
2207            "x-amz-target",
2208            "ACMPrivateCA.DescribeCertificateAuthorityAuditReport",
2209        );
2210        let encoded = serde_json::to_string(&input).unwrap();
2211        request.set_payload(Some(encoded));
2212
2213        let response = self
2214            .sign_and_dispatch(
2215                request,
2216                DescribeCertificateAuthorityAuditReportError::from_response,
2217            )
2218            .await?;
2219        let mut response = response;
2220        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2221        proto::json::ResponsePayload::new(&response)
2222            .deserialize::<DescribeCertificateAuthorityAuditReportResponse, _>()
2223    }
2224
2225    /// <p>Retrieves a certificate from your private CA. The ARN of the certificate is returned when you call the <a>IssueCertificate</a> action. You must specify both the ARN of your private CA and the ARN of the issued certificate when calling the <b>GetCertificate</b> action. You can retrieve the certificate if it is in the <b>ISSUED</b> state. You can call the <a>CreateCertificateAuthorityAuditReport</a> action to create a report that contains information about all of the certificates issued and revoked by your private CA. </p>
2226    async fn get_certificate(
2227        &self,
2228        input: GetCertificateRequest,
2229    ) -> Result<GetCertificateResponse, RusotoError<GetCertificateError>> {
2230        let mut request = self.new_signed_request("POST", "/");
2231        request.add_header("x-amz-target", "ACMPrivateCA.GetCertificate");
2232        let encoded = serde_json::to_string(&input).unwrap();
2233        request.set_payload(Some(encoded));
2234
2235        let response = self
2236            .sign_and_dispatch(request, GetCertificateError::from_response)
2237            .await?;
2238        let mut response = response;
2239        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2240        proto::json::ResponsePayload::new(&response).deserialize::<GetCertificateResponse, _>()
2241    }
2242
2243    /// <p>Retrieves the certificate and certificate chain for your private certificate authority (CA). Both the certificate and the chain are base64 PEM-encoded. The chain does not include the CA certificate. Each certificate in the chain signs the one before it. </p>
2244    async fn get_certificate_authority_certificate(
2245        &self,
2246        input: GetCertificateAuthorityCertificateRequest,
2247    ) -> Result<
2248        GetCertificateAuthorityCertificateResponse,
2249        RusotoError<GetCertificateAuthorityCertificateError>,
2250    > {
2251        let mut request = self.new_signed_request("POST", "/");
2252        request.add_header(
2253            "x-amz-target",
2254            "ACMPrivateCA.GetCertificateAuthorityCertificate",
2255        );
2256        let encoded = serde_json::to_string(&input).unwrap();
2257        request.set_payload(Some(encoded));
2258
2259        let response = self
2260            .sign_and_dispatch(
2261                request,
2262                GetCertificateAuthorityCertificateError::from_response,
2263            )
2264            .await?;
2265        let mut response = response;
2266        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2267        proto::json::ResponsePayload::new(&response)
2268            .deserialize::<GetCertificateAuthorityCertificateResponse, _>()
2269    }
2270
2271    /// <p>Retrieves the certificate signing request (CSR) for your private certificate authority (CA). The CSR is created when you call the <a>CreateCertificateAuthority</a> action. Sign the CSR with your ACM Private CA-hosted or on-premises root or subordinate CA. Then import the signed certificate back into ACM Private CA by calling the <a>ImportCertificateAuthorityCertificate</a> action. The CSR is returned as a base64 PEM-encoded string. </p>
2272    async fn get_certificate_authority_csr(
2273        &self,
2274        input: GetCertificateAuthorityCsrRequest,
2275    ) -> Result<GetCertificateAuthorityCsrResponse, RusotoError<GetCertificateAuthorityCsrError>>
2276    {
2277        let mut request = self.new_signed_request("POST", "/");
2278        request.add_header("x-amz-target", "ACMPrivateCA.GetCertificateAuthorityCsr");
2279        let encoded = serde_json::to_string(&input).unwrap();
2280        request.set_payload(Some(encoded));
2281
2282        let response = self
2283            .sign_and_dispatch(request, GetCertificateAuthorityCsrError::from_response)
2284            .await?;
2285        let mut response = response;
2286        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2287        proto::json::ResponsePayload::new(&response)
2288            .deserialize::<GetCertificateAuthorityCsrResponse, _>()
2289    }
2290
2291    /// <p><p>Imports a signed private CA certificate into ACM Private CA. This action is used when you are using a chain of trust whose root is located outside ACM Private CA. Before you can call this action, the following preparations must in place:</p> <ol> <li> <p>In ACM Private CA, call the <a>CreateCertificateAuthority</a> action to create the private CA that that you plan to back with the imported certificate.</p> </li> <li> <p>Call the <a>GetCertificateAuthorityCsr</a> action to generate a certificate signing request (CSR).</p> </li> <li> <p>Sign the CSR using a root or intermediate CA hosted either by an on-premises PKI hierarchy or a commercial CA..</p> </li> <li> <p>Create a certificate chain and copy the signed certificate and the certificate chain to your working directory.</p> </li> </ol> <p>The following requirements apply when you import a CA certificate.</p> <ul> <li> <p>You cannot import a non-self-signed certificate for use as a root CA.</p> </li> <li> <p>You cannot import a self-signed certificate for use as a subordinate CA.</p> </li> <li> <p>Your certificate chain must not include the private CA certificate that you are importing.</p> </li> <li> <p>Your ACM Private CA-hosted or on-premises CA certificate must be the last certificate in your chain. The subordinate certificate, if any, that your root CA signed must be next to last. The subordinate certificate signed by the preceding subordinate CA must come next, and so on until your chain is built. </p> </li> <li> <p>The chain must be PEM-encoded.</p> </li> </ul></p>
2292    async fn import_certificate_authority_certificate(
2293        &self,
2294        input: ImportCertificateAuthorityCertificateRequest,
2295    ) -> Result<(), RusotoError<ImportCertificateAuthorityCertificateError>> {
2296        let mut request = self.new_signed_request("POST", "/");
2297        request.add_header(
2298            "x-amz-target",
2299            "ACMPrivateCA.ImportCertificateAuthorityCertificate",
2300        );
2301        let encoded = serde_json::to_string(&input).unwrap();
2302        request.set_payload(Some(encoded));
2303
2304        let response = self
2305            .sign_and_dispatch(
2306                request,
2307                ImportCertificateAuthorityCertificateError::from_response,
2308            )
2309            .await?;
2310        std::mem::drop(response);
2311        Ok(())
2312    }
2313
2314    /// <p><p>Uses your private certificate authority (CA) to issue a client certificate. This action returns the Amazon Resource Name (ARN) of the certificate. You can retrieve the certificate by calling the <a>GetCertificate</a> action and specifying the ARN. </p> <note> <p>You cannot use the ACM <b>ListCertificateAuthorities</b> action to retrieve the ARNs of the certificates that you issue by using ACM Private CA.</p> </note></p>
2315    async fn issue_certificate(
2316        &self,
2317        input: IssueCertificateRequest,
2318    ) -> Result<IssueCertificateResponse, RusotoError<IssueCertificateError>> {
2319        let mut request = self.new_signed_request("POST", "/");
2320        request.add_header("x-amz-target", "ACMPrivateCA.IssueCertificate");
2321        let encoded = serde_json::to_string(&input).unwrap();
2322        request.set_payload(Some(encoded));
2323
2324        let response = self
2325            .sign_and_dispatch(request, IssueCertificateError::from_response)
2326            .await?;
2327        let mut response = response;
2328        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2329        proto::json::ResponsePayload::new(&response).deserialize::<IssueCertificateResponse, _>()
2330    }
2331
2332    /// <p>Lists the private certificate authorities that you created by using the <a>CreateCertificateAuthority</a> action.</p>
2333    async fn list_certificate_authorities(
2334        &self,
2335        input: ListCertificateAuthoritiesRequest,
2336    ) -> Result<ListCertificateAuthoritiesResponse, RusotoError<ListCertificateAuthoritiesError>>
2337    {
2338        let mut request = self.new_signed_request("POST", "/");
2339        request.add_header("x-amz-target", "ACMPrivateCA.ListCertificateAuthorities");
2340        let encoded = serde_json::to_string(&input).unwrap();
2341        request.set_payload(Some(encoded));
2342
2343        let response = self
2344            .sign_and_dispatch(request, ListCertificateAuthoritiesError::from_response)
2345            .await?;
2346        let mut response = response;
2347        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2348        proto::json::ResponsePayload::new(&response)
2349            .deserialize::<ListCertificateAuthoritiesResponse, _>()
2350    }
2351
2352    /// <p>Lists all the permissions, if any, that have been assigned by a private CA. Permissions can be granted with the <a>CreatePermission</a> action and revoked with the <a>DeletePermission</a> action.</p>
2353    async fn list_permissions(
2354        &self,
2355        input: ListPermissionsRequest,
2356    ) -> Result<ListPermissionsResponse, RusotoError<ListPermissionsError>> {
2357        let mut request = self.new_signed_request("POST", "/");
2358        request.add_header("x-amz-target", "ACMPrivateCA.ListPermissions");
2359        let encoded = serde_json::to_string(&input).unwrap();
2360        request.set_payload(Some(encoded));
2361
2362        let response = self
2363            .sign_and_dispatch(request, ListPermissionsError::from_response)
2364            .await?;
2365        let mut response = response;
2366        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2367        proto::json::ResponsePayload::new(&response).deserialize::<ListPermissionsResponse, _>()
2368    }
2369
2370    /// <p>Lists the tags, if any, that are associated with your private CA. Tags are labels that you can use to identify and organize your CAs. Each tag consists of a key and an optional value. Call the <a>TagCertificateAuthority</a> action to add one or more tags to your CA. Call the <a>UntagCertificateAuthority</a> action to remove tags. </p>
2371    async fn list_tags(
2372        &self,
2373        input: ListTagsRequest,
2374    ) -> Result<ListTagsResponse, RusotoError<ListTagsError>> {
2375        let mut request = self.new_signed_request("POST", "/");
2376        request.add_header("x-amz-target", "ACMPrivateCA.ListTags");
2377        let encoded = serde_json::to_string(&input).unwrap();
2378        request.set_payload(Some(encoded));
2379
2380        let response = self
2381            .sign_and_dispatch(request, ListTagsError::from_response)
2382            .await?;
2383        let mut response = response;
2384        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2385        proto::json::ResponsePayload::new(&response).deserialize::<ListTagsResponse, _>()
2386    }
2387
2388    /// <p>Restores a certificate authority (CA) that is in the <code>DELETED</code> state. You can restore a CA during the period that you defined in the <b>PermanentDeletionTimeInDays</b> parameter of the <a>DeleteCertificateAuthority</a> action. Currently, you can specify 7 to 30 days. If you did not specify a <b>PermanentDeletionTimeInDays</b> value, by default you can restore the CA at any time in a 30 day period. You can check the time remaining in the restoration period of a private CA in the <code>DELETED</code> state by calling the <a>DescribeCertificateAuthority</a> or <a>ListCertificateAuthorities</a> actions. The status of a restored CA is set to its pre-deletion status when the <b>RestoreCertificateAuthority</b> action returns. To change its status to <code>ACTIVE</code>, call the <a>UpdateCertificateAuthority</a> action. If the private CA was in the <code>PENDING_CERTIFICATE</code> state at deletion, you must use the <a>ImportCertificateAuthorityCertificate</a> action to import a certificate authority into the private CA before it can be activated. You cannot restore a CA after the restoration period has ended.</p>
2389    async fn restore_certificate_authority(
2390        &self,
2391        input: RestoreCertificateAuthorityRequest,
2392    ) -> Result<(), RusotoError<RestoreCertificateAuthorityError>> {
2393        let mut request = self.new_signed_request("POST", "/");
2394        request.add_header("x-amz-target", "ACMPrivateCA.RestoreCertificateAuthority");
2395        let encoded = serde_json::to_string(&input).unwrap();
2396        request.set_payload(Some(encoded));
2397
2398        let response = self
2399            .sign_and_dispatch(request, RestoreCertificateAuthorityError::from_response)
2400            .await?;
2401        std::mem::drop(response);
2402        Ok(())
2403    }
2404
2405    /// <p><p>Revokes a certificate that was issued inside ACM Private CA. If you enable a certificate revocation list (CRL) when you create or update your private CA, information about the revoked certificates will be included in the CRL. ACM Private CA writes the CRL to an S3 bucket that you specify. For more information about revocation, see the <a>CrlConfiguration</a> structure. ACM Private CA also writes revocation information to the audit report. For more information, see <a>CreateCertificateAuthorityAuditReport</a>. </p> <note> <p>You cannot revoke a root CA self-signed certificate.</p> </note></p>
2406    async fn revoke_certificate(
2407        &self,
2408        input: RevokeCertificateRequest,
2409    ) -> Result<(), RusotoError<RevokeCertificateError>> {
2410        let mut request = self.new_signed_request("POST", "/");
2411        request.add_header("x-amz-target", "ACMPrivateCA.RevokeCertificate");
2412        let encoded = serde_json::to_string(&input).unwrap();
2413        request.set_payload(Some(encoded));
2414
2415        let response = self
2416            .sign_and_dispatch(request, RevokeCertificateError::from_response)
2417            .await?;
2418        std::mem::drop(response);
2419        Ok(())
2420    }
2421
2422    /// <p>Adds one or more tags to your private CA. Tags are labels that you can use to identify and organize your AWS resources. Each tag consists of a key and an optional value. You specify the private CA on input by its Amazon Resource Name (ARN). You specify the tag by using a key-value pair. You can apply a tag to just one private CA if you want to identify a specific characteristic of that CA, or you can apply the same tag to multiple private CAs if you want to filter for a common relationship among those CAs. To remove one or more tags, use the <a>UntagCertificateAuthority</a> action. Call the <a>ListTags</a> action to see what tags are associated with your CA. </p>
2423    async fn tag_certificate_authority(
2424        &self,
2425        input: TagCertificateAuthorityRequest,
2426    ) -> Result<(), RusotoError<TagCertificateAuthorityError>> {
2427        let mut request = self.new_signed_request("POST", "/");
2428        request.add_header("x-amz-target", "ACMPrivateCA.TagCertificateAuthority");
2429        let encoded = serde_json::to_string(&input).unwrap();
2430        request.set_payload(Some(encoded));
2431
2432        let response = self
2433            .sign_and_dispatch(request, TagCertificateAuthorityError::from_response)
2434            .await?;
2435        std::mem::drop(response);
2436        Ok(())
2437    }
2438
2439    /// <p>Remove one or more tags from your private CA. A tag consists of a key-value pair. If you do not specify the value portion of the tag when calling this action, 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. To add tags to a private CA, use the <a>TagCertificateAuthority</a>. Call the <a>ListTags</a> action to see what tags are associated with your CA. </p>
2440    async fn untag_certificate_authority(
2441        &self,
2442        input: UntagCertificateAuthorityRequest,
2443    ) -> Result<(), RusotoError<UntagCertificateAuthorityError>> {
2444        let mut request = self.new_signed_request("POST", "/");
2445        request.add_header("x-amz-target", "ACMPrivateCA.UntagCertificateAuthority");
2446        let encoded = serde_json::to_string(&input).unwrap();
2447        request.set_payload(Some(encoded));
2448
2449        let response = self
2450            .sign_and_dispatch(request, UntagCertificateAuthorityError::from_response)
2451            .await?;
2452        std::mem::drop(response);
2453        Ok(())
2454    }
2455
2456    /// <p>Updates the status or configuration of a private certificate authority (CA). Your private CA must be in the <code>ACTIVE</code> or <code>DISABLED</code> state before you can update it. You can disable a private CA that is in the <code>ACTIVE</code> state or make a CA that is in the <code>DISABLED</code> state active again.</p>
2457    async fn update_certificate_authority(
2458        &self,
2459        input: UpdateCertificateAuthorityRequest,
2460    ) -> Result<(), RusotoError<UpdateCertificateAuthorityError>> {
2461        let mut request = self.new_signed_request("POST", "/");
2462        request.add_header("x-amz-target", "ACMPrivateCA.UpdateCertificateAuthority");
2463        let encoded = serde_json::to_string(&input).unwrap();
2464        request.set_payload(Some(encoded));
2465
2466        let response = self
2467            .sign_and_dispatch(request, UpdateCertificateAuthorityError::from_response)
2468            .await?;
2469        std::mem::drop(response);
2470        Ok(())
2471    }
2472}