Skip to content

Commit

Permalink
feat(client-cleanrooms): GA Release of AWS Clean Rooms, Added Tagging…
Browse files Browse the repository at this point in the history
… Functionality
  • Loading branch information
awstools committed Mar 21, 2023
1 parent 86a6046 commit b310676
Show file tree
Hide file tree
Showing 14 changed files with 1,397 additions and 239 deletions.
29 changes: 25 additions & 4 deletions clients/client-cleanrooms/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@

AWS SDK for JavaScript CleanRooms Client for Node.js, Browser and React Native.

<note>
<p>AWS Clean Rooms is in preview release and is subject to change.</p>
</note>
<p>Welcome to the <i>AWS Clean Rooms API Reference</i>.</p>
<p>AWS Clean Rooms is an AWS service that helps multiple parties to join their data
together in a secure collaboration workspace. In the collaboration, members who can query
and receive results can get insights into the combined data without either party getting
and receive results can get insights into the collective datasets without either party getting
access to the other party's raw data.</p>
<p>To learn more about AWS Clean Rooms concepts, procedures, and best practices, see the
<a href="https://docs.aws.amazon.com/clean-rooms/latest/userguide/what-is.html">AWS Clean
Expand Down Expand Up @@ -431,6 +428,14 @@ ListSchemas

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/classes/listschemascommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/interfaces/listschemascommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/interfaces/listschemascommandoutput.html)

</details>
<details>
<summary>
ListTagsForResource
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/classes/listtagsforresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/interfaces/listtagsforresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/interfaces/listtagsforresourcecommandoutput.html)

</details>
<details>
<summary>
Expand All @@ -439,6 +444,22 @@ StartProtectedQuery

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/classes/startprotectedquerycommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/interfaces/startprotectedquerycommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/interfaces/startprotectedquerycommandoutput.html)

</details>
<details>
<summary>
TagResource
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/classes/tagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/interfaces/tagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/interfaces/tagresourcecommandoutput.html)

</details>
<details>
<summary>
UntagResource
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/classes/untagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/interfaces/untagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cleanrooms/interfaces/untagresourcecommandoutput.html)

</details>
<details>
<summary>
Expand Down
108 changes: 103 additions & 5 deletions clients/client-cleanrooms/src/CleanRooms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,22 @@ import {
ListProtectedQueriesCommandOutput,
} from "./commands/ListProtectedQueriesCommand";
import { ListSchemasCommand, ListSchemasCommandInput, ListSchemasCommandOutput } from "./commands/ListSchemasCommand";
import {
ListTagsForResourceCommand,
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import {
StartProtectedQueryCommand,
StartProtectedQueryCommandInput,
StartProtectedQueryCommandOutput,
} from "./commands/StartProtectedQueryCommand";
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import {
UntagResourceCommand,
UntagResourceCommandInput,
UntagResourceCommandOutput,
} from "./commands/UntagResourceCommand";
import {
UpdateCollaborationCommand,
UpdateCollaborationCommandInput,
Expand Down Expand Up @@ -162,13 +173,10 @@ import {
} from "./commands/UpdateProtectedQueryCommand";

/**
* <note>
* <p>AWS Clean Rooms is in preview release and is subject to change.</p>
* </note>
* <p>Welcome to the <i>AWS Clean Rooms API Reference</i>.</p>
* <p>Welcome to the <i>AWS Clean Rooms API Reference</i>.</p>
* <p>AWS Clean Rooms is an AWS service that helps multiple parties to join their data
* together in a secure collaboration workspace. In the collaboration, members who can query
* and receive results can get insights into the combined data without either party getting
* and receive results can get insights into the collective datasets without either party getting
* access to the other party's raw data.</p>
* <p>To learn more about AWS Clean Rooms concepts, procedures, and best practices, see the
* <a href="https://docs.aws.amazon.com/clean-rooms/latest/userguide/what-is.html">AWS Clean
Expand Down Expand Up @@ -1023,6 +1031,38 @@ export class CleanRooms extends CleanRoomsClient {
}
}

/**
* <p>Lists all of the tags that have been added to a resource.</p>
*/
public listTagsForResource(
args: ListTagsForResourceCommandInput,
options?: __HttpHandlerOptions
): Promise<ListTagsForResourceCommandOutput>;
public listTagsForResource(
args: ListTagsForResourceCommandInput,
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
): void;
public listTagsForResource(
args: ListTagsForResourceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
): void;
public listTagsForResource(
args: ListTagsForResourceCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListTagsForResourceCommandOutput) => void),
cb?: (err: any, data?: ListTagsForResourceCommandOutput) => void
): Promise<ListTagsForResourceCommandOutput> | void {
const command = new ListTagsForResourceCommand(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);
}
}

