use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AcceptInvitationRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "InvitationId")]
pub invitation_id: String,
#[serde(rename = "MasterId")]
pub master_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AcceptInvitationResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AccessKeyDetails {
#[serde(rename = "AccessKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_key_id: Option<String>,
#[serde(rename = "PrincipalId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub principal_id: Option<String>,
#[serde(rename = "UserName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_name: Option<String>,
#[serde(rename = "UserType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AccountDetail {
#[serde(rename = "AccountId")]
pub account_id: String,
#[serde(rename = "Email")]
pub email: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Action {
#[serde(rename = "ActionType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action_type: Option<String>,
#[serde(rename = "AwsApiCallAction")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_api_call_action: Option<AwsApiCallAction>,
#[serde(rename = "DnsRequestAction")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dns_request_action: Option<DnsRequestAction>,
#[serde(rename = "NetworkConnectionAction")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_connection_action: Option<NetworkConnectionAction>,
#[serde(rename = "PortProbeAction")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port_probe_action: Option<PortProbeAction>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ArchiveFindingsRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "FindingIds")]
pub finding_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ArchiveFindingsResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AwsApiCallAction {
#[serde(rename = "Api")]
#[serde(skip_serializing_if = "Option::is_none")]
pub api: Option<String>,
#[serde(rename = "CallerType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub caller_type: Option<String>,
#[serde(rename = "DomainDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain_details: Option<DomainDetails>,
#[serde(rename = "RemoteIpDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_ip_details: Option<RemoteIpDetails>,
#[serde(rename = "ServiceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct City {
#[serde(rename = "CityName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub city_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Condition {
#[serde(rename = "Equals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub equals: Option<Vec<String>>,
#[serde(rename = "GreaterThan")]
#[serde(skip_serializing_if = "Option::is_none")]
pub greater_than: Option<i64>,
#[serde(rename = "GreaterThanOrEqual")]
#[serde(skip_serializing_if = "Option::is_none")]
pub greater_than_or_equal: Option<i64>,
#[serde(rename = "LessThan")]
#[serde(skip_serializing_if = "Option::is_none")]
pub less_than: Option<i64>,
#[serde(rename = "LessThanOrEqual")]
#[serde(skip_serializing_if = "Option::is_none")]
pub less_than_or_equal: Option<i64>,
#[serde(rename = "NotEquals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub not_equals: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Country {
#[serde(rename = "CountryCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub country_code: Option<String>,
#[serde(rename = "CountryName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub country_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateDetectorRequest {
#[serde(rename = "ClientToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_token: Option<String>,
#[serde(rename = "Enable")]
pub enable: bool,
#[serde(rename = "FindingPublishingFrequency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finding_publishing_frequency: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateDetectorResponse {
#[serde(rename = "DetectorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateFilterRequest {
#[serde(rename = "Action")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action: Option<String>,
#[serde(rename = "ClientToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_token: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "FindingCriteria")]
pub finding_criteria: FindingCriteria,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Rank")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rank: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateFilterResponse {
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateIPSetRequest {
#[serde(rename = "Activate")]
pub activate: bool,
#[serde(rename = "ClientToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_token: Option<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "Format")]
pub format: String,
#[serde(rename = "Location")]
pub location: String,
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateIPSetResponse {
#[serde(rename = "IpSetId")]
pub ip_set_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateMembersRequest {
#[serde(rename = "AccountDetails")]
pub account_details: Vec<AccountDetail>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateMembersResponse {
#[serde(rename = "UnprocessedAccounts")]
pub unprocessed_accounts: Vec<UnprocessedAccount>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateSampleFindingsRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "FindingTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finding_types: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateSampleFindingsResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateThreatIntelSetRequest {
#[serde(rename = "Activate")]
pub activate: bool,
#[serde(rename = "ClientToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_token: Option<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "Format")]
pub format: String,
#[serde(rename = "Location")]
pub location: String,
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateThreatIntelSetResponse {
#[serde(rename = "ThreatIntelSetId")]
pub threat_intel_set_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeclineInvitationsRequest {
#[serde(rename = "AccountIds")]
pub account_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeclineInvitationsResponse {
#[serde(rename = "UnprocessedAccounts")]
pub unprocessed_accounts: Vec<UnprocessedAccount>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDetectorRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteDetectorResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteFilterRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "FilterName")]
pub filter_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteFilterResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteIPSetRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "IpSetId")]
pub ip_set_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteIPSetResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteInvitationsRequest {
#[serde(rename = "AccountIds")]
pub account_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteInvitationsResponse {
#[serde(rename = "UnprocessedAccounts")]
pub unprocessed_accounts: Vec<UnprocessedAccount>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteMembersRequest {
#[serde(rename = "AccountIds")]
pub account_ids: Vec<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteMembersResponse {
#[serde(rename = "UnprocessedAccounts")]
pub unprocessed_accounts: Vec<UnprocessedAccount>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteThreatIntelSetRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "ThreatIntelSetId")]
pub threat_intel_set_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteThreatIntelSetResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateFromMasterAccountRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociateFromMasterAccountResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateMembersRequest {
#[serde(rename = "AccountIds")]
pub account_ids: Vec<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociateMembersResponse {
#[serde(rename = "UnprocessedAccounts")]
pub unprocessed_accounts: Vec<UnprocessedAccount>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DnsRequestAction {
#[serde(rename = "Domain")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DomainDetails {
#[serde(rename = "Domain")]
#[serde(skip_serializing_if = "Option::is_none")]
pub domain: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Finding {
#[serde(rename = "AccountId")]
pub account_id: String,
#[serde(rename = "Arn")]
pub arn: String,
#[serde(rename = "Confidence")]
#[serde(skip_serializing_if = "Option::is_none")]
pub confidence: Option<f64>,
#[serde(rename = "CreatedAt")]
pub created_at: String,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "Partition")]
#[serde(skip_serializing_if = "Option::is_none")]
pub partition: Option<String>,
#[serde(rename = "Region")]
pub region: String,
#[serde(rename = "Resource")]
pub resource: Resource,
#[serde(rename = "SchemaVersion")]
pub schema_version: String,
#[serde(rename = "Service")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service: Option<Service>,
#[serde(rename = "Severity")]
pub severity: f64,
#[serde(rename = "Title")]
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(rename = "Type")]
pub type_: String,
#[serde(rename = "UpdatedAt")]
pub updated_at: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct FindingCriteria {
#[serde(rename = "Criterion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub criterion: Option<::std::collections::HashMap<String, Condition>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FindingStatistics {
#[serde(rename = "CountBySeverity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub count_by_severity: Option<::std::collections::HashMap<String, i64>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GeoLocation {
#[serde(rename = "Lat")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lat: Option<f64>,
#[serde(rename = "Lon")]
#[serde(skip_serializing_if = "Option::is_none")]
pub lon: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDetectorRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDetectorResponse {
#[serde(rename = "CreatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<String>,
#[serde(rename = "FindingPublishingFrequency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finding_publishing_frequency: Option<String>,
#[serde(rename = "ServiceRole")]
pub service_role: String,
#[serde(rename = "Status")]
pub status: String,
#[serde(rename = "UpdatedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub updated_at: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetFilterRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "FilterName")]
pub filter_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetFilterResponse {
#[serde(rename = "Action")]
pub action: String,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "FindingCriteria")]
pub finding_criteria: FindingCriteria,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Rank")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rank: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetFindingsRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "FindingIds")]
pub finding_ids: Vec<String>,
#[serde(rename = "SortCriteria")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_criteria: Option<SortCriteria>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetFindingsResponse {
#[serde(rename = "Findings")]
pub findings: Vec<Finding>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetFindingsStatisticsRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "FindingCriteria")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finding_criteria: Option<FindingCriteria>,
#[serde(rename = "FindingStatisticTypes")]
pub finding_statistic_types: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetFindingsStatisticsResponse {
#[serde(rename = "FindingStatistics")]
pub finding_statistics: FindingStatistics,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetIPSetRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "IpSetId")]
pub ip_set_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetIPSetResponse {
#[serde(rename = "Format")]
pub format: String,
#[serde(rename = "Location")]
pub location: String,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Status")]
pub status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetInvitationsCountRequest {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetInvitationsCountResponse {
#[serde(rename = "InvitationsCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invitations_count: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetMasterAccountRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetMasterAccountResponse {
#[serde(rename = "Master")]
pub master: Master,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetMembersRequest {
#[serde(rename = "AccountIds")]
pub account_ids: Vec<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetMembersResponse {
#[serde(rename = "Members")]
pub members: Vec<Member>,
#[serde(rename = "UnprocessedAccounts")]
pub unprocessed_accounts: Vec<UnprocessedAccount>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetThreatIntelSetRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "ThreatIntelSetId")]
pub threat_intel_set_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetThreatIntelSetResponse {
#[serde(rename = "Format")]
pub format: String,
#[serde(rename = "Location")]
pub location: String,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Status")]
pub status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct IamInstanceProfile {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InstanceDetails {
#[serde(rename = "AvailabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zone: Option<String>,
#[serde(rename = "IamInstanceProfile")]
#[serde(skip_serializing_if = "Option::is_none")]
pub iam_instance_profile: Option<IamInstanceProfile>,
#[serde(rename = "ImageDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_description: Option<String>,
#[serde(rename = "ImageId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub image_id: Option<String>,
#[serde(rename = "InstanceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_id: Option<String>,
#[serde(rename = "InstanceState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_state: Option<String>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "LaunchTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub launch_time: Option<String>,
#[serde(rename = "NetworkInterfaces")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_interfaces: Option<Vec<NetworkInterface>>,
#[serde(rename = "Platform")]
#[serde(skip_serializing_if = "Option::is_none")]
pub platform: Option<String>,
#[serde(rename = "ProductCodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_codes: Option<Vec<ProductCode>>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Invitation {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "InvitationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invitation_id: Option<String>,
#[serde(rename = "InvitedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invited_at: Option<String>,
#[serde(rename = "RelationshipStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relationship_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InviteMembersRequest {
#[serde(rename = "AccountIds")]
pub account_ids: Vec<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "DisableEmailNotification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disable_email_notification: Option<bool>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InviteMembersResponse {
#[serde(rename = "UnprocessedAccounts")]
pub unprocessed_accounts: Vec<UnprocessedAccount>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListDetectorsRequest {
#[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(test, derive(Serialize))]
pub struct ListDetectorsResponse {
#[serde(rename = "DetectorIds")]
pub detector_ids: Vec<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListFiltersRequest {
#[serde(rename = "DetectorId")]
pub detector_id: 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(test, derive(Serialize))]
pub struct ListFiltersResponse {
#[serde(rename = "FilterNames")]
pub filter_names: Vec<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListFindingsRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "FindingCriteria")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finding_criteria: Option<FindingCriteria>,
#[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 = "SortCriteria")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort_criteria: Option<SortCriteria>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListFindingsResponse {
#[serde(rename = "FindingIds")]
pub finding_ids: Vec<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListIPSetsRequest {
#[serde(rename = "DetectorId")]
pub detector_id: 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(test, derive(Serialize))]
pub struct ListIPSetsResponse {
#[serde(rename = "IpSetIds")]
pub ip_set_ids: Vec<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListInvitationsRequest {
#[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(test, derive(Serialize))]
pub struct ListInvitationsResponse {
#[serde(rename = "Invitations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invitations: Option<Vec<Invitation>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListMembersRequest {
#[serde(rename = "DetectorId")]
pub detector_id: 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 = "OnlyAssociated")]
#[serde(skip_serializing_if = "Option::is_none")]
pub only_associated: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListMembersResponse {
#[serde(rename = "Members")]
#[serde(skip_serializing_if = "Option::is_none")]
pub members: Option<Vec<Member>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListThreatIntelSetsRequest {
#[serde(rename = "DetectorId")]
pub detector_id: 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(test, derive(Serialize))]
pub struct ListThreatIntelSetsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ThreatIntelSetIds")]
pub threat_intel_set_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LocalPortDetails {
#[serde(rename = "Port")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port: Option<i64>,
#[serde(rename = "PortName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Master {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "InvitationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invitation_id: Option<String>,
#[serde(rename = "InvitedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invited_at: Option<String>,
#[serde(rename = "RelationshipStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relationship_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Member {
#[serde(rename = "AccountId")]
pub account_id: String,
#[serde(rename = "DetectorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_id: Option<String>,
#[serde(rename = "Email")]
pub email: String,
#[serde(rename = "InvitedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invited_at: Option<String>,
#[serde(rename = "MasterId")]
pub master_id: String,
#[serde(rename = "RelationshipStatus")]
pub relationship_status: String,
#[serde(rename = "UpdatedAt")]
pub updated_at: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NetworkConnectionAction {
#[serde(rename = "Blocked")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked: Option<bool>,
#[serde(rename = "ConnectionDirection")]
#[serde(skip_serializing_if = "Option::is_none")]
pub connection_direction: Option<String>,
#[serde(rename = "LocalPortDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub local_port_details: Option<LocalPortDetails>,
#[serde(rename = "Protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
#[serde(rename = "RemoteIpDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_ip_details: Option<RemoteIpDetails>,
#[serde(rename = "RemotePortDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_port_details: Option<RemotePortDetails>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NetworkInterface {
#[serde(rename = "Ipv6Addresses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv_6_addresses: Option<Vec<String>>,
#[serde(rename = "NetworkInterfaceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_interface_id: Option<String>,
#[serde(rename = "PrivateDnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_dns_name: Option<String>,
#[serde(rename = "PrivateIpAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_ip_address: Option<String>,
#[serde(rename = "PrivateIpAddresses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_ip_addresses: Option<Vec<PrivateIpAddressDetails>>,
#[serde(rename = "PublicDnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub public_dns_name: Option<String>,
#[serde(rename = "PublicIp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub public_ip: Option<String>,
#[serde(rename = "SecurityGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_groups: Option<Vec<SecurityGroup>>,
#[serde(rename = "SubnetId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_id: Option<String>,
#[serde(rename = "VpcId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Organization {
#[serde(rename = "Asn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asn: Option<String>,
#[serde(rename = "AsnOrg")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asn_org: Option<String>,
#[serde(rename = "Isp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub isp: Option<String>,
#[serde(rename = "Org")]
#[serde(skip_serializing_if = "Option::is_none")]
pub org: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PortProbeAction {
#[serde(rename = "Blocked")]
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked: Option<bool>,
#[serde(rename = "PortProbeDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port_probe_details: Option<Vec<PortProbeDetail>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PortProbeDetail {
#[serde(rename = "LocalPortDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub local_port_details: Option<LocalPortDetails>,
#[serde(rename = "RemoteIpDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub remote_ip_details: Option<RemoteIpDetails>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PrivateIpAddressDetails {
#[serde(rename = "PrivateDnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_dns_name: Option<String>,
#[serde(rename = "PrivateIpAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub private_ip_address: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ProductCode {
#[serde(rename = "Code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "ProductType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub product_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RemoteIpDetails {
#[serde(rename = "City")]
#[serde(skip_serializing_if = "Option::is_none")]
pub city: Option<City>,
#[serde(rename = "Country")]
#[serde(skip_serializing_if = "Option::is_none")]
pub country: Option<Country>,
#[serde(rename = "GeoLocation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub geo_location: Option<GeoLocation>,
#[serde(rename = "IpAddressV4")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address_v4: Option<String>,
#[serde(rename = "Organization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization: Option<Organization>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RemotePortDetails {
#[serde(rename = "Port")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port: Option<i64>,
#[serde(rename = "PortName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Resource {
#[serde(rename = "AccessKeyDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_key_details: Option<AccessKeyDetails>,
#[serde(rename = "InstanceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_details: Option<InstanceDetails>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SecurityGroup {
#[serde(rename = "GroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_id: Option<String>,
#[serde(rename = "GroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Service {
#[serde(rename = "Action")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action: Option<Action>,
#[serde(rename = "Archived")]
#[serde(skip_serializing_if = "Option::is_none")]
pub archived: Option<bool>,
#[serde(rename = "Count")]
#[serde(skip_serializing_if = "Option::is_none")]
pub count: Option<i64>,
#[serde(rename = "DetectorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub detector_id: Option<String>,
#[serde(rename = "EventFirstSeen")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_first_seen: Option<String>,
#[serde(rename = "EventLastSeen")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_last_seen: Option<String>,
#[serde(rename = "ResourceRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_role: Option<String>,
#[serde(rename = "ServiceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_name: Option<String>,
#[serde(rename = "UserFeedback")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_feedback: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SortCriteria {
#[serde(rename = "AttributeName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attribute_name: Option<String>,
#[serde(rename = "OrderBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub order_by: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartMonitoringMembersRequest {
#[serde(rename = "AccountIds")]
pub account_ids: Vec<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartMonitoringMembersResponse {
#[serde(rename = "UnprocessedAccounts")]
pub unprocessed_accounts: Vec<UnprocessedAccount>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopMonitoringMembersRequest {
#[serde(rename = "AccountIds")]
pub account_ids: Vec<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopMonitoringMembersResponse {
#[serde(rename = "UnprocessedAccounts")]
pub unprocessed_accounts: Vec<UnprocessedAccount>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Tag {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UnarchiveFindingsRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "FindingIds")]
pub finding_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UnarchiveFindingsResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UnprocessedAccount {
#[serde(rename = "AccountId")]
pub account_id: String,
#[serde(rename = "Result")]
pub result: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateDetectorRequest {
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "Enable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enable: Option<bool>,
#[serde(rename = "FindingPublishingFrequency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finding_publishing_frequency: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateDetectorResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateFilterRequest {
#[serde(rename = "Action")]
#[serde(skip_serializing_if = "Option::is_none")]
pub action: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "FilterName")]
pub filter_name: String,
#[serde(rename = "FindingCriteria")]
#[serde(skip_serializing_if = "Option::is_none")]
pub finding_criteria: Option<FindingCriteria>,
#[serde(rename = "Rank")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rank: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateFilterResponse {
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateFindingsFeedbackRequest {
#[serde(rename = "Comments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comments: Option<String>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "Feedback")]
pub feedback: String,
#[serde(rename = "FindingIds")]
pub finding_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateFindingsFeedbackResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateIPSetRequest {
#[serde(rename = "Activate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub activate: Option<bool>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "IpSetId")]
pub ip_set_id: String,
#[serde(rename = "Location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateIPSetResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateThreatIntelSetRequest {
#[serde(rename = "Activate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub activate: Option<bool>,
#[serde(rename = "DetectorId")]
pub detector_id: String,
#[serde(rename = "Location")]
#[serde(skip_serializing_if = "Option::is_none")]
pub location: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ThreatIntelSetId")]
pub threat_intel_set_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateThreatIntelSetResponse {}
#[derive(Debug, PartialEq)]
pub enum AcceptInvitationError {
BadRequest(String),
InternalServerError(String),
}
impl AcceptInvitationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AcceptInvitationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(AcceptInvitationError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(AcceptInvitationError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AcceptInvitationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AcceptInvitationError {
fn description(&self) -> &str {
match *self {
AcceptInvitationError::BadRequest(ref cause) => cause,
AcceptInvitationError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ArchiveFindingsError {
BadRequest(String),
InternalServerError(String),
}
impl ArchiveFindingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ArchiveFindingsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ArchiveFindingsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ArchiveFindingsError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ArchiveFindingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ArchiveFindingsError {
fn description(&self) -> &str {
match *self {
ArchiveFindingsError::BadRequest(ref cause) => cause,
ArchiveFindingsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateDetectorError {
BadRequest(String),
InternalServerError(String),
}
impl CreateDetectorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateDetectorError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateDetectorError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateDetectorError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateDetectorError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateDetectorError {
fn description(&self) -> &str {
match *self {
CreateDetectorError::BadRequest(ref cause) => cause,
CreateDetectorError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateFilterError {
BadRequest(String),
InternalServerError(String),
}
impl CreateFilterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateFilterError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateFilterError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateFilterError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateFilterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateFilterError {
fn description(&self) -> &str {
match *self {
CreateFilterError::BadRequest(ref cause) => cause,
CreateFilterError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateIPSetError {
BadRequest(String),
InternalServerError(String),
}
impl CreateIPSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateIPSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateIPSetError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateIPSetError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateIPSetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateIPSetError {
fn description(&self) -> &str {
match *self {
CreateIPSetError::BadRequest(ref cause) => cause,
CreateIPSetError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateMembersError {
BadRequest(String),
InternalServerError(String),
}
impl CreateMembersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateMembersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateMembersError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateMembersError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateMembersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateMembersError {
fn description(&self) -> &str {
match *self {
CreateMembersError::BadRequest(ref cause) => cause,
CreateMembersError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateSampleFindingsError {
BadRequest(String),
InternalServerError(String),
}
impl CreateSampleFindingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateSampleFindingsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateSampleFindingsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateSampleFindingsError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateSampleFindingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateSampleFindingsError {
fn description(&self) -> &str {
match *self {
CreateSampleFindingsError::BadRequest(ref cause) => cause,
CreateSampleFindingsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateThreatIntelSetError {
BadRequest(String),
InternalServerError(String),
}
impl CreateThreatIntelSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateThreatIntelSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateThreatIntelSetError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateThreatIntelSetError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateThreatIntelSetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateThreatIntelSetError {
fn description(&self) -> &str {
match *self {
CreateThreatIntelSetError::BadRequest(ref cause) => cause,
CreateThreatIntelSetError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeclineInvitationsError {
BadRequest(String),
InternalServerError(String),
}
impl DeclineInvitationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeclineInvitationsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeclineInvitationsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeclineInvitationsError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeclineInvitationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeclineInvitationsError {
fn description(&self) -> &str {
match *self {
DeclineInvitationsError::BadRequest(ref cause) => cause,
DeclineInvitationsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDetectorError {
BadRequest(String),
InternalServerError(String),
}
impl DeleteDetectorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDetectorError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteDetectorError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteDetectorError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteDetectorError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDetectorError {
fn description(&self) -> &str {
match *self {
DeleteDetectorError::BadRequest(ref cause) => cause,
DeleteDetectorError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteFilterError {
BadRequest(String),
InternalServerError(String),
}
impl DeleteFilterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteFilterError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteFilterError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteFilterError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteFilterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteFilterError {
fn description(&self) -> &str {
match *self {
DeleteFilterError::BadRequest(ref cause) => cause,
DeleteFilterError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteIPSetError {
BadRequest(String),
InternalServerError(String),
}
impl DeleteIPSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteIPSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteIPSetError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteIPSetError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteIPSetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteIPSetError {
fn description(&self) -> &str {
match *self {
DeleteIPSetError::BadRequest(ref cause) => cause,
DeleteIPSetError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteInvitationsError {
BadRequest(String),
InternalServerError(String),
}
impl DeleteInvitationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteInvitationsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteInvitationsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteInvitationsError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteInvitationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteInvitationsError {
fn description(&self) -> &str {
match *self {
DeleteInvitationsError::BadRequest(ref cause) => cause,
DeleteInvitationsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteMembersError {
BadRequest(String),
InternalServerError(String),
}
impl DeleteMembersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteMembersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteMembersError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteMembersError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteMembersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteMembersError {
fn description(&self) -> &str {
match *self {
DeleteMembersError::BadRequest(ref cause) => cause,
DeleteMembersError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteThreatIntelSetError {
BadRequest(String),
InternalServerError(String),
}
impl DeleteThreatIntelSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteThreatIntelSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteThreatIntelSetError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteThreatIntelSetError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteThreatIntelSetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteThreatIntelSetError {
fn description(&self) -> &str {
match *self {
DeleteThreatIntelSetError::BadRequest(ref cause) => cause,
DeleteThreatIntelSetError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateFromMasterAccountError {
BadRequest(String),
InternalServerError(String),
}
impl DisassociateFromMasterAccountError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DisassociateFromMasterAccountError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DisassociateFromMasterAccountError::BadRequest(
err.msg,
))
}
"InternalServerErrorException" => {
return RusotoError::Service(
DisassociateFromMasterAccountError::InternalServerError(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DisassociateFromMasterAccountError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateFromMasterAccountError {
fn description(&self) -> &str {
match *self {
DisassociateFromMasterAccountError::BadRequest(ref cause) => cause,
DisassociateFromMasterAccountError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateMembersError {
BadRequest(String),
InternalServerError(String),
}
impl DisassociateMembersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DisassociateMembersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DisassociateMembersError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DisassociateMembersError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DisassociateMembersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateMembersError {
fn description(&self) -> &str {
match *self {
DisassociateMembersError::BadRequest(ref cause) => cause,
DisassociateMembersError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDetectorError {
BadRequest(String),
InternalServerError(String),
}
impl GetDetectorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDetectorError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetDetectorError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetDetectorError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetDetectorError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDetectorError {
fn description(&self) -> &str {
match *self {
GetDetectorError::BadRequest(ref cause) => cause,
GetDetectorError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFilterError {
BadRequest(String),
InternalServerError(String),
}
impl GetFilterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFilterError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetFilterError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetFilterError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetFilterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFilterError {
fn description(&self) -> &str {
match *self {
GetFilterError::BadRequest(ref cause) => cause,
GetFilterError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFindingsError {
BadRequest(String),
InternalServerError(String),
}
impl GetFindingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFindingsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetFindingsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetFindingsError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetFindingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFindingsError {
fn description(&self) -> &str {
match *self {
GetFindingsError::BadRequest(ref cause) => cause,
GetFindingsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFindingsStatisticsError {
BadRequest(String),
InternalServerError(String),
}
impl GetFindingsStatisticsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFindingsStatisticsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetFindingsStatisticsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetFindingsStatisticsError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetFindingsStatisticsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFindingsStatisticsError {
fn description(&self) -> &str {
match *self {
GetFindingsStatisticsError::BadRequest(ref cause) => cause,
GetFindingsStatisticsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetIPSetError {
BadRequest(String),
InternalServerError(String),
}
impl GetIPSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetIPSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetIPSetError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetIPSetError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetIPSetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetIPSetError {
fn description(&self) -> &str {
match *self {
GetIPSetError::BadRequest(ref cause) => cause,
GetIPSetError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetInvitationsCountError {
BadRequest(String),
InternalServerError(String),
}
impl GetInvitationsCountError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetInvitationsCountError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetInvitationsCountError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetInvitationsCountError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetInvitationsCountError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetInvitationsCountError {
fn description(&self) -> &str {
match *self {
GetInvitationsCountError::BadRequest(ref cause) => cause,
GetInvitationsCountError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetMasterAccountError {
BadRequest(String),
InternalServerError(String),
}
impl GetMasterAccountError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetMasterAccountError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetMasterAccountError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetMasterAccountError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetMasterAccountError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetMasterAccountError {
fn description(&self) -> &str {
match *self {
GetMasterAccountError::BadRequest(ref cause) => cause,
GetMasterAccountError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetMembersError {
BadRequest(String),
InternalServerError(String),
}
impl GetMembersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetMembersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetMembersError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetMembersError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetMembersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetMembersError {
fn description(&self) -> &str {
match *self {
GetMembersError::BadRequest(ref cause) => cause,
GetMembersError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetThreatIntelSetError {
BadRequest(String),
InternalServerError(String),
}
impl GetThreatIntelSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetThreatIntelSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetThreatIntelSetError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetThreatIntelSetError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetThreatIntelSetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetThreatIntelSetError {
fn description(&self) -> &str {
match *self {
GetThreatIntelSetError::BadRequest(ref cause) => cause,
GetThreatIntelSetError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum InviteMembersError {
BadRequest(String),
InternalServerError(String),
}
impl InviteMembersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<InviteMembersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(InviteMembersError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(InviteMembersError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for InviteMembersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for InviteMembersError {
fn description(&self) -> &str {
match *self {
InviteMembersError::BadRequest(ref cause) => cause,
InviteMembersError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDetectorsError {
BadRequest(String),
InternalServerError(String),
}
impl ListDetectorsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListDetectorsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListDetectorsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListDetectorsError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListDetectorsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDetectorsError {
fn description(&self) -> &str {
match *self {
ListDetectorsError::BadRequest(ref cause) => cause,
ListDetectorsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListFiltersError {
BadRequest(String),
InternalServerError(String),
}
impl ListFiltersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListFiltersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListFiltersError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListFiltersError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListFiltersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListFiltersError {
fn description(&self) -> &str {
match *self {
ListFiltersError::BadRequest(ref cause) => cause,
ListFiltersError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListFindingsError {
BadRequest(String),
InternalServerError(String),
}
impl ListFindingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListFindingsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListFindingsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListFindingsError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListFindingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListFindingsError {
fn description(&self) -> &str {
match *self {
ListFindingsError::BadRequest(ref cause) => cause,
ListFindingsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListIPSetsError {
BadRequest(String),
InternalServerError(String),
}
impl ListIPSetsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListIPSetsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListIPSetsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListIPSetsError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListIPSetsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListIPSetsError {
fn description(&self) -> &str {
match *self {
ListIPSetsError::BadRequest(ref cause) => cause,
ListIPSetsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListInvitationsError {
BadRequest(String),
InternalServerError(String),
}
impl ListInvitationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListInvitationsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListInvitationsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListInvitationsError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListInvitationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListInvitationsError {
fn description(&self) -> &str {
match *self {
ListInvitationsError::BadRequest(ref cause) => cause,
ListInvitationsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListMembersError {
BadRequest(String),
InternalServerError(String),
}
impl ListMembersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListMembersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListMembersError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListMembersError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListMembersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListMembersError {
fn description(&self) -> &str {
match *self {
ListMembersError::BadRequest(ref cause) => cause,
ListMembersError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListThreatIntelSetsError {
BadRequest(String),
InternalServerError(String),
}
impl ListThreatIntelSetsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListThreatIntelSetsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListThreatIntelSetsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListThreatIntelSetsError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListThreatIntelSetsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListThreatIntelSetsError {
fn description(&self) -> &str {
match *self {
ListThreatIntelSetsError::BadRequest(ref cause) => cause,
ListThreatIntelSetsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartMonitoringMembersError {
BadRequest(String),
InternalServerError(String),
}
impl StartMonitoringMembersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartMonitoringMembersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(StartMonitoringMembersError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(StartMonitoringMembersError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartMonitoringMembersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartMonitoringMembersError {
fn description(&self) -> &str {
match *self {
StartMonitoringMembersError::BadRequest(ref cause) => cause,
StartMonitoringMembersError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopMonitoringMembersError {
BadRequest(String),
InternalServerError(String),
}
impl StopMonitoringMembersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopMonitoringMembersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(StopMonitoringMembersError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(StopMonitoringMembersError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopMonitoringMembersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopMonitoringMembersError {
fn description(&self) -> &str {
match *self {
StopMonitoringMembersError::BadRequest(ref cause) => cause,
StopMonitoringMembersError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UnarchiveFindingsError {
BadRequest(String),
InternalServerError(String),
}
impl UnarchiveFindingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UnarchiveFindingsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UnarchiveFindingsError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UnarchiveFindingsError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UnarchiveFindingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UnarchiveFindingsError {
fn description(&self) -> &str {
match *self {
UnarchiveFindingsError::BadRequest(ref cause) => cause,
UnarchiveFindingsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateDetectorError {
BadRequest(String),
InternalServerError(String),
}
impl UpdateDetectorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDetectorError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateDetectorError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateDetectorError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateDetectorError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateDetectorError {
fn description(&self) -> &str {
match *self {
UpdateDetectorError::BadRequest(ref cause) => cause,
UpdateDetectorError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateFilterError {
BadRequest(String),
InternalServerError(String),
}
impl UpdateFilterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateFilterError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateFilterError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateFilterError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateFilterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateFilterError {
fn description(&self) -> &str {
match *self {
UpdateFilterError::BadRequest(ref cause) => cause,
UpdateFilterError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateFindingsFeedbackError {
BadRequest(String),
InternalServerError(String),
}
impl UpdateFindingsFeedbackError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateFindingsFeedbackError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateFindingsFeedbackError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateFindingsFeedbackError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateFindingsFeedbackError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateFindingsFeedbackError {
fn description(&self) -> &str {
match *self {
UpdateFindingsFeedbackError::BadRequest(ref cause) => cause,
UpdateFindingsFeedbackError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateIPSetError {
BadRequest(String),
InternalServerError(String),
}
impl UpdateIPSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateIPSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateIPSetError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateIPSetError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateIPSetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateIPSetError {
fn description(&self) -> &str {
match *self {
UpdateIPSetError::BadRequest(ref cause) => cause,
UpdateIPSetError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateThreatIntelSetError {
BadRequest(String),
InternalServerError(String),
}
impl UpdateThreatIntelSetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateThreatIntelSetError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateThreatIntelSetError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateThreatIntelSetError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateThreatIntelSetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateThreatIntelSetError {
fn description(&self) -> &str {
match *self {
UpdateThreatIntelSetError::BadRequest(ref cause) => cause,
UpdateThreatIntelSetError::InternalServerError(ref cause) => cause,
}
}
}
pub trait GuardDuty {
fn accept_invitation(
&self,
input: AcceptInvitationRequest,
) -> RusotoFuture<AcceptInvitationResponse, AcceptInvitationError>;
fn archive_findings(
&self,
input: ArchiveFindingsRequest,
) -> RusotoFuture<ArchiveFindingsResponse, ArchiveFindingsError>;
fn create_detector(
&self,
input: CreateDetectorRequest,
) -> RusotoFuture<CreateDetectorResponse, CreateDetectorError>;
fn create_filter(
&self,
input: CreateFilterRequest,
) -> RusotoFuture<CreateFilterResponse, CreateFilterError>;
fn create_ip_set(
&self,
input: CreateIPSetRequest,
) -> RusotoFuture<CreateIPSetResponse, CreateIPSetError>;
fn create_members(
&self,
input: CreateMembersRequest,
) -> RusotoFuture<CreateMembersResponse, CreateMembersError>;
fn create_sample_findings(
&self,
input: CreateSampleFindingsRequest,
) -> RusotoFuture<CreateSampleFindingsResponse, CreateSampleFindingsError>;
fn create_threat_intel_set(
&self,
input: CreateThreatIntelSetRequest,
) -> RusotoFuture<CreateThreatIntelSetResponse, CreateThreatIntelSetError>;
fn decline_invitations(
&self,
input: DeclineInvitationsRequest,
) -> RusotoFuture<DeclineInvitationsResponse, DeclineInvitationsError>;
fn delete_detector(
&self,
input: DeleteDetectorRequest,
) -> RusotoFuture<DeleteDetectorResponse, DeleteDetectorError>;
fn delete_filter(
&self,
input: DeleteFilterRequest,
) -> RusotoFuture<DeleteFilterResponse, DeleteFilterError>;
fn delete_ip_set(
&self,
input: DeleteIPSetRequest,
) -> RusotoFuture<DeleteIPSetResponse, DeleteIPSetError>;
fn delete_invitations(
&self,
input: DeleteInvitationsRequest,
) -> RusotoFuture<DeleteInvitationsResponse, DeleteInvitationsError>;
fn delete_members(
&self,
input: DeleteMembersRequest,
) -> RusotoFuture<DeleteMembersResponse, DeleteMembersError>;
fn delete_threat_intel_set(
&self,
input: DeleteThreatIntelSetRequest,
) -> RusotoFuture<DeleteThreatIntelSetResponse, DeleteThreatIntelSetError>;
fn disassociate_from_master_account(
&self,
input: DisassociateFromMasterAccountRequest,
) -> RusotoFuture<DisassociateFromMasterAccountResponse, DisassociateFromMasterAccountError>;
fn disassociate_members(
&self,
input: DisassociateMembersRequest,
) -> RusotoFuture<DisassociateMembersResponse, DisassociateMembersError>;
fn get_detector(
&self,
input: GetDetectorRequest,
) -> RusotoFuture<GetDetectorResponse, GetDetectorError>;
fn get_filter(
&self,
input: GetFilterRequest,
) -> RusotoFuture<GetFilterResponse, GetFilterError>;
fn get_findings(
&self,
input: GetFindingsRequest,
) -> RusotoFuture<GetFindingsResponse, GetFindingsError>;
fn get_findings_statistics(
&self,
input: GetFindingsStatisticsRequest,
) -> RusotoFuture<GetFindingsStatisticsResponse, GetFindingsStatisticsError>;
fn get_ip_set(&self, input: GetIPSetRequest) -> RusotoFuture<GetIPSetResponse, GetIPSetError>;
fn get_invitations_count(
&self,
) -> RusotoFuture<GetInvitationsCountResponse, GetInvitationsCountError>;
fn get_master_account(
&self,
input: GetMasterAccountRequest,
) -> RusotoFuture<GetMasterAccountResponse, GetMasterAccountError>;
fn get_members(
&self,
input: GetMembersRequest,
) -> RusotoFuture<GetMembersResponse, GetMembersError>;
fn get_threat_intel_set(
&self,
input: GetThreatIntelSetRequest,
) -> RusotoFuture<GetThreatIntelSetResponse, GetThreatIntelSetError>;
fn invite_members(
&self,
input: InviteMembersRequest,
) -> RusotoFuture<InviteMembersResponse, InviteMembersError>;
fn list_detectors(
&self,
input: ListDetectorsRequest,
) -> RusotoFuture<ListDetectorsResponse, ListDetectorsError>;
fn list_filters(
&self,
input: ListFiltersRequest,
) -> RusotoFuture<ListFiltersResponse, ListFiltersError>;
fn list_findings(
&self,
input: ListFindingsRequest,
) -> RusotoFuture<ListFindingsResponse, ListFindingsError>;
fn list_ip_sets(
&self,
input: ListIPSetsRequest,
) -> RusotoFuture<ListIPSetsResponse, ListIPSetsError>;
fn list_invitations(
&self,
input: ListInvitationsRequest,
) -> RusotoFuture<ListInvitationsResponse, ListInvitationsError>;
fn list_members(
&self,
input: ListMembersRequest,
) -> RusotoFuture<ListMembersResponse, ListMembersError>;
fn list_threat_intel_sets(
&self,
input: ListThreatIntelSetsRequest,
) -> RusotoFuture<ListThreatIntelSetsResponse, ListThreatIntelSetsError>;
fn start_monitoring_members(
&self,
input: StartMonitoringMembersRequest,
) -> RusotoFuture<StartMonitoringMembersResponse, StartMonitoringMembersError>;
fn stop_monitoring_members(
&self,
input: StopMonitoringMembersRequest,
) -> RusotoFuture<StopMonitoringMembersResponse, StopMonitoringMembersError>;
fn unarchive_findings(
&self,
input: UnarchiveFindingsRequest,
) -> RusotoFuture<UnarchiveFindingsResponse, UnarchiveFindingsError>;
fn update_detector(
&self,
input: UpdateDetectorRequest,
) -> RusotoFuture<UpdateDetectorResponse, UpdateDetectorError>;
fn update_filter(
&self,
input: UpdateFilterRequest,
) -> RusotoFuture<UpdateFilterResponse, UpdateFilterError>;
fn update_findings_feedback(
&self,
input: UpdateFindingsFeedbackRequest,
) -> RusotoFuture<UpdateFindingsFeedbackResponse, UpdateFindingsFeedbackError>;
fn update_ip_set(
&self,
input: UpdateIPSetRequest,
) -> RusotoFuture<UpdateIPSetResponse, UpdateIPSetError>;
fn update_threat_intel_set(
&self,
input: UpdateThreatIntelSetRequest,
) -> RusotoFuture<UpdateThreatIntelSetResponse, UpdateThreatIntelSetError>;
}
#[derive(Clone)]
pub struct GuardDutyClient {
client: Client,
region: region::Region,
}
impl GuardDutyClient {
pub fn new(region: region::Region) -> GuardDutyClient {
GuardDutyClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> GuardDutyClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
GuardDutyClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl GuardDuty for GuardDutyClient {
fn accept_invitation(
&self,
input: AcceptInvitationRequest,
) -> RusotoFuture<AcceptInvitationResponse, AcceptInvitationError> {
let request_uri = format!(
"/detector/{detector_id}/master",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<AcceptInvitationResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AcceptInvitationError::from_response(response))),
)
}
})
}
fn archive_findings(
&self,
input: ArchiveFindingsRequest,
) -> RusotoFuture<ArchiveFindingsResponse, ArchiveFindingsError> {
let request_uri = format!(
"/detector/{detector_id}/findings/archive",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ArchiveFindingsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ArchiveFindingsError::from_response(response))),
)
}
})
}
fn create_detector(
&self,
input: CreateDetectorRequest,
) -> RusotoFuture<CreateDetectorResponse, CreateDetectorError> {
let request_uri = "/detector";
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateDetectorResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateDetectorError::from_response(response))),
)
}
})
}
fn create_filter(
&self,
input: CreateFilterRequest,
) -> RusotoFuture<CreateFilterResponse, CreateFilterError> {
let request_uri = format!(
"/detector/{detector_id}/filter",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateFilterResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateFilterError::from_response(response))),
)
}
})
}
fn create_ip_set(
&self,
input: CreateIPSetRequest,
) -> RusotoFuture<CreateIPSetResponse, CreateIPSetError> {
let request_uri = format!(
"/detector/{detector_id}/ipset",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateIPSetResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateIPSetError::from_response(response))),
)
}
})
}
fn create_members(
&self,
input: CreateMembersRequest,
) -> RusotoFuture<CreateMembersResponse, CreateMembersError> {
let request_uri = format!(
"/detector/{detector_id}/member",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateMembersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateMembersError::from_response(response))),
)
}
})
}
fn create_sample_findings(
&self,
input: CreateSampleFindingsRequest,
) -> RusotoFuture<CreateSampleFindingsResponse, CreateSampleFindingsError> {
let request_uri = format!(
"/detector/{detector_id}/findings/create",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateSampleFindingsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateSampleFindingsError::from_response(response))
}),
)
}
})
}
fn create_threat_intel_set(
&self,
input: CreateThreatIntelSetRequest,
) -> RusotoFuture<CreateThreatIntelSetResponse, CreateThreatIntelSetError> {
let request_uri = format!(
"/detector/{detector_id}/threatintelset",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateThreatIntelSetResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateThreatIntelSetError::from_response(response))
}),
)
}
})
}
fn decline_invitations(
&self,
input: DeclineInvitationsRequest,
) -> RusotoFuture<DeclineInvitationsResponse, DeclineInvitationsError> {
let request_uri = "/invitation/decline";
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeclineInvitationsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeclineInvitationsError::from_response(response))),
)
}
})
}
fn delete_detector(
&self,
input: DeleteDetectorRequest,
) -> RusotoFuture<DeleteDetectorResponse, DeleteDetectorError> {
let request_uri = format!("/detector/{detector_id}", detector_id = input.detector_id);
let mut request = SignedRequest::new("DELETE", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteDetectorResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDetectorError::from_response(response))),
)
}
})
}
fn delete_filter(
&self,
input: DeleteFilterRequest,
) -> RusotoFuture<DeleteFilterResponse, DeleteFilterError> {
let request_uri = format!(
"/detector/{detector_id}/filter/{filter_name}",
detector_id = input.detector_id,
filter_name = input.filter_name
);
let mut request = SignedRequest::new("DELETE", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteFilterResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteFilterError::from_response(response))),
)
}
})
}
fn delete_ip_set(
&self,
input: DeleteIPSetRequest,
) -> RusotoFuture<DeleteIPSetResponse, DeleteIPSetError> {
let request_uri = format!(
"/detector/{detector_id}/ipset/{ip_set_id}",
detector_id = input.detector_id,
ip_set_id = input.ip_set_id
);
let mut request = SignedRequest::new("DELETE", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteIPSetResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteIPSetError::from_response(response))),
)
}
})
}
fn delete_invitations(
&self,
input: DeleteInvitationsRequest,
) -> RusotoFuture<DeleteInvitationsResponse, DeleteInvitationsError> {
let request_uri = "/invitation/delete";
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteInvitationsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteInvitationsError::from_response(response))),
)
}
})
}
fn delete_members(
&self,
input: DeleteMembersRequest,
) -> RusotoFuture<DeleteMembersResponse, DeleteMembersError> {
let request_uri = format!(
"/detector/{detector_id}/member/delete",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteMembersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteMembersError::from_response(response))),
)
}
})
}
fn delete_threat_intel_set(
&self,
input: DeleteThreatIntelSetRequest,
) -> RusotoFuture<DeleteThreatIntelSetResponse, DeleteThreatIntelSetError> {
let request_uri = format!(
"/detector/{detector_id}/threatintelset/{threat_intel_set_id}",
detector_id = input.detector_id,
threat_intel_set_id = input.threat_intel_set_id
);
let mut request = SignedRequest::new("DELETE", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteThreatIntelSetResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteThreatIntelSetError::from_response(response))
}),
)
}
})
}
fn disassociate_from_master_account(
&self,
input: DisassociateFromMasterAccountRequest,
) -> RusotoFuture<DisassociateFromMasterAccountResponse, DisassociateFromMasterAccountError>
{
let request_uri = format!(
"/detector/{detector_id}/master/disassociate",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DisassociateFromMasterAccountResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DisassociateFromMasterAccountError::from_response(response))
}))
}
})
}
fn disassociate_members(
&self,
input: DisassociateMembersRequest,
) -> RusotoFuture<DisassociateMembersResponse, DisassociateMembersError> {
let request_uri = format!(
"/detector/{detector_id}/member/disassociate",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DisassociateMembersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DisassociateMembersError::from_response(response))
}),
)
}
})
}
fn get_detector(
&self,
input: GetDetectorRequest,
) -> RusotoFuture<GetDetectorResponse, GetDetectorError> {
let request_uri = format!("/detector/{detector_id}", detector_id = input.detector_id);
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetDetectorResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDetectorError::from_response(response))),
)
}
})
}
fn get_filter(
&self,
input: GetFilterRequest,
) -> RusotoFuture<GetFilterResponse, GetFilterError> {
let request_uri = format!(
"/detector/{detector_id}/filter/{filter_name}",
detector_id = input.detector_id,
filter_name = input.filter_name
);
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetFilterResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetFilterError::from_response(response))),
)
}
})
}
fn get_findings(
&self,
input: GetFindingsRequest,
) -> RusotoFuture<GetFindingsResponse, GetFindingsError> {
let request_uri = format!(
"/detector/{detector_id}/findings/get",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetFindingsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetFindingsError::from_response(response))),
)
}
})
}
fn get_findings_statistics(
&self,
input: GetFindingsStatisticsRequest,
) -> RusotoFuture<GetFindingsStatisticsResponse, GetFindingsStatisticsError> {
let request_uri = format!(
"/detector/{detector_id}/findings/statistics",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetFindingsStatisticsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetFindingsStatisticsError::from_response(response))
}),
)
}
})
}
fn get_ip_set(&self, input: GetIPSetRequest) -> RusotoFuture<GetIPSetResponse, GetIPSetError> {
let request_uri = format!(
"/detector/{detector_id}/ipset/{ip_set_id}",
detector_id = input.detector_id,
ip_set_id = input.ip_set_id
);
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetIPSetResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetIPSetError::from_response(response))),
)
}
})
}
fn get_invitations_count(
&self,
) -> RusotoFuture<GetInvitationsCountResponse, GetInvitationsCountError> {
let request_uri = "/invitation/count";
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetInvitationsCountResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetInvitationsCountError::from_response(response))
}),
)
}
})
}
fn get_master_account(
&self,
input: GetMasterAccountRequest,
) -> RusotoFuture<GetMasterAccountResponse, GetMasterAccountError> {
let request_uri = format!(
"/detector/{detector_id}/master",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetMasterAccountResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetMasterAccountError::from_response(response))),
)
}
})
}
fn get_members(
&self,
input: GetMembersRequest,
) -> RusotoFuture<GetMembersResponse, GetMembersError> {
let request_uri = format!(
"/detector/{detector_id}/member/get",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetMembersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetMembersError::from_response(response))),
)
}
})
}
fn get_threat_intel_set(
&self,
input: GetThreatIntelSetRequest,
) -> RusotoFuture<GetThreatIntelSetResponse, GetThreatIntelSetError> {
let request_uri = format!(
"/detector/{detector_id}/threatintelset/{threat_intel_set_id}",
detector_id = input.detector_id,
threat_intel_set_id = input.threat_intel_set_id
);
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetThreatIntelSetResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetThreatIntelSetError::from_response(response))),
)
}
})
}
fn invite_members(
&self,
input: InviteMembersRequest,
) -> RusotoFuture<InviteMembersResponse, InviteMembersError> {
let request_uri = format!(
"/detector/{detector_id}/member/invite",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<InviteMembersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(InviteMembersError::from_response(response))),
)
}
})
}
fn list_detectors(
&self,
input: ListDetectorsRequest,
) -> RusotoFuture<ListDetectorsResponse, ListDetectorsError> {
let request_uri = "/detector";
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListDetectorsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListDetectorsError::from_response(response))),
)
}
})
}
fn list_filters(
&self,
input: ListFiltersRequest,
) -> RusotoFuture<ListFiltersResponse, ListFiltersError> {
let request_uri = format!(
"/detector/{detector_id}/filter",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListFiltersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListFiltersError::from_response(response))),
)
}
})
}
fn list_findings(
&self,
input: ListFindingsRequest,
) -> RusotoFuture<ListFindingsResponse, ListFindingsError> {
let request_uri = format!(
"/detector/{detector_id}/findings",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListFindingsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListFindingsError::from_response(response))),
)
}
})
}
fn list_ip_sets(
&self,
input: ListIPSetsRequest,
) -> RusotoFuture<ListIPSetsResponse, ListIPSetsError> {
let request_uri = format!(
"/detector/{detector_id}/ipset",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListIPSetsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListIPSetsError::from_response(response))),
)
}
})
}
fn list_invitations(
&self,
input: ListInvitationsRequest,
) -> RusotoFuture<ListInvitationsResponse, ListInvitationsError> {
let request_uri = "/invitation";
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListInvitationsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListInvitationsError::from_response(response))),
)
}
})
}
fn list_members(
&self,
input: ListMembersRequest,
) -> RusotoFuture<ListMembersResponse, ListMembersError> {
let request_uri = format!(
"/detector/{detector_id}/member",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
if let Some(ref x) = input.only_associated {
params.put("onlyAssociated", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListMembersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListMembersError::from_response(response))),
)
}
})
}
fn list_threat_intel_sets(
&self,
input: ListThreatIntelSetsRequest,
) -> RusotoFuture<ListThreatIntelSetsResponse, ListThreatIntelSetsError> {
let request_uri = format!(
"/detector/{detector_id}/threatintelset",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("GET", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListThreatIntelSetsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListThreatIntelSetsError::from_response(response))
}),
)
}
})
}
fn start_monitoring_members(
&self,
input: StartMonitoringMembersRequest,
) -> RusotoFuture<StartMonitoringMembersResponse, StartMonitoringMembersError> {
let request_uri = format!(
"/detector/{detector_id}/member/start",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<StartMonitoringMembersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(StartMonitoringMembersError::from_response(response))
}),
)
}
})
}
fn stop_monitoring_members(
&self,
input: StopMonitoringMembersRequest,
) -> RusotoFuture<StopMonitoringMembersResponse, StopMonitoringMembersError> {
let request_uri = format!(
"/detector/{detector_id}/member/stop",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<StopMonitoringMembersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(StopMonitoringMembersError::from_response(response))
}),
)
}
})
}
fn unarchive_findings(
&self,
input: UnarchiveFindingsRequest,
) -> RusotoFuture<UnarchiveFindingsResponse, UnarchiveFindingsError> {
let request_uri = format!(
"/detector/{detector_id}/findings/unarchive",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UnarchiveFindingsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UnarchiveFindingsError::from_response(response))),
)
}
})
}
fn update_detector(
&self,
input: UpdateDetectorRequest,
) -> RusotoFuture<UpdateDetectorResponse, UpdateDetectorError> {
let request_uri = format!("/detector/{detector_id}", detector_id = input.detector_id);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateDetectorResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateDetectorError::from_response(response))),
)
}
})
}
fn update_filter(
&self,
input: UpdateFilterRequest,
) -> RusotoFuture<UpdateFilterResponse, UpdateFilterError> {
let request_uri = format!(
"/detector/{detector_id}/filter/{filter_name}",
detector_id = input.detector_id,
filter_name = input.filter_name
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateFilterResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateFilterError::from_response(response))),
)
}
})
}
fn update_findings_feedback(
&self,
input: UpdateFindingsFeedbackRequest,
) -> RusotoFuture<UpdateFindingsFeedbackResponse, UpdateFindingsFeedbackError> {
let request_uri = format!(
"/detector/{detector_id}/findings/feedback",
detector_id = input.detector_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateFindingsFeedbackResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateFindingsFeedbackError::from_response(response))
}),
)
}
})
}
fn update_ip_set(
&self,
input: UpdateIPSetRequest,
) -> RusotoFuture<UpdateIPSetResponse, UpdateIPSetError> {
let request_uri = format!(
"/detector/{detector_id}/ipset/{ip_set_id}",
detector_id = input.detector_id,
ip_set_id = input.ip_set_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateIPSetResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateIPSetError::from_response(response))),
)
}
})
}
fn update_threat_intel_set(
&self,
input: UpdateThreatIntelSetRequest,
) -> RusotoFuture<UpdateThreatIntelSetResponse, UpdateThreatIntelSetError> {
let request_uri = format!(
"/detector/{detector_id}/threatintelset/{threat_intel_set_id}",
detector_id = input.detector_id,
threat_intel_set_id = input.threat_intel_set_id
);
let mut request = SignedRequest::new("POST", "guardduty", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateThreatIntelSetResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateThreatIntelSetError::from_response(response))
}),
)
}
})
}
}