Skip to content

Commit

Permalink
feat(client-service-catalog-appregistry): This release adds support f…
Browse files Browse the repository at this point in the history
…or tagged resource associations, which allows you to associate a group of resources with a defined resource tag key and value to the application.
  • Loading branch information
awstools committed Nov 17, 2022
1 parent 0528c9c commit 8212786
Show file tree
Hide file tree
Showing 9 changed files with 1,111 additions and 258 deletions.
Expand Up @@ -56,6 +56,11 @@ import {
GetAttributeGroupCommandInput,
GetAttributeGroupCommandOutput,
} from "./commands/GetAttributeGroupCommand";
import {
GetConfigurationCommand,
GetConfigurationCommandInput,
GetConfigurationCommandOutput,
} from "./commands/GetConfigurationCommand";
import {
ListApplicationsCommand,
ListApplicationsCommandInput,
Expand Down Expand Up @@ -86,6 +91,11 @@ import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import {
PutConfigurationCommand,
PutConfigurationCommandInput,
PutConfigurationCommandOutput,
} from "./commands/PutConfigurationCommand";
import {
SyncResourceCommand,
SyncResourceCommandInput,
Expand Down Expand Up @@ -470,6 +480,41 @@ export class ServiceCatalogAppRegistry extends ServiceCatalogAppRegistryClient {
}
}

/**
* <p>
* Retrieves a <code>TagKey</code> configuration
* from an account.
* </p>
*/
public getConfiguration(
args: GetConfigurationCommandInput,
options?: __HttpHandlerOptions
): Promise<GetConfigurationCommandOutput>;
public getConfiguration(
args: GetConfigurationCommandInput,
cb: (err: any, data?: GetConfigurationCommandOutput) => void
): void;
public getConfiguration(
args: GetConfigurationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: GetConfigurationCommandOutput) => void
): void;
public getConfiguration(
args: GetConfigurationCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: GetConfigurationCommandOutput) => void),
cb?: (err: any, data?: GetConfigurationCommandOutput) => void
): Promise<GetConfigurationCommandOutput> | void {
const command = new GetConfigurationCommand(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>Retrieves a list of all of your applications. Results are paginated.</p>
*/
Expand Down Expand Up @@ -535,7 +580,27 @@ export class ServiceCatalogAppRegistry extends ServiceCatalogAppRegistryClient {
}

/**
* <p>Lists all resources that are associated with specified application. Results are paginated.</p>
* <p>
* Lists all
* of the resources
* that are associated
* with the specified application.
* Results are paginated.
* </p>
* <note>
* <p>
* If you share an application,
* and a consumer account associates a tag query
* to the application,
* all of the users
* who can access the application
* can also view the tag values
* in all accounts
* that are associated
* with it
* using this API.
* </p>
* </note>
*/
public listAssociatedResources(
args: ListAssociatedResourcesCommandInput,
Expand Down Expand Up @@ -662,6 +727,41 @@ export class ServiceCatalogAppRegistry extends ServiceCatalogAppRegistryClient {
}
}

/**
* <p>
* Associates a <code>TagKey</code> configuration
* to an account.
* </p>
*/
public putConfiguration(
args: PutConfigurationCommandInput,
options?: __HttpHandlerOptions
): Promise<PutConfigurationCommandOutput>;
public putConfiguration(
args: PutConfigurationCommandInput,
cb: (err: any, data?: PutConfigurationCommandOutput) => void
): void;
public putConfiguration(
args: PutConfigurationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: PutConfigurationCommandOutput) => void
): void;
public putConfiguration(
args: PutConfigurationCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: PutConfigurationCommandOutput) => void),
cb?: (err: any, data?: PutConfigurationCommandOutput) => void
): Promise<PutConfigurationCommandOutput> | void {
const command = new PutConfigurationCommand(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>Syncs the resource with current AppRegistry records.</p>
* <p>Specifically, the resource’s AppRegistry system tags sync with its associated application. We remove the resource's AppRegistry system tags if it does not associate with the application. The caller must have permissions to read and update the resource.</p>
Expand Down
Expand Up @@ -76,6 +76,7 @@ import {
GetAssociatedResourceCommandOutput,
} from "./commands/GetAssociatedResourceCommand";
import { GetAttributeGroupCommandInput, GetAttributeGroupCommandOutput } from "./commands/GetAttributeGroupCommand";
import { GetConfigurationCommandInput, GetConfigurationCommandOutput } from "./commands/GetConfigurationCommand";
import { ListApplicationsCommandInput, ListApplicationsCommandOutput } from "./commands/ListApplicationsCommand";
import {
ListAssociatedAttributeGroupsCommandInput,
Expand All @@ -97,6 +98,7 @@ import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
} from "./commands/ListTagsForResourceCommand";
import { PutConfigurationCommandInput, PutConfigurationCommandOutput } from "./commands/PutConfigurationCommand";
import { SyncResourceCommandInput, SyncResourceCommandOutput } from "./commands/SyncResourceCommand";
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
Expand Down Expand Up @@ -125,12 +127,14 @@ export type ServiceInputTypes =
| GetApplicationCommandInput
| GetAssociatedResourceCommandInput
| GetAttributeGroupCommandInput
| GetConfigurationCommandInput
| ListApplicationsCommandInput
| ListAssociatedAttributeGroupsCommandInput
| ListAssociatedResourcesCommandInput
| ListAttributeGroupsCommandInput
| ListAttributeGroupsForApplicationCommandInput
| ListTagsForResourceCommandInput
| PutConfigurationCommandInput
| SyncResourceCommandInput
| TagResourceCommandInput
| UntagResourceCommandInput
Expand All @@ -149,12 +153,14 @@ export type ServiceOutputTypes =
| GetApplicationCommandOutput
| GetAssociatedResourceCommandOutput
| GetAttributeGroupCommandOutput
| GetConfigurationCommandOutput
| ListApplicationsCommandOutput
| ListAssociatedAttributeGroupsCommandOutput
| ListAssociatedResourcesCommandOutput
| ListAttributeGroupsCommandOutput
| ListAttributeGroupsForApplicationCommandOutput
| ListTagsForResourceCommandOutput
| PutConfigurationCommandOutput
| SyncResourceCommandOutput
| TagResourceCommandOutput
| UntagResourceCommandOutput
Expand Down
@@ -0,0 +1,116 @@
// 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 { GetConfigurationResponse, GetConfigurationResponseFilterSensitiveLog } from "../models/models_0";
import {
deserializeAws_restJson1GetConfigurationCommand,
serializeAws_restJson1GetConfigurationCommand,
} from "../protocols/Aws_restJson1";
import {
ServiceCatalogAppRegistryClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../ServiceCatalogAppRegistryClient";

export interface GetConfigurationCommandInput {}
export interface GetConfigurationCommandOutput extends GetConfigurationResponse, __MetadataBearer {}

/**
* <p>
* Retrieves a <code>TagKey</code> configuration
* from an account.
* </p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ServiceCatalogAppRegistryClient, GetConfigurationCommand } from "@aws-sdk/client-service-catalog-appregistry"; // ES Modules import
* // const { ServiceCatalogAppRegistryClient, GetConfigurationCommand } = require("@aws-sdk/client-service-catalog-appregistry"); // CommonJS import
* const client = new ServiceCatalogAppRegistryClient(config);
* const command = new GetConfigurationCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link GetConfigurationCommandInput} for command's `input` shape.
* @see {@link GetConfigurationCommandOutput} for command's `response` shape.
* @see {@link ServiceCatalogAppRegistryClientResolvedConfig | config} for ServiceCatalogAppRegistryClient's `config` shape.
*
*/
export class GetConfigurationCommand extends $Command<
GetConfigurationCommandInput,
GetConfigurationCommandOutput,
ServiceCatalogAppRegistryClientResolvedConfig
> {
// 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: GetConfigurationCommandInput) {
// Start section: command_constructor
super();
// End section: command_constructor
}

/**
* @internal
*/
resolveMiddleware(
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
configuration: ServiceCatalogAppRegistryClientResolvedConfig,
options?: __HttpHandlerOptions
): Handler<GetConfigurationCommandInput, GetConfigurationCommandOutput> {
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
this.middlewareStack.use(
getEndpointPlugin(configuration, GetConfigurationCommand.getEndpointParameterInstructions())
);

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

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

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

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

// Start section: command_body_extra
// End section: command_body_extra
}
Expand Up @@ -33,7 +33,27 @@ export interface ListAssociatedResourcesCommandInput extends ListAssociatedResou
export interface ListAssociatedResourcesCommandOutput extends ListAssociatedResourcesResponse, __MetadataBearer {}

/**
* <p>Lists all resources that are associated with specified application. Results are paginated.</p>
* <p>
* Lists all
* of the resources
* that are associated
* with the specified application.
* Results are paginated.
* </p>
* <note>
* <p>
* If you share an application,
* and a consumer account associates a tag query
* to the application,
* all of the users
* who can access the application
* can also view the tag values
* in all accounts
* that are associated
* with it
* using this API.
* </p>
* </note>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down

0 comments on commit 8212786

Please sign in to comment.