Skip to content

Commit

Permalink
feat(client-workmail): This release adds support for impersonation ro…
Browse files Browse the repository at this point in the history
…les in Amazon WorkMail.
  • Loading branch information
awstools committed Oct 4, 2022
1 parent b544ac0 commit f919ccd
Show file tree
Hide file tree
Showing 42 changed files with 3,825 additions and 519 deletions.
2 changes: 1 addition & 1 deletion clients/client-workmail/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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

<p>Amazon WorkMail is a secure, managed business email and calendaring service with support for
<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
Expand Down
333 changes: 301 additions & 32 deletions clients/client-workmail/src/WorkMail.ts

Large diffs are not rendered by default.

44 changes: 43 additions & 1 deletion clients/client-workmail/src/WorkMailClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ import {
AssociateMemberToGroupCommandInput,
AssociateMemberToGroupCommandOutput,
} from "./commands/AssociateMemberToGroupCommand";
import {
AssumeImpersonationRoleCommandInput,
AssumeImpersonationRoleCommandOutput,
} from "./commands/AssumeImpersonationRoleCommand";
import {
CancelMailboxExportJobCommandInput,
CancelMailboxExportJobCommandOutput,
Expand All @@ -71,6 +75,10 @@ import {
CreateAvailabilityConfigurationCommandOutput,
} from "./commands/CreateAvailabilityConfigurationCommand";
import { CreateGroupCommandInput, CreateGroupCommandOutput } from "./commands/CreateGroupCommand";
import {
CreateImpersonationRoleCommandInput,
CreateImpersonationRoleCommandOutput,
} from "./commands/CreateImpersonationRoleCommand";
import {
CreateMobileDeviceAccessRuleCommandInput,
CreateMobileDeviceAccessRuleCommandOutput,
Expand All @@ -92,6 +100,10 @@ import {
DeleteEmailMonitoringConfigurationCommandOutput,
} from "./commands/DeleteEmailMonitoringConfigurationCommand";
import { DeleteGroupCommandInput, DeleteGroupCommandOutput } from "./commands/DeleteGroupCommand";
import {
DeleteImpersonationRoleCommandInput,
DeleteImpersonationRoleCommandOutput,
} from "./commands/DeleteImpersonationRoleCommand";
import {
DeleteMailboxPermissionsCommandInput,
DeleteMailboxPermissionsCommandOutput,
Expand Down Expand Up @@ -154,6 +166,14 @@ import {
GetDefaultRetentionPolicyCommandInput,
GetDefaultRetentionPolicyCommandOutput,
} from "./commands/GetDefaultRetentionPolicyCommand";
import {
GetImpersonationRoleCommandInput,
GetImpersonationRoleCommandOutput,
} from "./commands/GetImpersonationRoleCommand";
import {
GetImpersonationRoleEffectCommandInput,
GetImpersonationRoleEffectCommandOutput,
} from "./commands/GetImpersonationRoleEffectCommand";
import { GetMailboxDetailsCommandInput, GetMailboxDetailsCommandOutput } from "./commands/GetMailboxDetailsCommand";
import { GetMailDomainCommandInput, GetMailDomainCommandOutput } from "./commands/GetMailDomainCommand";
import {
Expand All @@ -175,6 +195,10 @@ import {
} from "./commands/ListAvailabilityConfigurationsCommand";
import { ListGroupMembersCommandInput, ListGroupMembersCommandOutput } from "./commands/ListGroupMembersCommand";
import { ListGroupsCommandInput, ListGroupsCommandOutput } from "./commands/ListGroupsCommand";
import {
ListImpersonationRolesCommandInput,
ListImpersonationRolesCommandOutput,
} from "./commands/ListImpersonationRolesCommand";
import {
ListMailboxExportJobsCommandInput,
ListMailboxExportJobsCommandOutput,
Expand Down Expand Up @@ -245,6 +269,10 @@ import {
UpdateDefaultMailDomainCommandInput,
UpdateDefaultMailDomainCommandOutput,
} from "./commands/UpdateDefaultMailDomainCommand";
import {
UpdateImpersonationRoleCommandInput,
UpdateImpersonationRoleCommandOutput,
} from "./commands/UpdateImpersonationRoleCommand";
import { UpdateMailboxQuotaCommandInput, UpdateMailboxQuotaCommandOutput } from "./commands/UpdateMailboxQuotaCommand";
import {
UpdateMobileDeviceAccessRuleCommandInput,
Expand All @@ -260,10 +288,12 @@ import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig";
export type ServiceInputTypes =
| AssociateDelegateToResourceCommandInput
| AssociateMemberToGroupCommandInput
| AssumeImpersonationRoleCommandInput
| CancelMailboxExportJobCommandInput
| CreateAliasCommandInput
| CreateAvailabilityConfigurationCommandInput
| CreateGroupCommandInput
| CreateImpersonationRoleCommandInput
| CreateMobileDeviceAccessRuleCommandInput
| CreateOrganizationCommandInput
| CreateResourceCommandInput
Expand All @@ -273,6 +303,7 @@ export type ServiceInputTypes =
| DeleteAvailabilityConfigurationCommandInput
| DeleteEmailMonitoringConfigurationCommandInput
| DeleteGroupCommandInput
| DeleteImpersonationRoleCommandInput
| DeleteMailboxPermissionsCommandInput
| DeleteMobileDeviceAccessOverrideCommandInput
| DeleteMobileDeviceAccessRuleCommandInput
Expand All @@ -293,6 +324,8 @@ export type ServiceInputTypes =
| DisassociateMemberFromGroupCommandInput
| GetAccessControlEffectCommandInput
| GetDefaultRetentionPolicyCommandInput
| GetImpersonationRoleCommandInput
| GetImpersonationRoleEffectCommandInput
| GetMailDomainCommandInput
| GetMailboxDetailsCommandInput
| GetMobileDeviceAccessEffectCommandInput
Expand All @@ -302,6 +335,7 @@ export type ServiceInputTypes =
| ListAvailabilityConfigurationsCommandInput
| ListGroupMembersCommandInput
| ListGroupsCommandInput
| ListImpersonationRolesCommandInput
| ListMailDomainsCommandInput
| ListMailboxExportJobsCommandInput
| ListMailboxPermissionsCommandInput
Expand All @@ -327,6 +361,7 @@ export type ServiceInputTypes =
| UntagResourceCommandInput
| UpdateAvailabilityConfigurationCommandInput
| UpdateDefaultMailDomainCommandInput
| UpdateImpersonationRoleCommandInput
| UpdateMailboxQuotaCommandInput
| UpdateMobileDeviceAccessRuleCommandInput
| UpdatePrimaryEmailAddressCommandInput
Expand All @@ -335,10 +370,12 @@ export type ServiceInputTypes =
export type ServiceOutputTypes =
| AssociateDelegateToResourceCommandOutput
| AssociateMemberToGroupCommandOutput
| AssumeImpersonationRoleCommandOutput
| CancelMailboxExportJobCommandOutput
| CreateAliasCommandOutput
| CreateAvailabilityConfigurationCommandOutput
| CreateGroupCommandOutput
| CreateImpersonationRoleCommandOutput
| CreateMobileDeviceAccessRuleCommandOutput
| CreateOrganizationCommandOutput
| CreateResourceCommandOutput
Expand All @@ -348,6 +385,7 @@ export type ServiceOutputTypes =
| DeleteAvailabilityConfigurationCommandOutput
| DeleteEmailMonitoringConfigurationCommandOutput
| DeleteGroupCommandOutput
| DeleteImpersonationRoleCommandOutput
| DeleteMailboxPermissionsCommandOutput
| DeleteMobileDeviceAccessOverrideCommandOutput
| DeleteMobileDeviceAccessRuleCommandOutput
Expand All @@ -368,6 +406,8 @@ export type ServiceOutputTypes =
| DisassociateMemberFromGroupCommandOutput
| GetAccessControlEffectCommandOutput
| GetDefaultRetentionPolicyCommandOutput
| GetImpersonationRoleCommandOutput
| GetImpersonationRoleEffectCommandOutput
| GetMailDomainCommandOutput
| GetMailboxDetailsCommandOutput
| GetMobileDeviceAccessEffectCommandOutput
Expand All @@ -377,6 +417,7 @@ export type ServiceOutputTypes =
| ListAvailabilityConfigurationsCommandOutput
| ListGroupMembersCommandOutput
| ListGroupsCommandOutput
| ListImpersonationRolesCommandOutput
| ListMailDomainsCommandOutput
| ListMailboxExportJobsCommandOutput
| ListMailboxPermissionsCommandOutput
Expand All @@ -402,6 +443,7 @@ export type ServiceOutputTypes =
| UntagResourceCommandOutput
| UpdateAvailabilityConfigurationCommandOutput
| UpdateDefaultMailDomainCommandOutput
| UpdateImpersonationRoleCommandOutput
| UpdateMailboxQuotaCommandOutput
| UpdateMobileDeviceAccessRuleCommandOutput
| UpdatePrimaryEmailAddressCommandOutput
Expand Down Expand Up @@ -561,7 +603,7 @@ type WorkMailClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHand
export interface WorkMailClientResolvedConfig extends WorkMailClientResolvedConfigType {}

/**
* <p>Amazon WorkMail is a secure, managed business email and calendaring service with support for
* <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
Expand Down
102 changes: 102 additions & 0 deletions clients/client-workmail/src/commands/AssumeImpersonationRoleCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
// smithy-typescript generated code
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";

import {
AssumeImpersonationRoleRequest,
AssumeImpersonationRoleRequestFilterSensitiveLog,
AssumeImpersonationRoleResponse,
AssumeImpersonationRoleResponseFilterSensitiveLog,
} from "../models/models_0";
import {
deserializeAws_json1_1AssumeImpersonationRoleCommand,
serializeAws_json1_1AssumeImpersonationRoleCommand,
} from "../protocols/Aws_json1_1";
import { ServiceInputTypes, ServiceOutputTypes, WorkMailClientResolvedConfig } from "../WorkMailClient";

export interface AssumeImpersonationRoleCommandInput extends AssumeImpersonationRoleRequest {}
export interface AssumeImpersonationRoleCommandOutput extends AssumeImpersonationRoleResponse, __MetadataBearer {}

/**
* <p>Assumes an impersonation role for the given WorkMail organization. This method returns an
* authentication token you can use to make impersonated calls.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { WorkMailClient, AssumeImpersonationRoleCommand } from "@aws-sdk/client-workmail"; // ES Modules import
* // const { WorkMailClient, AssumeImpersonationRoleCommand } = require("@aws-sdk/client-workmail"); // CommonJS import
* const client = new WorkMailClient(config);
* const command = new AssumeImpersonationRoleCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link AssumeImpersonationRoleCommandInput} for command's `input` shape.
* @see {@link AssumeImpersonationRoleCommandOutput} for command's `response` shape.
* @see {@link WorkMailClientResolvedConfig | config} for WorkMailClient's `config` shape.
*
*/
export class AssumeImpersonationRoleCommand extends $Command<
AssumeImpersonationRoleCommandInput,
AssumeImpersonationRoleCommandOutput,
WorkMailClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

constructor(readonly input: AssumeImpersonationRoleCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: WorkMailClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<AssumeImpersonationRoleCommandInput, AssumeImpersonationRoleCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));

const stack = clientStack.concat(this.middlewareStack);

const { logger } = configuration;
const clientName = "WorkMailClient";
const commandName = "AssumeImpersonationRoleCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: AssumeImpersonationRoleRequestFilterSensitiveLog,
outputFilterSensitiveLog: AssumeImpersonationRoleResponseFilterSensitiveLog,
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

private serialize(input: AssumeImpersonationRoleCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_json1_1AssumeImpersonationRoleCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<AssumeImpersonationRoleCommandOutput> {
return deserializeAws_json1_1AssumeImpersonationRoleCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
2 changes: 1 addition & 1 deletion clients/client-workmail/src/commands/CreateAliasCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface CreateAliasCommandInput extends CreateAliasRequest {}
export interface CreateAliasCommandOutput extends CreateAliasResponse, __MetadataBearer {}

/**
* <p>Adds an alias to the set of a given member (user or group) of Amazon WorkMail.</p>
* <p>Adds an alias to the set of a given member (user or group) of WorkMail.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
2 changes: 1 addition & 1 deletion clients/client-workmail/src/commands/CreateGroupCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface CreateGroupCommandInput extends CreateGroupRequest {}
export interface CreateGroupCommandOutput extends CreateGroupResponse, __MetadataBearer {}

/**
* <p>Creates a group that can be used in Amazon WorkMail by calling the <a>RegisterToWorkMail</a> operation.</p>
* <p>Creates a group that can be used in WorkMail by calling the <a>RegisterToWorkMail</a> operation.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Loading

0 comments on commit f919ccd

Please sign in to comment.