You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Aws::WorkDocs::Client

Inherits:
Seahorse::Client::Base show all
Defined in:
(unknown)

Overview

An API client for Amazon WorkDocs. To construct a client, you need to configure a :region and :credentials.

workdocs = Aws::WorkDocs::Client.new(
  region: region_name,
  credentials: credentials,
  # ...
)

See #initialize for a full list of supported configuration options.

Region

You can configure a default region in the following locations:

  • ENV['AWS_REGION']
  • Aws.config[:region]

Go here for a list of supported regions.

Credentials

Default credentials are loaded automatically from the following locations:

  • ENV['AWS_ACCESS_KEY_ID'] and ENV['AWS_SECRET_ACCESS_KEY']
  • Aws.config[:credentials]
  • The shared credentials ini file at ~/.aws/credentials (more information)
  • From an instance profile when running on EC2

You can also construct a credentials object from one of the following classes:

Alternatively, you configure credentials with :access_key_id and :secret_access_key:

# load credentials from disk
creds = YAML.load(File.read('/path/to/secrets'))

Aws::WorkDocs::Client.new(
  access_key_id: creds['access_key_id'],
  secret_access_key: creds['secret_access_key']
)

Always load your credentials from outside your application. Avoid configuring credentials statically and never commit them to source control.

Instance Attribute Summary

Attributes inherited from Seahorse::Client::Base

#config, #handlers

Constructor collapse

API Operations collapse

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Base

add_plugin, api, #build_request, clear_plugins, define, new, #operation, #operation_names, plugins, remove_plugin, set_api, set_plugins

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response

Constructor Details

#initialize(options = {}) ⇒ Aws::WorkDocs::Client

Constructs an API client.

