diff --git a/clients/client-workmail/src/WorkMail.ts b/clients/client-workmail/src/WorkMail.ts index 7ed8cb749961..5b4179276655 100644 --- a/clients/client-workmail/src/WorkMail.ts +++ b/clients/client-workmail/src/WorkMail.ts @@ -17,6 +17,11 @@ import { CancelMailboxExportJobCommandOutput, } from "./commands/CancelMailboxExportJobCommand"; import { CreateAliasCommand, CreateAliasCommandInput, CreateAliasCommandOutput } from "./commands/CreateAliasCommand"; +import { + CreateAvailabilityConfigurationCommand, + CreateAvailabilityConfigurationCommandInput, + CreateAvailabilityConfigurationCommandOutput, +} from "./commands/CreateAvailabilityConfigurationCommand"; import { CreateGroupCommand, CreateGroupCommandInput, CreateGroupCommandOutput } from "./commands/CreateGroupCommand"; import { CreateMobileDeviceAccessRuleCommand, @@ -40,6 +45,11 @@ import { DeleteAccessControlRuleCommandOutput, } from "./commands/DeleteAccessControlRuleCommand"; import { DeleteAliasCommand, DeleteAliasCommandInput, DeleteAliasCommandOutput } from "./commands/DeleteAliasCommand"; +import { + DeleteAvailabilityConfigurationCommand, + DeleteAvailabilityConfigurationCommandInput, + DeleteAvailabilityConfigurationCommandOutput, +} from "./commands/DeleteAvailabilityConfigurationCommand"; import { DeleteEmailMonitoringConfigurationCommand, DeleteEmailMonitoringConfigurationCommandInput, @@ -168,6 +178,11 @@ import { ListAccessControlRulesCommandOutput, } from "./commands/ListAccessControlRulesCommand"; import { ListAliasesCommand, ListAliasesCommandInput, ListAliasesCommandOutput } from "./commands/ListAliasesCommand"; +import { + ListAvailabilityConfigurationsCommand, + ListAvailabilityConfigurationsCommandInput, + ListAvailabilityConfigurationsCommandOutput, +} from "./commands/ListAvailabilityConfigurationsCommand"; import { ListGroupMembersCommand, ListGroupMembersCommandInput, @@ -271,11 +286,21 @@ import { StartMailboxExportJobCommandOutput, } from "./commands/StartMailboxExportJobCommand"; import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { + TestAvailabilityConfigurationCommand, + TestAvailabilityConfigurationCommandInput, + TestAvailabilityConfigurationCommandOutput, +} from "./commands/TestAvailabilityConfigurationCommand"; import { UntagResourceCommand, UntagResourceCommandInput, UntagResourceCommandOutput, } from "./commands/UntagResourceCommand"; +import { + UpdateAvailabilityConfigurationCommand, + UpdateAvailabilityConfigurationCommandInput, + UpdateAvailabilityConfigurationCommandOutput, +} from "./commands/UpdateAvailabilityConfigurationCommand"; import { UpdateDefaultMailDomainCommand, UpdateDefaultMailDomainCommandInput, @@ -468,6 +493,38 @@ export class WorkMail extends WorkMailClient { } } + /** + *

Creates an AvailabilityConfiguration for the given WorkMail organization and domain.

+ */ + public createAvailabilityConfiguration( + args: CreateAvailabilityConfigurationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public createAvailabilityConfiguration( + args: CreateAvailabilityConfigurationCommandInput, + cb: (err: any, data?: CreateAvailabilityConfigurationCommandOutput) => void + ): void; + public createAvailabilityConfiguration( + args: CreateAvailabilityConfigurationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateAvailabilityConfigurationCommandOutput) => void + ): void; + public createAvailabilityConfiguration( + args: CreateAvailabilityConfigurationCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: CreateAvailabilityConfigurationCommandOutput) => void), + cb?: (err: any, data?: CreateAvailabilityConfigurationCommandOutput) => void + ): Promise | void { + const command = new CreateAvailabilityConfigurationCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** *

Creates a group that can be used in Amazon WorkMail by calling the RegisterToWorkMail operation.

*/ @@ -682,6 +739,38 @@ export class WorkMail extends WorkMailClient { } } + /** + *

Deletes the AvailabilityConfiguration for the given WorkMail organization and domain.

+ */ + public deleteAvailabilityConfiguration( + args: DeleteAvailabilityConfigurationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public deleteAvailabilityConfiguration( + args: DeleteAvailabilityConfigurationCommandInput, + cb: (err: any, data?: DeleteAvailabilityConfigurationCommandOutput) => void + ): void; + public deleteAvailabilityConfiguration( + args: DeleteAvailabilityConfigurationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteAvailabilityConfigurationCommandOutput) => void + ): void; + public deleteAvailabilityConfiguration( + args: DeleteAvailabilityConfigurationCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: DeleteAvailabilityConfigurationCommandOutput) => void), + cb?: (err: any, data?: DeleteAvailabilityConfigurationCommandOutput) => void + ): Promise | void { + const command = new DeleteAvailabilityConfigurationCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** *

Deletes the email monitoring configuration for a specified organization.

*/ @@ -1575,6 +1664,38 @@ export class WorkMail extends WorkMailClient { } } + /** + *

List all the AvailabilityConfiguration's for the given WorkMail organization.

+ */ + public listAvailabilityConfigurations( + args: ListAvailabilityConfigurationsCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public listAvailabilityConfigurations( + args: ListAvailabilityConfigurationsCommandInput, + cb: (err: any, data?: ListAvailabilityConfigurationsCommandOutput) => void + ): void; + public listAvailabilityConfigurations( + args: ListAvailabilityConfigurationsCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListAvailabilityConfigurationsCommandOutput) => void + ): void; + public listAvailabilityConfigurations( + args: ListAvailabilityConfigurationsCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListAvailabilityConfigurationsCommandOutput) => void), + cb?: (err: any, data?: ListAvailabilityConfigurationsCommandOutput) => void + ): Promise | void { + const command = new ListAvailabilityConfigurationsCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** *

Returns an overview of the members of a group. Users and groups can be members of a * group.

@@ -2312,6 +2433,45 @@ export class WorkMail extends WorkMailClient { } } + /** + *

Performs a test on an availability provider to ensure that access is allowed. For EWS, it verifies the provided credentials can be used to successfully log in. For Lambda, it verifies that the Lambda function can be invoked and that the resource access + * policy was configured to deny anonymous access. An anonymous invocation is one done without providing either a SourceArn or SourceAccount header.

+ * + *

The request must contain either one provider definition (EwsProvider or + * LambdaProvider) or the DomainName parameter. If the + * DomainName parameter is provided, the configuration stored under the + * DomainName will be tested.

+ *
+ */ + public testAvailabilityConfiguration( + args: TestAvailabilityConfigurationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public testAvailabilityConfiguration( + args: TestAvailabilityConfigurationCommandInput, + cb: (err: any, data?: TestAvailabilityConfigurationCommandOutput) => void + ): void; + public testAvailabilityConfiguration( + args: TestAvailabilityConfigurationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TestAvailabilityConfigurationCommandOutput) => void + ): void; + public testAvailabilityConfiguration( + args: TestAvailabilityConfigurationCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: TestAvailabilityConfigurationCommandOutput) => void), + cb?: (err: any, data?: TestAvailabilityConfigurationCommandOutput) => void + ): Promise | void { + const command = new TestAvailabilityConfigurationCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** *

Untags the specified tags from the specified Amazon WorkMail organization * resource.

@@ -2345,6 +2505,39 @@ export class WorkMail extends WorkMailClient { } } + /** + *

Updates an existing AvailabilityConfiguration for the given WorkMail + * organization and domain.

+ */ + public updateAvailabilityConfiguration( + args: UpdateAvailabilityConfigurationCommandInput, + options?: __HttpHandlerOptions + ): Promise; + public updateAvailabilityConfiguration( + args: UpdateAvailabilityConfigurationCommandInput, + cb: (err: any, data?: UpdateAvailabilityConfigurationCommandOutput) => void + ): void; + public updateAvailabilityConfiguration( + args: UpdateAvailabilityConfigurationCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateAvailabilityConfigurationCommandOutput) => void + ): void; + public updateAvailabilityConfiguration( + args: UpdateAvailabilityConfigurationCommandInput, + optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UpdateAvailabilityConfigurationCommandOutput) => void), + cb?: (err: any, data?: UpdateAvailabilityConfigurationCommandOutput) => void + ): Promise | void { + const command = new UpdateAvailabilityConfigurationCommand(args); + if (typeof optionsOrCb === "function") { + this.send(command, optionsOrCb); + } else if (typeof cb === "function") { + if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`); + this.send(command, optionsOrCb || {}, cb); + } else { + return this.send(command, optionsOrCb); + } + } + /** *

Updates the default mail domain for an organization. The default mail domain is used by the WorkMail AWS Console to suggest an email address when enabling a mail user. You can only have one default domain.

*/ diff --git a/clients/client-workmail/src/WorkMailClient.ts b/clients/client-workmail/src/WorkMailClient.ts index d6abe3680a5f..68f419c3b6da 100644 --- a/clients/client-workmail/src/WorkMailClient.ts +++ b/clients/client-workmail/src/WorkMailClient.ts @@ -66,6 +66,10 @@ import { CancelMailboxExportJobCommandOutput, } from "./commands/CancelMailboxExportJobCommand"; import { CreateAliasCommandInput, CreateAliasCommandOutput } from "./commands/CreateAliasCommand"; +import { + CreateAvailabilityConfigurationCommandInput, + CreateAvailabilityConfigurationCommandOutput, +} from "./commands/CreateAvailabilityConfigurationCommand"; import { CreateGroupCommandInput, CreateGroupCommandOutput } from "./commands/CreateGroupCommand"; import { CreateMobileDeviceAccessRuleCommandInput, @@ -79,6 +83,10 @@ import { DeleteAccessControlRuleCommandOutput, } from "./commands/DeleteAccessControlRuleCommand"; import { DeleteAliasCommandInput, DeleteAliasCommandOutput } from "./commands/DeleteAliasCommand"; +import { + DeleteAvailabilityConfigurationCommandInput, + DeleteAvailabilityConfigurationCommandOutput, +} from "./commands/DeleteAvailabilityConfigurationCommand"; import { DeleteEmailMonitoringConfigurationCommandInput, DeleteEmailMonitoringConfigurationCommandOutput, @@ -161,6 +169,10 @@ import { ListAccessControlRulesCommandOutput, } from "./commands/ListAccessControlRulesCommand"; import { ListAliasesCommandInput, ListAliasesCommandOutput } from "./commands/ListAliasesCommand"; +import { + ListAvailabilityConfigurationsCommandInput, + ListAvailabilityConfigurationsCommandOutput, +} from "./commands/ListAvailabilityConfigurationsCommand"; import { ListGroupMembersCommandInput, ListGroupMembersCommandOutput } from "./commands/ListGroupMembersCommand"; import { ListGroupsCommandInput, ListGroupsCommandOutput } from "./commands/ListGroupsCommand"; import { @@ -220,7 +232,15 @@ import { StartMailboxExportJobCommandOutput, } from "./commands/StartMailboxExportJobCommand"; import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { + TestAvailabilityConfigurationCommandInput, + TestAvailabilityConfigurationCommandOutput, +} from "./commands/TestAvailabilityConfigurationCommand"; import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; +import { + UpdateAvailabilityConfigurationCommandInput, + UpdateAvailabilityConfigurationCommandOutput, +} from "./commands/UpdateAvailabilityConfigurationCommand"; import { UpdateDefaultMailDomainCommandInput, UpdateDefaultMailDomainCommandOutput, @@ -242,6 +262,7 @@ export type ServiceInputTypes = | AssociateMemberToGroupCommandInput | CancelMailboxExportJobCommandInput | CreateAliasCommandInput + | CreateAvailabilityConfigurationCommandInput | CreateGroupCommandInput | CreateMobileDeviceAccessRuleCommandInput | CreateOrganizationCommandInput @@ -249,6 +270,7 @@ export type ServiceInputTypes = | CreateUserCommandInput | DeleteAccessControlRuleCommandInput | DeleteAliasCommandInput + | DeleteAvailabilityConfigurationCommandInput | DeleteEmailMonitoringConfigurationCommandInput | DeleteGroupCommandInput | DeleteMailboxPermissionsCommandInput @@ -277,6 +299,7 @@ export type ServiceInputTypes = | GetMobileDeviceAccessOverrideCommandInput | ListAccessControlRulesCommandInput | ListAliasesCommandInput + | ListAvailabilityConfigurationsCommandInput | ListGroupMembersCommandInput | ListGroupsCommandInput | ListMailDomainsCommandInput @@ -300,7 +323,9 @@ export type ServiceInputTypes = | ResetPasswordCommandInput | StartMailboxExportJobCommandInput | TagResourceCommandInput + | TestAvailabilityConfigurationCommandInput | UntagResourceCommandInput + | UpdateAvailabilityConfigurationCommandInput | UpdateDefaultMailDomainCommandInput | UpdateMailboxQuotaCommandInput | UpdateMobileDeviceAccessRuleCommandInput @@ -312,6 +337,7 @@ export type ServiceOutputTypes = | AssociateMemberToGroupCommandOutput | CancelMailboxExportJobCommandOutput | CreateAliasCommandOutput + | CreateAvailabilityConfigurationCommandOutput | CreateGroupCommandOutput | CreateMobileDeviceAccessRuleCommandOutput | CreateOrganizationCommandOutput @@ -319,6 +345,7 @@ export type ServiceOutputTypes = | CreateUserCommandOutput | DeleteAccessControlRuleCommandOutput | DeleteAliasCommandOutput + | DeleteAvailabilityConfigurationCommandOutput | DeleteEmailMonitoringConfigurationCommandOutput | DeleteGroupCommandOutput | DeleteMailboxPermissionsCommandOutput @@ -347,6 +374,7 @@ export type ServiceOutputTypes = | GetMobileDeviceAccessOverrideCommandOutput | ListAccessControlRulesCommandOutput | ListAliasesCommandOutput + | ListAvailabilityConfigurationsCommandOutput | ListGroupMembersCommandOutput | ListGroupsCommandOutput | ListMailDomainsCommandOutput @@ -370,7 +398,9 @@ export type ServiceOutputTypes = | ResetPasswordCommandOutput | StartMailboxExportJobCommandOutput | TagResourceCommandOutput + | TestAvailabilityConfigurationCommandOutput | UntagResourceCommandOutput + | UpdateAvailabilityConfigurationCommandOutput | UpdateDefaultMailDomainCommandOutput | UpdateMailboxQuotaCommandOutput | UpdateMobileDeviceAccessRuleCommandOutput diff --git a/clients/client-workmail/src/commands/CreateAvailabilityConfigurationCommand.ts b/clients/client-workmail/src/commands/CreateAvailabilityConfigurationCommand.ts new file mode 100644 index 000000000000..945f141ee126 --- /dev/null +++ b/clients/client-workmail/src/commands/CreateAvailabilityConfigurationCommand.ts @@ -0,0 +1,104 @@ +// 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 { CreateAvailabilityConfigurationRequest, CreateAvailabilityConfigurationResponse } from "../models/models_0"; +import { + deserializeAws_json1_1CreateAvailabilityConfigurationCommand, + serializeAws_json1_1CreateAvailabilityConfigurationCommand, +} from "../protocols/Aws_json1_1"; +import { ServiceInputTypes, ServiceOutputTypes, WorkMailClientResolvedConfig } from "../WorkMailClient"; + +export interface CreateAvailabilityConfigurationCommandInput extends CreateAvailabilityConfigurationRequest {} +export interface CreateAvailabilityConfigurationCommandOutput + extends CreateAvailabilityConfigurationResponse, + __MetadataBearer {} + +/** + *

Creates an AvailabilityConfiguration for the given WorkMail organization and domain.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { WorkMailClient, CreateAvailabilityConfigurationCommand } from "@aws-sdk/client-workmail"; // ES Modules import + * // const { WorkMailClient, CreateAvailabilityConfigurationCommand } = require("@aws-sdk/client-workmail"); // CommonJS import + * const client = new WorkMailClient(config); + * const command = new CreateAvailabilityConfigurationCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link CreateAvailabilityConfigurationCommandInput} for command's `input` shape. + * @see {@link CreateAvailabilityConfigurationCommandOutput} for command's `response` shape. + * @see {@link WorkMailClientResolvedConfig | config} for WorkMailClient's `config` shape. + * + */ +export class CreateAvailabilityConfigurationCommand extends $Command< + CreateAvailabilityConfigurationCommandInput, + CreateAvailabilityConfigurationCommandOutput, + WorkMailClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: CreateAvailabilityConfigurationCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: WorkMailClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "WorkMailClient"; + const commandName = "CreateAvailabilityConfigurationCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: CreateAvailabilityConfigurationRequest.filterSensitiveLog, + outputFilterSensitiveLog: CreateAvailabilityConfigurationResponse.filterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: CreateAvailabilityConfigurationCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1CreateAvailabilityConfigurationCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return deserializeAws_json1_1CreateAvailabilityConfigurationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-workmail/src/commands/DeleteAvailabilityConfigurationCommand.ts b/clients/client-workmail/src/commands/DeleteAvailabilityConfigurationCommand.ts new file mode 100644 index 000000000000..e42237cc1a78 --- /dev/null +++ b/clients/client-workmail/src/commands/DeleteAvailabilityConfigurationCommand.ts @@ -0,0 +1,104 @@ +// 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 { DeleteAvailabilityConfigurationRequest, DeleteAvailabilityConfigurationResponse } from "../models/models_0"; +import { + deserializeAws_json1_1DeleteAvailabilityConfigurationCommand, + serializeAws_json1_1DeleteAvailabilityConfigurationCommand, +} from "../protocols/Aws_json1_1"; +import { ServiceInputTypes, ServiceOutputTypes, WorkMailClientResolvedConfig } from "../WorkMailClient"; + +export interface DeleteAvailabilityConfigurationCommandInput extends DeleteAvailabilityConfigurationRequest {} +export interface DeleteAvailabilityConfigurationCommandOutput + extends DeleteAvailabilityConfigurationResponse, + __MetadataBearer {} + +/** + *

Deletes the AvailabilityConfiguration for the given WorkMail organization and domain.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { WorkMailClient, DeleteAvailabilityConfigurationCommand } from "@aws-sdk/client-workmail"; // ES Modules import + * // const { WorkMailClient, DeleteAvailabilityConfigurationCommand } = require("@aws-sdk/client-workmail"); // CommonJS import + * const client = new WorkMailClient(config); + * const command = new DeleteAvailabilityConfigurationCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link DeleteAvailabilityConfigurationCommandInput} for command's `input` shape. + * @see {@link DeleteAvailabilityConfigurationCommandOutput} for command's `response` shape. + * @see {@link WorkMailClientResolvedConfig | config} for WorkMailClient's `config` shape. + * + */ +export class DeleteAvailabilityConfigurationCommand extends $Command< + DeleteAvailabilityConfigurationCommandInput, + DeleteAvailabilityConfigurationCommandOutput, + WorkMailClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: DeleteAvailabilityConfigurationCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: WorkMailClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "WorkMailClient"; + const commandName = "DeleteAvailabilityConfigurationCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: DeleteAvailabilityConfigurationRequest.filterSensitiveLog, + outputFilterSensitiveLog: DeleteAvailabilityConfigurationResponse.filterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: DeleteAvailabilityConfigurationCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1DeleteAvailabilityConfigurationCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return deserializeAws_json1_1DeleteAvailabilityConfigurationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-workmail/src/commands/ListAvailabilityConfigurationsCommand.ts b/clients/client-workmail/src/commands/ListAvailabilityConfigurationsCommand.ts new file mode 100644 index 000000000000..4262f9efc500 --- /dev/null +++ b/clients/client-workmail/src/commands/ListAvailabilityConfigurationsCommand.ts @@ -0,0 +1,104 @@ +// 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 { ListAvailabilityConfigurationsRequest, ListAvailabilityConfigurationsResponse } from "../models/models_0"; +import { + deserializeAws_json1_1ListAvailabilityConfigurationsCommand, + serializeAws_json1_1ListAvailabilityConfigurationsCommand, +} from "../protocols/Aws_json1_1"; +import { ServiceInputTypes, ServiceOutputTypes, WorkMailClientResolvedConfig } from "../WorkMailClient"; + +export interface ListAvailabilityConfigurationsCommandInput extends ListAvailabilityConfigurationsRequest {} +export interface ListAvailabilityConfigurationsCommandOutput + extends ListAvailabilityConfigurationsResponse, + __MetadataBearer {} + +/** + *

List all the AvailabilityConfiguration's for the given WorkMail organization.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { WorkMailClient, ListAvailabilityConfigurationsCommand } from "@aws-sdk/client-workmail"; // ES Modules import + * // const { WorkMailClient, ListAvailabilityConfigurationsCommand } = require("@aws-sdk/client-workmail"); // CommonJS import + * const client = new WorkMailClient(config); + * const command = new ListAvailabilityConfigurationsCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link ListAvailabilityConfigurationsCommandInput} for command's `input` shape. + * @see {@link ListAvailabilityConfigurationsCommandOutput} for command's `response` shape. + * @see {@link WorkMailClientResolvedConfig | config} for WorkMailClient's `config` shape. + * + */ +export class ListAvailabilityConfigurationsCommand extends $Command< + ListAvailabilityConfigurationsCommandInput, + ListAvailabilityConfigurationsCommandOutput, + WorkMailClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: ListAvailabilityConfigurationsCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: WorkMailClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "WorkMailClient"; + const commandName = "ListAvailabilityConfigurationsCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: ListAvailabilityConfigurationsRequest.filterSensitiveLog, + outputFilterSensitiveLog: ListAvailabilityConfigurationsResponse.filterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: ListAvailabilityConfigurationsCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1ListAvailabilityConfigurationsCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return deserializeAws_json1_1ListAvailabilityConfigurationsCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-workmail/src/commands/TestAvailabilityConfigurationCommand.ts b/clients/client-workmail/src/commands/TestAvailabilityConfigurationCommand.ts new file mode 100644 index 000000000000..8b01a7fa1ff8 --- /dev/null +++ b/clients/client-workmail/src/commands/TestAvailabilityConfigurationCommand.ts @@ -0,0 +1,108 @@ +// 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 { TestAvailabilityConfigurationRequest, TestAvailabilityConfigurationResponse } from "../models/models_0"; +import { + deserializeAws_json1_1TestAvailabilityConfigurationCommand, + serializeAws_json1_1TestAvailabilityConfigurationCommand, +} from "../protocols/Aws_json1_1"; +import { ServiceInputTypes, ServiceOutputTypes, WorkMailClientResolvedConfig } from "../WorkMailClient"; + +export interface TestAvailabilityConfigurationCommandInput extends TestAvailabilityConfigurationRequest {} +export interface TestAvailabilityConfigurationCommandOutput + extends TestAvailabilityConfigurationResponse, + __MetadataBearer {} + +/** + *

Performs a test on an availability provider to ensure that access is allowed. For EWS, it verifies the provided credentials can be used to successfully log in. For Lambda, it verifies that the Lambda function can be invoked and that the resource access + * policy was configured to deny anonymous access. An anonymous invocation is one done without providing either a SourceArn or SourceAccount header.

+ * + *

The request must contain either one provider definition (EwsProvider or + * LambdaProvider) or the DomainName parameter. If the + * DomainName parameter is provided, the configuration stored under the + * DomainName will be tested.

+ *
+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { WorkMailClient, TestAvailabilityConfigurationCommand } from "@aws-sdk/client-workmail"; // ES Modules import + * // const { WorkMailClient, TestAvailabilityConfigurationCommand } = require("@aws-sdk/client-workmail"); // CommonJS import + * const client = new WorkMailClient(config); + * const command = new TestAvailabilityConfigurationCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link TestAvailabilityConfigurationCommandInput} for command's `input` shape. + * @see {@link TestAvailabilityConfigurationCommandOutput} for command's `response` shape. + * @see {@link WorkMailClientResolvedConfig | config} for WorkMailClient's `config` shape. + * + */ +export class TestAvailabilityConfigurationCommand extends $Command< + TestAvailabilityConfigurationCommandInput, + TestAvailabilityConfigurationCommandOutput, + WorkMailClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: TestAvailabilityConfigurationCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: WorkMailClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "WorkMailClient"; + const commandName = "TestAvailabilityConfigurationCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: TestAvailabilityConfigurationRequest.filterSensitiveLog, + outputFilterSensitiveLog: TestAvailabilityConfigurationResponse.filterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize(input: TestAvailabilityConfigurationCommandInput, context: __SerdeContext): Promise<__HttpRequest> { + return serializeAws_json1_1TestAvailabilityConfigurationCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return deserializeAws_json1_1TestAvailabilityConfigurationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-workmail/src/commands/UpdateAvailabilityConfigurationCommand.ts b/clients/client-workmail/src/commands/UpdateAvailabilityConfigurationCommand.ts new file mode 100644 index 000000000000..93fd6e36faed --- /dev/null +++ b/clients/client-workmail/src/commands/UpdateAvailabilityConfigurationCommand.ts @@ -0,0 +1,105 @@ +// 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 { UpdateAvailabilityConfigurationRequest, UpdateAvailabilityConfigurationResponse } from "../models/models_0"; +import { + deserializeAws_json1_1UpdateAvailabilityConfigurationCommand, + serializeAws_json1_1UpdateAvailabilityConfigurationCommand, +} from "../protocols/Aws_json1_1"; +import { ServiceInputTypes, ServiceOutputTypes, WorkMailClientResolvedConfig } from "../WorkMailClient"; + +export interface UpdateAvailabilityConfigurationCommandInput extends UpdateAvailabilityConfigurationRequest {} +export interface UpdateAvailabilityConfigurationCommandOutput + extends UpdateAvailabilityConfigurationResponse, + __MetadataBearer {} + +/** + *

Updates an existing AvailabilityConfiguration for the given WorkMail + * organization and domain.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { WorkMailClient, UpdateAvailabilityConfigurationCommand } from "@aws-sdk/client-workmail"; // ES Modules import + * // const { WorkMailClient, UpdateAvailabilityConfigurationCommand } = require("@aws-sdk/client-workmail"); // CommonJS import + * const client = new WorkMailClient(config); + * const command = new UpdateAvailabilityConfigurationCommand(input); + * const response = await client.send(command); + * ``` + * + * @see {@link UpdateAvailabilityConfigurationCommandInput} for command's `input` shape. + * @see {@link UpdateAvailabilityConfigurationCommandOutput} for command's `response` shape. + * @see {@link WorkMailClientResolvedConfig | config} for WorkMailClient's `config` shape. + * + */ +export class UpdateAvailabilityConfigurationCommand extends $Command< + UpdateAvailabilityConfigurationCommandInput, + UpdateAvailabilityConfigurationCommandOutput, + WorkMailClientResolvedConfig +> { + // Start section: command_properties + // End section: command_properties + + constructor(readonly input: UpdateAvailabilityConfigurationCommandInput) { + // Start section: command_constructor + super(); + // End section: command_constructor + } + + /** + * @internal + */ + resolveMiddleware( + clientStack: MiddlewareStack, + configuration: WorkMailClientResolvedConfig, + options?: __HttpHandlerOptions + ): Handler { + this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); + + const stack = clientStack.concat(this.middlewareStack); + + const { logger } = configuration; + const clientName = "WorkMailClient"; + const commandName = "UpdateAvailabilityConfigurationCommand"; + const handlerExecutionContext: HandlerExecutionContext = { + logger, + clientName, + commandName, + inputFilterSensitiveLog: UpdateAvailabilityConfigurationRequest.filterSensitiveLog, + outputFilterSensitiveLog: UpdateAvailabilityConfigurationResponse.filterSensitiveLog, + }; + const { requestHandler } = configuration; + return stack.resolve( + (request: FinalizeHandlerArguments) => + requestHandler.handle(request.request as __HttpRequest, options || {}), + handlerExecutionContext + ); + } + + private serialize( + input: UpdateAvailabilityConfigurationCommandInput, + context: __SerdeContext + ): Promise<__HttpRequest> { + return serializeAws_json1_1UpdateAvailabilityConfigurationCommand(input, context); + } + + private deserialize( + output: __HttpResponse, + context: __SerdeContext + ): Promise { + return deserializeAws_json1_1UpdateAvailabilityConfigurationCommand(output, context); + } + + // Start section: command_body_extra + // End section: command_body_extra +} diff --git a/clients/client-workmail/src/commands/index.ts b/clients/client-workmail/src/commands/index.ts index 6af539c43385..140366d77f81 100644 --- a/clients/client-workmail/src/commands/index.ts +++ b/clients/client-workmail/src/commands/index.ts @@ -3,6 +3,7 @@ export * from "./AssociateDelegateToResourceCommand"; export * from "./AssociateMemberToGroupCommand"; export * from "./CancelMailboxExportJobCommand"; export * from "./CreateAliasCommand"; +export * from "./CreateAvailabilityConfigurationCommand"; export * from "./CreateGroupCommand"; export * from "./CreateMobileDeviceAccessRuleCommand"; export * from "./CreateOrganizationCommand"; @@ -10,6 +11,7 @@ export * from "./CreateResourceCommand"; export * from "./CreateUserCommand"; export * from "./DeleteAccessControlRuleCommand"; export * from "./DeleteAliasCommand"; +export * from "./DeleteAvailabilityConfigurationCommand"; export * from "./DeleteEmailMonitoringConfigurationCommand"; export * from "./DeleteGroupCommand"; export * from "./DeleteMailboxPermissionsCommand"; @@ -38,6 +40,7 @@ export * from "./GetMobileDeviceAccessEffectCommand"; export * from "./GetMobileDeviceAccessOverrideCommand"; export * from "./ListAccessControlRulesCommand"; export * from "./ListAliasesCommand"; +export * from "./ListAvailabilityConfigurationsCommand"; export * from "./ListGroupMembersCommand"; export * from "./ListGroupsCommand"; export * from "./ListMailDomainsCommand"; @@ -61,7 +64,9 @@ export * from "./RegisterToWorkMailCommand"; export * from "./ResetPasswordCommand"; export * from "./StartMailboxExportJobCommand"; export * from "./TagResourceCommand"; +export * from "./TestAvailabilityConfigurationCommand"; export * from "./UntagResourceCommand"; +export * from "./UpdateAvailabilityConfigurationCommand"; export * from "./UpdateDefaultMailDomainCommand"; export * from "./UpdateMailboxQuotaCommand"; export * from "./UpdateMobileDeviceAccessRuleCommand"; diff --git a/clients/client-workmail/src/models/models_0.ts b/clients/client-workmail/src/models/models_0.ts index aa1ce0721563..301f5deb47cb 100644 --- a/clients/client-workmail/src/models/models_0.ts +++ b/clients/client-workmail/src/models/models_0.ts @@ -327,6 +327,102 @@ export class UnsupportedOperationException extends __BaseException { } } +/** + *

Describes an EWS based availability provider when returned from the service. It does not + * contain the password of the endpoint.

+ */ +export interface RedactedEwsAvailabilityProvider { + /** + *

The endpoint of the remote EWS server.

+ */ + EwsEndpoint?: string; + + /** + *

The username used to authenticate the remote EWS server.

+ */ + EwsUsername?: string; +} + +export namespace RedactedEwsAvailabilityProvider { + /** + * @internal + */ + export const filterSensitiveLog = (obj: RedactedEwsAvailabilityProvider): any => ({ + ...obj, + }); +} + +/** + *

Describes a Lambda based availability provider.

+ */ +export interface LambdaAvailabilityProvider { + /** + *

The Amazon Resource Name (ARN) of the Lambda that acts as the availability provider.

+ */ + LambdaArn: string | undefined; +} + +export namespace LambdaAvailabilityProvider { + /** + * @internal + */ + export const filterSensitiveLog = (obj: LambdaAvailabilityProvider): any => ({ + ...obj, + }); +} + +export enum AvailabilityProviderType { + EWS = "EWS", + LAMBDA = "LAMBDA", +} + +/** + *

List all the AvailabilityConfiguration's for the given WorkMail + * organization.

+ */ +export interface AvailabilityConfiguration { + /** + *

Displays the domain to which the provider applies.

+ */ + DomainName?: string; + + /** + *

Displays the provider type that applies to this domain.

+ */ + ProviderType?: AvailabilityProviderType | string; + + /** + *

If ProviderType is EWS, then this field contains + * RedactedEwsAvailabilityProvider. Otherwise, it is not requried.

+ */ + EwsProvider?: RedactedEwsAvailabilityProvider; + + /** + *

If ProviderType is LAMBDA then this field contains + * LambdaAvailabilityProvider. Otherwise, it is not required.

+ */ + LambdaProvider?: LambdaAvailabilityProvider; + + /** + *

The date and time at which the availability configuration was created.

+ */ + DateCreated?: Date; + + /** + *

The date and time at which the availability configuration was last modified.

+ */ + DateModified?: Date; +} + +export namespace AvailabilityConfiguration { + /** + * @internal + */ + export const filterSensitiveLog = (obj: AvailabilityConfiguration): any => ({ + ...obj, + }); +} + /** *

At least one delegate must be associated to the resource to disable automatic replies * from the resource.

@@ -518,39 +614,80 @@ export class MailDomainStateException extends __BaseException { } } -export interface CreateGroupRequest { +/** + *

Describes an EWS based availability provider. This is only used as input to the service.

+ */ +export interface EwsAvailabilityProvider { /** - *

The organization under which the group is to be created.

+ *

The endpoint of the remote EWS server.

*/ - OrganizationId: string | undefined; + EwsEndpoint: string | undefined; /** - *

The name of the group.

+ *

The username used to authenticate the remote EWS server.

*/ - Name: string | undefined; + EwsUsername: string | undefined; + + /** + *

The password used to authenticate the remote EWS server.

+ */ + EwsPassword: string | undefined; } -export namespace CreateGroupRequest { +export namespace EwsAvailabilityProvider { /** * @internal */ - export const filterSensitiveLog = (obj: CreateGroupRequest): any => ({ + export const filterSensitiveLog = (obj: EwsAvailabilityProvider): any => ({ ...obj, + ...(obj.EwsPassword && { EwsPassword: SENSITIVE_STRING }), }); } -export interface CreateGroupResponse { +export interface CreateAvailabilityConfigurationRequest { /** - *

The identifier of the group.

+ *

An idempotent token that ensures that an API request is executed only once.

*/ - GroupId?: string; + ClientToken?: string; + + /** + *

The Amazon WorkMail organization for which the AvailabilityConfiguration will be created.

+ */ + OrganizationId: string | undefined; + + /** + *

The domain to which the provider applies.

+ */ + DomainName: string | undefined; + + /** + *

Exchange Web Services (EWS) availability provider definition. The request must contain exactly one provider definition, either EwsProvider or LambdaProvider.

+ */ + EwsProvider?: EwsAvailabilityProvider; + + /** + *

Lambda availability provider definition. The request must contain exactly one provider definition, either EwsProvider or LambdaProvider.

+ */ + LambdaProvider?: LambdaAvailabilityProvider; } -export namespace CreateGroupResponse { +export namespace CreateAvailabilityConfigurationRequest { /** * @internal */ - export const filterSensitiveLog = (obj: CreateGroupResponse): any => ({ + export const filterSensitiveLog = (obj: CreateAvailabilityConfigurationRequest): any => ({ + ...obj, + ...(obj.EwsProvider && { EwsProvider: EwsAvailabilityProvider.filterSensitiveLog(obj.EwsProvider) }), + }); +} + +export interface CreateAvailabilityConfigurationResponse {} + +export namespace CreateAvailabilityConfigurationResponse { + /** + * @internal + */ + export const filterSensitiveLog = (obj: CreateAvailabilityConfigurationResponse): any => ({ ...obj, }); } @@ -576,6 +713,43 @@ export class NameAvailabilityException extends __BaseException { } } +export interface CreateGroupRequest { + /** + *

The organization under which the group is to be created.

+ */ + OrganizationId: string | undefined; + + /** + *

The name of the group.

+ */ + Name: string | undefined; +} + +export namespace CreateGroupRequest { + /** + * @internal + */ + export const filterSensitiveLog = (obj: CreateGroupRequest): any => ({ + ...obj, + }); +} + +export interface CreateGroupResponse { + /** + *

The identifier of the group.

+ */ + GroupId?: string; +} + +export namespace CreateGroupResponse { + /** + * @internal + */ + export const filterSensitiveLog = (obj: CreateGroupResponse): any => ({ + ...obj, + }); +} + /** *

This user, group, or resource name is not allowed in Amazon WorkMail.

*/ @@ -1018,6 +1192,38 @@ export namespace DeleteAliasResponse { }); } +export interface DeleteAvailabilityConfigurationRequest { + /** + *

The Amazon WorkMail organization for which the AvailabilityConfiguration will be deleted.

+ */ + OrganizationId: string | undefined; + + /** + *

The domain for which the AvailabilityConfiguration will be deleted.

+ */ + DomainName: string | undefined; +} + +export namespace DeleteAvailabilityConfigurationRequest { + /** + * @internal + */ + export const filterSensitiveLog = (obj: DeleteAvailabilityConfigurationRequest): any => ({ + ...obj, + }); +} + +export interface DeleteAvailabilityConfigurationResponse {} + +export namespace DeleteAvailabilityConfigurationResponse { + /** + * @internal + */ + export const filterSensitiveLog = (obj: DeleteAvailabilityConfigurationResponse): any => ({ + ...obj, + }); +} + export interface DeleteEmailMonitoringConfigurationRequest { /** *

The ID of the organization from which the email monitoring configuration is deleted.

@@ -2704,6 +2910,54 @@ export namespace ListAliasesResponse { }); } +export interface ListAvailabilityConfigurationsRequest { + /** + *

The Amazon WorkMail organization for which the AvailabilityConfiguration's will be + * listed.

+ */ + OrganizationId: string | undefined; + + /** + *

The maximum number of results to return in a single call.

+ */ + MaxResults?: number; + + /** + *

The token to use to retrieve the next page of results. The first call does not require a token.

+ */ + NextToken?: string; +} + +export namespace ListAvailabilityConfigurationsRequest { + /** + * @internal + */ + export const filterSensitiveLog = (obj: ListAvailabilityConfigurationsRequest): any => ({ + ...obj, + }); +} + +export interface ListAvailabilityConfigurationsResponse { + /** + *

The list of AvailabilityConfiguration's that exist for the specified Amazon WorkMail organization.

+ */ + AvailabilityConfigurations?: AvailabilityConfiguration[]; + + /** + *

The token to use to retrieve the next page of results. The value is null when there are no further results to return.

+ */ + NextToken?: string; +} + +export namespace ListAvailabilityConfigurationsResponse { + /** + * @internal + */ + export const filterSensitiveLog = (obj: ListAvailabilityConfigurationsResponse): any => ({ + ...obj, + }); +} + export interface ListGroupMembersRequest { /** *

The identifier for the organization under which the group exists.

@@ -4239,6 +4493,59 @@ export class TooManyTagsException extends __BaseException { } } +export interface TestAvailabilityConfigurationRequest { + /** + *

The Amazon WorkMail organization where the availability provider will be tested.

+ */ + OrganizationId: string | undefined; + + /** + *

The domain to which the provider applies. If this field is provided, a stored availability provider associated to this domain name will be tested.

+ */ + DomainName?: string; + + /** + *

Describes an EWS based availability provider. This is only used as input to the service.

+ */ + EwsProvider?: EwsAvailabilityProvider; + + /** + *

Describes a Lambda based availability provider.

+ */ + LambdaProvider?: LambdaAvailabilityProvider; +} + +export namespace TestAvailabilityConfigurationRequest { + /** + * @internal + */ + export const filterSensitiveLog = (obj: TestAvailabilityConfigurationRequest): any => ({ + ...obj, + ...(obj.EwsProvider && { EwsProvider: EwsAvailabilityProvider.filterSensitiveLog(obj.EwsProvider) }), + }); +} + +export interface TestAvailabilityConfigurationResponse { + /** + *

Boolean indicating whether the test passed or failed.

+ */ + TestPassed?: boolean; + + /** + *

String containing the reason for a failed test if TestPassed is false.

+ */ + FailureReason?: string; +} + +export namespace TestAvailabilityConfigurationResponse { + /** + * @internal + */ + export const filterSensitiveLog = (obj: TestAvailabilityConfigurationResponse): any => ({ + ...obj, + }); +} + export interface UntagResourceRequest { /** *

The resource ARN.

@@ -4271,6 +4578,54 @@ export namespace UntagResourceResponse { }); } +export interface UpdateAvailabilityConfigurationRequest { + /** + *

The Amazon WorkMail organization for which the AvailabilityConfiguration will be + * updated.

+ */ + OrganizationId: string | undefined; + + /** + *

The domain to which the provider applies the availability configuration.

+ */ + DomainName: string | undefined; + + /** + *

The EWS availability provider definition. The request must contain exactly one provider + * definition, either EwsProvider or LambdaProvider. The previously + * stored provider will be overridden by the one provided.

+ */ + EwsProvider?: EwsAvailabilityProvider; + + /** + *

The Lambda availability provider definition. The request must contain exactly one + * provider definition, either EwsProvider or LambdaProvider. The + * previously stored provider will be overridden by the one provided.

+ */ + LambdaProvider?: LambdaAvailabilityProvider; +} + +export namespace UpdateAvailabilityConfigurationRequest { + /** + * @internal + */ + export const filterSensitiveLog = (obj: UpdateAvailabilityConfigurationRequest): any => ({ + ...obj, + ...(obj.EwsProvider && { EwsProvider: EwsAvailabilityProvider.filterSensitiveLog(obj.EwsProvider) }), + }); +} + +export interface UpdateAvailabilityConfigurationResponse {} + +export namespace UpdateAvailabilityConfigurationResponse { + /** + * @internal + */ + export const filterSensitiveLog = (obj: UpdateAvailabilityConfigurationResponse): any => ({ + ...obj, + }); +} + export interface UpdateDefaultMailDomainRequest { /** *

The Amazon WorkMail organization for which to list domains.

diff --git a/clients/client-workmail/src/pagination/ListAvailabilityConfigurationsPaginator.ts b/clients/client-workmail/src/pagination/ListAvailabilityConfigurationsPaginator.ts new file mode 100644 index 000000000000..bd7bc93e8b6f --- /dev/null +++ b/clients/client-workmail/src/pagination/ListAvailabilityConfigurationsPaginator.ts @@ -0,0 +1,61 @@ +// smithy-typescript generated code +import { Paginator } from "@aws-sdk/types"; + +import { + ListAvailabilityConfigurationsCommand, + ListAvailabilityConfigurationsCommandInput, + ListAvailabilityConfigurationsCommandOutput, +} from "../commands/ListAvailabilityConfigurationsCommand"; +import { WorkMail } from "../WorkMail"; +import { WorkMailClient } from "../WorkMailClient"; +import { WorkMailPaginationConfiguration } from "./Interfaces"; + +/** + * @private + */ +const makePagedClientRequest = async ( + client: WorkMailClient, + input: ListAvailabilityConfigurationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.send(new ListAvailabilityConfigurationsCommand(input), ...args); +}; +/** + * @private + */ +const makePagedRequest = async ( + client: WorkMail, + input: ListAvailabilityConfigurationsCommandInput, + ...args: any +): Promise => { + // @ts-ignore + return await client.listAvailabilityConfigurations(input, ...args); +}; +export async function* paginateListAvailabilityConfigurations( + config: WorkMailPaginationConfiguration, + input: ListAvailabilityConfigurationsCommandInput, + ...additionalArguments: any +): Paginator { + // ToDo: replace with actual type instead of typeof input.NextToken + let token: typeof input.NextToken | undefined = config.startingToken || undefined; + let hasNext = true; + let page: ListAvailabilityConfigurationsCommandOutput; + while (hasNext) { + input.NextToken = token; + input["MaxResults"] = config.pageSize; + if (config.client instanceof WorkMail) { + page = await makePagedRequest(config.client, input, ...additionalArguments); + } else if (config.client instanceof WorkMailClient) { + page = await makePagedClientRequest(config.client, input, ...additionalArguments); + } else { + throw new Error("Invalid client, expected WorkMail | WorkMailClient"); + } + yield page; + const prevToken = token; + token = page.NextToken; + hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken)); + } + // @ts-ignore + return undefined; +} diff --git a/clients/client-workmail/src/pagination/index.ts b/clients/client-workmail/src/pagination/index.ts index 77853ae41a78..4af92fd7135e 100644 --- a/clients/client-workmail/src/pagination/index.ts +++ b/clients/client-workmail/src/pagination/index.ts @@ -1,6 +1,7 @@ // smithy-typescript generated code export * from "./Interfaces"; export * from "./ListAliasesPaginator"; +export * from "./ListAvailabilityConfigurationsPaginator"; export * from "./ListGroupMembersPaginator"; export * from "./ListGroupsPaginator"; export * from "./ListMailDomainsPaginator"; diff --git a/clients/client-workmail/src/protocols/Aws_json1_1.ts b/clients/client-workmail/src/protocols/Aws_json1_1.ts index 9567322a5e4e..34fbc4697775 100644 --- a/clients/client-workmail/src/protocols/Aws_json1_1.ts +++ b/clients/client-workmail/src/protocols/Aws_json1_1.ts @@ -31,6 +31,10 @@ import { CancelMailboxExportJobCommandOutput, } from "../commands/CancelMailboxExportJobCommand"; import { CreateAliasCommandInput, CreateAliasCommandOutput } from "../commands/CreateAliasCommand"; +import { + CreateAvailabilityConfigurationCommandInput, + CreateAvailabilityConfigurationCommandOutput, +} from "../commands/CreateAvailabilityConfigurationCommand"; import { CreateGroupCommandInput, CreateGroupCommandOutput } from "../commands/CreateGroupCommand"; import { CreateMobileDeviceAccessRuleCommandInput, @@ -44,6 +48,10 @@ import { DeleteAccessControlRuleCommandOutput, } from "../commands/DeleteAccessControlRuleCommand"; import { DeleteAliasCommandInput, DeleteAliasCommandOutput } from "../commands/DeleteAliasCommand"; +import { + DeleteAvailabilityConfigurationCommandInput, + DeleteAvailabilityConfigurationCommandOutput, +} from "../commands/DeleteAvailabilityConfigurationCommand"; import { DeleteEmailMonitoringConfigurationCommandInput, DeleteEmailMonitoringConfigurationCommandOutput, @@ -126,6 +134,10 @@ import { ListAccessControlRulesCommandOutput, } from "../commands/ListAccessControlRulesCommand"; import { ListAliasesCommandInput, ListAliasesCommandOutput } from "../commands/ListAliasesCommand"; +import { + ListAvailabilityConfigurationsCommandInput, + ListAvailabilityConfigurationsCommandOutput, +} from "../commands/ListAvailabilityConfigurationsCommand"; import { ListGroupMembersCommandInput, ListGroupMembersCommandOutput } from "../commands/ListGroupMembersCommand"; import { ListGroupsCommandInput, ListGroupsCommandOutput } from "../commands/ListGroupsCommand"; import { @@ -185,7 +197,15 @@ import { StartMailboxExportJobCommandOutput, } from "../commands/StartMailboxExportJobCommand"; import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; +import { + TestAvailabilityConfigurationCommandInput, + TestAvailabilityConfigurationCommandOutput, +} from "../commands/TestAvailabilityConfigurationCommand"; import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; +import { + UpdateAvailabilityConfigurationCommandInput, + UpdateAvailabilityConfigurationCommandOutput, +} from "../commands/UpdateAvailabilityConfigurationCommand"; import { UpdateDefaultMailDomainCommandInput, UpdateDefaultMailDomainCommandOutput, @@ -206,11 +226,14 @@ import { AssociateDelegateToResourceResponse, AssociateMemberToGroupRequest, AssociateMemberToGroupResponse, + AvailabilityConfiguration, BookingOptions, CancelMailboxExportJobRequest, CancelMailboxExportJobResponse, CreateAliasRequest, CreateAliasResponse, + CreateAvailabilityConfigurationRequest, + CreateAvailabilityConfigurationResponse, CreateGroupRequest, CreateGroupResponse, CreateMobileDeviceAccessRuleRequest, @@ -226,6 +249,8 @@ import { DeleteAccessControlRuleResponse, DeleteAliasRequest, DeleteAliasResponse, + DeleteAvailabilityConfigurationRequest, + DeleteAvailabilityConfigurationResponse, DeleteEmailMonitoringConfigurationRequest, DeleteEmailMonitoringConfigurationResponse, DeleteGroupRequest, @@ -275,6 +300,7 @@ import { EntityAlreadyRegisteredException, EntityNotFoundException, EntityStateException, + EwsAvailabilityProvider, FolderConfiguration, GetAccessControlEffectRequest, GetAccessControlEffectResponse, @@ -293,11 +319,14 @@ import { InvalidCustomSesConfigurationException, InvalidParameterException, InvalidPasswordException, + LambdaAvailabilityProvider, LimitExceededException, ListAccessControlRulesRequest, ListAccessControlRulesResponse, ListAliasesRequest, ListAliasesResponse, + ListAvailabilityConfigurationsRequest, + ListAvailabilityConfigurationsResponse, ListGroupMembersRequest, ListGroupMembersResponse, ListGroupsRequest, @@ -349,6 +378,7 @@ import { PutMobileDeviceAccessOverrideResponse, PutRetentionPolicyRequest, PutRetentionPolicyResponse, + RedactedEwsAvailabilityProvider, RegisterMailDomainRequest, RegisterMailDomainResponse, RegisterToWorkMailRequest, @@ -363,10 +393,14 @@ import { Tag, TagResourceRequest, TagResourceResponse, + TestAvailabilityConfigurationRequest, + TestAvailabilityConfigurationResponse, TooManyTagsException, UnsupportedOperationException, UntagResourceRequest, UntagResourceResponse, + UpdateAvailabilityConfigurationRequest, + UpdateAvailabilityConfigurationResponse, UpdateDefaultMailDomainRequest, UpdateDefaultMailDomainResponse, UpdateMailboxQuotaRequest, @@ -433,6 +467,19 @@ export const serializeAws_json1_1CreateAliasCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +export const serializeAws_json1_1CreateAvailabilityConfigurationCommand = async ( + input: CreateAvailabilityConfigurationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "WorkMailService.CreateAvailabilityConfiguration", + }; + let body: any; + body = JSON.stringify(serializeAws_json1_1CreateAvailabilityConfigurationRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + export const serializeAws_json1_1CreateGroupCommand = async ( input: CreateGroupCommandInput, context: __SerdeContext @@ -524,6 +571,19 @@ export const serializeAws_json1_1DeleteAliasCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +export const serializeAws_json1_1DeleteAvailabilityConfigurationCommand = async ( + input: DeleteAvailabilityConfigurationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "WorkMailService.DeleteAvailabilityConfiguration", + }; + let body: any; + body = JSON.stringify(serializeAws_json1_1DeleteAvailabilityConfigurationRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + export const serializeAws_json1_1DeleteEmailMonitoringConfigurationCommand = async ( input: DeleteEmailMonitoringConfigurationCommandInput, context: __SerdeContext @@ -888,6 +948,19 @@ export const serializeAws_json1_1ListAliasesCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +export const serializeAws_json1_1ListAvailabilityConfigurationsCommand = async ( + input: ListAvailabilityConfigurationsCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "WorkMailService.ListAvailabilityConfigurations", + }; + let body: any; + body = JSON.stringify(serializeAws_json1_1ListAvailabilityConfigurationsRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + export const serializeAws_json1_1ListGroupMembersCommand = async ( input: ListGroupMembersCommandInput, context: __SerdeContext @@ -1187,6 +1260,19 @@ export const serializeAws_json1_1TagResourceCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +export const serializeAws_json1_1TestAvailabilityConfigurationCommand = async ( + input: TestAvailabilityConfigurationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "WorkMailService.TestAvailabilityConfiguration", + }; + let body: any; + body = JSON.stringify(serializeAws_json1_1TestAvailabilityConfigurationRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + export const serializeAws_json1_1UntagResourceCommand = async ( input: UntagResourceCommandInput, context: __SerdeContext @@ -1200,6 +1286,19 @@ export const serializeAws_json1_1UntagResourceCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +export const serializeAws_json1_1UpdateAvailabilityConfigurationCommand = async ( + input: UpdateAvailabilityConfigurationCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = { + "content-type": "application/x-amz-json-1.1", + "x-amz-target": "WorkMailService.UpdateAvailabilityConfiguration", + }; + let body: any; + body = JSON.stringify(serializeAws_json1_1UpdateAvailabilityConfigurationRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + export const serializeAws_json1_1UpdateDefaultMailDomainCommand = async ( input: UpdateDefaultMailDomainCommandInput, context: __SerdeContext @@ -1507,6 +1606,62 @@ const deserializeAws_json1_1CreateAliasCommandError = async ( } }; +export const deserializeAws_json1_1CreateAvailabilityConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1CreateAvailabilityConfigurationCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1CreateAvailabilityConfigurationResponse(data, context); + const response: CreateAvailabilityConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; + +const deserializeAws_json1_1CreateAvailabilityConfigurationCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context), + }; + let response: __BaseException; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidParameterException": + case "com.amazonaws.workmail#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "LimitExceededException": + case "com.amazonaws.workmail#LimitExceededException": + throw await deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context); + case "NameAvailabilityException": + case "com.amazonaws.workmail#NameAvailabilityException": + throw await deserializeAws_json1_1NameAvailabilityExceptionResponse(parsedOutput, context); + case "OrganizationNotFoundException": + case "com.amazonaws.workmail#OrganizationNotFoundException": + throw await deserializeAws_json1_1OrganizationNotFoundExceptionResponse(parsedOutput, context); + case "OrganizationStateException": + case "com.amazonaws.workmail#OrganizationStateException": + throw await deserializeAws_json1_1OrganizationStateExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; + response = new __BaseException({ + name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError", + $fault: "client", + $metadata, + }); + throw __decorateServiceException(response, parsedBody); + } +}; + export const deserializeAws_json1_1CreateGroupCommand = async ( output: __HttpResponse, context: __SerdeContext @@ -1914,6 +2069,53 @@ const deserializeAws_json1_1DeleteAliasCommandError = async ( } }; +export const deserializeAws_json1_1DeleteAvailabilityConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1DeleteAvailabilityConfigurationCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1DeleteAvailabilityConfigurationResponse(data, context); + const response: DeleteAvailabilityConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; + +const deserializeAws_json1_1DeleteAvailabilityConfigurationCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context), + }; + let response: __BaseException; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "OrganizationNotFoundException": + case "com.amazonaws.workmail#OrganizationNotFoundException": + throw await deserializeAws_json1_1OrganizationNotFoundExceptionResponse(parsedOutput, context); + case "OrganizationStateException": + case "com.amazonaws.workmail#OrganizationStateException": + throw await deserializeAws_json1_1OrganizationStateExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; + response = new __BaseException({ + name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError", + $fault: "client", + $metadata, + }); + throw __decorateServiceException(response, parsedBody); + } +}; + export const deserializeAws_json1_1DeleteEmailMonitoringConfigurationCommand = async ( output: __HttpResponse, context: __SerdeContext @@ -3410,6 +3612,53 @@ const deserializeAws_json1_1ListAliasesCommandError = async ( } }; +export const deserializeAws_json1_1ListAvailabilityConfigurationsCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1ListAvailabilityConfigurationsCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1ListAvailabilityConfigurationsResponse(data, context); + const response: ListAvailabilityConfigurationsCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; + +const deserializeAws_json1_1ListAvailabilityConfigurationsCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context), + }; + let response: __BaseException; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "OrganizationNotFoundException": + case "com.amazonaws.workmail#OrganizationNotFoundException": + throw await deserializeAws_json1_1OrganizationNotFoundExceptionResponse(parsedOutput, context); + case "OrganizationStateException": + case "com.amazonaws.workmail#OrganizationStateException": + throw await deserializeAws_json1_1OrganizationStateExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; + response = new __BaseException({ + name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError", + $fault: "client", + $metadata, + }); + throw __decorateServiceException(response, parsedBody); + } +}; + export const deserializeAws_json1_1ListGroupMembersCommand = async ( output: __HttpResponse, context: __SerdeContext @@ -4644,6 +4893,59 @@ const deserializeAws_json1_1TagResourceCommandError = async ( } }; +export const deserializeAws_json1_1TestAvailabilityConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1TestAvailabilityConfigurationCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1TestAvailabilityConfigurationResponse(data, context); + const response: TestAvailabilityConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; + +const deserializeAws_json1_1TestAvailabilityConfigurationCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context), + }; + let response: __BaseException; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidParameterException": + case "com.amazonaws.workmail#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "OrganizationNotFoundException": + case "com.amazonaws.workmail#OrganizationNotFoundException": + throw await deserializeAws_json1_1OrganizationNotFoundExceptionResponse(parsedOutput, context); + case "OrganizationStateException": + case "com.amazonaws.workmail#OrganizationStateException": + throw await deserializeAws_json1_1OrganizationStateExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.workmail#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; + response = new __BaseException({ + name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError", + $fault: "client", + $metadata, + }); + throw __decorateServiceException(response, parsedBody); + } +}; + export const deserializeAws_json1_1UntagResourceCommand = async ( output: __HttpResponse, context: __SerdeContext @@ -4688,6 +4990,59 @@ const deserializeAws_json1_1UntagResourceCommandError = async ( } }; +export const deserializeAws_json1_1UpdateAvailabilityConfigurationCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return deserializeAws_json1_1UpdateAvailabilityConfigurationCommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = deserializeAws_json1_1UpdateAvailabilityConfigurationResponse(data, context); + const response: UpdateAvailabilityConfigurationCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return Promise.resolve(response); +}; + +const deserializeAws_json1_1UpdateAvailabilityConfigurationCommandError = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + const parsedOutput: any = { + ...output, + body: await parseBody(output.body, context), + }; + let response: __BaseException; + const errorCode = loadRestJsonErrorCode(output, parsedOutput.body); + switch (errorCode) { + case "InvalidParameterException": + case "com.amazonaws.workmail#InvalidParameterException": + throw await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context); + case "OrganizationNotFoundException": + case "com.amazonaws.workmail#OrganizationNotFoundException": + throw await deserializeAws_json1_1OrganizationNotFoundExceptionResponse(parsedOutput, context); + case "OrganizationStateException": + case "com.amazonaws.workmail#OrganizationStateException": + throw await deserializeAws_json1_1OrganizationStateExceptionResponse(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.workmail#ResourceNotFoundException": + throw await deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context); + default: + const parsedBody = parsedOutput.body; + const $metadata = deserializeMetadata(output); + const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined; + response = new __BaseException({ + name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError", + $fault: "client", + $metadata, + }); + throw __decorateServiceException(response, parsedBody); + } +}; + export const deserializeAws_json1_1UpdateDefaultMailDomainCommand = async ( output: __HttpResponse, context: __SerdeContext @@ -5355,6 +5710,26 @@ const serializeAws_json1_1CreateAliasRequest = (input: CreateAliasRequest, conte }; }; +const serializeAws_json1_1CreateAvailabilityConfigurationRequest = ( + input: CreateAvailabilityConfigurationRequest, + context: __SerdeContext +): any => { + return { + ClientToken: input.ClientToken ?? generateIdempotencyToken(), + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.EwsProvider !== undefined && + input.EwsProvider !== null && { + EwsProvider: serializeAws_json1_1EwsAvailabilityProvider(input.EwsProvider, context), + }), + ...(input.LambdaProvider !== undefined && + input.LambdaProvider !== null && { + LambdaProvider: serializeAws_json1_1LambdaAvailabilityProvider(input.LambdaProvider, context), + }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + }; +}; + const serializeAws_json1_1CreateGroupRequest = (input: CreateGroupRequest, context: __SerdeContext): any => { return { ...(input.Name !== undefined && input.Name !== null && { Name: input.Name }), @@ -5465,6 +5840,17 @@ const serializeAws_json1_1DeleteAliasRequest = (input: DeleteAliasRequest, conte }; }; +const serializeAws_json1_1DeleteAvailabilityConfigurationRequest = ( + input: DeleteAvailabilityConfigurationRequest, + context: __SerdeContext +): any => { + return { + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + }; +}; + const serializeAws_json1_1DeleteEmailMonitoringConfigurationRequest = ( input: DeleteEmailMonitoringConfigurationRequest, context: __SerdeContext @@ -5732,6 +6118,14 @@ const serializeAws_json1_1Domains = (input: Domain[], context: __SerdeContext): }); }; +const serializeAws_json1_1EwsAvailabilityProvider = (input: EwsAvailabilityProvider, context: __SerdeContext): any => { + return { + ...(input.EwsEndpoint !== undefined && input.EwsEndpoint !== null && { EwsEndpoint: input.EwsEndpoint }), + ...(input.EwsPassword !== undefined && input.EwsPassword !== null && { EwsPassword: input.EwsPassword }), + ...(input.EwsUsername !== undefined && input.EwsUsername !== null && { EwsUsername: input.EwsUsername }), + }; +}; + const serializeAws_json1_1FolderConfiguration = (input: FolderConfiguration, context: __SerdeContext): any => { return { ...(input.Action !== undefined && input.Action !== null && { Action: input.Action }), @@ -5832,6 +6226,15 @@ const serializeAws_json1_1IpRangeList = (input: string[], context: __SerdeContex }); }; +const serializeAws_json1_1LambdaAvailabilityProvider = ( + input: LambdaAvailabilityProvider, + context: __SerdeContext +): any => { + return { + ...(input.LambdaArn !== undefined && input.LambdaArn !== null && { LambdaArn: input.LambdaArn }), + }; +}; + const serializeAws_json1_1ListAccessControlRulesRequest = ( input: ListAccessControlRulesRequest, context: __SerdeContext @@ -5852,6 +6255,18 @@ const serializeAws_json1_1ListAliasesRequest = (input: ListAliasesRequest, conte }; }; +const serializeAws_json1_1ListAvailabilityConfigurationsRequest = ( + input: ListAvailabilityConfigurationsRequest, + context: __SerdeContext +): any => { + return { + ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + }; +}; + const serializeAws_json1_1ListGroupMembersRequest = (input: ListGroupMembersRequest, context: __SerdeContext): any => { return { ...(input.GroupId !== undefined && input.GroupId !== null && { GroupId: input.GroupId }), @@ -6171,6 +6586,25 @@ const serializeAws_json1_1TagResourceRequest = (input: TagResourceRequest, conte }; }; +const serializeAws_json1_1TestAvailabilityConfigurationRequest = ( + input: TestAvailabilityConfigurationRequest, + context: __SerdeContext +): any => { + return { + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.EwsProvider !== undefined && + input.EwsProvider !== null && { + EwsProvider: serializeAws_json1_1EwsAvailabilityProvider(input.EwsProvider, context), + }), + ...(input.LambdaProvider !== undefined && + input.LambdaProvider !== null && { + LambdaProvider: serializeAws_json1_1LambdaAvailabilityProvider(input.LambdaProvider, context), + }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + }; +}; + const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, context: __SerdeContext): any => { return { ...(input.ResourceARN !== undefined && input.ResourceARN !== null && { ResourceARN: input.ResourceARN }), @@ -6179,6 +6613,25 @@ const serializeAws_json1_1UntagResourceRequest = (input: UntagResourceRequest, c }; }; +const serializeAws_json1_1UpdateAvailabilityConfigurationRequest = ( + input: UpdateAvailabilityConfigurationRequest, + context: __SerdeContext +): any => { + return { + ...(input.DomainName !== undefined && input.DomainName !== null && { DomainName: input.DomainName }), + ...(input.EwsProvider !== undefined && + input.EwsProvider !== null && { + EwsProvider: serializeAws_json1_1EwsAvailabilityProvider(input.EwsProvider, context), + }), + ...(input.LambdaProvider !== undefined && + input.LambdaProvider !== null && { + LambdaProvider: serializeAws_json1_1LambdaAvailabilityProvider(input.LambdaProvider, context), + }), + ...(input.OrganizationId !== undefined && + input.OrganizationId !== null && { OrganizationId: input.OrganizationId }), + }; +}; + const serializeAws_json1_1UpdateDefaultMailDomainRequest = ( input: UpdateDefaultMailDomainRequest, context: __SerdeContext @@ -6388,6 +6841,47 @@ const deserializeAws_json1_1AssociateMemberToGroupResponse = ( return {} as any; }; +const deserializeAws_json1_1AvailabilityConfiguration = ( + output: any, + context: __SerdeContext +): AvailabilityConfiguration => { + return { + DateCreated: + output.DateCreated !== undefined && output.DateCreated !== null + ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.DateCreated))) + : undefined, + DateModified: + output.DateModified !== undefined && output.DateModified !== null + ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.DateModified))) + : undefined, + DomainName: __expectString(output.DomainName), + EwsProvider: + output.EwsProvider !== undefined && output.EwsProvider !== null + ? deserializeAws_json1_1RedactedEwsAvailabilityProvider(output.EwsProvider, context) + : undefined, + LambdaProvider: + output.LambdaProvider !== undefined && output.LambdaProvider !== null + ? deserializeAws_json1_1LambdaAvailabilityProvider(output.LambdaProvider, context) + : undefined, + ProviderType: __expectString(output.ProviderType), + } as any; +}; + +const deserializeAws_json1_1AvailabilityConfigurationList = ( + output: any, + context: __SerdeContext +): AvailabilityConfiguration[] => { + const retVal = (output || []) + .filter((e: any) => e != null) + .map((entry: any) => { + if (entry === null) { + return null as any; + } + return deserializeAws_json1_1AvailabilityConfiguration(entry, context); + }); + return retVal; +}; + const deserializeAws_json1_1BookingOptions = (output: any, context: __SerdeContext): BookingOptions => { return { AutoAcceptRequests: __expectBoolean(output.AutoAcceptRequests), @@ -6407,6 +6901,13 @@ const deserializeAws_json1_1CreateAliasResponse = (output: any, context: __Serde return {} as any; }; +const deserializeAws_json1_1CreateAvailabilityConfigurationResponse = ( + output: any, + context: __SerdeContext +): CreateAvailabilityConfigurationResponse => { + return {} as any; +}; + const deserializeAws_json1_1CreateGroupResponse = (output: any, context: __SerdeContext): CreateGroupResponse => { return { GroupId: __expectString(output.GroupId), @@ -6461,6 +6962,13 @@ const deserializeAws_json1_1DeleteAliasResponse = (output: any, context: __Serde return {} as any; }; +const deserializeAws_json1_1DeleteAvailabilityConfigurationResponse = ( + output: any, + context: __SerdeContext +): DeleteAvailabilityConfigurationResponse => { + return {} as any; +}; + const deserializeAws_json1_1DeleteEmailMonitoringConfigurationResponse = ( output: any, context: __SerdeContext @@ -6993,6 +7501,15 @@ const deserializeAws_json1_1Jobs = (output: any, context: __SerdeContext): Mailb return retVal; }; +const deserializeAws_json1_1LambdaAvailabilityProvider = ( + output: any, + context: __SerdeContext +): LambdaAvailabilityProvider => { + return { + LambdaArn: __expectString(output.LambdaArn), + } as any; +}; + const deserializeAws_json1_1LimitExceededException = (output: any, context: __SerdeContext): LimitExceededException => { return { Message: __expectString(output.Message), @@ -7021,6 +7538,19 @@ const deserializeAws_json1_1ListAliasesResponse = (output: any, context: __Serde } as any; }; +const deserializeAws_json1_1ListAvailabilityConfigurationsResponse = ( + output: any, + context: __SerdeContext +): ListAvailabilityConfigurationsResponse => { + return { + AvailabilityConfigurations: + output.AvailabilityConfigurations !== undefined && output.AvailabilityConfigurations !== null + ? deserializeAws_json1_1AvailabilityConfigurationList(output.AvailabilityConfigurations, context) + : undefined, + NextToken: __expectString(output.NextToken), + } as any; +}; + const deserializeAws_json1_1ListGroupMembersResponse = ( output: any, context: __SerdeContext @@ -7509,6 +8039,16 @@ const deserializeAws_json1_1PutRetentionPolicyResponse = ( return {} as any; }; +const deserializeAws_json1_1RedactedEwsAvailabilityProvider = ( + output: any, + context: __SerdeContext +): RedactedEwsAvailabilityProvider => { + return { + EwsEndpoint: __expectString(output.EwsEndpoint), + EwsUsername: __expectString(output.EwsUsername), + } as any; +}; + const deserializeAws_json1_1RegisterMailDomainResponse = ( output: any, context: __SerdeContext @@ -7616,6 +8156,16 @@ const deserializeAws_json1_1TagResourceResponse = (output: any, context: __Serde return {} as any; }; +const deserializeAws_json1_1TestAvailabilityConfigurationResponse = ( + output: any, + context: __SerdeContext +): TestAvailabilityConfigurationResponse => { + return { + FailureReason: __expectString(output.FailureReason), + TestPassed: __expectBoolean(output.TestPassed), + } as any; +}; + const deserializeAws_json1_1TooManyTagsException = (output: any, context: __SerdeContext): TooManyTagsException => { return { Message: __expectString(output.Message), @@ -7635,6 +8185,13 @@ const deserializeAws_json1_1UntagResourceResponse = (output: any, context: __Ser return {} as any; }; +const deserializeAws_json1_1UpdateAvailabilityConfigurationResponse = ( + output: any, + context: __SerdeContext +): UpdateAvailabilityConfigurationResponse => { + return {} as any; +}; + const deserializeAws_json1_1UpdateDefaultMailDomainResponse = ( output: any, context: __SerdeContext diff --git a/codegen/sdk-codegen/aws-models/workmail.json b/codegen/sdk-codegen/aws-models/workmail.json index 3d54bccb6b51..887eccee6533 100644 --- a/codegen/sdk-codegen/aws-models/workmail.json +++ b/codegen/sdk-codegen/aws-models/workmail.json @@ -328,6 +328,71 @@ "type": "structure", "members": {} }, + "com.amazonaws.workmail#AvailabilityConfiguration": { + "type": "structure", + "members": { + "DomainName": { + "target": "com.amazonaws.workmail#DomainName", + "traits": { + "smithy.api#documentation": "

Displays the domain to which the provider applies.

" + } + }, + "ProviderType": { + "target": "com.amazonaws.workmail#AvailabilityProviderType", + "traits": { + "smithy.api#documentation": "

Displays the provider type that applies to this domain.

" + } + }, + "EwsProvider": { + "target": "com.amazonaws.workmail#RedactedEwsAvailabilityProvider", + "traits": { + "smithy.api#documentation": "

If ProviderType is EWS, then this field contains\n RedactedEwsAvailabilityProvider. Otherwise, it is not requried.

" + } + }, + "LambdaProvider": { + "target": "com.amazonaws.workmail#LambdaAvailabilityProvider", + "traits": { + "smithy.api#documentation": "

If ProviderType is LAMBDA then this field contains\n LambdaAvailabilityProvider. Otherwise, it is not required.

" + } + }, + "DateCreated": { + "target": "com.amazonaws.workmail#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time at which the availability configuration was created.

" + } + }, + "DateModified": { + "target": "com.amazonaws.workmail#Timestamp", + "traits": { + "smithy.api#documentation": "

The date and time at which the availability configuration was last modified.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

List all the AvailabilityConfiguration's for the given WorkMail\n organization.

" + } + }, + "com.amazonaws.workmail#AvailabilityConfigurationList": { + "type": "list", + "member": { + "target": "com.amazonaws.workmail#AvailabilityConfiguration" + } + }, + "com.amazonaws.workmail#AvailabilityProviderType": { + "type": "string", + "traits": { + "smithy.api#enum": [ + { + "value": "EWS", + "name": "EWS" + }, + { + "value": "LAMBDA", + "name": "LAMBDA" + } + ] + } + }, "com.amazonaws.workmail#BookingOptions": { "type": "structure", "members": { @@ -493,6 +558,78 @@ "type": "structure", "members": {} }, + "com.amazonaws.workmail#CreateAvailabilityConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.workmail#CreateAvailabilityConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.workmail#CreateAvailabilityConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.workmail#InvalidParameterException" + }, + { + "target": "com.amazonaws.workmail#LimitExceededException" + }, + { + "target": "com.amazonaws.workmail#NameAvailabilityException" + }, + { + "target": "com.amazonaws.workmail#OrganizationNotFoundException" + }, + { + "target": "com.amazonaws.workmail#OrganizationStateException" + } + ], + "traits": { + "smithy.api#documentation": "

Creates an AvailabilityConfiguration for the given WorkMail organization and domain.

", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.workmail#CreateAvailabilityConfigurationRequest": { + "type": "structure", + "members": { + "ClientToken": { + "target": "com.amazonaws.workmail#IdempotencyClientToken", + "traits": { + "smithy.api#documentation": "

An idempotent token that ensures that an API request is executed only once.

", + "smithy.api#idempotencyToken": {} + } + }, + "OrganizationId": { + "target": "com.amazonaws.workmail#OrganizationId", + "traits": { + "smithy.api#documentation": "

The Amazon WorkMail organization for which the AvailabilityConfiguration will be created.

", + "smithy.api#required": {} + } + }, + "DomainName": { + "target": "com.amazonaws.workmail#DomainName", + "traits": { + "smithy.api#documentation": "

The domain to which the provider applies.

", + "smithy.api#required": {} + } + }, + "EwsProvider": { + "target": "com.amazonaws.workmail#EwsAvailabilityProvider", + "traits": { + "smithy.api#documentation": "

Exchange Web Services (EWS) availability provider definition. The request must contain exactly one provider definition, either EwsProvider or LambdaProvider.

" + } + }, + "LambdaProvider": { + "target": "com.amazonaws.workmail#LambdaAvailabilityProvider", + "traits": { + "smithy.api#documentation": "

Lambda availability provider definition. The request must contain exactly one provider definition, either EwsProvider or LambdaProvider.

" + } + } + } + }, + "com.amazonaws.workmail#CreateAvailabilityConfigurationResponse": { + "type": "structure", + "members": {} + }, "com.amazonaws.workmail#CreateGroup": { "type": "operation", "input": { @@ -1054,6 +1191,50 @@ "type": "structure", "members": {} }, + "com.amazonaws.workmail#DeleteAvailabilityConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.workmail#DeleteAvailabilityConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.workmail#DeleteAvailabilityConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.workmail#OrganizationNotFoundException" + }, + { + "target": "com.amazonaws.workmail#OrganizationStateException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the AvailabilityConfiguration for the given WorkMail organization and domain.

", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.workmail#DeleteAvailabilityConfigurationRequest": { + "type": "structure", + "members": { + "OrganizationId": { + "target": "com.amazonaws.workmail#OrganizationId", + "traits": { + "smithy.api#documentation": "

The Amazon WorkMail organization for which the AvailabilityConfiguration will be deleted.

", + "smithy.api#required": {} + } + }, + "DomainName": { + "target": "com.amazonaws.workmail#DomainName", + "traits": { + "smithy.api#documentation": "

The domain for which the AvailabilityConfiguration will be deleted.

", + "smithy.api#required": {} + } + } + } + }, + "com.amazonaws.workmail#DeleteAvailabilityConfigurationResponse": { + "type": "structure", + "members": {} + }, "com.amazonaws.workmail#DeleteEmailMonitoringConfiguration": { "type": "operation", "input": { @@ -2707,6 +2888,45 @@ "smithy.api#error": "client" } }, + "com.amazonaws.workmail#EwsAvailabilityProvider": { + "type": "structure", + "members": { + "EwsEndpoint": { + "target": "com.amazonaws.workmail#Url", + "traits": { + "smithy.api#documentation": "

The endpoint of the remote EWS server.

", + "smithy.api#required": {} + } + }, + "EwsUsername": { + "target": "com.amazonaws.workmail#ExternalUserName", + "traits": { + "smithy.api#documentation": "

The username used to authenticate the remote EWS server.

", + "smithy.api#required": {} + } + }, + "EwsPassword": { + "target": "com.amazonaws.workmail#Password", + "traits": { + "smithy.api#documentation": "

The password used to authenticate the remote EWS server.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes an EWS based availability provider. This is only used as input to the service.

" + } + }, + "com.amazonaws.workmail#ExternalUserName": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + }, + "smithy.api#pattern": "^[\\u0020-\\u00FF]+$" + } + }, "com.amazonaws.workmail#FolderConfiguration": { "type": "structure", "members": { @@ -3401,6 +3621,31 @@ "smithy.api#pattern": "^arn:aws:kms:[a-z0-9-]*:[a-z0-9-]+:[A-Za-z0-9][A-Za-z0-9:_/+=,@.-]{0,1023}$" } }, + "com.amazonaws.workmail#LambdaArn": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 49, + "max": 256 + }, + "smithy.api#pattern": "^arn:aws:lambda:[a-z]{2}-[a-z]+-\\d{1}:\\d{12}:function:[a-zA-Z0-9\\-_\\.]+(:(\\$LATEST|[a-zA-Z0-9\\-_]+))?$" + } + }, + "com.amazonaws.workmail#LambdaAvailabilityProvider": { + "type": "structure", + "members": { + "LambdaArn": { + "target": "com.amazonaws.workmail#LambdaArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the Lambda that acts as the availability provider.

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes a Lambda based availability provider.

" + } + }, "com.amazonaws.workmail#LimitExceededException": { "type": "structure", "members": { @@ -3539,6 +3784,73 @@ } } }, + "com.amazonaws.workmail#ListAvailabilityConfigurations": { + "type": "operation", + "input": { + "target": "com.amazonaws.workmail#ListAvailabilityConfigurationsRequest" + }, + "output": { + "target": "com.amazonaws.workmail#ListAvailabilityConfigurationsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.workmail#OrganizationNotFoundException" + }, + { + "target": "com.amazonaws.workmail#OrganizationStateException" + } + ], + "traits": { + "smithy.api#documentation": "

List all the AvailabilityConfiguration's for the given WorkMail organization.

", + "smithy.api#paginated": { + "inputToken": "NextToken", + "outputToken": "NextToken", + "items": "AvailabilityConfigurations", + "pageSize": "MaxResults" + } + } + }, + "com.amazonaws.workmail#ListAvailabilityConfigurationsRequest": { + "type": "structure", + "members": { + "OrganizationId": { + "target": "com.amazonaws.workmail#OrganizationId", + "traits": { + "smithy.api#documentation": "

The Amazon WorkMail organization for which the AvailabilityConfiguration's will be\n listed.

", + "smithy.api#required": {} + } + }, + "MaxResults": { + "target": "com.amazonaws.workmail#MaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of results to return in a single call.

" + } + }, + "NextToken": { + "target": "com.amazonaws.workmail#NextToken", + "traits": { + "smithy.api#documentation": "

The token to use to retrieve the next page of results. The first call does not require a token.

" + } + } + } + }, + "com.amazonaws.workmail#ListAvailabilityConfigurationsResponse": { + "type": "structure", + "members": { + "AvailabilityConfigurations": { + "target": "com.amazonaws.workmail#AvailabilityConfigurationList", + "traits": { + "smithy.api#documentation": "

The list of AvailabilityConfiguration's that exist for the specified Amazon WorkMail organization.

" + } + }, + "NextToken": { + "target": "com.amazonaws.workmail#NextToken", + "traits": { + "smithy.api#documentation": "

The token to use to retrieve the next page of results. The value is null when there are no further results to return.

" + } + } + } + }, "com.amazonaws.workmail#ListGroupMembers": { "type": "operation", "input": { @@ -5477,6 +5789,26 @@ "type": "structure", "members": {} }, + "com.amazonaws.workmail#RedactedEwsAvailabilityProvider": { + "type": "structure", + "members": { + "EwsEndpoint": { + "target": "com.amazonaws.workmail#Url", + "traits": { + "smithy.api#documentation": "

The endpoint of the remote EWS server.

" + } + }, + "EwsUsername": { + "target": "com.amazonaws.workmail#ExternalUserName", + "traits": { + "smithy.api#documentation": "

The username used to authenticate the remote EWS server.

" + } + } + }, + "traits": { + "smithy.api#documentation": "

Describes an EWS based availability provider when returned from the service. It does not\n contain the password of the endpoint.

" + } + }, "com.amazonaws.workmail#RegisterMailDomain": { "type": "operation", "input": { @@ -6098,6 +6430,73 @@ } } }, + "com.amazonaws.workmail#TestAvailabilityConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.workmail#TestAvailabilityConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.workmail#TestAvailabilityConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.workmail#InvalidParameterException" + }, + { + "target": "com.amazonaws.workmail#OrganizationNotFoundException" + }, + { + "target": "com.amazonaws.workmail#OrganizationStateException" + }, + { + "target": "com.amazonaws.workmail#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Performs a test on an availability provider to ensure that access is allowed. For EWS, it verifies the provided credentials can be used to successfully log in. For Lambda, it verifies that the Lambda function can be invoked and that the resource access\n policy was configured to deny anonymous access. An anonymous invocation is one done without providing either a SourceArn or SourceAccount header.

\n \n

The request must contain either one provider definition (EwsProvider or\n LambdaProvider) or the DomainName parameter. If the\n DomainName parameter is provided, the configuration stored under the\n DomainName will be tested.

\n
" + } + }, + "com.amazonaws.workmail#TestAvailabilityConfigurationRequest": { + "type": "structure", + "members": { + "OrganizationId": { + "target": "com.amazonaws.workmail#OrganizationId", + "traits": { + "smithy.api#documentation": "

The Amazon WorkMail organization where the availability provider will be tested.

", + "smithy.api#required": {} + } + }, + "DomainName": { + "target": "com.amazonaws.workmail#DomainName", + "traits": { + "smithy.api#documentation": "

The domain to which the provider applies. If this field is provided, a stored availability provider associated to this domain name will be tested.

" + } + }, + "EwsProvider": { + "target": "com.amazonaws.workmail#EwsAvailabilityProvider" + }, + "LambdaProvider": { + "target": "com.amazonaws.workmail#LambdaAvailabilityProvider" + } + } + }, + "com.amazonaws.workmail#TestAvailabilityConfigurationResponse": { + "type": "structure", + "members": { + "TestPassed": { + "target": "com.amazonaws.workmail#Boolean", + "traits": { + "smithy.api#documentation": "

Boolean indicating whether the test passed or failed.

" + } + }, + "FailureReason": { + "target": "com.amazonaws.workmail#String", + "traits": { + "smithy.api#documentation": "

String containing the reason for a failed test if TestPassed is false.

" + } + } + } + }, "com.amazonaws.workmail#Timestamp": { "type": "timestamp" }, @@ -6166,6 +6565,68 @@ "type": "structure", "members": {} }, + "com.amazonaws.workmail#UpdateAvailabilityConfiguration": { + "type": "operation", + "input": { + "target": "com.amazonaws.workmail#UpdateAvailabilityConfigurationRequest" + }, + "output": { + "target": "com.amazonaws.workmail#UpdateAvailabilityConfigurationResponse" + }, + "errors": [ + { + "target": "com.amazonaws.workmail#InvalidParameterException" + }, + { + "target": "com.amazonaws.workmail#OrganizationNotFoundException" + }, + { + "target": "com.amazonaws.workmail#OrganizationStateException" + }, + { + "target": "com.amazonaws.workmail#ResourceNotFoundException" + } + ], + "traits": { + "smithy.api#documentation": "

Updates an existing AvailabilityConfiguration for the given WorkMail\n organization and domain.

", + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.workmail#UpdateAvailabilityConfigurationRequest": { + "type": "structure", + "members": { + "OrganizationId": { + "target": "com.amazonaws.workmail#OrganizationId", + "traits": { + "smithy.api#documentation": "

The Amazon WorkMail organization for which the AvailabilityConfiguration will be\n updated.

", + "smithy.api#required": {} + } + }, + "DomainName": { + "target": "com.amazonaws.workmail#DomainName", + "traits": { + "smithy.api#documentation": "

The domain to which the provider applies the availability configuration.

", + "smithy.api#required": {} + } + }, + "EwsProvider": { + "target": "com.amazonaws.workmail#EwsAvailabilityProvider", + "traits": { + "smithy.api#documentation": "

The EWS availability provider definition. The request must contain exactly one provider\n definition, either EwsProvider or LambdaProvider. The previously\n stored provider will be overridden by the one provided.

" + } + }, + "LambdaProvider": { + "target": "com.amazonaws.workmail#LambdaAvailabilityProvider", + "traits": { + "smithy.api#documentation": "

The Lambda availability provider definition. The request must contain exactly one\n provider definition, either EwsProvider or LambdaProvider. The\n previously stored provider will be overridden by the one provided.

" + } + } + } + }, + "com.amazonaws.workmail#UpdateAvailabilityConfigurationResponse": { + "type": "structure", + "members": {} + }, "com.amazonaws.workmail#UpdateDefaultMailDomain": { "type": "operation", "input": { @@ -6554,6 +7015,16 @@ "type": "structure", "members": {} }, + "com.amazonaws.workmail#Url": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + }, + "smithy.api#pattern": "^https?://[A-Za-z0-9.-]+(:[0-9]+)?/" + } + }, "com.amazonaws.workmail#User": { "type": "structure", "members": { @@ -6707,6 +7178,9 @@ { "target": "com.amazonaws.workmail#CreateAlias" }, + { + "target": "com.amazonaws.workmail#CreateAvailabilityConfiguration" + }, { "target": "com.amazonaws.workmail#CreateGroup" }, @@ -6728,6 +7202,9 @@ { "target": "com.amazonaws.workmail#DeleteAlias" }, + { + "target": "com.amazonaws.workmail#DeleteAvailabilityConfiguration" + }, { "target": "com.amazonaws.workmail#DeleteEmailMonitoringConfiguration" }, @@ -6812,6 +7289,9 @@ { "target": "com.amazonaws.workmail#ListAliases" }, + { + "target": "com.amazonaws.workmail#ListAvailabilityConfigurations" + }, { "target": "com.amazonaws.workmail#ListGroupMembers" }, @@ -6881,9 +7361,15 @@ { "target": "com.amazonaws.workmail#TagResource" }, + { + "target": "com.amazonaws.workmail#TestAvailabilityConfiguration" + }, { "target": "com.amazonaws.workmail#UntagResource" }, + { + "target": "com.amazonaws.workmail#UpdateAvailabilityConfiguration" + }, { "target": "com.amazonaws.workmail#UpdateDefaultMailDomain" },