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::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddAttributesToFindingsRequest {
#[serde(rename = "attributes")]
pub attributes: Vec<Attribute>,
#[serde(rename = "findingArns")]
pub finding_arns: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddAttributesToFindingsResponse {
#[serde(rename = "failedItems")]
pub failed_items: ::std::collections::HashMap<String, FailedItemDetails>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct AgentAlreadyRunningAssessment {
pub agent_id: String,
pub assessment_run_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AgentFilter {
#[serde(rename = "agentHealthCodes")]
pub agent_health_codes: Vec<String>,
#[serde(rename = "agentHealths")]
pub agent_healths: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AgentPreview {
#[serde(rename = "agentHealth")]
#[serde(skip_serializing_if = "Option::is_none")]
pub agent_health: Option<String>,
#[serde(rename = "agentId")]
pub agent_id: String,
#[serde(rename = "agentVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub agent_version: Option<String>,
#[serde(rename = "autoScalingGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_scaling_group: Option<String>,
#[serde(rename = "hostname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
#[serde(rename = "ipv4Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv_4_address: Option<String>,
#[serde(rename = "kernelVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kernel_version: Option<String>,
#[serde(rename = "operatingSystem")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operating_system: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssessmentRun {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "assessmentTemplateArn")]
pub assessment_template_arn: String,
#[serde(rename = "completedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub completed_at: Option<f64>,
#[serde(rename = "createdAt")]
pub created_at: f64,
#[serde(rename = "dataCollected")]
pub data_collected: bool,
#[serde(rename = "durationInSeconds")]
pub duration_in_seconds: i64,
#[serde(rename = "findingCounts")]
pub finding_counts: ::std::collections::HashMap<String, i64>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "notifications")]
pub notifications: Vec<AssessmentRunNotification>,
#[serde(rename = "rulesPackageArns")]
pub rules_package_arns: Vec<String>,
#[serde(rename = "startedAt")]
#[serde(skip_serializing_if = "Option::is_none")]
pub started_at: Option<f64>,
#[serde(rename = "state")]
pub state: String,
#[serde(rename = "stateChangedAt")]
pub state_changed_at: f64,
#[serde(rename = "stateChanges")]
pub state_changes: Vec<AssessmentRunStateChange>,
#[serde(rename = "userAttributesForFindings")]
pub user_attributes_for_findings: Vec<Attribute>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssessmentRunAgent {
#[serde(rename = "agentHealth")]
pub agent_health: String,
#[serde(rename = "agentHealthCode")]
pub agent_health_code: String,
#[serde(rename = "agentHealthDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub agent_health_details: Option<String>,
#[serde(rename = "agentId")]
pub agent_id: String,
#[serde(rename = "assessmentRunArn")]
pub assessment_run_arn: String,
#[serde(rename = "autoScalingGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_scaling_group: Option<String>,
#[serde(rename = "telemetryMetadata")]
pub telemetry_metadata: Vec<TelemetryMetadata>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssessmentRunFilter {
#[serde(rename = "completionTimeRange")]
#[serde(skip_serializing_if = "Option::is_none")]
pub completion_time_range: Option<TimestampRange>,
#[serde(rename = "durationRange")]
#[serde(skip_serializing_if = "Option::is_none")]
pub duration_range: Option<DurationRange>,
#[serde(rename = "namePattern")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_pattern: Option<String>,
#[serde(rename = "rulesPackageArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rules_package_arns: Option<Vec<String>>,
#[serde(rename = "startTimeRange")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time_range: Option<TimestampRange>,
#[serde(rename = "stateChangeTimeRange")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state_change_time_range: Option<TimestampRange>,
#[serde(rename = "states")]
#[serde(skip_serializing_if = "Option::is_none")]
pub states: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssessmentRunNotification {
#[serde(rename = "date")]
pub date: f64,
#[serde(rename = "error")]
pub error: bool,
#[serde(rename = "event")]
pub event: String,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "snsPublishStatusCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sns_publish_status_code: Option<String>,
#[serde(rename = "snsTopicArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sns_topic_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssessmentRunStateChange {
#[serde(rename = "state")]
pub state: String,
#[serde(rename = "stateChangedAt")]
pub state_changed_at: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssessmentTarget {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "createdAt")]
pub created_at: f64,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "resourceGroupArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_group_arn: Option<String>,
#[serde(rename = "updatedAt")]
pub updated_at: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssessmentTargetFilter {
#[serde(rename = "assessmentTargetNamePattern")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assessment_target_name_pattern: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssessmentTemplate {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "assessmentRunCount")]
pub assessment_run_count: i64,
#[serde(rename = "assessmentTargetArn")]
pub assessment_target_arn: String,
#[serde(rename = "createdAt")]
pub created_at: f64,
#[serde(rename = "durationInSeconds")]
pub duration_in_seconds: i64,
#[serde(rename = "lastAssessmentRunArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_assessment_run_arn: Option<String>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "rulesPackageArns")]
pub rules_package_arns: Vec<String>,
#[serde(rename = "userAttributesForFindings")]
pub user_attributes_for_findings: Vec<Attribute>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssessmentTemplateFilter {
#[serde(rename = "durationRange")]
#[serde(skip_serializing_if = "Option::is_none")]
pub duration_range: Option<DurationRange>,
#[serde(rename = "namePattern")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name_pattern: Option<String>,
#[serde(rename = "rulesPackageArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rules_package_arns: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssetAttributes {
#[serde(rename = "agentId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub agent_id: Option<String>,
#[serde(rename = "amiId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ami_id: Option<String>,
#[serde(rename = "autoScalingGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_scaling_group: Option<String>,
#[serde(rename = "hostname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hostname: Option<String>,
#[serde(rename = "ipv4Addresses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ipv_4_addresses: Option<Vec<String>>,
#[serde(rename = "networkInterfaces")]
#[serde(skip_serializing_if = "Option::is_none")]
pub network_interfaces: Option<Vec<NetworkInterface>>,
#[serde(rename = "schemaVersion")]
pub schema_version: i64,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Attribute {
#[serde(rename = "key")]
pub key: String,
#[serde(rename = "value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateAssessmentTargetRequest {
#[serde(rename = "assessmentTargetName")]
pub assessment_target_name: String,
#[serde(rename = "resourceGroupArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_group_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateAssessmentTargetResponse {
#[serde(rename = "assessmentTargetArn")]
pub assessment_target_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateAssessmentTemplateRequest {
#[serde(rename = "assessmentTargetArn")]
pub assessment_target_arn: String,
#[serde(rename = "assessmentTemplateName")]
pub assessment_template_name: String,
#[serde(rename = "durationInSeconds")]
pub duration_in_seconds: i64,
#[serde(rename = "rulesPackageArns")]
pub rules_package_arns: Vec<String>,
#[serde(rename = "userAttributesForFindings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_attributes_for_findings: Option<Vec<Attribute>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateAssessmentTemplateResponse {
#[serde(rename = "assessmentTemplateArn")]
pub assessment_template_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateExclusionsPreviewRequest {
#[serde(rename = "assessmentTemplateArn")]
pub assessment_template_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateExclusionsPreviewResponse {
#[serde(rename = "previewToken")]
pub preview_token: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateResourceGroupRequest {
#[serde(rename = "resourceGroupTags")]
pub resource_group_tags: Vec<ResourceGroupTag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateResourceGroupResponse {
#[serde(rename = "resourceGroupArn")]
pub resource_group_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteAssessmentRunRequest {
#[serde(rename = "assessmentRunArn")]
pub assessment_run_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteAssessmentTargetRequest {
#[serde(rename = "assessmentTargetArn")]
pub assessment_target_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteAssessmentTemplateRequest {
#[serde(rename = "assessmentTemplateArn")]
pub assessment_template_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeAssessmentRunsRequest {
#[serde(rename = "assessmentRunArns")]
pub assessment_run_arns: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeAssessmentRunsResponse {
#[serde(rename = "assessmentRuns")]
pub assessment_runs: Vec<AssessmentRun>,
#[serde(rename = "failedItems")]
pub failed_items: ::std::collections::HashMap<String, FailedItemDetails>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeAssessmentTargetsRequest {
#[serde(rename = "assessmentTargetArns")]
pub assessment_target_arns: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeAssessmentTargetsResponse {
#[serde(rename = "assessmentTargets")]
pub assessment_targets: Vec<AssessmentTarget>,
#[serde(rename = "failedItems")]
pub failed_items: ::std::collections::HashMap<String, FailedItemDetails>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeAssessmentTemplatesRequest {
#[serde(rename = "assessmentTemplateArns")]
pub assessment_template_arns: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeAssessmentTemplatesResponse {
#[serde(rename = "assessmentTemplates")]
pub assessment_templates: Vec<AssessmentTemplate>,
#[serde(rename = "failedItems")]
pub failed_items: ::std::collections::HashMap<String, FailedItemDetails>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeCrossAccountAccessRoleResponse {
#[serde(rename = "registeredAt")]
pub registered_at: f64,
#[serde(rename = "roleArn")]
pub role_arn: String,
#[serde(rename = "valid")]
pub valid: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeExclusionsRequest {
#[serde(rename = "exclusionArns")]
pub exclusion_arns: Vec<String>,
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeExclusionsResponse {
#[serde(rename = "exclusions")]
pub exclusions: ::std::collections::HashMap<String, Exclusion>,
#[serde(rename = "failedItems")]
pub failed_items: ::std::collections::HashMap<String, FailedItemDetails>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeFindingsRequest {
#[serde(rename = "findingArns")]
pub finding_arns: Vec<String>,
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeFindingsResponse {
#[serde(rename = "failedItems")]
pub failed_items: ::std::collections::HashMap<String, FailedItemDetails>,
#[serde(rename = "findings")]
pub findings: Vec<Finding>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeResourceGroupsRequest {
#[serde(rename = "resourceGroupArns")]
pub resource_group_arns: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeResourceGroupsResponse {
#[serde(rename = "failedItems")]
pub failed_items: ::std::collections::HashMap<String, FailedItemDetails>,
#[serde(rename = "resourceGroups")]
pub resource_groups: Vec<ResourceGroup>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeRulesPackagesRequest {
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "rulesPackageArns")]
pub rules_package_arns: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeRulesPackagesResponse {
#[serde(rename = "failedItems")]
pub failed_items: ::std::collections::HashMap<String, FailedItemDetails>,
#[serde(rename = "rulesPackages")]
pub rules_packages: Vec<RulesPackage>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DurationRange {
#[serde(rename = "maxSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_seconds: Option<i64>,
#[serde(rename = "minSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub min_seconds: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EventSubscription {
#[serde(rename = "event")]
pub event: String,
#[serde(rename = "subscribedAt")]
pub subscribed_at: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Exclusion {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<Vec<Attribute>>,
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "recommendation")]
pub recommendation: String,
#[serde(rename = "scopes")]
pub scopes: Vec<Scope>,
#[serde(rename = "title")]
pub title: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExclusionPreview {
#[serde(rename = "attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<Vec<Attribute>>,
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "recommendation")]
pub recommendation: String,
#[serde(rename = "scopes")]
pub scopes: Vec<Scope>,
#[serde(rename = "title")]
pub title: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FailedItemDetails {
#[serde(rename = "failureCode")]
pub failure_code: String,
#[serde(rename = "retryable")]
pub retryable: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Finding {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "assetAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asset_attributes: Option<AssetAttributes>,
#[serde(rename = "assetType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub asset_type: Option<String>,
#[serde(rename = "attributes")]
pub attributes: Vec<Attribute>,
#[serde(rename = "confidence")]
#[serde(skip_serializing_if = "Option::is_none")]
pub confidence: Option<i64>,
#[serde(rename = "createdAt")]
pub created_at: f64,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "indicatorOfCompromise")]
#[serde(skip_serializing_if = "Option::is_none")]
pub indicator_of_compromise: Option<bool>,
#[serde(rename = "numericSeverity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub numeric_severity: Option<f64>,
#[serde(rename = "recommendation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recommendation: Option<String>,
#[serde(rename = "schemaVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub schema_version: Option<i64>,
#[serde(rename = "service")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service: Option<String>,
#[serde(rename = "serviceAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub service_attributes: Option<InspectorServiceAttributes>,
#[serde(rename = "severity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub severity: Option<String>,
#[serde(rename = "title")]
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<String>,
#[serde(rename = "updatedAt")]
pub updated_at: f64,
#[serde(rename = "userAttributes")]
pub user_attributes: Vec<Attribute>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct FindingFilter {
#[serde(rename = "agentIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub agent_ids: Option<Vec<String>>,
#[serde(rename = "attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<Vec<Attribute>>,
#[serde(rename = "autoScalingGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_scaling_groups: Option<Vec<String>>,
#[serde(rename = "creationTimeRange")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time_range: Option<TimestampRange>,
#[serde(rename = "ruleNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rule_names: Option<Vec<String>>,
#[serde(rename = "rulesPackageArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rules_package_arns: Option<Vec<String>>,
#[serde(rename = "severities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub severities: Option<Vec<String>>,
#[serde(rename = "userAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_attributes: Option<Vec<Attribute>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAssessmentReportRequest {
#[serde(rename = "assessmentRunArn")]
pub assessment_run_arn: String,
#[serde(rename = "reportFileFormat")]
pub report_file_format: String,
#[serde(rename = "reportType")]
pub report_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetAssessmentReportResponse {
#[serde(rename = "status")]
pub status: String,
#[serde(rename = "url")]
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetExclusionsPreviewRequest {
#[serde(rename = "assessmentTemplateArn")]
pub assessment_template_arn: String,
#[serde(rename = "locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "previewToken")]
pub preview_token: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetExclusionsPreviewResponse {
#[serde(rename = "exclusionPreviews")]
#[serde(skip_serializing_if = "Option::is_none")]
pub exclusion_previews: Option<Vec<ExclusionPreview>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "previewStatus")]
pub preview_status: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetTelemetryMetadataRequest {
#[serde(rename = "assessmentRunArn")]
pub assessment_run_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetTelemetryMetadataResponse {
#[serde(rename = "telemetryMetadata")]
pub telemetry_metadata: Vec<TelemetryMetadata>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InspectorServiceAttributes {
#[serde(rename = "assessmentRunArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assessment_run_arn: Option<String>,
#[serde(rename = "rulesPackageArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rules_package_arn: Option<String>,
#[serde(rename = "schemaVersion")]
pub schema_version: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListAssessmentRunAgentsRequest {
#[serde(rename = "assessmentRunArn")]
pub assessment_run_arn: String,
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<AgentFilter>,
#[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 ListAssessmentRunAgentsResponse {
#[serde(rename = "assessmentRunAgents")]
pub assessment_run_agents: Vec<AssessmentRunAgent>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListAssessmentRunsRequest {
#[serde(rename = "assessmentTemplateArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assessment_template_arns: Option<Vec<String>>,
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<AssessmentRunFilter>,
#[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 ListAssessmentRunsResponse {
#[serde(rename = "assessmentRunArns")]
pub assessment_run_arns: 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 ListAssessmentTargetsRequest {
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<AssessmentTargetFilter>,
#[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 ListAssessmentTargetsResponse {
#[serde(rename = "assessmentTargetArns")]
pub assessment_target_arns: 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 ListAssessmentTemplatesRequest {
#[serde(rename = "assessmentTargetArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assessment_target_arns: Option<Vec<String>>,
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<AssessmentTemplateFilter>,
#[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 ListAssessmentTemplatesResponse {
#[serde(rename = "assessmentTemplateArns")]
pub assessment_template_arns: 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 ListEventSubscriptionsRequest {
#[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 = "resourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListEventSubscriptionsResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "subscriptions")]
pub subscriptions: Vec<Subscription>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListExclusionsRequest {
#[serde(rename = "assessmentRunArn")]
pub assessment_run_arn: String,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListExclusionsResponse {
#[serde(rename = "exclusionArns")]
pub exclusion_arns: 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 = "assessmentRunArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assessment_run_arns: Option<Vec<String>>,
#[serde(rename = "filter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter: Option<FindingFilter>,
#[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 ListFindingsResponse {
#[serde(rename = "findingArns")]
pub finding_arns: 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 ListRulesPackagesRequest {
#[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 ListRulesPackagesResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "rulesPackageArns")]
pub rules_package_arns: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForResourceRequest {
#[serde(rename = "resourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[serde(rename = "tags")]
pub tags: Vec<Tag>,
}
#[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<PrivateIp>>,
#[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, Serialize)]
pub struct PreviewAgentsRequest {
#[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 = "previewAgentsArn")]
pub preview_agents_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PreviewAgentsResponse {
#[serde(rename = "agentPreviews")]
pub agent_previews: Vec<AgentPreview>,
#[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 PrivateIp {
#[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, Serialize)]
pub struct RegisterCrossAccountAccessRoleRequest {
#[serde(rename = "roleArn")]
pub role_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RemoveAttributesFromFindingsRequest {
#[serde(rename = "attributeKeys")]
pub attribute_keys: Vec<String>,
#[serde(rename = "findingArns")]
pub finding_arns: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RemoveAttributesFromFindingsResponse {
#[serde(rename = "failedItems")]
pub failed_items: ::std::collections::HashMap<String, FailedItemDetails>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourceGroup {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "createdAt")]
pub created_at: f64,
#[serde(rename = "tags")]
pub tags: Vec<ResourceGroupTag>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ResourceGroupTag {
#[serde(rename = "key")]
pub key: String,
#[serde(rename = "value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RulesPackage {
#[serde(rename = "arn")]
pub arn: String,
#[serde(rename = "description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "provider")]
pub provider: String,
#[serde(rename = "version")]
pub version: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Scope {
#[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, 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, Serialize)]
pub struct SetTagsForResourceRequest {
#[serde(rename = "resourceArn")]
pub resource_arn: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartAssessmentRunRequest {
#[serde(rename = "assessmentRunName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub assessment_run_name: Option<String>,
#[serde(rename = "assessmentTemplateArn")]
pub assessment_template_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartAssessmentRunResponse {
#[serde(rename = "assessmentRunArn")]
pub assessment_run_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopAssessmentRunRequest {
#[serde(rename = "assessmentRunArn")]
pub assessment_run_arn: String,
#[serde(rename = "stopAction")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stop_action: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SubscribeToEventRequest {
#[serde(rename = "event")]
pub event: String,
#[serde(rename = "resourceArn")]
pub resource_arn: String,
#[serde(rename = "topicArn")]
pub topic_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Subscription {
#[serde(rename = "eventSubscriptions")]
pub event_subscriptions: Vec<EventSubscription>,
#[serde(rename = "resourceArn")]
pub resource_arn: String,
#[serde(rename = "topicArn")]
pub topic_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "key")]
pub key: String,
#[serde(rename = "value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TelemetryMetadata {
#[serde(rename = "count")]
pub count: i64,
#[serde(rename = "dataSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_size: Option<i64>,
#[serde(rename = "messageType")]
pub message_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TimestampRange {
#[serde(rename = "beginDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub begin_date: Option<f64>,
#[serde(rename = "endDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_date: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UnsubscribeFromEventRequest {
#[serde(rename = "event")]
pub event: String,
#[serde(rename = "resourceArn")]
pub resource_arn: String,
#[serde(rename = "topicArn")]
pub topic_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateAssessmentTargetRequest {
#[serde(rename = "assessmentTargetArn")]
pub assessment_target_arn: String,
#[serde(rename = "assessmentTargetName")]
pub assessment_target_name: String,
#[serde(rename = "resourceGroupArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_group_arn: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum AddAttributesToFindingsError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl AddAttributesToFindingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AddAttributesToFindingsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(AddAttributesToFindingsError::AccessDenied(
err.msg,
))
}
"InternalException" => {
return RusotoError::Service(AddAttributesToFindingsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(AddAttributesToFindingsError::InvalidInput(
err.msg,
))
}
"NoSuchEntityException" => {
return RusotoError::Service(AddAttributesToFindingsError::NoSuchEntity(
err.msg,
))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
AddAttributesToFindingsError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AddAttributesToFindingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddAttributesToFindingsError {
fn description(&self) -> &str {
match *self {
AddAttributesToFindingsError::AccessDenied(ref cause) => cause,
AddAttributesToFindingsError::Internal(ref cause) => cause,
AddAttributesToFindingsError::InvalidInput(ref cause) => cause,
AddAttributesToFindingsError::NoSuchEntity(ref cause) => cause,
AddAttributesToFindingsError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateAssessmentTargetError {
AccessDenied(String),
Internal(String),
InvalidCrossAccountRole(String),
InvalidInput(String),
LimitExceeded(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl CreateAssessmentTargetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateAssessmentTargetError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(CreateAssessmentTargetError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(CreateAssessmentTargetError::Internal(err.msg))
}
"InvalidCrossAccountRoleException" => {
return RusotoError::Service(
CreateAssessmentTargetError::InvalidCrossAccountRole(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(CreateAssessmentTargetError::InvalidInput(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateAssessmentTargetError::LimitExceeded(
err.msg,
))
}
"NoSuchEntityException" => {
return RusotoError::Service(CreateAssessmentTargetError::NoSuchEntity(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
CreateAssessmentTargetError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateAssessmentTargetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateAssessmentTargetError {
fn description(&self) -> &str {
match *self {
CreateAssessmentTargetError::AccessDenied(ref cause) => cause,
CreateAssessmentTargetError::Internal(ref cause) => cause,
CreateAssessmentTargetError::InvalidCrossAccountRole(ref cause) => cause,
CreateAssessmentTargetError::InvalidInput(ref cause) => cause,
CreateAssessmentTargetError::LimitExceeded(ref cause) => cause,
CreateAssessmentTargetError::NoSuchEntity(ref cause) => cause,
CreateAssessmentTargetError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateAssessmentTemplateError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
LimitExceeded(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl CreateAssessmentTemplateError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateAssessmentTemplateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(CreateAssessmentTemplateError::AccessDenied(
err.msg,
))
}
"InternalException" => {
return RusotoError::Service(CreateAssessmentTemplateError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(CreateAssessmentTemplateError::InvalidInput(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(CreateAssessmentTemplateError::LimitExceeded(
err.msg,
))
}
"NoSuchEntityException" => {
return RusotoError::Service(CreateAssessmentTemplateError::NoSuchEntity(
err.msg,
))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
CreateAssessmentTemplateError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateAssessmentTemplateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateAssessmentTemplateError {
fn description(&self) -> &str {
match *self {
CreateAssessmentTemplateError::AccessDenied(ref cause) => cause,
CreateAssessmentTemplateError::Internal(ref cause) => cause,
CreateAssessmentTemplateError::InvalidInput(ref cause) => cause,
CreateAssessmentTemplateError::LimitExceeded(ref cause) => cause,
CreateAssessmentTemplateError::NoSuchEntity(ref cause) => cause,
CreateAssessmentTemplateError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateExclusionsPreviewError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
PreviewGenerationInProgress(String),
ServiceTemporarilyUnavailable(String),
}
impl CreateExclusionsPreviewError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateExclusionsPreviewError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(CreateExclusionsPreviewError::AccessDenied(
err.msg,
))
}
"InternalException" => {
return RusotoError::Service(CreateExclusionsPreviewError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(CreateExclusionsPreviewError::InvalidInput(
err.msg,
))
}
"NoSuchEntityException" => {
return RusotoError::Service(CreateExclusionsPreviewError::NoSuchEntity(
err.msg,
))
}
"PreviewGenerationInProgressException" => {
return RusotoError::Service(
CreateExclusionsPreviewError::PreviewGenerationInProgress(err.msg),
)
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
CreateExclusionsPreviewError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateExclusionsPreviewError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateExclusionsPreviewError {
fn description(&self) -> &str {
match *self {
CreateExclusionsPreviewError::AccessDenied(ref cause) => cause,
CreateExclusionsPreviewError::Internal(ref cause) => cause,
CreateExclusionsPreviewError::InvalidInput(ref cause) => cause,
CreateExclusionsPreviewError::NoSuchEntity(ref cause) => cause,
CreateExclusionsPreviewError::PreviewGenerationInProgress(ref cause) => cause,
CreateExclusionsPreviewError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateResourceGroupError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
LimitExceeded(String),
ServiceTemporarilyUnavailable(String),
}
impl CreateResourceGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateResourceGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(CreateResourceGroupError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(CreateResourceGroupError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(CreateResourceGroupError::InvalidInput(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateResourceGroupError::LimitExceeded(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
CreateResourceGroupError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateResourceGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateResourceGroupError {
fn description(&self) -> &str {
match *self {
CreateResourceGroupError::AccessDenied(ref cause) => cause,
CreateResourceGroupError::Internal(ref cause) => cause,
CreateResourceGroupError::InvalidInput(ref cause) => cause,
CreateResourceGroupError::LimitExceeded(ref cause) => cause,
CreateResourceGroupError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteAssessmentRunError {
AccessDenied(String),
AssessmentRunInProgress(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl DeleteAssessmentRunError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAssessmentRunError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeleteAssessmentRunError::AccessDenied(err.msg))
}
"AssessmentRunInProgressException" => {
return RusotoError::Service(DeleteAssessmentRunError::AssessmentRunInProgress(
err.msg,
))
}
"InternalException" => {
return RusotoError::Service(DeleteAssessmentRunError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(DeleteAssessmentRunError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(DeleteAssessmentRunError::NoSuchEntity(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
DeleteAssessmentRunError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteAssessmentRunError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteAssessmentRunError {
fn description(&self) -> &str {
match *self {
DeleteAssessmentRunError::AccessDenied(ref cause) => cause,
DeleteAssessmentRunError::AssessmentRunInProgress(ref cause) => cause,
DeleteAssessmentRunError::Internal(ref cause) => cause,
DeleteAssessmentRunError::InvalidInput(ref cause) => cause,
DeleteAssessmentRunError::NoSuchEntity(ref cause) => cause,
DeleteAssessmentRunError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteAssessmentTargetError {
AccessDenied(String),
AssessmentRunInProgress(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl DeleteAssessmentTargetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAssessmentTargetError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeleteAssessmentTargetError::AccessDenied(err.msg))
}
"AssessmentRunInProgressException" => {
return RusotoError::Service(
DeleteAssessmentTargetError::AssessmentRunInProgress(err.msg),
)
}
"InternalException" => {
return RusotoError::Service(DeleteAssessmentTargetError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(DeleteAssessmentTargetError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(DeleteAssessmentTargetError::NoSuchEntity(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
DeleteAssessmentTargetError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteAssessmentTargetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteAssessmentTargetError {
fn description(&self) -> &str {
match *self {
DeleteAssessmentTargetError::AccessDenied(ref cause) => cause,
DeleteAssessmentTargetError::AssessmentRunInProgress(ref cause) => cause,
DeleteAssessmentTargetError::Internal(ref cause) => cause,
DeleteAssessmentTargetError::InvalidInput(ref cause) => cause,
DeleteAssessmentTargetError::NoSuchEntity(ref cause) => cause,
DeleteAssessmentTargetError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteAssessmentTemplateError {
AccessDenied(String),
AssessmentRunInProgress(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl DeleteAssessmentTemplateError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAssessmentTemplateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeleteAssessmentTemplateError::AccessDenied(
err.msg,
))
}
"AssessmentRunInProgressException" => {
return RusotoError::Service(
DeleteAssessmentTemplateError::AssessmentRunInProgress(err.msg),
)
}
"InternalException" => {
return RusotoError::Service(DeleteAssessmentTemplateError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(DeleteAssessmentTemplateError::InvalidInput(
err.msg,
))
}
"NoSuchEntityException" => {
return RusotoError::Service(DeleteAssessmentTemplateError::NoSuchEntity(
err.msg,
))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
DeleteAssessmentTemplateError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteAssessmentTemplateError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteAssessmentTemplateError {
fn description(&self) -> &str {
match *self {
DeleteAssessmentTemplateError::AccessDenied(ref cause) => cause,
DeleteAssessmentTemplateError::AssessmentRunInProgress(ref cause) => cause,
DeleteAssessmentTemplateError::Internal(ref cause) => cause,
DeleteAssessmentTemplateError::InvalidInput(ref cause) => cause,
DeleteAssessmentTemplateError::NoSuchEntity(ref cause) => cause,
DeleteAssessmentTemplateError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAssessmentRunsError {
Internal(String),
InvalidInput(String),
}
impl DescribeAssessmentRunsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAssessmentRunsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalException" => {
return RusotoError::Service(DescribeAssessmentRunsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(DescribeAssessmentRunsError::InvalidInput(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeAssessmentRunsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAssessmentRunsError {
fn description(&self) -> &str {
match *self {
DescribeAssessmentRunsError::Internal(ref cause) => cause,
DescribeAssessmentRunsError::InvalidInput(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAssessmentTargetsError {
Internal(String),
InvalidInput(String),
}
impl DescribeAssessmentTargetsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAssessmentTargetsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalException" => {
return RusotoError::Service(DescribeAssessmentTargetsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(DescribeAssessmentTargetsError::InvalidInput(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeAssessmentTargetsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAssessmentTargetsError {
fn description(&self) -> &str {
match *self {
DescribeAssessmentTargetsError::Internal(ref cause) => cause,
DescribeAssessmentTargetsError::InvalidInput(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAssessmentTemplatesError {
Internal(String),
InvalidInput(String),
}
impl DescribeAssessmentTemplatesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeAssessmentTemplatesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalException" => {
return RusotoError::Service(DescribeAssessmentTemplatesError::Internal(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(DescribeAssessmentTemplatesError::InvalidInput(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeAssessmentTemplatesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAssessmentTemplatesError {
fn description(&self) -> &str {
match *self {
DescribeAssessmentTemplatesError::Internal(ref cause) => cause,
DescribeAssessmentTemplatesError::InvalidInput(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCrossAccountAccessRoleError {
Internal(String),
}
impl DescribeCrossAccountAccessRoleError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeCrossAccountAccessRoleError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalException" => {
return RusotoError::Service(DescribeCrossAccountAccessRoleError::Internal(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeCrossAccountAccessRoleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCrossAccountAccessRoleError {
fn description(&self) -> &str {
match *self {
DescribeCrossAccountAccessRoleError::Internal(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeExclusionsError {
Internal(String),
InvalidInput(String),
}
impl DescribeExclusionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeExclusionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalException" => {
return RusotoError::Service(DescribeExclusionsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(DescribeExclusionsError::InvalidInput(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeExclusionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeExclusionsError {
fn description(&self) -> &str {
match *self {
DescribeExclusionsError::Internal(ref cause) => cause,
DescribeExclusionsError::InvalidInput(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeFindingsError {
Internal(String),
InvalidInput(String),
}
impl DescribeFindingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeFindingsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalException" => {
return RusotoError::Service(DescribeFindingsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(DescribeFindingsError::InvalidInput(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeFindingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeFindingsError {
fn description(&self) -> &str {
match *self {
DescribeFindingsError::Internal(ref cause) => cause,
DescribeFindingsError::InvalidInput(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeResourceGroupsError {
Internal(String),
InvalidInput(String),
}
impl DescribeResourceGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeResourceGroupsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalException" => {
return RusotoError::Service(DescribeResourceGroupsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(DescribeResourceGroupsError::InvalidInput(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeResourceGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeResourceGroupsError {
fn description(&self) -> &str {
match *self {
DescribeResourceGroupsError::Internal(ref cause) => cause,
DescribeResourceGroupsError::InvalidInput(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeRulesPackagesError {
Internal(String),
InvalidInput(String),
}
impl DescribeRulesPackagesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeRulesPackagesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalException" => {
return RusotoError::Service(DescribeRulesPackagesError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(DescribeRulesPackagesError::InvalidInput(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeRulesPackagesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeRulesPackagesError {
fn description(&self) -> &str {
match *self {
DescribeRulesPackagesError::Internal(ref cause) => cause,
DescribeRulesPackagesError::InvalidInput(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAssessmentReportError {
AccessDenied(String),
AssessmentRunInProgress(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
UnsupportedFeature(String),
}
impl GetAssessmentReportError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetAssessmentReportError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(GetAssessmentReportError::AccessDenied(err.msg))
}
"AssessmentRunInProgressException" => {
return RusotoError::Service(GetAssessmentReportError::AssessmentRunInProgress(
err.msg,
))
}
"InternalException" => {
return RusotoError::Service(GetAssessmentReportError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(GetAssessmentReportError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(GetAssessmentReportError::NoSuchEntity(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
GetAssessmentReportError::ServiceTemporarilyUnavailable(err.msg),
)
}
"UnsupportedFeatureException" => {
return RusotoError::Service(GetAssessmentReportError::UnsupportedFeature(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetAssessmentReportError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAssessmentReportError {
fn description(&self) -> &str {
match *self {
GetAssessmentReportError::AccessDenied(ref cause) => cause,
GetAssessmentReportError::AssessmentRunInProgress(ref cause) => cause,
GetAssessmentReportError::Internal(ref cause) => cause,
GetAssessmentReportError::InvalidInput(ref cause) => cause,
GetAssessmentReportError::NoSuchEntity(ref cause) => cause,
GetAssessmentReportError::ServiceTemporarilyUnavailable(ref cause) => cause,
GetAssessmentReportError::UnsupportedFeature(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetExclusionsPreviewError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
}
impl GetExclusionsPreviewError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetExclusionsPreviewError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(GetExclusionsPreviewError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(GetExclusionsPreviewError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(GetExclusionsPreviewError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(GetExclusionsPreviewError::NoSuchEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetExclusionsPreviewError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetExclusionsPreviewError {
fn description(&self) -> &str {
match *self {
GetExclusionsPreviewError::AccessDenied(ref cause) => cause,
GetExclusionsPreviewError::Internal(ref cause) => cause,
GetExclusionsPreviewError::InvalidInput(ref cause) => cause,
GetExclusionsPreviewError::NoSuchEntity(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetTelemetryMetadataError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
}
impl GetTelemetryMetadataError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetTelemetryMetadataError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(GetTelemetryMetadataError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(GetTelemetryMetadataError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(GetTelemetryMetadataError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(GetTelemetryMetadataError::NoSuchEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetTelemetryMetadataError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetTelemetryMetadataError {
fn description(&self) -> &str {
match *self {
GetTelemetryMetadataError::AccessDenied(ref cause) => cause,
GetTelemetryMetadataError::Internal(ref cause) => cause,
GetTelemetryMetadataError::InvalidInput(ref cause) => cause,
GetTelemetryMetadataError::NoSuchEntity(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAssessmentRunAgentsError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
}
impl ListAssessmentRunAgentsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListAssessmentRunAgentsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListAssessmentRunAgentsError::AccessDenied(
err.msg,
))
}
"InternalException" => {
return RusotoError::Service(ListAssessmentRunAgentsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(ListAssessmentRunAgentsError::InvalidInput(
err.msg,
))
}
"NoSuchEntityException" => {
return RusotoError::Service(ListAssessmentRunAgentsError::NoSuchEntity(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListAssessmentRunAgentsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAssessmentRunAgentsError {
fn description(&self) -> &str {
match *self {
ListAssessmentRunAgentsError::AccessDenied(ref cause) => cause,
ListAssessmentRunAgentsError::Internal(ref cause) => cause,
ListAssessmentRunAgentsError::InvalidInput(ref cause) => cause,
ListAssessmentRunAgentsError::NoSuchEntity(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAssessmentRunsError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
}
impl ListAssessmentRunsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListAssessmentRunsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListAssessmentRunsError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(ListAssessmentRunsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(ListAssessmentRunsError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(ListAssessmentRunsError::NoSuchEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListAssessmentRunsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAssessmentRunsError {
fn description(&self) -> &str {
match *self {
ListAssessmentRunsError::AccessDenied(ref cause) => cause,
ListAssessmentRunsError::Internal(ref cause) => cause,
ListAssessmentRunsError::InvalidInput(ref cause) => cause,
ListAssessmentRunsError::NoSuchEntity(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAssessmentTargetsError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
}
impl ListAssessmentTargetsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListAssessmentTargetsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListAssessmentTargetsError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(ListAssessmentTargetsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(ListAssessmentTargetsError::InvalidInput(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListAssessmentTargetsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAssessmentTargetsError {
fn description(&self) -> &str {
match *self {
ListAssessmentTargetsError::AccessDenied(ref cause) => cause,
ListAssessmentTargetsError::Internal(ref cause) => cause,
ListAssessmentTargetsError::InvalidInput(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAssessmentTemplatesError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
}
impl ListAssessmentTemplatesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListAssessmentTemplatesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListAssessmentTemplatesError::AccessDenied(
err.msg,
))
}
"InternalException" => {
return RusotoError::Service(ListAssessmentTemplatesError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(ListAssessmentTemplatesError::InvalidInput(
err.msg,
))
}
"NoSuchEntityException" => {
return RusotoError::Service(ListAssessmentTemplatesError::NoSuchEntity(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListAssessmentTemplatesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAssessmentTemplatesError {
fn description(&self) -> &str {
match *self {
ListAssessmentTemplatesError::AccessDenied(ref cause) => cause,
ListAssessmentTemplatesError::Internal(ref cause) => cause,
ListAssessmentTemplatesError::InvalidInput(ref cause) => cause,
ListAssessmentTemplatesError::NoSuchEntity(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListEventSubscriptionsError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
}
impl ListEventSubscriptionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListEventSubscriptionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListEventSubscriptionsError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(ListEventSubscriptionsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(ListEventSubscriptionsError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(ListEventSubscriptionsError::NoSuchEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListEventSubscriptionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListEventSubscriptionsError {
fn description(&self) -> &str {
match *self {
ListEventSubscriptionsError::AccessDenied(ref cause) => cause,
ListEventSubscriptionsError::Internal(ref cause) => cause,
ListEventSubscriptionsError::InvalidInput(ref cause) => cause,
ListEventSubscriptionsError::NoSuchEntity(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListExclusionsError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
}
impl ListExclusionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListExclusionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListExclusionsError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(ListExclusionsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(ListExclusionsError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(ListExclusionsError::NoSuchEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListExclusionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListExclusionsError {
fn description(&self) -> &str {
match *self {
ListExclusionsError::AccessDenied(ref cause) => cause,
ListExclusionsError::Internal(ref cause) => cause,
ListExclusionsError::InvalidInput(ref cause) => cause,
ListExclusionsError::NoSuchEntity(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListFindingsError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
}
impl ListFindingsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListFindingsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListFindingsError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(ListFindingsError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(ListFindingsError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(ListFindingsError::NoSuchEntity(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::AccessDenied(ref cause) => cause,
ListFindingsError::Internal(ref cause) => cause,
ListFindingsError::InvalidInput(ref cause) => cause,
ListFindingsError::NoSuchEntity(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListRulesPackagesError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
}
impl ListRulesPackagesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListRulesPackagesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListRulesPackagesError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(ListRulesPackagesError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(ListRulesPackagesError::InvalidInput(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListRulesPackagesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListRulesPackagesError {
fn description(&self) -> &str {
match *self {
ListRulesPackagesError::AccessDenied(ref cause) => cause,
ListRulesPackagesError::Internal(ref cause) => cause,
ListRulesPackagesError::InvalidInput(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListTagsForResourceError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(ListTagsForResourceError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(ListTagsForResourceError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(ListTagsForResourceError::NoSuchEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::AccessDenied(ref cause) => cause,
ListTagsForResourceError::Internal(ref cause) => cause,
ListTagsForResourceError::InvalidInput(ref cause) => cause,
ListTagsForResourceError::NoSuchEntity(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PreviewAgentsError {
AccessDenied(String),
Internal(String),
InvalidCrossAccountRole(String),
InvalidInput(String),
NoSuchEntity(String),
}
impl PreviewAgentsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PreviewAgentsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(PreviewAgentsError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(PreviewAgentsError::Internal(err.msg))
}
"InvalidCrossAccountRoleException" => {
return RusotoError::Service(PreviewAgentsError::InvalidCrossAccountRole(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(PreviewAgentsError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(PreviewAgentsError::NoSuchEntity(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PreviewAgentsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PreviewAgentsError {
fn description(&self) -> &str {
match *self {
PreviewAgentsError::AccessDenied(ref cause) => cause,
PreviewAgentsError::Internal(ref cause) => cause,
PreviewAgentsError::InvalidCrossAccountRole(ref cause) => cause,
PreviewAgentsError::InvalidInput(ref cause) => cause,
PreviewAgentsError::NoSuchEntity(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RegisterCrossAccountAccessRoleError {
AccessDenied(String),
Internal(String),
InvalidCrossAccountRole(String),
InvalidInput(String),
ServiceTemporarilyUnavailable(String),
}
impl RegisterCrossAccountAccessRoleError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<RegisterCrossAccountAccessRoleError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(RegisterCrossAccountAccessRoleError::AccessDenied(
err.msg,
))
}
"InternalException" => {
return RusotoError::Service(RegisterCrossAccountAccessRoleError::Internal(
err.msg,
))
}
"InvalidCrossAccountRoleException" => {
return RusotoError::Service(
RegisterCrossAccountAccessRoleError::InvalidCrossAccountRole(err.msg),
)
}
"InvalidInputException" => {
return RusotoError::Service(RegisterCrossAccountAccessRoleError::InvalidInput(
err.msg,
))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
RegisterCrossAccountAccessRoleError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RegisterCrossAccountAccessRoleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RegisterCrossAccountAccessRoleError {
fn description(&self) -> &str {
match *self {
RegisterCrossAccountAccessRoleError::AccessDenied(ref cause) => cause,
RegisterCrossAccountAccessRoleError::Internal(ref cause) => cause,
RegisterCrossAccountAccessRoleError::InvalidCrossAccountRole(ref cause) => cause,
RegisterCrossAccountAccessRoleError::InvalidInput(ref cause) => cause,
RegisterCrossAccountAccessRoleError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RemoveAttributesFromFindingsError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl RemoveAttributesFromFindingsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<RemoveAttributesFromFindingsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(RemoveAttributesFromFindingsError::AccessDenied(
err.msg,
))
}
"InternalException" => {
return RusotoError::Service(RemoveAttributesFromFindingsError::Internal(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(RemoveAttributesFromFindingsError::InvalidInput(
err.msg,
))
}
"NoSuchEntityException" => {
return RusotoError::Service(RemoveAttributesFromFindingsError::NoSuchEntity(
err.msg,
))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
RemoveAttributesFromFindingsError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RemoveAttributesFromFindingsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RemoveAttributesFromFindingsError {
fn description(&self) -> &str {
match *self {
RemoveAttributesFromFindingsError::AccessDenied(ref cause) => cause,
RemoveAttributesFromFindingsError::Internal(ref cause) => cause,
RemoveAttributesFromFindingsError::InvalidInput(ref cause) => cause,
RemoveAttributesFromFindingsError::NoSuchEntity(ref cause) => cause,
RemoveAttributesFromFindingsError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SetTagsForResourceError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl SetTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SetTagsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(SetTagsForResourceError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(SetTagsForResourceError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(SetTagsForResourceError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(SetTagsForResourceError::NoSuchEntity(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
SetTagsForResourceError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SetTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SetTagsForResourceError {
fn description(&self) -> &str {
match *self {
SetTagsForResourceError::AccessDenied(ref cause) => cause,
SetTagsForResourceError::Internal(ref cause) => cause,
SetTagsForResourceError::InvalidInput(ref cause) => cause,
SetTagsForResourceError::NoSuchEntity(ref cause) => cause,
SetTagsForResourceError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartAssessmentRunError {
AccessDenied(String),
AgentsAlreadyRunningAssessment(String),
Internal(String),
InvalidCrossAccountRole(String),
InvalidInput(String),
LimitExceeded(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl StartAssessmentRunError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartAssessmentRunError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(StartAssessmentRunError::AccessDenied(err.msg))
}
"AgentsAlreadyRunningAssessmentException" => {
return RusotoError::Service(
StartAssessmentRunError::AgentsAlreadyRunningAssessment(err.msg),
)
}
"InternalException" => {
return RusotoError::Service(StartAssessmentRunError::Internal(err.msg))
}
"InvalidCrossAccountRoleException" => {
return RusotoError::Service(StartAssessmentRunError::InvalidCrossAccountRole(
err.msg,
))
}
"InvalidInputException" => {
return RusotoError::Service(StartAssessmentRunError::InvalidInput(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(StartAssessmentRunError::LimitExceeded(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(StartAssessmentRunError::NoSuchEntity(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
StartAssessmentRunError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartAssessmentRunError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartAssessmentRunError {
fn description(&self) -> &str {
match *self {
StartAssessmentRunError::AccessDenied(ref cause) => cause,
StartAssessmentRunError::AgentsAlreadyRunningAssessment(ref cause) => cause,
StartAssessmentRunError::Internal(ref cause) => cause,
StartAssessmentRunError::InvalidCrossAccountRole(ref cause) => cause,
StartAssessmentRunError::InvalidInput(ref cause) => cause,
StartAssessmentRunError::LimitExceeded(ref cause) => cause,
StartAssessmentRunError::NoSuchEntity(ref cause) => cause,
StartAssessmentRunError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopAssessmentRunError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl StopAssessmentRunError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopAssessmentRunError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(StopAssessmentRunError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(StopAssessmentRunError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(StopAssessmentRunError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(StopAssessmentRunError::NoSuchEntity(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
StopAssessmentRunError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopAssessmentRunError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopAssessmentRunError {
fn description(&self) -> &str {
match *self {
StopAssessmentRunError::AccessDenied(ref cause) => cause,
StopAssessmentRunError::Internal(ref cause) => cause,
StopAssessmentRunError::InvalidInput(ref cause) => cause,
StopAssessmentRunError::NoSuchEntity(ref cause) => cause,
StopAssessmentRunError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum SubscribeToEventError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
LimitExceeded(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl SubscribeToEventError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SubscribeToEventError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(SubscribeToEventError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(SubscribeToEventError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(SubscribeToEventError::InvalidInput(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(SubscribeToEventError::LimitExceeded(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(SubscribeToEventError::NoSuchEntity(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
SubscribeToEventError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for SubscribeToEventError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for SubscribeToEventError {
fn description(&self) -> &str {
match *self {
SubscribeToEventError::AccessDenied(ref cause) => cause,
SubscribeToEventError::Internal(ref cause) => cause,
SubscribeToEventError::InvalidInput(ref cause) => cause,
SubscribeToEventError::LimitExceeded(ref cause) => cause,
SubscribeToEventError::NoSuchEntity(ref cause) => cause,
SubscribeToEventError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UnsubscribeFromEventError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl UnsubscribeFromEventError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UnsubscribeFromEventError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UnsubscribeFromEventError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(UnsubscribeFromEventError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(UnsubscribeFromEventError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(UnsubscribeFromEventError::NoSuchEntity(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
UnsubscribeFromEventError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UnsubscribeFromEventError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UnsubscribeFromEventError {
fn description(&self) -> &str {
match *self {
UnsubscribeFromEventError::AccessDenied(ref cause) => cause,
UnsubscribeFromEventError::Internal(ref cause) => cause,
UnsubscribeFromEventError::InvalidInput(ref cause) => cause,
UnsubscribeFromEventError::NoSuchEntity(ref cause) => cause,
UnsubscribeFromEventError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateAssessmentTargetError {
AccessDenied(String),
Internal(String),
InvalidInput(String),
NoSuchEntity(String),
ServiceTemporarilyUnavailable(String),
}
impl UpdateAssessmentTargetError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateAssessmentTargetError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UpdateAssessmentTargetError::AccessDenied(err.msg))
}
"InternalException" => {
return RusotoError::Service(UpdateAssessmentTargetError::Internal(err.msg))
}
"InvalidInputException" => {
return RusotoError::Service(UpdateAssessmentTargetError::InvalidInput(err.msg))
}
"NoSuchEntityException" => {
return RusotoError::Service(UpdateAssessmentTargetError::NoSuchEntity(err.msg))
}
"ServiceTemporarilyUnavailableException" => {
return RusotoError::Service(
UpdateAssessmentTargetError::ServiceTemporarilyUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateAssessmentTargetError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateAssessmentTargetError {
fn description(&self) -> &str {
match *self {
UpdateAssessmentTargetError::AccessDenied(ref cause) => cause,
UpdateAssessmentTargetError::Internal(ref cause) => cause,
UpdateAssessmentTargetError::InvalidInput(ref cause) => cause,
UpdateAssessmentTargetError::NoSuchEntity(ref cause) => cause,
UpdateAssessmentTargetError::ServiceTemporarilyUnavailable(ref cause) => cause,
}
}
}
pub trait Inspector {
fn add_attributes_to_findings(
&self,
input: AddAttributesToFindingsRequest,
) -> RusotoFuture<AddAttributesToFindingsResponse, AddAttributesToFindingsError>;
fn create_assessment_target(
&self,
input: CreateAssessmentTargetRequest,
) -> RusotoFuture<CreateAssessmentTargetResponse, CreateAssessmentTargetError>;
fn create_assessment_template(
&self,
input: CreateAssessmentTemplateRequest,
) -> RusotoFuture<CreateAssessmentTemplateResponse, CreateAssessmentTemplateError>;
fn create_exclusions_preview(
&self,
input: CreateExclusionsPreviewRequest,
) -> RusotoFuture<CreateExclusionsPreviewResponse, CreateExclusionsPreviewError>;
fn create_resource_group(
&self,
input: CreateResourceGroupRequest,
) -> RusotoFuture<CreateResourceGroupResponse, CreateResourceGroupError>;
fn delete_assessment_run(
&self,
input: DeleteAssessmentRunRequest,
) -> RusotoFuture<(), DeleteAssessmentRunError>;
fn delete_assessment_target(
&self,
input: DeleteAssessmentTargetRequest,
) -> RusotoFuture<(), DeleteAssessmentTargetError>;
fn delete_assessment_template(
&self,
input: DeleteAssessmentTemplateRequest,
) -> RusotoFuture<(), DeleteAssessmentTemplateError>;
fn describe_assessment_runs(
&self,
input: DescribeAssessmentRunsRequest,
) -> RusotoFuture<DescribeAssessmentRunsResponse, DescribeAssessmentRunsError>;
fn describe_assessment_targets(
&self,
input: DescribeAssessmentTargetsRequest,
) -> RusotoFuture<DescribeAssessmentTargetsResponse, DescribeAssessmentTargetsError>;
fn describe_assessment_templates(
&self,
input: DescribeAssessmentTemplatesRequest,
) -> RusotoFuture<DescribeAssessmentTemplatesResponse, DescribeAssessmentTemplatesError>;
fn describe_cross_account_access_role(
&self,
) -> RusotoFuture<DescribeCrossAccountAccessRoleResponse, DescribeCrossAccountAccessRoleError>;
fn describe_exclusions(
&self,
input: DescribeExclusionsRequest,
) -> RusotoFuture<DescribeExclusionsResponse, DescribeExclusionsError>;
fn describe_findings(
&self,
input: DescribeFindingsRequest,
) -> RusotoFuture<DescribeFindingsResponse, DescribeFindingsError>;
fn describe_resource_groups(
&self,
input: DescribeResourceGroupsRequest,
) -> RusotoFuture<DescribeResourceGroupsResponse, DescribeResourceGroupsError>;
fn describe_rules_packages(
&self,
input: DescribeRulesPackagesRequest,
) -> RusotoFuture<DescribeRulesPackagesResponse, DescribeRulesPackagesError>;
fn get_assessment_report(
&self,
input: GetAssessmentReportRequest,
) -> RusotoFuture<GetAssessmentReportResponse, GetAssessmentReportError>;
fn get_exclusions_preview(
&self,
input: GetExclusionsPreviewRequest,
) -> RusotoFuture<GetExclusionsPreviewResponse, GetExclusionsPreviewError>;
fn get_telemetry_metadata(
&self,
input: GetTelemetryMetadataRequest,
) -> RusotoFuture<GetTelemetryMetadataResponse, GetTelemetryMetadataError>;
fn list_assessment_run_agents(
&self,
input: ListAssessmentRunAgentsRequest,
) -> RusotoFuture<ListAssessmentRunAgentsResponse, ListAssessmentRunAgentsError>;
fn list_assessment_runs(
&self,
input: ListAssessmentRunsRequest,
) -> RusotoFuture<ListAssessmentRunsResponse, ListAssessmentRunsError>;
fn list_assessment_targets(
&self,
input: ListAssessmentTargetsRequest,
) -> RusotoFuture<ListAssessmentTargetsResponse, ListAssessmentTargetsError>;
fn list_assessment_templates(
&self,
input: ListAssessmentTemplatesRequest,
) -> RusotoFuture<ListAssessmentTemplatesResponse, ListAssessmentTemplatesError>;
fn list_event_subscriptions(
&self,
input: ListEventSubscriptionsRequest,
) -> RusotoFuture<ListEventSubscriptionsResponse, ListEventSubscriptionsError>;
fn list_exclusions(
&self,
input: ListExclusionsRequest,
) -> RusotoFuture<ListExclusionsResponse, ListExclusionsError>;
fn list_findings(
&self,
input: ListFindingsRequest,
) -> RusotoFuture<ListFindingsResponse, ListFindingsError>;
fn list_rules_packages(
&self,
input: ListRulesPackagesRequest,
) -> RusotoFuture<ListRulesPackagesResponse, ListRulesPackagesError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError>;
fn preview_agents(
&self,
input: PreviewAgentsRequest,
) -> RusotoFuture<PreviewAgentsResponse, PreviewAgentsError>;
fn register_cross_account_access_role(
&self,
input: RegisterCrossAccountAccessRoleRequest,
) -> RusotoFuture<(), RegisterCrossAccountAccessRoleError>;
fn remove_attributes_from_findings(
&self,
input: RemoveAttributesFromFindingsRequest,
) -> RusotoFuture<RemoveAttributesFromFindingsResponse, RemoveAttributesFromFindingsError>;
fn set_tags_for_resource(
&self,
input: SetTagsForResourceRequest,
) -> RusotoFuture<(), SetTagsForResourceError>;
fn start_assessment_run(
&self,
input: StartAssessmentRunRequest,
) -> RusotoFuture<StartAssessmentRunResponse, StartAssessmentRunError>;
fn stop_assessment_run(
&self,
input: StopAssessmentRunRequest,
) -> RusotoFuture<(), StopAssessmentRunError>;
fn subscribe_to_event(
&self,
input: SubscribeToEventRequest,
) -> RusotoFuture<(), SubscribeToEventError>;
fn unsubscribe_from_event(
&self,
input: UnsubscribeFromEventRequest,
) -> RusotoFuture<(), UnsubscribeFromEventError>;
fn update_assessment_target(
&self,
input: UpdateAssessmentTargetRequest,
) -> RusotoFuture<(), UpdateAssessmentTargetError>;
}
#[derive(Clone)]
pub struct InspectorClient {
client: Client,
region: region::Region,
}
impl InspectorClient {
pub fn new(region: region::Region) -> InspectorClient {
InspectorClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> InspectorClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
InspectorClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Inspector for InspectorClient {
fn add_attributes_to_findings(
&self,
input: AddAttributesToFindingsRequest,
) -> RusotoFuture<AddAttributesToFindingsResponse, AddAttributesToFindingsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.AddAttributesToFindings");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<AddAttributesToFindingsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AddAttributesToFindingsError::from_response(response))
}))
}
})
}
fn create_assessment_target(
&self,
input: CreateAssessmentTargetRequest,
) -> RusotoFuture<CreateAssessmentTargetResponse, CreateAssessmentTargetError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.CreateAssessmentTarget");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateAssessmentTargetResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateAssessmentTargetError::from_response(response))
}),
)
}
})
}
fn create_assessment_template(
&self,
input: CreateAssessmentTemplateRequest,
) -> RusotoFuture<CreateAssessmentTemplateResponse, CreateAssessmentTemplateError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.CreateAssessmentTemplate");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateAssessmentTemplateResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateAssessmentTemplateError::from_response(response))
}))
}
})
}
fn create_exclusions_preview(
&self,
input: CreateExclusionsPreviewRequest,
) -> RusotoFuture<CreateExclusionsPreviewResponse, CreateExclusionsPreviewError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.CreateExclusionsPreview");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateExclusionsPreviewResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateExclusionsPreviewError::from_response(response))
}))
}
})
}
fn create_resource_group(
&self,
input: CreateResourceGroupRequest,
) -> RusotoFuture<CreateResourceGroupResponse, CreateResourceGroupError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.CreateResourceGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateResourceGroupResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateResourceGroupError::from_response(response))
}),
)
}
})
}
fn delete_assessment_run(
&self,
input: DeleteAssessmentRunRequest,
) -> RusotoFuture<(), DeleteAssessmentRunError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.DeleteAssessmentRun");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteAssessmentRunError::from_response(response))
}),
)
}
})
}
fn delete_assessment_target(
&self,
input: DeleteAssessmentTargetRequest,
) -> RusotoFuture<(), DeleteAssessmentTargetError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.DeleteAssessmentTarget");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteAssessmentTargetError::from_response(response))
}),
)
}
})
}
fn delete_assessment_template(
&self,
input: DeleteAssessmentTemplateRequest,
) -> RusotoFuture<(), DeleteAssessmentTemplateError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.DeleteAssessmentTemplate");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteAssessmentTemplateError::from_response(response))
}))
}
})
}
fn describe_assessment_runs(
&self,
input: DescribeAssessmentRunsRequest,
) -> RusotoFuture<DescribeAssessmentRunsResponse, DescribeAssessmentRunsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.DescribeAssessmentRuns");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeAssessmentRunsResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeAssessmentRunsError::from_response(response))
}),
)
}
})
}
fn describe_assessment_targets(
&self,
input: DescribeAssessmentTargetsRequest,
) -> RusotoFuture<DescribeAssessmentTargetsResponse, DescribeAssessmentTargetsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.DescribeAssessmentTargets");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeAssessmentTargetsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeAssessmentTargetsError::from_response(response))
}))
}
})
}
fn describe_assessment_templates(
&self,
input: DescribeAssessmentTemplatesRequest,
) -> RusotoFuture<DescribeAssessmentTemplatesResponse, DescribeAssessmentTemplatesError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"InspectorService.DescribeAssessmentTemplates",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeAssessmentTemplatesResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeAssessmentTemplatesError::from_response(response))
}))
}
})
}
fn describe_cross_account_access_role(
&self,
) -> RusotoFuture<DescribeCrossAccountAccessRoleResponse, DescribeCrossAccountAccessRoleError>
{
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"InspectorService.DescribeCrossAccountAccessRole",
);
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeCrossAccountAccessRoleResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeCrossAccountAccessRoleError::from_response(response))
}))
}
})
}
fn describe_exclusions(
&self,
input: DescribeExclusionsRequest,
) -> RusotoFuture<DescribeExclusionsResponse, DescribeExclusionsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.DescribeExclusions");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeExclusionsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeExclusionsError::from_response(response))),
)
}
})
}
fn describe_findings(
&self,
input: DescribeFindingsRequest,
) -> RusotoFuture<DescribeFindingsResponse, DescribeFindingsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.DescribeFindings");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeFindingsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeFindingsError::from_response(response))),
)
}
})
}
fn describe_resource_groups(
&self,
input: DescribeResourceGroupsRequest,
) -> RusotoFuture<DescribeResourceGroupsResponse, DescribeResourceGroupsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.DescribeResourceGroups");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeResourceGroupsResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeResourceGroupsError::from_response(response))
}),
)
}
})
}
fn describe_rules_packages(
&self,
input: DescribeRulesPackagesRequest,
) -> RusotoFuture<DescribeRulesPackagesResponse, DescribeRulesPackagesError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.DescribeRulesPackages");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeRulesPackagesResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeRulesPackagesError::from_response(response))
}),
)
}
})
}
fn get_assessment_report(
&self,
input: GetAssessmentReportRequest,
) -> RusotoFuture<GetAssessmentReportResponse, GetAssessmentReportError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.GetAssessmentReport");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetAssessmentReportResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetAssessmentReportError::from_response(response))
}),
)
}
})
}
fn get_exclusions_preview(
&self,
input: GetExclusionsPreviewRequest,
) -> RusotoFuture<GetExclusionsPreviewResponse, GetExclusionsPreviewError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.GetExclusionsPreview");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetExclusionsPreviewResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetExclusionsPreviewError::from_response(response))
}),
)
}
})
}
fn get_telemetry_metadata(
&self,
input: GetTelemetryMetadataRequest,
) -> RusotoFuture<GetTelemetryMetadataResponse, GetTelemetryMetadataError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.GetTelemetryMetadata");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetTelemetryMetadataResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetTelemetryMetadataError::from_response(response))
}),
)
}
})
}
fn list_assessment_run_agents(
&self,
input: ListAssessmentRunAgentsRequest,
) -> RusotoFuture<ListAssessmentRunAgentsResponse, ListAssessmentRunAgentsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.ListAssessmentRunAgents");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListAssessmentRunAgentsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListAssessmentRunAgentsError::from_response(response))
}))
}
})
}
fn list_assessment_runs(
&self,
input: ListAssessmentRunsRequest,
) -> RusotoFuture<ListAssessmentRunsResponse, ListAssessmentRunsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.ListAssessmentRuns");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListAssessmentRunsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListAssessmentRunsError::from_response(response))),
)
}
})
}
fn list_assessment_targets(
&self,
input: ListAssessmentTargetsRequest,
) -> RusotoFuture<ListAssessmentTargetsResponse, ListAssessmentTargetsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.ListAssessmentTargets");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListAssessmentTargetsResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListAssessmentTargetsError::from_response(response))
}),
)
}
})
}
fn list_assessment_templates(
&self,
input: ListAssessmentTemplatesRequest,
) -> RusotoFuture<ListAssessmentTemplatesResponse, ListAssessmentTemplatesError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.ListAssessmentTemplates");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListAssessmentTemplatesResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListAssessmentTemplatesError::from_response(response))
}))
}
})
}
fn list_event_subscriptions(
&self,
input: ListEventSubscriptionsRequest,
) -> RusotoFuture<ListEventSubscriptionsResponse, ListEventSubscriptionsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.ListEventSubscriptions");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListEventSubscriptionsResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListEventSubscriptionsError::from_response(response))
}),
)
}
})
}
fn list_exclusions(
&self,
input: ListExclusionsRequest,
) -> RusotoFuture<ListExclusionsResponse, ListExclusionsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.ListExclusions");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListExclusionsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListExclusionsError::from_response(response))),
)
}
})
}
fn list_findings(
&self,
input: ListFindingsRequest,
) -> RusotoFuture<ListFindingsResponse, ListFindingsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.ListFindings");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListFindingsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListFindingsError::from_response(response))),
)
}
})
}
fn list_rules_packages(
&self,
input: ListRulesPackagesRequest,
) -> RusotoFuture<ListRulesPackagesResponse, ListRulesPackagesError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.ListRulesPackages");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListRulesPackagesResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListRulesPackagesError::from_response(response))),
)
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.ListTagsForResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsForResourceResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn preview_agents(
&self,
input: PreviewAgentsRequest,
) -> RusotoFuture<PreviewAgentsResponse, PreviewAgentsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.PreviewAgents");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<PreviewAgentsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PreviewAgentsError::from_response(response))),
)
}
})
}
fn register_cross_account_access_role(
&self,
input: RegisterCrossAccountAccessRoleRequest,
) -> RusotoFuture<(), RegisterCrossAccountAccessRoleError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"InspectorService.RegisterCrossAccountAccessRole",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RegisterCrossAccountAccessRoleError::from_response(response))
}))
}
})
}
fn remove_attributes_from_findings(
&self,
input: RemoveAttributesFromFindingsRequest,
) -> RusotoFuture<RemoveAttributesFromFindingsResponse, RemoveAttributesFromFindingsError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"InspectorService.RemoveAttributesFromFindings",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<RemoveAttributesFromFindingsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RemoveAttributesFromFindingsError::from_response(response))
}))
}
})
}
fn set_tags_for_resource(
&self,
input: SetTagsForResourceRequest,
) -> RusotoFuture<(), SetTagsForResourceError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.SetTagsForResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(SetTagsForResourceError::from_response(response))),
)
}
})
}
fn start_assessment_run(
&self,
input: StartAssessmentRunRequest,
) -> RusotoFuture<StartAssessmentRunResponse, StartAssessmentRunError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.StartAssessmentRun");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartAssessmentRunResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StartAssessmentRunError::from_response(response))),
)
}
})
}
fn stop_assessment_run(
&self,
input: StopAssessmentRunRequest,
) -> RusotoFuture<(), StopAssessmentRunError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.StopAssessmentRun");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopAssessmentRunError::from_response(response))),
)
}
})
}
fn subscribe_to_event(
&self,
input: SubscribeToEventRequest,
) -> RusotoFuture<(), SubscribeToEventError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.SubscribeToEvent");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(SubscribeToEventError::from_response(response))),
)
}
})
}
fn unsubscribe_from_event(
&self,
input: UnsubscribeFromEventRequest,
) -> RusotoFuture<(), UnsubscribeFromEventError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.UnsubscribeFromEvent");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UnsubscribeFromEventError::from_response(response))
}),
)
}
})
}
fn update_assessment_target(
&self,
input: UpdateAssessmentTargetRequest,
) -> RusotoFuture<(), UpdateAssessmentTargetError> {
let mut request = SignedRequest::new("POST", "inspector", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "InspectorService.UpdateAssessmentTarget");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateAssessmentTargetError::from_response(response))
}),
)
}
})
}
}