Skip to content

Commit

Permalink
feat(client-support): This release adds 2 new Support APIs, DescribeC…
Browse files Browse the repository at this point in the history
…reateCaseOptions and DescribeSupportedLanguages. You can use these new APIs to get available support languages.
  • Loading branch information
awstools committed May 11, 2023
1 parent 33700a2 commit 5a9d621
Show file tree
Hide file tree
Showing 14 changed files with 1,538 additions and 958 deletions.
16 changes: 16 additions & 0 deletions clients/client-support/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,14 @@ DescribeCommunications

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/classes/describecommunicationscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/interfaces/describecommunicationscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/interfaces/describecommunicationscommandoutput.html)

</details>
<details>
<summary>
DescribeCreateCaseOptions
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/classes/describecreatecaseoptionscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/interfaces/describecreatecaseoptionscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/interfaces/describecreatecaseoptionscommandoutput.html)

</details>
<details>
<summary>
Expand All @@ -310,6 +318,14 @@ DescribeSeverityLevels

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/classes/describeseveritylevelscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/interfaces/describeseveritylevelscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/interfaces/describeseveritylevelscommandoutput.html)

</details>
<details>
<summary>
DescribeSupportedLanguages
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/classes/describesupportedlanguagescommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/interfaces/describesupportedlanguagescommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-support/interfaces/describesupportedlanguagescommandoutput.html)

