Skip to content

Commit 63e5da1

Browse files
author
awstools
committed
feat(client-license-manager): AWS License Manager now supports onboarded Management Accounts or Delegated Admins to view granted licenses aggregated from all accounts in the organization.
1 parent 65b66c7 commit 63e5da1

File tree

9 files changed

+1807
-783
lines changed

9 files changed

+1807
-783
lines changed

clients/client-license-manager/src/LicenseManager.ts

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,21 @@ import {
153153
ListReceivedGrantsCommandInput,
154154
ListReceivedGrantsCommandOutput,
155155
} from "./commands/ListReceivedGrantsCommand";
156+
import {
157+
ListReceivedGrantsForOrganizationCommand,
158+
ListReceivedGrantsForOrganizationCommandInput,
159+
ListReceivedGrantsForOrganizationCommandOutput,
160+
} from "./commands/ListReceivedGrantsForOrganizationCommand";
156161
import {
157162
ListReceivedLicensesCommand,
158163
ListReceivedLicensesCommandInput,
159164
ListReceivedLicensesCommandOutput,
160165
} from "./commands/ListReceivedLicensesCommand";
166+
import {
167+
ListReceivedLicensesForOrganizationCommand,
168+
ListReceivedLicensesForOrganizationCommandInput,
169+
ListReceivedLicensesForOrganizationCommandOutput,
170+
} from "./commands/ListReceivedLicensesForOrganizationCommand";
161171
import {
162172
ListResourceInventoryCommand,
163173
ListResourceInventoryCommandInput,
@@ -300,6 +310,10 @@ export class LicenseManager extends LicenseManagerClient {
300310

301311
/**
302312
* <p>Checks out the specified license.</p>
313+
* <note>
314+
* <p>If the account that created the license is the same that is performing the check out, you must
315+
* specify the account as the beneficiary.</p>
316+
* </note>
303317
*/
304318
public checkoutLicense(
305319
args: CheckoutLicenseCommandInput,
@@ -1336,6 +1350,38 @@ export class LicenseManager extends LicenseManagerClient {
13361350
}
13371351
}
13381352

1353+
/**
1354+
* <p>Lists the grants received for all accounts in the organization.</p>
1355+
*/
1356+
public listReceivedGrantsForOrganization(
1357+
args: ListReceivedGrantsForOrganizationCommandInput,
1358+
options?: __HttpHandlerOptions
1359+
): Promise<ListReceivedGrantsForOrganizationCommandOutput>;
1360+
public listReceivedGrantsForOrganization(
1361+
args: ListReceivedGrantsForOrganizationCommandInput,
1362+
cb: (err: any, data?: ListReceivedGrantsForOrganizationCommandOutput) => void
1363+
): void;
1364+
public listReceivedGrantsForOrganization(
1365+
args: ListReceivedGrantsForOrganizationCommandInput,
1366+
options: __HttpHandlerOptions,
1367+
cb: (err: any, data?: ListReceivedGrantsForOrganizationCommandOutput) => void
1368+
): void;
1369+
public listReceivedGrantsForOrganization(
1370+
args: ListReceivedGrantsForOrganizationCommandInput,
1371+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListReceivedGrantsForOrganizationCommandOutput) => void),
1372+
cb?: (err: any, data?: ListReceivedGrantsForOrganizationCommandOutput) => void
1373+
): Promise<ListReceivedGrantsForOrganizationCommandOutput> | void {
1374+
const command = new ListReceivedGrantsForOrganizationCommand(args);
1375+
if (typeof optionsOrCb === "function") {
1376+
this.send(command, optionsOrCb);
1377+
} else if (typeof cb === "function") {
1378+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1379+
this.send(command, optionsOrCb || {}, cb);
1380+
} else {
1381+
return this.send(command, optionsOrCb);
1382+
}
1383+
}
1384+
13391385
/**
13401386
* <p>Lists received licenses.</p>
13411387
*/
@@ -1368,6 +1414,38 @@ export class LicenseManager extends LicenseManagerClient {
13681414
}
13691415
}
13701416