Options Hash (options):

  • :access_key_id (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :active_endpoint_cache (Boolean)

    When set to true, a thread polling for endpoints will be running in the background every 60 secs (default). Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :convert_params (Boolean) — default: true

    When true, an attempt is made to coerce request parameters into the required types. See Plugins::ParamConverter for more details.

  • :credentials (required, Credentials)

    Your AWS credentials. The following locations will be searched in order for credentials:

    • :access_key_id, :secret_access_key, and :session_token options
    • ENV['AWS_ACCESS_KEY_ID'], ENV['AWS_SECRET_ACCESS_KEY']
    • HOME/.aws/credentials shared credentials file
    • EC2 instance profile credentials See Plugins::RequestSigner for more details.
  • :disable_host_prefix_injection (Boolean)

    Set to true to disable SDK automatically adding host prefix to default service endpoint when available. See Plugins::EndpointPattern for more details.

  • :endpoint (String)

    A default endpoint is constructed from the :region. See Plugins::RegionalEndpoint for more details.

  • :endpoint_cache_max_entries (Integer)

    Used for the maximum size limit of the LRU cache storing endpoints data for endpoint discovery enabled operations. Defaults to 1000. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_max_threads (Integer)

    Used for the maximum threads in use for polling endpoints to be cached, defaults to 10. See Plugins::EndpointDiscovery for more details.

  • :endpoint_cache_poll_interval (Integer)

    When :endpoint_discovery and :active_endpoint_cache is enabled, Use this option to config the time interval in seconds for making requests fetching endpoints information. Defaults to 60 sec. See Plugins::EndpointDiscovery for more details.

  • :endpoint_discovery (Boolean)

    When set to true, endpoint discovery will be enabled for operations when available. Defaults to false. See Plugins::EndpointDiscovery for more details.

  • :http_continue_timeout (Float) — default: 1

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_idle_timeout (Integer) — default: 5

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_open_timeout (Integer) — default: 15

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_proxy (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_read_timeout (Integer) — default: 60

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :http_wire_trace (Boolean) — default: false

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :log_level (Symbol) — default: :info

    The log level to send messages to the logger at. See Plugins::Logging for more details.

  • :log_formatter (Logging::LogFormatter)

    The log formatter. Defaults to Seahorse::Client::Logging::Formatter.default. See Plugins::Logging for more details.

  • :logger (Logger) — default: nil

    The Logger instance to send log messages to. If this option is not set, logging will be disabled. See Plugins::Logging for more details.

  • :profile (String)

    Used when loading credentials from the shared credentials file at HOME/.aws/credentials. When not specified, 'default' is used. See Plugins::RequestSigner for more details.

  • :raise_response_errors (Boolean) — default: true

    When true, response errors are raised. See Seahorse::Client::Plugins::RaiseResponseErrors for more details.

  • :region (required, String)

    The AWS region to connect to. The region is used to construct the client endpoint. Defaults to ENV['AWS_REGION']. Also checks AMAZON_REGION and AWS_DEFAULT_REGION. See Plugins::RegionalEndpoint for more details.

  • :retry_limit (Integer) — default: 3

    The maximum number of times to retry failed requests. Only ~ 500 level server errors and certain ~ 400 level client errors are retried. Generally, these are throttling errors, data checksum errors, networking errors, timeout errors and auth errors from expired credentials. See Plugins::RetryErrors for more details.

  • :secret_access_key (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :session_token (String)

    Used to set credentials statically. See Plugins::RequestSigner for more details.

  • :ssl_ca_bundle (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_directory (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_ca_store (String)

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :ssl_verify_peer (Boolean) — default: true

    See Seahorse::Client::Plugins::NetHttp for more details.

  • :stub_responses (Boolean) — default: false

    Causes the client to return stubbed responses. By default fake responses are generated and returned. You can specify the response data to return or errors to raise by calling ClientStubs#stub_responses. See ClientStubs for more information.

    Please note When response stubbing is enabled, no HTTP requests are made, and retries are disabled. See Plugins::StubResponses for more details.

  • :validate_params (Boolean) — default: true

    When true, request parameters are validated before sending the request. See Plugins::ParamValidator for more details.

Instance Method Details

#abort_document_version_upload(options = {}) ⇒ Struct

Aborts the upload of the specified document version that was previously initiated by InitiateDocumentVersionUpload. The client should make this call only when it no longer intends to upload the document version, or fails to do so.

Examples:

Request syntax with placeholder values


resp = client.abort_document_version_upload({
  authentication_token: "AuthenticationHeaderType",
  document_id: "ResourceIdType", # required
  version_id: "DocumentVersionIdType", # required
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

  • :version_id (required, String)

    The ID of the version.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#activate_user(options = {}) ⇒ Types::ActivateUserResponse

Activates the specified user. Only active users can access Amazon WorkDocs.

Examples:

Request syntax with placeholder values


resp = client.activate_user({
  user_id: "IdType", # required
  authentication_token: "AuthenticationHeaderType",
})

Response structure


resp.user.id #=> String
resp.user.username #=> String
resp.user.email_address #=> String
resp.user.given_name #=> String
resp.user.surname #=> String
resp.user.organization_id #=> String
resp.user.root_folder_id #=> String
resp.user.recycle_bin_folder_id #=> String
resp.user.status #=> String, one of "ACTIVE", "INACTIVE", "PENDING"
resp.user.type #=> String, one of "USER", "ADMIN", "POWERUSER", "MINIMALUSER", "WORKSPACESUSER"
resp.user.created_timestamp #=> Time
resp.user.modified_timestamp #=> Time
resp.user.time_zone_id #=> String
resp.user.locale #=> String, one of "en", "fr", "ko", "de", "es", "ja", "ru", "zh_CN", "zh_TW", "pt_BR", "default"
resp.user.storage.storage_utilized_in_bytes #=> Integer
resp.user.storage.storage_rule.storage_allocated_in_bytes #=> Integer
resp.user.storage.storage_rule.storage_type #=> String, one of "UNLIMITED", "QUOTA"

Options Hash (options):

  • :user_id (required, String)

    The ID of the user.

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

Returns:

See Also:

#add_resource_permissions(options = {}) ⇒ Types::AddResourcePermissionsResponse

Creates a set of permissions for the specified folder or document. The resource permissions are overwritten if the principals already have different permissions.

Examples:

Request syntax with placeholder values


resp = client.add_resource_permissions({
  authentication_token: "AuthenticationHeaderType",
  resource_id: "ResourceIdType", # required
  principals: [ # required
    {
      id: "IdType", # required
      type: "USER", # required, accepts USER, GROUP, INVITE, ANONYMOUS, ORGANIZATION
      role: "VIEWER", # required, accepts VIEWER, CONTRIBUTOR, OWNER, COOWNER
    },
  ],
  notification_options: {
    send_email: false,
    email_message: "MessageType",
  },
})

Response structure


resp.share_results #=> Array
resp.share_results[0].principal_id #=> String
resp.share_results[0].invitee_principal_id #=> String
resp.share_results[0].role #=> String, one of "VIEWER", "CONTRIBUTOR", "OWNER", "COOWNER"
resp.share_results[0].status #=> String, one of "SUCCESS", "FAILURE"
resp.share_results[0].share_id #=> String
resp.share_results[0].status_message #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :resource_id (required, String)

    The ID of the resource.

  • :principals (required, Array<Types::SharePrincipal>)

    The users, groups, or organization being granted permission.

  • :notification_options (Types::NotificationOptions)

    The notification options.

Returns:

See Also:

#create_comment(options = {}) ⇒ Types::CreateCommentResponse

Adds a new comment to the specified document version.

Examples:

Request syntax with placeholder values


resp = client.create_comment({
  authentication_token: "AuthenticationHeaderType",
  document_id: "ResourceIdType", # required
  version_id: "DocumentVersionIdType", # required
  parent_id: "CommentIdType",
  thread_id: "CommentIdType",
  text: "CommentTextType", # required
  visibility: "PUBLIC", # accepts PUBLIC, PRIVATE
  notify_collaborators: false,
})

Response structure


resp.comment.comment_id #=> String
resp.comment.parent_id #=> String
resp.comment.thread_id #=> String
resp.comment.text #=> String
resp.comment.contributor.id #=> String
resp.comment.contributor.username #=> String
resp.comment.contributor.email_address #=> String
resp.comment.contributor.given_name #=> String
resp.comment.contributor.surname #=> String
resp.comment.contributor.organization_id #=> String
resp.comment.contributor.root_folder_id #=> String
resp.comment.contributor.recycle_bin_folder_id #=> String
resp.comment.contributor.status #=> String, one of "ACTIVE", "INACTIVE", "PENDING"
resp.comment.contributor.type #=> String, one of "USER", "ADMIN", "POWERUSER", "MINIMALUSER", "WORKSPACESUSER"
resp.comment.contributor.created_timestamp #=> Time
resp.comment.contributor.modified_timestamp #=> Time
resp.comment.contributor.time_zone_id #=> String
resp.comment.contributor.locale #=> String, one of "en", "fr", "ko", "de", "es", "ja", "ru", "zh_CN", "zh_TW", "pt_BR", "default"
resp.comment.contributor.storage.storage_utilized_in_bytes #=> Integer
resp.comment.contributor.storage.storage_rule.storage_allocated_in_bytes #=> Integer
resp.comment.contributor.storage.storage_rule.storage_type #=> String, one of "UNLIMITED", "QUOTA"
resp.comment.created_timestamp #=> Time
resp.comment.status #=> String, one of "DRAFT", "PUBLISHED", "DELETED"
resp.comment.visibility #=> String, one of "PUBLIC", "PRIVATE"
resp.comment.recipient_id #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

  • :version_id (required, String)

    The ID of the document version.

  • :parent_id (String)

    The ID of the parent comment.

  • :thread_id (String)

    The ID of the root comment in the thread.

  • :text (required, String)

    The text of the comment.

  • :visibility (String)

    The visibility of the comment. Options are either PRIVATE, where the comment is visible only to the comment author and document owner and co-owners, or PUBLIC, where the comment is visible to document owners, co-owners, and contributors.

  • :notify_collaborators (Boolean)

    Set this parameter to TRUE to send an email out to the document collaborators after the comment is created.

Returns:

See Also:

#create_custom_metadata(options = {}) ⇒ Struct

Adds one or more custom properties to the specified resource (a folder, document, or version).

Examples:

Request syntax with placeholder values


resp = client.({
  authentication_token: "AuthenticationHeaderType",
  resource_id: "ResourceIdType", # required
  version_id: "DocumentVersionIdType",
  custom_metadata: { # required
    "CustomMetadataKeyType" => "CustomMetadataValueType",
  },
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :resource_id (required, String)

    The ID of the resource.

  • :version_id (String)

    The ID of the version, if the custom metadata is being added to a document version.

  • :custom_metadata (required, Hash<String,String>)

    Custom metadata in the form of name-value pairs.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_folder(options = {}) ⇒ Types::CreateFolderResponse

Creates a folder with the specified name and parent folder.

Examples:

Request syntax with placeholder values


resp = client.create_folder({
  authentication_token: "AuthenticationHeaderType",
  name: "ResourceNameType",
  parent_folder_id: "ResourceIdType", # required
})

Response structure


resp..id #=> String
resp..name #=> String
resp..creator_id #=> String
resp..parent_folder_id #=> String
resp..created_timestamp #=> Time
resp..modified_timestamp #=> Time
resp..resource_state #=> String, one of "ACTIVE", "RESTORING", "RECYCLING", "RECYCLED"
resp..signature #=> String
resp..labels #=> Array
resp..labels[0] #=> String
resp..size #=> Integer
resp..latest_version_size #=> Integer

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :name (String)

    The name of the new folder.

  • :parent_folder_id (required, String)

    The ID of the parent folder.

Returns:

See Also:

#create_labels(options = {}) ⇒ Struct

Adds the specified list of labels to the given resource (a document or folder)

Examples:

Request syntax with placeholder values


resp = client.create_labels({
  resource_id: "ResourceIdType", # required
  labels: ["SharedLabel"], # required
  authentication_token: "AuthenticationHeaderType",
})

Options Hash (options):

  • :resource_id (required, String)

    The ID of the resource.

  • :labels (required, Array<String>)

    List of labels to add to the resource.

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#create_notification_subscription(options = {}) ⇒ Types::CreateNotificationSubscriptionResponse

Configure Amazon WorkDocs to use Amazon SNS notifications. The endpoint receives a confirmation message, and must confirm the subscription.

For more information, see Subscribe to Notifications in the Amazon WorkDocs Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.create_notification_subscription({
  organization_id: "IdType", # required
  endpoint: "SubscriptionEndPointType", # required
  protocol: "HTTPS", # required, accepts HTTPS
  subscription_type: "ALL", # required, accepts ALL
})

Response structure


resp.subscription.subscription_id #=> String
resp.subscription.end_point #=> String
resp.subscription.protocol #=> String, one of "HTTPS"

Options Hash (options):

  • :organization_id (required, String)

    The ID of the organization.

  • :endpoint (required, String)

    The endpoint to receive the notifications. If the protocol is HTTPS, the endpoint is a URL that begins with https.

  • :protocol (required, String)

    The protocol to use. The supported value is https, which delivers JSON-encoded messages using HTTPS POST.

  • :subscription_type (required, String)

    The notification type.

Returns:

See Also:

#create_user(options = {}) ⇒ Types::CreateUserResponse

Creates a user in a Simple AD or Microsoft AD directory. The status of a newly created user is "ACTIVE". New users can access Amazon WorkDocs.

Examples:

Request syntax with placeholder values


resp = client.create_user({
  organization_id: "IdType",
  username: "UsernameType", # required
  email_address: "EmailAddressType",
  given_name: "UserAttributeValueType", # required
  surname: "UserAttributeValueType", # required
  password: "PasswordType", # required
  time_zone_id: "TimeZoneIdType",
  storage_rule: {
    storage_allocated_in_bytes: 1,
    storage_type: "UNLIMITED", # accepts UNLIMITED, QUOTA
  },
  authentication_token: "AuthenticationHeaderType",
})

Response structure


resp.user.id #=> String
resp.user.username #=> String
resp.user.email_address #=> String
resp.user.given_name #=> String
resp.user.surname #=> String
resp.user.organization_id #=> String
resp.user.root_folder_id #=> String
resp.user.recycle_bin_folder_id #=> String
resp.user.status #=> String, one of "ACTIVE", "INACTIVE", "PENDING"
resp.user.type #=> String, one of "USER", "ADMIN", "POWERUSER", "MINIMALUSER", "WORKSPACESUSER"
resp.user.created_timestamp #=> Time
resp.user.modified_timestamp #=> Time
resp.user.time_zone_id #=> String
resp.user.locale #=> String, one of "en", "fr", "ko", "de", "es", "ja", "ru", "zh_CN", "zh_TW", "pt_BR", "default"
resp.user.storage.storage_utilized_in_bytes #=> Integer
resp.user.storage.storage_rule.storage_allocated_in_bytes #=> Integer
resp.user.storage.storage_rule.storage_type #=> String, one of "UNLIMITED", "QUOTA"

Options Hash (options):

  • :organization_id (String)

    The ID of the organization.

  • :username (required, String)

    The login name of the user.

  • :email_address (String)

    The email address of the user.

  • :given_name (required, String)

    The given name of the user.

  • :surname (required, String)

    The surname of the user.

  • :password (required, String)

    The password of the user.

  • :time_zone_id (String)

    The time zone ID of the user.

  • :storage_rule (Types::StorageRuleType)

    The amount of storage for the user.

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

Returns:

See Also:

#deactivate_user(options = {}) ⇒ Struct

Deactivates the specified user, which revokes the user's access to Amazon WorkDocs.

Examples:

Request syntax with placeholder values


resp = client.deactivate_user({
  user_id: "IdType", # required
  authentication_token: "AuthenticationHeaderType",
})

Options Hash (options):

  • :user_id (required, String)

    The ID of the user.

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_comment(options = {}) ⇒ Struct

Deletes the specified comment from the document version.

Examples:

Request syntax with placeholder values


resp = client.delete_comment({
  authentication_token: "AuthenticationHeaderType",
  document_id: "ResourceIdType", # required
  version_id: "DocumentVersionIdType", # required
  comment_id: "CommentIdType", # required
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

  • :version_id (required, String)

    The ID of the document version.

  • :comment_id (required, String)

    The ID of the comment.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_custom_metadata(options = {}) ⇒ Struct

Deletes custom metadata from the specified resource.

Examples:

Request syntax with placeholder values


resp = client.({
  authentication_token: "AuthenticationHeaderType",
  resource_id: "ResourceIdType", # required
  version_id: "DocumentVersionIdType",
  keys: ["CustomMetadataKeyType"],
  delete_all: false,
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :resource_id (required, String)

    The ID of the resource, either a document or folder.

  • :version_id (String)

    The ID of the version, if the custom metadata is being deleted from a document version.

  • :keys (Array<String>)

    List of properties to remove.

  • :delete_all (Boolean)

    Flag to indicate removal of all custom metadata properties from the specified resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_document(options = {}) ⇒ Struct

Permanently deletes the specified document and its associated metadata.

Examples:

Request syntax with placeholder values


resp = client.delete_document({
  authentication_token: "AuthenticationHeaderType",
  document_id: "ResourceIdType", # required
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_folder(options = {}) ⇒ Struct

Permanently deletes the specified folder and its contents.

Examples:

Request syntax with placeholder values


resp = client.delete_folder({
  authentication_token: "AuthenticationHeaderType",
  folder_id: "ResourceIdType", # required
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :folder_id (required, String)

    The ID of the folder.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_folder_contents(options = {}) ⇒ Struct

Deletes the contents of the specified folder.

Examples:

Request syntax with placeholder values


resp = client.delete_folder_contents({
  authentication_token: "AuthenticationHeaderType",
  folder_id: "ResourceIdType", # required
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :folder_id (required, String)

    The ID of the folder.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_labels(options = {}) ⇒ Struct

Deletes the specified list of labels from a resource.

Examples:

Request syntax with placeholder values


resp = client.delete_labels({
  resource_id: "ResourceIdType", # required
  authentication_token: "AuthenticationHeaderType",
  labels: ["SharedLabel"],
  delete_all: false,
})

Options Hash (options):

  • :resource_id (required, String)

    The ID of the resource.

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :labels (Array<String>)

    List of labels to delete from the resource.

  • :delete_all (Boolean)

    Flag to request removal of all labels from the specified resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_notification_subscription(options = {}) ⇒ Struct

Deletes the specified subscription from the specified organization.

Examples:

Request syntax with placeholder values


resp = client.delete_notification_subscription({
  subscription_id: "IdType", # required
  organization_id: "IdType", # required
})

Options Hash (options):

  • :subscription_id (required, String)

    The ID of the subscription.

  • :organization_id (required, String)

    The ID of the organization.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#delete_user(options = {}) ⇒ Struct

Deletes the specified user from a Simple AD or Microsoft AD directory.

Examples:

Request syntax with placeholder values


resp = client.delete_user({
  authentication_token: "AuthenticationHeaderType",
  user_id: "IdType", # required
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Do not set this field when using administrative API actions, as in accessing the API using AWS credentials.

  • :user_id (required, String)

    The ID of the user.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#describe_activities(options = {}) ⇒ Types::DescribeActivitiesResponse

Describes the user activities in a specified time period.

Examples:

Request syntax with placeholder values


resp = client.describe_activities({
  authentication_token: "AuthenticationHeaderType",
  start_time: Time.now,
  end_time: Time.now,
  organization_id: "IdType",
  activity_types: "ActivityNamesFilterType",
  resource_id: "IdType",
  user_id: "IdType",
  include_indirect_activities: false,
  limit: 1,
  marker: "MarkerType",
})

Response structure


resp.user_activities #=> Array
resp.user_activities[0].type #=> String, one of "DOCUMENT_CHECKED_IN", "DOCUMENT_CHECKED_OUT", "DOCUMENT_RENAMED", "DOCUMENT_VERSION_UPLOADED", "DOCUMENT_VERSION_DELETED", "DOCUMENT_VERSION_VIEWED", "DOCUMENT_VERSION_DOWNLOADED", "DOCUMENT_RECYCLED", "DOCUMENT_RESTORED", "DOCUMENT_REVERTED", "DOCUMENT_SHARED", "DOCUMENT_UNSHARED", "DOCUMENT_SHARE_PERMISSION_CHANGED", "DOCUMENT_SHAREABLE_LINK_CREATED", "DOCUMENT_SHAREABLE_LINK_REMOVED", "DOCUMENT_SHAREABLE_LINK_PERMISSION_CHANGED", "DOCUMENT_MOVED", "DOCUMENT_COMMENT_ADDED", "DOCUMENT_COMMENT_DELETED", "DOCUMENT_ANNOTATION_ADDED", "DOCUMENT_ANNOTATION_DELETED", "FOLDER_CREATED", "FOLDER_DELETED", "FOLDER_RENAMED", "FOLDER_RECYCLED", "FOLDER_RESTORED", "FOLDER_SHARED", "FOLDER_UNSHARED", "FOLDER_SHARE_PERMISSION_CHANGED", "FOLDER_SHAREABLE_LINK_CREATED", "FOLDER_SHAREABLE_LINK_REMOVED", "FOLDER_SHAREABLE_LINK_PERMISSION_CHANGED", "FOLDER_MOVED"
resp.user_activities[0].time_stamp #=> Time
resp.user_activities[0].is_indirect_activity #=> true/false
resp.user_activities[0].organization_id #=> String
resp.user_activities[0].initiator.id #=> String
resp.user_activities[0].initiator.username #=> String
resp.user_activities[0].initiator.given_name #=> String
resp.user_activities[0].initiator.surname #=> String
resp.user_activities[0].initiator.email_address #=> String
resp.user_activities[0].participants.users #=> Array
resp.user_activities[0].participants.users[0].id #=> String
resp.user_activities[0].participants.users[0].username #=> String
resp.user_activities[0].participants.users[0].given_name #=> String
resp.user_activities[0].participants.users[0].surname #=> String
resp.user_activities[0].participants.users[0].email_address #=> String
resp.user_activities[0].participants.groups #=> Array
resp.user_activities[0].participants.groups[0].id #=> String
resp.user_activities[0].participants.groups[0].name #=> String
resp.user_activities[0]..type #=> String, one of "FOLDER", "DOCUMENT"
resp.user_activities[0]..name #=> String
resp.user_activities[0]..original_name #=> String
resp.user_activities[0]..id #=> String
resp.user_activities[0]..version_id #=> String
resp.user_activities[0]..owner.id #=> String
resp.user_activities[0]..owner.username #=> String
resp.user_activities[0]..owner.given_name #=> String
resp.user_activities[0]..owner.surname #=> String
resp.user_activities[0]..owner.email_address #=> String
resp.user_activities[0]..parent_id #=> String
resp.user_activities[0].original_parent.type #=> String, one of "FOLDER", "DOCUMENT"
resp.user_activities[0].original_parent.name #=> String
resp.user_activities[0].original_parent.original_name #=> String
resp.user_activities[0].original_parent.id #=> String
resp.user_activities[0].original_parent.version_id #=> String
resp.user_activities[0].original_parent.owner.id #=> String
resp.user_activities[0].original_parent.owner.username #=> String
resp.user_activities[0].original_parent.owner.given_name #=> String
resp.user_activities[0].original_parent.owner.surname #=> String
resp.user_activities[0].original_parent.owner.email_address #=> String
resp.user_activities[0].original_parent.parent_id #=> String
resp.user_activities[0]..comment_id #=> String
resp.user_activities[0]..contributor.id #=> String
resp.user_activities[0]..contributor.username #=> String
resp.user_activities[0]..contributor.email_address #=> String
resp.user_activities[0]..contributor.given_name #=> String
resp.user_activities[0]..contributor.surname #=> String
resp.user_activities[0]..contributor.organization_id #=> String
resp.user_activities[0]..contributor.root_folder_id #=> String
resp.user_activities[0]..contributor.recycle_bin_folder_id #=> String
resp.user_activities[0]..contributor.status #=> String, one of "ACTIVE", "INACTIVE", "PENDING"
resp.user_activities[0]..contributor.type #=> String, one of "USER", "ADMIN", "POWERUSER", "MINIMALUSER", "WORKSPACESUSER"
resp.user_activities[0]..contributor.created_timestamp #=> Time
resp.user_activities[0]..contributor.modified_timestamp #=> Time
resp.user_activities[0]..contributor.time_zone_id #=> String
resp.user_activities[0]..contributor.locale #=> String, one of "en", "fr", "ko", "de", "es", "ja", "ru", "zh_CN", "zh_TW", "pt_BR", "default"
resp.user_activities[0]..contributor.storage.storage_utilized_in_bytes #=> Integer
resp.user_activities[0]..contributor.storage.storage_rule.storage_allocated_in_bytes #=> Integer
resp.user_activities[0]..contributor.storage.storage_rule.storage_type #=> String, one of "UNLIMITED", "QUOTA"
resp.user_activities[0]..created_timestamp #=> Time
resp.user_activities[0]..comment_status #=> String, one of "DRAFT", "PUBLISHED", "DELETED"
resp.user_activities[0]..recipient_id #=> String
resp.marker #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :start_time (Time)

    The timestamp that determines the starting time of the activities. The response includes the activities performed after the specified timestamp.

  • :end_time (Time)

    The timestamp that determines the end time of the activities. The response includes the activities performed before the specified timestamp.

  • :organization_id (String)

    The ID of the organization. This is a mandatory parameter when using administrative API (SigV4) requests.

  • :activity_types (String)

    Specifies which activity types to include in the response. If this field is left empty, all activity types are returned.

  • :resource_id (String)

    The document or folder ID for which to describe activity types.

  • :user_id (String)

    The ID of the user who performed the action. The response includes activities pertaining to this user. This is an optional parameter and is only applicable for administrative API (SigV4) requests.

  • :include_indirect_activities (Boolean)

    Includes indirect activities. An indirect activity results from a direct activity performed on a parent resource. For example, sharing a parent folder (the direct activity) shares all of the subfolders and documents within the parent folder (the indirect activity).

  • :limit (Integer)

    The maximum number of items to return.

  • :marker (String)

    The marker for the next set of results.

Returns:

See Also:

#describe_comments(options = {}) ⇒ Types::DescribeCommentsResponse

List all the comments for the specified document version.

Examples:

Request syntax with placeholder values


resp = client.describe_comments({
  authentication_token: "AuthenticationHeaderType",
  document_id: "ResourceIdType", # required
  version_id: "DocumentVersionIdType", # required
  limit: 1,
  marker: "MarkerType",
})

Response structure


resp.comments #=> Array
resp.comments[0].comment_id #=> String
resp.comments[0].parent_id #=> String
resp.comments[0].thread_id #=> String
resp.comments[0].text #=> String
resp.comments[0].contributor.id #=> String
resp.comments[0].contributor.username #=> String
resp.comments[0].contributor.email_address #=> String
resp.comments[0].contributor.given_name #=> String
resp.comments[0].contributor.surname #=> String
resp.comments[0].contributor.organization_id #=> String
resp.comments[0].contributor.root_folder_id #=> String
resp.comments[0].contributor.recycle_bin_folder_id #=> String
resp.comments[0].contributor.status #=> String, one of "ACTIVE", "INACTIVE", "PENDING"
resp.comments[0].contributor.type #=> String, one of "USER", "ADMIN", "POWERUSER", "MINIMALUSER", "WORKSPACESUSER"
resp.comments[0].contributor.created_timestamp #=> Time
resp.comments[0].contributor.modified_timestamp #=> Time
resp.comments[0].contributor.time_zone_id #=> String
resp.comments[0].contributor.locale #=> String, one of "en", "fr", "ko", "de", "es", "ja", "ru", "zh_CN", "zh_TW", "pt_BR", "default"
resp.comments[0].contributor.storage.storage_utilized_in_bytes #=> Integer
resp.comments[0].contributor.storage.storage_rule.storage_allocated_in_bytes #=> Integer
resp.comments[0].contributor.storage.storage_rule.storage_type #=> String, one of "UNLIMITED", "QUOTA"
resp.comments[0].created_timestamp #=> Time
resp.comments[0].status #=> String, one of "DRAFT", "PUBLISHED", "DELETED"
resp.comments[0].visibility #=> String, one of "PUBLIC", "PRIVATE"
resp.comments[0].recipient_id #=> String
resp.marker #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

  • :version_id (required, String)

    The ID of the document version.

  • :limit (Integer)

    The maximum number of items to return.

  • :marker (String)

    The marker for the next set of results. This marker was received from a previous call.

Returns:

See Also:

#describe_document_versions(options = {}) ⇒ Types::DescribeDocumentVersionsResponse

Retrieves the document versions for the specified document.

By default, only active versions are returned.

Examples:

Request syntax with placeholder values


resp = client.describe_document_versions({
  authentication_token: "AuthenticationHeaderType",
  document_id: "ResourceIdType", # required
  marker: "PageMarkerType",
  limit: 1,
  include: "FieldNamesType",
  fields: "FieldNamesType",
})

Response structure


resp.document_versions #=> Array
resp.document_versions[0].id #=> String
resp.document_versions[0].name #=> String
resp.document_versions[0].content_type #=> String
resp.document_versions[0].size #=> Integer
resp.document_versions[0].signature #=> String
resp.document_versions[0].status #=> String, one of "INITIALIZED", "ACTIVE"
resp.document_versions[0].created_timestamp #=> Time
resp.document_versions[0].modified_timestamp #=> Time
resp.document_versions[0].content_created_timestamp #=> Time
resp.document_versions[0].content_modified_timestamp #=> Time
resp.document_versions[0].creator_id #=> String
resp.document_versions[0].thumbnail #=> Hash
resp.document_versions[0].thumbnail["DocumentThumbnailType"] #=> String
resp.document_versions[0].source #=> Hash
resp.document_versions[0].source["DocumentSourceType"] #=> String
resp.marker #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

  • :marker (String)

    The marker for the next set of results. (You received this marker from a previous call.)

  • :limit (Integer)

    The maximum number of versions to return with this call.

  • :include (String)

    A comma-separated list of values. Specify \"INITIALIZED\" to include incomplete versions.

  • :fields (String)

    Specify \"SOURCE\" to include initialized versions and a URL for the source document.

Returns:

See Also:

#describe_folder_contents(options = {}) ⇒ Types::DescribeFolderContentsResponse

Describes the contents of the specified folder, including its documents and subfolders.

By default, Amazon WorkDocs returns the first 100 active document and folder metadata items. If there are more results, the response includes a marker that you can use to request the next set of results. You can also request initialized documents.

Examples:

Request syntax with placeholder values


resp = client.describe_folder_contents({
  authentication_token: "AuthenticationHeaderType",
  folder_id: "ResourceIdType", # required
  sort: "DATE", # accepts DATE, NAME
  order: "ASCENDING", # accepts ASCENDING, DESCENDING
  limit: 1,
  marker: "PageMarkerType",
  type: "ALL", # accepts ALL, DOCUMENT, FOLDER
  include: "FieldNamesType",
})

Response structure


resp.folders #=> Array
resp.folders[0].id #=> String
resp.folders[0].name #=> String
resp.folders[0].creator_id #=> String
resp.folders[0].parent_folder_id #=> String
resp.folders[0].created_timestamp #=> Time
resp.folders[0].modified_timestamp #=> Time
resp.folders[0].resource_state #=> String, one of "ACTIVE", "RESTORING", "RECYCLING", "RECYCLED"
resp.folders[0].signature #=> String
resp.folders[0].labels #=> Array
resp.folders[0].labels[0] #=> String
resp.folders[0].size #=> Integer
resp.folders[0].latest_version_size #=> Integer
resp.documents #=> Array
resp.documents[0].id #=> String
resp.documents[0].creator_id #=> String
resp.documents[0].parent_folder_id #=> String
resp.documents[0].created_timestamp #=> Time
resp.documents[0].modified_timestamp #=> Time
resp.documents[0]..id #=> String
resp.documents[0]..name #=> String
resp.documents[0]..content_type #=> String
resp.documents[0]..size #=> Integer
resp.documents[0]..signature #=> String
resp.documents[0]..status #=> String, one of "INITIALIZED", "ACTIVE"
resp.documents[0]..created_timestamp #=> Time
resp.documents[0]..modified_timestamp #=> Time
resp.documents[0]..content_created_timestamp #=> Time
resp.documents[0]..content_modified_timestamp #=> Time
resp.documents[0]..creator_id #=> String
resp.documents[0]..thumbnail #=> Hash
resp.documents[0]..thumbnail["DocumentThumbnailType"] #=> String
resp.documents[0]..source #=> Hash
resp.documents[0]..source["DocumentSourceType"] #=> String
resp.documents[0].resource_state #=> String, one of "ACTIVE", "RESTORING", "RECYCLING", "RECYCLED"
resp.documents[0].labels #=> Array
resp.documents[0].labels[0] #=> String
resp.marker #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :folder_id (required, String)

    The ID of the folder.

  • :sort (String)

    The sorting criteria.

  • :order (String)

    The order for the contents of the folder.

  • :limit (Integer)

    The maximum number of items to return with this call.

  • :marker (String)

    The marker for the next set of results. This marker was received from a previous call.

  • :type (String)

    The type of items.

  • :include (String)

    The contents to include. Specify \"INITIALIZED\" to include initialized documents.

Returns:

See Also:

#describe_groups(options = {}) ⇒ Types::DescribeGroupsResponse

Describes the groups specified by the query. Groups are defined by the underlying Active Directory.

Examples:

Request syntax with placeholder values


resp = client.describe_groups({
  authentication_token: "AuthenticationHeaderType",
  search_query: "SearchQueryType", # required
  organization_id: "IdType",
  marker: "MarkerType",
  limit: 1,
})

Response structure


resp.groups #=> Array
resp.groups[0].id #=> String
resp.groups[0].name #=> String
resp.marker #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :search_query (required, String)

    A query to describe groups by group name.

  • :organization_id (String)

    The ID of the organization.

  • :marker (String)

    The marker for the next set of results. (You received this marker from a previous call.)

  • :limit (Integer)

    The maximum number of items to return with this call.

Returns:

See Also:

#describe_notification_subscriptions(options = {}) ⇒ Types::DescribeNotificationSubscriptionsResponse

Lists the specified notification subscriptions.

Examples:

Request syntax with placeholder values


resp = client.describe_notification_subscriptions({
  organization_id: "IdType", # required
  marker: "PageMarkerType",
  limit: 1,
})

Response structure


resp.subscriptions #=> Array
resp.subscriptions[0].subscription_id #=> String
resp.subscriptions[0].end_point #=> String
resp.subscriptions[0].protocol #=> String, one of "HTTPS"
resp.marker #=> String

Options Hash (options):

  • :organization_id (required, String)

    The ID of the organization.

  • :marker (String)

    The marker for the next set of results. (You received this marker from a previous call.)

  • :limit (Integer)

    The maximum number of items to return with this call.

Returns:

See Also:

#describe_resource_permissions(options = {}) ⇒ Types::DescribeResourcePermissionsResponse

Describes the permissions of a specified resource.

Examples:

Request syntax with placeholder values


resp = client.describe_resource_permissions({
  authentication_token: "AuthenticationHeaderType",
  resource_id: "ResourceIdType", # required
  principal_id: "IdType",
  limit: 1,
  marker: "PageMarkerType",
})

Response structure


resp.principals #=> Array
resp.principals[0].id #=> String
resp.principals[0].type #=> String, one of "USER", "GROUP", "INVITE", "ANONYMOUS", "ORGANIZATION"
resp.principals[0].roles #=> Array
resp.principals[0].roles[0].role #=> String, one of "VIEWER", "CONTRIBUTOR", "OWNER", "COOWNER"
resp.principals[0].roles[0].type #=> String, one of "DIRECT", "INHERITED"
resp.marker #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :resource_id (required, String)

    The ID of the resource.

  • :principal_id (String)

    The ID of the principal to filter permissions by.

  • :limit (Integer)

    The maximum number of items to return with this call.

  • :marker (String)

    The marker for the next set of results. (You received this marker from a previous call)

Returns:

See Also:

#describe_root_folders(options = {}) ⇒ Types::DescribeRootFoldersResponse

Describes the current user's special folders; the RootFolder and the RecycleBin. RootFolder is the root of user's files and folders and RecycleBin is the root of recycled items. This is not a valid action for SigV4 (administrative API) clients.

This action requires an authentication token. To get an authentication token, register an application with Amazon WorkDocs. For more information, see Authentication and Access Control for User Applications in the Amazon WorkDocs Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.describe_root_folders({
  authentication_token: "AuthenticationHeaderType", # required
  limit: 1,
  marker: "PageMarkerType",
})

Response structure


resp.folders #=> Array
resp.folders[0].id #=> String
resp.folders[0].name #=> String
resp.folders[0].creator_id #=> String
resp.folders[0].parent_folder_id #=> String
resp.folders[0].created_timestamp #=> Time
resp.folders[0].modified_timestamp #=> Time
resp.folders[0].resource_state #=> String, one of "ACTIVE", "RESTORING", "RECYCLING", "RECYCLED"
resp.folders[0].signature #=> String
resp.folders[0].labels #=> Array
resp.folders[0].labels[0] #=> String
resp.folders[0].size #=> Integer
resp.folders[0].latest_version_size #=> Integer
resp.marker #=> String

Options Hash (options):

  • :authentication_token (required, String)

    Amazon WorkDocs authentication token.

  • :limit (Integer)

    The maximum number of items to return.

  • :marker (String)

    The marker for the next set of results. (You received this marker from a previous call.)

Returns:

See Also:

#describe_users(options = {}) ⇒ Types::DescribeUsersResponse

Describes the specified users. You can describe all users or filter the results (for example, by status or organization).

By default, Amazon WorkDocs returns the first 24 active or pending users. If there are more results, the response includes a marker that you can use to request the next set of results.

Examples:

Request syntax with placeholder values


resp = client.describe_users({
  authentication_token: "AuthenticationHeaderType",
  organization_id: "IdType",
  user_ids: "UserIdsType",
  query: "SearchQueryType",
  include: "ALL", # accepts ALL, ACTIVE_PENDING
  order: "ASCENDING", # accepts ASCENDING, DESCENDING
  sort: "USER_NAME", # accepts USER_NAME, FULL_NAME, STORAGE_LIMIT, USER_STATUS, STORAGE_USED
  marker: "PageMarkerType",
  limit: 1,
  fields: "FieldNamesType",
})

Response structure


resp.users #=> Array
resp.users[0].id #=> String
resp.users[0].username #=> String
resp.users[0].email_address #=> String
resp.users[0].given_name #=> String
resp.users[0].surname #=> String
resp.users[0].organization_id #=> String
resp.users[0].root_folder_id #=> String
resp.users[0].recycle_bin_folder_id #=> String
resp.users[0].status #=> String, one of "ACTIVE", "INACTIVE", "PENDING"
resp.users[0].type #=> String, one of "USER", "ADMIN", "POWERUSER", "MINIMALUSER", "WORKSPACESUSER"
resp.users[0].created_timestamp #=> Time
resp.users[0].modified_timestamp #=> Time
resp.users[0].time_zone_id #=> String
resp.users[0].locale #=> String, one of "en", "fr", "ko", "de", "es", "ja", "ru", "zh_CN", "zh_TW", "pt_BR", "default"
resp.users[0].storage.storage_utilized_in_bytes #=> Integer
resp.users[0].storage.storage_rule.storage_allocated_in_bytes #=> Integer
resp.users[0].storage.storage_rule.storage_type #=> String, one of "UNLIMITED", "QUOTA"
resp.total_number_of_users #=> Integer
resp.marker #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :organization_id (String)

    The ID of the organization.

  • :user_ids (String)

    The IDs of the users.

  • :query (String)

    A query to filter users by user name.

  • :include (String)

    The state of the users. Specify \"ALL\" to include inactive users.

  • :order (String)

    The order for the results.

  • :sort (String)

    The sorting criteria.

  • :marker (String)

    The marker for the next set of results. (You received this marker from a previous call.)

  • :limit (Integer)

    The maximum number of items to return.

  • :fields (String)

    A comma-separated list of values. Specify \"STORAGE_METADATA\" to include the user storage quota and utilization information.

Returns:

See Also:

#get_current_user(options = {}) ⇒ Types::GetCurrentUserResponse

Retrieves details of the current user for whom the authentication token was generated. This is not a valid action for SigV4 (administrative API) clients.

This action requires an authentication token. To get an authentication token, register an application with Amazon WorkDocs. For more information, see Authentication and Access Control for User Applications in the Amazon WorkDocs Developer Guide.

Examples:

Request syntax with placeholder values


resp = client.get_current_user({
  authentication_token: "AuthenticationHeaderType", # required
})

Response structure


resp.user.id #=> String
resp.user.username #=> String
resp.user.email_address #=> String
resp.user.given_name #=> String
resp.user.surname #=> String
resp.user.organization_id #=> String
resp.user.root_folder_id #=> String
resp.user.recycle_bin_folder_id #=> String
resp.user.status #=> String, one of "ACTIVE", "INACTIVE", "PENDING"
resp.user.type #=> String, one of "USER", "ADMIN", "POWERUSER", "MINIMALUSER", "WORKSPACESUSER"
resp.user.created_timestamp #=> Time
resp.user.modified_timestamp #=> Time
resp.user.time_zone_id #=> String
resp.user.locale #=> String, one of "en", "fr", "ko", "de", "es", "ja", "ru", "zh_CN", "zh_TW", "pt_BR", "default"
resp.user.storage.storage_utilized_in_bytes #=> Integer
resp.user.storage.storage_rule.storage_allocated_in_bytes #=> Integer
resp.user.storage.storage_rule.storage_type #=> String, one of "UNLIMITED", "QUOTA"

Options Hash (options):

  • :authentication_token (required, String)

    Amazon WorkDocs authentication token.

Returns:

See Also:

#get_document(options = {}) ⇒ Types::GetDocumentResponse

Retrieves details of a document.

Examples:

Request syntax with placeholder values


resp = client.get_document({
  authentication_token: "AuthenticationHeaderType",
  document_id: "ResourceIdType", # required
  include_custom_metadata: false,
})

Response structure


resp..id #=> String
resp..creator_id #=> String
resp..parent_folder_id #=> String
resp..created_timestamp #=> Time
resp..modified_timestamp #=> Time
resp...id #=> String
resp...name #=> String
resp...content_type #=> String
resp...size #=> Integer
resp...signature #=> String
resp...status #=> String, one of "INITIALIZED", "ACTIVE"
resp...created_timestamp #=> Time
resp...modified_timestamp #=> Time
resp...content_created_timestamp #=> Time
resp...content_modified_timestamp #=> Time
resp...creator_id #=> String
resp...thumbnail #=> Hash
resp...thumbnail["DocumentThumbnailType"] #=> String
resp...source #=> Hash
resp...source["DocumentSourceType"] #=> String
resp..resource_state #=> String, one of "ACTIVE", "RESTORING", "RECYCLING", "RECYCLED"
resp..labels #=> Array
resp..labels[0] #=> String
resp. #=> Hash
resp.["CustomMetadataKeyType"] #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

  • :include_custom_metadata (Boolean)

    Set this to TRUE to include custom metadata in the response.

Returns:

See Also:

#get_document_path(options = {}) ⇒ Types::GetDocumentPathResponse

Retrieves the path information (the hierarchy from the root folder) for the requested document.

By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested document and only includes the IDs of the parent folders in the path. You can limit the maximum number of levels. You can also request the names of the parent folders.

Examples:

Request syntax with placeholder values


resp = client.get_document_path({
  authentication_token: "AuthenticationHeaderType",
  document_id: "IdType", # required
  limit: 1,
  fields: "FieldNamesType",
  marker: "PageMarkerType",
})

Response structure


resp.path.components #=> Array
resp.path.components[0].id #=> String
resp.path.components[0].name #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

  • :limit (Integer)

    The maximum number of levels in the hierarchy to return.

  • :fields (String)

    A comma-separated list of values. Specify NAME to include the names of the parent folders.

  • :marker (String)

    This value is not supported.

Returns:

See Also:

#get_document_version(options = {}) ⇒ Types::GetDocumentVersionResponse

Retrieves version metadata for the specified document.

Examples:

Request syntax with placeholder values


resp = client.get_document_version({
  authentication_token: "AuthenticationHeaderType",
  document_id: "ResourceIdType", # required
  version_id: "DocumentVersionIdType", # required
  fields: "FieldNamesType",
  include_custom_metadata: false,
})

Response structure


resp..id #=> String
resp..name #=> String
resp..content_type #=> String
resp..size #=> Integer
resp..signature #=> String
resp..status #=> String, one of "INITIALIZED", "ACTIVE"
resp..created_timestamp #=> Time
resp..modified_timestamp #=> Time
resp..content_created_timestamp #=> Time
resp..content_modified_timestamp #=> Time
resp..creator_id #=> String
resp..thumbnail #=> Hash
resp..thumbnail["DocumentThumbnailType"] #=> String
resp..source #=> Hash
resp..source["DocumentSourceType"] #=> String
resp. #=> Hash
resp.["CustomMetadataKeyType"] #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

  • :version_id (required, String)

    The version ID of the document.

  • :fields (String)

    A comma-separated list of values. Specify \"SOURCE\" to include a URL for the source document.

  • :include_custom_metadata (Boolean)

    Set this to TRUE to include custom metadata in the response.

Returns:

See Also:

#get_folder(options = {}) ⇒ Types::GetFolderResponse

Retrieves the metadata of the specified folder.

Examples:

Request syntax with placeholder values


resp = client.get_folder({
  authentication_token: "AuthenticationHeaderType",
  folder_id: "ResourceIdType", # required
  include_custom_metadata: false,
})

Response structure


resp..id #=> String
resp..name #=> String
resp..creator_id #=> String
resp..parent_folder_id #=> String
resp..created_timestamp #=> Time
resp..modified_timestamp #=> Time
resp..resource_state #=> String, one of "ACTIVE", "RESTORING", "RECYCLING", "RECYCLED"
resp..signature #=> String
resp..labels #=> Array
resp..labels[0] #=> String
resp..size #=> Integer
resp..latest_version_size #=> Integer
resp. #=> Hash
resp.["CustomMetadataKeyType"] #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :folder_id (required, String)

    The ID of the folder.

  • :include_custom_metadata (Boolean)

    Set to TRUE to include custom metadata in the response.

Returns:

See Also:

#get_folder_path(options = {}) ⇒ Types::GetFolderPathResponse

Retrieves the path information (the hierarchy from the root folder) for the specified folder.

By default, Amazon WorkDocs returns a maximum of 100 levels upwards from the requested folder and only includes the IDs of the parent folders in the path. You can limit the maximum number of levels. You can also request the parent folder names.

Examples:

Request syntax with placeholder values


resp = client.get_folder_path({
  authentication_token: "AuthenticationHeaderType",
  folder_id: "IdType", # required
  limit: 1,
  fields: "FieldNamesType",
  marker: "PageMarkerType",
})

Response structure


resp.path.components #=> Array
resp.path.components[0].id #=> String
resp.path.components[0].name #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :folder_id (required, String)

    The ID of the folder.

  • :limit (Integer)

    The maximum number of levels in the hierarchy to return.

  • :fields (String)

    A comma-separated list of values. Specify \"NAME\" to include the names of the parent folders.

  • :marker (String)

    This value is not supported.

Returns:

See Also:

#get_resources(options = {}) ⇒ Types::GetResourcesResponse

Retrieves a collection of resources, including folders and documents. The only CollectionType supported is SHARED_WITH_ME.

Examples:

Request syntax with placeholder values


resp = client.get_resources({
  authentication_token: "AuthenticationHeaderType",
  user_id: "IdType",
  collection_type: "SHARED_WITH_ME", # accepts SHARED_WITH_ME
  limit: 1,
  marker: "PageMarkerType",
})

Response structure


resp.folders #=> Array
resp.folders[0].id #=> String
resp.folders[0].name #=> String
resp.folders[0].creator_id #=> String
resp.folders[0].parent_folder_id #=> String
resp.folders[0].created_timestamp #=> Time
resp.folders[0].modified_timestamp #=> Time
resp.folders[0].resource_state #=> String, one of "ACTIVE", "RESTORING", "RECYCLING", "RECYCLED"
resp.folders[0].signature #=> String
resp.folders[0].labels #=> Array
resp.folders[0].labels[0] #=> String
resp.folders[0].size #=> Integer
resp.folders[0].latest_version_size #=> Integer
resp.documents #=> Array
resp.documents[0].id #=> String
resp.documents[0].creator_id #=> String
resp.documents[0].parent_folder_id #=> String
resp.documents[0].created_timestamp #=> Time
resp.documents[0].modified_timestamp #=> Time
resp.documents[0]..id #=> String
resp.documents[0]..name #=> String
resp.documents[0]..content_type #=> String
resp.documents[0]..size #=> Integer
resp.documents[0]..signature #=> String
resp.documents[0]..status #=> String, one of "INITIALIZED", "ACTIVE"
resp.documents[0]..created_timestamp #=> Time
resp.documents[0]..modified_timestamp #=> Time
resp.documents[0]..content_created_timestamp #=> Time
resp.documents[0]..content_modified_timestamp #=> Time
resp.documents[0]..creator_id #=> String
resp.documents[0]..thumbnail #=> Hash
resp.documents[0]..thumbnail["DocumentThumbnailType"] #=> String
resp.documents[0]..source #=> Hash
resp.documents[0]..source["DocumentSourceType"] #=> String
resp.documents[0].resource_state #=> String, one of "ACTIVE", "RESTORING", "RECYCLING", "RECYCLED"
resp.documents[0].labels #=> Array
resp.documents[0].labels[0] #=> String
resp.marker #=> String

Options Hash (options):

  • :authentication_token (String)

    The Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :user_id (String)

    The user ID for the resource collection. This is a required field for accessing the API operation using IAM credentials.

  • :collection_type (String)

    The collection type.

  • :limit (Integer)

    The maximum number of resources to return.

  • :marker (String)

    The marker for the next set of results. This marker was received from a previous call.

Returns:

See Also:

#initiate_document_version_upload(options = {}) ⇒ Types::InitiateDocumentVersionUploadResponse

Creates a new document object and version object.

The client specifies the parent folder ID and name of the document to upload. The ID is optionally specified when creating a new version of an existing document. This is the first step to upload a document. Next, upload the document to the URL returned from the call, and then call UpdateDocumentVersion.

To cancel the document upload, call AbortDocumentVersionUpload.

Examples:

Request syntax with placeholder values


resp = client.initiate_document_version_upload({
  authentication_token: "AuthenticationHeaderType",
  id: "ResourceIdType",
  name: "ResourceNameType",
  content_created_timestamp: Time.now,
  content_modified_timestamp: Time.now,
  content_type: "DocumentContentType",
  document_size_in_bytes: 1,
  parent_folder_id: "ResourceIdType", # required
})

Response structure


resp..id #=> String
resp..creator_id #=> String
resp..parent_folder_id #=> String
resp..created_timestamp #=> Time
resp..modified_timestamp #=> Time
resp...id #=> String
resp...name #=> String
resp...content_type #=> String
resp...size #=> Integer
resp...signature #=> String
resp...status #=> String, one of "INITIALIZED", "ACTIVE"
resp...created_timestamp #=> Time
resp...modified_timestamp #=> Time
resp...content_created_timestamp #=> Time
resp...content_modified_timestamp #=> Time
resp...creator_id #=> String
resp...thumbnail #=> Hash
resp...thumbnail["DocumentThumbnailType"] #=> String
resp...source #=> Hash
resp...source["DocumentSourceType"] #=> String
resp..resource_state #=> String, one of "ACTIVE", "RESTORING", "RECYCLING", "RECYCLED"
resp..labels #=> Array
resp..labels[0] #=> String
resp..upload_url #=> String
resp..signed_headers #=> Hash
resp..signed_headers["HeaderNameType"] #=> String

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :id (String)

    The ID of the document.

  • :name (String)

    The name of the document.

  • :content_created_timestamp (Time)

    The timestamp when the content of the document was originally created.

  • :content_modified_timestamp (Time)

    The timestamp when the content of the document was modified.

  • :content_type (String)

    The content type of the document.

  • :document_size_in_bytes (Integer)

    The size of the document, in bytes.

  • :parent_folder_id (required, String)

    The ID of the parent folder.

Returns:

See Also:

#remove_all_resource_permissions(options = {}) ⇒ Struct

Removes all the permissions from the specified resource.

Examples:

Request syntax with placeholder values


resp = client.remove_all_resource_permissions({
  authentication_token: "AuthenticationHeaderType",
  resource_id: "ResourceIdType", # required
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :resource_id (required, String)

    The ID of the resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#remove_resource_permission(options = {}) ⇒ Struct

Removes the permission for the specified principal from the specified resource.

Examples:

Request syntax with placeholder values


resp = client.remove_resource_permission({
  authentication_token: "AuthenticationHeaderType",
  resource_id: "ResourceIdType", # required
  principal_id: "IdType", # required
  principal_type: "USER", # accepts USER, GROUP, INVITE, ANONYMOUS, ORGANIZATION
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :resource_id (required, String)

    The ID of the resource.

  • :principal_id (required, String)

    The principal ID of the resource.

  • :principal_type (String)

    The principal type of the resource.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_document(options = {}) ⇒ Struct

Updates the specified attributes of a document. The user must have access to both the document and its parent folder, if applicable.

Examples:

Request syntax with placeholder values


resp = client.update_document({
  authentication_token: "AuthenticationHeaderType",
  document_id: "ResourceIdType", # required
  name: "ResourceNameType",
  parent_folder_id: "ResourceIdType",
  resource_state: "ACTIVE", # accepts ACTIVE, RESTORING, RECYCLING, RECYCLED
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

  • :name (String)

    The name of the document.

  • :parent_folder_id (String)

    The ID of the parent folder.

  • :resource_state (String)

    The resource state of the document. Only ACTIVE and RECYCLED are supported.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_document_version(options = {}) ⇒ Struct

Changes the status of the document version to ACTIVE.

Amazon WorkDocs also sets its document container to ACTIVE. This is the last step in a document upload, after the client uploads the document to an S3-presigned URL returned by InitiateDocumentVersionUpload.

Examples:

Request syntax with placeholder values


resp = client.update_document_version({
  authentication_token: "AuthenticationHeaderType",
  document_id: "ResourceIdType", # required
  version_id: "DocumentVersionIdType", # required
  version_status: "ACTIVE", # accepts ACTIVE
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :document_id (required, String)

    The ID of the document.

  • :version_id (required, String)

    The version ID of the document.

  • :version_status (String)

    The status of the version.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_folder(options = {}) ⇒ Struct

Updates the specified attributes of the specified folder. The user must have access to both the folder and its parent folder, if applicable.

Examples:

Request syntax with placeholder values


resp = client.update_folder({
  authentication_token: "AuthenticationHeaderType",
  folder_id: "ResourceIdType", # required
  name: "ResourceNameType",
  parent_folder_id: "ResourceIdType",
  resource_state: "ACTIVE", # accepts ACTIVE, RESTORING, RECYCLING, RECYCLED
})

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :folder_id (required, String)

    The ID of the folder.

  • :name (String)

    The name of the folder.

  • :parent_folder_id (String)

    The ID of the parent folder.

  • :resource_state (String)

    The resource state of the folder. Only ACTIVE and RECYCLED are accepted values from the API.

Returns:

  • (Struct)

    Returns an empty response.

See Also:

#update_user(options = {}) ⇒ Types::UpdateUserResponse

Updates the specified attributes of the specified user, and grants or revokes administrative privileges to the Amazon WorkDocs site.

Examples:

Request syntax with placeholder values


resp = client.update_user({
  authentication_token: "AuthenticationHeaderType",
  user_id: "IdType", # required
  given_name: "UserAttributeValueType",
  surname: "UserAttributeValueType",
  type: "USER", # accepts USER, ADMIN, POWERUSER, MINIMALUSER, WORKSPACESUSER
  storage_rule: {
    storage_allocated_in_bytes: 1,
    storage_type: "UNLIMITED", # accepts UNLIMITED, QUOTA
  },
  time_zone_id: "TimeZoneIdType",
  locale: "en", # accepts en, fr, ko, de, es, ja, ru, zh_CN, zh_TW, pt_BR, default
  grant_poweruser_privileges: "TRUE", # accepts TRUE, FALSE
})

Response structure


resp.user.id #=> String
resp.user.username #=> String
resp.user.email_address #=> String
resp.user.given_name #=> String
resp.user.surname #=> String
resp.user.organization_id #=> String
resp.user.root_folder_id #=> String
resp.user.recycle_bin_folder_id #=> String
resp.user.status #=> String, one of "ACTIVE", "INACTIVE", "PENDING"
resp.user.type #=> String, one of "USER", "ADMIN", "POWERUSER", "MINIMALUSER", "WORKSPACESUSER"
resp.user.created_timestamp #=> Time
resp.user.modified_timestamp #=> Time
resp.user.time_zone_id #=> String
resp.user.locale #=> String, one of "en", "fr", "ko", "de", "es", "ja", "ru", "zh_CN", "zh_TW", "pt_BR", "default"
resp.user.storage.storage_utilized_in_bytes #=> Integer
resp.user.storage.storage_rule.storage_allocated_in_bytes #=> Integer
resp.user.storage.storage_rule.storage_type #=> String, one of "UNLIMITED", "QUOTA"

Options Hash (options):

  • :authentication_token (String)

    Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

  • :user_id (required, String)

    The ID of the user.

  • :given_name (String)

    The given name of the user.

  • :surname (String)

    The surname of the user.

  • :type (String)

    The type of the user.

  • :storage_rule (Types::StorageRuleType)

    The amount of storage for the user.

  • :time_zone_id (String)

    The time zone ID of the user.

  • :locale (String)

    The locale of the user.

  • :grant_poweruser_privileges (String)

    Boolean value to determine whether the user is granted Poweruser privileges.

Returns:

See Also:

#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean

Waiters polls an API operation until a resource enters a desired state.

Basic Usage

Waiters will poll until they are succesful, they fail by entering a terminal state, or until a maximum number of attempts are made.

# polls in a loop, sleeping between attempts client.waiter_until(waiter_name, params)

Configuration

You can configure the maximum number of polling attempts, and the delay (in seconds) between each polling attempt. You configure waiters by passing a block to #wait_until:

# poll for ~25 seconds
client.wait_until(...) do |w|
  w.max_attempts = 5
  w.delay = 5
end

Callbacks

You can be notified before each polling attempt and before each delay. If you throw :success or :failure from these callbacks, it will terminate the waiter.

started_at = Time.now
client.wait_until(...) do |w|

  # disable max attempts
  w.max_attempts = nil

  # poll for 1 hour, instead of a number of attempts
  w.before_wait do |attempts, response|
    throw :failure if Time.now - started_at > 3600
  end

end

Handling Errors

When a waiter is successful, it returns true. When a waiter fails, it raises an error. All errors raised extend from Aws::Waiters::Errors::WaiterFailed.

begin
  client.wait_until(...)
rescue Aws::Waiters::Errors::WaiterFailed
  # resource did not enter the desired state in time
end

Parameters:

  • waiter_name (Symbol)

    The name of the waiter. See #waiter_names for a full list of supported waiters.

  • params (Hash) (defaults to: {})

    Additional request parameters. See the #waiter_names for a list of supported waiters and what request they call. The called request determines the list of accepted parameters.

Yield Parameters:

Returns:

  • (Boolean)

    Returns true if the waiter was successful.

Raises:

  • (Errors::FailureStateError)

    Raised when the waiter terminates because the waiter has entered a state that it will not transition out of, preventing success.

  • (Errors::TooManyAttemptsError)

    Raised when the configured maximum number of attempts have been made, and the waiter is not yet successful.

  • (Errors::UnexpectedError)

    Raised when an error is encounted while polling for a resource that is not expected.

  • (Errors::NoSuchWaiterError)

    Raised when you request to wait for an unknown state.

#waiter_namesArray<Symbol>

Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:

Waiter NameClient MethodDefault Delay:Default Max Attempts:

Returns:

  • (Array<Symbol>)

    the list of supported waiters.