Skip to content

Commit

Permalink
feat(client-appflow): This release adds a Client Token parameter to t…
Browse files Browse the repository at this point in the history
…he following AppFlow APIs: Create/Update Connector Profile, Create/Update Flow, Start Flow, Register Connector, Update Connector Registration. The Client Token parameter allows idempotent operations for these APIs.
  • Loading branch information
awstools committed Apr 17, 2023
1 parent 6f369a9 commit 7be646f
Show file tree
Hide file tree
Showing 11 changed files with 297 additions and 70 deletions.
4 changes: 3 additions & 1 deletion clients/client-appflow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,14 @@
"@aws-sdk/util-user-agent-browser": "*",
"@aws-sdk/util-user-agent-node": "*",
"@aws-sdk/util-utf8": "*",
"tslib": "^2.5.0"
"tslib": "^2.5.0",
"uuid": "^8.3.2"
},
"devDependencies": {
"@aws-sdk/service-client-documentation-generator": "*",
"@tsconfig/node14": "1.0.3",
"@types/node": "^14.14.31",
"@types/uuid": "^8.3.0",
"concurrently": "7.0.0",
"downlevel-dts": "0.10.1",
"rimraf": "3.0.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ export interface CreateConnectorProfileCommandOutput extends CreateConnectorProf
* },
* },
* },
* clientToken: "STRING_VALUE",
* };
* const command = new CreateConnectorProfileCommand(input);
* const response = await client.send(command);
Expand Down
1 change: 1 addition & 0 deletions clients/client-appflow/src/commands/CreateFlowCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ export interface CreateFlowCommandOutput extends CreateFlowResponse, __MetadataB
* tablePrefix: "STRING_VALUE", // required
* },
* },
* clientToken: "STRING_VALUE",
* };
* const command = new CreateFlowCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface RegisterConnectorCommandOutput extends RegisterConnectorRespons
* lambdaArn: "STRING_VALUE", // required
* },
* },
* clientToken: "STRING_VALUE",
* };
* const command = new RegisterConnectorCommand(input);
* const response = await client.send(command);
Expand Down
1 change: 1 addition & 0 deletions clients/client-appflow/src/commands/StartFlowCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface StartFlowCommandOutput extends StartFlowResponse, __MetadataBea
* const client = new AppflowClient(config);
* const input = { // StartFlowRequest
* flowName: "STRING_VALUE", // required
* clientToken: "STRING_VALUE",
* };
* const command = new StartFlowCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ export interface UpdateConnectorProfileCommandOutput extends UpdateConnectorProf
* },
* },
* },
* clientToken: "STRING_VALUE",
* };
* const command = new UpdateConnectorProfileCommand(input);
* const response = await client.send(command);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface UpdateConnectorRegistrationCommandOutput
* lambdaArn: "STRING_VALUE", // required
* },
* },
* clientToken: "STRING_VALUE",
* };
* const command = new UpdateConnectorRegistrationCommand(input);
* const response = await client.send(command);
Expand Down
1 change: 1 addition & 0 deletions clients/client-appflow/src/commands/UpdateFlowCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ export interface UpdateFlowCommandOutput extends UpdateFlowResponse, __MetadataB
* tablePrefix: "STRING_VALUE", // required
* },
* },
* clientToken: "STRING_VALUE",
* };
* const command = new UpdateFlowCommand(input);
* const response = await client.send(command);
Expand Down
101 changes: 101 additions & 0 deletions clients/client-appflow/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3177,6 +3177,20 @@ export interface CreateConnectorProfileRequest {
* <p> Defines the connector-specific configuration and credentials. </p>
*/
connectorProfileConfig: ConnectorProfileConfig | undefined;

/**
* <p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your
* <code>CreateConnectorProfile</code> request completes only once. You choose the value to
* pass. For example, if you don't receive a response from your request, you can safely retry the
* request with the same <code>clientToken</code> parameter value.</p>
* <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are
* using inserts a value for you. This way, the SDK can safely retry requests multiple times
* after a network error. You must provide your own value for other use cases.</p>
* <p>If you specify input parameters that differ from your first request, an error occurs. If
* you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new
* call to <code>CreateConnectorProfile</code>. The token is active for 8 hours.</p>
*/
clientToken?: string;
}

