Skip to content

Commit

Permalink
feat(client-artifact): Add support for listing active customer agreem…
Browse files Browse the repository at this point in the history
…ents for the calling AWS Account.
  • Loading branch information
awstools committed Dec 11, 2024
1 parent 056dae2 commit 5c0fbe3
Show file tree
Hide file tree
Showing 14 changed files with 779 additions and 93 deletions.
8 changes: 8 additions & 0 deletions clients/client-artifact/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,14 @@ GetTermForReport

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/artifact/command/GetTermForReportCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-artifact/Interface/GetTermForReportCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-artifact/Interface/GetTermForReportCommandOutput/)

</details>
<details>
<summary>
ListCustomerAgreements
</summary>

[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/artifact/command/ListCustomerAgreementsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-artifact/Interface/ListCustomerAgreementsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-artifact/Interface/ListCustomerAgreementsCommandOutput/)

</details>
<details>
<summary>
Expand Down
24 changes: 24 additions & 0 deletions clients/client-artifact/src/Artifact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import {
GetTermForReportCommandInput,
GetTermForReportCommandOutput,
} from "./commands/GetTermForReportCommand";
import {
ListCustomerAgreementsCommand,
ListCustomerAgreementsCommandInput,
ListCustomerAgreementsCommandOutput,
} from "./commands/ListCustomerAgreementsCommand";
import { ListReportsCommand, ListReportsCommandInput, ListReportsCommandOutput } from "./commands/ListReportsCommand";
import {
PutAccountSettingsCommand,
Expand All @@ -31,6 +36,7 @@ const commands = {
GetReportCommand,
GetReportMetadataCommand,
GetTermForReportCommand,
ListCustomerAgreementsCommand,
ListReportsCommand,
PutAccountSettingsCommand,
};
Expand Down Expand Up @@ -99,6 +105,24 @@ export interface Artifact {
cb: (err: any, data?: GetTermForReportCommandOutput) => void
): void;

/**
* @see {@link ListCustomerAgreementsCommand}
*/
listCustomerAgreements(): Promise<ListCustomerAgreementsCommandOutput>;
listCustomerAgreements(
args: ListCustomerAgreementsCommandInput,
options?: __HttpHandlerOptions
): Promise<ListCustomerAgreementsCommandOutput>;
listCustomerAgreements(
args: ListCustomerAgreementsCommandInput,
cb: (err: any, data?: ListCustomerAgreementsCommandOutput) => void
): void;
listCustomerAgreements(
args: ListCustomerAgreementsCommandInput,
options: __HttpHandlerOptions,
cb: (err: any, data?: ListCustomerAgreementsCommandOutput) => void
): void;

/**
* @see {@link ListReportsCommand}
*/
Expand Down
6 changes: 6 additions & 0 deletions clients/client-artifact/src/ArtifactClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ import { GetAccountSettingsCommandInput, GetAccountSettingsCommandOutput } from
import { GetReportCommandInput, GetReportCommandOutput } from "./commands/GetReportCommand";
import { GetReportMetadataCommandInput, GetReportMetadataCommandOutput } from "./commands/GetReportMetadataCommand";
import { GetTermForReportCommandInput, GetTermForReportCommandOutput } from "./commands/GetTermForReportCommand";
import {
ListCustomerAgreementsCommandInput,
ListCustomerAgreementsCommandOutput,
} from "./commands/ListCustomerAgreementsCommand";
import { ListReportsCommandInput, ListReportsCommandOutput } from "./commands/ListReportsCommand";
import { PutAccountSettingsCommandInput, PutAccountSettingsCommandOutput } from "./commands/PutAccountSettingsCommand";
import {
Expand All @@ -78,6 +82,7 @@ export type ServiceInputTypes =
| GetReportCommandInput
| GetReportMetadataCommandInput
| GetTermForReportCommandInput
| ListCustomerAgreementsCommandInput
| ListReportsCommandInput
| PutAccountSettingsCommandInput;

Expand All @@ -89,6 +94,7 @@ export type ServiceOutputTypes =
| GetReportCommandOutput
| GetReportMetadataCommandOutput
| GetTermForReportCommandOutput
| ListCustomerAgreementsCommandOutput
| ListReportsCommandOutput
| PutAccountSettingsCommandOutput;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface GetAccountSettingsCommandOutput extends GetAccountSettingsRespo
* const response = await client.send(command);
* // { // GetAccountSettingsResponse
* // accountSettings: { // AccountSettings
* // notificationSubscriptionStatus: "STRING_VALUE",
* // notificationSubscriptionStatus: "SUBSCRIBED" || "NOT_SUBSCRIBED",
* // },
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ export interface GetReportMetadataCommandOutput extends GetReportMetadataRespons
* // createdAt: new Date("TIMESTAMP"),
* // lastModifiedAt: new Date("TIMESTAMP"),
* // deletedAt: new Date("TIMESTAMP"),
* // state: "STRING_VALUE",
* // state: "PUBLISHED" || "UNPUBLISHED",
* // arn: "STRING_VALUE",
* // series: "STRING_VALUE",
* // category: "STRING_VALUE",
* // companyName: "STRING_VALUE",
* // productName: "STRING_VALUE",
* // termArn: "STRING_VALUE",
* // version: Number("long"),
* // acceptanceType: "STRING_VALUE",
* // acceptanceType: "PASSTHROUGH" || "EXPLICIT",
* // sequenceNumber: Number("long"),
* // uploadState: "STRING_VALUE",
* // uploadState: "PROCESSING" || "COMPLETE" || "FAILED" || "FAULT",
* // statusMessage: "STRING_VALUE",
* // },
* // };
Expand Down
126 changes: 126 additions & 0 deletions clients/client-artifact/src/commands/ListCustomerAgreementsCommand.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
// smithy-typescript generated code
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
import { getSerdePlugin } from "@smithy/middleware-serde";
import { Command as $Command } from "@smithy/smithy-client";
import { MetadataBearer as __MetadataBearer } from "@smithy/types";

import { ArtifactClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../ArtifactClient";
import { commonParams } from "../endpoint/EndpointParameters";
import { ListCustomerAgreementsRequest, ListCustomerAgreementsResponse } from "../models/models_0";
import { de_ListCustomerAgreementsCommand, se_ListCustomerAgreementsCommand } from "../protocols/Aws_restJson1";

/**
* @public
*/
export type { __MetadataBearer };
export { $Command };
/**
* @public
*
* The input for {@link ListCustomerAgreementsCommand}.
*/
export interface ListCustomerAgreementsCommandInput extends ListCustomerAgreementsRequest {}
/**
* @public
*
* The output of {@link ListCustomerAgreementsCommand}.
*/
export interface ListCustomerAgreementsCommandOutput extends ListCustomerAgreementsResponse, __MetadataBearer {}

/**
* <p>List active customer-agreements applicable to calling identity.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
* import { ArtifactClient, ListCustomerAgreementsCommand } from "@aws-sdk/client-artifact"; // ES Modules import
* // const { ArtifactClient, ListCustomerAgreementsCommand } = require("@aws-sdk/client-artifact"); // CommonJS import
* const client = new ArtifactClient(config);
* const input = { // ListCustomerAgreementsRequest
* maxResults: Number("int"),
* nextToken: "STRING_VALUE",
* };
* const command = new ListCustomerAgreementsCommand(input);
* const response = await client.send(command);
* // { // ListCustomerAgreementsResponse
* // customerAgreements: [ // CustomerAgreementList // required
* // { // CustomerAgreementSummary
* // name: "STRING_VALUE",
* // arn: "STRING_VALUE",
* // id: "STRING_VALUE",
* // agreementArn: "STRING_VALUE",
* // awsAccountId: "STRING_VALUE",
* // organizationArn: "STRING_VALUE",
* // effectiveStart: new Date("TIMESTAMP"),
* // effectiveEnd: new Date("TIMESTAMP"),
* // state: "ACTIVE" || "CUSTOMER_TERMINATED" || "AWS_TERMINATED",
* // description: "STRING_VALUE",
* // acceptanceTerms: [ // AgreementTerms
* // "STRING_VALUE",
* // ],
* // terminateTerms: [
* // "STRING_VALUE",
* // ],
* // type: "CUSTOM" || "DEFAULT" || "MODIFIED",
* // },
* // ],
* // nextToken: "STRING_VALUE",
* // };
*
* ```
*
* @param ListCustomerAgreementsCommandInput - {@link ListCustomerAgreementsCommandInput}
* @returns {@link ListCustomerAgreementsCommandOutput}
* @see {@link ListCustomerAgreementsCommandInput} for command's `input` shape.
* @see {@link ListCustomerAgreementsCommandOutput} for command's `response` shape.
* @see {@link ArtifactClientResolvedConfig | config} for ArtifactClient's `config` shape.
*
* @throws {@link AccessDeniedException} (client fault)
* <p>User does not have sufficient access to perform this action.</p>
*
* @throws {@link InternalServerException} (server fault)
* <p>An unknown server exception has occurred.</p>
*
* @throws {@link ThrottlingException} (client fault)
* <p>Request was denied due to request throttling.</p>
*
* @throws {@link ValidationException} (client fault)
* <p>Request fails to satisfy the constraints specified by an AWS service.</p>
*
* @throws {@link ArtifactServiceException}
* <p>Base exception class for all service exceptions from Artifact service.</p>
*
* @public
*/
export class ListCustomerAgreementsCommand extends $Command
.classBuilder<
ListCustomerAgreementsCommandInput,
ListCustomerAgreementsCommandOutput,
ArtifactClientResolvedConfig,
ServiceInputTypes,
ServiceOutputTypes
>()
.ep(commonParams)
.m(function (this: any, Command: any, cs: any, config: ArtifactClientResolvedConfig, o: any) {
return [
getSerdePlugin(config, this.serialize, this.deserialize),
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
];
})
.s("Artifact", "ListCustomerAgreements", {})
.n("ArtifactClient", "ListCustomerAgreementsCommand")
.f(void 0, void 0)
.ser(se_ListCustomerAgreementsCommand)
.de(de_ListCustomerAgreementsCommand)
.build() {
/** @internal type navigation helper, not in runtime. */
protected declare static __types: {
api: {
input: ListCustomerAgreementsRequest;
output: ListCustomerAgreementsResponse;
};
sdk: {
input: ListCustomerAgreementsCommandInput;
output: ListCustomerAgreementsCommandOutput;
};
};
}
6 changes: 3 additions & 3 deletions clients/client-artifact/src/commands/ListReportsCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ export interface ListReportsCommandOutput extends ListReportsResponse, __Metadat
* // { // ReportSummary
* // id: "STRING_VALUE",
* // name: "STRING_VALUE",
* // state: "STRING_VALUE",
* // state: "PUBLISHED" || "UNPUBLISHED",
* // arn: "STRING_VALUE",
* // version: Number("long"),
* // uploadState: "STRING_VALUE",
* // uploadState: "PROCESSING" || "COMPLETE" || "FAILED" || "FAULT",
* // description: "STRING_VALUE",
* // periodStart: new Date("TIMESTAMP"),
* // periodEnd: new Date("TIMESTAMP"),
Expand All @@ -58,7 +58,7 @@ export interface ListReportsCommandOutput extends ListReportsResponse, __Metadat
* // companyName: "STRING_VALUE",
* // productName: "STRING_VALUE",
* // statusMessage: "STRING_VALUE",
* // acceptanceType: "STRING_VALUE",
* // acceptanceType: "PASSTHROUGH" || "EXPLICIT",
* // },
* // ],
* // nextToken: "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ export interface PutAccountSettingsCommandOutput extends PutAccountSettingsRespo
* // const { ArtifactClient, PutAccountSettingsCommand } = require("@aws-sdk/client-artifact"); // CommonJS import
* const client = new ArtifactClient(config);
* const input = { // PutAccountSettingsRequest
* notificationSubscriptionStatus: "STRING_VALUE",
* notificationSubscriptionStatus: "SUBSCRIBED" || "NOT_SUBSCRIBED",
* };
* const command = new PutAccountSettingsCommand(input);
* const response = await client.send(command);
* // { // PutAccountSettingsResponse
* // accountSettings: { // AccountSettings
* // notificationSubscriptionStatus: "STRING_VALUE",
* // notificationSubscriptionStatus: "SUBSCRIBED" || "NOT_SUBSCRIBED",
* // },
* // };
*
Expand Down
1 change: 1 addition & 0 deletions clients/client-artifact/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ export * from "./GetAccountSettingsCommand";
export * from "./GetReportCommand";
export * from "./GetReportMetadataCommand";
export * from "./GetTermForReportCommand";
export * from "./ListCustomerAgreementsCommand";
export * from "./ListReportsCommand";
export * from "./PutAccountSettingsCommand";
Loading

0 comments on commit 5c0fbe3

Please sign in to comment.