Skip to content

Commit

Permalink
feat(client-appsync): This update enables introspection of Aurora clu…
Browse files Browse the repository at this point in the history
…ster databases using the RDS Data API
  • Loading branch information
awstools committed Nov 27, 2023
1 parent 59a2041 commit defc236
Show file tree
Hide file tree
Showing 9 changed files with 1,461 additions and 0 deletions.
16 changes: 16 additions & 0 deletions clients/client-appsync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,14 @@ GetDataSource

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appsync/command/GetDataSourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/GetDataSourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/GetDataSourceCommandOutput/)

</details>
<details>
<summary>
GetDataSourceIntrospection
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appsync/command/GetDataSourceIntrospectionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/GetDataSourceIntrospectionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/GetDataSourceIntrospectionCommandOutput/)

</details>
<details>
<summary>
Expand Down Expand Up @@ -579,6 +587,14 @@ ListTypesByAssociation

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appsync/command/ListTypesByAssociationCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/ListTypesByAssociationCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/ListTypesByAssociationCommandOutput/)

</details>
<details>
<summary>
StartDataSourceIntrospection
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/appsync/command/StartDataSourceIntrospectionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/StartDataSourceIntrospectionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-appsync/Interface/StartDataSourceIntrospectionCommandOutput/)

</details>
<details>
<summary>
Expand Down
46 changes: 46 additions & 0 deletions clients/client-appsync/src/AppSync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ import {
GetDataSourceCommandInput,
GetDataSourceCommandOutput,
} from "./commands/GetDataSourceCommand";
import {
GetDataSourceIntrospectionCommand,
GetDataSourceIntrospectionCommandInput,
GetDataSourceIntrospectionCommandOutput,
} from "./commands/GetDataSourceIntrospectionCommand";
import {
GetDomainNameCommand,
GetDomainNameCommandInput,
Expand Down Expand Up @@ -206,6 +211,11 @@ import {
ListTypesByAssociationCommandOutput,
} from "./commands/ListTypesByAssociationCommand";
import { ListTypesCommand, ListTypesCommandInput, ListTypesCommandOutput } from "./commands/ListTypesCommand";
import {
StartDataSourceIntrospectionCommand,
StartDataSourceIntrospectionCommandInput,
StartDataSourceIntrospectionCommandOutput,
} from "./commands/StartDataSourceIntrospectionCommand";
import {
StartSchemaCreationCommand,
StartSchemaCreationCommandInput,
Expand Down Expand Up @@ -293,6 +303,7 @@ const commands = {
GetApiAssociationCommand,
GetApiCacheCommand,
GetDataSourceCommand,
GetDataSourceIntrospectionCommand,
GetDomainNameCommand,
GetFunctionCommand,
GetGraphqlApiCommand,
Expand All @@ -312,6 +323,7 @@ const commands = {
ListTagsForResourceCommand,
ListTypesCommand,
ListTypesByAssociationCommand,
StartDataSourceIntrospectionCommand,
StartSchemaCreationCommand,
StartSchemaMergeCommand,
TagResourceCommand,
Expand Down Expand Up @@ -729,6 +741,23 @@ export interface AppSync {
cb: (err: any, data?: GetDataSourceCommandOutput) => void
): void;

/**
* @see {@link GetDataSourceIntrospectionCommand}
*/
getDataSourceIntrospection(
args: GetDataSourceIntrospectionCommandInput,
options?: __HttpHandlerOptions
): Promise<GetDataSourceIntrospectionCommandOutput>;
getDataSourceIntrospection(
args: GetDataSourceIntrospectionCommandInput,
cb: (err: any, data?: GetDataSourceIntrospectionCommandOutput) => void
): void;
getDataSourceIntrospection(
args: GetDataSourceIntrospectionCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetDataSourceIntrospectionCommandOutput) => void
): void;

/**
* @see {@link GetDomainNameCommand}
*/
Expand Down Expand Up @@ -989,6 +1018,23 @@ export interface AppSync {
cb: (err: any, data?: ListTypesByAssociationCommandOutput) => void
): void;

/**
* @see {@link StartDataSourceIntrospectionCommand}
*/
startDataSourceIntrospection(
args: StartDataSourceIntrospectionCommandInput,
options?: __HttpHandlerOptions
): Promise<StartDataSourceIntrospectionCommandOutput>;
startDataSourceIntrospection(
args: StartDataSourceIntrospectionCommandInput,
cb: (err: any, data?: StartDataSourceIntrospectionCommandOutput) => void
): void;
startDataSourceIntrospection(
args: StartDataSourceIntrospectionCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: StartDataSourceIntrospectionCommandOutput) => void
): void;

/**
* @see {@link StartSchemaCreationCommand}
*/
Expand Down
12 changes: 12 additions & 0 deletions clients/client-appsync/src/AppSyncClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ import { FlushApiCacheCommandInput, FlushApiCacheCommandOutput } from "./command
import { GetApiAssociationCommandInput, GetApiAssociationCommandOutput } from "./commands/GetApiAssociationCommand";
import { GetApiCacheCommandInput, GetApiCacheCommandOutput } from "./commands/GetApiCacheCommand";
import { GetDataSourceCommandInput, GetDataSourceCommandOutput } from "./commands/GetDataSourceCommand";
import {
GetDataSourceIntrospectionCommandInput,
GetDataSourceIntrospectionCommandOutput,
} from "./commands/GetDataSourceIntrospectionCommand";
import { GetDomainNameCommandInput, GetDomainNameCommandOutput } from "./commands/GetDomainNameCommand";
import { GetFunctionCommandInput, GetFunctionCommandOutput } from "./commands/GetFunctionCommand";
import { GetGraphqlApiCommandInput, GetGraphqlApiCommandOutput } from "./commands/GetGraphqlApiCommand";
Expand Down Expand Up @@ -133,6 +137,10 @@ import {
ListTypesByAssociationCommandOutput,
} from "./commands/ListTypesByAssociationCommand";
import { ListTypesCommandInput, ListTypesCommandOutput } from "./commands/ListTypesCommand";
import {
StartDataSourceIntrospectionCommandInput,
StartDataSourceIntrospectionCommandOutput,
} from "./commands/StartDataSourceIntrospectionCommand";
import {
StartSchemaCreationCommandInput,
StartSchemaCreationCommandOutput,
Expand Down Expand Up @@ -195,6 +203,7 @@ export type ServiceInputTypes =
| GetApiAssociationCommandInput
| GetApiCacheCommandInput
| GetDataSourceCommandInput
| GetDataSourceIntrospectionCommandInput
| GetDomainNameCommandInput
| GetFunctionCommandInput
| GetGraphqlApiCommandInput
Expand All @@ -214,6 +223,7 @@ export type ServiceInputTypes =
| ListTagsForResourceCommandInput
| ListTypesByAssociationCommandInput
| ListTypesCommandInput
| StartDataSourceIntrospectionCommandInput
| StartSchemaCreationCommandInput
| StartSchemaMergeCommandInput
| TagResourceCommandInput
Expand Down Expand Up @@ -260,6 +270,7 @@ export type ServiceOutputTypes =
| GetApiAssociationCommandOutput
| GetApiCacheCommandOutput
| GetDataSourceCommandOutput
| GetDataSourceIntrospectionCommandOutput
| GetDomainNameCommandOutput
| GetFunctionCommandOutput
| GetGraphqlApiCommandOutput
Expand All @@ -279,6 +290,7 @@ export type ServiceOutputTypes =
| ListTagsForResourceCommandOutput
| ListTypesByAssociationCommandOutput
| ListTypesCommandOutput
| StartDataSourceIntrospectionCommandOutput
| StartSchemaCreationCommandOutput
| StartSchemaMergeCommandOutput
| TagResourceCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { Command as $Command } from "@smithy/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
SerdeContext as __SerdeContext,
SMITHY_CONTEXT_KEY,
} from "@smithy/types";

import { AppSyncClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AppSyncClient";
import { GetDataSourceIntrospectionRequest, GetDataSourceIntrospectionResponse } from "../models/models_0";
import { de_GetDataSourceIntrospectionCommand, se_GetDataSourceIntrospectionCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link GetDataSourceIntrospectionCommand}.
*/
export interface GetDataSourceIntrospectionCommandInput extends GetDataSourceIntrospectionRequest {}
/**
* @public
*
* The output of {@link GetDataSourceIntrospectionCommand}.
*/
export interface GetDataSourceIntrospectionCommandOutput extends GetDataSourceIntrospectionResponse, __MetadataBearer {}

/**
* @public
* <p>Retrieves the record of an existing introspection. If the retrieval is successful, the result of the
* instrospection will also be returned. If the retrieval fails the operation, an error message will be returned
* instead.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AppSyncClient, GetDataSourceIntrospectionCommand } from "@aws-sdk/client-appsync"; // ES Modules import
* // const { AppSyncClient, GetDataSourceIntrospectionCommand } = require("@aws-sdk/client-appsync"); // CommonJS import
* const client = new AppSyncClient(config);
* const input = { // GetDataSourceIntrospectionRequest
* introspectionId: "STRING_VALUE", // required
* includeModelsSDL: true || false,
* nextToken: "STRING_VALUE",
* maxResults: Number("int"),
* };
* const command = new GetDataSourceIntrospectionCommand(input);
* const response = await client.send(command);
* // { // GetDataSourceIntrospectionResponse
* // introspectionId: "STRING_VALUE",
* // introspectionStatus: "PROCESSING" || "FAILED" || "SUCCESS",
* // introspectionStatusDetail: "STRING_VALUE",
* // introspectionResult: { // DataSourceIntrospectionResult
* // models: [ // DataSourceIntrospectionModels
* // { // DataSourceIntrospectionModel
* // name: "STRING_VALUE",
* // fields: [ // DataSourceIntrospectionModelFields
* // { // DataSourceIntrospectionModelField
* // name: "STRING_VALUE",
* // type: { // DataSourceIntrospectionModelFieldType
* // kind: "STRING_VALUE",
* // name: "STRING_VALUE",
* // type: {
* // kind: "STRING_VALUE",
* // name: "STRING_VALUE",
* // type: "<DataSourceIntrospectionModelFieldType>",
* // values: [ // DataSourceIntrospectionModelFieldTypeValues
* // "STRING_VALUE",
* // ],
* // },
* // values: [
* // "STRING_VALUE",
* // ],
* // },
* // length: Number("long"),
* // },
* // ],
* // primaryKey: { // DataSourceIntrospectionModelIndex
* // name: "STRING_VALUE",
* // fields: [ // DataSourceIntrospectionModelIndexFields
* // "STRING_VALUE",
* // ],
* // },
* // indexes: [ // DataSourceIntrospectionModelIndexes
* // {
* // name: "STRING_VALUE",
* // fields: [
* // "STRING_VALUE",
* // ],
* // },
* // ],
* // sdl: "STRING_VALUE",
* // },
* // ],
* // nextToken: "STRING_VALUE",
* // },
* // };
*
* ```
*
* @param GetDataSourceIntrospectionCommandInput - {@link GetDataSourceIntrospectionCommandInput}
* @returns {@link GetDataSourceIntrospectionCommandOutput}
* @see {@link GetDataSourceIntrospectionCommandInput} for command's `input` shape.
* @see {@link GetDataSourceIntrospectionCommandOutput} for command's `response` shape.
* @see {@link AppSyncClientResolvedConfig | config} for AppSyncClient's `config` shape.
*
* @throws {@link BadRequestException} (client fault)
* <p>The request is not well formed. For example, a value is invalid or a required field is
* missing. Check the field values, and then try again.</p>
*
* @throws {@link InternalFailureException} (server fault)
* <p>An internal AppSync error occurred. Try your request again.</p>
*
* @throws {@link NotFoundException} (client fault)
* <p>The resource specified in the request was not found. Check the resource, and then try
* again.</p>
*
* @throws {@link AppSyncServiceException}
* <p>Base exception class for all service exceptions from AppSync service.</p>
*
*/
export class GetDataSourceIntrospectionCommand extends $Command<
GetDataSourceIntrospectionCommandInput,
GetDataSourceIntrospectionCommandOutput,
AppSyncClientResolvedConfig
> {
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: GetDataSourceIntrospectionCommandInput) {
super();
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: AppSyncClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetDataSourceIntrospectionCommandInput, GetDataSourceIntrospectionCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, GetDataSourceIntrospectionCommand.getEndpointParameterInstructions())
);

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

const { logger } = configuration;
const clientName = "AppSyncClient";
const commandName = "GetDataSourceIntrospectionCommand";
const handlerExecutionContext: HandlerExecutionContext = {
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
outputFilterSensitiveLog: (_: any) => _,
[SMITHY_CONTEXT_KEY]: {
service: "AWSDeepdishControlPlaneService",
operation: "GetDataSourceIntrospection",
},
};
const { requestHandler } = configuration;
return stack.resolve(
(request: FinalizeHandlerArguments<any>) =>
requestHandler.handle(request.request as __HttpRequest, options || {}),
handlerExecutionContext
);
}

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

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

0 comments on commit defc236

Please sign in to comment.