Skip to content

Commit

Permalink
feat(client-appflow): This release adds new API to reset connector me…
Browse files Browse the repository at this point in the history
…tadata cache
  • Loading branch information
awstools committed Jun 20, 2023
1 parent fa71f14 commit d0594b9
Show file tree
Hide file tree
Showing 8 changed files with 447 additions and 4 deletions.
8 changes: 8 additions & 0 deletions clients/client-appflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,14 @@ RegisterConnector

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-appflow/classes/registerconnectorcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-appflow/interfaces/registerconnectorcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-appflow/interfaces/registerconnectorcommandoutput.html)

</details>
<details>
<summary>
ResetConnectorMetadataCache
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-appflow/classes/resetconnectormetadatacachecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-appflow/interfaces/resetconnectormetadatacachecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-appflow/interfaces/resetconnectormetadatacachecommandoutput.html)

</details>
<details>
<summary>
Expand Down
23 changes: 23 additions & 0 deletions clients/client-appflow/src/Appflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ import {
RegisterConnectorCommandInput,
RegisterConnectorCommandOutput,
} from "./commands/RegisterConnectorCommand";
import {
ResetConnectorMetadataCacheCommand,
ResetConnectorMetadataCacheCommandInput,
ResetConnectorMetadataCacheCommandOutput,
} from "./commands/ResetConnectorMetadataCacheCommand";
import { StartFlowCommand, StartFlowCommandInput, StartFlowCommandOutput } from "./commands/StartFlowCommand";
import { StopFlowCommand, StopFlowCommandInput, StopFlowCommandOutput } from "./commands/StopFlowCommand";
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
Expand Down Expand Up @@ -113,6 +118,7 @@ const commands = {
ListFlowsCommand,
ListTagsForResourceCommand,
RegisterConnectorCommand,
ResetConnectorMetadataCacheCommand,
StartFlowCommand,
StopFlowCommand,
TagResourceCommand,
Expand Down Expand Up @@ -369,6 +375,23 @@ export interface Appflow {
cb: (err: any, data?: RegisterConnectorCommandOutput) => void
): void;

/**
* @see {@link ResetConnectorMetadataCacheCommand}
*/
resetConnectorMetadataCache(
args: ResetConnectorMetadataCacheCommandInput,
options?: __HttpHandlerOptions
): Promise<ResetConnectorMetadataCacheCommandOutput>;
resetConnectorMetadataCache(
args: ResetConnectorMetadataCacheCommandInput,
cb: (err: any, data?: ResetConnectorMetadataCacheCommandOutput) => void
): void;
resetConnectorMetadataCache(
args: ResetConnectorMetadataCacheCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ResetConnectorMetadataCacheCommandOutput) => void
): void;

/**
* @see {@link StartFlowCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-appflow/src/AppflowClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ import {
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import { RegisterConnectorCommandInput, RegisterConnectorCommandOutput } from "./commands/RegisterConnectorCommand";
import {
ResetConnectorMetadataCacheCommandInput,
ResetConnectorMetadataCacheCommandOutput,
} from "./commands/ResetConnectorMetadataCacheCommand";
import { StartFlowCommandInput, StartFlowCommandOutput } from "./commands/StartFlowCommand";
import { StopFlowCommandInput, StopFlowCommandOutput } from "./commands/StopFlowCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
Expand Down Expand Up @@ -138,6 +142,7 @@ export type ServiceInputTypes =
| ListFlowsCommandInput
| ListTagsForResourceCommandInput
| RegisterConnectorCommandInput
| ResetConnectorMetadataCacheCommandInput
| StartFlowCommandInput
| StopFlowCommandInput
| TagResourceCommandInput
Expand Down Expand Up @@ -167,6 +172,7 @@ export type ServiceOutputTypes =
| ListFlowsCommandOutput
| ListTagsForResourceCommandOutput
| RegisterConnectorCommandOutput
| ResetConnectorMetadataCacheCommandOutput
| StartFlowCommandOutput
| StopFlowCommandOutput
| TagResourceCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
// smithy-typescript generated code
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
import { Command as $Command } from "@aws-sdk/smithy-client";
import {
FinalizeHandlerArguments,
Handler,
HandlerExecutionContext,
HttpHandlerOptions as __HttpHandlerOptions,
MetadataBearer as __MetadataBearer,
MiddlewareStack,
} from "@aws-sdk/types";
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
import { SerdeContext as __SerdeContext } from "@smithy/types";

import { AppflowClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../AppflowClient";
import { ResetConnectorMetadataCacheRequest, ResetConnectorMetadataCacheResponse } from "../models/models_0";
import {
de_ResetConnectorMetadataCacheCommand,
se_ResetConnectorMetadataCacheCommand,
} from "../protocols/Aws_restJson1";

/**
* @public
*/
export { __MetadataBearer, $Command };
/**
* @public
*
* The input for {@link ResetConnectorMetadataCacheCommand}.
*/
export interface ResetConnectorMetadataCacheCommandInput extends ResetConnectorMetadataCacheRequest {}
/**
* @public
*
* The output of {@link ResetConnectorMetadataCacheCommand}.
*/
export interface ResetConnectorMetadataCacheCommandOutput
extends ResetConnectorMetadataCacheResponse,
__MetadataBearer {}

