Skip to content

Commit

Permalink
feat(client-service-catalog-appregistry): This release adds a new API…
Browse files Browse the repository at this point in the history
… ListAttributeGroupsForApplication that returns associated attribute groups of an application. In addition, the UpdateApplication and UpdateAttributeGroup APIs will not allow users to update the 'Name' attribute.
  • Loading branch information
awstools committed Jun 15, 2022
1 parent 57980bd commit 03773d1
Show file tree
Hide file tree
Showing 9 changed files with 600 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ import {
ListAttributeGroupsCommandInput,
ListAttributeGroupsCommandOutput,
} from "./commands/ListAttributeGroupsCommand";
import {
ListAttributeGroupsForApplicationCommand,
ListAttributeGroupsForApplicationCommandInput,
ListAttributeGroupsForApplicationCommandOutput,
} from "./commands/ListAttributeGroupsForApplicationCommand";
import {
ListTagsForResourceCommand,
ListTagsForResourceCommandInput,
Expand Down Expand Up @@ -593,6 +598,38 @@ export class ServiceCatalogAppRegistry extends ServiceCatalogAppRegistryClient {
}
}

/**
* <p>Lists the details of all attribute groups associated with a specific application. The results display in pages.</p>
*/
public listAttributeGroupsForApplication(
args: ListAttributeGroupsForApplicationCommandInput,
options?: __HttpHandlerOptions
): Promise<ListAttributeGroupsForApplicationCommandOutput>;
public listAttributeGroupsForApplication(
args: ListAttributeGroupsForApplicationCommandInput,
cb: (err: any, data?: ListAttributeGroupsForApplicationCommandOutput) => void
): void;
public listAttributeGroupsForApplication(
args: ListAttributeGroupsForApplicationCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListAttributeGroupsForApplicationCommandOutput) => void
): void;
public listAttributeGroupsForApplication(
args: ListAttributeGroupsForApplicationCommandInput,
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListAttributeGroupsForApplicationCommandOutput) => void),
cb?: (err: any, data?: ListAttributeGroupsForApplicationCommandOutput) => void
): Promise<ListAttributeGroupsForApplicationCommandOutput> | void {
const command = new ListAttributeGroupsForApplicationCommand(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>Lists all of the tags on the resource.</p>
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ import {
ListAttributeGroupsCommandInput,
ListAttributeGroupsCommandOutput,
} from "./commands/ListAttributeGroupsCommand";
import {
ListAttributeGroupsForApplicationCommandInput,
ListAttributeGroupsForApplicationCommandOutput,
} from "./commands/ListAttributeGroupsForApplicationCommand";
import {
ListTagsForResourceCommandInput,
ListTagsForResourceCommandOutput,
Expand Down Expand Up @@ -125,6 +129,7 @@ export type ServiceInputTypes =
| ListAssociatedAttributeGroupsCommandInput
| ListAssociatedResourcesCommandInput
| ListAttributeGroupsCommandInput
| ListAttributeGroupsForApplicationCommandInput
| ListTagsForResourceCommandInput
| SyncResourceCommandInput
| TagResourceCommandInput
Expand All @@ -148,6 +153,7 @@ export type ServiceOutputTypes =
| ListAssociatedAttributeGroupsCommandOutput
| ListAssociatedResourcesCommandOutput
| ListAttributeGroupsCommandOutput
| ListAttributeGroupsForApplicationCommandOutput
| ListTagsForResourceCommandOutput
| SyncResourceCommandOutput
| TagResourceCommandOutput
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// smithy-typescript generated code
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 {
ListAttributeGroupsForApplicationRequest,
ListAttributeGroupsForApplicationResponse,
} from "../models/models_0";
import {
deserializeAws_restJson1ListAttributeGroupsForApplicationCommand,
serializeAws_restJson1ListAttributeGroupsForApplicationCommand,
} from "../protocols/Aws_restJson1";
import {
ServiceCatalogAppRegistryClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes,
} from "../ServiceCatalogAppRegistryClient";

export interface ListAttributeGroupsForApplicationCommandInput extends ListAttributeGroupsForApplicationRequest {}
export interface ListAttributeGroupsForApplicationCommandOutput
extends ListAttributeGroupsForApplicationResponse,
__MetadataBearer {}

/**
* <p>Lists the details of all attribute groups associated with a specific application. The results display in pages.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ServiceCatalogAppRegistryClient, ListAttributeGroupsForApplicationCommand } from "@aws-sdk/client-service-catalog-appregistry"; // ES Modules import
* // const { ServiceCatalogAppRegistryClient, ListAttributeGroupsForApplicationCommand } = require("@aws-sdk/client-service-catalog-appregistry"); // CommonJS import
* const client = new ServiceCatalogAppRegistryClient(config);
* const command = new ListAttributeGroupsForApplicationCommand(input);
* const response = await client.send(command);
* ```
*
* @see {@link ListAttributeGroupsForApplicationCommandInput} for command's `input` shape.
* @see {@link ListAttributeGroupsForApplicationCommandOutput} for command's `response` shape.
* @see {@link ServiceCatalogAppRegistryClientResolvedConfig | config} for ServiceCatalogAppRegistryClient's `config` shape.
*
*/
export class ListAttributeGroupsForApplicationCommand extends $Command<
ListAttributeGroupsForApplicationCommandInput,
ListAttributeGroupsForApplicationCommandOutput,
ServiceCatalogAppRegistryClientResolvedConfig
> {
// Start section: command_properties
// End section: command_properties

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

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

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

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

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

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

// Start section: command_body_extra
// End section: command_body_extra
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export * from "./ListApplicationsCommand";
export * from "./ListAssociatedAttributeGroupsCommand";
export * from "./ListAssociatedResourcesCommand";
export * from "./ListAttributeGroupsCommand";
export * from "./ListAttributeGroupsForApplicationCommand";
export * from "./ListTagsForResourceCommand";
export * from "./SyncResourceCommand";
export * from "./TagResourceCommand";
Expand Down
123 changes: 100 additions & 23 deletions clients/client-service-catalog-appregistry/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,26 @@ export namespace AssociateAttributeGroupResponse {
});
}

/**
* <p>There was a conflict when processing the request (for example, a resource with the given name already
* exists within the account).</p>
*/
export class ConflictException extends __BaseException {
readonly name: "ConflictException" = "ConflictException";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<ConflictException, __BaseException>) {
super({
name: "ConflictException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, ConflictException.prototype);
}
}

/**
* <p>The service is experiencing internal problems.</p>
*/
Expand Down Expand Up @@ -266,26 +286,6 @@ export namespace AssociateResourceResponse {
});
}

/**
* <p>There was a conflict when processing the request (for example, a resource with the given name already
* exists within the account).</p>
*/
export class ConflictException extends __BaseException {
readonly name: "ConflictException" = "ConflictException";
readonly $fault: "client" = "client";
/**
* @internal
*/
constructor(opts: __ExceptionOptionType<ConflictException, __BaseException>) {
super({
name: "ConflictException",
$fault: "client",
...opts,
});
Object.setPrototypeOf(this, ConflictException.prototype);
}
}

/**
* <p>Represents a Amazon Web Services Service Catalog AppRegistry attribute group that is rich metadata which describes an application and its components.</p>
*/
Expand Down Expand Up @@ -335,6 +335,35 @@ export namespace AttributeGroup {
});
}