1417+
/**
1418+
* <p>Lists the licenses received for all accounts in the organization.</p>
1419+
*/
1420+
public listReceivedLicensesForOrganization(
1421+
args: ListReceivedLicensesForOrganizationCommandInput,
1422+
options?: __HttpHandlerOptions
1423+
): Promise<ListReceivedLicensesForOrganizationCommandOutput>;
1424+
public listReceivedLicensesForOrganization(
1425+
args: ListReceivedLicensesForOrganizationCommandInput,
1426+
cb: (err: any, data?: ListReceivedLicensesForOrganizationCommandOutput) => void
1427+
): void;
1428+
public listReceivedLicensesForOrganization(
1429+
args: ListReceivedLicensesForOrganizationCommandInput,
1430+
options: __HttpHandlerOptions,
1431+
cb: (err: any, data?: ListReceivedLicensesForOrganizationCommandOutput) => void
1432+
): void;
1433+
public listReceivedLicensesForOrganization(
1434+
args: ListReceivedLicensesForOrganizationCommandInput,
1435+
optionsOrCb?: __HttpHandlerOptions | ((err: any, data?: ListReceivedLicensesForOrganizationCommandOutput) => void),
1436+
cb?: (err: any, data?: ListReceivedLicensesForOrganizationCommandOutput) => void
1437+
): Promise<ListReceivedLicensesForOrganizationCommandOutput> | void {
1438+
const command = new ListReceivedLicensesForOrganizationCommand(args);
1439+
if (typeof optionsOrCb === "function") {
1440+
this.send(command, optionsOrCb);
1441+
} else if (typeof cb === "function") {
1442+
if (typeof optionsOrCb !== "object") throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
1443+
this.send(command, optionsOrCb || {}, cb);
1444+
} else {
1445+
return this.send(command, optionsOrCb);
1446+
}
1447+
}
1448+
13711449
/**
13721450
* <p>Lists resources managed using Systems Manager inventory.</p>
13731451
*/

