use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateUserRequest {
#[serde(rename = "DirectoryUserId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub directory_user_id: Option<String>,
#[serde(rename = "HierarchyGroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hierarchy_group_id: Option<String>,
#[serde(rename = "IdentityInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_info: Option<UserIdentityInfo>,
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "Password")]
#[serde(skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
#[serde(rename = "PhoneConfig")]
pub phone_config: UserPhoneConfig,
#[serde(rename = "RoutingProfileId")]
pub routing_profile_id: String,
#[serde(rename = "SecurityProfileIds")]
pub security_profile_ids: Vec<String>,
#[serde(rename = "Username")]
pub username: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateUserResponse {
#[serde(rename = "UserArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_arn: Option<String>,
#[serde(rename = "UserId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Credentials {
#[serde(rename = "AccessToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_token: Option<String>,
#[serde(rename = "AccessTokenExpiration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_token_expiration: Option<f64>,
#[serde(rename = "RefreshToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub refresh_token: Option<String>,
#[serde(rename = "RefreshTokenExpiration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub refresh_token_expiration: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct CurrentMetric {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Unit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CurrentMetricData {
#[serde(rename = "Metric")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric: Option<CurrentMetric>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CurrentMetricResult {
#[serde(rename = "Collections")]
#[serde(skip_serializing_if = "Option::is_none")]
pub collections: Option<Vec<CurrentMetricData>>,
#[serde(rename = "Dimensions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dimensions: Option<Dimensions>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteUserRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeUserHierarchyGroupRequest {
#[serde(rename = "HierarchyGroupId")]
pub hierarchy_group_id: String,
#[serde(rename = "InstanceId")]
pub instance_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeUserHierarchyGroupResponse {
#[serde(rename = "HierarchyGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hierarchy_group: Option<HierarchyGroup>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeUserHierarchyStructureRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeUserHierarchyStructureResponse {
#[serde(rename = "HierarchyStructure")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hierarchy_structure: Option<HierarchyStructure>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeUserRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeUserResponse {
#[serde(rename = "User")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<User>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Dimensions {
#[serde(rename = "Channel")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channel: Option<String>,
#[serde(rename = "Queue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub queue: Option<QueueReference>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct Filters {
#[serde(rename = "Channels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub channels: Option<Vec<String>>,
#[serde(rename = "Queues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub queues: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetContactAttributesRequest {
#[serde(rename = "InitialContactId")]
pub initial_contact_id: String,
#[serde(rename = "InstanceId")]
pub instance_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetContactAttributesResponse {
#[serde(rename = "Attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetCurrentMetricDataRequest {
#[serde(rename = "CurrentMetrics")]
pub current_metrics: Vec<CurrentMetric>,
#[serde(rename = "Filters")]
pub filters: Filters,
#[serde(rename = "Groupings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groupings: Option<Vec<String>>,
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetCurrentMetricDataResponse {
#[serde(rename = "DataSnapshotTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_snapshot_time: Option<f64>,
#[serde(rename = "MetricResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_results: Option<Vec<CurrentMetricResult>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetFederationTokenRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetFederationTokenResponse {
#[serde(rename = "Credentials")]
#[serde(skip_serializing_if = "Option::is_none")]
pub credentials: Option<Credentials>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetMetricDataRequest {
#[serde(rename = "EndTime")]
pub end_time: f64,
#[serde(rename = "Filters")]
pub filters: Filters,
#[serde(rename = "Groupings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groupings: Option<Vec<String>>,
#[serde(rename = "HistoricalMetrics")]
pub historical_metrics: Vec<HistoricalMetric>,
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "StartTime")]
pub start_time: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetMetricDataResponse {
#[serde(rename = "MetricResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_results: Option<Vec<HistoricalMetricResult>>,
#[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 HierarchyGroup {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "HierarchyPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hierarchy_path: Option<HierarchyPath>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "LevelId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HierarchyGroupSummary {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HierarchyLevel {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HierarchyPath {
#[serde(rename = "LevelFive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_five: Option<HierarchyGroupSummary>,
#[serde(rename = "LevelFour")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_four: Option<HierarchyGroupSummary>,
#[serde(rename = "LevelOne")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_one: Option<HierarchyGroupSummary>,
#[serde(rename = "LevelThree")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_three: Option<HierarchyGroupSummary>,
#[serde(rename = "LevelTwo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_two: Option<HierarchyGroupSummary>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HierarchyStructure {
#[serde(rename = "LevelFive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_five: Option<HierarchyLevel>,
#[serde(rename = "LevelFour")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_four: Option<HierarchyLevel>,
#[serde(rename = "LevelOne")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_one: Option<HierarchyLevel>,
#[serde(rename = "LevelThree")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_three: Option<HierarchyLevel>,
#[serde(rename = "LevelTwo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub level_two: Option<HierarchyLevel>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HistoricalMetric {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Statistic")]
#[serde(skip_serializing_if = "Option::is_none")]
pub statistic: Option<String>,
#[serde(rename = "Threshold")]
#[serde(skip_serializing_if = "Option::is_none")]
pub threshold: Option<Threshold>,
#[serde(rename = "Unit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HistoricalMetricData {
#[serde(rename = "Metric")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric: Option<HistoricalMetric>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct HistoricalMetricResult {
#[serde(rename = "Collections")]
#[serde(skip_serializing_if = "Option::is_none")]
pub collections: Option<Vec<HistoricalMetricData>>,
#[serde(rename = "Dimensions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dimensions: Option<Dimensions>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListRoutingProfilesRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListRoutingProfilesResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "RoutingProfileSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub routing_profile_summary_list: Option<Vec<RoutingProfileSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListSecurityProfilesRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListSecurityProfilesResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SecurityProfileSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_profile_summary_list: Option<Vec<SecurityProfileSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListUserHierarchyGroupsRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListUserHierarchyGroupsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "UserHierarchyGroupSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_hierarchy_group_summary_list: Option<Vec<HierarchyGroupSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListUsersRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListUsersResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "UserSummaryList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_summary_list: Option<Vec<UserSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct QueueReference {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RoutingProfileSummary {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SecurityProfileSummary {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartOutboundVoiceContactRequest {
#[serde(rename = "Attributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attributes: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "ClientToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_token: Option<String>,
#[serde(rename = "ContactFlowId")]
pub contact_flow_id: String,
#[serde(rename = "DestinationPhoneNumber")]
pub destination_phone_number: String,
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "QueueId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub queue_id: Option<String>,
#[serde(rename = "SourcePhoneNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_phone_number: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartOutboundVoiceContactResponse {
#[serde(rename = "ContactId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub contact_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopContactRequest {
#[serde(rename = "ContactId")]
pub contact_id: String,
#[serde(rename = "InstanceId")]
pub instance_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopContactResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Threshold {
#[serde(rename = "Comparison")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comparison: Option<String>,
#[serde(rename = "ThresholdValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub threshold_value: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateContactAttributesRequest {
#[serde(rename = "Attributes")]
pub attributes: ::std::collections::HashMap<String, String>,
#[serde(rename = "InitialContactId")]
pub initial_contact_id: String,
#[serde(rename = "InstanceId")]
pub instance_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateContactAttributesResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateUserHierarchyRequest {
#[serde(rename = "HierarchyGroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hierarchy_group_id: Option<String>,
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateUserIdentityInfoRequest {
#[serde(rename = "IdentityInfo")]
pub identity_info: UserIdentityInfo,
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateUserPhoneConfigRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "PhoneConfig")]
pub phone_config: UserPhoneConfig,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateUserRoutingProfileRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "RoutingProfileId")]
pub routing_profile_id: String,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateUserSecurityProfilesRequest {
#[serde(rename = "InstanceId")]
pub instance_id: String,
#[serde(rename = "SecurityProfileIds")]
pub security_profile_ids: Vec<String>,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct User {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "DirectoryUserId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub directory_user_id: Option<String>,
#[serde(rename = "HierarchyGroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub hierarchy_group_id: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "IdentityInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub identity_info: Option<UserIdentityInfo>,
#[serde(rename = "PhoneConfig")]
#[serde(skip_serializing_if = "Option::is_none")]
pub phone_config: Option<UserPhoneConfig>,
#[serde(rename = "RoutingProfileId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub routing_profile_id: Option<String>,
#[serde(rename = "SecurityProfileIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_profile_ids: Option<Vec<String>>,
#[serde(rename = "Username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct UserIdentityInfo {
#[serde(rename = "Email")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "FirstName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub first_name: Option<String>,
#[serde(rename = "LastName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct UserPhoneConfig {
#[serde(rename = "AfterContactWorkTimeLimit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub after_contact_work_time_limit: Option<i64>,
#[serde(rename = "AutoAccept")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_accept: Option<bool>,
#[serde(rename = "DeskPhoneNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub desk_phone_number: Option<String>,
#[serde(rename = "PhoneType")]
pub phone_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UserSummary {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum CreateUserError {
DuplicateResource(String),
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
LimitExceeded(String),
ResourceNotFound(String),
Throttling(String),
}
impl CreateUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"DuplicateResourceException" => {
return RusotoError::Service(CreateUserError::DuplicateResource(err.msg))
}
"InternalServiceException" => {
return RusotoError::Service(CreateUserError::InternalService(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(CreateUserError::InvalidParameter(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(CreateUserError::InvalidRequest(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateUserError::LimitExceeded(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateUserError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(CreateUserError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateUserError {
fn description(&self) -> &str {
match *self {
CreateUserError::DuplicateResource(ref cause) => cause,
CreateUserError::InternalService(ref cause) => cause,
CreateUserError::InvalidParameter(ref cause) => cause,
CreateUserError::InvalidRequest(ref cause) => cause,
CreateUserError::LimitExceeded(ref cause) => cause,
CreateUserError::ResourceNotFound(ref cause) => cause,
CreateUserError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteUserError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl DeleteUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(DeleteUserError::InternalService(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DeleteUserError::InvalidParameter(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DeleteUserError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteUserError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(DeleteUserError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteUserError {
fn description(&self) -> &str {
match *self {
DeleteUserError::InternalService(ref cause) => cause,
DeleteUserError::InvalidParameter(ref cause) => cause,
DeleteUserError::InvalidRequest(ref cause) => cause,
DeleteUserError::ResourceNotFound(ref cause) => cause,
DeleteUserError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeUserError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl DescribeUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(DescribeUserError::InternalService(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DescribeUserError::InvalidParameter(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(DescribeUserError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeUserError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(DescribeUserError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeUserError {
fn description(&self) -> &str {
match *self {
DescribeUserError::InternalService(ref cause) => cause,
DescribeUserError::InvalidParameter(ref cause) => cause,
DescribeUserError::InvalidRequest(ref cause) => cause,
DescribeUserError::ResourceNotFound(ref cause) => cause,
DescribeUserError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeUserHierarchyGroupError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl DescribeUserHierarchyGroupError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeUserHierarchyGroupError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(DescribeUserHierarchyGroupError::InternalService(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(DescribeUserHierarchyGroupError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(DescribeUserHierarchyGroupError::InvalidRequest(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeUserHierarchyGroupError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(DescribeUserHierarchyGroupError::Throttling(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeUserHierarchyGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeUserHierarchyGroupError {
fn description(&self) -> &str {
match *self {
DescribeUserHierarchyGroupError::InternalService(ref cause) => cause,
DescribeUserHierarchyGroupError::InvalidParameter(ref cause) => cause,
DescribeUserHierarchyGroupError::InvalidRequest(ref cause) => cause,
DescribeUserHierarchyGroupError::ResourceNotFound(ref cause) => cause,
DescribeUserHierarchyGroupError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeUserHierarchyStructureError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl DescribeUserHierarchyStructureError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeUserHierarchyStructureError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(
DescribeUserHierarchyStructureError::InternalService(err.msg),
)
}
"InvalidParameterException" => {
return RusotoError::Service(
DescribeUserHierarchyStructureError::InvalidParameter(err.msg),
)
}
"InvalidRequestException" => {
return RusotoError::Service(
DescribeUserHierarchyStructureError::InvalidRequest(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
DescribeUserHierarchyStructureError::ResourceNotFound(err.msg),
)
}
"ThrottlingException" => {
return RusotoError::Service(DescribeUserHierarchyStructureError::Throttling(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeUserHierarchyStructureError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeUserHierarchyStructureError {
fn description(&self) -> &str {
match *self {
DescribeUserHierarchyStructureError::InternalService(ref cause) => cause,
DescribeUserHierarchyStructureError::InvalidParameter(ref cause) => cause,
DescribeUserHierarchyStructureError::InvalidRequest(ref cause) => cause,
DescribeUserHierarchyStructureError::ResourceNotFound(ref cause) => cause,
DescribeUserHierarchyStructureError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetContactAttributesError {
InternalService(String),
InvalidRequest(String),
ResourceNotFound(String),
}
impl GetContactAttributesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetContactAttributesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(GetContactAttributesError::InternalService(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(GetContactAttributesError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetContactAttributesError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetContactAttributesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetContactAttributesError {
fn description(&self) -> &str {
match *self {
GetContactAttributesError::InternalService(ref cause) => cause,
GetContactAttributesError::InvalidRequest(ref cause) => cause,
GetContactAttributesError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetCurrentMetricDataError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetCurrentMetricDataError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetCurrentMetricDataError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(GetCurrentMetricDataError::InternalService(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(GetCurrentMetricDataError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(GetCurrentMetricDataError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetCurrentMetricDataError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(GetCurrentMetricDataError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetCurrentMetricDataError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetCurrentMetricDataError {
fn description(&self) -> &str {
match *self {
GetCurrentMetricDataError::InternalService(ref cause) => cause,
GetCurrentMetricDataError::InvalidParameter(ref cause) => cause,
GetCurrentMetricDataError::InvalidRequest(ref cause) => cause,
GetCurrentMetricDataError::ResourceNotFound(ref cause) => cause,
GetCurrentMetricDataError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFederationTokenError {
DuplicateResource(String),
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
UserNotFound(String),
}
impl GetFederationTokenError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFederationTokenError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"DuplicateResourceException" => {
return RusotoError::Service(GetFederationTokenError::DuplicateResource(
err.msg,
))
}
"InternalServiceException" => {
return RusotoError::Service(GetFederationTokenError::InternalService(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(GetFederationTokenError::InvalidParameter(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(GetFederationTokenError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetFederationTokenError::ResourceNotFound(err.msg))
}
"UserNotFoundException" => {
return RusotoError::Service(GetFederationTokenError::UserNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetFederationTokenError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFederationTokenError {
fn description(&self) -> &str {
match *self {
GetFederationTokenError::DuplicateResource(ref cause) => cause,
GetFederationTokenError::InternalService(ref cause) => cause,
GetFederationTokenError::InvalidParameter(ref cause) => cause,
GetFederationTokenError::InvalidRequest(ref cause) => cause,
GetFederationTokenError::ResourceNotFound(ref cause) => cause,
GetFederationTokenError::UserNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetMetricDataError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl GetMetricDataError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetMetricDataError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(GetMetricDataError::InternalService(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(GetMetricDataError::InvalidParameter(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(GetMetricDataError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetMetricDataError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(GetMetricDataError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetMetricDataError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetMetricDataError {
fn description(&self) -> &str {
match *self {
GetMetricDataError::InternalService(ref cause) => cause,
GetMetricDataError::InvalidParameter(ref cause) => cause,
GetMetricDataError::InvalidRequest(ref cause) => cause,
GetMetricDataError::ResourceNotFound(ref cause) => cause,
GetMetricDataError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListRoutingProfilesError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl ListRoutingProfilesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListRoutingProfilesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(ListRoutingProfilesError::InternalService(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ListRoutingProfilesError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(ListRoutingProfilesError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListRoutingProfilesError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(ListRoutingProfilesError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListRoutingProfilesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListRoutingProfilesError {
fn description(&self) -> &str {
match *self {
ListRoutingProfilesError::InternalService(ref cause) => cause,
ListRoutingProfilesError::InvalidParameter(ref cause) => cause,
ListRoutingProfilesError::InvalidRequest(ref cause) => cause,
ListRoutingProfilesError::ResourceNotFound(ref cause) => cause,
ListRoutingProfilesError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListSecurityProfilesError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl ListSecurityProfilesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListSecurityProfilesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(ListSecurityProfilesError::InternalService(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(ListSecurityProfilesError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(ListSecurityProfilesError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListSecurityProfilesError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(ListSecurityProfilesError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListSecurityProfilesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListSecurityProfilesError {
fn description(&self) -> &str {
match *self {
ListSecurityProfilesError::InternalService(ref cause) => cause,
ListSecurityProfilesError::InvalidParameter(ref cause) => cause,
ListSecurityProfilesError::InvalidRequest(ref cause) => cause,
ListSecurityProfilesError::ResourceNotFound(ref cause) => cause,
ListSecurityProfilesError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListUserHierarchyGroupsError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl ListUserHierarchyGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListUserHierarchyGroupsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(ListUserHierarchyGroupsError::InternalService(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(ListUserHierarchyGroupsError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(ListUserHierarchyGroupsError::InvalidRequest(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListUserHierarchyGroupsError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(ListUserHierarchyGroupsError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListUserHierarchyGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListUserHierarchyGroupsError {
fn description(&self) -> &str {
match *self {
ListUserHierarchyGroupsError::InternalService(ref cause) => cause,
ListUserHierarchyGroupsError::InvalidParameter(ref cause) => cause,
ListUserHierarchyGroupsError::InvalidRequest(ref cause) => cause,
ListUserHierarchyGroupsError::ResourceNotFound(ref cause) => cause,
ListUserHierarchyGroupsError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListUsersError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl ListUsersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListUsersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(ListUsersError::InternalService(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ListUsersError::InvalidParameter(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(ListUsersError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListUsersError::ResourceNotFound(err.msg))
}
"ThrottlingException" => {
return RusotoError::Service(ListUsersError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListUsersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListUsersError {
fn description(&self) -> &str {
match *self {
ListUsersError::InternalService(ref cause) => cause,
ListUsersError::InvalidParameter(ref cause) => cause,
ListUsersError::InvalidRequest(ref cause) => cause,
ListUsersError::ResourceNotFound(ref cause) => cause,
ListUsersError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartOutboundVoiceContactError {
DestinationNotAllowed(String),
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
LimitExceeded(String),
OutboundContactNotPermitted(String),
ResourceNotFound(String),
}
impl StartOutboundVoiceContactError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartOutboundVoiceContactError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"DestinationNotAllowedException" => {
return RusotoError::Service(
StartOutboundVoiceContactError::DestinationNotAllowed(err.msg),
)
}
"InternalServiceException" => {
return RusotoError::Service(StartOutboundVoiceContactError::InternalService(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(StartOutboundVoiceContactError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(StartOutboundVoiceContactError::InvalidRequest(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(StartOutboundVoiceContactError::LimitExceeded(
err.msg,
))
}
"OutboundContactNotPermittedException" => {
return RusotoError::Service(
StartOutboundVoiceContactError::OutboundContactNotPermitted(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(StartOutboundVoiceContactError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartOutboundVoiceContactError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartOutboundVoiceContactError {
fn description(&self) -> &str {
match *self {
StartOutboundVoiceContactError::DestinationNotAllowed(ref cause) => cause,
StartOutboundVoiceContactError::InternalService(ref cause) => cause,
StartOutboundVoiceContactError::InvalidParameter(ref cause) => cause,
StartOutboundVoiceContactError::InvalidRequest(ref cause) => cause,
StartOutboundVoiceContactError::LimitExceeded(ref cause) => cause,
StartOutboundVoiceContactError::OutboundContactNotPermitted(ref cause) => cause,
StartOutboundVoiceContactError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopContactError {
ContactNotFound(String),
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
}
impl StopContactError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopContactError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ContactNotFoundException" => {
return RusotoError::Service(StopContactError::ContactNotFound(err.msg))
}
"InternalServiceException" => {
return RusotoError::Service(StopContactError::InternalService(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(StopContactError::InvalidParameter(err.msg))
}
"InvalidRequestException" => {
return RusotoError::Service(StopContactError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(StopContactError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopContactError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopContactError {
fn description(&self) -> &str {
match *self {
StopContactError::ContactNotFound(ref cause) => cause,
StopContactError::InternalService(ref cause) => cause,
StopContactError::InvalidParameter(ref cause) => cause,
StopContactError::InvalidRequest(ref cause) => cause,
StopContactError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateContactAttributesError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
}
impl UpdateContactAttributesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateContactAttributesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(UpdateContactAttributesError::InternalService(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(UpdateContactAttributesError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(UpdateContactAttributesError::InvalidRequest(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateContactAttributesError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateContactAttributesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateContactAttributesError {
fn description(&self) -> &str {
match *self {
UpdateContactAttributesError::InternalService(ref cause) => cause,
UpdateContactAttributesError::InvalidParameter(ref cause) => cause,
UpdateContactAttributesError::InvalidRequest(ref cause) => cause,
UpdateContactAttributesError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateUserHierarchyError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateUserHierarchyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateUserHierarchyError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(UpdateUserHierarchyError::InternalService(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(UpdateUserHierarchyError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(UpdateUserHierarchyError::InvalidRequest(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateUserHierarchyError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateUserHierarchyError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateUserHierarchyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateUserHierarchyError {
fn description(&self) -> &str {
match *self {
UpdateUserHierarchyError::InternalService(ref cause) => cause,
UpdateUserHierarchyError::InvalidParameter(ref cause) => cause,
UpdateUserHierarchyError::InvalidRequest(ref cause) => cause,
UpdateUserHierarchyError::ResourceNotFound(ref cause) => cause,
UpdateUserHierarchyError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateUserIdentityInfoError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateUserIdentityInfoError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateUserIdentityInfoError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(UpdateUserIdentityInfoError::InternalService(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(UpdateUserIdentityInfoError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(UpdateUserIdentityInfoError::InvalidRequest(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateUserIdentityInfoError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateUserIdentityInfoError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateUserIdentityInfoError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateUserIdentityInfoError {
fn description(&self) -> &str {
match *self {
UpdateUserIdentityInfoError::InternalService(ref cause) => cause,
UpdateUserIdentityInfoError::InvalidParameter(ref cause) => cause,
UpdateUserIdentityInfoError::InvalidRequest(ref cause) => cause,
UpdateUserIdentityInfoError::ResourceNotFound(ref cause) => cause,
UpdateUserIdentityInfoError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateUserPhoneConfigError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateUserPhoneConfigError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateUserPhoneConfigError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(UpdateUserPhoneConfigError::InternalService(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(UpdateUserPhoneConfigError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(UpdateUserPhoneConfigError::InvalidRequest(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateUserPhoneConfigError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateUserPhoneConfigError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateUserPhoneConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateUserPhoneConfigError {
fn description(&self) -> &str {
match *self {
UpdateUserPhoneConfigError::InternalService(ref cause) => cause,
UpdateUserPhoneConfigError::InvalidParameter(ref cause) => cause,
UpdateUserPhoneConfigError::InvalidRequest(ref cause) => cause,
UpdateUserPhoneConfigError::ResourceNotFound(ref cause) => cause,
UpdateUserPhoneConfigError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateUserRoutingProfileError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateUserRoutingProfileError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateUserRoutingProfileError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(UpdateUserRoutingProfileError::InternalService(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(UpdateUserRoutingProfileError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(UpdateUserRoutingProfileError::InvalidRequest(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateUserRoutingProfileError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateUserRoutingProfileError::Throttling(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateUserRoutingProfileError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateUserRoutingProfileError {
fn description(&self) -> &str {
match *self {
UpdateUserRoutingProfileError::InternalService(ref cause) => cause,
UpdateUserRoutingProfileError::InvalidParameter(ref cause) => cause,
UpdateUserRoutingProfileError::InvalidRequest(ref cause) => cause,
UpdateUserRoutingProfileError::ResourceNotFound(ref cause) => cause,
UpdateUserRoutingProfileError::Throttling(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateUserSecurityProfilesError {
InternalService(String),
InvalidParameter(String),
InvalidRequest(String),
ResourceNotFound(String),
Throttling(String),
}
impl UpdateUserSecurityProfilesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateUserSecurityProfilesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"InternalServiceException" => {
return RusotoError::Service(UpdateUserSecurityProfilesError::InternalService(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(UpdateUserSecurityProfilesError::InvalidParameter(
err.msg,
))
}
"InvalidRequestException" => {
return RusotoError::Service(UpdateUserSecurityProfilesError::InvalidRequest(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateUserSecurityProfilesError::ResourceNotFound(
err.msg,
))
}
"ThrottlingException" => {
return RusotoError::Service(UpdateUserSecurityProfilesError::Throttling(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateUserSecurityProfilesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateUserSecurityProfilesError {
fn description(&self) -> &str {
match *self {
UpdateUserSecurityProfilesError::InternalService(ref cause) => cause,
UpdateUserSecurityProfilesError::InvalidParameter(ref cause) => cause,
UpdateUserSecurityProfilesError::InvalidRequest(ref cause) => cause,
UpdateUserSecurityProfilesError::ResourceNotFound(ref cause) => cause,
UpdateUserSecurityProfilesError::Throttling(ref cause) => cause,
}
}
}
pub trait Connect {
fn create_user(
&self,
input: CreateUserRequest,
) -> RusotoFuture<CreateUserResponse, CreateUserError>;
fn delete_user(&self, input: DeleteUserRequest) -> RusotoFuture<(), DeleteUserError>;
fn describe_user(
&self,
input: DescribeUserRequest,
) -> RusotoFuture<DescribeUserResponse, DescribeUserError>;
fn describe_user_hierarchy_group(
&self,
input: DescribeUserHierarchyGroupRequest,
) -> RusotoFuture<DescribeUserHierarchyGroupResponse, DescribeUserHierarchyGroupError>;
fn describe_user_hierarchy_structure(
&self,
input: DescribeUserHierarchyStructureRequest,
) -> RusotoFuture<DescribeUserHierarchyStructureResponse, DescribeUserHierarchyStructureError>;
fn get_contact_attributes(
&self,
input: GetContactAttributesRequest,
) -> RusotoFuture<GetContactAttributesResponse, GetContactAttributesError>;
fn get_current_metric_data(
&self,
input: GetCurrentMetricDataRequest,
) -> RusotoFuture<GetCurrentMetricDataResponse, GetCurrentMetricDataError>;
fn get_federation_token(
&self,
input: GetFederationTokenRequest,
) -> RusotoFuture<GetFederationTokenResponse, GetFederationTokenError>;
fn get_metric_data(
&self,
input: GetMetricDataRequest,
) -> RusotoFuture<GetMetricDataResponse, GetMetricDataError>;
fn list_routing_profiles(
&self,
input: ListRoutingProfilesRequest,
) -> RusotoFuture<ListRoutingProfilesResponse, ListRoutingProfilesError>;
fn list_security_profiles(
&self,
input: ListSecurityProfilesRequest,
) -> RusotoFuture<ListSecurityProfilesResponse, ListSecurityProfilesError>;
fn list_user_hierarchy_groups(
&self,
input: ListUserHierarchyGroupsRequest,
) -> RusotoFuture<ListUserHierarchyGroupsResponse, ListUserHierarchyGroupsError>;
fn list_users(
&self,
input: ListUsersRequest,
) -> RusotoFuture<ListUsersResponse, ListUsersError>;
fn start_outbound_voice_contact(
&self,
input: StartOutboundVoiceContactRequest,
) -> RusotoFuture<StartOutboundVoiceContactResponse, StartOutboundVoiceContactError>;
fn stop_contact(
&self,
input: StopContactRequest,
) -> RusotoFuture<StopContactResponse, StopContactError>;
fn update_contact_attributes(
&self,
input: UpdateContactAttributesRequest,
) -> RusotoFuture<UpdateContactAttributesResponse, UpdateContactAttributesError>;
fn update_user_hierarchy(
&self,
input: UpdateUserHierarchyRequest,
) -> RusotoFuture<(), UpdateUserHierarchyError>;
fn update_user_identity_info(
&self,
input: UpdateUserIdentityInfoRequest,
) -> RusotoFuture<(), UpdateUserIdentityInfoError>;
fn update_user_phone_config(
&self,
input: UpdateUserPhoneConfigRequest,
) -> RusotoFuture<(), UpdateUserPhoneConfigError>;
fn update_user_routing_profile(
&self,
input: UpdateUserRoutingProfileRequest,
) -> RusotoFuture<(), UpdateUserRoutingProfileError>;
fn update_user_security_profiles(
&self,
input: UpdateUserSecurityProfilesRequest,
) -> RusotoFuture<(), UpdateUserSecurityProfilesError>;
}
#[derive(Clone)]
pub struct ConnectClient {
client: Client,
region: region::Region,
}
impl ConnectClient {
pub fn new(region: region::Region) -> ConnectClient {
ConnectClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> ConnectClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
ConnectClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Connect for ConnectClient {
fn create_user(
&self,
input: CreateUserRequest,
) -> RusotoFuture<CreateUserResponse, CreateUserError> {
let request_uri = format!("/users/{instance_id}", instance_id = input.instance_id);
let mut request = SignedRequest::new("PUT", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateUserResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateUserError::from_response(response))),
)
}
})
}
fn delete_user(&self, input: DeleteUserRequest) -> RusotoFuture<(), DeleteUserError> {
let request_uri = format!(
"/users/{instance_id}/{user_id}",
instance_id = input.instance_id,
user_id = input.user_id
);
let mut request = SignedRequest::new("DELETE", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteUserError::from_response(response))),
)
}
})
}
fn describe_user(
&self,
input: DescribeUserRequest,
) -> RusotoFuture<DescribeUserResponse, DescribeUserError> {
let request_uri = format!(
"/users/{instance_id}/{user_id}",
instance_id = input.instance_id,
user_id = input.user_id
);
let mut request = SignedRequest::new("GET", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeUserResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeUserError::from_response(response))),
)
}
})
}
fn describe_user_hierarchy_group(
&self,
input: DescribeUserHierarchyGroupRequest,
) -> RusotoFuture<DescribeUserHierarchyGroupResponse, DescribeUserHierarchyGroupError> {
let request_uri = format!(
"/user-hierarchy-groups/{instance_id}/{hierarchy_group_id}",
hierarchy_group_id = input.hierarchy_group_id,
instance_id = input.instance_id
);
let mut request = SignedRequest::new("GET", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeUserHierarchyGroupResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeUserHierarchyGroupError::from_response(response))
}))
}
})
}
fn describe_user_hierarchy_structure(
&self,
input: DescribeUserHierarchyStructureRequest,
) -> RusotoFuture<DescribeUserHierarchyStructureResponse, DescribeUserHierarchyStructureError>
{
let request_uri = format!(
"/user-hierarchy-structure/{instance_id}",
instance_id = input.instance_id
);
let mut request = SignedRequest::new("GET", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeUserHierarchyStructureResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeUserHierarchyStructureError::from_response(response))
}))
}
})
}
fn get_contact_attributes(
&self,
input: GetContactAttributesRequest,
) -> RusotoFuture<GetContactAttributesResponse, GetContactAttributesError> {
let request_uri = format!(
"/contact/attributes/{instance_id}/{initial_contact_id}",
initial_contact_id = input.initial_contact_id,
instance_id = input.instance_id
);
let mut request = SignedRequest::new("GET", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetContactAttributesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetContactAttributesError::from_response(response))
}),
)
}
})
}
fn get_current_metric_data(
&self,
input: GetCurrentMetricDataRequest,
) -> RusotoFuture<GetCurrentMetricDataResponse, GetCurrentMetricDataError> {
let request_uri = format!(
"/metrics/current/{instance_id}",
instance_id = input.instance_id
);
let mut request = SignedRequest::new("POST", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetCurrentMetricDataResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetCurrentMetricDataError::from_response(response))
}),
)
}
})
}
fn get_federation_token(
&self,
input: GetFederationTokenRequest,
) -> RusotoFuture<GetFederationTokenResponse, GetFederationTokenError> {
let request_uri = format!(
"/user/federate/{instance_id}",
instance_id = input.instance_id
);
let mut request = SignedRequest::new("GET", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetFederationTokenResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetFederationTokenError::from_response(response))),
)
}
})
}
fn get_metric_data(
&self,
input: GetMetricDataRequest,
) -> RusotoFuture<GetMetricDataResponse, GetMetricDataError> {
let request_uri = format!(
"/metrics/historical/{instance_id}",
instance_id = input.instance_id
);
let mut request = SignedRequest::new("POST", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetMetricDataResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetMetricDataError::from_response(response))),
)
}
})
}
fn list_routing_profiles(
&self,
input: ListRoutingProfilesRequest,
) -> RusotoFuture<ListRoutingProfilesResponse, ListRoutingProfilesError> {
let request_uri = format!(
"/routing-profiles-summary/{instance_id}",
instance_id = input.instance_id
);
let mut request = SignedRequest::new("GET", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListRoutingProfilesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListRoutingProfilesError::from_response(response))
}),
)
}
})
}
fn list_security_profiles(
&self,
input: ListSecurityProfilesRequest,
) -> RusotoFuture<ListSecurityProfilesResponse, ListSecurityProfilesError> {
let request_uri = format!(
"/security-profiles-summary/{instance_id}",
instance_id = input.instance_id
);
let mut request = SignedRequest::new("GET", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListSecurityProfilesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListSecurityProfilesError::from_response(response))
}),
)
}
})
}
fn list_user_hierarchy_groups(
&self,
input: ListUserHierarchyGroupsRequest,
) -> RusotoFuture<ListUserHierarchyGroupsResponse, ListUserHierarchyGroupsError> {
let request_uri = format!(
"/user-hierarchy-groups-summary/{instance_id}",
instance_id = input.instance_id
);
let mut request = SignedRequest::new("GET", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListUserHierarchyGroupsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListUserHierarchyGroupsError::from_response(response))
}))
}
})
}
fn list_users(
&self,
input: ListUsersRequest,
) -> RusotoFuture<ListUsersResponse, ListUsersError> {
let request_uri = format!(
"/users-summary/{instance_id}",
instance_id = input.instance_id
);
let mut request = SignedRequest::new("GET", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListUsersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListUsersError::from_response(response))),
)
}
})
}
fn start_outbound_voice_contact(
&self,
input: StartOutboundVoiceContactRequest,
) -> RusotoFuture<StartOutboundVoiceContactResponse, StartOutboundVoiceContactError> {
let request_uri = "/contact/outbound-voice";
let mut request = SignedRequest::new("PUT", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<StartOutboundVoiceContactResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StartOutboundVoiceContactError::from_response(response))
}))
}
})
}
fn stop_contact(
&self,
input: StopContactRequest,
) -> RusotoFuture<StopContactResponse, StopContactError> {
let request_uri = "/contact/stop";
let mut request = SignedRequest::new("POST", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<StopContactResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopContactError::from_response(response))),
)
}
})
}
fn update_contact_attributes(
&self,
input: UpdateContactAttributesRequest,
) -> RusotoFuture<UpdateContactAttributesResponse, UpdateContactAttributesError> {
let request_uri = "/contact/attributes";
let mut request = SignedRequest::new("POST", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateContactAttributesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateContactAttributesError::from_response(response))
}))
}
})
}
fn update_user_hierarchy(
&self,
input: UpdateUserHierarchyRequest,
) -> RusotoFuture<(), UpdateUserHierarchyError> {
let request_uri = format!(
"/users/{instance_id}/{user_id}/hierarchy",
instance_id = input.instance_id,
user_id = input.user_id
);
let mut request = SignedRequest::new("POST", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateUserHierarchyError::from_response(response))
}),
)
}
})
}
fn update_user_identity_info(
&self,
input: UpdateUserIdentityInfoRequest,
) -> RusotoFuture<(), UpdateUserIdentityInfoError> {
let request_uri = format!(
"/users/{instance_id}/{user_id}/identity-info",
instance_id = input.instance_id,
user_id = input.user_id
);
let mut request = SignedRequest::new("POST", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateUserIdentityInfoError::from_response(response))
}),
)
}
})
}
fn update_user_phone_config(
&self,
input: UpdateUserPhoneConfigRequest,
) -> RusotoFuture<(), UpdateUserPhoneConfigError> {
let request_uri = format!(
"/users/{instance_id}/{user_id}/phone-config",
instance_id = input.instance_id,
user_id = input.user_id
);
let mut request = SignedRequest::new("POST", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateUserPhoneConfigError::from_response(response))
}),
)
}
})
}
fn update_user_routing_profile(
&self,
input: UpdateUserRoutingProfileRequest,
) -> RusotoFuture<(), UpdateUserRoutingProfileError> {
let request_uri = format!(
"/users/{instance_id}/{user_id}/routing-profile",
instance_id = input.instance_id,
user_id = input.user_id
);
let mut request = SignedRequest::new("POST", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateUserRoutingProfileError::from_response(response))
}))
}
})
}
fn update_user_security_profiles(
&self,
input: UpdateUserSecurityProfilesRequest,
) -> RusotoFuture<(), UpdateUserSecurityProfilesError> {
let request_uri = format!(
"/users/{instance_id}/{user_id}/security-profiles",
instance_id = input.instance_id,
user_id = input.user_id
);
let mut request = SignedRequest::new("POST", "connect", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateUserSecurityProfilesError::from_response(response))
}))
}
})
}
}