/**
* <p> The details related to a specific AttributeGroup. </p>
*/
export interface AttributeGroupDetails {
/**
* <p>The unique identifier of the attribute group.</p>
*/
id?: string;

/**
* <p>The Amazon resource name (ARN) that specifies the attribute group.</p>
*/
arn?: string;

/**
* <p>The name of the attribute group. </p>
*/
name?: string;
}

export namespace AttributeGroupDetails {
/**
* @internal
*/
export const filterSensitiveLog = (obj: AttributeGroupDetails): any => ({
...obj,
});
}

/**
* <p>Summary of a Amazon Web Services Service Catalog AppRegistry attribute group.</p>
*/
Expand Down Expand Up @@ -1143,6 +1172,53 @@ export namespace ListAttributeGroupsResponse {
});
}

export interface ListAttributeGroupsForApplicationRequest {
/**
* <p>The name or ID of the application.</p>
*/
application: string | undefined;

/**
* <p>This token retrieves the next page of results after a previous API call.</p>
*/
nextToken?: string;

/**
* <p>The upper bound of the number of results to return. The value cannot exceed 25. If you omit this parameter, it defaults to 25. This value is optional.</p>
*/
maxResults?: number;
}

export namespace ListAttributeGroupsForApplicationRequest {
/**
* @internal
*/
export const filterSensitiveLog = (obj: ListAttributeGroupsForApplicationRequest): any => ({
...obj,
});
}

export interface ListAttributeGroupsForApplicationResponse {
/**
* <p> The details related to a specific AttributeGroup. </p>
*/
attributeGroupsDetails?: AttributeGroupDetails[];

/**
* <p>The token to use to get the next page of results after a previous API call.</p>
*/
nextToken?: string;
}

export namespace ListAttributeGroupsForApplicationResponse {
/**
* @internal
*/
export const filterSensitiveLog = (obj: ListAttributeGroupsForApplicationResponse): any => ({
...obj,
});
}

export interface ListTagsForResourceRequest {
/**
* <p>The Amazon resource name (ARN) that specifies the resource.</p>
Expand Down Expand Up @@ -1300,7 +1376,8 @@ export interface UpdateApplicationRequest {
/**
* @deprecated
*
* <p>The new name of the application. The name must be unique in the region in which you are updating the application.</p>
* <p>Deprecated: The new name of the application. The name must be unique in the region in which you are
* updating the application. Please do not use this field as we have stopped supporting name updates.</p>
*/
name?: string;

Expand Down Expand Up @@ -1344,8 +1421,8 @@ export interface UpdateAttributeGroupRequest {
/**
* @deprecated
*
* <p>The new name of the attribute group. The name must be unique in the region in which you are
* updating the attribute group.</p>
* <p>Deprecated: The new name of the attribute group. The name must be unique in the region in which you are
* updating the attribute group. Please do not use this field as we have stopped supporting name updates.</p>
*/
name?: string;

Expand Down
Loading

0 comments on commit 03773d1

Please sign in to comment.