rusoto_fms/
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 FmsClient {
29    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30        let mut request = SignedRequest::new(http_method, "fms", &self.region, request_uri);
31
32        request.set_content_type("application/x-amz-json-1.1".to_owned());
33
34        request
35    }
36
37    async fn sign_and_dispatch<E>(
38        &self,
39        request: SignedRequest,
40        from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
41    ) -> Result<HttpResponse, RusotoError<E>> {
42        let mut response = self.client.sign_and_dispatch(request).await?;
43        if !response.status.is_success() {
44            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
45            return Err(from_response(response));
46        }
47
48        Ok(response)
49    }
50}
51
52use serde_json;
53#[derive(Clone, Debug, Default, PartialEq, Serialize)]
54#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
55pub struct AssociateAdminAccountRequest {
56    /// <p>The AWS account ID to associate with AWS Firewall Manager as the AWS Firewall Manager administrator account. This can be an AWS Organizations master account or a member account. For more information about AWS Organizations and master accounts, see <a href="https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts.html">Managing the AWS Accounts in Your Organization</a>. </p>
57    #[serde(rename = "AdminAccount")]
58    pub admin_account: String,
59}
60
61/// <p>Details of the resource that is not protected by the policy.</p>
62#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
63#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
64pub struct ComplianceViolator {
65    /// <p>The resource ID.</p>
66    #[serde(rename = "ResourceId")]
67    #[serde(skip_serializing_if = "Option::is_none")]
68    pub resource_id: Option<String>,
69    /// <p>The resource type. This is in the format shown in the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">AWS Resource Types Reference</a>. For example: <code>AWS::ElasticLoadBalancingV2::LoadBalancer</code> or <code>AWS::CloudFront::Distribution</code>.</p>
70    #[serde(rename = "ResourceType")]
71    #[serde(skip_serializing_if = "Option::is_none")]
72    pub resource_type: Option<String>,
73    /// <p>The reason that the resource is not protected by the policy.</p>
74    #[serde(rename = "ViolationReason")]
75    #[serde(skip_serializing_if = "Option::is_none")]
76    pub violation_reason: Option<String>,
77}
78
79#[derive(Clone, Debug, Default, PartialEq, Serialize)]
80#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
81pub struct DeleteNotificationChannelRequest {}
82
83#[derive(Clone, Debug, Default, PartialEq, Serialize)]
84#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
85pub struct DeletePolicyRequest {
86    /// <p>If <code>True</code>, the request performs cleanup according to the policy type. </p> <p>For AWS WAF and Shield Advanced policies, the cleanup does the following:</p> <ul> <li> <p>Deletes rule groups created by AWS Firewall Manager</p> </li> <li> <p>Removes web ACLs from in-scope resources</p> </li> <li> <p>Deletes web ACLs that contain no rules or rule groups</p> </li> </ul> <p>For security group policies, the cleanup does the following for each security group in the policy:</p> <ul> <li> <p>Disassociates the security group from in-scope resources </p> </li> <li> <p>Deletes the security group if it was created through Firewall Manager and if it's no longer associated with any resources through another policy</p> </li> </ul> <p>After the cleanup, in-scope resources are no longer protected by web ACLs in this policy. Protection of out-of-scope resources remains unchanged. Scope is determined by tags that you create and accounts that you associate with the policy. When creating the policy, if you specify that only resources in specific accounts or with specific tags are in scope of the policy, those accounts and resources are handled by the policy. All others are out of scope. If you don't specify tags or accounts, all resources are in scope. </p>
87    #[serde(rename = "DeleteAllPolicyResources")]
88    #[serde(skip_serializing_if = "Option::is_none")]
89    pub delete_all_policy_resources: Option<bool>,
90    /// <p>The ID of the policy that you want to delete. <code>PolicyId</code> is returned by <code>PutPolicy</code> and by <code>ListPolicies</code>.</p>
91    #[serde(rename = "PolicyId")]
92    pub policy_id: String,
93}
94
95#[derive(Clone, Debug, Default, PartialEq, Serialize)]
96#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
97pub struct DisassociateAdminAccountRequest {}
98
99/// <p>Describes the compliance status for the account. An account is considered noncompliant if it includes resources that are not protected by the specified policy or that don't comply with the policy.</p>
100#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
101#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
102pub struct EvaluationResult {
103    /// <p>Describes an AWS account's compliance with the AWS Firewall Manager policy.</p>
104    #[serde(rename = "ComplianceStatus")]
105    #[serde(skip_serializing_if = "Option::is_none")]
106    pub compliance_status: Option<String>,
107    /// <p>Indicates that over 100 resources are noncompliant with the AWS Firewall Manager policy.</p>
108    #[serde(rename = "EvaluationLimitExceeded")]
109    #[serde(skip_serializing_if = "Option::is_none")]
110    pub evaluation_limit_exceeded: Option<bool>,
111    /// <p>The number of resources that are noncompliant with the specified policy. For AWS WAF and Shield Advanced policies, a resource is considered noncompliant if it is not associated with the policy. For security group policies, a resource is considered noncompliant if it doesn't comply with the rules of the policy and remediation is disabled or not possible.</p>
112    #[serde(rename = "ViolatorCount")]
113    #[serde(skip_serializing_if = "Option::is_none")]
114    pub violator_count: Option<i64>,
115}
116
117#[derive(Clone, Debug, Default, PartialEq, Serialize)]
118#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
119pub struct GetAdminAccountRequest {}
120
121#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
122#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
123pub struct GetAdminAccountResponse {
124    /// <p>The AWS account that is set as the AWS Firewall Manager administrator.</p>
125    #[serde(rename = "AdminAccount")]
126    #[serde(skip_serializing_if = "Option::is_none")]
127    pub admin_account: Option<String>,
128    /// <p>The status of the AWS account that you set as the AWS Firewall Manager administrator.</p>
129    #[serde(rename = "RoleStatus")]
130    #[serde(skip_serializing_if = "Option::is_none")]
131    pub role_status: Option<String>,
132}
133
134#[derive(Clone, Debug, Default, PartialEq, Serialize)]
135#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
136pub struct GetComplianceDetailRequest {
137    /// <p>The AWS account that owns the resources that you want to get the details for.</p>
138    #[serde(rename = "MemberAccount")]
139    pub member_account: String,
140    /// <p>The ID of the policy that you want to get the details for. <code>PolicyId</code> is returned by <code>PutPolicy</code> and by <code>ListPolicies</code>.</p>
141    #[serde(rename = "PolicyId")]
142    pub policy_id: String,
143}
144
145#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
146#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
147pub struct GetComplianceDetailResponse {
148    /// <p>Information about the resources and the policy that you specified in the <code>GetComplianceDetail</code> request.</p>
149    #[serde(rename = "PolicyComplianceDetail")]
150    #[serde(skip_serializing_if = "Option::is_none")]
151    pub policy_compliance_detail: Option<PolicyComplianceDetail>,
152}
153
154#[derive(Clone, Debug, Default, PartialEq, Serialize)]
155#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
156pub struct GetNotificationChannelRequest {}
157
158#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
159#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
160pub struct GetNotificationChannelResponse {
161    /// <p>The IAM role that is used by AWS Firewall Manager to record activity to SNS.</p>
162    #[serde(rename = "SnsRoleName")]
163    #[serde(skip_serializing_if = "Option::is_none")]
164    pub sns_role_name: Option<String>,
165    /// <p>The SNS topic that records AWS Firewall Manager activity. </p>
166    #[serde(rename = "SnsTopicArn")]
167    #[serde(skip_serializing_if = "Option::is_none")]
168    pub sns_topic_arn: Option<String>,
169}
170
171#[derive(Clone, Debug, Default, PartialEq, Serialize)]
172#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
173pub struct GetPolicyRequest {
174    /// <p>The ID of the AWS Firewall Manager policy that you want the details for.</p>
175    #[serde(rename = "PolicyId")]
176    pub policy_id: String,
177}
178
179#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
180#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
181pub struct GetPolicyResponse {
182    /// <p>Information about the specified AWS Firewall Manager policy.</p>
183    #[serde(rename = "Policy")]
184    #[serde(skip_serializing_if = "Option::is_none")]
185    pub policy: Option<Policy>,
186    /// <p>The Amazon Resource Name (ARN) of the specified policy.</p>
187    #[serde(rename = "PolicyArn")]
188    #[serde(skip_serializing_if = "Option::is_none")]
189    pub policy_arn: Option<String>,
190}
191
192#[derive(Clone, Debug, Default, PartialEq, Serialize)]
193#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
194pub struct GetProtectionStatusRequest {
195    /// <p>The end of the time period to query for the attacks. This is a <code>timestamp</code> type. The request syntax listing indicates a <code>number</code> type because the default used by AWS Firewall Manager is Unix time in seconds. However, any valid <code>timestamp</code> format is allowed.</p>
196    #[serde(rename = "EndTime")]
197    #[serde(skip_serializing_if = "Option::is_none")]
198    pub end_time: Option<f64>,
199    /// <p>Specifies the number of objects that you want AWS Firewall Manager to return for this request. If you have more objects than the number that you specify for <code>MaxResults</code>, the response includes a <code>NextToken</code> value that you can use to get another batch of objects.</p>
200    #[serde(rename = "MaxResults")]
201    #[serde(skip_serializing_if = "Option::is_none")]
202    pub max_results: Option<i64>,
203    /// <p>The AWS account that is in scope of the policy that you want to get the details for.</p>
204    #[serde(rename = "MemberAccountId")]
205    #[serde(skip_serializing_if = "Option::is_none")]
206    pub member_account_id: Option<String>,
207    /// <p>If you specify a value for <code>MaxResults</code> and you have more objects than the number that you specify for <code>MaxResults</code>, AWS Firewall Manager returns a <code>NextToken</code> value in the response, which you can use to retrieve another group of objects. For the second and subsequent <code>GetProtectionStatus</code> requests, specify the value of <code>NextToken</code> from the previous response to get information about another batch of objects.</p>
208    #[serde(rename = "NextToken")]
209    #[serde(skip_serializing_if = "Option::is_none")]
210    pub next_token: Option<String>,
211    /// <p>The ID of the policy for which you want to get the attack information.</p>
212    #[serde(rename = "PolicyId")]
213    pub policy_id: String,
214    /// <p>The start of the time period to query for the attacks. This is a <code>timestamp</code> type. The request syntax listing indicates a <code>number</code> type because the default used by AWS Firewall Manager is Unix time in seconds. However, any valid <code>timestamp</code> format is allowed.</p>
215    #[serde(rename = "StartTime")]
216    #[serde(skip_serializing_if = "Option::is_none")]
217    pub start_time: Option<f64>,
218}
219
220#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
221#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
222pub struct GetProtectionStatusResponse {
223    /// <p>The ID of the AWS Firewall administrator account for this policy.</p>
224    #[serde(rename = "AdminAccountId")]
225    #[serde(skip_serializing_if = "Option::is_none")]
226    pub admin_account_id: Option<String>,
227    /// <p>Details about the attack, including the following:</p> <ul> <li> <p>Attack type</p> </li> <li> <p>Account ID</p> </li> <li> <p>ARN of the resource attacked</p> </li> <li> <p>Start time of the attack</p> </li> <li> <p>End time of the attack (ongoing attacks will not have an end time)</p> </li> </ul> <p>The details are in JSON format. </p>
228    #[serde(rename = "Data")]
229    #[serde(skip_serializing_if = "Option::is_none")]
230    pub data: Option<String>,
231    /// <p>If you have more objects than the number that you specified for <code>MaxResults</code> in the request, the response includes a <code>NextToken</code> value. To list more objects, submit another <code>GetProtectionStatus</code> request, and specify the <code>NextToken</code> value from the response in the <code>NextToken</code> value in the next request.</p> <p>AWS SDKs provide auto-pagination that identify <code>NextToken</code> in a response and make subsequent request calls automatically on your behalf. However, this feature is not supported by <code>GetProtectionStatus</code>. You must submit subsequent requests with <code>NextToken</code> using your own processes. </p>
232    #[serde(rename = "NextToken")]
233    #[serde(skip_serializing_if = "Option::is_none")]
234    pub next_token: Option<String>,
235    /// <p>The service type that is protected by the policy. Currently, this is always <code>SHIELD_ADVANCED</code>.</p>
236    #[serde(rename = "ServiceType")]
237    #[serde(skip_serializing_if = "Option::is_none")]
238    pub service_type: Option<String>,
239}
240
241#[derive(Clone, Debug, Default, PartialEq, Serialize)]
242#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
243pub struct ListComplianceStatusRequest {
244    /// <p>Specifies the number of <code>PolicyComplianceStatus</code> objects that you want AWS Firewall Manager to return for this request. If you have more <code>PolicyComplianceStatus</code> objects than the number that you specify for <code>MaxResults</code>, the response includes a <code>NextToken</code> value that you can use to get another batch of <code>PolicyComplianceStatus</code> objects.</p>
245    #[serde(rename = "MaxResults")]
246    #[serde(skip_serializing_if = "Option::is_none")]
247    pub max_results: Option<i64>,
248    /// <p>If you specify a value for <code>MaxResults</code> and you have more <code>PolicyComplianceStatus</code> objects than the number that you specify for <code>MaxResults</code>, AWS Firewall Manager returns a <code>NextToken</code> value in the response that allows you to list another group of <code>PolicyComplianceStatus</code> objects. For the second and subsequent <code>ListComplianceStatus</code> requests, specify the value of <code>NextToken</code> from the previous response to get information about another batch of <code>PolicyComplianceStatus</code> objects.</p>
249    #[serde(rename = "NextToken")]
250    #[serde(skip_serializing_if = "Option::is_none")]
251    pub next_token: Option<String>,
252    /// <p>The ID of the AWS Firewall Manager policy that you want the details for.</p>
253    #[serde(rename = "PolicyId")]
254    pub policy_id: String,
255}
256
257#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
258#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
259pub struct ListComplianceStatusResponse {
260    /// <p>If you have more <code>PolicyComplianceStatus</code> objects than the number that you specified for <code>MaxResults</code> in the request, the response includes a <code>NextToken</code> value. To list more <code>PolicyComplianceStatus</code> objects, submit another <code>ListComplianceStatus</code> request, and specify the <code>NextToken</code> value from the response in the <code>NextToken</code> value in the next request.</p>
261    #[serde(rename = "NextToken")]
262    #[serde(skip_serializing_if = "Option::is_none")]
263    pub next_token: Option<String>,
264    /// <p>An array of <code>PolicyComplianceStatus</code> objects.</p>
265    #[serde(rename = "PolicyComplianceStatusList")]
266    #[serde(skip_serializing_if = "Option::is_none")]
267    pub policy_compliance_status_list: Option<Vec<PolicyComplianceStatus>>,
268}
269
270#[derive(Clone, Debug, Default, PartialEq, Serialize)]
271#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
272pub struct ListMemberAccountsRequest {
273    /// <p>Specifies the number of member account IDs that you want AWS Firewall Manager to return for this request. If you have more IDs than the number that you specify for <code>MaxResults</code>, the response includes a <code>NextToken</code> value that you can use to get another batch of member account IDs.</p>
274    #[serde(rename = "MaxResults")]
275    #[serde(skip_serializing_if = "Option::is_none")]
276    pub max_results: Option<i64>,
277    /// <p>If you specify a value for <code>MaxResults</code> and you have more account IDs than the number that you specify for <code>MaxResults</code>, AWS Firewall Manager returns a <code>NextToken</code> value in the response that allows you to list another group of IDs. For the second and subsequent <code>ListMemberAccountsRequest</code> requests, specify the value of <code>NextToken</code> from the previous response to get information about another batch of member account IDs.</p>
278    #[serde(rename = "NextToken")]
279    #[serde(skip_serializing_if = "Option::is_none")]
280    pub next_token: Option<String>,
281}
282
283#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
284#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
285pub struct ListMemberAccountsResponse {
286    /// <p>An array of account IDs.</p>
287    #[serde(rename = "MemberAccounts")]
288    #[serde(skip_serializing_if = "Option::is_none")]
289    pub member_accounts: Option<Vec<String>>,
290    /// <p>If you have more member account IDs than the number that you specified for <code>MaxResults</code> in the request, the response includes a <code>NextToken</code> value. To list more IDs, submit another <code>ListMemberAccounts</code> request, and specify the <code>NextToken</code> value from the response in the <code>NextToken</code> value in the next request.</p>
291    #[serde(rename = "NextToken")]
292    #[serde(skip_serializing_if = "Option::is_none")]
293    pub next_token: Option<String>,
294}
295
296#[derive(Clone, Debug, Default, PartialEq, Serialize)]
297#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
298pub struct ListPoliciesRequest {
299    /// <p>Specifies the number of <code>PolicySummary</code> objects that you want AWS Firewall Manager to return for this request. If you have more <code>PolicySummary</code> objects than the number that you specify for <code>MaxResults</code>, the response includes a <code>NextToken</code> value that you can use to get another batch of <code>PolicySummary</code> objects.</p>
300    #[serde(rename = "MaxResults")]
301    #[serde(skip_serializing_if = "Option::is_none")]
302    pub max_results: Option<i64>,
303    /// <p>If you specify a value for <code>MaxResults</code> and you have more <code>PolicySummary</code> objects than the number that you specify for <code>MaxResults</code>, AWS Firewall Manager returns a <code>NextToken</code> value in the response that allows you to list another group of <code>PolicySummary</code> objects. For the second and subsequent <code>ListPolicies</code> requests, specify the value of <code>NextToken</code> from the previous response to get information about another batch of <code>PolicySummary</code> objects.</p>
304    #[serde(rename = "NextToken")]
305    #[serde(skip_serializing_if = "Option::is_none")]
306    pub next_token: Option<String>,
307}
308
309#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
310#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
311pub struct ListPoliciesResponse {
312    /// <p>If you have more <code>PolicySummary</code> objects than the number that you specified for <code>MaxResults</code> in the request, the response includes a <code>NextToken</code> value. To list more <code>PolicySummary</code> objects, submit another <code>ListPolicies</code> request, and specify the <code>NextToken</code> value from the response in the <code>NextToken</code> value in the next request.</p>
313    #[serde(rename = "NextToken")]
314    #[serde(skip_serializing_if = "Option::is_none")]
315    pub next_token: Option<String>,
316    /// <p>An array of <code>PolicySummary</code> objects.</p>
317    #[serde(rename = "PolicyList")]
318    #[serde(skip_serializing_if = "Option::is_none")]
319    pub policy_list: Option<Vec<PolicySummary>>,
320}
321
322#[derive(Clone, Debug, Default, PartialEq, Serialize)]
323#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
324pub struct ListTagsForResourceRequest {
325    /// <p>The Amazon Resource Name (ARN) of the resource to return tags for. The Firewall Manager policy is the only AWS resource that supports tagging, so this ARN is a policy ARN..</p>
326    #[serde(rename = "ResourceArn")]
327    pub resource_arn: String,
328}
329
330#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
331#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
332pub struct ListTagsForResourceResponse {
333    /// <p>The tags associated with the resource.</p>
334    #[serde(rename = "TagList")]
335    #[serde(skip_serializing_if = "Option::is_none")]
336    pub tag_list: Option<Vec<Tag>>,
337}
338
339/// <p>An AWS Firewall Manager policy.</p>
340#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
341pub struct Policy {
342    /// <p><p>Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to exclude from the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.</p> <p>You can specify inclusions or exclusions, but not both. If you specify an <code>IncludeMap</code>, AWS Firewall Manager applies the policy to all accounts specified by the <code>IncludeMap</code>, and does not evaluate any <code>ExcludeMap</code> specifications. If you do not specify an <code>IncludeMap</code>, then Firewall Manager applies the policy to all accounts except for those specified by the <code>ExcludeMap</code>.</p> <p>You can specify account IDs, OUs, or a combination: </p> <ul> <li> <p>Specify account IDs by setting the key to <code>ACCOUNT</code>. For example, the following is a valid map: <code>{“ACCOUNT” : [“accountID1”, “accountID2”]}</code>.</p> </li> <li> <p>Specify OUs by setting the key to <code>ORG<em>UNIT</code>. For example, the following is a valid map: <code>{“ORG</em>UNIT” : [“ouid111”, “ouid112”]}</code>.</p> </li> <li> <p>Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map: <code>{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}</code>.</p> </li> </ul></p>
343    #[serde(rename = "ExcludeMap")]
344    #[serde(skip_serializing_if = "Option::is_none")]
345    pub exclude_map: Option<::std::collections::HashMap<String, Vec<String>>>,
346    /// <p>If set to <code>True</code>, resources with the tags that are specified in the <code>ResourceTag</code> array are not in scope of the policy. If set to <code>False</code>, and the <code>ResourceTag</code> array is not null, only resources with the specified tags are in scope of the policy.</p>
347    #[serde(rename = "ExcludeResourceTags")]
348    pub exclude_resource_tags: bool,
349    /// <p><p>Specifies the AWS account IDs and AWS Organizations organizational units (OUs) to include in the policy. Specifying an OU is the equivalent of specifying all accounts in the OU and in any of its child OUs, including any child OUs and accounts that are added at a later time.</p> <p>You can specify inclusions or exclusions, but not both. If you specify an <code>IncludeMap</code>, AWS Firewall Manager applies the policy to all accounts specified by the <code>IncludeMap</code>, and does not evaluate any <code>ExcludeMap</code> specifications. If you do not specify an <code>IncludeMap</code>, then Firewall Manager applies the policy to all accounts except for those specified by the <code>ExcludeMap</code>.</p> <p>You can specify account IDs, OUs, or a combination: </p> <ul> <li> <p>Specify account IDs by setting the key to <code>ACCOUNT</code>. For example, the following is a valid map: <code>{“ACCOUNT” : [“accountID1”, “accountID2”]}</code>.</p> </li> <li> <p>Specify OUs by setting the key to <code>ORG<em>UNIT</code>. For example, the following is a valid map: <code>{“ORG</em>UNIT” : [“ouid111”, “ouid112”]}</code>.</p> </li> <li> <p>Specify accounts and OUs together in a single map, separated with a comma. For example, the following is a valid map: <code>{“ACCOUNT” : [“accountID1”, “accountID2”], “ORG_UNIT” : [“ouid111”, “ouid112”]}</code>.</p> </li> </ul></p>
350    #[serde(rename = "IncludeMap")]
351    #[serde(skip_serializing_if = "Option::is_none")]
352    pub include_map: Option<::std::collections::HashMap<String, Vec<String>>>,
353    /// <p>The ID of the AWS Firewall Manager policy.</p>
354    #[serde(rename = "PolicyId")]
355    #[serde(skip_serializing_if = "Option::is_none")]
356    pub policy_id: Option<String>,
357    /// <p>The friendly name of the AWS Firewall Manager policy.</p>
358    #[serde(rename = "PolicyName")]
359    pub policy_name: String,
360    /// <p>A unique identifier for each update to the policy. When issuing a <code>PutPolicy</code> request, the <code>PolicyUpdateToken</code> in the request must match the <code>PolicyUpdateToken</code> of the current policy version. To get the <code>PolicyUpdateToken</code> of the current policy version, use a <code>GetPolicy</code> request.</p>
361    #[serde(rename = "PolicyUpdateToken")]
362    #[serde(skip_serializing_if = "Option::is_none")]
363    pub policy_update_token: Option<String>,
364    /// <p>Indicates if the policy should be automatically applied to new resources.</p>
365    #[serde(rename = "RemediationEnabled")]
366    pub remediation_enabled: bool,
367    /// <p>An array of <code>ResourceTag</code> objects.</p>
368    #[serde(rename = "ResourceTags")]
369    #[serde(skip_serializing_if = "Option::is_none")]
370    pub resource_tags: Option<Vec<ResourceTag>>,
371    /// <p>The type of resource protected by or in scope of the policy. This is in the format shown in the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">AWS Resource Types Reference</a>. For AWS WAF and Shield Advanced, examples include <code>AWS::ElasticLoadBalancingV2::LoadBalancer</code> and <code>AWS::CloudFront::Distribution</code>. For a security group common policy, valid values are <code>AWS::EC2::NetworkInterface</code> and <code>AWS::EC2::Instance</code>. For a security group content audit policy, valid values are <code>AWS::EC2::SecurityGroup</code>, <code>AWS::EC2::NetworkInterface</code>, and <code>AWS::EC2::Instance</code>. For a security group usage audit policy, the value is <code>AWS::EC2::SecurityGroup</code>. </p>
372    #[serde(rename = "ResourceType")]
373    pub resource_type: String,
374    /// <p>An array of <code>ResourceType</code>.</p>
375    #[serde(rename = "ResourceTypeList")]
376    #[serde(skip_serializing_if = "Option::is_none")]
377    pub resource_type_list: Option<Vec<String>>,
378    /// <p>Details about the security service that is being used to protect the resources.</p>
379    #[serde(rename = "SecurityServicePolicyData")]
380    pub security_service_policy_data: SecurityServicePolicyData,
381}
382
383/// <p>Describes the noncompliant resources in a member account for a specific AWS Firewall Manager policy. A maximum of 100 entries are displayed. If more than 100 resources are noncompliant, <code>EvaluationLimitExceeded</code> is set to <code>True</code>.</p>
384#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
385#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
386pub struct PolicyComplianceDetail {
387    /// <p>Indicates if over 100 resources are noncompliant with the AWS Firewall Manager policy.</p>
388    #[serde(rename = "EvaluationLimitExceeded")]
389    #[serde(skip_serializing_if = "Option::is_none")]
390    pub evaluation_limit_exceeded: Option<bool>,
391    /// <p>A timestamp that indicates when the returned information should be considered out of date.</p>
392    #[serde(rename = "ExpiredAt")]
393    #[serde(skip_serializing_if = "Option::is_none")]
394    pub expired_at: Option<f64>,
395    /// <p>Details about problems with dependent services, such as AWS WAF or AWS Config, that are causing a resource to be noncompliant. The details include the name of the dependent service and the error message received that indicates the problem with the service.</p>
396    #[serde(rename = "IssueInfoMap")]
397    #[serde(skip_serializing_if = "Option::is_none")]
398    pub issue_info_map: Option<::std::collections::HashMap<String, String>>,
399    /// <p>The AWS account ID.</p>
400    #[serde(rename = "MemberAccount")]
401    #[serde(skip_serializing_if = "Option::is_none")]
402    pub member_account: Option<String>,
403    /// <p>The ID of the AWS Firewall Manager policy.</p>
404    #[serde(rename = "PolicyId")]
405    #[serde(skip_serializing_if = "Option::is_none")]
406    pub policy_id: Option<String>,
407    /// <p>The AWS account that created the AWS Firewall Manager policy.</p>
408    #[serde(rename = "PolicyOwner")]
409    #[serde(skip_serializing_if = "Option::is_none")]
410    pub policy_owner: Option<String>,
411    /// <p>An array of resources that aren't protected by the AWS WAF or Shield Advanced policy or that aren't in compliance with the security group policy.</p>
412    #[serde(rename = "Violators")]
413    #[serde(skip_serializing_if = "Option::is_none")]
414    pub violators: Option<Vec<ComplianceViolator>>,
415}
416
417/// <p>Indicates whether the account is compliant with the specified policy. An account is considered noncompliant if it includes resources that are not protected by the policy, for AWS WAF and Shield Advanced policies, or that are noncompliant with the policy, for security group policies.</p>
418#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
419#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
420pub struct PolicyComplianceStatus {
421    /// <p>An array of <code>EvaluationResult</code> objects.</p>
422    #[serde(rename = "EvaluationResults")]
423    #[serde(skip_serializing_if = "Option::is_none")]
424    pub evaluation_results: Option<Vec<EvaluationResult>>,
425    /// <p>Details about problems with dependent services, such as AWS WAF or AWS Config, that are causing a resource to be noncompliant. The details include the name of the dependent service and the error message received that indicates the problem with the service.</p>
426    #[serde(rename = "IssueInfoMap")]
427    #[serde(skip_serializing_if = "Option::is_none")]
428    pub issue_info_map: Option<::std::collections::HashMap<String, String>>,
429    /// <p>Timestamp of the last update to the <code>EvaluationResult</code> objects.</p>
430    #[serde(rename = "LastUpdated")]
431    #[serde(skip_serializing_if = "Option::is_none")]
432    pub last_updated: Option<f64>,
433    /// <p>The member account ID.</p>
434    #[serde(rename = "MemberAccount")]
435    #[serde(skip_serializing_if = "Option::is_none")]
436    pub member_account: Option<String>,
437    /// <p>The ID of the AWS Firewall Manager policy.</p>
438    #[serde(rename = "PolicyId")]
439    #[serde(skip_serializing_if = "Option::is_none")]
440    pub policy_id: Option<String>,
441    /// <p>The friendly name of the AWS Firewall Manager policy.</p>
442    #[serde(rename = "PolicyName")]
443    #[serde(skip_serializing_if = "Option::is_none")]
444    pub policy_name: Option<String>,
445    /// <p>The AWS account that created the AWS Firewall Manager policy.</p>
446    #[serde(rename = "PolicyOwner")]
447    #[serde(skip_serializing_if = "Option::is_none")]
448    pub policy_owner: Option<String>,
449}
450
451/// <p>Details of the AWS Firewall Manager policy. </p>
452#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
453#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
454pub struct PolicySummary {
455    /// <p>The Amazon Resource Name (ARN) of the specified policy.</p>
456    #[serde(rename = "PolicyArn")]
457    #[serde(skip_serializing_if = "Option::is_none")]
458    pub policy_arn: Option<String>,
459    /// <p>The ID of the specified policy.</p>
460    #[serde(rename = "PolicyId")]
461    #[serde(skip_serializing_if = "Option::is_none")]
462    pub policy_id: Option<String>,
463    /// <p>The friendly name of the specified policy.</p>
464    #[serde(rename = "PolicyName")]
465    #[serde(skip_serializing_if = "Option::is_none")]
466    pub policy_name: Option<String>,
467    /// <p>Indicates if the policy should be automatically applied to new resources.</p>
468    #[serde(rename = "RemediationEnabled")]
469    #[serde(skip_serializing_if = "Option::is_none")]
470    pub remediation_enabled: Option<bool>,
471    /// <p>The type of resource protected by or in scope of the policy. This is in the format shown in the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html">AWS Resource Types Reference</a>. For AWS WAF and Shield Advanced, examples include <code>AWS::ElasticLoadBalancingV2::LoadBalancer</code> and <code>AWS::CloudFront::Distribution</code>. For a security group common policy, valid values are <code>AWS::EC2::NetworkInterface</code> and <code>AWS::EC2::Instance</code>. For a security group content audit policy, valid values are <code>AWS::EC2::SecurityGroup</code>, <code>AWS::EC2::NetworkInterface</code>, and <code>AWS::EC2::Instance</code>. For a security group usage audit policy, the value is <code>AWS::EC2::SecurityGroup</code>. </p>
472    #[serde(rename = "ResourceType")]
473    #[serde(skip_serializing_if = "Option::is_none")]
474    pub resource_type: Option<String>,
475    /// <p>The service that the policy is using to protect the resources. This specifies the type of policy that is created, either an AWS WAF policy, a Shield Advanced policy, or a security group policy.</p>
476    #[serde(rename = "SecurityServiceType")]
477    #[serde(skip_serializing_if = "Option::is_none")]
478    pub security_service_type: Option<String>,
479}
480
481#[derive(Clone, Debug, Default, PartialEq, Serialize)]
482#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
483pub struct PutNotificationChannelRequest {
484    /// <p>The Amazon Resource Name (ARN) of the IAM role that allows Amazon SNS to record AWS Firewall Manager activity. </p>
485    #[serde(rename = "SnsRoleName")]
486    pub sns_role_name: String,
487    /// <p>The Amazon Resource Name (ARN) of the SNS topic that collects notifications from AWS Firewall Manager.</p>
488    #[serde(rename = "SnsTopicArn")]
489    pub sns_topic_arn: String,
490}
491
492#[derive(Clone, Debug, Default, PartialEq, Serialize)]
493#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
494pub struct PutPolicyRequest {
495    /// <p>The details of the AWS Firewall Manager policy to be created.</p>
496    #[serde(rename = "Policy")]
497    pub policy: Policy,
498    /// <p>The tags to add to the AWS resource.</p>
499    #[serde(rename = "TagList")]
500    #[serde(skip_serializing_if = "Option::is_none")]
501    pub tag_list: Option<Vec<Tag>>,
502}
503
504#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
505#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
506pub struct PutPolicyResponse {
507    /// <p>The details of the AWS Firewall Manager policy that was created.</p>
508    #[serde(rename = "Policy")]
509    #[serde(skip_serializing_if = "Option::is_none")]
510    pub policy: Option<Policy>,
511    /// <p>The Amazon Resource Name (ARN) of the policy that was created.</p>
512    #[serde(rename = "PolicyArn")]
513    #[serde(skip_serializing_if = "Option::is_none")]
514    pub policy_arn: Option<String>,
515}
516
517/// <p>The resource tags that AWS Firewall Manager uses to determine if a particular resource should be included or excluded from the AWS Firewall Manager policy. Tags enable you to categorize your AWS resources in different ways, for example, by purpose, owner, or environment. Each tag consists of a key and an optional value. Firewall Manager combines the tags with "AND" so that, if you add more than one tag to a policy scope, a resource must have all the specified tags to be included or excluded. For more information, see <a href="https://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/tag-editor.html">Working with Tag Editor</a>.</p>
518#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
519pub struct ResourceTag {
520    /// <p>The resource tag key.</p>
521    #[serde(rename = "Key")]
522    pub key: String,
523    /// <p>The resource tag value.</p>
524    #[serde(rename = "Value")]
525    #[serde(skip_serializing_if = "Option::is_none")]
526    pub value: Option<String>,
527}
528
529/// <p>Details about the security service that is being used to protect the resources.</p>
530#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
531pub struct SecurityServicePolicyData {
532    /// <p><p>Details about the service that are specific to the service type, in JSON format. For service type <code>SHIELD<em>ADVANCED</code>, this is an empty string.</p> <ul> <li> <p>Example: <code>WAFV2</code> </p> <p> <code>&quot;ManagedServiceData&quot;: &quot;{&quot;type&quot;:&quot;WAFV2&quot;,&quot;defaultAction&quot;:{&quot;type&quot;:&quot;ALLOW&quot;},&quot;preProcessRuleGroups&quot;:[{&quot;managedRuleGroupIdentifier&quot;:null,&quot;ruleGroupArn&quot;:&quot;rulegrouparn&quot;,&quot;overrideAction&quot;:{&quot;type&quot;:&quot;COUNT&quot;},&quot;excludedRules&quot;:[{&quot;name&quot;:&quot;EntityName&quot;}],&quot;ruleGroupType&quot;:&quot;RuleGroup&quot;}],&quot;postProcessRuleGroups&quot;:[{&quot;managedRuleGroupIdentifier&quot;:{&quot;managedRuleGroupName&quot;:&quot;AWSManagedRulesAdminProtectionRuleSet&quot;,&quot;vendor&quot;:&quot;AWS&quot;},&quot;ruleGroupArn&quot;:&quot;rulegrouparn&quot;,&quot;overrideAction&quot;:{&quot;type&quot;:&quot;NONE&quot;},&quot;excludedRules&quot;:[],&quot;ruleGroupType&quot;:&quot;ManagedRuleGroup&quot;}],&quot;overrideCustomerWebACLAssociation&quot;:false}&quot;</code> </p> </li> <li> <p>Example: <code>WAF Classic</code> </p> <p> <code>&quot;ManagedServiceData&quot;: &quot;{&quot;type&quot;: &quot;WAF&quot;, &quot;ruleGroups&quot;: [{&quot;id&quot;: &quot;12345678-1bcd-9012-efga-0987654321ab&quot;, &quot;overrideAction&quot; : {&quot;type&quot;: &quot;COUNT&quot;}}], &quot;defaultAction&quot;: {&quot;type&quot;: &quot;BLOCK&quot;}}</code> </p> </li> <li> <p>Example: <code>SECURITY</em>GROUPS<em>COMMON</code> </p> <p> <code>&quot;SecurityServicePolicyData&quot;:{&quot;Type&quot;:&quot;SECURITY</em>GROUPS<em>COMMON&quot;,&quot;ManagedServiceData&quot;:&quot;{&quot;type&quot;:&quot;SECURITY</em>GROUPS<em>COMMON&quot;,&quot;revertManualSecurityGroupChanges&quot;:false,&quot;exclusiveResourceSecurityGroupManagement&quot;:false, &quot;applyToAllEC2InstanceENIs&quot;:false,&quot;securityGroups&quot;:[{&quot;id&quot;:&quot; sg-000e55995d61a06bd&quot;}]}&quot;},&quot;RemediationEnabled&quot;:false,&quot;ResourceType&quot;:&quot;AWS::EC2::NetworkInterface&quot;}</code> </p> </li> <li> <p>Example: <code>SECURITY</em>GROUPS<em>CONTENT</em>AUDIT</code> </p> <p> <code>&quot;SecurityServicePolicyData&quot;:{&quot;Type&quot;:&quot;SECURITY<em>GROUPS</em>CONTENT<em>AUDIT&quot;,&quot;ManagedServiceData&quot;:&quot;{&quot;type&quot;:&quot;SECURITY</em>GROUPS<em>CONTENT</em>AUDIT&quot;,&quot;securityGroups&quot;:[{&quot;id&quot;:&quot; sg-000e55995d61a06bd &quot;}],&quot;securityGroupAction&quot;:{&quot;type&quot;:&quot;ALLOW&quot;}}&quot;},&quot;RemediationEnabled&quot;:false,&quot;ResourceType&quot;:&quot;AWS::EC2::NetworkInterface&quot;}</code> </p> <p>The security group action for content audit can be <code>ALLOW</code> or <code>DENY</code>. For <code>ALLOW</code>, all in-scope security group rules must be within the allowed range of the policy&#39;s security group rules. For <code>DENY</code>, all in-scope security group rules must not contain a value or a range that matches a rule value or range in the policy security group.</p> </li> <li> <p>Example: <code>SECURITY<em>GROUPS</em>USAGE<em>AUDIT</code> </p> <p> <code>&quot;SecurityServicePolicyData&quot;:{&quot;Type&quot;:&quot;SECURITY</em>GROUPS<em>USAGE</em>AUDIT&quot;,&quot;ManagedServiceData&quot;:&quot;{&quot;type&quot;:&quot;SECURITY<em>GROUPS</em>USAGE_AUDIT&quot;,&quot;deleteUnusedSecurityGroups&quot;:true,&quot;coalesceRedundantSecurityGroups&quot;:true}&quot;},&quot;RemediationEnabled&quot;:false,&quot;Resou rceType&quot;:&quot;AWS::EC2::SecurityGroup&quot;}</code> </p> </li> </ul></p>
533    #[serde(rename = "ManagedServiceData")]
534    #[serde(skip_serializing_if = "Option::is_none")]
535    pub managed_service_data: Option<String>,
536    /// <p>The service that the policy is using to protect the resources. This specifies the type of policy that is created, either an AWS WAF policy, a Shield Advanced policy, or a security group policy. For security group policies, Firewall Manager supports one security group for each common policy and for each content audit policy. This is an adjustable limit that you can increase by contacting AWS Support.</p>
537    #[serde(rename = "Type")]
538    pub type_: String,
539}
540
541/// <p>A collection of key:value pairs associated with an AWS resource. The key:value pair can be anything you define. Typically, the tag key represents a category (such as "environment") and the tag value represents a specific value within that category (such as "test," "development," or "production"). You can add up to 50 tags to each AWS resource. </p>
542#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
543pub struct Tag {
544    /// <p>Part of the key:value pair that defines a tag. You can use a tag key to describe a category of information, such as "customer." Tag keys are case-sensitive.</p>
545    #[serde(rename = "Key")]
546    pub key: String,
547    /// <p>Part of the key:value pair that defines a tag. You can use a tag value to describe a specific value within a category, such as "companyA" or "companyB." Tag values are case-sensitive. </p>
548    #[serde(rename = "Value")]
549    pub value: String,
550}
551
552#[derive(Clone, Debug, Default, PartialEq, Serialize)]
553#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
554pub struct TagResourceRequest {
555    /// <p>The Amazon Resource Name (ARN) of the resource. The Firewall Manager policy is the only AWS resource that supports tagging, so this ARN is a policy ARN.</p>
556    #[serde(rename = "ResourceArn")]
557    pub resource_arn: String,
558    /// <p>The tags to add to the resource.</p>
559    #[serde(rename = "TagList")]
560    pub tag_list: Vec<Tag>,
561}
562
563#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
564#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
565pub struct TagResourceResponse {}
566
567#[derive(Clone, Debug, Default, PartialEq, Serialize)]
568#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
569pub struct UntagResourceRequest {
570    /// <p>The Amazon Resource Name (ARN) of the resource. The Firewall Manager policy is the only AWS resource that supports tagging, so this ARN is a policy ARN.</p>
571    #[serde(rename = "ResourceArn")]
572    pub resource_arn: String,
573    /// <p>The keys of the tags to remove from the resource. </p>
574    #[serde(rename = "TagKeys")]
575    pub tag_keys: Vec<String>,
576}
577
578#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
579#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
580pub struct UntagResourceResponse {}
581
582/// Errors returned by AssociateAdminAccount
583#[derive(Debug, PartialEq)]
584pub enum AssociateAdminAccountError {
585    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
586    InternalError(String),
587    /// <p>The parameters of the request were invalid.</p>
588    InvalidInput(String),
589    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
590    InvalidOperation(String),
591    /// <p>The specified resource was not found.</p>
592    ResourceNotFound(String),
593}
594
595impl AssociateAdminAccountError {
596    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AssociateAdminAccountError> {
597        if let Some(err) = proto::json::Error::parse(&res) {
598            match err.typ.as_str() {
599                "InternalErrorException" => {
600                    return RusotoError::Service(AssociateAdminAccountError::InternalError(err.msg))
601                }
602                "InvalidInputException" => {
603                    return RusotoError::Service(AssociateAdminAccountError::InvalidInput(err.msg))
604                }
605                "InvalidOperationException" => {
606                    return RusotoError::Service(AssociateAdminAccountError::InvalidOperation(
607                        err.msg,
608                    ))
609                }
610                "ResourceNotFoundException" => {
611                    return RusotoError::Service(AssociateAdminAccountError::ResourceNotFound(
612                        err.msg,
613                    ))
614                }
615                "ValidationException" => return RusotoError::Validation(err.msg),
616                _ => {}
617            }
618        }
619        RusotoError::Unknown(res)
620    }
621}
622impl fmt::Display for AssociateAdminAccountError {
623    #[allow(unused_variables)]
624    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
625        match *self {
626            AssociateAdminAccountError::InternalError(ref cause) => write!(f, "{}", cause),
627            AssociateAdminAccountError::InvalidInput(ref cause) => write!(f, "{}", cause),
628            AssociateAdminAccountError::InvalidOperation(ref cause) => write!(f, "{}", cause),
629            AssociateAdminAccountError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
630        }
631    }
632}
633impl Error for AssociateAdminAccountError {}
634/// Errors returned by DeleteNotificationChannel
635#[derive(Debug, PartialEq)]
636pub enum DeleteNotificationChannelError {
637    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
638    InternalError(String),
639    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
640    InvalidOperation(String),
641    /// <p>The specified resource was not found.</p>
642    ResourceNotFound(String),
643}
644
645impl DeleteNotificationChannelError {
646    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteNotificationChannelError> {
647        if let Some(err) = proto::json::Error::parse(&res) {
648            match err.typ.as_str() {
649                "InternalErrorException" => {
650                    return RusotoError::Service(DeleteNotificationChannelError::InternalError(
651                        err.msg,
652                    ))
653                }
654                "InvalidOperationException" => {
655                    return RusotoError::Service(DeleteNotificationChannelError::InvalidOperation(
656                        err.msg,
657                    ))
658                }
659                "ResourceNotFoundException" => {
660                    return RusotoError::Service(DeleteNotificationChannelError::ResourceNotFound(
661                        err.msg,
662                    ))
663                }
664                "ValidationException" => return RusotoError::Validation(err.msg),
665                _ => {}
666            }
667        }
668        RusotoError::Unknown(res)
669    }
670}
671impl fmt::Display for DeleteNotificationChannelError {
672    #[allow(unused_variables)]
673    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
674        match *self {
675            DeleteNotificationChannelError::InternalError(ref cause) => write!(f, "{}", cause),
676            DeleteNotificationChannelError::InvalidOperation(ref cause) => write!(f, "{}", cause),
677            DeleteNotificationChannelError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
678        }
679    }
680}
681impl Error for DeleteNotificationChannelError {}
682/// Errors returned by DeletePolicy
683#[derive(Debug, PartialEq)]
684pub enum DeletePolicyError {
685    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
686    InternalError(String),
687    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
688    InvalidOperation(String),
689    /// <p>The specified resource was not found.</p>
690    ResourceNotFound(String),
691}
692
693impl DeletePolicyError {
694    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeletePolicyError> {
695        if let Some(err) = proto::json::Error::parse(&res) {
696            match err.typ.as_str() {
697                "InternalErrorException" => {
698                    return RusotoError::Service(DeletePolicyError::InternalError(err.msg))
699                }
700                "InvalidOperationException" => {
701                    return RusotoError::Service(DeletePolicyError::InvalidOperation(err.msg))
702                }
703                "ResourceNotFoundException" => {
704                    return RusotoError::Service(DeletePolicyError::ResourceNotFound(err.msg))
705                }
706                "ValidationException" => return RusotoError::Validation(err.msg),
707                _ => {}
708            }
709        }
710        RusotoError::Unknown(res)
711    }
712}
713impl fmt::Display for DeletePolicyError {
714    #[allow(unused_variables)]
715    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
716        match *self {
717            DeletePolicyError::InternalError(ref cause) => write!(f, "{}", cause),
718            DeletePolicyError::InvalidOperation(ref cause) => write!(f, "{}", cause),
719            DeletePolicyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
720        }
721    }
722}
723impl Error for DeletePolicyError {}
724/// Errors returned by DisassociateAdminAccount
725#[derive(Debug, PartialEq)]
726pub enum DisassociateAdminAccountError {
727    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
728    InternalError(String),
729    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
730    InvalidOperation(String),
731    /// <p>The specified resource was not found.</p>
732    ResourceNotFound(String),
733}
734
735impl DisassociateAdminAccountError {
736    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DisassociateAdminAccountError> {
737        if let Some(err) = proto::json::Error::parse(&res) {
738            match err.typ.as_str() {
739                "InternalErrorException" => {
740                    return RusotoError::Service(DisassociateAdminAccountError::InternalError(
741                        err.msg,
742                    ))
743                }
744                "InvalidOperationException" => {
745                    return RusotoError::Service(DisassociateAdminAccountError::InvalidOperation(
746                        err.msg,
747                    ))
748                }
749                "ResourceNotFoundException" => {
750                    return RusotoError::Service(DisassociateAdminAccountError::ResourceNotFound(
751                        err.msg,
752                    ))
753                }
754                "ValidationException" => return RusotoError::Validation(err.msg),
755                _ => {}
756            }
757        }
758        RusotoError::Unknown(res)
759    }
760}
761impl fmt::Display for DisassociateAdminAccountError {
762    #[allow(unused_variables)]
763    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
764        match *self {
765            DisassociateAdminAccountError::InternalError(ref cause) => write!(f, "{}", cause),
766            DisassociateAdminAccountError::InvalidOperation(ref cause) => write!(f, "{}", cause),
767            DisassociateAdminAccountError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
768        }
769    }
770}
771impl Error for DisassociateAdminAccountError {}
772/// Errors returned by GetAdminAccount
773#[derive(Debug, PartialEq)]
774pub enum GetAdminAccountError {
775    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
776    InternalError(String),
777    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
778    InvalidOperation(String),
779    /// <p>The specified resource was not found.</p>
780    ResourceNotFound(String),
781}
782
783impl GetAdminAccountError {
784    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAdminAccountError> {
785        if let Some(err) = proto::json::Error::parse(&res) {
786            match err.typ.as_str() {
787                "InternalErrorException" => {
788                    return RusotoError::Service(GetAdminAccountError::InternalError(err.msg))
789                }
790                "InvalidOperationException" => {
791                    return RusotoError::Service(GetAdminAccountError::InvalidOperation(err.msg))
792                }
793                "ResourceNotFoundException" => {
794                    return RusotoError::Service(GetAdminAccountError::ResourceNotFound(err.msg))
795                }
796                "ValidationException" => return RusotoError::Validation(err.msg),
797                _ => {}
798            }
799        }
800        RusotoError::Unknown(res)
801    }
802}
803impl fmt::Display for GetAdminAccountError {
804    #[allow(unused_variables)]
805    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
806        match *self {
807            GetAdminAccountError::InternalError(ref cause) => write!(f, "{}", cause),
808            GetAdminAccountError::InvalidOperation(ref cause) => write!(f, "{}", cause),
809            GetAdminAccountError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
810        }
811    }
812}
813impl Error for GetAdminAccountError {}
814/// Errors returned by GetComplianceDetail
815#[derive(Debug, PartialEq)]
816pub enum GetComplianceDetailError {
817    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
818    InternalError(String),
819    /// <p>The specified resource was not found.</p>
820    ResourceNotFound(String),
821}
822
823impl GetComplianceDetailError {
824    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetComplianceDetailError> {
825        if let Some(err) = proto::json::Error::parse(&res) {
826            match err.typ.as_str() {
827                "InternalErrorException" => {
828                    return RusotoError::Service(GetComplianceDetailError::InternalError(err.msg))
829                }
830                "ResourceNotFoundException" => {
831                    return RusotoError::Service(GetComplianceDetailError::ResourceNotFound(
832                        err.msg,
833                    ))
834                }
835                "ValidationException" => return RusotoError::Validation(err.msg),
836                _ => {}
837            }
838        }
839        RusotoError::Unknown(res)
840    }
841}
842impl fmt::Display for GetComplianceDetailError {
843    #[allow(unused_variables)]
844    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
845        match *self {
846            GetComplianceDetailError::InternalError(ref cause) => write!(f, "{}", cause),
847            GetComplianceDetailError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
848        }
849    }
850}
851impl Error for GetComplianceDetailError {}
852/// Errors returned by GetNotificationChannel
853#[derive(Debug, PartialEq)]
854pub enum GetNotificationChannelError {
855    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
856    InternalError(String),
857    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
858    InvalidOperation(String),
859    /// <p>The specified resource was not found.</p>
860    ResourceNotFound(String),
861}
862
863impl GetNotificationChannelError {
864    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetNotificationChannelError> {
865        if let Some(err) = proto::json::Error::parse(&res) {
866            match err.typ.as_str() {
867                "InternalErrorException" => {
868                    return RusotoError::Service(GetNotificationChannelError::InternalError(
869                        err.msg,
870                    ))
871                }
872                "InvalidOperationException" => {
873                    return RusotoError::Service(GetNotificationChannelError::InvalidOperation(
874                        err.msg,
875                    ))
876                }
877                "ResourceNotFoundException" => {
878                    return RusotoError::Service(GetNotificationChannelError::ResourceNotFound(
879                        err.msg,
880                    ))
881                }
882                "ValidationException" => return RusotoError::Validation(err.msg),
883                _ => {}
884            }
885        }
886        RusotoError::Unknown(res)
887    }
888}
889impl fmt::Display for GetNotificationChannelError {
890    #[allow(unused_variables)]
891    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
892        match *self {
893            GetNotificationChannelError::InternalError(ref cause) => write!(f, "{}", cause),
894            GetNotificationChannelError::InvalidOperation(ref cause) => write!(f, "{}", cause),
895            GetNotificationChannelError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
896        }
897    }
898}
899impl Error for GetNotificationChannelError {}
900/// Errors returned by GetPolicy
901#[derive(Debug, PartialEq)]
902pub enum GetPolicyError {
903    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
904    InternalError(String),
905    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
906    InvalidOperation(String),
907    /// <p>The value of the <code>Type</code> parameter is invalid.</p>
908    InvalidType(String),
909    /// <p>The specified resource was not found.</p>
910    ResourceNotFound(String),
911}
912
913impl GetPolicyError {
914    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetPolicyError> {
915        if let Some(err) = proto::json::Error::parse(&res) {
916            match err.typ.as_str() {
917                "InternalErrorException" => {
918                    return RusotoError::Service(GetPolicyError::InternalError(err.msg))
919                }
920                "InvalidOperationException" => {
921                    return RusotoError::Service(GetPolicyError::InvalidOperation(err.msg))
922                }
923                "InvalidTypeException" => {
924                    return RusotoError::Service(GetPolicyError::InvalidType(err.msg))
925                }
926                "ResourceNotFoundException" => {
927                    return RusotoError::Service(GetPolicyError::ResourceNotFound(err.msg))
928                }
929                "ValidationException" => return RusotoError::Validation(err.msg),
930                _ => {}
931            }
932        }
933        RusotoError::Unknown(res)
934    }
935}
936impl fmt::Display for GetPolicyError {
937    #[allow(unused_variables)]
938    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
939        match *self {
940            GetPolicyError::InternalError(ref cause) => write!(f, "{}", cause),
941            GetPolicyError::InvalidOperation(ref cause) => write!(f, "{}", cause),
942            GetPolicyError::InvalidType(ref cause) => write!(f, "{}", cause),
943            GetPolicyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
944        }
945    }
946}
947impl Error for GetPolicyError {}
948/// Errors returned by GetProtectionStatus
949#[derive(Debug, PartialEq)]
950pub enum GetProtectionStatusError {
951    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
952    InternalError(String),
953    /// <p>The parameters of the request were invalid.</p>
954    InvalidInput(String),
955    /// <p>The specified resource was not found.</p>
956    ResourceNotFound(String),
957}
958
959impl GetProtectionStatusError {
960    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetProtectionStatusError> {
961        if let Some(err) = proto::json::Error::parse(&res) {
962            match err.typ.as_str() {
963                "InternalErrorException" => {
964                    return RusotoError::Service(GetProtectionStatusError::InternalError(err.msg))
965                }
966                "InvalidInputException" => {
967                    return RusotoError::Service(GetProtectionStatusError::InvalidInput(err.msg))
968                }
969                "ResourceNotFoundException" => {
970                    return RusotoError::Service(GetProtectionStatusError::ResourceNotFound(
971                        err.msg,
972                    ))
973                }
974                "ValidationException" => return RusotoError::Validation(err.msg),
975                _ => {}
976            }
977        }
978        RusotoError::Unknown(res)
979    }
980}
981impl fmt::Display for GetProtectionStatusError {
982    #[allow(unused_variables)]
983    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
984        match *self {
985            GetProtectionStatusError::InternalError(ref cause) => write!(f, "{}", cause),
986            GetProtectionStatusError::InvalidInput(ref cause) => write!(f, "{}", cause),
987            GetProtectionStatusError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
988        }
989    }
990}
991impl Error for GetProtectionStatusError {}
992/// Errors returned by ListComplianceStatus
993#[derive(Debug, PartialEq)]
994pub enum ListComplianceStatusError {
995    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
996    InternalError(String),
997    /// <p>The specified resource was not found.</p>
998    ResourceNotFound(String),
999}
1000
1001impl ListComplianceStatusError {
1002    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListComplianceStatusError> {
1003        if let Some(err) = proto::json::Error::parse(&res) {
1004            match err.typ.as_str() {
1005                "InternalErrorException" => {
1006                    return RusotoError::Service(ListComplianceStatusError::InternalError(err.msg))
1007                }
1008                "ResourceNotFoundException" => {
1009                    return RusotoError::Service(ListComplianceStatusError::ResourceNotFound(
1010                        err.msg,
1011                    ))
1012                }
1013                "ValidationException" => return RusotoError::Validation(err.msg),
1014                _ => {}
1015            }
1016        }
1017        RusotoError::Unknown(res)
1018    }
1019}
1020impl fmt::Display for ListComplianceStatusError {
1021    #[allow(unused_variables)]
1022    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1023        match *self {
1024            ListComplianceStatusError::InternalError(ref cause) => write!(f, "{}", cause),
1025            ListComplianceStatusError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1026        }
1027    }
1028}
1029impl Error for ListComplianceStatusError {}
1030/// Errors returned by ListMemberAccounts
1031#[derive(Debug, PartialEq)]
1032pub enum ListMemberAccountsError {
1033    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
1034    InternalError(String),
1035    /// <p>The specified resource was not found.</p>
1036    ResourceNotFound(String),
1037}
1038
1039impl ListMemberAccountsError {
1040    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListMemberAccountsError> {
1041        if let Some(err) = proto::json::Error::parse(&res) {
1042            match err.typ.as_str() {
1043                "InternalErrorException" => {
1044                    return RusotoError::Service(ListMemberAccountsError::InternalError(err.msg))
1045                }
1046                "ResourceNotFoundException" => {
1047                    return RusotoError::Service(ListMemberAccountsError::ResourceNotFound(err.msg))
1048                }
1049                "ValidationException" => return RusotoError::Validation(err.msg),
1050                _ => {}
1051            }
1052        }
1053        RusotoError::Unknown(res)
1054    }
1055}
1056impl fmt::Display for ListMemberAccountsError {
1057    #[allow(unused_variables)]
1058    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1059        match *self {
1060            ListMemberAccountsError::InternalError(ref cause) => write!(f, "{}", cause),
1061            ListMemberAccountsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1062        }
1063    }
1064}
1065impl Error for ListMemberAccountsError {}
1066/// Errors returned by ListPolicies
1067#[derive(Debug, PartialEq)]
1068pub enum ListPoliciesError {
1069    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
1070    InternalError(String),
1071    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
1072    InvalidOperation(String),
1073    /// <p>The operation exceeds a resource limit, for example, the maximum number of <code>policy</code> objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/fms-limits.html">Firewall Manager Limits</a> in the <i>AWS WAF Developer Guide</i>.</p>
1074    LimitExceeded(String),
1075    /// <p>The specified resource was not found.</p>
1076    ResourceNotFound(String),
1077}
1078
1079impl ListPoliciesError {
1080    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListPoliciesError> {
1081        if let Some(err) = proto::json::Error::parse(&res) {
1082            match err.typ.as_str() {
1083                "InternalErrorException" => {
1084                    return RusotoError::Service(ListPoliciesError::InternalError(err.msg))
1085                }
1086                "InvalidOperationException" => {
1087                    return RusotoError::Service(ListPoliciesError::InvalidOperation(err.msg))
1088                }
1089                "LimitExceededException" => {
1090                    return RusotoError::Service(ListPoliciesError::LimitExceeded(err.msg))
1091                }
1092                "ResourceNotFoundException" => {
1093                    return RusotoError::Service(ListPoliciesError::ResourceNotFound(err.msg))
1094                }
1095                "ValidationException" => return RusotoError::Validation(err.msg),
1096                _ => {}
1097            }
1098        }
1099        RusotoError::Unknown(res)
1100    }
1101}
1102impl fmt::Display for ListPoliciesError {
1103    #[allow(unused_variables)]
1104    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1105        match *self {
1106            ListPoliciesError::InternalError(ref cause) => write!(f, "{}", cause),
1107            ListPoliciesError::InvalidOperation(ref cause) => write!(f, "{}", cause),
1108            ListPoliciesError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1109            ListPoliciesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1110        }
1111    }
1112}
1113impl Error for ListPoliciesError {}
1114/// Errors returned by ListTagsForResource
1115#[derive(Debug, PartialEq)]
1116pub enum ListTagsForResourceError {
1117    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
1118    InternalError(String),
1119    /// <p>The parameters of the request were invalid.</p>
1120    InvalidInput(String),
1121    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
1122    InvalidOperation(String),
1123    /// <p>The specified resource was not found.</p>
1124    ResourceNotFound(String),
1125}
1126
1127impl ListTagsForResourceError {
1128    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
1129        if let Some(err) = proto::json::Error::parse(&res) {
1130            match err.typ.as_str() {
1131                "InternalErrorException" => {
1132                    return RusotoError::Service(ListTagsForResourceError::InternalError(err.msg))
1133                }
1134                "InvalidInputException" => {
1135                    return RusotoError::Service(ListTagsForResourceError::InvalidInput(err.msg))
1136                }
1137                "InvalidOperationException" => {
1138                    return RusotoError::Service(ListTagsForResourceError::InvalidOperation(
1139                        err.msg,
1140                    ))
1141                }
1142                "ResourceNotFoundException" => {
1143                    return RusotoError::Service(ListTagsForResourceError::ResourceNotFound(
1144                        err.msg,
1145                    ))
1146                }
1147                "ValidationException" => return RusotoError::Validation(err.msg),
1148                _ => {}
1149            }
1150        }
1151        RusotoError::Unknown(res)
1152    }
1153}
1154impl fmt::Display for ListTagsForResourceError {
1155    #[allow(unused_variables)]
1156    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1157        match *self {
1158            ListTagsForResourceError::InternalError(ref cause) => write!(f, "{}", cause),
1159            ListTagsForResourceError::InvalidInput(ref cause) => write!(f, "{}", cause),
1160            ListTagsForResourceError::InvalidOperation(ref cause) => write!(f, "{}", cause),
1161            ListTagsForResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1162        }
1163    }
1164}
1165impl Error for ListTagsForResourceError {}
1166/// Errors returned by PutNotificationChannel
1167#[derive(Debug, PartialEq)]
1168pub enum PutNotificationChannelError {
1169    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
1170    InternalError(String),
1171    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
1172    InvalidOperation(String),
1173    /// <p>The specified resource was not found.</p>
1174    ResourceNotFound(String),
1175}
1176
1177impl PutNotificationChannelError {
1178    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutNotificationChannelError> {
1179        if let Some(err) = proto::json::Error::parse(&res) {
1180            match err.typ.as_str() {
1181                "InternalErrorException" => {
1182                    return RusotoError::Service(PutNotificationChannelError::InternalError(
1183                        err.msg,
1184                    ))
1185                }
1186                "InvalidOperationException" => {
1187                    return RusotoError::Service(PutNotificationChannelError::InvalidOperation(
1188                        err.msg,
1189                    ))
1190                }
1191                "ResourceNotFoundException" => {
1192                    return RusotoError::Service(PutNotificationChannelError::ResourceNotFound(
1193                        err.msg,
1194                    ))
1195                }
1196                "ValidationException" => return RusotoError::Validation(err.msg),
1197                _ => {}
1198            }
1199        }
1200        RusotoError::Unknown(res)
1201    }
1202}
1203impl fmt::Display for PutNotificationChannelError {
1204    #[allow(unused_variables)]
1205    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1206        match *self {
1207            PutNotificationChannelError::InternalError(ref cause) => write!(f, "{}", cause),
1208            PutNotificationChannelError::InvalidOperation(ref cause) => write!(f, "{}", cause),
1209            PutNotificationChannelError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1210        }
1211    }
1212}
1213impl Error for PutNotificationChannelError {}
1214/// Errors returned by PutPolicy
1215#[derive(Debug, PartialEq)]
1216pub enum PutPolicyError {
1217    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
1218    InternalError(String),
1219    /// <p>The parameters of the request were invalid.</p>
1220    InvalidInput(String),
1221    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
1222    InvalidOperation(String),
1223    /// <p>The value of the <code>Type</code> parameter is invalid.</p>
1224    InvalidType(String),
1225    /// <p>The operation exceeds a resource limit, for example, the maximum number of <code>policy</code> objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/fms-limits.html">Firewall Manager Limits</a> in the <i>AWS WAF Developer Guide</i>.</p>
1226    LimitExceeded(String),
1227    /// <p>The specified resource was not found.</p>
1228    ResourceNotFound(String),
1229}
1230
1231impl PutPolicyError {
1232    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutPolicyError> {
1233        if let Some(err) = proto::json::Error::parse(&res) {
1234            match err.typ.as_str() {
1235                "InternalErrorException" => {
1236                    return RusotoError::Service(PutPolicyError::InternalError(err.msg))
1237                }
1238                "InvalidInputException" => {
1239                    return RusotoError::Service(PutPolicyError::InvalidInput(err.msg))
1240                }
1241                "InvalidOperationException" => {
1242                    return RusotoError::Service(PutPolicyError::InvalidOperation(err.msg))
1243                }
1244                "InvalidTypeException" => {
1245                    return RusotoError::Service(PutPolicyError::InvalidType(err.msg))
1246                }
1247                "LimitExceededException" => {
1248                    return RusotoError::Service(PutPolicyError::LimitExceeded(err.msg))
1249                }
1250                "ResourceNotFoundException" => {
1251                    return RusotoError::Service(PutPolicyError::ResourceNotFound(err.msg))
1252                }
1253                "ValidationException" => return RusotoError::Validation(err.msg),
1254                _ => {}
1255            }
1256        }
1257        RusotoError::Unknown(res)
1258    }
1259}
1260impl fmt::Display for PutPolicyError {
1261    #[allow(unused_variables)]
1262    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1263        match *self {
1264            PutPolicyError::InternalError(ref cause) => write!(f, "{}", cause),
1265            PutPolicyError::InvalidInput(ref cause) => write!(f, "{}", cause),
1266            PutPolicyError::InvalidOperation(ref cause) => write!(f, "{}", cause),
1267            PutPolicyError::InvalidType(ref cause) => write!(f, "{}", cause),
1268            PutPolicyError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1269            PutPolicyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1270        }
1271    }
1272}
1273impl Error for PutPolicyError {}
1274/// Errors returned by TagResource
1275#[derive(Debug, PartialEq)]
1276pub enum TagResourceError {
1277    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
1278    InternalError(String),
1279    /// <p>The parameters of the request were invalid.</p>
1280    InvalidInput(String),
1281    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
1282    InvalidOperation(String),
1283    /// <p>The operation exceeds a resource limit, for example, the maximum number of <code>policy</code> objects that you can create for an AWS account. For more information, see <a href="https://docs.aws.amazon.com/waf/latest/developerguide/fms-limits.html">Firewall Manager Limits</a> in the <i>AWS WAF Developer Guide</i>.</p>
1284    LimitExceeded(String),
1285    /// <p>The specified resource was not found.</p>
1286    ResourceNotFound(String),
1287}
1288
1289impl TagResourceError {
1290    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
1291        if let Some(err) = proto::json::Error::parse(&res) {
1292            match err.typ.as_str() {
1293                "InternalErrorException" => {
1294                    return RusotoError::Service(TagResourceError::InternalError(err.msg))
1295                }
1296                "InvalidInputException" => {
1297                    return RusotoError::Service(TagResourceError::InvalidInput(err.msg))
1298                }
1299                "InvalidOperationException" => {
1300                    return RusotoError::Service(TagResourceError::InvalidOperation(err.msg))
1301                }
1302                "LimitExceededException" => {
1303                    return RusotoError::Service(TagResourceError::LimitExceeded(err.msg))
1304                }
1305                "ResourceNotFoundException" => {
1306                    return RusotoError::Service(TagResourceError::ResourceNotFound(err.msg))
1307                }
1308                "ValidationException" => return RusotoError::Validation(err.msg),
1309                _ => {}
1310            }
1311        }
1312        RusotoError::Unknown(res)
1313    }
1314}
1315impl fmt::Display for TagResourceError {
1316    #[allow(unused_variables)]
1317    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1318        match *self {
1319            TagResourceError::InternalError(ref cause) => write!(f, "{}", cause),
1320            TagResourceError::InvalidInput(ref cause) => write!(f, "{}", cause),
1321            TagResourceError::InvalidOperation(ref cause) => write!(f, "{}", cause),
1322            TagResourceError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1323            TagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1324        }
1325    }
1326}
1327impl Error for TagResourceError {}
1328/// Errors returned by UntagResource
1329#[derive(Debug, PartialEq)]
1330pub enum UntagResourceError {
1331    /// <p>The operation failed because of a system problem, even though the request was valid. Retry your request.</p>
1332    InternalError(String),
1333    /// <p>The parameters of the request were invalid.</p>
1334    InvalidInput(String),
1335    /// <p>The operation failed because there was nothing to do. For example, you might have submitted an <code>AssociateAdminAccount</code> request, but the account ID that you submitted was already set as the AWS Firewall Manager administrator.</p>
1336    InvalidOperation(String),
1337    /// <p>The specified resource was not found.</p>
1338    ResourceNotFound(String),
1339}
1340
1341impl UntagResourceError {
1342    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
1343        if let Some(err) = proto::json::Error::parse(&res) {
1344            match err.typ.as_str() {
1345                "InternalErrorException" => {
1346                    return RusotoError::Service(UntagResourceError::InternalError(err.msg))
1347                }
1348                "InvalidInputException" => {
1349                    return RusotoError::Service(UntagResourceError::InvalidInput(err.msg))
1350                }
1351                "InvalidOperationException" => {
1352                    return RusotoError::Service(UntagResourceError::InvalidOperation(err.msg))
1353                }
1354                "ResourceNotFoundException" => {
1355                    return RusotoError::Service(UntagResourceError::ResourceNotFound(err.msg))
1356                }
1357                "ValidationException" => return RusotoError::Validation(err.msg),
1358                _ => {}
1359            }
1360        }
1361        RusotoError::Unknown(res)
1362    }
1363}
1364impl fmt::Display for UntagResourceError {
1365    #[allow(unused_variables)]
1366    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1367        match *self {
1368            UntagResourceError::InternalError(ref cause) => write!(f, "{}", cause),
1369            UntagResourceError::InvalidInput(ref cause) => write!(f, "{}", cause),
1370            UntagResourceError::InvalidOperation(ref cause) => write!(f, "{}", cause),
1371            UntagResourceError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1372        }
1373    }
1374}
1375impl Error for UntagResourceError {}
1376/// Trait representing the capabilities of the FMS API. FMS clients implement this trait.
1377#[async_trait]
1378pub trait Fms {
1379    /// <p>Sets the AWS Firewall Manager administrator account. AWS Firewall Manager must be associated with the master account of your AWS organization or associated with a member account that has the appropriate permissions. If the account ID that you submit is not an AWS Organizations master account, AWS Firewall Manager will set the appropriate permissions for the given member account.</p> <p>The account that you associate with AWS Firewall Manager is called the AWS Firewall Manager administrator account. </p>
1380    async fn associate_admin_account(
1381        &self,
1382        input: AssociateAdminAccountRequest,
1383    ) -> Result<(), RusotoError<AssociateAdminAccountError>>;
1384
1385    /// <p>Deletes an AWS Firewall Manager association with the IAM role and the Amazon Simple Notification Service (SNS) topic that is used to record AWS Firewall Manager SNS logs.</p>
1386    async fn delete_notification_channel(
1387        &self,
1388    ) -> Result<(), RusotoError<DeleteNotificationChannelError>>;
1389
1390    /// <p>Permanently deletes an AWS Firewall Manager policy. </p>
1391    async fn delete_policy(
1392        &self,
1393        input: DeletePolicyRequest,
1394    ) -> Result<(), RusotoError<DeletePolicyError>>;
1395
1396    /// <p>Disassociates the account that has been set as the AWS Firewall Manager administrator account. To set a different account as the administrator account, you must submit an <code>AssociateAdminAccount</code> request.</p>
1397    async fn disassociate_admin_account(
1398        &self,
1399    ) -> Result<(), RusotoError<DisassociateAdminAccountError>>;
1400
1401    /// <p>Returns the AWS Organizations master account that is associated with AWS Firewall Manager as the AWS Firewall Manager administrator.</p>
1402    async fn get_admin_account(
1403        &self,
1404    ) -> Result<GetAdminAccountResponse, RusotoError<GetAdminAccountError>>;
1405
1406    /// <p>Returns detailed compliance information about the specified member account. Details include resources that are in and out of compliance with the specified policy. Resources are considered noncompliant for AWS WAF and Shield Advanced policies if the specified policy has not been applied to them. Resources are considered noncompliant for security group policies if they are in scope of the policy, they violate one or more of the policy rules, and remediation is disabled or not possible. </p>
1407    async fn get_compliance_detail(
1408        &self,
1409        input: GetComplianceDetailRequest,
1410    ) -> Result<GetComplianceDetailResponse, RusotoError<GetComplianceDetailError>>;
1411
1412    /// <p>Information about the Amazon Simple Notification Service (SNS) topic that is used to record AWS Firewall Manager SNS logs.</p>
1413    async fn get_notification_channel(
1414        &self,
1415    ) -> Result<GetNotificationChannelResponse, RusotoError<GetNotificationChannelError>>;
1416
1417    /// <p>Returns information about the specified AWS Firewall Manager policy.</p>
1418    async fn get_policy(
1419        &self,
1420        input: GetPolicyRequest,
1421    ) -> Result<GetPolicyResponse, RusotoError<GetPolicyError>>;
1422
1423    /// <p>If you created a Shield Advanced policy, returns policy-level attack summary information in the event of a potential DDoS attack. Other policy types are currently unsupported.</p>
1424    async fn get_protection_status(
1425        &self,
1426        input: GetProtectionStatusRequest,
1427    ) -> Result<GetProtectionStatusResponse, RusotoError<GetProtectionStatusError>>;
1428
1429    /// <p>Returns an array of <code>PolicyComplianceStatus</code> objects in the response. Use <code>PolicyComplianceStatus</code> to get a summary of which member accounts are protected by the specified policy. </p>
1430    async fn list_compliance_status(
1431        &self,
1432        input: ListComplianceStatusRequest,
1433    ) -> Result<ListComplianceStatusResponse, RusotoError<ListComplianceStatusError>>;
1434
1435    /// <p>Returns a <code>MemberAccounts</code> object that lists the member accounts in the administrator's AWS organization.</p> <p>The <code>ListMemberAccounts</code> must be submitted by the account that is set as the AWS Firewall Manager administrator.</p>
1436    async fn list_member_accounts(
1437        &self,
1438        input: ListMemberAccountsRequest,
1439    ) -> Result<ListMemberAccountsResponse, RusotoError<ListMemberAccountsError>>;
1440
1441    /// <p>Returns an array of <code>PolicySummary</code> objects in the response.</p>
1442    async fn list_policies(
1443        &self,
1444        input: ListPoliciesRequest,
1445    ) -> Result<ListPoliciesResponse, RusotoError<ListPoliciesError>>;
1446
1447    /// <p>Retrieves the list of tags for the specified AWS resource. </p>
1448    async fn list_tags_for_resource(
1449        &self,
1450        input: ListTagsForResourceRequest,
1451    ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
1452
1453    /// <p>Designates the IAM role and Amazon Simple Notification Service (SNS) topic that AWS Firewall Manager uses to record SNS logs.</p>
1454    async fn put_notification_channel(
1455        &self,
1456        input: PutNotificationChannelRequest,
1457    ) -> Result<(), RusotoError<PutNotificationChannelError>>;
1458
1459    /// <p>Creates an AWS Firewall Manager policy.</p> <p>Firewall Manager provides the following types of policies: </p> <ul> <li> <p>A Shield Advanced policy, which applies Shield Advanced protection to specified accounts and resources</p> </li> <li> <p>An AWS WAF policy (type WAFV2), which defines rule groups to run first in the corresponding AWS WAF web ACL and rule groups to run last in the web ACL.</p> </li> <li> <p>An AWS WAF Classic policy (type WAF), which defines a rule group. </p> </li> <li> <p>A security group policy, which manages VPC security groups across your AWS organization. </p> </li> </ul> <p>Each policy is specific to one of the types. If you want to enforce more than one policy type across accounts, create multiple policies. You can create multiple policies for each type.</p> <p>You must be subscribed to Shield Advanced to create a Shield Advanced policy. For more information about subscribing to Shield Advanced, see <a href="https://docs.aws.amazon.com/waf/latest/DDOSAPIReference/API_CreateSubscription.html">CreateSubscription</a>.</p>
1460    async fn put_policy(
1461        &self,
1462        input: PutPolicyRequest,
1463    ) -> Result<PutPolicyResponse, RusotoError<PutPolicyError>>;
1464
1465    /// <p>Adds one or more tags to an AWS resource.</p>
1466    async fn tag_resource(
1467        &self,
1468        input: TagResourceRequest,
1469    ) -> Result<TagResourceResponse, RusotoError<TagResourceError>>;
1470
1471    /// <p>Removes one or more tags from an AWS resource.</p>
1472    async fn untag_resource(
1473        &self,
1474        input: UntagResourceRequest,
1475    ) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>>;
1476}
1477/// A client for the FMS API.
1478#[derive(Clone)]
1479pub struct FmsClient {
1480    client: Client,
1481    region: region::Region,
1482}
1483
1484impl FmsClient {
1485    /// Creates a client backed by the default tokio event loop.
1486    ///
1487    /// The client will use the default credentials provider and tls client.
1488    pub fn new(region: region::Region) -> FmsClient {
1489        FmsClient {
1490            client: Client::shared(),
1491            region,
1492        }
1493    }
1494
1495    pub fn new_with<P, D>(
1496        request_dispatcher: D,
1497        credentials_provider: P,
1498        region: region::Region,
1499    ) -> FmsClient
1500    where
1501        P: ProvideAwsCredentials + Send + Sync + 'static,
1502        D: DispatchSignedRequest + Send + Sync + 'static,
1503    {
1504        FmsClient {
1505            client: Client::new_with(credentials_provider, request_dispatcher),
1506            region,
1507        }
1508    }
1509
1510    pub fn new_with_client(client: Client, region: region::Region) -> FmsClient {
1511        FmsClient { client, region }
1512    }
1513}
1514
1515#[async_trait]
1516impl Fms for FmsClient {
1517    /// <p>Sets the AWS Firewall Manager administrator account. AWS Firewall Manager must be associated with the master account of your AWS organization or associated with a member account that has the appropriate permissions. If the account ID that you submit is not an AWS Organizations master account, AWS Firewall Manager will set the appropriate permissions for the given member account.</p> <p>The account that you associate with AWS Firewall Manager is called the AWS Firewall Manager administrator account. </p>
1518    async fn associate_admin_account(
1519        &self,
1520        input: AssociateAdminAccountRequest,
1521    ) -> Result<(), RusotoError<AssociateAdminAccountError>> {
1522        let mut request = self.new_signed_request("POST", "/");
1523        request.add_header("x-amz-target", "AWSFMS_20180101.AssociateAdminAccount");
1524        let encoded = serde_json::to_string(&input).unwrap();
1525        request.set_payload(Some(encoded));
1526
1527        let response = self
1528            .sign_and_dispatch(request, AssociateAdminAccountError::from_response)
1529            .await?;
1530        std::mem::drop(response);
1531        Ok(())
1532    }
1533
1534    /// <p>Deletes an AWS Firewall Manager association with the IAM role and the Amazon Simple Notification Service (SNS) topic that is used to record AWS Firewall Manager SNS logs.</p>
1535    async fn delete_notification_channel(
1536        &self,
1537    ) -> Result<(), RusotoError<DeleteNotificationChannelError>> {
1538        let mut request = self.new_signed_request("POST", "/");
1539        request.add_header("x-amz-target", "AWSFMS_20180101.DeleteNotificationChannel");
1540        request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
1541
1542        let response = self
1543            .sign_and_dispatch(request, DeleteNotificationChannelError::from_response)
1544            .await?;
1545        std::mem::drop(response);
1546        Ok(())
1547    }
1548
1549    /// <p>Permanently deletes an AWS Firewall Manager policy. </p>
1550    async fn delete_policy(
1551        &self,
1552        input: DeletePolicyRequest,
1553    ) -> Result<(), RusotoError<DeletePolicyError>> {
1554        let mut request = self.new_signed_request("POST", "/");
1555        request.add_header("x-amz-target", "AWSFMS_20180101.DeletePolicy");
1556        let encoded = serde_json::to_string(&input).unwrap();
1557        request.set_payload(Some(encoded));
1558
1559        let response = self
1560            .sign_and_dispatch(request, DeletePolicyError::from_response)
1561            .await?;
1562        std::mem::drop(response);
1563        Ok(())
1564    }
1565
1566    /// <p>Disassociates the account that has been set as the AWS Firewall Manager administrator account. To set a different account as the administrator account, you must submit an <code>AssociateAdminAccount</code> request.</p>
1567    async fn disassociate_admin_account(
1568        &self,
1569    ) -> Result<(), RusotoError<DisassociateAdminAccountError>> {
1570        let mut request = self.new_signed_request("POST", "/");
1571        request.add_header("x-amz-target", "AWSFMS_20180101.DisassociateAdminAccount");
1572        request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
1573
1574        let response = self
1575            .sign_and_dispatch(request, DisassociateAdminAccountError::from_response)
1576            .await?;
1577        std::mem::drop(response);
1578        Ok(())
1579    }
1580
1581    /// <p>Returns the AWS Organizations master account that is associated with AWS Firewall Manager as the AWS Firewall Manager administrator.</p>
1582    async fn get_admin_account(
1583        &self,
1584    ) -> Result<GetAdminAccountResponse, RusotoError<GetAdminAccountError>> {
1585        let mut request = self.new_signed_request("POST", "/");
1586        request.add_header("x-amz-target", "AWSFMS_20180101.GetAdminAccount");
1587        request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
1588
1589        let response = self
1590            .sign_and_dispatch(request, GetAdminAccountError::from_response)
1591            .await?;
1592        let mut response = response;
1593        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1594        proto::json::ResponsePayload::new(&response).deserialize::<GetAdminAccountResponse, _>()
1595    }
1596
1597    /// <p>Returns detailed compliance information about the specified member account. Details include resources that are in and out of compliance with the specified policy. Resources are considered noncompliant for AWS WAF and Shield Advanced policies if the specified policy has not been applied to them. Resources are considered noncompliant for security group policies if they are in scope of the policy, they violate one or more of the policy rules, and remediation is disabled or not possible. </p>
1598    async fn get_compliance_detail(
1599        &self,
1600        input: GetComplianceDetailRequest,
1601    ) -> Result<GetComplianceDetailResponse, RusotoError<GetComplianceDetailError>> {
1602        let mut request = self.new_signed_request("POST", "/");
1603        request.add_header("x-amz-target", "AWSFMS_20180101.GetComplianceDetail");
1604        let encoded = serde_json::to_string(&input).unwrap();
1605        request.set_payload(Some(encoded));
1606
1607        let response = self
1608            .sign_and_dispatch(request, GetComplianceDetailError::from_response)
1609            .await?;
1610        let mut response = response;
1611        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1612        proto::json::ResponsePayload::new(&response).deserialize::<GetComplianceDetailResponse, _>()
1613    }
1614
1615    /// <p>Information about the Amazon Simple Notification Service (SNS) topic that is used to record AWS Firewall Manager SNS logs.</p>
1616    async fn get_notification_channel(
1617        &self,
1618    ) -> Result<GetNotificationChannelResponse, RusotoError<GetNotificationChannelError>> {
1619        let mut request = self.new_signed_request("POST", "/");
1620        request.add_header("x-amz-target", "AWSFMS_20180101.GetNotificationChannel");
1621        request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
1622
1623        let response = self
1624            .sign_and_dispatch(request, GetNotificationChannelError::from_response)
1625            .await?;
1626        let mut response = response;
1627        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1628        proto::json::ResponsePayload::new(&response)
1629            .deserialize::<GetNotificationChannelResponse, _>()
1630    }
1631
1632    /// <p>Returns information about the specified AWS Firewall Manager policy.</p>
1633    async fn get_policy(
1634        &self,
1635        input: GetPolicyRequest,
1636    ) -> Result<GetPolicyResponse, RusotoError<GetPolicyError>> {
1637        let mut request = self.new_signed_request("POST", "/");
1638        request.add_header("x-amz-target", "AWSFMS_20180101.GetPolicy");
1639        let encoded = serde_json::to_string(&input).unwrap();
1640        request.set_payload(Some(encoded));
1641
1642        let response = self
1643            .sign_and_dispatch(request, GetPolicyError::from_response)
1644            .await?;
1645        let mut response = response;
1646        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1647        proto::json::ResponsePayload::new(&response).deserialize::<GetPolicyResponse, _>()
1648    }
1649
1650    /// <p>If you created a Shield Advanced policy, returns policy-level attack summary information in the event of a potential DDoS attack. Other policy types are currently unsupported.</p>
1651    async fn get_protection_status(
1652        &self,
1653        input: GetProtectionStatusRequest,
1654    ) -> Result<GetProtectionStatusResponse, RusotoError<GetProtectionStatusError>> {
1655        let mut request = self.new_signed_request("POST", "/");
1656        request.add_header("x-amz-target", "AWSFMS_20180101.GetProtectionStatus");
1657        let encoded = serde_json::to_string(&input).unwrap();
1658        request.set_payload(Some(encoded));
1659
1660        let response = self
1661            .sign_and_dispatch(request, GetProtectionStatusError::from_response)
1662            .await?;
1663        let mut response = response;
1664        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1665        proto::json::ResponsePayload::new(&response).deserialize::<GetProtectionStatusResponse, _>()
1666    }
1667
1668    /// <p>Returns an array of <code>PolicyComplianceStatus</code> objects in the response. Use <code>PolicyComplianceStatus</code> to get a summary of which member accounts are protected by the specified policy. </p>
1669    async fn list_compliance_status(
1670        &self,
1671        input: ListComplianceStatusRequest,
1672    ) -> Result<ListComplianceStatusResponse, RusotoError<ListComplianceStatusError>> {
1673        let mut request = self.new_signed_request("POST", "/");
1674        request.add_header("x-amz-target", "AWSFMS_20180101.ListComplianceStatus");
1675        let encoded = serde_json::to_string(&input).unwrap();
1676        request.set_payload(Some(encoded));
1677
1678        let response = self
1679            .sign_and_dispatch(request, ListComplianceStatusError::from_response)
1680            .await?;
1681        let mut response = response;
1682        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1683        proto::json::ResponsePayload::new(&response)
1684            .deserialize::<ListComplianceStatusResponse, _>()
1685    }
1686
1687    /// <p>Returns a <code>MemberAccounts</code> object that lists the member accounts in the administrator's AWS organization.</p> <p>The <code>ListMemberAccounts</code> must be submitted by the account that is set as the AWS Firewall Manager administrator.</p>
1688    async fn list_member_accounts(
1689        &self,
1690        input: ListMemberAccountsRequest,
1691    ) -> Result<ListMemberAccountsResponse, RusotoError<ListMemberAccountsError>> {
1692        let mut request = self.new_signed_request("POST", "/");
1693        request.add_header("x-amz-target", "AWSFMS_20180101.ListMemberAccounts");
1694        let encoded = serde_json::to_string(&input).unwrap();
1695        request.set_payload(Some(encoded));
1696
1697        let response = self
1698            .sign_and_dispatch(request, ListMemberAccountsError::from_response)
1699            .await?;
1700        let mut response = response;
1701        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1702        proto::json::ResponsePayload::new(&response).deserialize::<ListMemberAccountsResponse, _>()
1703    }
1704
1705    /// <p>Returns an array of <code>PolicySummary</code> objects in the response.</p>
1706    async fn list_policies(
1707        &self,
1708        input: ListPoliciesRequest,
1709    ) -> Result<ListPoliciesResponse, RusotoError<ListPoliciesError>> {
1710        let mut request = self.new_signed_request("POST", "/");
1711        request.add_header("x-amz-target", "AWSFMS_20180101.ListPolicies");
1712        let encoded = serde_json::to_string(&input).unwrap();
1713        request.set_payload(Some(encoded));
1714
1715        let response = self
1716            .sign_and_dispatch(request, ListPoliciesError::from_response)
1717            .await?;
1718        let mut response = response;
1719        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1720        proto::json::ResponsePayload::new(&response).deserialize::<ListPoliciesResponse, _>()
1721    }
1722
1723    /// <p>Retrieves the list of tags for the specified AWS resource. </p>
1724    async fn list_tags_for_resource(
1725        &self,
1726        input: ListTagsForResourceRequest,
1727    ) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
1728        let mut request = self.new_signed_request("POST", "/");
1729        request.add_header("x-amz-target", "AWSFMS_20180101.ListTagsForResource");
1730        let encoded = serde_json::to_string(&input).unwrap();
1731        request.set_payload(Some(encoded));
1732
1733        let response = self
1734            .sign_and_dispatch(request, ListTagsForResourceError::from_response)
1735            .await?;
1736        let mut response = response;
1737        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1738        proto::json::ResponsePayload::new(&response).deserialize::<ListTagsForResourceResponse, _>()
1739    }
1740
1741    /// <p>Designates the IAM role and Amazon Simple Notification Service (SNS) topic that AWS Firewall Manager uses to record SNS logs.</p>
1742    async fn put_notification_channel(
1743        &self,
1744        input: PutNotificationChannelRequest,
1745    ) -> Result<(), RusotoError<PutNotificationChannelError>> {
1746        let mut request = self.new_signed_request("POST", "/");
1747        request.add_header("x-amz-target", "AWSFMS_20180101.PutNotificationChannel");
1748        let encoded = serde_json::to_string(&input).unwrap();
1749        request.set_payload(Some(encoded));
1750
1751        let response = self
1752            .sign_and_dispatch(request, PutNotificationChannelError::from_response)
1753            .await?;
1754        std::mem::drop(response);
1755        Ok(())
1756    }
1757
1758    /// <p>Creates an AWS Firewall Manager policy.</p> <p>Firewall Manager provides the following types of policies: </p> <ul> <li> <p>A Shield Advanced policy, which applies Shield Advanced protection to specified accounts and resources</p> </li> <li> <p>An AWS WAF policy (type WAFV2), which defines rule groups to run first in the corresponding AWS WAF web ACL and rule groups to run last in the web ACL.</p> </li> <li> <p>An AWS WAF Classic policy (type WAF), which defines a rule group. </p> </li> <li> <p>A security group policy, which manages VPC security groups across your AWS organization. </p> </li> </ul> <p>Each policy is specific to one of the types. If you want to enforce more than one policy type across accounts, create multiple policies. You can create multiple policies for each type.</p> <p>You must be subscribed to Shield Advanced to create a Shield Advanced policy. For more information about subscribing to Shield Advanced, see <a href="https://docs.aws.amazon.com/waf/latest/DDOSAPIReference/API_CreateSubscription.html">CreateSubscription</a>.</p>
1759    async fn put_policy(
1760        &self,
1761        input: PutPolicyRequest,
1762    ) -> Result<PutPolicyResponse, RusotoError<PutPolicyError>> {
1763        let mut request = self.new_signed_request("POST", "/");
1764        request.add_header("x-amz-target", "AWSFMS_20180101.PutPolicy");
1765        let encoded = serde_json::to_string(&input).unwrap();
1766        request.set_payload(Some(encoded));
1767
1768        let response = self
1769            .sign_and_dispatch(request, PutPolicyError::from_response)
1770            .await?;
1771        let mut response = response;
1772        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1773        proto::json::ResponsePayload::new(&response).deserialize::<PutPolicyResponse, _>()
1774    }
1775
1776    /// <p>Adds one or more tags to an AWS resource.</p>
1777    async fn tag_resource(
1778        &self,
1779        input: TagResourceRequest,
1780    ) -> Result<TagResourceResponse, RusotoError<TagResourceError>> {
1781        let mut request = self.new_signed_request("POST", "/");
1782        request.add_header("x-amz-target", "AWSFMS_20180101.TagResource");
1783        let encoded = serde_json::to_string(&input).unwrap();
1784        request.set_payload(Some(encoded));
1785
1786        let response = self
1787            .sign_and_dispatch(request, TagResourceError::from_response)
1788            .await?;
1789        let mut response = response;
1790        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1791        proto::json::ResponsePayload::new(&response).deserialize::<TagResourceResponse, _>()
1792    }
1793
1794    /// <p>Removes one or more tags from an AWS resource.</p>
1795    async fn untag_resource(
1796        &self,
1797        input: UntagResourceRequest,
1798    ) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>> {
1799        let mut request = self.new_signed_request("POST", "/");
1800        request.add_header("x-amz-target", "AWSFMS_20180101.UntagResource");
1801        let encoded = serde_json::to_string(&input).unwrap();
1802        request.set_payload(Some(encoded));
1803
1804        let response = self
1805            .sign_and_dispatch(request, UntagResourceError::from_response)
1806            .await?;
1807        let mut response = response;
1808        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
1809        proto::json::ResponsePayload::new(&response).deserialize::<UntagResourceResponse, _>()
1810    }
1811}