/**
* <p>Creates a protected query that is started by AWS Clean Rooms.</p>
*/
Expand Down Expand Up @@ -1055,6 +1095,64 @@ export class CleanRooms extends CleanRoomsClient {
}
}

/**
* <p>Tags a resource.</p>
*/
public tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;
public tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
public tagResource(
args: TagResourceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: TagResourceCommandOutput) => void
): void;
public tagResource(
args: TagResourceCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: TagResourceCommandOutput) => void),
cb?: (err: any, data?: TagResourceCommandOutput) => void
): Promise<TagResourceCommandOutput> | void {
const command = new TagResourceCommand(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);
}
}

/**
* <p>Removes a tag or list of tags from a resource.</p>
*/
public untagResource(
args: UntagResourceCommandInput,
options?: __HttpHandlerOptions
): Promise<UntagResourceCommandOutput>;
public untagResource(
args: UntagResourceCommandInput,
cb: (err: any, data?: UntagResourceCommandOutput) => void
): void;
public untagResource(
args: UntagResourceCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: UntagResourceCommandOutput) => void
): void;
public untagResource(
args: UntagResourceCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: UntagResourceCommandOutput) => void),
cb?: (err: any, data?: UntagResourceCommandOutput) => void
): Promise<UntagResourceCommandOutput> | void {
const command = new UntagResourceCommand(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);
}
}