/**
Expand Down Expand Up @@ -4683,6 +4697,20 @@ export interface CreateFlowRequest {
* stores metadata in a data catalog.</p>
*/
metadataCatalogConfig?: MetadataCatalogConfig;

/**
* <p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your
* <code>CreateFlow</code> request completes only once. You choose the value to
* pass. For example, if you don't receive a response from your request, you can safely retry the
* request with the same <code>clientToken</code> parameter value.</p>
* <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are
* using inserts a value for you. This way, the SDK can safely retry requests multiple times
* after a network error. You must provide your own value for other use cases.</p>
* <p>If you specify input parameters that differ from your first request, an error occurs. If
* you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new
* call to <code>CreateFlow</code>. The token is active for 8 hours.</p>
*/
clientToken?: string;
}

/**
Expand Down Expand Up @@ -5563,6 +5591,20 @@ export interface RegisterConnectorRequest {
* LAMBDA.</p>
*/
connectorProvisioningConfig?: ConnectorProvisioningConfig;

/**
* <p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your
* <code>RegisterConnector</code> request completes only once. You choose the value to
* pass. For example, if you don't receive a response from your request, you can safely retry the
* request with the same <code>clientToken</code> parameter value.</p>
* <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are
* using inserts a value for you. This way, the SDK can safely retry requests multiple times
* after a network error. You must provide your own value for other use cases.</p>
* <p>If you specify input parameters that differ from your first request, an error occurs. If
* you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new
* call to <code>RegisterConnector</code>. The token is active for 8 hours.</p>
*/
clientToken?: string;
}

/**
Expand Down Expand Up @@ -5605,6 +5647,23 @@ export interface StartFlowRequest {
* (-) only. </p>
*/
flowName: string | undefined;

/**
* <p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your
* <code>StartFlow</code> request completes only once. You choose the value to
* pass. For example, if you don't receive a response from your request, you can safely retry the
* request with the same <code>clientToken</code> parameter value.</p>
* <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are
* using inserts a value for you. This way, the SDK can safely retry requests multiple times
* after a network error. You must provide your own value for other use cases.</p>
* <p>If you specify input parameters that differ from your first request, an error occurs for
* flows that run on a schedule or based on an event. However, the error doesn't occur for flows
* that run on demand. You set the conditions that initiate your flow for the
* <code>triggerConfig</code> parameter.</p>
* <p>If you use a different value for <code>clientToken</code>, Amazon AppFlow considers
* it a new call to <code>StartFlow</code>. The token is active for 8 hours.</p>
*/
clientToken?: string;
}

/**
Expand Down Expand Up @@ -5755,6 +5814,20 @@ export interface UpdateConnectorProfileRequest {
* <p> Defines the connector-specific profile configuration and credentials. </p>
*/
connectorProfileConfig: ConnectorProfileConfig | undefined;

/**
* <p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your
* <code>UpdateConnectorProfile</code> request completes only once. You choose the value to
* pass. For example, if you don't receive a response from your request, you can safely retry the
* request with the same <code>clientToken</code> parameter value.</p>
* <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are
* using inserts a value for you. This way, the SDK can safely retry requests multiple times
* after a network error. You must provide your own value for other use cases.</p>
* <p>If you specify input parameters that differ from your first request, an error occurs. If
* you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new
* call to <code>UpdateConnectorProfile</code>. The token is active for 8 hours.</p>
*/
clientToken?: string;
}

/**
Expand Down Expand Up @@ -5786,6 +5859,20 @@ export interface UpdateConnectorRegistrationRequest {
* <p>Contains information about the configuration of the connector being registered.</p>
*/
connectorProvisioningConfig?: ConnectorProvisioningConfig;