/**
* @public
* <p>Resets metadata about your connector entities that Amazon AppFlow stored in its
* cache. Use this action when you want Amazon AppFlow to return the latest information
* about the data that you have in a source application.</p>
* <p>Amazon AppFlow returns metadata about your entities when you use the
* ListConnectorEntities or DescribeConnectorEntities actions. Following these actions, Amazon AppFlow caches the metadata to reduce the number of API requests that it must send to
* the source application. Amazon AppFlow automatically resets the cache once every hour,
* but you can use this action when you want to get the latest metadata right away.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { AppflowClient, ResetConnectorMetadataCacheCommand } from "@aws-sdk/client-appflow"; // ES Modules import
* // const { AppflowClient, ResetConnectorMetadataCacheCommand } = require("@aws-sdk/client-appflow"); // CommonJS import
* const client = new AppflowClient(config);
* const input = { // ResetConnectorMetadataCacheRequest
* connectorProfileName: "STRING_VALUE",
* connectorType: "Salesforce" || "Singular" || "Slack" || "Redshift" || "S3" || "Marketo" || "Googleanalytics" || "Zendesk" || "Servicenow" || "Datadog" || "Trendmicro" || "Snowflake" || "Dynatrace" || "Infornexus" || "Amplitude" || "Veeva" || "EventBridge" || "LookoutMetrics" || "Upsolver" || "Honeycode" || "CustomerProfiles" || "SAPOData" || "CustomConnector" || "Pardot",
* connectorEntityName: "STRING_VALUE",
* entitiesPath: "STRING_VALUE",
* apiVersion: "STRING_VALUE",
* };
* const command = new ResetConnectorMetadataCacheCommand(input);
* const response = await client.send(command);
* // {};
*
* ```
*
* @param ResetConnectorMetadataCacheCommandInput - {@link ResetConnectorMetadataCacheCommandInput}
* @returns {@link ResetConnectorMetadataCacheCommandOutput}
* @see {@link ResetConnectorMetadataCacheCommandInput} for command's `input` shape.
* @see {@link ResetConnectorMetadataCacheCommandOutput} for command's `response` shape.
* @see {@link AppflowClientResolvedConfig | config} for AppflowClient's `config` shape.
*
* @throws {@link ConflictException} (client fault)
* <p> There was a conflict when processing the request (for example, a flow with the given name
* already exists within the account. Check for conflicting resource names and try again. </p>
*
* @throws {@link InternalServerException} (server fault)
* <p> An internal service error occurred during the processing of your request. Try again
* later. </p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p> The resource specified in the request (such as the source or destination connector
* profile) is not found. </p>
*
* @throws {@link ValidationException} (client fault)
* <p> The request has invalid or missing parameters. </p>
*
* @throws {@link AppflowServiceException}
* <p>Base exception class for all service exceptions from Appflow service.</p>
*
*/
export class ResetConnectorMetadataCacheCommand extends $Command<
ResetConnectorMetadataCacheCommandInput,
ResetConnectorMetadataCacheCommandOutput,
AppflowClientResolvedConfig
> {
// 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: ResetConnectorMetadataCacheCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: AppflowClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ResetConnectorMetadataCacheCommandInput, ResetConnectorMetadataCacheCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, ResetConnectorMetadataCacheCommand.getEndpointParameterInstructions())
);

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

