use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AbortDocumentVersionUploadRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DocumentId")]
pub document_id: String,
#[serde(rename = "VersionId")]
pub version_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ActivateUserRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ActivateUserResponse {
#[serde(rename = "User")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<User>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Activity {
#[serde(rename = "CommentMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment_metadata: Option<CommentMetadata>,
#[serde(rename = "Initiator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub initiator: Option<UserMetadata>,
#[serde(rename = "IsIndirectActivity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_indirect_activity: Option<bool>,
#[serde(rename = "OrganizationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_id: Option<String>,
#[serde(rename = "OriginalParent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub original_parent: Option<ResourceMetadata>,
#[serde(rename = "Participants")]
#[serde(skip_serializing_if = "Option::is_none")]
pub participants: Option<Participants>,
#[serde(rename = "ResourceMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_metadata: Option<ResourceMetadata>,
#[serde(rename = "TimeStamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_stamp: Option<f64>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AddResourcePermissionsRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "NotificationOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_options: Option<NotificationOptions>,
#[serde(rename = "Principals")]
pub principals: Vec<SharePrincipal>,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AddResourcePermissionsResponse {
#[serde(rename = "ShareResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub share_results: Option<Vec<ShareResult>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Comment {
#[serde(rename = "CommentId")]
pub comment_id: String,
#[serde(rename = "Contributor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub contributor: Option<User>,
#[serde(rename = "CreatedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_timestamp: Option<f64>,
#[serde(rename = "ParentId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parent_id: Option<String>,
#[serde(rename = "RecipientId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recipient_id: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "Text")]
#[serde(skip_serializing_if = "Option::is_none")]
pub text: Option<String>,
#[serde(rename = "ThreadId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_id: Option<String>,
#[serde(rename = "Visibility")]
#[serde(skip_serializing_if = "Option::is_none")]
pub visibility: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CommentMetadata {
#[serde(rename = "CommentId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment_id: Option<String>,
#[serde(rename = "CommentStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment_status: Option<String>,
#[serde(rename = "Contributor")]
#[serde(skip_serializing_if = "Option::is_none")]
pub contributor: Option<User>,
#[serde(rename = "CreatedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_timestamp: Option<f64>,
#[serde(rename = "RecipientId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recipient_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateCommentRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DocumentId")]
pub document_id: String,
#[serde(rename = "NotifyCollaborators")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notify_collaborators: Option<bool>,
#[serde(rename = "ParentId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parent_id: Option<String>,
#[serde(rename = "Text")]
pub text: String,
#[serde(rename = "ThreadId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_id: Option<String>,
#[serde(rename = "VersionId")]
pub version_id: String,
#[serde(rename = "Visibility")]
#[serde(skip_serializing_if = "Option::is_none")]
pub visibility: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateCommentResponse {
#[serde(rename = "Comment")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comment: Option<Comment>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateCustomMetadataRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "CustomMetadata")]
pub custom_metadata: ::std::collections::HashMap<String, String>,
#[serde(rename = "ResourceId")]
pub resource_id: String,
#[serde(rename = "VersionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateCustomMetadataResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateFolderRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ParentFolderId")]
pub parent_folder_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateFolderResponse {
#[serde(rename = "Metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<FolderMetadata>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateLabelsRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "Labels")]
pub labels: Vec<String>,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateLabelsResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateNotificationSubscriptionRequest {
#[serde(rename = "Endpoint")]
pub endpoint: String,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "Protocol")]
pub protocol: String,
#[serde(rename = "SubscriptionType")]
pub subscription_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateNotificationSubscriptionResponse {
#[serde(rename = "Subscription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subscription: Option<Subscription>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateUserRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "EmailAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email_address: Option<String>,
#[serde(rename = "GivenName")]
pub given_name: String,
#[serde(rename = "OrganizationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_id: Option<String>,
#[serde(rename = "Password")]
pub password: String,
#[serde(rename = "StorageRule")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storage_rule: Option<StorageRuleType>,
#[serde(rename = "Surname")]
pub surname: String,
#[serde(rename = "TimeZoneId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_zone_id: Option<String>,
#[serde(rename = "Username")]
pub username: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateUserResponse {
#[serde(rename = "User")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<User>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeactivateUserRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteCommentRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "CommentId")]
pub comment_id: String,
#[serde(rename = "DocumentId")]
pub document_id: String,
#[serde(rename = "VersionId")]
pub version_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteCustomMetadataRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DeleteAll")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delete_all: Option<bool>,
#[serde(rename = "Keys")]
#[serde(skip_serializing_if = "Option::is_none")]
pub keys: Option<Vec<String>>,
#[serde(rename = "ResourceId")]
pub resource_id: String,
#[serde(rename = "VersionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteCustomMetadataResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDocumentRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DocumentId")]
pub document_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteFolderContentsRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "FolderId")]
pub folder_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteFolderRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "FolderId")]
pub folder_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteLabelsRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DeleteAll")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delete_all: Option<bool>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteLabelsResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteNotificationSubscriptionRequest {
#[serde(rename = "OrganizationId")]
pub organization_id: String,
#[serde(rename = "SubscriptionId")]
pub subscription_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteUserRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeActivitiesRequest {
#[serde(rename = "ActivityTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_types: Option<String>,
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "IncludeIndirectActivities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_indirect_activities: Option<bool>,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "OrganizationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_id: Option<String>,
#[serde(rename = "ResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "StartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<f64>,
#[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 DescribeActivitiesResponse {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "UserActivities")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_activities: Option<Vec<Activity>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeCommentsRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DocumentId")]
pub document_id: String,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "VersionId")]
pub version_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeCommentsResponse {
#[serde(rename = "Comments")]
#[serde(skip_serializing_if = "Option::is_none")]
pub comments: Option<Vec<Comment>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeDocumentVersionsRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DocumentId")]
pub document_id: String,
#[serde(rename = "Fields")]
#[serde(skip_serializing_if = "Option::is_none")]
pub fields: Option<String>,
#[serde(rename = "Include")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include: Option<String>,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeDocumentVersionsResponse {
#[serde(rename = "DocumentVersions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_versions: Option<Vec<DocumentVersionMetadata>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeFolderContentsRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "FolderId")]
pub folder_id: String,
#[serde(rename = "Include")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include: Option<String>,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "Order")]
#[serde(skip_serializing_if = "Option::is_none")]
pub order: Option<String>,
#[serde(rename = "Sort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort: 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 DescribeFolderContentsResponse {
#[serde(rename = "Documents")]
#[serde(skip_serializing_if = "Option::is_none")]
pub documents: Option<Vec<DocumentMetadata>>,
#[serde(rename = "Folders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub folders: Option<Vec<FolderMetadata>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeGroupsRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "OrganizationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_id: Option<String>,
#[serde(rename = "SearchQuery")]
pub search_query: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeGroupsResponse {
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<GroupMetadata>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeNotificationSubscriptionsRequest {
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "OrganizationId")]
pub organization_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeNotificationSubscriptionsResponse {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "Subscriptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subscriptions: Option<Vec<Subscription>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeResourcePermissionsRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "PrincipalId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub principal_id: Option<String>,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeResourcePermissionsResponse {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "Principals")]
#[serde(skip_serializing_if = "Option::is_none")]
pub principals: Option<Vec<Principal>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeRootFoldersRequest {
#[serde(rename = "AuthenticationToken")]
pub authentication_token: String,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeRootFoldersResponse {
#[serde(rename = "Folders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub folders: Option<Vec<FolderMetadata>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeUsersRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "Fields")]
#[serde(skip_serializing_if = "Option::is_none")]
pub fields: Option<String>,
#[serde(rename = "Include")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include: Option<String>,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "Order")]
#[serde(skip_serializing_if = "Option::is_none")]
pub order: Option<String>,
#[serde(rename = "OrganizationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_id: Option<String>,
#[serde(rename = "Query")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query: Option<String>,
#[serde(rename = "Sort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sort: Option<String>,
#[serde(rename = "UserIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_ids: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeUsersResponse {
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: 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 DocumentMetadata {
#[serde(rename = "CreatedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_timestamp: Option<f64>,
#[serde(rename = "CreatorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creator_id: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "LatestVersionMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub latest_version_metadata: Option<DocumentVersionMetadata>,
#[serde(rename = "ModifiedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub modified_timestamp: Option<f64>,
#[serde(rename = "ParentFolderId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parent_folder_id: Option<String>,
#[serde(rename = "ResourceState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DocumentVersionMetadata {
#[serde(rename = "ContentCreatedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_created_timestamp: Option<f64>,
#[serde(rename = "ContentModifiedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_modified_timestamp: Option<f64>,
#[serde(rename = "ContentType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "CreatedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_timestamp: Option<f64>,
#[serde(rename = "CreatorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creator_id: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "ModifiedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub modified_timestamp: Option<f64>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Signature")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(rename = "Size")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<i64>,
#[serde(rename = "Source")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "Thumbnail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub thumbnail: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FolderMetadata {
#[serde(rename = "CreatedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_timestamp: Option<f64>,
#[serde(rename = "CreatorId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creator_id: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Labels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<String>>,
#[serde(rename = "LatestVersionSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub latest_version_size: Option<i64>,
#[serde(rename = "ModifiedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub modified_timestamp: Option<f64>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ParentFolderId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parent_folder_id: Option<String>,
#[serde(rename = "ResourceState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_state: Option<String>,
#[serde(rename = "Signature")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signature: Option<String>,
#[serde(rename = "Size")]
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetCurrentUserRequest {
#[serde(rename = "AuthenticationToken")]
pub authentication_token: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetCurrentUserResponse {
#[serde(rename = "User")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<User>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDocumentPathRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DocumentId")]
pub document_id: String,
#[serde(rename = "Fields")]
#[serde(skip_serializing_if = "Option::is_none")]
pub fields: Option<String>,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDocumentPathResponse {
#[serde(rename = "Path")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<ResourcePath>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDocumentRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DocumentId")]
pub document_id: String,
#[serde(rename = "IncludeCustomMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_custom_metadata: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDocumentResponse {
#[serde(rename = "CustomMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_metadata: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<DocumentMetadata>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDocumentVersionRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DocumentId")]
pub document_id: String,
#[serde(rename = "Fields")]
#[serde(skip_serializing_if = "Option::is_none")]
pub fields: Option<String>,
#[serde(rename = "IncludeCustomMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_custom_metadata: Option<bool>,
#[serde(rename = "VersionId")]
pub version_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDocumentVersionResponse {
#[serde(rename = "CustomMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_metadata: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<DocumentVersionMetadata>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetFolderPathRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "Fields")]
#[serde(skip_serializing_if = "Option::is_none")]
pub fields: Option<String>,
#[serde(rename = "FolderId")]
pub folder_id: String,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetFolderPathResponse {
#[serde(rename = "Path")]
#[serde(skip_serializing_if = "Option::is_none")]
pub path: Option<ResourcePath>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetFolderRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "FolderId")]
pub folder_id: String,
#[serde(rename = "IncludeCustomMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_custom_metadata: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetFolderResponse {
#[serde(rename = "CustomMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub custom_metadata: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<FolderMetadata>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetResourcesRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "CollectionType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub collection_type: Option<String>,
#[serde(rename = "Limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
#[serde(rename = "UserId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetResourcesResponse {
#[serde(rename = "Documents")]
#[serde(skip_serializing_if = "Option::is_none")]
pub documents: Option<Vec<DocumentMetadata>>,
#[serde(rename = "Folders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub folders: Option<Vec<FolderMetadata>>,
#[serde(rename = "Marker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub marker: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GroupMetadata {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InitiateDocumentVersionUploadRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "ContentCreatedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_created_timestamp: Option<f64>,
#[serde(rename = "ContentModifiedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_modified_timestamp: Option<f64>,
#[serde(rename = "ContentType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub content_type: Option<String>,
#[serde(rename = "DocumentSizeInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub document_size_in_bytes: Option<i64>,
#[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 = "ParentFolderId")]
pub parent_folder_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct InitiateDocumentVersionUploadResponse {
#[serde(rename = "Metadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<DocumentMetadata>,
#[serde(rename = "UploadMetadata")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upload_metadata: Option<UploadMetadata>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct NotificationOptions {
#[serde(rename = "EmailMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email_message: Option<String>,
#[serde(rename = "SendEmail")]
#[serde(skip_serializing_if = "Option::is_none")]
pub send_email: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Participants {
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<GroupMetadata>>,
#[serde(rename = "Users")]
#[serde(skip_serializing_if = "Option::is_none")]
pub users: Option<Vec<UserMetadata>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PermissionInfo {
#[serde(rename = "Role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: 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 Principal {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Roles")]
#[serde(skip_serializing_if = "Option::is_none")]
pub roles: Option<Vec<PermissionInfo>>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RemoveAllResourcePermissionsRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RemoveResourcePermissionRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "PrincipalId")]
pub principal_id: String,
#[serde(rename = "PrincipalType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub principal_type: Option<String>,
#[serde(rename = "ResourceId")]
pub resource_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourceMetadata {
#[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 = "OriginalName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub original_name: Option<String>,
#[serde(rename = "Owner")]
#[serde(skip_serializing_if = "Option::is_none")]
pub owner: Option<UserMetadata>,
#[serde(rename = "ParentId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parent_id: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "VersionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourcePath {
#[serde(rename = "Components")]
#[serde(skip_serializing_if = "Option::is_none")]
pub components: Option<Vec<ResourcePathComponent>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourcePathComponent {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SharePrincipal {
#[serde(rename = "Id")]
pub id: String,
#[serde(rename = "Role")]
pub role: String,
#[serde(rename = "Type")]
pub type_: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ShareResult {
#[serde(rename = "InviteePrincipalId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub invitee_principal_id: Option<String>,
#[serde(rename = "PrincipalId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub principal_id: Option<String>,
#[serde(rename = "Role")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<String>,
#[serde(rename = "ShareId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub share_id: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "StatusMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct StorageRuleType {
#[serde(rename = "StorageAllocatedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storage_allocated_in_bytes: Option<i64>,
#[serde(rename = "StorageType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storage_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Subscription {
#[serde(rename = "EndPoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_point: Option<String>,
#[serde(rename = "Protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
#[serde(rename = "SubscriptionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subscription_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateDocumentRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DocumentId")]
pub document_id: String,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ParentFolderId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parent_folder_id: Option<String>,
#[serde(rename = "ResourceState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateDocumentVersionRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "DocumentId")]
pub document_id: String,
#[serde(rename = "VersionId")]
pub version_id: String,
#[serde(rename = "VersionStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateFolderRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "FolderId")]
pub folder_id: String,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ParentFolderId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parent_folder_id: Option<String>,
#[serde(rename = "ResourceState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateUserRequest {
#[serde(rename = "AuthenticationToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authentication_token: Option<String>,
#[serde(rename = "GivenName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub given_name: Option<String>,
#[serde(rename = "GrantPoweruserPrivileges")]
#[serde(skip_serializing_if = "Option::is_none")]
pub grant_poweruser_privileges: Option<String>,
#[serde(rename = "Locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "StorageRule")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storage_rule: Option<StorageRuleType>,
#[serde(rename = "Surname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub surname: Option<String>,
#[serde(rename = "TimeZoneId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_zone_id: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "UserId")]
pub user_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateUserResponse {
#[serde(rename = "User")]
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<User>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UploadMetadata {
#[serde(rename = "SignedHeaders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub signed_headers: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "UploadUrl")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upload_url: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct User {
#[serde(rename = "CreatedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_timestamp: Option<f64>,
#[serde(rename = "EmailAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email_address: Option<String>,
#[serde(rename = "GivenName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub given_name: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Locale")]
#[serde(skip_serializing_if = "Option::is_none")]
pub locale: Option<String>,
#[serde(rename = "ModifiedTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub modified_timestamp: Option<f64>,
#[serde(rename = "OrganizationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_id: Option<String>,
#[serde(rename = "RecycleBinFolderId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recycle_bin_folder_id: Option<String>,
#[serde(rename = "RootFolderId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub root_folder_id: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "Storage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storage: Option<UserStorageMetadata>,
#[serde(rename = "Surname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub surname: Option<String>,
#[serde(rename = "TimeZoneId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_zone_id: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
#[serde(rename = "Username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UserMetadata {
#[serde(rename = "EmailAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub email_address: Option<String>,
#[serde(rename = "GivenName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub given_name: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Surname")]
#[serde(skip_serializing_if = "Option::is_none")]
pub surname: Option<String>,
#[serde(rename = "Username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UserStorageMetadata {
#[serde(rename = "StorageRule")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storage_rule: Option<StorageRuleType>,
#[serde(rename = "StorageUtilizedInBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storage_utilized_in_bytes: Option<i64>,
}
#[derive(Debug, PartialEq)]
pub enum AbortDocumentVersionUploadError {
EntityNotExists(String),
FailedDependency(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl AbortDocumentVersionUploadError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<AbortDocumentVersionUploadError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(AbortDocumentVersionUploadError::EntityNotExists(
err.msg,
))
}
"FailedDependencyException" => {
return RusotoError::Service(AbortDocumentVersionUploadError::FailedDependency(
err.msg,
))
}
"ProhibitedStateException" => {
return RusotoError::Service(AbortDocumentVersionUploadError::ProhibitedState(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(
AbortDocumentVersionUploadError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedOperationException" => {
return RusotoError::Service(
AbortDocumentVersionUploadError::UnauthorizedOperation(err.msg),
)
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
AbortDocumentVersionUploadError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AbortDocumentVersionUploadError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AbortDocumentVersionUploadError {
fn description(&self) -> &str {
match *self {
AbortDocumentVersionUploadError::EntityNotExists(ref cause) => cause,
AbortDocumentVersionUploadError::FailedDependency(ref cause) => cause,
AbortDocumentVersionUploadError::ProhibitedState(ref cause) => cause,
AbortDocumentVersionUploadError::ServiceUnavailable(ref cause) => cause,
AbortDocumentVersionUploadError::UnauthorizedOperation(ref cause) => cause,
AbortDocumentVersionUploadError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ActivateUserError {
EntityNotExists(String),
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl ActivateUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ActivateUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(ActivateUserError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(ActivateUserError::FailedDependency(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(ActivateUserError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(ActivateUserError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(ActivateUserError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ActivateUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ActivateUserError {
fn description(&self) -> &str {
match *self {
ActivateUserError::EntityNotExists(ref cause) => cause,
ActivateUserError::FailedDependency(ref cause) => cause,
ActivateUserError::ServiceUnavailable(ref cause) => cause,
ActivateUserError::UnauthorizedOperation(ref cause) => cause,
ActivateUserError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum AddResourcePermissionsError {
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl AddResourcePermissionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AddResourcePermissionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"FailedDependencyException" => {
return RusotoError::Service(AddResourcePermissionsError::FailedDependency(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(AddResourcePermissionsError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(
AddResourcePermissionsError::UnauthorizedOperation(err.msg),
)
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
AddResourcePermissionsError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AddResourcePermissionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AddResourcePermissionsError {
fn description(&self) -> &str {
match *self {
AddResourcePermissionsError::FailedDependency(ref cause) => cause,
AddResourcePermissionsError::ServiceUnavailable(ref cause) => cause,
AddResourcePermissionsError::UnauthorizedOperation(ref cause) => cause,
AddResourcePermissionsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCommentError {
DocumentLockedForComments(String),
EntityNotExists(String),
FailedDependency(String),
InvalidCommentOperation(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl CreateCommentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateCommentError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"DocumentLockedForCommentsException" => {
return RusotoError::Service(CreateCommentError::DocumentLockedForComments(
err.msg,
))
}
"EntityNotExistsException" => {
return RusotoError::Service(CreateCommentError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(CreateCommentError::FailedDependency(err.msg))
}
"InvalidCommentOperationException" => {
return RusotoError::Service(CreateCommentError::InvalidCommentOperation(
err.msg,
))
}
"ProhibitedStateException" => {
return RusotoError::Service(CreateCommentError::ProhibitedState(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateCommentError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(CreateCommentError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(CreateCommentError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateCommentError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCommentError {
fn description(&self) -> &str {
match *self {
CreateCommentError::DocumentLockedForComments(ref cause) => cause,
CreateCommentError::EntityNotExists(ref cause) => cause,
CreateCommentError::FailedDependency(ref cause) => cause,
CreateCommentError::InvalidCommentOperation(ref cause) => cause,
CreateCommentError::ProhibitedState(ref cause) => cause,
CreateCommentError::ServiceUnavailable(ref cause) => cause,
CreateCommentError::UnauthorizedOperation(ref cause) => cause,
CreateCommentError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateCustomMetadataError {
CustomMetadataLimitExceeded(String),
EntityNotExists(String),
FailedDependency(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl CreateCustomMetadataError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateCustomMetadataError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"CustomMetadataLimitExceededException" => {
return RusotoError::Service(
CreateCustomMetadataError::CustomMetadataLimitExceeded(err.msg),
)
}
"EntityNotExistsException" => {
return RusotoError::Service(CreateCustomMetadataError::EntityNotExists(
err.msg,
))
}
"FailedDependencyException" => {
return RusotoError::Service(CreateCustomMetadataError::FailedDependency(
err.msg,
))
}
"ProhibitedStateException" => {
return RusotoError::Service(CreateCustomMetadataError::ProhibitedState(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateCustomMetadataError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(CreateCustomMetadataError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
CreateCustomMetadataError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateCustomMetadataError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateCustomMetadataError {
fn description(&self) -> &str {
match *self {
CreateCustomMetadataError::CustomMetadataLimitExceeded(ref cause) => cause,
CreateCustomMetadataError::EntityNotExists(ref cause) => cause,
CreateCustomMetadataError::FailedDependency(ref cause) => cause,
CreateCustomMetadataError::ProhibitedState(ref cause) => cause,
CreateCustomMetadataError::ServiceUnavailable(ref cause) => cause,
CreateCustomMetadataError::UnauthorizedOperation(ref cause) => cause,
CreateCustomMetadataError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateFolderError {
ConflictingOperation(String),
EntityAlreadyExists(String),
EntityNotExists(String),
FailedDependency(String),
LimitExceeded(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl CreateFolderError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateFolderError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConflictingOperationException" => {
return RusotoError::Service(CreateFolderError::ConflictingOperation(err.msg))
}
"EntityAlreadyExistsException" => {
return RusotoError::Service(CreateFolderError::EntityAlreadyExists(err.msg))
}
"EntityNotExistsException" => {
return RusotoError::Service(CreateFolderError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(CreateFolderError::FailedDependency(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateFolderError::LimitExceeded(err.msg))
}
"ProhibitedStateException" => {
return RusotoError::Service(CreateFolderError::ProhibitedState(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateFolderError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(CreateFolderError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(CreateFolderError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateFolderError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateFolderError {
fn description(&self) -> &str {
match *self {
CreateFolderError::ConflictingOperation(ref cause) => cause,
CreateFolderError::EntityAlreadyExists(ref cause) => cause,
CreateFolderError::EntityNotExists(ref cause) => cause,
CreateFolderError::FailedDependency(ref cause) => cause,
CreateFolderError::LimitExceeded(ref cause) => cause,
CreateFolderError::ProhibitedState(ref cause) => cause,
CreateFolderError::ServiceUnavailable(ref cause) => cause,
CreateFolderError::UnauthorizedOperation(ref cause) => cause,
CreateFolderError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateLabelsError {
EntityNotExists(String),
FailedDependency(String),
ServiceUnavailable(String),
TooManyLabels(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl CreateLabelsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateLabelsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(CreateLabelsError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(CreateLabelsError::FailedDependency(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateLabelsError::ServiceUnavailable(err.msg))
}
"TooManyLabelsException" => {
return RusotoError::Service(CreateLabelsError::TooManyLabels(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(CreateLabelsError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(CreateLabelsError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateLabelsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateLabelsError {
fn description(&self) -> &str {
match *self {
CreateLabelsError::EntityNotExists(ref cause) => cause,
CreateLabelsError::FailedDependency(ref cause) => cause,
CreateLabelsError::ServiceUnavailable(ref cause) => cause,
CreateLabelsError::TooManyLabels(ref cause) => cause,
CreateLabelsError::UnauthorizedOperation(ref cause) => cause,
CreateLabelsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateNotificationSubscriptionError {
ServiceUnavailable(String),
TooManySubscriptions(String),
UnauthorizedResourceAccess(String),
}
impl CreateNotificationSubscriptionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<CreateNotificationSubscriptionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ServiceUnavailableException" => {
return RusotoError::Service(
CreateNotificationSubscriptionError::ServiceUnavailable(err.msg),
)
}
"TooManySubscriptionsException" => {
return RusotoError::Service(
CreateNotificationSubscriptionError::TooManySubscriptions(err.msg),
)
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
CreateNotificationSubscriptionError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateNotificationSubscriptionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateNotificationSubscriptionError {
fn description(&self) -> &str {
match *self {
CreateNotificationSubscriptionError::ServiceUnavailable(ref cause) => cause,
CreateNotificationSubscriptionError::TooManySubscriptions(ref cause) => cause,
CreateNotificationSubscriptionError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateUserError {
EntityAlreadyExists(String),
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl CreateUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityAlreadyExistsException" => {
return RusotoError::Service(CreateUserError::EntityAlreadyExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(CreateUserError::FailedDependency(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateUserError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(CreateUserError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(CreateUserError::UnauthorizedResourceAccess(
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::EntityAlreadyExists(ref cause) => cause,
CreateUserError::FailedDependency(ref cause) => cause,
CreateUserError::ServiceUnavailable(ref cause) => cause,
CreateUserError::UnauthorizedOperation(ref cause) => cause,
CreateUserError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeactivateUserError {
EntityNotExists(String),
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DeactivateUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeactivateUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(DeactivateUserError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(DeactivateUserError::FailedDependency(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeactivateUserError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DeactivateUserError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(DeactivateUserError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeactivateUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeactivateUserError {
fn description(&self) -> &str {
match *self {
DeactivateUserError::EntityNotExists(ref cause) => cause,
DeactivateUserError::FailedDependency(ref cause) => cause,
DeactivateUserError::ServiceUnavailable(ref cause) => cause,
DeactivateUserError::UnauthorizedOperation(ref cause) => cause,
DeactivateUserError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteCommentError {
DocumentLockedForComments(String),
EntityNotExists(String),
FailedDependency(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DeleteCommentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteCommentError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"DocumentLockedForCommentsException" => {
return RusotoError::Service(DeleteCommentError::DocumentLockedForComments(
err.msg,
))
}
"EntityNotExistsException" => {
return RusotoError::Service(DeleteCommentError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(DeleteCommentError::FailedDependency(err.msg))
}
"ProhibitedStateException" => {
return RusotoError::Service(DeleteCommentError::ProhibitedState(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteCommentError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DeleteCommentError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(DeleteCommentError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteCommentError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteCommentError {
fn description(&self) -> &str {
match *self {
DeleteCommentError::DocumentLockedForComments(ref cause) => cause,
DeleteCommentError::EntityNotExists(ref cause) => cause,
DeleteCommentError::FailedDependency(ref cause) => cause,
DeleteCommentError::ProhibitedState(ref cause) => cause,
DeleteCommentError::ServiceUnavailable(ref cause) => cause,
DeleteCommentError::UnauthorizedOperation(ref cause) => cause,
DeleteCommentError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteCustomMetadataError {
EntityNotExists(String),
FailedDependency(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DeleteCustomMetadataError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteCustomMetadataError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(DeleteCustomMetadataError::EntityNotExists(
err.msg,
))
}
"FailedDependencyException" => {
return RusotoError::Service(DeleteCustomMetadataError::FailedDependency(
err.msg,
))
}
"ProhibitedStateException" => {
return RusotoError::Service(DeleteCustomMetadataError::ProhibitedState(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteCustomMetadataError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DeleteCustomMetadataError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
DeleteCustomMetadataError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteCustomMetadataError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteCustomMetadataError {
fn description(&self) -> &str {
match *self {
DeleteCustomMetadataError::EntityNotExists(ref cause) => cause,
DeleteCustomMetadataError::FailedDependency(ref cause) => cause,
DeleteCustomMetadataError::ProhibitedState(ref cause) => cause,
DeleteCustomMetadataError::ServiceUnavailable(ref cause) => cause,
DeleteCustomMetadataError::UnauthorizedOperation(ref cause) => cause,
DeleteCustomMetadataError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDocumentError {
ConcurrentModification(String),
ConflictingOperation(String),
EntityNotExists(String),
FailedDependency(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DeleteDocumentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDocumentError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(DeleteDocumentError::ConcurrentModification(
err.msg,
))
}
"ConflictingOperationException" => {
return RusotoError::Service(DeleteDocumentError::ConflictingOperation(err.msg))
}
"EntityNotExistsException" => {
return RusotoError::Service(DeleteDocumentError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(DeleteDocumentError::FailedDependency(err.msg))
}
"ProhibitedStateException" => {
return RusotoError::Service(DeleteDocumentError::ProhibitedState(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteDocumentError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DeleteDocumentError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(DeleteDocumentError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteDocumentError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDocumentError {
fn description(&self) -> &str {
match *self {
DeleteDocumentError::ConcurrentModification(ref cause) => cause,
DeleteDocumentError::ConflictingOperation(ref cause) => cause,
DeleteDocumentError::EntityNotExists(ref cause) => cause,
DeleteDocumentError::FailedDependency(ref cause) => cause,
DeleteDocumentError::ProhibitedState(ref cause) => cause,
DeleteDocumentError::ServiceUnavailable(ref cause) => cause,
DeleteDocumentError::UnauthorizedOperation(ref cause) => cause,
DeleteDocumentError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteFolderError {
ConcurrentModification(String),
ConflictingOperation(String),
EntityNotExists(String),
FailedDependency(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DeleteFolderError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteFolderError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(DeleteFolderError::ConcurrentModification(err.msg))
}
"ConflictingOperationException" => {
return RusotoError::Service(DeleteFolderError::ConflictingOperation(err.msg))
}
"EntityNotExistsException" => {
return RusotoError::Service(DeleteFolderError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(DeleteFolderError::FailedDependency(err.msg))
}
"ProhibitedStateException" => {
return RusotoError::Service(DeleteFolderError::ProhibitedState(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteFolderError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DeleteFolderError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(DeleteFolderError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteFolderError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteFolderError {
fn description(&self) -> &str {
match *self {
DeleteFolderError::ConcurrentModification(ref cause) => cause,
DeleteFolderError::ConflictingOperation(ref cause) => cause,
DeleteFolderError::EntityNotExists(ref cause) => cause,
DeleteFolderError::FailedDependency(ref cause) => cause,
DeleteFolderError::ProhibitedState(ref cause) => cause,
DeleteFolderError::ServiceUnavailable(ref cause) => cause,
DeleteFolderError::UnauthorizedOperation(ref cause) => cause,
DeleteFolderError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteFolderContentsError {
ConflictingOperation(String),
EntityNotExists(String),
FailedDependency(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DeleteFolderContentsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteFolderContentsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConflictingOperationException" => {
return RusotoError::Service(DeleteFolderContentsError::ConflictingOperation(
err.msg,
))
}
"EntityNotExistsException" => {
return RusotoError::Service(DeleteFolderContentsError::EntityNotExists(
err.msg,
))
}
"FailedDependencyException" => {
return RusotoError::Service(DeleteFolderContentsError::FailedDependency(
err.msg,
))
}
"ProhibitedStateException" => {
return RusotoError::Service(DeleteFolderContentsError::ProhibitedState(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteFolderContentsError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DeleteFolderContentsError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
DeleteFolderContentsError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteFolderContentsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteFolderContentsError {
fn description(&self) -> &str {
match *self {
DeleteFolderContentsError::ConflictingOperation(ref cause) => cause,
DeleteFolderContentsError::EntityNotExists(ref cause) => cause,
DeleteFolderContentsError::FailedDependency(ref cause) => cause,
DeleteFolderContentsError::ProhibitedState(ref cause) => cause,
DeleteFolderContentsError::ServiceUnavailable(ref cause) => cause,
DeleteFolderContentsError::UnauthorizedOperation(ref cause) => cause,
DeleteFolderContentsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteLabelsError {
EntityNotExists(String),
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DeleteLabelsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLabelsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(DeleteLabelsError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(DeleteLabelsError::FailedDependency(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteLabelsError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DeleteLabelsError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(DeleteLabelsError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteLabelsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteLabelsError {
fn description(&self) -> &str {
match *self {
DeleteLabelsError::EntityNotExists(ref cause) => cause,
DeleteLabelsError::FailedDependency(ref cause) => cause,
DeleteLabelsError::ServiceUnavailable(ref cause) => cause,
DeleteLabelsError::UnauthorizedOperation(ref cause) => cause,
DeleteLabelsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteNotificationSubscriptionError {
EntityNotExists(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedResourceAccess(String),
}
impl DeleteNotificationSubscriptionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DeleteNotificationSubscriptionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(
DeleteNotificationSubscriptionError::EntityNotExists(err.msg),
)
}
"ProhibitedStateException" => {
return RusotoError::Service(
DeleteNotificationSubscriptionError::ProhibitedState(err.msg),
)
}
"ServiceUnavailableException" => {
return RusotoError::Service(
DeleteNotificationSubscriptionError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
DeleteNotificationSubscriptionError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteNotificationSubscriptionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteNotificationSubscriptionError {
fn description(&self) -> &str {
match *self {
DeleteNotificationSubscriptionError::EntityNotExists(ref cause) => cause,
DeleteNotificationSubscriptionError::ProhibitedState(ref cause) => cause,
DeleteNotificationSubscriptionError::ServiceUnavailable(ref cause) => cause,
DeleteNotificationSubscriptionError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteUserError {
EntityNotExists(String),
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DeleteUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(DeleteUserError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(DeleteUserError::FailedDependency(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteUserError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DeleteUserError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(DeleteUserError::UnauthorizedResourceAccess(
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::EntityNotExists(ref cause) => cause,
DeleteUserError::FailedDependency(ref cause) => cause,
DeleteUserError::ServiceUnavailable(ref cause) => cause,
DeleteUserError::UnauthorizedOperation(ref cause) => cause,
DeleteUserError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeActivitiesError {
FailedDependency(String),
InvalidArgument(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DescribeActivitiesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeActivitiesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"FailedDependencyException" => {
return RusotoError::Service(DescribeActivitiesError::FailedDependency(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(DescribeActivitiesError::InvalidArgument(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeActivitiesError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DescribeActivitiesError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
DescribeActivitiesError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeActivitiesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeActivitiesError {
fn description(&self) -> &str {
match *self {
DescribeActivitiesError::FailedDependency(ref cause) => cause,
DescribeActivitiesError::InvalidArgument(ref cause) => cause,
DescribeActivitiesError::ServiceUnavailable(ref cause) => cause,
DescribeActivitiesError::UnauthorizedOperation(ref cause) => cause,
DescribeActivitiesError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeCommentsError {
EntityNotExists(String),
FailedDependency(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DescribeCommentsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeCommentsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(DescribeCommentsError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(DescribeCommentsError::FailedDependency(err.msg))
}
"ProhibitedStateException" => {
return RusotoError::Service(DescribeCommentsError::ProhibitedState(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeCommentsError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DescribeCommentsError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(DescribeCommentsError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeCommentsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeCommentsError {
fn description(&self) -> &str {
match *self {
DescribeCommentsError::EntityNotExists(ref cause) => cause,
DescribeCommentsError::FailedDependency(ref cause) => cause,
DescribeCommentsError::ProhibitedState(ref cause) => cause,
DescribeCommentsError::ServiceUnavailable(ref cause) => cause,
DescribeCommentsError::UnauthorizedOperation(ref cause) => cause,
DescribeCommentsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeDocumentVersionsError {
EntityNotExists(String),
FailedDependency(String),
InvalidArgument(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DescribeDocumentVersionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeDocumentVersionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(DescribeDocumentVersionsError::EntityNotExists(
err.msg,
))
}
"FailedDependencyException" => {
return RusotoError::Service(DescribeDocumentVersionsError::FailedDependency(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(DescribeDocumentVersionsError::InvalidArgument(
err.msg,
))
}
"ProhibitedStateException" => {
return RusotoError::Service(DescribeDocumentVersionsError::ProhibitedState(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeDocumentVersionsError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(
DescribeDocumentVersionsError::UnauthorizedOperation(err.msg),
)
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
DescribeDocumentVersionsError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeDocumentVersionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeDocumentVersionsError {
fn description(&self) -> &str {
match *self {
DescribeDocumentVersionsError::EntityNotExists(ref cause) => cause,
DescribeDocumentVersionsError::FailedDependency(ref cause) => cause,
DescribeDocumentVersionsError::InvalidArgument(ref cause) => cause,
DescribeDocumentVersionsError::ProhibitedState(ref cause) => cause,
DescribeDocumentVersionsError::ServiceUnavailable(ref cause) => cause,
DescribeDocumentVersionsError::UnauthorizedOperation(ref cause) => cause,
DescribeDocumentVersionsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeFolderContentsError {
EntityNotExists(String),
FailedDependency(String),
InvalidArgument(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedResourceAccess(String),
}
impl DescribeFolderContentsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeFolderContentsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(DescribeFolderContentsError::EntityNotExists(
err.msg,
))
}
"FailedDependencyException" => {
return RusotoError::Service(DescribeFolderContentsError::FailedDependency(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(DescribeFolderContentsError::InvalidArgument(
err.msg,
))
}
"ProhibitedStateException" => {
return RusotoError::Service(DescribeFolderContentsError::ProhibitedState(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeFolderContentsError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
DescribeFolderContentsError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeFolderContentsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeFolderContentsError {
fn description(&self) -> &str {
match *self {
DescribeFolderContentsError::EntityNotExists(ref cause) => cause,
DescribeFolderContentsError::FailedDependency(ref cause) => cause,
DescribeFolderContentsError::InvalidArgument(ref cause) => cause,
DescribeFolderContentsError::ProhibitedState(ref cause) => cause,
DescribeFolderContentsError::ServiceUnavailable(ref cause) => cause,
DescribeFolderContentsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeGroupsError {
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DescribeGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeGroupsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"FailedDependencyException" => {
return RusotoError::Service(DescribeGroupsError::FailedDependency(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeGroupsError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DescribeGroupsError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(DescribeGroupsError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeGroupsError {
fn description(&self) -> &str {
match *self {
DescribeGroupsError::FailedDependency(ref cause) => cause,
DescribeGroupsError::ServiceUnavailable(ref cause) => cause,
DescribeGroupsError::UnauthorizedOperation(ref cause) => cause,
DescribeGroupsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeNotificationSubscriptionsError {
EntityNotExists(String),
ServiceUnavailable(String),
UnauthorizedResourceAccess(String),
}
impl DescribeNotificationSubscriptionsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeNotificationSubscriptionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(
DescribeNotificationSubscriptionsError::EntityNotExists(err.msg),
)
}
"ServiceUnavailableException" => {
return RusotoError::Service(
DescribeNotificationSubscriptionsError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
DescribeNotificationSubscriptionsError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeNotificationSubscriptionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeNotificationSubscriptionsError {
fn description(&self) -> &str {
match *self {
DescribeNotificationSubscriptionsError::EntityNotExists(ref cause) => cause,
DescribeNotificationSubscriptionsError::ServiceUnavailable(ref cause) => cause,
DescribeNotificationSubscriptionsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeResourcePermissionsError {
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DescribeResourcePermissionsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeResourcePermissionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"FailedDependencyException" => {
return RusotoError::Service(
DescribeResourcePermissionsError::FailedDependency(err.msg),
)
}
"ServiceUnavailableException" => {
return RusotoError::Service(
DescribeResourcePermissionsError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedOperationException" => {
return RusotoError::Service(
DescribeResourcePermissionsError::UnauthorizedOperation(err.msg),
)
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
DescribeResourcePermissionsError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeResourcePermissionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeResourcePermissionsError {
fn description(&self) -> &str {
match *self {
DescribeResourcePermissionsError::FailedDependency(ref cause) => cause,
DescribeResourcePermissionsError::ServiceUnavailable(ref cause) => cause,
DescribeResourcePermissionsError::UnauthorizedOperation(ref cause) => cause,
DescribeResourcePermissionsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeRootFoldersError {
FailedDependency(String),
InvalidArgument(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DescribeRootFoldersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeRootFoldersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"FailedDependencyException" => {
return RusotoError::Service(DescribeRootFoldersError::FailedDependency(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(DescribeRootFoldersError::InvalidArgument(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeRootFoldersError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DescribeRootFoldersError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
DescribeRootFoldersError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeRootFoldersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeRootFoldersError {
fn description(&self) -> &str {
match *self {
DescribeRootFoldersError::FailedDependency(ref cause) => cause,
DescribeRootFoldersError::InvalidArgument(ref cause) => cause,
DescribeRootFoldersError::ServiceUnavailable(ref cause) => cause,
DescribeRootFoldersError::UnauthorizedOperation(ref cause) => cause,
DescribeRootFoldersError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeUsersError {
EntityNotExists(String),
FailedDependency(String),
InvalidArgument(String),
RequestedEntityTooLarge(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl DescribeUsersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeUsersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(DescribeUsersError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(DescribeUsersError::FailedDependency(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(DescribeUsersError::InvalidArgument(err.msg))
}
"RequestedEntityTooLargeException" => {
return RusotoError::Service(DescribeUsersError::RequestedEntityTooLarge(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeUsersError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(DescribeUsersError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(DescribeUsersError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeUsersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeUsersError {
fn description(&self) -> &str {
match *self {
DescribeUsersError::EntityNotExists(ref cause) => cause,
DescribeUsersError::FailedDependency(ref cause) => cause,
DescribeUsersError::InvalidArgument(ref cause) => cause,
DescribeUsersError::RequestedEntityTooLarge(ref cause) => cause,
DescribeUsersError::ServiceUnavailable(ref cause) => cause,
DescribeUsersError::UnauthorizedOperation(ref cause) => cause,
DescribeUsersError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetCurrentUserError {
EntityNotExists(String),
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl GetCurrentUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetCurrentUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(GetCurrentUserError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(GetCurrentUserError::FailedDependency(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetCurrentUserError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(GetCurrentUserError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(GetCurrentUserError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetCurrentUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetCurrentUserError {
fn description(&self) -> &str {
match *self {
GetCurrentUserError::EntityNotExists(ref cause) => cause,
GetCurrentUserError::FailedDependency(ref cause) => cause,
GetCurrentUserError::ServiceUnavailable(ref cause) => cause,
GetCurrentUserError::UnauthorizedOperation(ref cause) => cause,
GetCurrentUserError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDocumentError {
EntityNotExists(String),
FailedDependency(String),
InvalidArgument(String),
InvalidPassword(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl GetDocumentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDocumentError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(GetDocumentError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(GetDocumentError::FailedDependency(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(GetDocumentError::InvalidArgument(err.msg))
}
"InvalidPasswordException" => {
return RusotoError::Service(GetDocumentError::InvalidPassword(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetDocumentError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(GetDocumentError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(GetDocumentError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetDocumentError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDocumentError {
fn description(&self) -> &str {
match *self {
GetDocumentError::EntityNotExists(ref cause) => cause,
GetDocumentError::FailedDependency(ref cause) => cause,
GetDocumentError::InvalidArgument(ref cause) => cause,
GetDocumentError::InvalidPassword(ref cause) => cause,
GetDocumentError::ServiceUnavailable(ref cause) => cause,
GetDocumentError::UnauthorizedOperation(ref cause) => cause,
GetDocumentError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDocumentPathError {
EntityNotExists(String),
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl GetDocumentPathError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDocumentPathError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(GetDocumentPathError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(GetDocumentPathError::FailedDependency(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetDocumentPathError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(GetDocumentPathError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(GetDocumentPathError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetDocumentPathError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDocumentPathError {
fn description(&self) -> &str {
match *self {
GetDocumentPathError::EntityNotExists(ref cause) => cause,
GetDocumentPathError::FailedDependency(ref cause) => cause,
GetDocumentPathError::ServiceUnavailable(ref cause) => cause,
GetDocumentPathError::UnauthorizedOperation(ref cause) => cause,
GetDocumentPathError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDocumentVersionError {
EntityNotExists(String),
FailedDependency(String),
InvalidPassword(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl GetDocumentVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetDocumentVersionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(GetDocumentVersionError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(GetDocumentVersionError::FailedDependency(err.msg))
}
"InvalidPasswordException" => {
return RusotoError::Service(GetDocumentVersionError::InvalidPassword(err.msg))
}
"ProhibitedStateException" => {
return RusotoError::Service(GetDocumentVersionError::ProhibitedState(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetDocumentVersionError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(GetDocumentVersionError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
GetDocumentVersionError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetDocumentVersionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDocumentVersionError {
fn description(&self) -> &str {
match *self {
GetDocumentVersionError::EntityNotExists(ref cause) => cause,
GetDocumentVersionError::FailedDependency(ref cause) => cause,
GetDocumentVersionError::InvalidPassword(ref cause) => cause,
GetDocumentVersionError::ProhibitedState(ref cause) => cause,
GetDocumentVersionError::ServiceUnavailable(ref cause) => cause,
GetDocumentVersionError::UnauthorizedOperation(ref cause) => cause,
GetDocumentVersionError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFolderError {
EntityNotExists(String),
FailedDependency(String),
InvalidArgument(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl GetFolderError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFolderError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(GetFolderError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(GetFolderError::FailedDependency(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(GetFolderError::InvalidArgument(err.msg))
}
"ProhibitedStateException" => {
return RusotoError::Service(GetFolderError::ProhibitedState(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetFolderError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(GetFolderError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(GetFolderError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetFolderError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFolderError {
fn description(&self) -> &str {
match *self {
GetFolderError::EntityNotExists(ref cause) => cause,
GetFolderError::FailedDependency(ref cause) => cause,
GetFolderError::InvalidArgument(ref cause) => cause,
GetFolderError::ProhibitedState(ref cause) => cause,
GetFolderError::ServiceUnavailable(ref cause) => cause,
GetFolderError::UnauthorizedOperation(ref cause) => cause,
GetFolderError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetFolderPathError {
EntityNotExists(String),
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl GetFolderPathError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetFolderPathError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"EntityNotExistsException" => {
return RusotoError::Service(GetFolderPathError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(GetFolderPathError::FailedDependency(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetFolderPathError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(GetFolderPathError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(GetFolderPathError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetFolderPathError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetFolderPathError {
fn description(&self) -> &str {
match *self {
GetFolderPathError::EntityNotExists(ref cause) => cause,
GetFolderPathError::FailedDependency(ref cause) => cause,
GetFolderPathError::ServiceUnavailable(ref cause) => cause,
GetFolderPathError::UnauthorizedOperation(ref cause) => cause,
GetFolderPathError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetResourcesError {
FailedDependency(String),
InvalidArgument(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl GetResourcesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetResourcesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"FailedDependencyException" => {
return RusotoError::Service(GetResourcesError::FailedDependency(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(GetResourcesError::InvalidArgument(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetResourcesError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(GetResourcesError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(GetResourcesError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetResourcesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetResourcesError {
fn description(&self) -> &str {
match *self {
GetResourcesError::FailedDependency(ref cause) => cause,
GetResourcesError::InvalidArgument(ref cause) => cause,
GetResourcesError::ServiceUnavailable(ref cause) => cause,
GetResourcesError::UnauthorizedOperation(ref cause) => cause,
GetResourcesError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum InitiateDocumentVersionUploadError {
DraftUploadOutOfSync(String),
EntityAlreadyExists(String),
EntityNotExists(String),
FailedDependency(String),
ProhibitedState(String),
ResourceAlreadyCheckedOut(String),
ServiceUnavailable(String),
StorageLimitExceeded(String),
StorageLimitWillExceed(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl InitiateDocumentVersionUploadError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<InitiateDocumentVersionUploadError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"DraftUploadOutOfSyncException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::DraftUploadOutOfSync(err.msg),
)
}
"EntityAlreadyExistsException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::EntityAlreadyExists(err.msg),
)
}
"EntityNotExistsException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::EntityNotExists(err.msg),
)
}
"FailedDependencyException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::FailedDependency(err.msg),
)
}
"ProhibitedStateException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::ProhibitedState(err.msg),
)
}
"ResourceAlreadyCheckedOutException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::ResourceAlreadyCheckedOut(err.msg),
)
}
"ServiceUnavailableException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::ServiceUnavailable(err.msg),
)
}
"StorageLimitExceededException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::StorageLimitExceeded(err.msg),
)
}
"StorageLimitWillExceedException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::StorageLimitWillExceed(err.msg),
)
}
"UnauthorizedOperationException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::UnauthorizedOperation(err.msg),
)
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
InitiateDocumentVersionUploadError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for InitiateDocumentVersionUploadError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for InitiateDocumentVersionUploadError {
fn description(&self) -> &str {
match *self {
InitiateDocumentVersionUploadError::DraftUploadOutOfSync(ref cause) => cause,
InitiateDocumentVersionUploadError::EntityAlreadyExists(ref cause) => cause,
InitiateDocumentVersionUploadError::EntityNotExists(ref cause) => cause,
InitiateDocumentVersionUploadError::FailedDependency(ref cause) => cause,
InitiateDocumentVersionUploadError::ProhibitedState(ref cause) => cause,
InitiateDocumentVersionUploadError::ResourceAlreadyCheckedOut(ref cause) => cause,
InitiateDocumentVersionUploadError::ServiceUnavailable(ref cause) => cause,
InitiateDocumentVersionUploadError::StorageLimitExceeded(ref cause) => cause,
InitiateDocumentVersionUploadError::StorageLimitWillExceed(ref cause) => cause,
InitiateDocumentVersionUploadError::UnauthorizedOperation(ref cause) => cause,
InitiateDocumentVersionUploadError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RemoveAllResourcePermissionsError {
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl RemoveAllResourcePermissionsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<RemoveAllResourcePermissionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"FailedDependencyException" => {
return RusotoError::Service(
RemoveAllResourcePermissionsError::FailedDependency(err.msg),
)
}
"ServiceUnavailableException" => {
return RusotoError::Service(
RemoveAllResourcePermissionsError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedOperationException" => {
return RusotoError::Service(
RemoveAllResourcePermissionsError::UnauthorizedOperation(err.msg),
)
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
RemoveAllResourcePermissionsError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RemoveAllResourcePermissionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RemoveAllResourcePermissionsError {
fn description(&self) -> &str {
match *self {
RemoveAllResourcePermissionsError::FailedDependency(ref cause) => cause,
RemoveAllResourcePermissionsError::ServiceUnavailable(ref cause) => cause,
RemoveAllResourcePermissionsError::UnauthorizedOperation(ref cause) => cause,
RemoveAllResourcePermissionsError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RemoveResourcePermissionError {
FailedDependency(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl RemoveResourcePermissionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RemoveResourcePermissionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"FailedDependencyException" => {
return RusotoError::Service(RemoveResourcePermissionError::FailedDependency(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(RemoveResourcePermissionError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(
RemoveResourcePermissionError::UnauthorizedOperation(err.msg),
)
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
RemoveResourcePermissionError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RemoveResourcePermissionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RemoveResourcePermissionError {
fn description(&self) -> &str {
match *self {
RemoveResourcePermissionError::FailedDependency(ref cause) => cause,
RemoveResourcePermissionError::ServiceUnavailable(ref cause) => cause,
RemoveResourcePermissionError::UnauthorizedOperation(ref cause) => cause,
RemoveResourcePermissionError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateDocumentError {
ConcurrentModification(String),
ConflictingOperation(String),
EntityAlreadyExists(String),
EntityNotExists(String),
FailedDependency(String),
LimitExceeded(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl UpdateDocumentError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDocumentError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(UpdateDocumentError::ConcurrentModification(
err.msg,
))
}
"ConflictingOperationException" => {
return RusotoError::Service(UpdateDocumentError::ConflictingOperation(err.msg))
}
"EntityAlreadyExistsException" => {
return RusotoError::Service(UpdateDocumentError::EntityAlreadyExists(err.msg))
}
"EntityNotExistsException" => {
return RusotoError::Service(UpdateDocumentError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(UpdateDocumentError::FailedDependency(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(UpdateDocumentError::LimitExceeded(err.msg))
}
"ProhibitedStateException" => {
return RusotoError::Service(UpdateDocumentError::ProhibitedState(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(UpdateDocumentError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(UpdateDocumentError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(UpdateDocumentError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateDocumentError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateDocumentError {
fn description(&self) -> &str {
match *self {
UpdateDocumentError::ConcurrentModification(ref cause) => cause,
UpdateDocumentError::ConflictingOperation(ref cause) => cause,
UpdateDocumentError::EntityAlreadyExists(ref cause) => cause,
UpdateDocumentError::EntityNotExists(ref cause) => cause,
UpdateDocumentError::FailedDependency(ref cause) => cause,
UpdateDocumentError::LimitExceeded(ref cause) => cause,
UpdateDocumentError::ProhibitedState(ref cause) => cause,
UpdateDocumentError::ServiceUnavailable(ref cause) => cause,
UpdateDocumentError::UnauthorizedOperation(ref cause) => cause,
UpdateDocumentError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateDocumentVersionError {
ConcurrentModification(String),
EntityNotExists(String),
FailedDependency(String),
InvalidOperation(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl UpdateDocumentVersionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateDocumentVersionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(
UpdateDocumentVersionError::ConcurrentModification(err.msg),
)
}
"EntityNotExistsException" => {
return RusotoError::Service(UpdateDocumentVersionError::EntityNotExists(
err.msg,
))
}
"FailedDependencyException" => {
return RusotoError::Service(UpdateDocumentVersionError::FailedDependency(
err.msg,
))
}
"InvalidOperationException" => {
return RusotoError::Service(UpdateDocumentVersionError::InvalidOperation(
err.msg,
))
}
"ProhibitedStateException" => {
return RusotoError::Service(UpdateDocumentVersionError::ProhibitedState(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(UpdateDocumentVersionError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(UpdateDocumentVersionError::UnauthorizedOperation(
err.msg,
))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(
UpdateDocumentVersionError::UnauthorizedResourceAccess(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateDocumentVersionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateDocumentVersionError {
fn description(&self) -> &str {
match *self {
UpdateDocumentVersionError::ConcurrentModification(ref cause) => cause,
UpdateDocumentVersionError::EntityNotExists(ref cause) => cause,
UpdateDocumentVersionError::FailedDependency(ref cause) => cause,
UpdateDocumentVersionError::InvalidOperation(ref cause) => cause,
UpdateDocumentVersionError::ProhibitedState(ref cause) => cause,
UpdateDocumentVersionError::ServiceUnavailable(ref cause) => cause,
UpdateDocumentVersionError::UnauthorizedOperation(ref cause) => cause,
UpdateDocumentVersionError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateFolderError {
ConcurrentModification(String),
ConflictingOperation(String),
EntityAlreadyExists(String),
EntityNotExists(String),
FailedDependency(String),
LimitExceeded(String),
ProhibitedState(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl UpdateFolderError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateFolderError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"ConcurrentModificationException" => {
return RusotoError::Service(UpdateFolderError::ConcurrentModification(err.msg))
}
"ConflictingOperationException" => {
return RusotoError::Service(UpdateFolderError::ConflictingOperation(err.msg))
}
"EntityAlreadyExistsException" => {
return RusotoError::Service(UpdateFolderError::EntityAlreadyExists(err.msg))
}
"EntityNotExistsException" => {
return RusotoError::Service(UpdateFolderError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(UpdateFolderError::FailedDependency(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(UpdateFolderError::LimitExceeded(err.msg))
}
"ProhibitedStateException" => {
return RusotoError::Service(UpdateFolderError::ProhibitedState(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(UpdateFolderError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(UpdateFolderError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(UpdateFolderError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateFolderError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateFolderError {
fn description(&self) -> &str {
match *self {
UpdateFolderError::ConcurrentModification(ref cause) => cause,
UpdateFolderError::ConflictingOperation(ref cause) => cause,
UpdateFolderError::EntityAlreadyExists(ref cause) => cause,
UpdateFolderError::EntityNotExists(ref cause) => cause,
UpdateFolderError::FailedDependency(ref cause) => cause,
UpdateFolderError::LimitExceeded(ref cause) => cause,
UpdateFolderError::ProhibitedState(ref cause) => cause,
UpdateFolderError::ServiceUnavailable(ref cause) => cause,
UpdateFolderError::UnauthorizedOperation(ref cause) => cause,
UpdateFolderError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateUserError {
DeactivatingLastSystemUser(String),
EntityNotExists(String),
FailedDependency(String),
IllegalUserState(String),
InvalidArgument(String),
ServiceUnavailable(String),
UnauthorizedOperation(String),
UnauthorizedResourceAccess(String),
}
impl UpdateUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"DeactivatingLastSystemUserException" => {
return RusotoError::Service(UpdateUserError::DeactivatingLastSystemUser(
err.msg,
))
}
"EntityNotExistsException" => {
return RusotoError::Service(UpdateUserError::EntityNotExists(err.msg))
}
"FailedDependencyException" => {
return RusotoError::Service(UpdateUserError::FailedDependency(err.msg))
}
"IllegalUserStateException" => {
return RusotoError::Service(UpdateUserError::IllegalUserState(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(UpdateUserError::InvalidArgument(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(UpdateUserError::ServiceUnavailable(err.msg))
}
"UnauthorizedOperationException" => {
return RusotoError::Service(UpdateUserError::UnauthorizedOperation(err.msg))
}
"UnauthorizedResourceAccessException" => {
return RusotoError::Service(UpdateUserError::UnauthorizedResourceAccess(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateUserError {
fn description(&self) -> &str {
match *self {
UpdateUserError::DeactivatingLastSystemUser(ref cause) => cause,
UpdateUserError::EntityNotExists(ref cause) => cause,
UpdateUserError::FailedDependency(ref cause) => cause,
UpdateUserError::IllegalUserState(ref cause) => cause,
UpdateUserError::InvalidArgument(ref cause) => cause,
UpdateUserError::ServiceUnavailable(ref cause) => cause,
UpdateUserError::UnauthorizedOperation(ref cause) => cause,
UpdateUserError::UnauthorizedResourceAccess(ref cause) => cause,
}
}
}
pub trait Workdocs {
fn abort_document_version_upload(
&self,
input: AbortDocumentVersionUploadRequest,
) -> RusotoFuture<(), AbortDocumentVersionUploadError>;
fn activate_user(
&self,
input: ActivateUserRequest,
) -> RusotoFuture<ActivateUserResponse, ActivateUserError>;
fn add_resource_permissions(
&self,
input: AddResourcePermissionsRequest,
) -> RusotoFuture<AddResourcePermissionsResponse, AddResourcePermissionsError>;
fn create_comment(
&self,
input: CreateCommentRequest,
) -> RusotoFuture<CreateCommentResponse, CreateCommentError>;
fn create_custom_metadata(
&self,
input: CreateCustomMetadataRequest,
) -> RusotoFuture<CreateCustomMetadataResponse, CreateCustomMetadataError>;
fn create_folder(
&self,
input: CreateFolderRequest,
) -> RusotoFuture<CreateFolderResponse, CreateFolderError>;
fn create_labels(
&self,
input: CreateLabelsRequest,
) -> RusotoFuture<CreateLabelsResponse, CreateLabelsError>;
fn create_notification_subscription(
&self,
input: CreateNotificationSubscriptionRequest,
) -> RusotoFuture<CreateNotificationSubscriptionResponse, CreateNotificationSubscriptionError>;
fn create_user(
&self,
input: CreateUserRequest,
) -> RusotoFuture<CreateUserResponse, CreateUserError>;
fn deactivate_user(
&self,
input: DeactivateUserRequest,
) -> RusotoFuture<(), DeactivateUserError>;
fn delete_comment(&self, input: DeleteCommentRequest) -> RusotoFuture<(), DeleteCommentError>;
fn delete_custom_metadata(
&self,
input: DeleteCustomMetadataRequest,
) -> RusotoFuture<DeleteCustomMetadataResponse, DeleteCustomMetadataError>;
fn delete_document(
&self,
input: DeleteDocumentRequest,
) -> RusotoFuture<(), DeleteDocumentError>;
fn delete_folder(&self, input: DeleteFolderRequest) -> RusotoFuture<(), DeleteFolderError>;
fn delete_folder_contents(
&self,
input: DeleteFolderContentsRequest,
) -> RusotoFuture<(), DeleteFolderContentsError>;
fn delete_labels(
&self,
input: DeleteLabelsRequest,
) -> RusotoFuture<DeleteLabelsResponse, DeleteLabelsError>;
fn delete_notification_subscription(
&self,
input: DeleteNotificationSubscriptionRequest,
) -> RusotoFuture<(), DeleteNotificationSubscriptionError>;
fn delete_user(&self, input: DeleteUserRequest) -> RusotoFuture<(), DeleteUserError>;
fn describe_activities(
&self,
input: DescribeActivitiesRequest,
) -> RusotoFuture<DescribeActivitiesResponse, DescribeActivitiesError>;
fn describe_comments(
&self,
input: DescribeCommentsRequest,
) -> RusotoFuture<DescribeCommentsResponse, DescribeCommentsError>;
fn describe_document_versions(
&self,
input: DescribeDocumentVersionsRequest,
) -> RusotoFuture<DescribeDocumentVersionsResponse, DescribeDocumentVersionsError>;
fn describe_folder_contents(
&self,
input: DescribeFolderContentsRequest,
) -> RusotoFuture<DescribeFolderContentsResponse, DescribeFolderContentsError>;
fn describe_groups(
&self,
input: DescribeGroupsRequest,
) -> RusotoFuture<DescribeGroupsResponse, DescribeGroupsError>;
fn describe_notification_subscriptions(
&self,
input: DescribeNotificationSubscriptionsRequest,
) -> RusotoFuture<
DescribeNotificationSubscriptionsResponse,
DescribeNotificationSubscriptionsError,
>;
fn describe_resource_permissions(
&self,
input: DescribeResourcePermissionsRequest,
) -> RusotoFuture<DescribeResourcePermissionsResponse, DescribeResourcePermissionsError>;
fn describe_root_folders(
&self,
input: DescribeRootFoldersRequest,
) -> RusotoFuture<DescribeRootFoldersResponse, DescribeRootFoldersError>;
fn describe_users(
&self,
input: DescribeUsersRequest,
) -> RusotoFuture<DescribeUsersResponse, DescribeUsersError>;
fn get_current_user(
&self,
input: GetCurrentUserRequest,
) -> RusotoFuture<GetCurrentUserResponse, GetCurrentUserError>;
fn get_document(
&self,
input: GetDocumentRequest,
) -> RusotoFuture<GetDocumentResponse, GetDocumentError>;
fn get_document_path(
&self,
input: GetDocumentPathRequest,
) -> RusotoFuture<GetDocumentPathResponse, GetDocumentPathError>;
fn get_document_version(
&self,
input: GetDocumentVersionRequest,
) -> RusotoFuture<GetDocumentVersionResponse, GetDocumentVersionError>;
fn get_folder(
&self,
input: GetFolderRequest,
) -> RusotoFuture<GetFolderResponse, GetFolderError>;
fn get_folder_path(
&self,
input: GetFolderPathRequest,
) -> RusotoFuture<GetFolderPathResponse, GetFolderPathError>;
fn get_resources(
&self,
input: GetResourcesRequest,
) -> RusotoFuture<GetResourcesResponse, GetResourcesError>;
fn initiate_document_version_upload(
&self,
input: InitiateDocumentVersionUploadRequest,
) -> RusotoFuture<InitiateDocumentVersionUploadResponse, InitiateDocumentVersionUploadError>;
fn remove_all_resource_permissions(
&self,
input: RemoveAllResourcePermissionsRequest,
) -> RusotoFuture<(), RemoveAllResourcePermissionsError>;
fn remove_resource_permission(
&self,
input: RemoveResourcePermissionRequest,
) -> RusotoFuture<(), RemoveResourcePermissionError>;
fn update_document(
&self,
input: UpdateDocumentRequest,
) -> RusotoFuture<(), UpdateDocumentError>;
fn update_document_version(
&self,
input: UpdateDocumentVersionRequest,
) -> RusotoFuture<(), UpdateDocumentVersionError>;
fn update_folder(&self, input: UpdateFolderRequest) -> RusotoFuture<(), UpdateFolderError>;
fn update_user(
&self,
input: UpdateUserRequest,
) -> RusotoFuture<UpdateUserResponse, UpdateUserError>;
}
#[derive(Clone)]
pub struct WorkdocsClient {
client: Client,
region: region::Region,
}
impl WorkdocsClient {
pub fn new(region: region::Region) -> WorkdocsClient {
WorkdocsClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> WorkdocsClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
WorkdocsClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Workdocs for WorkdocsClient {
fn abort_document_version_upload(
&self,
input: AbortDocumentVersionUploadRequest,
) -> RusotoFuture<(), AbortDocumentVersionUploadError> {
let request_uri = format!(
"/api/v1/documents/{document_id}/versions/{version_id}",
document_id = input.document_id,
version_id = input.version_id
);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(AbortDocumentVersionUploadError::from_response(response))
}))
}
})
}
fn activate_user(
&self,
input: ActivateUserRequest,
) -> RusotoFuture<ActivateUserResponse, ActivateUserError> {
let request_uri = format!(
"/api/v1/users/{user_id}/activation",
user_id = input.user_id
);
let mut request = SignedRequest::new("POST", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ActivateUserResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ActivateUserError::from_response(response))),
)
}
})
}
fn add_resource_permissions(
&self,
input: AddResourcePermissionsRequest,
) -> RusotoFuture<AddResourcePermissionsResponse, AddResourcePermissionsError> {
let request_uri = format!(
"/api/v1/resources/{resource_id}/permissions",
resource_id = input.resource_id
);
let mut request = SignedRequest::new("POST", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<AddResourcePermissionsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(AddResourcePermissionsError::from_response(response))
}),
)
}
})
}
fn create_comment(
&self,
input: CreateCommentRequest,
) -> RusotoFuture<CreateCommentResponse, CreateCommentError> {
let request_uri = format!(
"/api/v1/documents/{document_id}/versions/{version_id}/comment",
document_id = input.document_id,
version_id = input.version_id
);
let mut request = SignedRequest::new("POST", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateCommentResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateCommentError::from_response(response))),
)
}
})
}
fn create_custom_metadata(
&self,
input: CreateCustomMetadataRequest,
) -> RusotoFuture<CreateCustomMetadataResponse, CreateCustomMetadataError> {
let request_uri = format!(
"/api/v1/resources/{resource_id}/customMetadata",
resource_id = input.resource_id
);
let mut request = SignedRequest::new("PUT", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.version_id {
params.put("versionid", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateCustomMetadataResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateCustomMetadataError::from_response(response))
}),
)
}
})
}
fn create_folder(
&self,
input: CreateFolderRequest,
) -> RusotoFuture<CreateFolderResponse, CreateFolderError> {
let request_uri = "/api/v1/folders";
let mut request = SignedRequest::new("POST", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateFolderResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateFolderError::from_response(response))),
)
}
})
}
fn create_labels(
&self,
input: CreateLabelsRequest,
) -> RusotoFuture<CreateLabelsResponse, CreateLabelsError> {
let request_uri = format!(
"/api/v1/resources/{resource_id}/labels",
resource_id = input.resource_id
);
let mut request = SignedRequest::new("PUT", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateLabelsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateLabelsError::from_response(response))),
)
}
})
}
fn create_notification_subscription(
&self,
input: CreateNotificationSubscriptionRequest,
) -> RusotoFuture<CreateNotificationSubscriptionResponse, CreateNotificationSubscriptionError>
{
let request_uri = format!(
"/api/v1/organizations/{organization_id}/subscriptions",
organization_id = input.organization_id
);
let mut request = SignedRequest::new("POST", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateNotificationSubscriptionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(CreateNotificationSubscriptionError::from_response(response))
}))
}
})
}
fn create_user(
&self,
input: CreateUserRequest,
) -> RusotoFuture<CreateUserResponse, CreateUserError> {
let request_uri = "/api/v1/users";
let mut request = SignedRequest::new("POST", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateUserResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateUserError::from_response(response))),
)
}
})
}
fn deactivate_user(
&self,
input: DeactivateUserRequest,
) -> RusotoFuture<(), DeactivateUserError> {
let request_uri = format!(
"/api/v1/users/{user_id}/activation",
user_id = input.user_id
);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeactivateUserError::from_response(response))),
)
}
})
}
fn delete_comment(&self, input: DeleteCommentRequest) -> RusotoFuture<(), DeleteCommentError> {
let request_uri = format!(
"/api/v1/documents/{document_id}/versions/{version_id}/comment/{comment_id}",
comment_id = input.comment_id,
document_id = input.document_id,
version_id = input.version_id
);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteCommentError::from_response(response))),
)
}
})
}
fn delete_custom_metadata(
&self,
input: DeleteCustomMetadataRequest,
) -> RusotoFuture<DeleteCustomMetadataResponse, DeleteCustomMetadataError> {
let request_uri = format!(
"/api/v1/resources/{resource_id}/customMetadata",
resource_id = input.resource_id
);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.delete_all {
params.put("deleteAll", x);
}
if let Some(ref x) = input.keys {
for item in x.iter() {
params.put("keys", item);
}
}
if let Some(ref x) = input.version_id {
params.put("versionId", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteCustomMetadataResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteCustomMetadataError::from_response(response))
}),
)
}
})
}
fn delete_document(
&self,
input: DeleteDocumentRequest,
) -> RusotoFuture<(), DeleteDocumentError> {
let request_uri = format!(
"/api/v1/documents/{document_id}",
document_id = input.document_id
);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDocumentError::from_response(response))),
)
}
})
}
fn delete_folder(&self, input: DeleteFolderRequest) -> RusotoFuture<(), DeleteFolderError> {
let request_uri = format!("/api/v1/folders/{folder_id}", folder_id = input.folder_id);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteFolderError::from_response(response))),
)
}
})
}
fn delete_folder_contents(
&self,
input: DeleteFolderContentsRequest,
) -> RusotoFuture<(), DeleteFolderContentsError> {
let request_uri = format!(
"/api/v1/folders/{folder_id}/contents",
folder_id = input.folder_id
);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteFolderContentsError::from_response(response))
}),
)
}
})
}
fn delete_labels(
&self,
input: DeleteLabelsRequest,
) -> RusotoFuture<DeleteLabelsResponse, DeleteLabelsError> {
let request_uri = format!(
"/api/v1/resources/{resource_id}/labels",
resource_id = input.resource_id
);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.delete_all {
params.put("deleteAll", x);
}
if let Some(ref x) = input.labels {
for item in x.iter() {
params.put("labels", item);
}
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteLabelsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteLabelsError::from_response(response))),
)
}
})
}
fn delete_notification_subscription(
&self,
input: DeleteNotificationSubscriptionRequest,
) -> RusotoFuture<(), DeleteNotificationSubscriptionError> {
let request_uri = format!(
"/api/v1/organizations/{organization_id}/subscriptions/{subscription_id}",
organization_id = input.organization_id,
subscription_id = input.subscription_id
);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteNotificationSubscriptionError::from_response(response))
}))
}
})
}
fn delete_user(&self, input: DeleteUserRequest) -> RusotoFuture<(), DeleteUserError> {
let request_uri = format!("/api/v1/users/{user_id}", user_id = input.user_id);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteUserError::from_response(response))),
)
}
})
}
fn describe_activities(
&self,
input: DescribeActivitiesRequest,
) -> RusotoFuture<DescribeActivitiesResponse, DescribeActivitiesError> {
let request_uri = "/api/v1/activities";
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.activity_types {
params.put("activityTypes", x);
}
if let Some(ref x) = input.end_time {
params.put("endTime", x);
}
if let Some(ref x) = input.include_indirect_activities {
params.put("includeIndirectActivities", x);
}
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
if let Some(ref x) = input.organization_id {
params.put("organizationId", x);
}
if let Some(ref x) = input.resource_id {
params.put("resourceId", x);
}
if let Some(ref x) = input.start_time {
params.put("startTime", x);
}
if let Some(ref x) = input.user_id {
params.put("userId", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeActivitiesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeActivitiesError::from_response(response))),
)
}
})
}
fn describe_comments(
&self,
input: DescribeCommentsRequest,
) -> RusotoFuture<DescribeCommentsResponse, DescribeCommentsError> {
let request_uri = format!(
"/api/v1/documents/{document_id}/versions/{version_id}/comments",
document_id = input.document_id,
version_id = input.version_id
);
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeCommentsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeCommentsError::from_response(response))),
)
}
})
}
fn describe_document_versions(
&self,
input: DescribeDocumentVersionsRequest,
) -> RusotoFuture<DescribeDocumentVersionsResponse, DescribeDocumentVersionsError> {
let request_uri = format!(
"/api/v1/documents/{document_id}/versions",
document_id = input.document_id
);
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.fields {
params.put("fields", x);
}
if let Some(ref x) = input.include {
params.put("include", x);
}
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeDocumentVersionsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeDocumentVersionsError::from_response(response))
}))
}
})
}
fn describe_folder_contents(
&self,
input: DescribeFolderContentsRequest,
) -> RusotoFuture<DescribeFolderContentsResponse, DescribeFolderContentsError> {
let request_uri = format!(
"/api/v1/folders/{folder_id}/contents",
folder_id = input.folder_id
);
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.include {
params.put("include", x);
}
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
if let Some(ref x) = input.order {
params.put("order", x);
}
if let Some(ref x) = input.sort {
params.put("sort", x);
}
if let Some(ref x) = input.type_ {
params.put("type", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeFolderContentsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeFolderContentsError::from_response(response))
}),
)
}
})
}
fn describe_groups(
&self,
input: DescribeGroupsRequest,
) -> RusotoFuture<DescribeGroupsResponse, DescribeGroupsError> {
let request_uri = "/api/v1/groups";
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
if let Some(ref x) = input.organization_id {
params.put("organizationId", x);
}
params.put("searchQuery", &input.search_query);
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeGroupsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeGroupsError::from_response(response))),
)
}
})
}
fn describe_notification_subscriptions(
&self,
input: DescribeNotificationSubscriptionsRequest,
) -> RusotoFuture<
DescribeNotificationSubscriptionsResponse,
DescribeNotificationSubscriptionsError,
> {
let request_uri = format!(
"/api/v1/organizations/{organization_id}/subscriptions",
organization_id = input.organization_id
);
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeNotificationSubscriptionsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeNotificationSubscriptionsError::from_response(
response,
))
}))
}
})
}
fn describe_resource_permissions(
&self,
input: DescribeResourcePermissionsRequest,
) -> RusotoFuture<DescribeResourcePermissionsResponse, DescribeResourcePermissionsError> {
let request_uri = format!(
"/api/v1/resources/{resource_id}/permissions",
resource_id = input.resource_id
);
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
if let Some(ref x) = input.principal_id {
params.put("principalId", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeResourcePermissionsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeResourcePermissionsError::from_response(response))
}))
}
})
}
fn describe_root_folders(
&self,
input: DescribeRootFoldersRequest,
) -> RusotoFuture<DescribeRootFoldersResponse, DescribeRootFoldersError> {
let request_uri = "/api/v1/me/root";
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("Authentication", &input.authentication_token);
let mut params = Params::new();
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeRootFoldersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeRootFoldersError::from_response(response))
}),
)
}
})
}
fn describe_users(
&self,
input: DescribeUsersRequest,
) -> RusotoFuture<DescribeUsersResponse, DescribeUsersError> {
let request_uri = "/api/v1/users";
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.fields {
params.put("fields", x);
}
if let Some(ref x) = input.include {
params.put("include", x);
}
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
if let Some(ref x) = input.order {
params.put("order", x);
}
if let Some(ref x) = input.organization_id {
params.put("organizationId", x);
}
if let Some(ref x) = input.query {
params.put("query", x);
}
if let Some(ref x) = input.sort {
params.put("sort", x);
}
if let Some(ref x) = input.user_ids {
params.put("userIds", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeUsersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeUsersError::from_response(response))),
)
}
})
}
fn get_current_user(
&self,
input: GetCurrentUserRequest,
) -> RusotoFuture<GetCurrentUserResponse, GetCurrentUserError> {
let request_uri = "/api/v1/me";
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("Authentication", &input.authentication_token);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetCurrentUserResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetCurrentUserError::from_response(response))),
)
}
})
}
fn get_document(
&self,
input: GetDocumentRequest,
) -> RusotoFuture<GetDocumentResponse, GetDocumentError> {
let request_uri = format!(
"/api/v1/documents/{document_id}",
document_id = input.document_id
);
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.include_custom_metadata {
params.put("includeCustomMetadata", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetDocumentResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDocumentError::from_response(response))),
)
}
})
}
fn get_document_path(
&self,
input: GetDocumentPathRequest,
) -> RusotoFuture<GetDocumentPathResponse, GetDocumentPathError> {
let request_uri = format!(
"/api/v1/documents/{document_id}/path",
document_id = input.document_id
);
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.fields {
params.put("fields", x);
}
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetDocumentPathResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDocumentPathError::from_response(response))),
)
}
})
}
fn get_document_version(
&self,
input: GetDocumentVersionRequest,
) -> RusotoFuture<GetDocumentVersionResponse, GetDocumentVersionError> {
let request_uri = format!(
"/api/v1/documents/{document_id}/versions/{version_id}",
document_id = input.document_id,
version_id = input.version_id
);
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.fields {
params.put("fields", x);
}
if let Some(ref x) = input.include_custom_metadata {
params.put("includeCustomMetadata", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetDocumentVersionResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetDocumentVersionError::from_response(response))),
)
}
})
}
fn get_folder(
&self,
input: GetFolderRequest,
) -> RusotoFuture<GetFolderResponse, GetFolderError> {
let request_uri = format!("/api/v1/folders/{folder_id}", folder_id = input.folder_id);
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.include_custom_metadata {
params.put("includeCustomMetadata", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetFolderResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetFolderError::from_response(response))),
)
}
})
}
fn get_folder_path(
&self,
input: GetFolderPathRequest,
) -> RusotoFuture<GetFolderPathResponse, GetFolderPathError> {
let request_uri = format!(
"/api/v1/folders/{folder_id}/path",
folder_id = input.folder_id
);
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.fields {
params.put("fields", x);
}
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetFolderPathResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetFolderPathError::from_response(response))),
)
}
})
}
fn get_resources(
&self,
input: GetResourcesRequest,
) -> RusotoFuture<GetResourcesResponse, GetResourcesError> {
let request_uri = "/api/v1/resources";
let mut request = SignedRequest::new("GET", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.collection_type {
params.put("collectionType", x);
}
if let Some(ref x) = input.limit {
params.put("limit", x);
}
if let Some(ref x) = input.marker {
params.put("marker", x);
}
if let Some(ref x) = input.user_id {
params.put("userId", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<GetResourcesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetResourcesError::from_response(response))),
)
}
})
}
fn initiate_document_version_upload(
&self,
input: InitiateDocumentVersionUploadRequest,
) -> RusotoFuture<InitiateDocumentVersionUploadResponse, InitiateDocumentVersionUploadError>
{
let request_uri = "/api/v1/documents";
let mut request = SignedRequest::new("POST", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 201 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<InitiateDocumentVersionUploadResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(InitiateDocumentVersionUploadError::from_response(response))
}))
}
})
}
fn remove_all_resource_permissions(
&self,
input: RemoveAllResourcePermissionsRequest,
) -> RusotoFuture<(), RemoveAllResourcePermissionsError> {
let request_uri = format!(
"/api/v1/resources/{resource_id}/permissions",
resource_id = input.resource_id
);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RemoveAllResourcePermissionsError::from_response(response))
}))
}
})
}
fn remove_resource_permission(
&self,
input: RemoveResourcePermissionRequest,
) -> RusotoFuture<(), RemoveResourcePermissionError> {
let request_uri = format!(
"/api/v1/resources/{resource_id}/permissions/{principal_id}",
principal_id = input.principal_id,
resource_id = input.resource_id
);
let mut request = SignedRequest::new("DELETE", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
let mut params = Params::new();
if let Some(ref x) = input.principal_type {
params.put("type", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(RemoveResourcePermissionError::from_response(response))
}))
}
})
}
fn update_document(
&self,
input: UpdateDocumentRequest,
) -> RusotoFuture<(), UpdateDocumentError> {
let request_uri = format!(
"/api/v1/documents/{document_id}",
document_id = input.document_id
);
let mut request = SignedRequest::new("PATCH", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateDocumentError::from_response(response))),
)
}
})
}
fn update_document_version(
&self,
input: UpdateDocumentVersionRequest,
) -> RusotoFuture<(), UpdateDocumentVersionError> {
let request_uri = format!(
"/api/v1/documents/{document_id}/versions/{version_id}",
document_id = input.document_id,
version_id = input.version_id
);
let mut request = SignedRequest::new("PATCH", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateDocumentVersionError::from_response(response))
}),
)
}
})
}
fn update_folder(&self, input: UpdateFolderRequest) -> RusotoFuture<(), UpdateFolderError> {
let request_uri = format!("/api/v1/folders/{folder_id}", folder_id = input.folder_id);
let mut request = SignedRequest::new("PATCH", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateFolderError::from_response(response))),
)
}
})
}
fn update_user(
&self,
input: UpdateUserRequest,
) -> RusotoFuture<UpdateUserResponse, UpdateUserError> {
let request_uri = format!("/api/v1/users/{user_id}", user_id = input.user_id);
let mut request = SignedRequest::new("PATCH", "workdocs", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
if let Some(ref authentication_token) = input.authentication_token {
request.add_header("Authentication", &authentication_token.to_string());
}
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateUserResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateUserError::from_response(response))),
)
}
})
}
}