clients/client-license-manager/src/LicenseManagerClient.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,18 @@ import {
140140
ListLicenseVersionsCommandOutput,
141141
} from "./commands/ListLicenseVersionsCommand";
142142
import { ListReceivedGrantsCommandInput, ListReceivedGrantsCommandOutput } from "./commands/ListReceivedGrantsCommand";
143+
import {
144+
ListReceivedGrantsForOrganizationCommandInput,
145+
ListReceivedGrantsForOrganizationCommandOutput,
146+
} from "./commands/ListReceivedGrantsForOrganizationCommand";
143147
import {
144148
ListReceivedLicensesCommandInput,
145149
ListReceivedLicensesCommandOutput,
146150
} from "./commands/ListReceivedLicensesCommand";
151+
import {
152+
ListReceivedLicensesForOrganizationCommandInput,
153+
ListReceivedLicensesForOrganizationCommandOutput,
154+
} from "./commands/ListReceivedLicensesForOrganizationCommand";
147155
import {
148156
ListResourceInventoryCommandInput,
149157
ListResourceInventoryCommandOutput,
@@ -221,7 +229,9 @@ export type ServiceInputTypes =
221229
| ListLicenseVersionsCommandInput
222230
| ListLicensesCommandInput
223231
| ListReceivedGrantsCommandInput
232+
| ListReceivedGrantsForOrganizationCommandInput
224233
| ListReceivedLicensesCommandInput
234+
| ListReceivedLicensesForOrganizationCommandInput
225235
| ListResourceInventoryCommandInput
226236
| ListTagsForResourceCommandInput
227237
| ListTokensCommandInput
@@ -271,7 +281,9 @@ export type ServiceOutputTypes =
271281
| ListLicenseVersionsCommandOutput
272282
| ListLicensesCommandOutput
273283
| ListReceivedGrantsCommandOutput
284+
| ListReceivedGrantsForOrganizationCommandOutput
274285
| ListReceivedLicensesCommandOutput
286+
| ListReceivedLicensesForOrganizationCommandOutput
275287
| ListResourceInventoryCommandOutput
276288
| ListTagsForResourceCommandOutput
277289
| ListTokensCommandOutput

clients/client-license-manager/src/commands/CheckoutLicenseCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ export interface CheckoutLicenseCommandOutput extends CheckoutLicenseResponse, _
3030

3131
/**
3232
* <p>Checks out the specified license.</p>
33+
* <note>
34+
* <p>If the account that created the license is the same that is performing the check out, you must
35+
* specify the account as the beneficiary.</p>
36+
* </note>
3337
* @example
3438
* Use a bare-bones client and the command you need to make an API call.
3539
* ```javascript
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
// smithy-typescript generated code
2+
import { EndpointParameterInstructions, getEndpointPlugin } from "@aws-sdk/middleware-endpoint";
3+
import { getSerdePlugin } from "@aws-sdk/middleware-serde";
4+
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
5+
import { Command as $Command } from "@aws-sdk/smithy-client";
6+
import {
7+
FinalizeHandlerArguments,
8+
Handler,
9+
HandlerExecutionContext,
10+
HttpHandlerOptions as __HttpHandlerOptions,
11+
MetadataBearer as __MetadataBearer,
12+
MiddlewareStack,
13+
SerdeContext as __SerdeContext,
14+
} from "@aws-sdk/types";
15+
16+
import { LicenseManagerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LicenseManagerClient";
17+
import {
18+
ListReceivedGrantsForOrganizationRequest,
19+
ListReceivedGrantsForOrganizationRequestFilterSensitiveLog,
20+
ListReceivedGrantsForOrganizationResponse,
21+
ListReceivedGrantsForOrganizationResponseFilterSensitiveLog,
22+
} from "../models/models_0";
23+
import {
24+
deserializeAws_json1_1ListReceivedGrantsForOrganizationCommand,
25+
serializeAws_json1_1ListReceivedGrantsForOrganizationCommand,
26+
} from "../protocols/Aws_json1_1";
27+
28+
export interface ListReceivedGrantsForOrganizationCommandInput extends ListReceivedGrantsForOrganizationRequest {}
29+
export interface ListReceivedGrantsForOrganizationCommandOutput
30+
extends ListReceivedGrantsForOrganizationResponse,
31+
__MetadataBearer {}
32+
33+
/**
34+
* <p>Lists the grants received for all accounts in the organization.</p>
35+
* @example
36+
* Use a bare-bones client and the command you need to make an API call.
37+
* ```javascript
38+
* import { LicenseManagerClient, ListReceivedGrantsForOrganizationCommand } from "@aws-sdk/client-license-manager"; // ES Modules import
39+
* // const { LicenseManagerClient, ListReceivedGrantsForOrganizationCommand } = require("@aws-sdk/client-license-manager"); // CommonJS import
40+
* const client = new LicenseManagerClient(config);
41+
* const command = new ListReceivedGrantsForOrganizationCommand(input);
42+
* const response = await client.send(command);
43+
* ```
44+
*
45+
* @see {@link ListReceivedGrantsForOrganizationCommandInput} for command's `input` shape.
46+
* @see {@link ListReceivedGrantsForOrganizationCommandOutput} for command's `response` shape.
47+
* @see {@link LicenseManagerClientResolvedConfig | config} for LicenseManagerClient's `config` shape.
48+
*
49+
*/
50+
export class ListReceivedGrantsForOrganizationCommand extends $Command<
51+
ListReceivedGrantsForOrganizationCommandInput,
52+
ListReceivedGrantsForOrganizationCommandOutput,
53+
LicenseManagerClientResolvedConfig
54+
> {
55+
// Start section: command_properties
56+
// End section: command_properties
57+
58+
public static getEndpointParameterInstructions(): EndpointParameterInstructions {
59+
return {
60+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
61+
Endpoint: { type: "builtInParams", name: "endpoint" },
62+
Region: { type: "builtInParams", name: "region" },
63+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
64+
};
65+
}
66+
67+
constructor(readonly input: ListReceivedGrantsForOrganizationCommandInput) {
68+
// Start section: command_constructor
69+
super();
70+
// End section: command_constructor
71+
}
72+
73+
/**
74+
* @internal
75+
*/
76+
resolveMiddleware(
77+
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>,
78+
configuration: LicenseManagerClientResolvedConfig,
79+
options?: __HttpHandlerOptions
80+
): Handler<ListReceivedGrantsForOrganizationCommandInput, ListReceivedGrantsForOrganizationCommandOutput> {
81+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
82+
this.middlewareStack.use(
83+
getEndpointPlugin(configuration, ListReceivedGrantsForOrganizationCommand.getEndpointParameterInstructions())
84+
);
85+
86+
const stack = clientStack.concat(this.middlewareStack);
87+
88+
const { logger } = configuration;
89+
const clientName = "LicenseManagerClient";
90+
const commandName = "ListReceivedGrantsForOrganizationCommand";
91+
const handlerExecutionContext: HandlerExecutionContext = {
92+
logger,
93+
clientName,
94+
commandName,
95+
inputFilterSensitiveLog: ListReceivedGrantsForOrganizationRequestFilterSensitiveLog,
96+
outputFilterSensitiveLog: ListReceivedGrantsForOrganizationResponseFilterSensitiveLog,
97+
};
98+
const { requestHandler } = configuration;
99+
return stack.resolve(
100+
(request: FinalizeHandlerArguments<any>) =>
101+
requestHandler.handle(request.request as __HttpRequest, options || {}),
102+
handlerExecutionContext
103+
);
104+
}
105+
106+
private serialize(
107+
input: ListReceivedGrantsForOrganizationCommandInput,
108+
context: __SerdeContext
109+
): Promise<__HttpRequest> {
110+
return serializeAws_json1_1ListReceivedGrantsForOrganizationCommand(input, context);
111+
}
112+
113+
private deserialize(
114+
output: __HttpResponse,
115+
context: __SerdeContext
116+
): Promise<ListReceivedGrantsForOrganizationCommandOutput> {
117+
return deserializeAws_json1_1ListReceivedGrantsForOrganizationCommand(output, context);
118+
}
119+
120+
// Start section: command_body_extra
121+
// End section: command_body_extra
122+
}

0 commit comments

Comments
 (0)