</details>
<details>
<summary>
Expand Down
46 changes: 46 additions & 0 deletions clients/client-support/src/Support.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ import {
DescribeCommunicationsCommandInput,
DescribeCommunicationsCommandOutput,
} from "./commands/DescribeCommunicationsCommand";
import {
DescribeCreateCaseOptionsCommand,
DescribeCreateCaseOptionsCommandInput,
DescribeCreateCaseOptionsCommandOutput,
} from "./commands/DescribeCreateCaseOptionsCommand";
import {
DescribeServicesCommand,
DescribeServicesCommandInput,
Expand All @@ -38,6 +43,11 @@ import {
DescribeSeverityLevelsCommandInput,
DescribeSeverityLevelsCommandOutput,
} from "./commands/DescribeSeverityLevelsCommand";
import {
DescribeSupportedLanguagesCommand,
DescribeSupportedLanguagesCommandInput,
DescribeSupportedLanguagesCommandOutput,
} from "./commands/DescribeSupportedLanguagesCommand";
import {
DescribeTrustedAdvisorCheckRefreshStatusesCommand,
DescribeTrustedAdvisorCheckRefreshStatusesCommandInput,
Expand Down Expand Up @@ -73,8 +83,10 @@ const commands = {
DescribeAttachmentCommand,
DescribeCasesCommand,
DescribeCommunicationsCommand,
DescribeCreateCaseOptionsCommand,
DescribeServicesCommand,
DescribeSeverityLevelsCommand,
DescribeSupportedLanguagesCommand,
DescribeTrustedAdvisorCheckRefreshStatusesCommand,
DescribeTrustedAdvisorCheckResultCommand,
DescribeTrustedAdvisorChecksCommand,
Expand Down Expand Up @@ -174,6 +186,23 @@ export interface Support {
cb: (err: any, data?: DescribeCommunicationsCommandOutput) => void
): void;

/**
* @see {@link DescribeCreateCaseOptionsCommand}
*/
describeCreateCaseOptions(
args: DescribeCreateCaseOptionsCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeCreateCaseOptionsCommandOutput>;
describeCreateCaseOptions(
args: DescribeCreateCaseOptionsCommandInput,
cb: (err: any, data?: DescribeCreateCaseOptionsCommandOutput) => void
): void;
describeCreateCaseOptions(
args: DescribeCreateCaseOptionsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeCreateCaseOptionsCommandOutput) => void
): void;

/**
* @see {@link DescribeServicesCommand}
*/
Expand Down Expand Up @@ -208,6 +237,23 @@ export interface Support {
cb: (err: any, data?: DescribeSeverityLevelsCommandOutput) => void
): void;

/**
* @see {@link DescribeSupportedLanguagesCommand}
*/
describeSupportedLanguages(
args: DescribeSupportedLanguagesCommandInput,
options?: __HttpHandlerOptions
): Promise<DescribeSupportedLanguagesCommandOutput>;
describeSupportedLanguages(
args: DescribeSupportedLanguagesCommandInput,
cb: (err: any, data?: DescribeSupportedLanguagesCommandOutput) => void
): void;
describeSupportedLanguages(
args: DescribeSupportedLanguagesCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: DescribeSupportedLanguagesCommandOutput) => void
): void;

/**
* @see {@link DescribeTrustedAdvisorCheckRefreshStatusesCommand}
*/
Expand Down
12 changes: 12 additions & 0 deletions clients/client-support/src/SupportClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,19 @@ import {
DescribeCommunicationsCommandInput,
DescribeCommunicationsCommandOutput,
} from "./commands/DescribeCommunicationsCommand";
import {
DescribeCreateCaseOptionsCommandInput,
DescribeCreateCaseOptionsCommandOutput,
} from "./commands/DescribeCreateCaseOptionsCommand";
import { DescribeServicesCommandInput, DescribeServicesCommandOutput } from "./commands/DescribeServicesCommand";
import {
DescribeSeverityLevelsCommandInput,
DescribeSeverityLevelsCommandOutput,
} from "./commands/DescribeSeverityLevelsCommand";
import {
DescribeSupportedLanguagesCommandInput,
DescribeSupportedLanguagesCommandOutput,
} from "./commands/DescribeSupportedLanguagesCommand";
import {
DescribeTrustedAdvisorCheckRefreshStatusesCommandInput,
DescribeTrustedAdvisorCheckRefreshStatusesCommandOutput,
Expand Down Expand Up @@ -108,8 +116,10 @@ export type ServiceInputTypes =
| DescribeAttachmentCommandInput
| DescribeCasesCommandInput
| DescribeCommunicationsCommandInput
| DescribeCreateCaseOptionsCommandInput
| DescribeServicesCommandInput
| DescribeSeverityLevelsCommandInput
| DescribeSupportedLanguagesCommandInput
| DescribeTrustedAdvisorCheckRefreshStatusesCommandInput
| DescribeTrustedAdvisorCheckResultCommandInput
| DescribeTrustedAdvisorCheckSummariesCommandInput
Expand All @@ -127,8 +137,10 @@ export type ServiceOutputTypes =
| DescribeAttachmentCommandOutput
| DescribeCasesCommandOutput
| DescribeCommunicationsCommandOutput
| DescribeCreateCaseOptionsCommandOutput
| DescribeServicesCommandOutput
| DescribeSeverityLevelsCommandOutput
| DescribeSupportedLanguagesCommandOutput
| DescribeTrustedAdvisorCheckRefreshStatusesCommandOutput
| DescribeTrustedAdvisorCheckResultCommandOutput
| DescribeTrustedAdvisorCheckSummariesCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,186 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
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 { DescribeCreateCaseOptionsRequest, DescribeCreateCaseOptionsResponse } from "../models/models_0";
import { de_DescribeCreateCaseOptionsCommand, se_DescribeCreateCaseOptionsCommand } from "../protocols/Aws_json1_1";
import { ServiceInputTypes, ServiceOutputTypes, SupportClientResolvedConfig } from "../SupportClient";

/**
* @public
*
* The input for {@link DescribeCreateCaseOptionsCommand}.
*/
export interface DescribeCreateCaseOptionsCommandInput extends DescribeCreateCaseOptionsRequest {}
/**
* @public
*
* The output of {@link DescribeCreateCaseOptionsCommand}.
*/
export interface DescribeCreateCaseOptionsCommandOutput extends DescribeCreateCaseOptionsResponse, __MetadataBearer {}

/**
* @public
* <p>Returns a list of CreateCaseOption types along with the
* corresponding supported hours and language availability. You can specify the <code>language</code>
* <code>categoryCode</code>,
* <code>issueType</code> and <code>serviceCode</code> used to retrieve the CreateCaseOptions.</p>
* <note>
* <ul>
* <li>
* <p>You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support
* API. </p>
* </li>
* <li>
* <p>If you call the Amazon Web Services Support API from an account that doesn't have a
* Business, Enterprise On-Ramp, or Enterprise Support plan, the
* <code>SubscriptionRequiredException</code> error message appears. For
* information about changing your support plan, see <a href="http://aws.amazon.com/premiumsupport/">Amazon Web Services Support</a>.</p>
* </li>
* </ul>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { SupportClient, DescribeCreateCaseOptionsCommand } from "@aws-sdk/client-support"; // ES Modules import
* // const { SupportClient, DescribeCreateCaseOptionsCommand } = require("@aws-sdk/client-support"); // CommonJS import
* const client = new SupportClient(config);
* const input = { // DescribeCreateCaseOptionsRequest
* issueType: "STRING_VALUE", // required
* serviceCode: "STRING_VALUE", // required
* language: "STRING_VALUE", // required
* categoryCode: "STRING_VALUE", // required
* };
* const command = new DescribeCreateCaseOptionsCommand(input);
* const response = await client.send(command);
* // { // DescribeCreateCaseOptionsResponse
* // languageAvailability: "STRING_VALUE",
* // communicationTypes: [ // CommunicationTypeOptionsList
* // { // CommunicationTypeOptions
* // type: "STRING_VALUE",
* // supportedHours: [ // SupportedHoursList
* // { // SupportedHour
* // startTime: "STRING_VALUE",
* // endTime: "STRING_VALUE",
* // },
* // ],
* // datesWithoutSupport: [ // DatesWithoutSupportList
* // { // DateInterval
* // startDateTime: "STRING_VALUE",
* // endDateTime: "STRING_VALUE",
* // },
* // ],
* // },
* // ],
* // };
*
* ```
*
* @param DescribeCreateCaseOptionsCommandInput - {@link DescribeCreateCaseOptionsCommandInput}
* @returns {@link DescribeCreateCaseOptionsCommandOutput}
* @see {@link DescribeCreateCaseOptionsCommandInput} for command's `input` shape.
* @see {@link DescribeCreateCaseOptionsCommandOutput} for command's `response` shape.
* @see {@link SupportClientResolvedConfig | config} for SupportClient's `config` shape.
*
* @throws {@link InternalServerError} (server fault)
* <p>An internal server error occurred.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>
* You have exceeded the maximum allowed TPS (Transactions Per Second) for the operations.
* </p>
*
* @throws {@link SupportServiceException}
* <p>Base exception class for all service exceptions from Support service.</p>
*
*/
export class DescribeCreateCaseOptionsCommand extends $Command<
DescribeCreateCaseOptionsCommandInput,
DescribeCreateCaseOptionsCommandOutput,
SupportClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

public static getEndpointParameterInstructions(): EndpointParameterInstructions {
return {
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
Endpoint: { type: "builtInParams", name: "endpoint" },
Region: { type: "builtInParams", name: "region" },
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
};
}

/**
* @public
*/
constructor(readonly input: DescribeCreateCaseOptionsCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: SupportClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<DescribeCreateCaseOptionsCommandInput, DescribeCreateCaseOptionsCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, DescribeCreateCaseOptionsCommand.getEndpointParameterInstructions())
);

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

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

/**
* @internal
*/
private serialize(input: DescribeCreateCaseOptionsCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_DescribeCreateCaseOptionsCommand(input, context);
}

/**
* @internal
*/
private deserialize(
output: __HttpResponse,
context: __SerdeContext
): Promise<DescribeCreateCaseOptionsCommandOutput> {
return de_DescribeCreateCaseOptionsCommand(output, context);
}

// Start section: command_body_extra
// End section: command_body_extra
}
Loading

0 comments on commit 5a9d621

Please sign in to comment.