/**
* <p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your
* <code>UpdateConnectorRegistration</code> request completes only once. You choose the value to
* pass. For example, if you don't receive a response from your request, you can safely retry the
* request with the same <code>clientToken</code> parameter value.</p>
* <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are
* using inserts a value for you. This way, the SDK can safely retry requests multiple times
* after a network error. You must provide your own value for other use cases.</p>
* <p>If you specify input parameters that differ from your first request, an error occurs. If
* you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new
* call to <code>UpdateConnectorRegistration</code>. The token is active for 8 hours.</p>
*/
clientToken?: string;
}

/**
Expand Down Expand Up @@ -5842,6 +5929,20 @@ export interface UpdateFlowRequest {
* stores metadata in a data catalog.</p>
*/
metadataCatalogConfig?: MetadataCatalogConfig;

/**
* <p>The <code>clientToken</code> parameter is an idempotency token. It ensures that your
* <code>UpdateFlow</code> request completes only once. You choose the value to
* pass. For example, if you don't receive a response from your request, you can safely retry the
* request with the same <code>clientToken</code> parameter value.</p>
* <p>If you omit a <code>clientToken</code> value, the Amazon Web Services SDK that you are
* using inserts a value for you. This way, the SDK can safely retry requests multiple times
* after a network error. You must provide your own value for other use cases.</p>
* <p>If you specify input parameters that differ from your first request, an error occurs. If
* you use a different value for <code>clientToken</code>, Amazon AppFlow considers it a new
* call to <code>UpdateFlow</code>. The token is active for 8 hours.</p>
*/
clientToken?: string;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions clients/client-appflow/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
ResponseMetadata as __ResponseMetadata,
SerdeContext as __SerdeContext,
} from "@aws-sdk/types";
import { v4 as generateIdempotencyToken } from "uuid";

import {
CreateConnectorProfileCommandInput,
Expand Down Expand Up @@ -219,6 +220,7 @@ export const se_CreateConnectorProfileCommand = async (
let body: any;
body = JSON.stringify(
take(input, {
clientToken: (_) => _ ?? generateIdempotencyToken(),
connectionMode: [],
connectorLabel: [],
connectorProfileConfig: (_) => _json(_),
Expand Down Expand Up @@ -253,6 +255,7 @@ export const se_CreateFlowCommand = async (
let body: any;
body = JSON.stringify(
take(input, {
clientToken: (_) => _ ?? generateIdempotencyToken(),
description: [],
destinationFlowConfigList: (_) => _json(_),
flowName: [],
Expand Down Expand Up @@ -658,6 +661,7 @@ export const se_RegisterConnectorCommand = async (
let body: any;
body = JSON.stringify(
take(input, {
clientToken: (_) => _ ?? generateIdempotencyToken(),
connectorLabel: [],
connectorProvisioningConfig: (_) => _json(_),
connectorProvisioningType: [],
Expand Down Expand Up @@ -690,6 +694,7 @@ export const se_StartFlowCommand = async (
let body: any;
body = JSON.stringify(
take(input, {
clientToken: (_) => _ ?? generateIdempotencyToken(),
flowName: [],
})
);
Expand Down Expand Up @@ -839,6 +844,7 @@ export const se_UpdateConnectorProfileCommand = async (
let body: any;
body = JSON.stringify(
take(input, {
clientToken: (_) => _ ?? generateIdempotencyToken(),
connectionMode: [],
connectorProfileConfig: (_) => _json(_),
connectorProfileName: [],
Expand Down Expand Up @@ -871,6 +877,7 @@ export const se_UpdateConnectorRegistrationCommand = async (
let body: any;
body = JSON.stringify(
take(input, {
clientToken: (_) => _ ?? generateIdempotencyToken(),
connectorLabel: [],
connectorProvisioningConfig: (_) => _json(_),
description: [],
Expand Down Expand Up @@ -902,6 +909,7 @@ export const se_UpdateFlowCommand = async (
let body: any;
body = JSON.stringify(
take(input, {
clientToken: (_) => _ ?? generateIdempotencyToken(),
description: [],
destinationFlowConfigList: (_) => _json(_),
flowName: [],
Expand Down
Loading

0 comments on commit 7be646f

Please sign in to comment.