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 AssociateDelegateToResourceRequest {
#[serde(rename = "EntityId")]
pub entity_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssociateDelegateToResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssociateMemberToGroupRequest {
#[serde(rename = "GroupId")]
pub group_id: String,
#[serde(rename = "MemberId")]
pub member_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AssociateMemberToGroupResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct BookingOptions {
#[serde(rename = "AutoAcceptRequests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_accept_requests: Option<bool>,
#[serde(rename = "AutoDeclineConflictingRequests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_decline_conflicting_requests: Option<bool>,
#[serde(rename = "AutoDeclineRecurringRequests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_decline_recurring_requests: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateAliasRequest {
#[serde(rename = "Alias")]
pub alias: String,
#[serde(rename = "EntityId")]
pub entity_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateAliasResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateGroupRequest {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateGroupResponse {
#[serde(rename = "GroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateResourceRequest {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateResourceResponse {
#[serde(rename = "ResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateUserRequest {
#[serde(rename = "DisplayName")]
pub display_name: String,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "Password")]
pub password: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateUserResponse {
#[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 Delegate {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteAliasRequest {
#[serde(rename = "Alias")]
pub alias: String,
#[serde(rename = "EntityId")]
pub entity_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteAliasResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteGroupRequest {
#[serde(rename = "GroupId")]
pub group_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteGroupResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteMailboxPermissionsRequest {
#[serde(rename = "EntityId")]
pub entity_id: String,
#[serde(rename = "GranteeId")]
pub grantee_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteMailboxPermissionsResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteResourceRequest {
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteUserRequest {
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteUserResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeregisterFromWorkMailRequest {
#[serde(rename = "EntityId")]
pub entity_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeregisterFromWorkMailResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeGroupRequest {
#[serde(rename = "GroupId")]
pub group_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeGroupResponse {
#[serde(rename = "DisabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled_date: Option<f64>,
#[serde(rename = "Email")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "EnabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled_date: Option<f64>,
#[serde(rename = "GroupId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeOrganizationRequest {
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeOrganizationResponse {
#[serde(rename = "Alias")]
#[serde(skip_serializing_if = "Option::is_none")]
pub alias: Option<String>,
#[serde(rename = "CompletedDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub completed_date: Option<f64>,
#[serde(rename = "DefaultMailDomain")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_mail_domain: Option<String>,
#[serde(rename = "DirectoryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub directory_id: Option<String>,
#[serde(rename = "DirectoryType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub directory_type: Option<String>,
#[serde(rename = "ErrorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
#[serde(rename = "OrganizationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_id: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeResourceRequest {
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeResourceResponse {
#[serde(rename = "BookingOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub booking_options: Option<BookingOptions>,
#[serde(rename = "DisabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled_date: Option<f64>,
#[serde(rename = "Email")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "EnabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled_date: Option<f64>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeUserRequest {
#[serde(rename = "OrganizationId")]
pub organization_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 = "DisabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled_date: Option<f64>,
#[serde(rename = "DisplayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "Email")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "EnabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled_date: Option<f64>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "UserId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_id: Option<String>,
#[serde(rename = "UserRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_role: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateDelegateFromResourceRequest {
#[serde(rename = "EntityId")]
pub entity_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociateDelegateFromResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateMemberFromGroupRequest {
#[serde(rename = "GroupId")]
pub group_id: String,
#[serde(rename = "MemberId")]
pub member_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DisassociateMemberFromGroupResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetMailboxDetailsRequest {
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetMailboxDetailsResponse {
#[serde(rename = "MailboxQuota")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mailbox_quota: Option<i64>,
#[serde(rename = "MailboxSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mailbox_size: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Group {
#[serde(rename = "DisabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled_date: Option<f64>,
#[serde(rename = "Email")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "EnabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled_date: Option<f64>,
#[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>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListAliasesRequest {
#[serde(rename = "EntityId")]
pub entity_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 = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListAliasesResponse {
#[serde(rename = "Aliases")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aliases: Option<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 ListGroupMembersRequest {
#[serde(rename = "GroupId")]
pub group_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 = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListGroupMembersResponse {
#[serde(rename = "Members")]
#[serde(skip_serializing_if = "Option::is_none")]
pub members: Option<Vec<Member>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListGroupsRequest {
#[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 = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListGroupsResponse {
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<Group>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListMailboxPermissionsRequest {
#[serde(rename = "EntityId")]
pub entity_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 = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListMailboxPermissionsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Permissions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub permissions: Option<Vec<Permission>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListOrganizationsRequest {
#[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 ListOrganizationsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "OrganizationSummaries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_summaries: Option<Vec<OrganizationSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListResourceDelegatesRequest {
#[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 = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListResourceDelegatesResponse {
#[serde(rename = "Delegates")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delegates: Option<Vec<Delegate>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListResourcesRequest {
#[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 = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListResourcesResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Resources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resources: Option<Vec<Resource>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListUsersRequest {
#[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 = "OrganizationId")]
pub organization_id: 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 = "Users")]
#[serde(skip_serializing_if = "Option::is_none")]
pub users: Option<Vec<User>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Member {
#[serde(rename = "DisabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled_date: Option<f64>,
#[serde(rename = "EnabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled_date: Option<f64>,
#[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>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct OrganizationSummary {
#[serde(rename = "Alias")]
#[serde(skip_serializing_if = "Option::is_none")]
pub alias: Option<String>,
#[serde(rename = "ErrorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_message: Option<String>,
#[serde(rename = "OrganizationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_id: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Permission {
#[serde(rename = "GranteeId")]
pub grantee_id: String,
#[serde(rename = "GranteeType")]
pub grantee_type: String,
#[serde(rename = "PermissionValues")]
pub permission_values: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutMailboxPermissionsRequest {
#[serde(rename = "EntityId")]
pub entity_id: String,
#[serde(rename = "GranteeId")]
pub grantee_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "PermissionValues")]
pub permission_values: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutMailboxPermissionsResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RegisterToWorkMailRequest {
#[serde(rename = "Email")]
pub email: String,
#[serde(rename = "EntityId")]
pub entity_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RegisterToWorkMailResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ResetPasswordRequest {
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "Password")]
pub password: String,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResetPasswordResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Resource {
#[serde(rename = "DisabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled_date: Option<f64>,
#[serde(rename = "Email")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "EnabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled_date: Option<f64>,
#[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>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateMailboxQuotaRequest {
#[serde(rename = "MailboxQuota")]
pub mailbox_quota: i64,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateMailboxQuotaResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdatePrimaryEmailAddressRequest {
#[serde(rename = "Email")]
pub email: String,
#[serde(rename = "EntityId")]
pub entity_id: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdatePrimaryEmailAddressResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateResourceRequest {
#[serde(rename = "BookingOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub booking_options: Option<BookingOptions>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateResourceResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct User {
#[serde(rename = "DisabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub disabled_date: Option<f64>,
#[serde(rename = "DisplayName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<String>,
#[serde(rename = "Email")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
#[serde(rename = "EnabledDate")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled_date: Option<f64>,
#[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>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "UserRole")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_role: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum AssociateDelegateToResourceError {
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl AssociateDelegateToResourceError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<AssociateDelegateToResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(AssociateDelegateToResourceError::EntityNotFound(
err.msg,
))
}
"EntityStateException" => {
return RusotoError::Service(AssociateDelegateToResourceError::EntityState(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(
AssociateDelegateToResourceError::InvalidParameter(err.msg),
)
}
"OrganizationNotFoundException" => {
return RusotoError::Service(
AssociateDelegateToResourceError::OrganizationNotFound(err.msg),
)
}
"OrganizationStateException" => {
return RusotoError::Service(
AssociateDelegateToResourceError::OrganizationState(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AssociateDelegateToResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AssociateDelegateToResourceError {
fn description(&self) -> &str {
match *self {
AssociateDelegateToResourceError::EntityNotFound(ref cause) => cause,
AssociateDelegateToResourceError::EntityState(ref cause) => cause,
AssociateDelegateToResourceError::InvalidParameter(ref cause) => cause,
AssociateDelegateToResourceError::OrganizationNotFound(ref cause) => cause,
AssociateDelegateToResourceError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum AssociateMemberToGroupError {
DirectoryServiceAuthenticationFailed(String),
DirectoryUnavailable(String),
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
UnsupportedOperation(String),
}
impl AssociateMemberToGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AssociateMemberToGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryServiceAuthenticationFailedException" => {
return RusotoError::Service(
AssociateMemberToGroupError::DirectoryServiceAuthenticationFailed(err.msg),
)
}
"DirectoryUnavailableException" => {
return RusotoError::Service(AssociateMemberToGroupError::DirectoryUnavailable(
err.msg,
))
}
"EntityNotFoundException" => {
return RusotoError::Service(AssociateMemberToGroupError::EntityNotFound(
err.msg,
))
}
"EntityStateException" => {
return RusotoError::Service(AssociateMemberToGroupError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(AssociateMemberToGroupError::InvalidParameter(
err.msg,
))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(AssociateMemberToGroupError::OrganizationNotFound(
err.msg,
))
}
"OrganizationStateException" => {
return RusotoError::Service(AssociateMemberToGroupError::OrganizationState(
err.msg,
))
}
"UnsupportedOperationException" => {
return RusotoError::Service(AssociateMemberToGroupError::UnsupportedOperation(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AssociateMemberToGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AssociateMemberToGroupError {
fn description(&self) -> &str {
match *self {
AssociateMemberToGroupError::DirectoryServiceAuthenticationFailed(ref cause) => cause,
AssociateMemberToGroupError::DirectoryUnavailable(ref cause) => cause,
AssociateMemberToGroupError::EntityNotFound(ref cause) => cause,
AssociateMemberToGroupError::EntityState(ref cause) => cause,
AssociateMemberToGroupError::InvalidParameter(ref cause) => cause,
AssociateMemberToGroupError::OrganizationNotFound(ref cause) => cause,
AssociateMemberToGroupError::OrganizationState(ref cause) => cause,
AssociateMemberToGroupError::UnsupportedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateAliasError {
EmailAddressInUse(String),
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
MailDomainNotFound(String),
MailDomainState(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl CreateAliasError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateAliasError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EmailAddressInUseException" => {
return RusotoError::Service(CreateAliasError::EmailAddressInUse(err.msg))
}
"EntityNotFoundException" => {
return RusotoError::Service(CreateAliasError::EntityNotFound(err.msg))
}
"EntityStateException" => {
return RusotoError::Service(CreateAliasError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(CreateAliasError::InvalidParameter(err.msg))
}
"MailDomainNotFoundException" => {
return RusotoError::Service(CreateAliasError::MailDomainNotFound(err.msg))
}
"MailDomainStateException" => {
return RusotoError::Service(CreateAliasError::MailDomainState(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(CreateAliasError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(CreateAliasError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateAliasError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateAliasError {
fn description(&self) -> &str {
match *self {
CreateAliasError::EmailAddressInUse(ref cause) => cause,
CreateAliasError::EntityNotFound(ref cause) => cause,
CreateAliasError::EntityState(ref cause) => cause,
CreateAliasError::InvalidParameter(ref cause) => cause,
CreateAliasError::MailDomainNotFound(ref cause) => cause,
CreateAliasError::MailDomainState(ref cause) => cause,
CreateAliasError::OrganizationNotFound(ref cause) => cause,
CreateAliasError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateGroupError {
DirectoryServiceAuthenticationFailed(String),
DirectoryUnavailable(String),
InvalidParameter(String),
NameAvailability(String),
OrganizationNotFound(String),
OrganizationState(String),
ReservedName(String),
UnsupportedOperation(String),
}
impl CreateGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryServiceAuthenticationFailedException" => {
return RusotoError::Service(
CreateGroupError::DirectoryServiceAuthenticationFailed(err.msg),
)
}
"DirectoryUnavailableException" => {
return RusotoError::Service(CreateGroupError::DirectoryUnavailable(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(CreateGroupError::InvalidParameter(err.msg))
}
"NameAvailabilityException" => {
return RusotoError::Service(CreateGroupError::NameAvailability(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(CreateGroupError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(CreateGroupError::OrganizationState(err.msg))
}
"ReservedNameException" => {
return RusotoError::Service(CreateGroupError::ReservedName(err.msg))
}
"UnsupportedOperationException" => {
return RusotoError::Service(CreateGroupError::UnsupportedOperation(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateGroupError {
fn description(&self) -> &str {
match *self {
CreateGroupError::DirectoryServiceAuthenticationFailed(ref cause) => cause,
CreateGroupError::DirectoryUnavailable(ref cause) => cause,
CreateGroupError::InvalidParameter(ref cause) => cause,
CreateGroupError::NameAvailability(ref cause) => cause,
CreateGroupError::OrganizationNotFound(ref cause) => cause,
CreateGroupError::OrganizationState(ref cause) => cause,
CreateGroupError::ReservedName(ref cause) => cause,
CreateGroupError::UnsupportedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateResourceError {
DirectoryServiceAuthenticationFailed(String),
DirectoryUnavailable(String),
InvalidParameter(String),
NameAvailability(String),
OrganizationNotFound(String),
OrganizationState(String),
ReservedName(String),
}
impl CreateResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryServiceAuthenticationFailedException" => {
return RusotoError::Service(
CreateResourceError::DirectoryServiceAuthenticationFailed(err.msg),
)
}
"DirectoryUnavailableException" => {
return RusotoError::Service(CreateResourceError::DirectoryUnavailable(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(CreateResourceError::InvalidParameter(err.msg))
}
"NameAvailabilityException" => {
return RusotoError::Service(CreateResourceError::NameAvailability(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(CreateResourceError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(CreateResourceError::OrganizationState(err.msg))
}
"ReservedNameException" => {
return RusotoError::Service(CreateResourceError::ReservedName(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateResourceError {
fn description(&self) -> &str {
match *self {
CreateResourceError::DirectoryServiceAuthenticationFailed(ref cause) => cause,
CreateResourceError::DirectoryUnavailable(ref cause) => cause,
CreateResourceError::InvalidParameter(ref cause) => cause,
CreateResourceError::NameAvailability(ref cause) => cause,
CreateResourceError::OrganizationNotFound(ref cause) => cause,
CreateResourceError::OrganizationState(ref cause) => cause,
CreateResourceError::ReservedName(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateUserError {
DirectoryServiceAuthenticationFailed(String),
DirectoryUnavailable(String),
InvalidParameter(String),
InvalidPassword(String),
NameAvailability(String),
OrganizationNotFound(String),
OrganizationState(String),
ReservedName(String),
UnsupportedOperation(String),
}
impl CreateUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateUserError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryServiceAuthenticationFailedException" => {
return RusotoError::Service(
CreateUserError::DirectoryServiceAuthenticationFailed(err.msg),
)
}
"DirectoryUnavailableException" => {
return RusotoError::Service(CreateUserError::DirectoryUnavailable(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(CreateUserError::InvalidParameter(err.msg))
}
"InvalidPasswordException" => {
return RusotoError::Service(CreateUserError::InvalidPassword(err.msg))
}
"NameAvailabilityException" => {
return RusotoError::Service(CreateUserError::NameAvailability(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(CreateUserError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(CreateUserError::OrganizationState(err.msg))
}
"ReservedNameException" => {
return RusotoError::Service(CreateUserError::ReservedName(err.msg))
}
"UnsupportedOperationException" => {
return RusotoError::Service(CreateUserError::UnsupportedOperation(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::DirectoryServiceAuthenticationFailed(ref cause) => cause,
CreateUserError::DirectoryUnavailable(ref cause) => cause,
CreateUserError::InvalidParameter(ref cause) => cause,
CreateUserError::InvalidPassword(ref cause) => cause,
CreateUserError::NameAvailability(ref cause) => cause,
CreateUserError::OrganizationNotFound(ref cause) => cause,
CreateUserError::OrganizationState(ref cause) => cause,
CreateUserError::ReservedName(ref cause) => cause,
CreateUserError::UnsupportedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteAliasError {
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl DeleteAliasError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAliasError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(DeleteAliasError::EntityNotFound(err.msg))
}
"EntityStateException" => {
return RusotoError::Service(DeleteAliasError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DeleteAliasError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(DeleteAliasError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(DeleteAliasError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteAliasError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteAliasError {
fn description(&self) -> &str {
match *self {
DeleteAliasError::EntityNotFound(ref cause) => cause,
DeleteAliasError::EntityState(ref cause) => cause,
DeleteAliasError::InvalidParameter(ref cause) => cause,
DeleteAliasError::OrganizationNotFound(ref cause) => cause,
DeleteAliasError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteGroupError {
DirectoryServiceAuthenticationFailed(String),
DirectoryUnavailable(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
UnsupportedOperation(String),
}
impl DeleteGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryServiceAuthenticationFailedException" => {
return RusotoError::Service(
DeleteGroupError::DirectoryServiceAuthenticationFailed(err.msg),
)
}
"DirectoryUnavailableException" => {
return RusotoError::Service(DeleteGroupError::DirectoryUnavailable(err.msg))
}
"EntityStateException" => {
return RusotoError::Service(DeleteGroupError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DeleteGroupError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(DeleteGroupError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(DeleteGroupError::OrganizationState(err.msg))
}
"UnsupportedOperationException" => {
return RusotoError::Service(DeleteGroupError::UnsupportedOperation(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteGroupError {
fn description(&self) -> &str {
match *self {
DeleteGroupError::DirectoryServiceAuthenticationFailed(ref cause) => cause,
DeleteGroupError::DirectoryUnavailable(ref cause) => cause,
DeleteGroupError::EntityState(ref cause) => cause,
DeleteGroupError::InvalidParameter(ref cause) => cause,
DeleteGroupError::OrganizationNotFound(ref cause) => cause,
DeleteGroupError::OrganizationState(ref cause) => cause,
DeleteGroupError::UnsupportedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteMailboxPermissionsError {
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl DeleteMailboxPermissionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteMailboxPermissionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(DeleteMailboxPermissionsError::EntityNotFound(
err.msg,
))
}
"EntityStateException" => {
return RusotoError::Service(DeleteMailboxPermissionsError::EntityState(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(DeleteMailboxPermissionsError::InvalidParameter(
err.msg,
))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(
DeleteMailboxPermissionsError::OrganizationNotFound(err.msg),
)
}
"OrganizationStateException" => {
return RusotoError::Service(DeleteMailboxPermissionsError::OrganizationState(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteMailboxPermissionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteMailboxPermissionsError {
fn description(&self) -> &str {
match *self {
DeleteMailboxPermissionsError::EntityNotFound(ref cause) => cause,
DeleteMailboxPermissionsError::EntityState(ref cause) => cause,
DeleteMailboxPermissionsError::InvalidParameter(ref cause) => cause,
DeleteMailboxPermissionsError::OrganizationNotFound(ref cause) => cause,
DeleteMailboxPermissionsError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteResourceError {
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl DeleteResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityStateException" => {
return RusotoError::Service(DeleteResourceError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DeleteResourceError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(DeleteResourceError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(DeleteResourceError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteResourceError {
fn description(&self) -> &str {
match *self {
DeleteResourceError::EntityState(ref cause) => cause,
DeleteResourceError::InvalidParameter(ref cause) => cause,
DeleteResourceError::OrganizationNotFound(ref cause) => cause,
DeleteResourceError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteUserError {
DirectoryServiceAuthenticationFailed(String),
DirectoryUnavailable(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
UnsupportedOperation(String),
}
impl DeleteUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteUserError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryServiceAuthenticationFailedException" => {
return RusotoError::Service(
DeleteUserError::DirectoryServiceAuthenticationFailed(err.msg),
)
}
"DirectoryUnavailableException" => {
return RusotoError::Service(DeleteUserError::DirectoryUnavailable(err.msg))
}
"EntityStateException" => {
return RusotoError::Service(DeleteUserError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DeleteUserError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(DeleteUserError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(DeleteUserError::OrganizationState(err.msg))
}
"UnsupportedOperationException" => {
return RusotoError::Service(DeleteUserError::UnsupportedOperation(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::DirectoryServiceAuthenticationFailed(ref cause) => cause,
DeleteUserError::DirectoryUnavailable(ref cause) => cause,
DeleteUserError::EntityState(ref cause) => cause,
DeleteUserError::InvalidParameter(ref cause) => cause,
DeleteUserError::OrganizationNotFound(ref cause) => cause,
DeleteUserError::OrganizationState(ref cause) => cause,
DeleteUserError::UnsupportedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeregisterFromWorkMailError {
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl DeregisterFromWorkMailError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeregisterFromWorkMailError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(DeregisterFromWorkMailError::EntityNotFound(
err.msg,
))
}
"EntityStateException" => {
return RusotoError::Service(DeregisterFromWorkMailError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DeregisterFromWorkMailError::InvalidParameter(
err.msg,
))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(DeregisterFromWorkMailError::OrganizationNotFound(
err.msg,
))
}
"OrganizationStateException" => {
return RusotoError::Service(DeregisterFromWorkMailError::OrganizationState(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeregisterFromWorkMailError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeregisterFromWorkMailError {
fn description(&self) -> &str {
match *self {
DeregisterFromWorkMailError::EntityNotFound(ref cause) => cause,
DeregisterFromWorkMailError::EntityState(ref cause) => cause,
DeregisterFromWorkMailError::InvalidParameter(ref cause) => cause,
DeregisterFromWorkMailError::OrganizationNotFound(ref cause) => cause,
DeregisterFromWorkMailError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeGroupError {
EntityNotFound(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl DescribeGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(DescribeGroupError::EntityNotFound(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DescribeGroupError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(DescribeGroupError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(DescribeGroupError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeGroupError {
fn description(&self) -> &str {
match *self {
DescribeGroupError::EntityNotFound(ref cause) => cause,
DescribeGroupError::InvalidParameter(ref cause) => cause,
DescribeGroupError::OrganizationNotFound(ref cause) => cause,
DescribeGroupError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeOrganizationError {
InvalidParameter(String),
OrganizationNotFound(String),
}
impl DescribeOrganizationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeOrganizationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DescribeOrganizationError::InvalidParameter(
err.msg,
))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(DescribeOrganizationError::OrganizationNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeOrganizationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeOrganizationError {
fn description(&self) -> &str {
match *self {
DescribeOrganizationError::InvalidParameter(ref cause) => cause,
DescribeOrganizationError::OrganizationNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeResourceError {
EntityNotFound(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl DescribeResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(DescribeResourceError::EntityNotFound(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DescribeResourceError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(DescribeResourceError::OrganizationNotFound(
err.msg,
))
}
"OrganizationStateException" => {
return RusotoError::Service(DescribeResourceError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeResourceError {
fn description(&self) -> &str {
match *self {
DescribeResourceError::EntityNotFound(ref cause) => cause,
DescribeResourceError::InvalidParameter(ref cause) => cause,
DescribeResourceError::OrganizationNotFound(ref cause) => cause,
DescribeResourceError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeUserError {
EntityNotFound(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl DescribeUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeUserError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(DescribeUserError::EntityNotFound(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DescribeUserError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(DescribeUserError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(DescribeUserError::OrganizationState(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::EntityNotFound(ref cause) => cause,
DescribeUserError::InvalidParameter(ref cause) => cause,
DescribeUserError::OrganizationNotFound(ref cause) => cause,
DescribeUserError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateDelegateFromResourceError {
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl DisassociateDelegateFromResourceError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DisassociateDelegateFromResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(
DisassociateDelegateFromResourceError::EntityNotFound(err.msg),
)
}
"EntityStateException" => {
return RusotoError::Service(
DisassociateDelegateFromResourceError::EntityState(err.msg),
)
}
"InvalidParameterException" => {
return RusotoError::Service(
DisassociateDelegateFromResourceError::InvalidParameter(err.msg),
)
}
"OrganizationNotFoundException" => {
return RusotoError::Service(
DisassociateDelegateFromResourceError::OrganizationNotFound(err.msg),
)
}
"OrganizationStateException" => {
return RusotoError::Service(
DisassociateDelegateFromResourceError::OrganizationState(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DisassociateDelegateFromResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateDelegateFromResourceError {
fn description(&self) -> &str {
match *self {
DisassociateDelegateFromResourceError::EntityNotFound(ref cause) => cause,
DisassociateDelegateFromResourceError::EntityState(ref cause) => cause,
DisassociateDelegateFromResourceError::InvalidParameter(ref cause) => cause,
DisassociateDelegateFromResourceError::OrganizationNotFound(ref cause) => cause,
DisassociateDelegateFromResourceError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateMemberFromGroupError {
DirectoryServiceAuthenticationFailed(String),
DirectoryUnavailable(String),
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
UnsupportedOperation(String),
}
impl DisassociateMemberFromGroupError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DisassociateMemberFromGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryServiceAuthenticationFailedException" => {
return RusotoError::Service(
DisassociateMemberFromGroupError::DirectoryServiceAuthenticationFailed(
err.msg,
),
)
}
"DirectoryUnavailableException" => {
return RusotoError::Service(
DisassociateMemberFromGroupError::DirectoryUnavailable(err.msg),
)
}
"EntityNotFoundException" => {
return RusotoError::Service(DisassociateMemberFromGroupError::EntityNotFound(
err.msg,
))
}
"EntityStateException" => {
return RusotoError::Service(DisassociateMemberFromGroupError::EntityState(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(
DisassociateMemberFromGroupError::InvalidParameter(err.msg),
)
}
"OrganizationNotFoundException" => {
return RusotoError::Service(
DisassociateMemberFromGroupError::OrganizationNotFound(err.msg),
)
}
"OrganizationStateException" => {
return RusotoError::Service(
DisassociateMemberFromGroupError::OrganizationState(err.msg),
)
}
"UnsupportedOperationException" => {
return RusotoError::Service(
DisassociateMemberFromGroupError::UnsupportedOperation(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DisassociateMemberFromGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateMemberFromGroupError {
fn description(&self) -> &str {
match *self {
DisassociateMemberFromGroupError::DirectoryServiceAuthenticationFailed(ref cause) => {
cause
}
DisassociateMemberFromGroupError::DirectoryUnavailable(ref cause) => cause,
DisassociateMemberFromGroupError::EntityNotFound(ref cause) => cause,
DisassociateMemberFromGroupError::EntityState(ref cause) => cause,
DisassociateMemberFromGroupError::InvalidParameter(ref cause) => cause,
DisassociateMemberFromGroupError::OrganizationNotFound(ref cause) => cause,
DisassociateMemberFromGroupError::OrganizationState(ref cause) => cause,
DisassociateMemberFromGroupError::UnsupportedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetMailboxDetailsError {
EntityNotFound(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl GetMailboxDetailsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetMailboxDetailsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(GetMailboxDetailsError::EntityNotFound(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(GetMailboxDetailsError::OrganizationNotFound(
err.msg,
))
}
"OrganizationStateException" => {
return RusotoError::Service(GetMailboxDetailsError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetMailboxDetailsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetMailboxDetailsError {
fn description(&self) -> &str {
match *self {
GetMailboxDetailsError::EntityNotFound(ref cause) => cause,
GetMailboxDetailsError::OrganizationNotFound(ref cause) => cause,
GetMailboxDetailsError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAliasesError {
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl ListAliasesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListAliasesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(ListAliasesError::EntityNotFound(err.msg))
}
"EntityStateException" => {
return RusotoError::Service(ListAliasesError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ListAliasesError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(ListAliasesError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(ListAliasesError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListAliasesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAliasesError {
fn description(&self) -> &str {
match *self {
ListAliasesError::EntityNotFound(ref cause) => cause,
ListAliasesError::EntityState(ref cause) => cause,
ListAliasesError::InvalidParameter(ref cause) => cause,
ListAliasesError::OrganizationNotFound(ref cause) => cause,
ListAliasesError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListGroupMembersError {
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl ListGroupMembersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListGroupMembersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(ListGroupMembersError::EntityNotFound(err.msg))
}
"EntityStateException" => {
return RusotoError::Service(ListGroupMembersError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ListGroupMembersError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(ListGroupMembersError::OrganizationNotFound(
err.msg,
))
}
"OrganizationStateException" => {
return RusotoError::Service(ListGroupMembersError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListGroupMembersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListGroupMembersError {
fn description(&self) -> &str {
match *self {
ListGroupMembersError::EntityNotFound(ref cause) => cause,
ListGroupMembersError::EntityState(ref cause) => cause,
ListGroupMembersError::InvalidParameter(ref cause) => cause,
ListGroupMembersError::OrganizationNotFound(ref cause) => cause,
ListGroupMembersError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListGroupsError {
EntityNotFound(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl ListGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListGroupsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(ListGroupsError::EntityNotFound(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ListGroupsError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(ListGroupsError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(ListGroupsError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListGroupsError {
fn description(&self) -> &str {
match *self {
ListGroupsError::EntityNotFound(ref cause) => cause,
ListGroupsError::InvalidParameter(ref cause) => cause,
ListGroupsError::OrganizationNotFound(ref cause) => cause,
ListGroupsError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListMailboxPermissionsError {
EntityNotFound(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl ListMailboxPermissionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListMailboxPermissionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(ListMailboxPermissionsError::EntityNotFound(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(ListMailboxPermissionsError::InvalidParameter(
err.msg,
))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(ListMailboxPermissionsError::OrganizationNotFound(
err.msg,
))
}
"OrganizationStateException" => {
return RusotoError::Service(ListMailboxPermissionsError::OrganizationState(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListMailboxPermissionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListMailboxPermissionsError {
fn description(&self) -> &str {
match *self {
ListMailboxPermissionsError::EntityNotFound(ref cause) => cause,
ListMailboxPermissionsError::InvalidParameter(ref cause) => cause,
ListMailboxPermissionsError::OrganizationNotFound(ref cause) => cause,
ListMailboxPermissionsError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListOrganizationsError {
InvalidParameter(String),
}
impl ListOrganizationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListOrganizationsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(ListOrganizationsError::InvalidParameter(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListOrganizationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListOrganizationsError {
fn description(&self) -> &str {
match *self {
ListOrganizationsError::InvalidParameter(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListResourceDelegatesError {
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl ListResourceDelegatesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListResourceDelegatesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(ListResourceDelegatesError::EntityNotFound(
err.msg,
))
}
"EntityStateException" => {
return RusotoError::Service(ListResourceDelegatesError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ListResourceDelegatesError::InvalidParameter(
err.msg,
))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(ListResourceDelegatesError::OrganizationNotFound(
err.msg,
))
}
"OrganizationStateException" => {
return RusotoError::Service(ListResourceDelegatesError::OrganizationState(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListResourceDelegatesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListResourceDelegatesError {
fn description(&self) -> &str {
match *self {
ListResourceDelegatesError::EntityNotFound(ref cause) => cause,
ListResourceDelegatesError::EntityState(ref cause) => cause,
ListResourceDelegatesError::InvalidParameter(ref cause) => cause,
ListResourceDelegatesError::OrganizationNotFound(ref cause) => cause,
ListResourceDelegatesError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListResourcesError {
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl ListResourcesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListResourcesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(ListResourcesError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(ListResourcesError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(ListResourcesError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListResourcesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListResourcesError {
fn description(&self) -> &str {
match *self {
ListResourcesError::InvalidParameter(ref cause) => cause,
ListResourcesError::OrganizationNotFound(ref cause) => cause,
ListResourcesError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListUsersError {
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl ListUsersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListUsersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(ListUsersError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(ListUsersError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(ListUsersError::OrganizationState(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::InvalidParameter(ref cause) => cause,
ListUsersError::OrganizationNotFound(ref cause) => cause,
ListUsersError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutMailboxPermissionsError {
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl PutMailboxPermissionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutMailboxPermissionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(PutMailboxPermissionsError::EntityNotFound(
err.msg,
))
}
"EntityStateException" => {
return RusotoError::Service(PutMailboxPermissionsError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(PutMailboxPermissionsError::InvalidParameter(
err.msg,
))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(PutMailboxPermissionsError::OrganizationNotFound(
err.msg,
))
}
"OrganizationStateException" => {
return RusotoError::Service(PutMailboxPermissionsError::OrganizationState(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutMailboxPermissionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutMailboxPermissionsError {
fn description(&self) -> &str {
match *self {
PutMailboxPermissionsError::EntityNotFound(ref cause) => cause,
PutMailboxPermissionsError::EntityState(ref cause) => cause,
PutMailboxPermissionsError::InvalidParameter(ref cause) => cause,
PutMailboxPermissionsError::OrganizationNotFound(ref cause) => cause,
PutMailboxPermissionsError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RegisterToWorkMailError {
DirectoryServiceAuthenticationFailed(String),
DirectoryUnavailable(String),
EmailAddressInUse(String),
EntityAlreadyRegistered(String),
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
MailDomainNotFound(String),
MailDomainState(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl RegisterToWorkMailError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RegisterToWorkMailError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryServiceAuthenticationFailedException" => {
return RusotoError::Service(
RegisterToWorkMailError::DirectoryServiceAuthenticationFailed(err.msg),
)
}
"DirectoryUnavailableException" => {
return RusotoError::Service(RegisterToWorkMailError::DirectoryUnavailable(
err.msg,
))
}
"EmailAddressInUseException" => {
return RusotoError::Service(RegisterToWorkMailError::EmailAddressInUse(
err.msg,
))
}
"EntityAlreadyRegisteredException" => {
return RusotoError::Service(RegisterToWorkMailError::EntityAlreadyRegistered(
err.msg,
))
}
"EntityNotFoundException" => {
return RusotoError::Service(RegisterToWorkMailError::EntityNotFound(err.msg))
}
"EntityStateException" => {
return RusotoError::Service(RegisterToWorkMailError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(RegisterToWorkMailError::InvalidParameter(err.msg))
}
"MailDomainNotFoundException" => {
return RusotoError::Service(RegisterToWorkMailError::MailDomainNotFound(
err.msg,
))
}
"MailDomainStateException" => {
return RusotoError::Service(RegisterToWorkMailError::MailDomainState(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(RegisterToWorkMailError::OrganizationNotFound(
err.msg,
))
}
"OrganizationStateException" => {
return RusotoError::Service(RegisterToWorkMailError::OrganizationState(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RegisterToWorkMailError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RegisterToWorkMailError {
fn description(&self) -> &str {
match *self {
RegisterToWorkMailError::DirectoryServiceAuthenticationFailed(ref cause) => cause,
RegisterToWorkMailError::DirectoryUnavailable(ref cause) => cause,
RegisterToWorkMailError::EmailAddressInUse(ref cause) => cause,
RegisterToWorkMailError::EntityAlreadyRegistered(ref cause) => cause,
RegisterToWorkMailError::EntityNotFound(ref cause) => cause,
RegisterToWorkMailError::EntityState(ref cause) => cause,
RegisterToWorkMailError::InvalidParameter(ref cause) => cause,
RegisterToWorkMailError::MailDomainNotFound(ref cause) => cause,
RegisterToWorkMailError::MailDomainState(ref cause) => cause,
RegisterToWorkMailError::OrganizationNotFound(ref cause) => cause,
RegisterToWorkMailError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ResetPasswordError {
DirectoryServiceAuthenticationFailed(String),
DirectoryUnavailable(String),
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
InvalidPassword(String),
OrganizationNotFound(String),
OrganizationState(String),
UnsupportedOperation(String),
}
impl ResetPasswordError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ResetPasswordError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryServiceAuthenticationFailedException" => {
return RusotoError::Service(
ResetPasswordError::DirectoryServiceAuthenticationFailed(err.msg),
)
}
"DirectoryUnavailableException" => {
return RusotoError::Service(ResetPasswordError::DirectoryUnavailable(err.msg))
}
"EntityNotFoundException" => {
return RusotoError::Service(ResetPasswordError::EntityNotFound(err.msg))
}
"EntityStateException" => {
return RusotoError::Service(ResetPasswordError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ResetPasswordError::InvalidParameter(err.msg))
}
"InvalidPasswordException" => {
return RusotoError::Service(ResetPasswordError::InvalidPassword(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(ResetPasswordError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(ResetPasswordError::OrganizationState(err.msg))
}
"UnsupportedOperationException" => {
return RusotoError::Service(ResetPasswordError::UnsupportedOperation(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ResetPasswordError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ResetPasswordError {
fn description(&self) -> &str {
match *self {
ResetPasswordError::DirectoryServiceAuthenticationFailed(ref cause) => cause,
ResetPasswordError::DirectoryUnavailable(ref cause) => cause,
ResetPasswordError::EntityNotFound(ref cause) => cause,
ResetPasswordError::EntityState(ref cause) => cause,
ResetPasswordError::InvalidParameter(ref cause) => cause,
ResetPasswordError::InvalidPassword(ref cause) => cause,
ResetPasswordError::OrganizationNotFound(ref cause) => cause,
ResetPasswordError::OrganizationState(ref cause) => cause,
ResetPasswordError::UnsupportedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateMailboxQuotaError {
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl UpdateMailboxQuotaError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateMailboxQuotaError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EntityNotFoundException" => {
return RusotoError::Service(UpdateMailboxQuotaError::EntityNotFound(err.msg))
}
"EntityStateException" => {
return RusotoError::Service(UpdateMailboxQuotaError::EntityState(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(UpdateMailboxQuotaError::InvalidParameter(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(UpdateMailboxQuotaError::OrganizationNotFound(
err.msg,
))
}
"OrganizationStateException" => {
return RusotoError::Service(UpdateMailboxQuotaError::OrganizationState(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateMailboxQuotaError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateMailboxQuotaError {
fn description(&self) -> &str {
match *self {
UpdateMailboxQuotaError::EntityNotFound(ref cause) => cause,
UpdateMailboxQuotaError::EntityState(ref cause) => cause,
UpdateMailboxQuotaError::InvalidParameter(ref cause) => cause,
UpdateMailboxQuotaError::OrganizationNotFound(ref cause) => cause,
UpdateMailboxQuotaError::OrganizationState(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdatePrimaryEmailAddressError {
DirectoryServiceAuthenticationFailed(String),
DirectoryUnavailable(String),
EmailAddressInUse(String),
EntityNotFound(String),
EntityState(String),
InvalidParameter(String),
MailDomainNotFound(String),
MailDomainState(String),
OrganizationNotFound(String),
OrganizationState(String),
UnsupportedOperation(String),
}
impl UpdatePrimaryEmailAddressError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdatePrimaryEmailAddressError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryServiceAuthenticationFailedException" => {
return RusotoError::Service(
UpdatePrimaryEmailAddressError::DirectoryServiceAuthenticationFailed(
err.msg,
),
)
}
"DirectoryUnavailableException" => {
return RusotoError::Service(
UpdatePrimaryEmailAddressError::DirectoryUnavailable(err.msg),
)
}
"EmailAddressInUseException" => {
return RusotoError::Service(UpdatePrimaryEmailAddressError::EmailAddressInUse(
err.msg,
))
}
"EntityNotFoundException" => {
return RusotoError::Service(UpdatePrimaryEmailAddressError::EntityNotFound(
err.msg,
))
}
"EntityStateException" => {
return RusotoError::Service(UpdatePrimaryEmailAddressError::EntityState(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(UpdatePrimaryEmailAddressError::InvalidParameter(
err.msg,
))
}
"MailDomainNotFoundException" => {
return RusotoError::Service(
UpdatePrimaryEmailAddressError::MailDomainNotFound(err.msg),
)
}
"MailDomainStateException" => {
return RusotoError::Service(UpdatePrimaryEmailAddressError::MailDomainState(
err.msg,
))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(
UpdatePrimaryEmailAddressError::OrganizationNotFound(err.msg),
)
}
"OrganizationStateException" => {
return RusotoError::Service(UpdatePrimaryEmailAddressError::OrganizationState(
err.msg,
))
}
"UnsupportedOperationException" => {
return RusotoError::Service(
UpdatePrimaryEmailAddressError::UnsupportedOperation(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdatePrimaryEmailAddressError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdatePrimaryEmailAddressError {
fn description(&self) -> &str {
match *self {
UpdatePrimaryEmailAddressError::DirectoryServiceAuthenticationFailed(ref cause) => {
cause
}
UpdatePrimaryEmailAddressError::DirectoryUnavailable(ref cause) => cause,
UpdatePrimaryEmailAddressError::EmailAddressInUse(ref cause) => cause,
UpdatePrimaryEmailAddressError::EntityNotFound(ref cause) => cause,
UpdatePrimaryEmailAddressError::EntityState(ref cause) => cause,
UpdatePrimaryEmailAddressError::InvalidParameter(ref cause) => cause,
UpdatePrimaryEmailAddressError::MailDomainNotFound(ref cause) => cause,
UpdatePrimaryEmailAddressError::MailDomainState(ref cause) => cause,
UpdatePrimaryEmailAddressError::OrganizationNotFound(ref cause) => cause,
UpdatePrimaryEmailAddressError::OrganizationState(ref cause) => cause,
UpdatePrimaryEmailAddressError::UnsupportedOperation(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateResourceError {
DirectoryUnavailable(String),
EmailAddressInUse(String),
EntityNotFound(String),
EntityState(String),
InvalidConfiguration(String),
MailDomainNotFound(String),
MailDomainState(String),
NameAvailability(String),
OrganizationNotFound(String),
OrganizationState(String),
}
impl UpdateResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DirectoryUnavailableException" => {
return RusotoError::Service(UpdateResourceError::DirectoryUnavailable(err.msg))
}
"EmailAddressInUseException" => {
return RusotoError::Service(UpdateResourceError::EmailAddressInUse(err.msg))
}
"EntityNotFoundException" => {
return RusotoError::Service(UpdateResourceError::EntityNotFound(err.msg))
}
"EntityStateException" => {
return RusotoError::Service(UpdateResourceError::EntityState(err.msg))
}
"InvalidConfigurationException" => {
return RusotoError::Service(UpdateResourceError::InvalidConfiguration(err.msg))
}
"MailDomainNotFoundException" => {
return RusotoError::Service(UpdateResourceError::MailDomainNotFound(err.msg))
}
"MailDomainStateException" => {
return RusotoError::Service(UpdateResourceError::MailDomainState(err.msg))
}
"NameAvailabilityException" => {
return RusotoError::Service(UpdateResourceError::NameAvailability(err.msg))
}
"OrganizationNotFoundException" => {
return RusotoError::Service(UpdateResourceError::OrganizationNotFound(err.msg))
}
"OrganizationStateException" => {
return RusotoError::Service(UpdateResourceError::OrganizationState(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateResourceError {
fn description(&self) -> &str {
match *self {
UpdateResourceError::DirectoryUnavailable(ref cause) => cause,
UpdateResourceError::EmailAddressInUse(ref cause) => cause,
UpdateResourceError::EntityNotFound(ref cause) => cause,
UpdateResourceError::EntityState(ref cause) => cause,
UpdateResourceError::InvalidConfiguration(ref cause) => cause,
UpdateResourceError::MailDomainNotFound(ref cause) => cause,
UpdateResourceError::MailDomainState(ref cause) => cause,
UpdateResourceError::NameAvailability(ref cause) => cause,
UpdateResourceError::OrganizationNotFound(ref cause) => cause,
UpdateResourceError::OrganizationState(ref cause) => cause,
}
}
}
pub trait Workmail {
fn associate_delegate_to_resource(
&self,
input: AssociateDelegateToResourceRequest,
) -> RusotoFuture<AssociateDelegateToResourceResponse, AssociateDelegateToResourceError>;
fn associate_member_to_group(
&self,
input: AssociateMemberToGroupRequest,
) -> RusotoFuture<AssociateMemberToGroupResponse, AssociateMemberToGroupError>;
fn create_alias(
&self,
input: CreateAliasRequest,
) -> RusotoFuture<CreateAliasResponse, CreateAliasError>;
fn create_group(
&self,
input: CreateGroupRequest,
) -> RusotoFuture<CreateGroupResponse, CreateGroupError>;
fn create_resource(
&self,
input: CreateResourceRequest,
) -> RusotoFuture<CreateResourceResponse, CreateResourceError>;
fn create_user(
&self,
input: CreateUserRequest,
) -> RusotoFuture<CreateUserResponse, CreateUserError>;
fn delete_alias(
&self,
input: DeleteAliasRequest,
) -> RusotoFuture<DeleteAliasResponse, DeleteAliasError>;
fn delete_group(
&self,
input: DeleteGroupRequest,
) -> RusotoFuture<DeleteGroupResponse, DeleteGroupError>;
fn delete_mailbox_permissions(
&self,
input: DeleteMailboxPermissionsRequest,
) -> RusotoFuture<DeleteMailboxPermissionsResponse, DeleteMailboxPermissionsError>;
fn delete_resource(
&self,
input: DeleteResourceRequest,
) -> RusotoFuture<DeleteResourceResponse, DeleteResourceError>;
fn delete_user(
&self,
input: DeleteUserRequest,
) -> RusotoFuture<DeleteUserResponse, DeleteUserError>;
fn deregister_from_work_mail(
&self,
input: DeregisterFromWorkMailRequest,
) -> RusotoFuture<DeregisterFromWorkMailResponse, DeregisterFromWorkMailError>;
fn describe_group(
&self,
input: DescribeGroupRequest,
) -> RusotoFuture<DescribeGroupResponse, DescribeGroupError>;
fn describe_organization(
&self,
input: DescribeOrganizationRequest,
) -> RusotoFuture<DescribeOrganizationResponse, DescribeOrganizationError>;
fn describe_resource(
&self,
input: DescribeResourceRequest,
) -> RusotoFuture<DescribeResourceResponse, DescribeResourceError>;
fn describe_user(
&self,
input: DescribeUserRequest,
) -> RusotoFuture<DescribeUserResponse, DescribeUserError>;
fn disassociate_delegate_from_resource(
&self,
input: DisassociateDelegateFromResourceRequest,
) -> RusotoFuture<DisassociateDelegateFromResourceResponse, DisassociateDelegateFromResourceError>;
fn disassociate_member_from_group(
&self,
input: DisassociateMemberFromGroupRequest,
) -> RusotoFuture<DisassociateMemberFromGroupResponse, DisassociateMemberFromGroupError>;
fn get_mailbox_details(
&self,
input: GetMailboxDetailsRequest,
) -> RusotoFuture<GetMailboxDetailsResponse, GetMailboxDetailsError>;
fn list_aliases(
&self,
input: ListAliasesRequest,
) -> RusotoFuture<ListAliasesResponse, ListAliasesError>;
fn list_group_members(
&self,
input: ListGroupMembersRequest,
) -> RusotoFuture<ListGroupMembersResponse, ListGroupMembersError>;
fn list_groups(
&self,
input: ListGroupsRequest,
) -> RusotoFuture<ListGroupsResponse, ListGroupsError>;
fn list_mailbox_permissions(
&self,
input: ListMailboxPermissionsRequest,
) -> RusotoFuture<ListMailboxPermissionsResponse, ListMailboxPermissionsError>;
fn list_organizations(
&self,
input: ListOrganizationsRequest,
) -> RusotoFuture<ListOrganizationsResponse, ListOrganizationsError>;
fn list_resource_delegates(
&self,
input: ListResourceDelegatesRequest,
) -> RusotoFuture<ListResourceDelegatesResponse, ListResourceDelegatesError>;
fn list_resources(
&self,
input: ListResourcesRequest,
) -> RusotoFuture<ListResourcesResponse, ListResourcesError>;
fn list_users(
&self,
input: ListUsersRequest,
) -> RusotoFuture<ListUsersResponse, ListUsersError>;
fn put_mailbox_permissions(
&self,
input: PutMailboxPermissionsRequest,
) -> RusotoFuture<PutMailboxPermissionsResponse, PutMailboxPermissionsError>;
fn register_to_work_mail(
&self,
input: RegisterToWorkMailRequest,
) -> RusotoFuture<RegisterToWorkMailResponse, RegisterToWorkMailError>;
fn reset_password(
&self,
input: ResetPasswordRequest,
) -> RusotoFuture<ResetPasswordResponse, ResetPasswordError>;
fn update_mailbox_quota(
&self,
input: UpdateMailboxQuotaRequest,
) -> RusotoFuture<UpdateMailboxQuotaResponse, UpdateMailboxQuotaError>;
fn update_primary_email_address(
&self,
input: UpdatePrimaryEmailAddressRequest,
) -> RusotoFuture<UpdatePrimaryEmailAddressResponse, UpdatePrimaryEmailAddressError>;
fn update_resource(
&self,
input: UpdateResourceRequest,
) -> RusotoFuture<UpdateResourceResponse, UpdateResourceError>;
}
#[derive(Clone)]
pub struct WorkmailClient {
client: Client,
region: region::Region,
}
impl WorkmailClient {
pub fn new(region: region::Region) -> WorkmailClient {
WorkmailClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> WorkmailClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
WorkmailClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Workmail for WorkmailClient {
fn associate_delegate_to_resource(
&self,
input: AssociateDelegateToResourceRequest,
) -> RusotoFuture<AssociateDelegateToResourceResponse, AssociateDelegateToResourceError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"WorkMailService.AssociateDelegateToResource",
);
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::<AssociateDelegateToResourceResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AssociateDelegateToResourceError::from_response(response))
}))
}
})
}
fn associate_member_to_group(
&self,
input: AssociateMemberToGroupRequest,
) -> RusotoFuture<AssociateMemberToGroupResponse, AssociateMemberToGroupError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.AssociateMemberToGroup");
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::<AssociateMemberToGroupResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(AssociateMemberToGroupError::from_response(response))
}),
)
}
})
}
fn create_alias(
&self,
input: CreateAliasRequest,
) -> RusotoFuture<CreateAliasResponse, CreateAliasError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.CreateAlias");
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::<CreateAliasResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateAliasError::from_response(response))),
)
}
})
}
fn create_group(
&self,
input: CreateGroupRequest,
) -> RusotoFuture<CreateGroupResponse, CreateGroupError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.CreateGroup");
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::<CreateGroupResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateGroupError::from_response(response))),
)
}
})
}
fn create_resource(
&self,
input: CreateResourceRequest,
) -> RusotoFuture<CreateResourceResponse, CreateResourceError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.CreateResource");
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::<CreateResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateResourceError::from_response(response))),
)
}
})
}
fn create_user(
&self,
input: CreateUserRequest,
) -> RusotoFuture<CreateUserResponse, CreateUserError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.CreateUser");
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::<CreateUserResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateUserError::from_response(response))),
)
}
})
}
fn delete_alias(
&self,
input: DeleteAliasRequest,
) -> RusotoFuture<DeleteAliasResponse, DeleteAliasError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.DeleteAlias");
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::<DeleteAliasResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteAliasError::from_response(response))),
)
}
})
}
fn delete_group(
&self,
input: DeleteGroupRequest,
) -> RusotoFuture<DeleteGroupResponse, DeleteGroupError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.DeleteGroup");
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::<DeleteGroupResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteGroupError::from_response(response))),
)
}
})
}
fn delete_mailbox_permissions(
&self,
input: DeleteMailboxPermissionsRequest,
) -> RusotoFuture<DeleteMailboxPermissionsResponse, DeleteMailboxPermissionsError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.DeleteMailboxPermissions");
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::<DeleteMailboxPermissionsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteMailboxPermissionsError::from_response(response))
}))
}
})
}
fn delete_resource(
&self,
input: DeleteResourceRequest,
) -> RusotoFuture<DeleteResourceResponse, DeleteResourceError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.DeleteResource");
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::<DeleteResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteResourceError::from_response(response))),
)
}
})
}
fn delete_user(
&self,
input: DeleteUserRequest,
) -> RusotoFuture<DeleteUserResponse, DeleteUserError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.DeleteUser");
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::<DeleteUserResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteUserError::from_response(response))),
)
}
})
}
fn deregister_from_work_mail(
&self,
input: DeregisterFromWorkMailRequest,
) -> RusotoFuture<DeregisterFromWorkMailResponse, DeregisterFromWorkMailError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.DeregisterFromWorkMail");
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::<DeregisterFromWorkMailResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeregisterFromWorkMailError::from_response(response))
}),
)
}
})
}
fn describe_group(
&self,
input: DescribeGroupRequest,
) -> RusotoFuture<DescribeGroupResponse, DescribeGroupError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.DescribeGroup");
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::<DescribeGroupResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeGroupError::from_response(response))),
)
}
})
}
fn describe_organization(
&self,
input: DescribeOrganizationRequest,
) -> RusotoFuture<DescribeOrganizationResponse, DescribeOrganizationError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.DescribeOrganization");
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::<DescribeOrganizationResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeOrganizationError::from_response(response))
}),
)
}
})
}
fn describe_resource(
&self,
input: DescribeResourceRequest,
) -> RusotoFuture<DescribeResourceResponse, DescribeResourceError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.DescribeResource");
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::<DescribeResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeResourceError::from_response(response))),
)
}
})
}
fn describe_user(
&self,
input: DescribeUserRequest,
) -> RusotoFuture<DescribeUserResponse, DescribeUserError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.DescribeUser");
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::<DescribeUserResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeUserError::from_response(response))),
)
}
})
}
fn disassociate_delegate_from_resource(
&self,
input: DisassociateDelegateFromResourceRequest,
) -> RusotoFuture<DisassociateDelegateFromResourceResponse, DisassociateDelegateFromResourceError>
{
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"WorkMailService.DisassociateDelegateFromResource",
);
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::<DisassociateDelegateFromResourceResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DisassociateDelegateFromResourceError::from_response(
response,
))
}))
}
})
}
fn disassociate_member_from_group(
&self,
input: DisassociateMemberFromGroupRequest,
) -> RusotoFuture<DisassociateMemberFromGroupResponse, DisassociateMemberFromGroupError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"WorkMailService.DisassociateMemberFromGroup",
);
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::<DisassociateMemberFromGroupResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DisassociateMemberFromGroupError::from_response(response))
}))
}
})
}
fn get_mailbox_details(
&self,
input: GetMailboxDetailsRequest,
) -> RusotoFuture<GetMailboxDetailsResponse, GetMailboxDetailsError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.GetMailboxDetails");
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::<GetMailboxDetailsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetMailboxDetailsError::from_response(response))),
)
}
})
}
fn list_aliases(
&self,
input: ListAliasesRequest,
) -> RusotoFuture<ListAliasesResponse, ListAliasesError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.ListAliases");
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::<ListAliasesResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListAliasesError::from_response(response))),
)
}
})
}
fn list_group_members(
&self,
input: ListGroupMembersRequest,
) -> RusotoFuture<ListGroupMembersResponse, ListGroupMembersError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.ListGroupMembers");
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::<ListGroupMembersResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListGroupMembersError::from_response(response))),
)
}
})
}
fn list_groups(
&self,
input: ListGroupsRequest,
) -> RusotoFuture<ListGroupsResponse, ListGroupsError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.ListGroups");
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::<ListGroupsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListGroupsError::from_response(response))),
)
}
})
}
fn list_mailbox_permissions(
&self,
input: ListMailboxPermissionsRequest,
) -> RusotoFuture<ListMailboxPermissionsResponse, ListMailboxPermissionsError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.ListMailboxPermissions");
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::<ListMailboxPermissionsResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListMailboxPermissionsError::from_response(response))
}),
)
}
})
}
fn list_organizations(
&self,
input: ListOrganizationsRequest,
) -> RusotoFuture<ListOrganizationsResponse, ListOrganizationsError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.ListOrganizations");
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::<ListOrganizationsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListOrganizationsError::from_response(response))),
)
}
})
}
fn list_resource_delegates(
&self,
input: ListResourceDelegatesRequest,
) -> RusotoFuture<ListResourceDelegatesResponse, ListResourceDelegatesError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.ListResourceDelegates");
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::<ListResourceDelegatesResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListResourceDelegatesError::from_response(response))
}),
)
}
})
}
fn list_resources(
&self,
input: ListResourcesRequest,
) -> RusotoFuture<ListResourcesResponse, ListResourcesError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.ListResources");
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::<ListResourcesResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListResourcesError::from_response(response))),
)
}
})
}
fn list_users(
&self,
input: ListUsersRequest,
) -> RusotoFuture<ListUsersResponse, ListUsersError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.ListUsers");
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::<ListUsersResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListUsersError::from_response(response))),
)
}
})
}
fn put_mailbox_permissions(
&self,
input: PutMailboxPermissionsRequest,
) -> RusotoFuture<PutMailboxPermissionsResponse, PutMailboxPermissionsError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.PutMailboxPermissions");
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::<PutMailboxPermissionsResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(PutMailboxPermissionsError::from_response(response))
}),
)
}
})
}
fn register_to_work_mail(
&self,
input: RegisterToWorkMailRequest,
) -> RusotoFuture<RegisterToWorkMailResponse, RegisterToWorkMailError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.RegisterToWorkMail");
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::<RegisterToWorkMailResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RegisterToWorkMailError::from_response(response))),
)
}
})
}
fn reset_password(
&self,
input: ResetPasswordRequest,
) -> RusotoFuture<ResetPasswordResponse, ResetPasswordError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.ResetPassword");
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::<ResetPasswordResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ResetPasswordError::from_response(response))),
)
}
})
}
fn update_mailbox_quota(
&self,
input: UpdateMailboxQuotaRequest,
) -> RusotoFuture<UpdateMailboxQuotaResponse, UpdateMailboxQuotaError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.UpdateMailboxQuota");
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::<UpdateMailboxQuotaResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateMailboxQuotaError::from_response(response))),
)
}
})
}
fn update_primary_email_address(
&self,
input: UpdatePrimaryEmailAddressRequest,
) -> RusotoFuture<UpdatePrimaryEmailAddressResponse, UpdatePrimaryEmailAddressError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.UpdatePrimaryEmailAddress");
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::<UpdatePrimaryEmailAddressResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdatePrimaryEmailAddressError::from_response(response))
}))
}
})
}
fn update_resource(
&self,
input: UpdateResourceRequest,
) -> RusotoFuture<UpdateResourceResponse, UpdateResourceError> {
let mut request = SignedRequest::new("POST", "workmail", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "WorkMailService.UpdateResource");
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::<UpdateResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateResourceError::from_response(response))),
)
}
})
}
}