You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.
Class: Aws::WorkMail::Client
- Inherits:
-
Seahorse::Client::Base
- Object
- Seahorse::Client::Base
- Aws::WorkMail::Client
- Defined in:
- (unknown)
Overview
An API client for Amazon WorkMail. To construct a client, you need to configure a :region
and :credentials
.
workmail = Aws::WorkMail::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']
andENV['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::WorkMail::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.
Attribute Summary collapse
Instance Attribute Summary
Attributes inherited from Seahorse::Client::Base
Constructor collapse
-
#initialize(options = {}) ⇒ Aws::WorkMail::Client
constructor
Constructs an API client.
API Operations collapse
-
#associate_delegate_to_resource(options = {}) ⇒ Struct
Adds a member (user or group) to the resource's set of delegates.
.
-
#associate_member_to_group(options = {}) ⇒ Struct
Adds a member (user or group) to the group's set.
.
-
#cancel_mailbox_export_job(options = {}) ⇒ Struct
Cancels a mailbox export job.
If the mailbox export job is near completion, it might not be possible to cancel it.
-
#create_alias(options = {}) ⇒ Struct
Adds an alias to the set of a given member (user or group) of Amazon WorkMail.
.
-
#create_group(options = {}) ⇒ Types::CreateGroupResponse
Creates a group that can be used in Amazon WorkMail by calling the RegisterToWorkMail operation.
.
-
#create_organization(options = {}) ⇒ Types::CreateOrganizationResponse
Creates a new Amazon WorkMail organization.
-
#create_resource(options = {}) ⇒ Types::CreateResourceResponse
Creates a new Amazon WorkMail resource.
-
#create_user(options = {}) ⇒ Types::CreateUserResponse
Creates a user who can be used in Amazon WorkMail by calling the RegisterToWorkMail operation.
.
-
#delete_access_control_rule(options = {}) ⇒ Struct
Deletes an access control rule for the specified WorkMail organization.
.
-
#delete_alias(options = {}) ⇒ Struct
Remove one or more specified aliases from a set of aliases for a given user.
.
-
#delete_group(options = {}) ⇒ Struct
Deletes a group from Amazon WorkMail.
.
-
#delete_mailbox_permissions(options = {}) ⇒ Struct
Deletes permissions granted to a member (user or group).
.
-
#delete_organization(options = {}) ⇒ Types::DeleteOrganizationResponse
Deletes an Amazon WorkMail organization and all underlying AWS resources managed by Amazon WorkMail as part of the organization.
-
#delete_resource(options = {}) ⇒ Struct
Deletes the specified resource.
-
#delete_retention_policy(options = {}) ⇒ Struct
Deletes the specified retention policy from the specified organization.
.
-
#delete_user(options = {}) ⇒ Struct
Deletes a user from Amazon WorkMail and all subsequent systems.
-
#deregister_from_work_mail(options = {}) ⇒ Struct
Mark a user, group, or resource as no longer used in Amazon WorkMail.
-
#describe_group(options = {}) ⇒ Types::DescribeGroupResponse
Returns the data available for the group.
.
-
#describe_mailbox_export_job(options = {}) ⇒ Types::DescribeMailboxExportJobResponse
Describes the current status of a mailbox export job.
.
-
#describe_organization(options = {}) ⇒ Types::DescribeOrganizationResponse
Provides more information regarding a given organization based on its identifier.
.
-
#describe_resource(options = {}) ⇒ Types::DescribeResourceResponse
Returns the data available for the resource.
.
-
#describe_user(options = {}) ⇒ Types::DescribeUserResponse
Provides information regarding the user.
.
-
#disassociate_delegate_from_resource(options = {}) ⇒ Struct
Removes a member from the resource's set of delegates.
.
-
#disassociate_member_from_group(options = {}) ⇒ Struct
Removes a member from a group.
.
-
#get_access_control_effect(options = {}) ⇒ Types::GetAccessControlEffectResponse
Gets the effects of an organization's access control rules as they apply to a specified IPv4 address, access protocol action, or user ID.
-
#get_default_retention_policy(options = {}) ⇒ Types::GetDefaultRetentionPolicyResponse
Gets the default retention policy details for the specified organization.
.
-
#get_mailbox_details(options = {}) ⇒ Types::GetMailboxDetailsResponse
Requests a user's mailbox details for a specified organization and user.
.
-
#list_access_control_rules(options = {}) ⇒ Types::ListAccessControlRulesResponse
Lists the access control rules for the specified organization.
.
-
#list_aliases(options = {}) ⇒ Types::ListAliasesResponse
Creates a paginated call to list the aliases associated with a given entity.
.
-
#list_group_members(options = {}) ⇒ Types::ListGroupMembersResponse
Returns an overview of the members of a group.
-
#list_groups(options = {}) ⇒ Types::ListGroupsResponse
Returns summaries of the organization's groups.
.
-
#list_mailbox_export_jobs(options = {}) ⇒ Types::ListMailboxExportJobsResponse
Lists the mailbox export jobs started for the specified organization within the last seven days.
.
-
#list_mailbox_permissions(options = {}) ⇒ Types::ListMailboxPermissionsResponse
Lists the mailbox permissions associated with a user, group, or resource mailbox.
.
-
#list_organizations(options = {}) ⇒ Types::ListOrganizationsResponse
Returns summaries of the customer's organizations.
.
-
#list_resource_delegates(options = {}) ⇒ Types::ListResourceDelegatesResponse
Lists the delegates associated with a resource.
-
#list_resources(options = {}) ⇒ Types::ListResourcesResponse
Returns summaries of the organization's resources.
.
-
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags applied to an Amazon WorkMail organization resource.
.
-
#list_users(options = {}) ⇒ Types::ListUsersResponse
Returns summaries of the organization's users.
.
-
#put_access_control_rule(options = {}) ⇒ Struct
Adds a new access control rule for the specified organization.
-
#put_mailbox_permissions(options = {}) ⇒ Struct
Sets permissions for a user, group, or resource.
-
#put_retention_policy(options = {}) ⇒ Struct
Puts a retention policy to the specified organization.
.
-
#register_to_work_mail(options = {}) ⇒ Struct
Registers an existing and disabled user, group, or resource for Amazon WorkMail use by associating a mailbox and calendaring capabilities.
-
#reset_password(options = {}) ⇒ Struct
Allows the administrator to reset the password for a user.
.
-
#start_mailbox_export_job(options = {}) ⇒ Types::StartMailboxExportJobResponse
Starts a mailbox export job to export MIME-format email messages and calendar items from the specified mailbox to the specified Amazon Simple Storage Service (Amazon S3) bucket.
-
#tag_resource(options = {}) ⇒ Struct
Applies the specified tags to the specified Amazon WorkMail organization resource.
.
-
#untag_resource(options = {}) ⇒ Struct
Untags the specified tags from the specified Amazon WorkMail organization resource.
.
-
#update_mailbox_quota(options = {}) ⇒ Struct
Updates a user's current mailbox quota for a specified organization and user.
.
-
#update_primary_email_address(options = {}) ⇒ Struct
Updates the primary email for a user, group, or resource.
-
#update_resource(options = {}) ⇒ Struct
Updates data for the resource.
Instance Method Summary collapse
-
#wait_until(waiter_name, params = {}) {|waiter| ... } ⇒ Boolean
Waiters polls an API operation until a resource enters a desired state.
-
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters.
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::WorkMail::Client
Constructs an API client.
Instance Method Details
#associate_delegate_to_resource(options = {}) ⇒ Struct
Adds a member (user or group) to the resource's set of delegates.
#associate_member_to_group(options = {}) ⇒ Struct
Adds a member (user or group) to the group's set.
#cancel_mailbox_export_job(options = {}) ⇒ Struct
Cancels a mailbox export job.
If the mailbox export job is near completion, it might not be possible to cancel it.
#create_alias(options = {}) ⇒ Struct
Adds an alias to the set of a given member (user or group) of Amazon WorkMail.
#create_group(options = {}) ⇒ Types::CreateGroupResponse
Creates a group that can be used in Amazon WorkMail by calling the RegisterToWorkMail operation.
#create_organization(options = {}) ⇒ Types::CreateOrganizationResponse
Creates a new Amazon WorkMail organization. Optionally, you can choose to associate an existing AWS Directory Service directory with your organization. If an AWS Directory Service directory ID is specified, the organization alias must match the directory alias. If you choose not to associate an existing directory with your organization, then we create a new Amazon WorkMail directory for you. For more information, see Adding an organization in the Amazon WorkMail Administrator Guide.
You can associate multiple email domains with an organization, then set your default email domain from the Amazon WorkMail console. You can also associate a domain that is managed in an Amazon Route 53 public hosted zone. For more information, see Adding a domain and Choosing the default domain in the Amazon WorkMail Administrator Guide.
Optionally, you can use a customer managed master key from AWS Key Management Service (AWS KMS) to encrypt email for your organization. If you don't associate an AWS KMS key, Amazon WorkMail creates a default AWS managed master key for you.
#create_resource(options = {}) ⇒ Types::CreateResourceResponse
Creates a new Amazon WorkMail resource.
#create_user(options = {}) ⇒ Types::CreateUserResponse
Creates a user who can be used in Amazon WorkMail by calling the RegisterToWorkMail operation.
#delete_access_control_rule(options = {}) ⇒ Struct
Deletes an access control rule for the specified WorkMail organization.
#delete_alias(options = {}) ⇒ Struct
Remove one or more specified aliases from a set of aliases for a given user.
#delete_group(options = {}) ⇒ Struct
Deletes a group from Amazon WorkMail.
#delete_mailbox_permissions(options = {}) ⇒ Struct
Deletes permissions granted to a member (user or group).
#delete_organization(options = {}) ⇒ Types::DeleteOrganizationResponse
Deletes an Amazon WorkMail organization and all underlying AWS resources managed by Amazon WorkMail as part of the organization. You can choose whether to delete the associated directory. For more information, see Removing an organization in the Amazon WorkMail Administrator Guide.
#delete_resource(options = {}) ⇒ Struct
Deletes the specified resource.
#delete_retention_policy(options = {}) ⇒ Struct
Deletes the specified retention policy from the specified organization.
#delete_user(options = {}) ⇒ Struct
Deletes a user from Amazon WorkMail and all subsequent systems. Before you can delete a user, the user state must be DISABLED
. Use the DescribeUser action to confirm the user state.
Deleting a user is permanent and cannot be undone. WorkMail archives user mailboxes for 30 days before they are permanently removed.
#deregister_from_work_mail(options = {}) ⇒ Struct
Mark a user, group, or resource as no longer used in Amazon WorkMail. This action disassociates the mailbox and schedules it for clean-up. WorkMail keeps mailboxes for 30 days before they are permanently removed. The functionality in the console is Disable.
#describe_group(options = {}) ⇒ Types::DescribeGroupResponse
Returns the data available for the group.
#describe_mailbox_export_job(options = {}) ⇒ Types::DescribeMailboxExportJobResponse
Describes the current status of a mailbox export job.
#describe_organization(options = {}) ⇒ Types::DescribeOrganizationResponse
Provides more information regarding a given organization based on its identifier.
#describe_resource(options = {}) ⇒ Types::DescribeResourceResponse
Returns the data available for the resource.
#describe_user(options = {}) ⇒ Types::DescribeUserResponse
Provides information regarding the user.
#disassociate_delegate_from_resource(options = {}) ⇒ Struct
Removes a member from the resource's set of delegates.
#disassociate_member_from_group(options = {}) ⇒ Struct
Removes a member from a group.
#get_access_control_effect(options = {}) ⇒ Types::GetAccessControlEffectResponse
Gets the effects of an organization's access control rules as they apply to a specified IPv4 address, access protocol action, or user ID.
#get_default_retention_policy(options = {}) ⇒ Types::GetDefaultRetentionPolicyResponse
Gets the default retention policy details for the specified organization.
#get_mailbox_details(options = {}) ⇒ Types::GetMailboxDetailsResponse
Requests a user's mailbox details for a specified organization and user.
#list_access_control_rules(options = {}) ⇒ Types::ListAccessControlRulesResponse
Lists the access control rules for the specified organization.
#list_aliases(options = {}) ⇒ Types::ListAliasesResponse
Creates a paginated call to list the aliases associated with a given entity.
#list_group_members(options = {}) ⇒ Types::ListGroupMembersResponse
Returns an overview of the members of a group. Users and groups can be members of a group.
#list_groups(options = {}) ⇒ Types::ListGroupsResponse
Returns summaries of the organization's groups.
#list_mailbox_export_jobs(options = {}) ⇒ Types::ListMailboxExportJobsResponse
Lists the mailbox export jobs started for the specified organization within the last seven days.
#list_mailbox_permissions(options = {}) ⇒ Types::ListMailboxPermissionsResponse
Lists the mailbox permissions associated with a user, group, or resource mailbox.
#list_organizations(options = {}) ⇒ Types::ListOrganizationsResponse
Returns summaries of the customer's organizations.
#list_resource_delegates(options = {}) ⇒ Types::ListResourceDelegatesResponse
Lists the delegates associated with a resource. Users and groups can be resource delegates and answer requests on behalf of the resource.
#list_resources(options = {}) ⇒ Types::ListResourcesResponse
Returns summaries of the organization's resources.
#list_tags_for_resource(options = {}) ⇒ Types::ListTagsForResourceResponse
Lists the tags applied to an Amazon WorkMail organization resource.
#list_users(options = {}) ⇒ Types::ListUsersResponse
Returns summaries of the organization's users.
#put_access_control_rule(options = {}) ⇒ Struct
Adds a new access control rule for the specified organization. The rule allows or denies access to the organization for the specified IPv4 addresses, access protocol actions, and user IDs. Adding a new rule with the same name as an existing rule replaces the older rule.
#put_mailbox_permissions(options = {}) ⇒ Struct
Sets permissions for a user, group, or resource. This replaces any pre-existing permissions.
#put_retention_policy(options = {}) ⇒ Struct
Puts a retention policy to the specified organization.
#register_to_work_mail(options = {}) ⇒ Struct
Registers an existing and disabled user, group, or resource for Amazon WorkMail use by associating a mailbox and calendaring capabilities. It performs no change if the user, group, or resource is enabled and fails if the user, group, or resource is deleted. This operation results in the accumulation of costs. For more information, see Pricing. The equivalent console functionality for this operation is Enable.
Users can either be created by calling the CreateUser API operation or they can be synchronized from your directory. For more information, see DeregisterFromWorkMail.
#reset_password(options = {}) ⇒ Struct
Allows the administrator to reset the password for a user.
#start_mailbox_export_job(options = {}) ⇒ Types::StartMailboxExportJobResponse
Starts a mailbox export job to export MIME-format email messages and calendar items from the specified mailbox to the specified Amazon Simple Storage Service (Amazon S3) bucket. For more information, see Exporting mailbox content in the Amazon WorkMail Administrator Guide.
#tag_resource(options = {}) ⇒ Struct
Applies the specified tags to the specified Amazon WorkMail organization resource.
#untag_resource(options = {}) ⇒ Struct
Untags the specified tags from the specified Amazon WorkMail organization resource.
#update_mailbox_quota(options = {}) ⇒ Struct
Updates a user's current mailbox quota for a specified organization and user.
#update_primary_email_address(options = {}) ⇒ Struct
Updates the primary email for a user, group, or resource. The current email is moved into the list of aliases (or swapped between an existing alias and the current primary email), and the email provided in the input is promoted as the primary.
#update_resource(options = {}) ⇒ Struct
Updates data for the resource. To have the latest information, it must be preceded by a DescribeResource call. The dataset in the request should be the one expected when performing another DescribeResource
call.
#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
#waiter_names ⇒ Array<Symbol>
Returns the list of supported waiters. The following table lists the supported waiters and the client method they call:
Waiter Name | Client Method | Default Delay: | Default Max Attempts: |
---|