Skip to content

Commit 9ea7a53

Browse files
author
awstools
committed
feat(client-lakeformation): Introduces a new API, GetDataLakePrincipal, that returns the identity of the invoking principal
1 parent 08d5cc3 commit 9ea7a53

File tree

8 files changed

+241
-0
lines changed

8 files changed

+241
-0
lines changed

clients/client-lakeformation/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,14 @@ GetDataCellsFilter
372372

373373
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lakeformation/command/GetDataCellsFilterCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lakeformation/Interface/GetDataCellsFilterCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lakeformation/Interface/GetDataCellsFilterCommandOutput/)
374374

375+
</details>
376+
<details>
377+
<summary>
378+
GetDataLakePrincipal
379+
</summary>
380+
381+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/lakeformation/command/GetDataLakePrincipalCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lakeformation/Interface/GetDataLakePrincipalCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-lakeformation/Interface/GetDataLakePrincipalCommandOutput/)
382+
375383
</details>
376384
<details>
377385
<summary>

clients/client-lakeformation/src/LakeFormation.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ import {
9999
GetDataCellsFilterCommandInput,
100100
GetDataCellsFilterCommandOutput,
101101
} from "./commands/GetDataCellsFilterCommand";
102+
import {
103+
GetDataLakePrincipalCommand,
104+
GetDataLakePrincipalCommandInput,
105+
GetDataLakePrincipalCommandOutput,
106+
} from "./commands/GetDataLakePrincipalCommand";
102107
import {
103108
GetDataLakeSettingsCommand,
104109
GetDataLakeSettingsCommandInput,
@@ -276,6 +281,7 @@ const commands = {
276281
DescribeTransactionCommand,
277282
ExtendTransactionCommand,
278283
GetDataCellsFilterCommand,
284+
GetDataLakePrincipalCommand,
279285
GetDataLakeSettingsCommand,
280286
GetEffectivePermissionsForPathCommand,
281287
GetLFTagCommand,
@@ -662,6 +668,24 @@ export interface LakeFormation {
662668
cb: (err: any, data?: GetDataCellsFilterCommandOutput) => void
663669
): void;
664670

671+
/**
672+
* @see {@link GetDataLakePrincipalCommand}
673+
*/
674+
getDataLakePrincipal(): Promise<GetDataLakePrincipalCommandOutput>;
675+
getDataLakePrincipal(
676+
args: GetDataLakePrincipalCommandInput,
677+
options?: __HttpHandlerOptions
678+
): Promise<GetDataLakePrincipalCommandOutput>;
679+
getDataLakePrincipal(
680+
args: GetDataLakePrincipalCommandInput,
681+
cb: (err: any, data?: GetDataLakePrincipalCommandOutput) => void
682+
): void;
683+
getDataLakePrincipal(
684+
args: GetDataLakePrincipalCommandInput,
685+
options: __HttpHandlerOptions,
686+
cb: (err: any, data?: GetDataLakePrincipalCommandOutput) => void
687+
): void;
688+
665689
/**
666690
* @see {@link GetDataLakeSettingsCommand}
667691
*/

clients/client-lakeformation/src/LakeFormationClient.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,10 @@ import {
114114
} from "./commands/DescribeTransactionCommand";
115115
import { ExtendTransactionCommandInput, ExtendTransactionCommandOutput } from "./commands/ExtendTransactionCommand";
116116
import { GetDataCellsFilterCommandInput, GetDataCellsFilterCommandOutput } from "./commands/GetDataCellsFilterCommand";
117+
import {
118+
GetDataLakePrincipalCommandInput,
119+
GetDataLakePrincipalCommandOutput,
120+
} from "./commands/GetDataLakePrincipalCommand";
117121
import {
118122
GetDataLakeSettingsCommandInput,
119123
GetDataLakeSettingsCommandOutput,
@@ -225,6 +229,7 @@ export type ServiceInputTypes =
225229
| DescribeTransactionCommandInput
226230
| ExtendTransactionCommandInput
227231
| GetDataCellsFilterCommandInput
232+
| GetDataLakePrincipalCommandInput
228233
| GetDataLakeSettingsCommandInput
229234
| GetEffectivePermissionsForPathCommandInput
230235
| GetLFTagCommandInput
@@ -284,6 +289,7 @@ export type ServiceOutputTypes =
284289
| DescribeTransactionCommandOutput
285290
| ExtendTransactionCommandOutput
286291
| GetDataCellsFilterCommandOutput
292+
| GetDataLakePrincipalCommandOutput
287293
| GetDataLakeSettingsCommandOutput
288294
| GetEffectivePermissionsForPathCommandOutput
289295
| GetLFTagCommandOutput
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { commonParams } from "../endpoint/EndpointParameters";
8+
import { LakeFormationClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LakeFormationClient";
9+
import { GetDataLakePrincipalRequest, GetDataLakePrincipalResponse } from "../models/models_0";
10+
import { de_GetDataLakePrincipalCommand, se_GetDataLakePrincipalCommand } from "../protocols/Aws_restJson1";
11+
12+
/**
13+
* @public
14+
*/
15+
export { __MetadataBearer, $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link GetDataLakePrincipalCommand}.
20+
*/
21+
export interface GetDataLakePrincipalCommandInput extends GetDataLakePrincipalRequest {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link GetDataLakePrincipalCommand}.
26+
*/
27+
export interface GetDataLakePrincipalCommandOutput extends GetDataLakePrincipalResponse, __MetadataBearer {}
28+
29+
/**
30+
* <p>Returns the identity of the invoking principal.</p>
31+
* @example
32+
* Use a bare-bones client and the command you need to make an API call.
33+
* ```javascript
34+
* import { LakeFormationClient, GetDataLakePrincipalCommand } from "@aws-sdk/client-lakeformation"; // ES Modules import
35+
* // const { LakeFormationClient, GetDataLakePrincipalCommand } = require("@aws-sdk/client-lakeformation"); // CommonJS import
36+
* const client = new LakeFormationClient(config);
37+
* const input = {};
38+
* const command = new GetDataLakePrincipalCommand(input);
39+
* const response = await client.send(command);
40+
* // { // GetDataLakePrincipalResponse
41+
* // Identity: "STRING_VALUE",
42+
* // };
43+
*
44+
* ```
45+
*
46+
* @param GetDataLakePrincipalCommandInput - {@link GetDataLakePrincipalCommandInput}
47+
* @returns {@link GetDataLakePrincipalCommandOutput}
48+
* @see {@link GetDataLakePrincipalCommandInput} for command's `input` shape.
49+
* @see {@link GetDataLakePrincipalCommandOutput} for command's `response` shape.
50+
* @see {@link LakeFormationClientResolvedConfig | config} for LakeFormationClient's `config` shape.
51+
*
52+
* @throws {@link AccessDeniedException} (client fault)
53+
* <p>Access to a resource was denied.</p>
54+
*
55+
* @throws {@link InternalServiceException} (server fault)
56+
* <p>An internal service error occurred.</p>
57+
*
58+
* @throws {@link OperationTimeoutException} (client fault)
59+
* <p>The operation timed out.</p>
60+
*
61+
* @throws {@link LakeFormationServiceException}
62+
* <p>Base exception class for all service exceptions from LakeFormation service.</p>
63+
*
64+
* @public
65+
*/
66+
export class GetDataLakePrincipalCommand extends $Command
67+
.classBuilder<
68+
GetDataLakePrincipalCommandInput,
69+
GetDataLakePrincipalCommandOutput,
70+
LakeFormationClientResolvedConfig,
71+
ServiceInputTypes,
72+
ServiceOutputTypes
73+
>()
74+
.ep({
75+
...commonParams,
76+
})
77+
.m(function (this: any, Command: any, cs: any, config: LakeFormationClientResolvedConfig, o: any) {
78+
return [
79+
getSerdePlugin(config, this.serialize, this.deserialize),
80+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
81+
];
82+
})
83+
.s("AWSLakeFormation", "GetDataLakePrincipal", {})
84+
.n("LakeFormationClient", "GetDataLakePrincipalCommand")
85+
.f(void 0, void 0)
86+
.ser(se_GetDataLakePrincipalCommand)
87+
.de(de_GetDataLakePrincipalCommand)
88+
.build() {}

clients/client-lakeformation/src/commands/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export * from "./DescribeResourceCommand";
2020
export * from "./DescribeTransactionCommand";
2121
export * from "./ExtendTransactionCommand";
2222
export * from "./GetDataCellsFilterCommand";
23+
export * from "./GetDataLakePrincipalCommand";
2324
export * from "./GetDataLakeSettingsCommand";
2425
export * from "./GetEffectivePermissionsForPathCommand";
2526
export * from "./GetLFTagCommand";

clients/client-lakeformation/src/models/models_0.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1647,6 +1647,22 @@ export interface GetDataCellsFilterResponse {
16471647
DataCellsFilter?: DataCellsFilter;
16481648
}
16491649

1650+
/**
1651+
* @public
1652+
*/
1653+
export interface GetDataLakePrincipalRequest {}
1654+
1655+
/**
1656+
* @public
1657+
*/
1658+
export interface GetDataLakePrincipalResponse {
1659+
/**
1660+
* <p>A unique identifier of the invoking principal.</p>
1661+
* @public
1662+
*/
1663+
Identity?: string;
1664+
}
1665+
16501666
/**
16511667
* @public
16521668
*/

clients/client-lakeformation/src/protocols/Aws_restJson1.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,10 @@ import {
8888
} from "../commands/DescribeTransactionCommand";
8989
import { ExtendTransactionCommandInput, ExtendTransactionCommandOutput } from "../commands/ExtendTransactionCommand";
9090
import { GetDataCellsFilterCommandInput, GetDataCellsFilterCommandOutput } from "../commands/GetDataCellsFilterCommand";
91+
import {
92+
GetDataLakePrincipalCommandInput,
93+
GetDataLakePrincipalCommandOutput,
94+
} from "../commands/GetDataLakePrincipalCommand";
9195
import {
9296
GetDataLakeSettingsCommandInput,
9397
GetDataLakeSettingsCommandOutput,
@@ -709,6 +713,24 @@ export const se_GetDataCellsFilterCommand = async (
709713
return b.build();
710714
};
711715

716+
/**
717+
* serializeAws_restJson1GetDataLakePrincipalCommand
718+
*/
719+
export const se_GetDataLakePrincipalCommand = async (
720+
input: GetDataLakePrincipalCommandInput,
721+
context: __SerdeContext
722+
): Promise<__HttpRequest> => {
723+
const b = rb(input, context);
724+
const headers: any = {
725+
"content-type": "application/json",
726+
};
727+
b.bp("/GetDataLakePrincipal");
728+
let body: any;
729+
body = "";
730+
b.m("POST").h(headers).b(body);
731+
return b.build();
732+
};
733+
712734
/**
713735
* serializeAws_restJson1GetDataLakeSettingsCommand
714736
*/
@@ -1970,6 +1992,27 @@ export const de_GetDataCellsFilterCommand = async (
19701992
return contents;
19711993
};
19721994

1995+
/**
1996+
* deserializeAws_restJson1GetDataLakePrincipalCommand
1997+
*/
1998+
export const de_GetDataLakePrincipalCommand = async (
1999+
output: __HttpResponse,
2000+
context: __SerdeContext
2001+
): Promise<GetDataLakePrincipalCommandOutput> => {
2002+
if (output.statusCode !== 200 && output.statusCode >= 300) {
2003+
return de_CommandError(output, context);
2004+
}
2005+
const contents: any = map({
2006+
$metadata: deserializeMetadata(output),
2007+
});
2008+
const data: Record<string, any> = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
2009+
const doc = take(data, {
2010+
Identity: __expectString,
2011+
});
2012+
Object.assign(contents, doc);
2013+
return contents;
2014+
};
2015+
19732016
/**
19742017
* deserializeAws_restJson1GetDataLakeSettingsCommand
19752018
*/

codegen/sdk-codegen/aws-models/lakeformation.json

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@
9696
{
9797
"target": "com.amazonaws.lakeformation#GetDataCellsFilter"
9898
},
99+
{
100+
"target": "com.amazonaws.lakeformation#GetDataLakePrincipal"
101+
},
99102
{
100103
"target": "com.amazonaws.lakeformation#GetDataLakeSettings"
101104
},
@@ -3593,6 +3596,55 @@
35933596
"smithy.api#output": {}
35943597
}
35953598
},
3599+
"com.amazonaws.lakeformation#GetDataLakePrincipal": {
3600+
"type": "operation",
3601+
"input": {
3602+
"target": "com.amazonaws.lakeformation#GetDataLakePrincipalRequest"
3603+
},
3604+
"output": {
3605+
"target": "com.amazonaws.lakeformation#GetDataLakePrincipalResponse"
3606+
},
3607+
"errors": [
3608+
{
3609+
"target": "com.amazonaws.lakeformation#AccessDeniedException"
3610+
},
3611+
{
3612+
"target": "com.amazonaws.lakeformation#InternalServiceException"
3613+
},
3614+
{
3615+
"target": "com.amazonaws.lakeformation#OperationTimeoutException"
3616+
}
3617+
],
3618+
"traits": {
3619+
"smithy.api#documentation": "<p>Returns the identity of the invoking principal.</p>",
3620+
"smithy.api#http": {
3621+
"method": "POST",
3622+
"uri": "/GetDataLakePrincipal",
3623+
"code": 200
3624+
}
3625+
}
3626+
},
3627+
"com.amazonaws.lakeformation#GetDataLakePrincipalRequest": {
3628+
"type": "structure",
3629+
"members": {},
3630+
"traits": {
3631+
"smithy.api#input": {}
3632+
}
3633+
},
3634+
"com.amazonaws.lakeformation#GetDataLakePrincipalResponse": {
3635+
"type": "structure",
3636+
"members": {
3637+
"Identity": {
3638+
"target": "com.amazonaws.lakeformation#IdentityString",
3639+
"traits": {
3640+
"smithy.api#documentation": "<p>A unique identifier of the invoking principal.</p>"
3641+
}
3642+
}
3643+
},
3644+
"traits": {
3645+
"smithy.api#output": {}
3646+
}
3647+
},
35963648
"com.amazonaws.lakeformation#GetDataLakeSettings": {
35973649
"type": "operation",
35983650
"input": {
@@ -4775,6 +4827,9 @@
47754827
"com.amazonaws.lakeformation#IdentityCenterInstanceArn": {
47764828
"type": "string"
47774829
},
4830+
"com.amazonaws.lakeformation#IdentityString": {
4831+
"type": "string"
4832+
},
47784833
"com.amazonaws.lakeformation#InternalServiceException": {
47794834
"type": "structure",
47804835
"members": {

0 commit comments

Comments
 (0)