Back to Aws Sdk Js V3

@aws-sdk/client-workmail

clients/client-workmail/README.md

3.1043.050.8 KB
Original Source
<!-- generated file, do not edit directly -->

@aws-sdk/client-workmail

Description

AWS SDK for JavaScript WorkMail Client for Node.js, Browser and React Native.

<p>WorkMail is a secure, managed business email and calendaring service with support for existing desktop and mobile email clients. You can access your email, contacts, and calendars using Microsoft Outlook, your browser, or other native iOS and Android email applications. You can integrate WorkMail with your existing corporate directory and control both the keys that encrypt your data and the location in which your data is stored.</p> <p>The WorkMail API is designed for the following scenarios:</p> <ul> <li> <p>Listing and describing organizations</p> </li> </ul> <ul> <li> <p>Managing users</p> </li> </ul> <ul> <li> <p>Managing groups</p> </li> </ul> <ul> <li> <p>Managing resources</p> </li> </ul> <p>All WorkMail API operations are Amazon-authenticated and certificate-signed. They not only require the use of the AWS SDK, but also allow for the exclusive use of AWS Identity and Access Management users and roles to help facilitate access, trust, and permission policies. By creating a role and allowing an IAM user to access the WorkMail site, the IAM user gains full administrative visibility into the entire WorkMail organization (or as set in the IAM policy). This includes, but is not limited to, the ability to create, update, and delete users, groups, and resources. This allows developers to perform the scenarios listed above, as well as give users the ability to grant access on a selective basis using the IAM model.</p>

Installing

To install this package, use the CLI of your favorite package manager:

  • npm install @aws-sdk/client-workmail
  • yarn add @aws-sdk/client-workmail
  • pnpm add @aws-sdk/client-workmail

Getting Started

Import

The AWS SDK is modulized by clients and commands. To send a request, you only need to import the WorkMailClient and the commands you need, for example ListGroupsCommand:

js
// ES5 example
const { WorkMailClient, ListGroupsCommand } = require("@aws-sdk/client-workmail");
ts
// ES6+ example
import { WorkMailClient, ListGroupsCommand } from "@aws-sdk/client-workmail";

Usage

To send a request:

  • Instantiate a client with configuration (e.g. credentials, region).
  • Instantiate a command with input parameters.
  • Call the send operation on the client, providing the command object as input.
js
const client = new WorkMailClient({ region: "REGION" });

const params = { /** input parameters */ };
const command = new ListGroupsCommand(params);

Async/await

We recommend using the await operator to wait for the promise returned by send operation as follows:

js
// async/await.
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  // error handling.
} finally {
  // finally.
}

Promises

You can also use Promise chaining.

js
client
  .send(command)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  })
  .finally(() => {
    // finally.
  });

Aggregated client

The aggregated client class is exported from the same package, but without the "Client" suffix.

WorkMail extends WorkMailClient and additionally supports all operations, waiters, and paginators as methods. This style may be familiar to you from the AWS SDK for JavaScript v2.

If you are bundling the AWS SDK, we recommend using only the bare-bones client (WorkMailClient). More details are in the blog post on modular packages in AWS SDK for JavaScript.

ts
import { WorkMail } from "@aws-sdk/client-workmail";

const client = new WorkMail({ region: "REGION" });

// async/await.
try {
  const data = await client.listGroups(params);
  // process data.
} catch (error) {
  // error handling.
}

// Promises.
client
  .listGroups(params)
  .then((data) => {
    // process data.
  })
  .catch((error) => {
    // error handling.
  });

// callbacks (not recommended).
client.listGroups(params, (err, data) => {
  // process err and data.
});

Troubleshooting

When the service returns an exception, the error will include the exception information, as well as response metadata (e.g. request id).

js
try {
  const data = await client.send(command);
  // process data.
} catch (error) {
  const { requestId, cfId, extendedRequestId } = error.$metadata;
  console.log({ requestId, cfId, extendedRequestId });
  /**
   * The keys within exceptions are also parsed.
   * You can access them by specifying exception names:
   * if (error.name === 'SomeServiceException') {
   *     const value = error.specialKeyInException;
   * }
   */
}

See also docs/ERROR_HANDLING.

Getting Help

Please use these community resources for getting help. We use GitHub issues for tracking bugs and feature requests, but have limited bandwidth to address them.

To test your universal JavaScript code in Node.js, browser and react-native environments, visit our code samples repo.

Contributing

This client code is generated automatically. Any modifications will be overwritten the next time the @aws-sdk/client-workmail package is updated. To contribute to client you can check our generate clients scripts.

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

Client Commands (Operations List)

<details> <summary> AssociateDelegateToResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> AssociateMemberToGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> AssumeImpersonationRole </summary>

Command API Reference / Input / Output

</details> <details> <summary> CancelMailboxExportJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateAlias </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateAvailabilityConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateIdentityCenterApplication </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateImpersonationRole </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateMobileDeviceAccessRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateOrganization </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> CreateUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteAccessControlRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteAlias </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteAvailabilityConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteEmailMonitoringConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteIdentityCenterApplication </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteIdentityProviderConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteImpersonationRole </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteMailboxPermissions </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteMobileDeviceAccessOverride </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteMobileDeviceAccessRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteOrganization </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeletePersonalAccessToken </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteRetentionPolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeleteUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeregisterFromWorkMail </summary>

Command API Reference / Input / Output

</details> <details> <summary> DeregisterMailDomain </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeEmailMonitoringConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeEntity </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeIdentityProviderConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeInboundDmarcSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeMailboxExportJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeOrganization </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> DescribeUser </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociateDelegateFromResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> DisassociateMemberFromGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetAccessControlEffect </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetDefaultRetentionPolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetImpersonationRole </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetImpersonationRoleEffect </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetMailboxDetails </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetMailDomain </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetMobileDeviceAccessEffect </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetMobileDeviceAccessOverride </summary>

Command API Reference / Input / Output

</details> <details> <summary> GetPersonalAccessTokenMetadata </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAccessControlRules </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAliases </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListAvailabilityConfigurations </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListGroupMembers </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListGroups </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListGroupsForEntity </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListImpersonationRoles </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListMailboxExportJobs </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListMailboxPermissions </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListMailDomains </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListMobileDeviceAccessOverrides </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListMobileDeviceAccessRules </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListOrganizations </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListPersonalAccessTokens </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListResourceDelegates </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListResources </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListTagsForResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> ListUsers </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutAccessControlRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutEmailMonitoringConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutIdentityProviderConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutInboundDmarcSettings </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutMailboxPermissions </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutMobileDeviceAccessOverride </summary>

Command API Reference / Input / Output

</details> <details> <summary> PutRetentionPolicy </summary>

Command API Reference / Input / Output

</details> <details> <summary> RegisterMailDomain </summary>

Command API Reference / Input / Output

</details> <details> <summary> RegisterToWorkMail </summary>

Command API Reference / Input / Output

</details> <details> <summary> ResetPassword </summary>

Command API Reference / Input / Output

</details> <details> <summary> StartMailboxExportJob </summary>

Command API Reference / Input / Output

</details> <details> <summary> TagResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> TestAvailabilityConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> UntagResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateAvailabilityConfiguration </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateDefaultMailDomain </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateGroup </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateImpersonationRole </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateMailboxQuota </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateMobileDeviceAccessRule </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdatePrimaryEmailAddress </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateResource </summary>

Command API Reference / Input / Output

</details> <details> <summary> UpdateUser </summary>

Command API Reference / Input / Output

</details>