use std::error::Error;
use std::fmt;
use async_trait::async_trait;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AffectedEntity {
#[serde(rename = "awsAccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_account_id: Option<String>,
#[serde(rename = "entityArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_arn: Option<String>,
#[serde(rename = "entityUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_url: Option<String>,
#[serde(rename = "entityValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_value: Option<String>,
#[serde(rename = "eventArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_arn: Option<String>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<f64>,
#[serde(rename = "statusCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_code: Option<String>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DateTimeRange {
#[serde(rename = "from")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from: Option<f64>,
#[serde(rename = "to")]
#[serde(skip_serializing_if = "Option::is_none")]
pub to: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeAffectedAccountsForOrganizationRequest {
#[serde(rename = "eventArn")]
pub event_arn: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeAffectedAccountsForOrganizationResponse {
#[serde(rename = "affectedAccounts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub affected_accounts: Option<Vec<String>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeAffectedEntitiesForOrganizationRequest {
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "organizationEntityFilters")]
pub organization_entity_filters: Vec<EventAccountFilter>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeAffectedEntitiesForOrganizationResponse {
#[serde(rename = "entities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entities: Option<Vec<AffectedEntity>>,
#[serde(rename = "failedSet")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failed_set: Option<Vec<OrganizationAffectedEntitiesErrorItem>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeAffectedEntitiesRequest {
#[serde(rename = "filter")]
pub filter: EntityFilter,
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeAffectedEntitiesResponse {
#[serde(rename = "entities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entities: Option<Vec<AffectedEntity>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEntityAggregatesRequest {
#[serde(rename = "eventArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_arns: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEntityAggregatesResponse {
#[serde(rename = "entityAggregates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_aggregates: Option<Vec<EntityAggregate>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEventAggregatesRequest {
#[serde(rename = "aggregateField")]
pub aggregate_field: String,
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<EventFilter>,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEventAggregatesResponse {
#[serde(rename = "eventAggregates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_aggregates: Option<Vec<EventAggregate>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEventDetailsForOrganizationRequest {
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "organizationEventDetailFilters")]
pub organization_event_detail_filters: Vec<EventAccountFilter>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEventDetailsForOrganizationResponse {
#[serde(rename = "failedSet")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failed_set: Option<Vec<OrganizationEventDetailsErrorItem>>,
#[serde(rename = "successfulSet")]
#[serde(skip_serializing_if = "Option::is_none")]
pub successful_set: Option<Vec<OrganizationEventDetails>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEventDetailsRequest {
#[serde(rename = "eventArns")]
pub event_arns: Vec<String>,
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEventDetailsResponse {
#[serde(rename = "failedSet")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failed_set: Option<Vec<EventDetailsErrorItem>>,
#[serde(rename = "successfulSet")]
#[serde(skip_serializing_if = "Option::is_none")]
pub successful_set: Option<Vec<EventDetails>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEventTypesRequest {
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<EventTypeFilter>,
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEventTypesResponse {
#[serde(rename = "eventTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_types: Option<Vec<String>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEventsForOrganizationRequest {
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<OrganizationEventFilter>,
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEventsForOrganizationResponse {
#[serde(rename = "events")]
#[serde(skip_serializing_if = "Option::is_none")]
pub events: Option<Vec<OrganizationEvent>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEventsRequest {
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<EventFilter>,
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEventsResponse {
#[serde(rename = "events")]
#[serde(skip_serializing_if = "Option::is_none")]
pub events: Option<Vec<Event>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeHealthServiceStatusForOrganizationResponse {
#[serde(rename = "healthServiceAccessStatusForOrganization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_service_access_status_for_organization: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EntityAggregate {
#[serde(rename = "count")]
#[serde(skip_serializing_if = "Option::is_none")]
pub count: Option<i64>,
#[serde(rename = "eventArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct EntityFilter {
#[serde(rename = "entityArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_arns: Option<Vec<String>>,
#[serde(rename = "entityValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_values: Option<Vec<String>>,
#[serde(rename = "eventArns")]
pub event_arns: Vec<String>,
#[serde(rename = "lastUpdatedTimes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_times: Option<Vec<DateTimeRange>>,
#[serde(rename = "statusCodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_codes: Option<Vec<String>>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<::std::collections::HashMap<String, String>>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Event {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "availabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zone: Option<String>,
#[serde(rename = "endTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "eventTypeCategory")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_type_category: Option<String>,
#[serde(rename = "eventTypeCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_type_code: Option<String>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<f64>,
#[serde(rename = "region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "service")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
#[serde(rename = "startTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<f64>,
#[serde(rename = "statusCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_code: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct EventAccountFilter {
#[serde(rename = "awsAccountId")]
pub aws_account_id: String,
#[serde(rename = "eventArn")]
pub event_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EventAggregate {
#[serde(rename = "aggregateValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aggregate_value: Option<String>,
#[serde(rename = "count")]
#[serde(skip_serializing_if = "Option::is_none")]
pub count: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EventDetails {
#[serde(rename = "event")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event: Option<Event>,
#[serde(rename = "eventDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_description: Option<String>,
#[serde(rename = "eventMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_metadata: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EventDetailsErrorItem {
#[serde(rename = "errorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
#[serde(rename = "errorName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_name: Option<String>,
#[serde(rename = "eventArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct EventFilter {
#[serde(rename = "availabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zones: Option<Vec<String>>,
#[serde(rename = "endTimes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_times: Option<Vec<DateTimeRange>>,
#[serde(rename = "entityArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_arns: Option<Vec<String>>,
#[serde(rename = "entityValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_values: Option<Vec<String>>,
#[serde(rename = "eventArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_arns: Option<Vec<String>>,
#[serde(rename = "eventStatusCodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_status_codes: Option<Vec<String>>,
#[serde(rename = "eventTypeCategories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_type_categories: Option<Vec<String>>,
#[serde(rename = "eventTypeCodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_type_codes: Option<Vec<String>>,
#[serde(rename = "lastUpdatedTimes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_times: Option<Vec<DateTimeRange>>,
#[serde(rename = "regions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub regions: Option<Vec<String>>,
#[serde(rename = "services")]
#[serde(skip_serializing_if = "Option::is_none")]
pub services: Option<Vec<String>>,
#[serde(rename = "startTimes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_times: Option<Vec<DateTimeRange>>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<::std::collections::HashMap<String, String>>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct EventTypeFilter {
#[serde(rename = "eventTypeCategories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_type_categories: Option<Vec<String>>,
#[serde(rename = "eventTypeCodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_type_codes: Option<Vec<String>>,
#[serde(rename = "services")]
#[serde(skip_serializing_if = "Option::is_none")]
pub services: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct OrganizationAffectedEntitiesErrorItem {
#[serde(rename = "awsAccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_account_id: Option<String>,
#[serde(rename = "errorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
#[serde(rename = "errorName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_name: Option<String>,
#[serde(rename = "eventArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct OrganizationEvent {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "endTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "eventTypeCategory")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_type_category: Option<String>,
#[serde(rename = "eventTypeCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_type_code: Option<String>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<f64>,
#[serde(rename = "region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "service")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
#[serde(rename = "startTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<f64>,
#[serde(rename = "statusCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_code: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct OrganizationEventDetails {
#[serde(rename = "awsAccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_account_id: Option<String>,
#[serde(rename = "event")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event: Option<Event>,
#[serde(rename = "eventDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_description: Option<String>,
#[serde(rename = "eventMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_metadata: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct OrganizationEventDetailsErrorItem {
#[serde(rename = "awsAccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_account_id: Option<String>,
#[serde(rename = "errorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
#[serde(rename = "errorName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_name: Option<String>,
#[serde(rename = "eventArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct OrganizationEventFilter {
#[serde(rename = "awsAccountIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_account_ids: Option<Vec<String>>,
#[serde(rename = "endTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<DateTimeRange>,
#[serde(rename = "entityArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_arns: Option<Vec<String>>,
#[serde(rename = "entityValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub entity_values: Option<Vec<String>>,
#[serde(rename = "eventStatusCodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_status_codes: Option<Vec<String>>,
#[serde(rename = "eventTypeCategories")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_type_categories: Option<Vec<String>>,
#[serde(rename = "eventTypeCodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_type_codes: Option<Vec<String>>,
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<DateTimeRange>,
#[serde(rename = "regions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub regions: Option<Vec<String>>,
#[serde(rename = "services")]
#[serde(skip_serializing_if = "Option::is_none")]
pub services: Option<Vec<String>>,
#[serde(rename = "startTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<DateTimeRange>,
}
#[derive(Debug, PartialEq)]
pub enum DescribeAffectedAccountsForOrganizationError {
InvalidPaginationToken(String),
}
impl DescribeAffectedAccountsForOrganizationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeAffectedAccountsForOrganizationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidPaginationToken" => {
return RusotoError::Service(
DescribeAffectedAccountsForOrganizationError::InvalidPaginationToken(
err.msg,
),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeAffectedAccountsForOrganizationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeAffectedAccountsForOrganizationError::InvalidPaginationToken(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeAffectedAccountsForOrganizationError {}
#[derive(Debug, PartialEq)]
pub enum DescribeAffectedEntitiesError {
InvalidPaginationToken(String),
UnsupportedLocale(String),
}
impl DescribeAffectedEntitiesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAffectedEntitiesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidPaginationToken" => {
return RusotoError::Service(
DescribeAffectedEntitiesError::InvalidPaginationToken(err.msg),
)
}
"UnsupportedLocale" => {
return RusotoError::Service(DescribeAffectedEntitiesError::UnsupportedLocale(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeAffectedEntitiesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeAffectedEntitiesError::InvalidPaginationToken(ref cause) => {
write!(f, "{}", cause)
}
DescribeAffectedEntitiesError::UnsupportedLocale(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeAffectedEntitiesError {}
#[derive(Debug, PartialEq)]
pub enum DescribeAffectedEntitiesForOrganizationError {
InvalidPaginationToken(String),
UnsupportedLocale(String),
}
impl DescribeAffectedEntitiesForOrganizationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeAffectedEntitiesForOrganizationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidPaginationToken" => {
return RusotoError::Service(
DescribeAffectedEntitiesForOrganizationError::InvalidPaginationToken(
err.msg,
),
)
}
"UnsupportedLocale" => {
return RusotoError::Service(
DescribeAffectedEntitiesForOrganizationError::UnsupportedLocale(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeAffectedEntitiesForOrganizationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeAffectedEntitiesForOrganizationError::InvalidPaginationToken(ref cause) => {
write!(f, "{}", cause)
}
DescribeAffectedEntitiesForOrganizationError::UnsupportedLocale(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeAffectedEntitiesForOrganizationError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEntityAggregatesError {}
impl DescribeEntityAggregatesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEntityAggregatesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEntityAggregatesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {}
}
}
impl Error for DescribeEntityAggregatesError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEventAggregatesError {
InvalidPaginationToken(String),
}
impl DescribeEventAggregatesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEventAggregatesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidPaginationToken" => {
return RusotoError::Service(
DescribeEventAggregatesError::InvalidPaginationToken(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEventAggregatesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEventAggregatesError::InvalidPaginationToken(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeEventAggregatesError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEventDetailsError {
UnsupportedLocale(String),
}
impl DescribeEventDetailsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEventDetailsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"UnsupportedLocale" => {
return RusotoError::Service(DescribeEventDetailsError::UnsupportedLocale(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEventDetailsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEventDetailsError::UnsupportedLocale(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeEventDetailsError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEventDetailsForOrganizationError {
UnsupportedLocale(String),
}
impl DescribeEventDetailsForOrganizationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeEventDetailsForOrganizationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"UnsupportedLocale" => {
return RusotoError::Service(
DescribeEventDetailsForOrganizationError::UnsupportedLocale(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEventDetailsForOrganizationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEventDetailsForOrganizationError::UnsupportedLocale(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeEventDetailsForOrganizationError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEventTypesError {
InvalidPaginationToken(String),
UnsupportedLocale(String),
}
impl DescribeEventTypesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEventTypesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidPaginationToken" => {
return RusotoError::Service(DescribeEventTypesError::InvalidPaginationToken(
err.msg,
))
}
"UnsupportedLocale" => {
return RusotoError::Service(DescribeEventTypesError::UnsupportedLocale(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEventTypesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEventTypesError::InvalidPaginationToken(ref cause) => write!(f, "{}", cause),
DescribeEventTypesError::UnsupportedLocale(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeEventTypesError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEventsError {
InvalidPaginationToken(String),
UnsupportedLocale(String),
}
impl DescribeEventsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEventsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidPaginationToken" => {
return RusotoError::Service(DescribeEventsError::InvalidPaginationToken(
err.msg,
))
}
"UnsupportedLocale" => {
return RusotoError::Service(DescribeEventsError::UnsupportedLocale(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEventsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEventsError::InvalidPaginationToken(ref cause) => write!(f, "{}", cause),
DescribeEventsError::UnsupportedLocale(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeEventsError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEventsForOrganizationError {
InvalidPaginationToken(String),
UnsupportedLocale(String),
}
impl DescribeEventsForOrganizationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeEventsForOrganizationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidPaginationToken" => {
return RusotoError::Service(
DescribeEventsForOrganizationError::InvalidPaginationToken(err.msg),
)
}
"UnsupportedLocale" => {
return RusotoError::Service(
DescribeEventsForOrganizationError::UnsupportedLocale(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEventsForOrganizationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEventsForOrganizationError::InvalidPaginationToken(ref cause) => {
write!(f, "{}", cause)
}
DescribeEventsForOrganizationError::UnsupportedLocale(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeEventsForOrganizationError {}
#[derive(Debug, PartialEq)]
pub enum DescribeHealthServiceStatusForOrganizationError {}
impl DescribeHealthServiceStatusForOrganizationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeHealthServiceStatusForOrganizationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeHealthServiceStatusForOrganizationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {}
}
}
impl Error for DescribeHealthServiceStatusForOrganizationError {}
#[derive(Debug, PartialEq)]
pub enum DisableHealthServiceAccessForOrganizationError {
ConcurrentModification(String),
}
impl DisableHealthServiceAccessForOrganizationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DisableHealthServiceAccessForOrganizationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(
DisableHealthServiceAccessForOrganizationError::ConcurrentModification(
err.msg,
),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DisableHealthServiceAccessForOrganizationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DisableHealthServiceAccessForOrganizationError::ConcurrentModification(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DisableHealthServiceAccessForOrganizationError {}
#[derive(Debug, PartialEq)]
pub enum EnableHealthServiceAccessForOrganizationError {
ConcurrentModification(String),
}
impl EnableHealthServiceAccessForOrganizationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<EnableHealthServiceAccessForOrganizationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(
EnableHealthServiceAccessForOrganizationError::ConcurrentModification(
err.msg,
),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for EnableHealthServiceAccessForOrganizationError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
EnableHealthServiceAccessForOrganizationError::ConcurrentModification(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for EnableHealthServiceAccessForOrganizationError {}
#[async_trait]
pub trait AWSHealth {
async fn describe_affected_accounts_for_organization(
&self,
input: DescribeAffectedAccountsForOrganizationRequest,
) -> Result<
DescribeAffectedAccountsForOrganizationResponse,
RusotoError<DescribeAffectedAccountsForOrganizationError>,
>;
async fn describe_affected_entities(
&self,
input: DescribeAffectedEntitiesRequest,
) -> Result<DescribeAffectedEntitiesResponse, RusotoError<DescribeAffectedEntitiesError>>;
async fn describe_affected_entities_for_organization(
&self,
input: DescribeAffectedEntitiesForOrganizationRequest,
) -> Result<
DescribeAffectedEntitiesForOrganizationResponse,
RusotoError<DescribeAffectedEntitiesForOrganizationError>,
>;
async fn describe_entity_aggregates(
&self,
input: DescribeEntityAggregatesRequest,
) -> Result<DescribeEntityAggregatesResponse, RusotoError<DescribeEntityAggregatesError>>;
async fn describe_event_aggregates(
&self,
input: DescribeEventAggregatesRequest,
) -> Result<DescribeEventAggregatesResponse, RusotoError<DescribeEventAggregatesError>>;
async fn describe_event_details(
&self,
input: DescribeEventDetailsRequest,
) -> Result<DescribeEventDetailsResponse, RusotoError<DescribeEventDetailsError>>;
async fn describe_event_details_for_organization(
&self,
input: DescribeEventDetailsForOrganizationRequest,
) -> Result<
DescribeEventDetailsForOrganizationResponse,
RusotoError<DescribeEventDetailsForOrganizationError>,
>;
async fn describe_event_types(
&self,
input: DescribeEventTypesRequest,
) -> Result<DescribeEventTypesResponse, RusotoError<DescribeEventTypesError>>;
async fn describe_events(
&self,
input: DescribeEventsRequest,
) -> Result<DescribeEventsResponse, RusotoError<DescribeEventsError>>;
async fn describe_events_for_organization(
&self,
input: DescribeEventsForOrganizationRequest,
) -> Result<
DescribeEventsForOrganizationResponse,
RusotoError<DescribeEventsForOrganizationError>,
>;
async fn describe_health_service_status_for_organization(
&self,
) -> Result<
DescribeHealthServiceStatusForOrganizationResponse,
RusotoError<DescribeHealthServiceStatusForOrganizationError>,
>;
async fn disable_health_service_access_for_organization(
&self,
) -> Result<(), RusotoError<DisableHealthServiceAccessForOrganizationError>>;
async fn enable_health_service_access_for_organization(
&self,
) -> Result<(), RusotoError<EnableHealthServiceAccessForOrganizationError>>;
}
#[derive(Clone)]
pub struct AWSHealthClient {
client: Client,
region: region::Region,
}
impl AWSHealthClient {
pub fn new(region: region::Region) -> AWSHealthClient {
AWSHealthClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> AWSHealthClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
AWSHealthClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> AWSHealthClient {
AWSHealthClient { client, region }
}
}
#[async_trait]
impl AWSHealth for AWSHealthClient {
async fn describe_affected_accounts_for_organization(
&self,
input: DescribeAffectedAccountsForOrganizationRequest,
) -> Result<
DescribeAffectedAccountsForOrganizationResponse,
RusotoError<DescribeAffectedAccountsForOrganizationError>,
> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSHealth_20160804.DescribeAffectedAccountsForOrganization",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeAffectedAccountsForOrganizationResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeAffectedAccountsForOrganizationError::from_response(
response,
))
}
}
async fn describe_affected_entities(
&self,
input: DescribeAffectedEntitiesRequest,
) -> Result<DescribeAffectedEntitiesResponse, RusotoError<DescribeAffectedEntitiesError>> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSHealth_20160804.DescribeAffectedEntities",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeAffectedEntitiesResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeAffectedEntitiesError::from_response(response))
}
}
async fn describe_affected_entities_for_organization(
&self,
input: DescribeAffectedEntitiesForOrganizationRequest,
) -> Result<
DescribeAffectedEntitiesForOrganizationResponse,
RusotoError<DescribeAffectedEntitiesForOrganizationError>,
> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSHealth_20160804.DescribeAffectedEntitiesForOrganization",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeAffectedEntitiesForOrganizationResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeAffectedEntitiesForOrganizationError::from_response(
response,
))
}
}
async fn describe_entity_aggregates(
&self,
input: DescribeEntityAggregatesRequest,
) -> Result<DescribeEntityAggregatesResponse, RusotoError<DescribeEntityAggregatesError>> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSHealth_20160804.DescribeEntityAggregates",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEntityAggregatesResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeEntityAggregatesError::from_response(response))
}
}
async fn describe_event_aggregates(
&self,
input: DescribeEventAggregatesRequest,
) -> Result<DescribeEventAggregatesResponse, RusotoError<DescribeEventAggregatesError>> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSHealth_20160804.DescribeEventAggregates");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEventAggregatesResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeEventAggregatesError::from_response(response))
}
}
async fn describe_event_details(
&self,
input: DescribeEventDetailsRequest,
) -> Result<DescribeEventDetailsResponse, RusotoError<DescribeEventDetailsError>> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSHealth_20160804.DescribeEventDetails");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEventDetailsResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeEventDetailsError::from_response(response))
}
}
async fn describe_event_details_for_organization(
&self,
input: DescribeEventDetailsForOrganizationRequest,
) -> Result<
DescribeEventDetailsForOrganizationResponse,
RusotoError<DescribeEventDetailsForOrganizationError>,
> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSHealth_20160804.DescribeEventDetailsForOrganization",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEventDetailsForOrganizationResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeEventDetailsForOrganizationError::from_response(
response,
))
}
}
async fn describe_event_types(
&self,
input: DescribeEventTypesRequest,
) -> Result<DescribeEventTypesResponse, RusotoError<DescribeEventTypesError>> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSHealth_20160804.DescribeEventTypes");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEventTypesResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeEventTypesError::from_response(response))
}
}
async fn describe_events(
&self,
input: DescribeEventsRequest,
) -> Result<DescribeEventsResponse, RusotoError<DescribeEventsError>> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AWSHealth_20160804.DescribeEvents");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeEventsResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeEventsError::from_response(response))
}
}
async fn describe_events_for_organization(
&self,
input: DescribeEventsForOrganizationRequest,
) -> Result<
DescribeEventsForOrganizationResponse,
RusotoError<DescribeEventsForOrganizationError>,
> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSHealth_20160804.DescribeEventsForOrganization",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEventsForOrganizationResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeEventsForOrganizationError::from_response(response))
}
}
async fn describe_health_service_status_for_organization(
&self,
) -> Result<
DescribeHealthServiceStatusForOrganizationResponse,
RusotoError<DescribeHealthServiceStatusForOrganizationError>,
> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSHealth_20160804.DescribeHealthServiceStatusForOrganization",
);
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeHealthServiceStatusForOrganizationResponse, _>()
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DescribeHealthServiceStatusForOrganizationError::from_response(response))
}
}
async fn disable_health_service_access_for_organization(
&self,
) -> Result<(), RusotoError<DisableHealthServiceAccessForOrganizationError>> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSHealth_20160804.DisableHealthServiceAccessForOrganization",
);
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
std::mem::drop(response);
Ok(())
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(DisableHealthServiceAccessForOrganizationError::from_response(response))
}
}
async fn enable_health_service_access_for_organization(
&self,
) -> Result<(), RusotoError<EnableHealthServiceAccessForOrganizationError>> {
let mut request = SignedRequest::new("POST", "health", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"AWSHealth_20160804.EnableHealthServiceAccessForOrganization",
);
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let mut response = self
.client
.sign_and_dispatch(request)
.await
.map_err(RusotoError::from)?;
if response.status.is_success() {
std::mem::drop(response);
Ok(())
} else {
let try_response = response.buffer().await;
let response = try_response.map_err(RusotoError::HttpDispatch)?;
Err(EnableHealthServiceAccessForOrganizationError::from_response(response))
}
}
}