/**
* <p>Updates collaboration metadata and can only be called by the collaboration owner.</p>
*/
Expand Down
19 changes: 14 additions & 5 deletions clients/client-cleanrooms/src/CleanRoomsClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,16 @@ import {
ListProtectedQueriesCommandOutput,
} from "./commands/ListProtectedQueriesCommand";
import { ListSchemasCommandInput, ListSchemasCommandOutput } from "./commands/ListSchemasCommand";
import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import {
StartProtectedQueryCommandInput,
StartProtectedQueryCommandOutput,
} from "./commands/StartProtectedQueryCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
import {
UpdateCollaborationCommandInput,
UpdateCollaborationCommandOutput,
Expand Down Expand Up @@ -179,7 +185,10 @@ export type ServiceInputTypes =
| ListMembershipsCommandInput
| ListProtectedQueriesCommandInput
| ListSchemasCommandInput
| ListTagsForResourceCommandInput
| StartProtectedQueryCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
| UpdateCollaborationCommandInput
| UpdateConfiguredTableAnalysisRuleCommandInput
| UpdateConfiguredTableAssociationCommandInput
Expand Down Expand Up @@ -215,7 +224,10 @@ export type ServiceOutputTypes =
| ListMembershipsCommandOutput
| ListProtectedQueriesCommandOutput
| ListSchemasCommandOutput
| ListTagsForResourceCommandOutput
| StartProtectedQueryCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
| UpdateCollaborationCommandOutput
| UpdateConfiguredTableAnalysisRuleCommandOutput
| UpdateConfiguredTableAssociationCommandOutput
Expand Down Expand Up @@ -373,13 +385,10 @@ type CleanRoomsClientResolvedConfigType = __SmithyResolvedConfiguration<__HttpHa
export interface CleanRoomsClientResolvedConfig extends CleanRoomsClientResolvedConfigType {}

/**
* <note>
* <p>AWS Clean Rooms is in preview release and is subject to change.</p>
* </note>
* <p>Welcome to the <i>AWS Clean Rooms API Reference</i>.</p>
* <p>Welcome to the <i>AWS Clean Rooms API Reference</i>.</p>
* <p>AWS Clean Rooms is an AWS service that helps multiple parties to join their data
* together in a secure collaboration workspace. In the collaboration, members who can query
* and receive results can get insights into the combined data without either party getting
* and receive results can get insights into the collective datasets without either party getting
* access to the other party's raw data.</p>
* <p>To learn more about AWS Clean Rooms concepts, procedures, and best practices, see the
* <a href="https://docs.aws.amazon.com/clean-rooms/latest/userguide/what-is.html">AWS Clean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ export interface ListConfiguredTableAssociationsCommandOutput
* @throws {@link InternalServerException} (server fault)
* <p>Unexpected error during processing of request.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>Request references a resource which does not exist.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>Request was denied due to request throttling.</p>
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ export interface ListProtectedQueriesCommandOutput extends ListProtectedQueriesO
* @throws {@link InternalServerException} (server fault)
* <p>Unexpected error during processing of request.</p>
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>Request references a resource which does not exist.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>Request was denied due to request throttling.</p>
*
Expand Down
127 changes: 127 additions & 0 deletions clients/client-cleanrooms/src/commands/ListTagsForResourceCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
// 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 { CleanRoomsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CleanRoomsClient";
import {
ListTagsForResourceInput,
ListTagsForResourceInputFilterSensitiveLog,
ListTagsForResourceOutput,
ListTagsForResourceOutputFilterSensitiveLog,
} from "../models/models_0";
import {
deserializeAws_restJson1ListTagsForResourceCommand,
serializeAws_restJson1ListTagsForResourceCommand,
} from "../protocols/Aws_restJson1";

/**
* The input for {@link ListTagsForResourceCommand}.
*/
export interface ListTagsForResourceCommandInput extends ListTagsForResourceInput {}
/**
* The output of {@link ListTagsForResourceCommand}.
*/
export interface ListTagsForResourceCommandOutput extends ListTagsForResourceOutput, __MetadataBearer {}

/**
* <p>Lists all of the tags that have been added to a resource.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { CleanRoomsClient, ListTagsForResourceCommand } from "@aws-sdk/client-cleanrooms"; // ES Modules import
* // const { CleanRoomsClient, ListTagsForResourceCommand } = require("@aws-sdk/client-cleanrooms"); // CommonJS import
* const client = new CleanRoomsClient(config);
* const command = new ListTagsForResourceCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListTagsForResourceCommandInput} for command's `input` shape.
* @see {@link ListTagsForResourceCommandOutput} for command's `response` shape.
* @see {@link CleanRoomsClientResolvedConfig | config} for CleanRoomsClient's `config` shape.
*
* @throws {@link ResourceNotFoundException} (client fault)
* <p>Request references a resource which does not exist.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>The input fails to satisfy the specified constraints.</p>
*
*
*/
export class ListTagsForResourceCommand extends $Command<
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
CleanRoomsClientResolvedConfig
> {
// 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" },
};
}

constructor(readonly input: ListTagsForResourceCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: CleanRoomsClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions())
);

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

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

private serialize(input: ListTagsForResourceCommandInput, context: __SerdeContext): Promise<__HttpRequest> {
return serializeAws_restJson1ListTagsForResourceCommand(input, context);
}

private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<ListTagsForResourceCommandOutput> {
return deserializeAws_restJson1ListTagsForResourceCommand(output, context);
}

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

0 comments on commit b310676

Please sign in to comment.