const { logger } = configuration;
const clientName = "AppflowClient";
const commandName = "ResetConnectorMetadataCacheCommand";
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: ResetConnectorMetadataCacheCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return se_ResetConnectorMetadataCacheCommand(input, context);
}

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

// Start section: command_body_extra
// End section: command_body_extra
}
1 change: 1 addition & 0 deletions clients/client-appflow/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export * from "./ListConnectorsCommand";
export * from "./ListFlowsCommand";
export * from "./ListTagsForResourceCommand";
export * from "./RegisterConnectorCommand";
export * from "./ResetConnectorMetadataCacheCommand";
export * from "./StartFlowCommand";
export * from "./StopFlowCommand";
export * from "./TagResourceCommand";
Expand Down
69 changes: 66 additions & 3 deletions clients/client-appflow/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1001,12 +1001,13 @@ export interface DataTransferApi {
* <dt>AUTOMATIC</dt>
* <dd>
* <p>The default. Optimizes a flow for datasets that fluctuate in size from small to
* large. For each flow run, Amazon AppFlow chooses to use the SYNC or ASYNC API type based on
* the amount of data that the run transfers.</p>
* large. For each flow run, Amazon AppFlow chooses to use the SYNC or ASYNC API type
* based on the amount of data that the run transfers.</p>
* </dd>
* <dt>SYNC</dt>
* <dd>
* <p>A synchronous API. This type of API optimizes a flow for small to medium-sized datasets.</p>
* <p>A synchronous API. This type of API optimizes a flow for small to medium-sized
* datasets.</p>
* </dd>
* <dt>ASYNC</dt>
* <dd>
Expand Down Expand Up @@ -5839,6 +5840,68 @@ export interface RegisterConnectorResponse {
connectorArn?: string;
}

/**
* @public
*/
export interface ResetConnectorMetadataCacheRequest {
/**
* <p>The name of the connector profile that you want to reset cached metadata for.</p>
* <p>You can omit this parameter if you're resetting the cache for any of the following
* connectors: Amazon Connect, Amazon EventBridge, Amazon Lookout for Metrics, Amazon S3, or Upsolver. If you're resetting the cache for any other connector, you must include this
* parameter in your request.</p>
*/
connectorProfileName?: string;

/**
* <p>The type of connector to reset cached metadata for.</p>
* <p>You must include this parameter in your request if you're resetting the cache for any of
* the following connectors: Amazon Connect, Amazon EventBridge, Amazon Lookout for Metrics,
* Amazon S3, or Upsolver. If you're resetting the cache for any other connector, you
* can omit this parameter from your request. </p>
*/
connectorType?: ConnectorType | string;

/**
* <p>Use this parameter if you want to reset cached metadata about the details for an
* individual entity.</p>
* <p>If you don't include this parameter in your request, Amazon AppFlow only resets
* cached metadata about entity names, not entity details.</p>
*/
connectorEntityName?: string;

/**
* <p>Use this parameter only if you’re resetting the cached metadata about a nested entity.
* Only some connectors support nested entities. A nested entity is one that has another entity
* as a parent. To use this parameter, specify the name of the parent entity.</p>
* <p>To look up the parent-child relationship of entities, you can send a ListConnectorEntities
* request that omits the entitiesPath parameter. Amazon AppFlow will return a list of
* top-level entities. For each one, it indicates whether the entity has nested entities. Then,
* in a subsequent ListConnectorEntities request, you can specify a parent entity name for the
* entitiesPath parameter. Amazon AppFlow will return a list of the child entities for that
* parent.</p>
*/
entitiesPath?: string;

/**
* <p>The API version that you specified in the connector profile that you’re resetting cached
* metadata for. You must use this parameter only if the connector supports multiple API versions
* or if the connector type is CustomConnector.</p>
* <p>To look up how many versions a connector supports, use the DescribeConnectors action. In
* the response, find the value that Amazon AppFlow returns for the connectorVersion
* parameter.</p>
* <p>To look up the connector type, use the DescribeConnectorProfiles action. In the response,
* find the value that Amazon AppFlow returns for the connectorType parameter.</p>
* <p>To look up the API version that you specified in a connector profile, use the
* DescribeConnectorProfiles action.</p>
*/
apiVersion?: string;
}

/**
* @public
*/
export interface ResetConnectorMetadataCacheResponse {}

/**
* @public
*/
Expand Down
Loading

0 comments on commit d0594b9

Please sign in to comment.