Skip to content

Commit d4b1d36

Browse files
author
awstools
committed
feat(client-verifiedpermissions): Amazon Verified Permissions / Features : Adds support for datetime and duration attribute values.
1 parent 9a69161 commit d4b1d36

File tree

7 files changed

+7351
-7226
lines changed

7 files changed

+7351
-7226
lines changed

clients/client-verifiedpermissions/src/commands/BatchIsAuthorizedCommand.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,17 @@ export interface BatchIsAuthorizedCommandOutput extends BatchIsAuthorizedOutput,
7676
* },
7777
* ipaddr: "STRING_VALUE",
7878
* decimal: "STRING_VALUE",
79+
* datetime: "STRING_VALUE",
80+
* duration: "STRING_VALUE",
7981
* },
8082
* ],
8183
* record: {
8284
* "<keys>": "<AttributeValue>",
8385
* },
8486
* ipaddr: "STRING_VALUE",
8587
* decimal: "STRING_VALUE",
88+
* datetime: "STRING_VALUE",
89+
* duration: "STRING_VALUE",
8690
* },
8791
* },
8892
* parents: [ // ParentList
@@ -151,13 +155,17 @@ export interface BatchIsAuthorizedCommandOutput extends BatchIsAuthorizedOutput,
151155
* // },
152156
* // ipaddr: "STRING_VALUE",
153157
* // decimal: "STRING_VALUE",
158+
* // datetime: "STRING_VALUE",
159+
* // duration: "STRING_VALUE",
154160
* // },
155161
* // ],
156162
* // record: {
157163
* // "<keys>": "<AttributeValue>",
158164
* // },
159165
* // ipaddr: "STRING_VALUE",
160166
* // decimal: "STRING_VALUE",
167+
* // datetime: "STRING_VALUE",
168+
* // duration: "STRING_VALUE",
161169
* // },
162170
* // },
163171
* // cedarJson: "STRING_VALUE",

clients/client-verifiedpermissions/src/commands/BatchIsAuthorizedWithTokenCommand.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,17 @@ export interface BatchIsAuthorizedWithTokenCommandOutput extends BatchIsAuthoriz
7878
* },
7979
* ipaddr: "STRING_VALUE",
8080
* decimal: "STRING_VALUE",
81+
* datetime: "STRING_VALUE",
82+
* duration: "STRING_VALUE",
8183
* },
8284
* ],
8385
* record: {
8486
* "<keys>": "<AttributeValue>",
8587
* },
8688
* ipaddr: "STRING_VALUE",
8789
* decimal: "STRING_VALUE",
90+
* datetime: "STRING_VALUE",
91+
* duration: "STRING_VALUE",
8892
* },
8993
* },
9094
* parents: [ // ParentList
@@ -149,13 +153,17 @@ export interface BatchIsAuthorizedWithTokenCommandOutput extends BatchIsAuthoriz
149153
* // },
150154
* // ipaddr: "STRING_VALUE",
151155
* // decimal: "STRING_VALUE",
156+
* // datetime: "STRING_VALUE",
157+
* // duration: "STRING_VALUE",
152158
* // },
153159
* // ],
154160
* // record: {
155161
* // "<keys>": "<AttributeValue>",
156162
* // },
157163
* // ipaddr: "STRING_VALUE",
158164
* // decimal: "STRING_VALUE",
165+
* // datetime: "STRING_VALUE",
166+
* // duration: "STRING_VALUE",
159167
* // },
160168
* // },
161169
* // cedarJson: "STRING_VALUE",

clients/client-verifiedpermissions/src/commands/IsAuthorizedCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,17 @@ export interface IsAuthorizedCommandOutput extends IsAuthorizedOutput, __Metadat
8282
* },
8383
* ipaddr: "STRING_VALUE",
8484
* decimal: "STRING_VALUE",
85+
* datetime: "STRING_VALUE",
86+
* duration: "STRING_VALUE",
8587
* },
8688
* ],
8789
* record: {
8890
* "<keys>": "<AttributeValue>",
8991
* },
9092
* ipaddr: "STRING_VALUE",
9193
* decimal: "STRING_VALUE",
94+
* datetime: "STRING_VALUE",
95+
* duration: "STRING_VALUE",
9296
* },
9397
* },
9498
* cedarJson: "STRING_VALUE",

clients/client-verifiedpermissions/src/commands/IsAuthorizedWithTokenCommand.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,17 @@ export interface IsAuthorizedWithTokenCommandOutput extends IsAuthorizedWithToke
8080
* },
8181
* ipaddr: "STRING_VALUE",
8282
* decimal: "STRING_VALUE",
83+
* datetime: "STRING_VALUE",
84+
* duration: "STRING_VALUE",
8385
* },
8486
* ],
8587
* record: {
8688
* "<keys>": "<AttributeValue>",
8789
* },
8890
* ipaddr: "STRING_VALUE",
8991
* decimal: "STRING_VALUE",
92+
* datetime: "STRING_VALUE",
93+
* duration: "STRING_VALUE",
9094
* },
9195
* },
9296
* cedarJson: "STRING_VALUE",

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

Lines changed: 63 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2822,7 +2822,7 @@ export interface StaticPolicyDefinitionItem {
28222822
}
28232823

28242824
/**
2825-
* <p>Contains information about a policy created by instantiating a policy template. </p> <p>This </p>
2825+
* <p>Contains information about a policy created by instantiating a policy template. </p>
28262826
* @public
28272827
*/
28282828
export interface TemplateLinkedPolicyDefinitionItem {
@@ -3566,7 +3566,9 @@ export interface UntagResourceOutput {}
35663566
*/
35673567
export type AttributeValue =
35683568
| AttributeValue.BooleanMember
3569+
| AttributeValue.DatetimeMember
35693570
| AttributeValue.DecimalMember
3571+
| AttributeValue.DurationMember
35703572
| AttributeValue.EntityIdentifierMember
35713573
| AttributeValue.IpaddrMember
35723574
| AttributeValue.LongMember
@@ -3592,6 +3594,8 @@ export namespace AttributeValue {
35923594
record?: never;
35933595
ipaddr?: never;
35943596
decimal?: never;
3597+
datetime?: never;
3598+
duration?: never;
35953599
$unknown?: never;
35963600
}
35973601

@@ -3608,6 +3612,8 @@ export namespace AttributeValue {
36083612
record?: never;
36093613
ipaddr?: never;
36103614
decimal?: never;
3615+
datetime?: never;
3616+
duration?: never;
36113617
$unknown?: never;
36123618
}
36133619

@@ -3624,6 +3630,8 @@ export namespace AttributeValue {
36243630
record?: never;
36253631
ipaddr?: never;
36263632
decimal?: never;
3633+
datetime?: never;
3634+
duration?: never;
36273635
$unknown?: never;
36283636
}
36293637

@@ -3640,6 +3648,8 @@ export namespace AttributeValue {
36403648
record?: never;
36413649
ipaddr?: never;
36423650
decimal?: never;
3651+
datetime?: never;
3652+
duration?: never;
36433653
$unknown?: never;
36443654
}
36453655

@@ -3656,6 +3666,8 @@ export namespace AttributeValue {
36563666
record?: never;
36573667
ipaddr?: never;
36583668
decimal?: never;
3669+
datetime?: never;
3670+
duration?: never;
36593671
$unknown?: never;
36603672
}
36613673

@@ -3672,6 +3684,8 @@ export namespace AttributeValue {
36723684
record: Record<string, AttributeValue>;
36733685
ipaddr?: never;
36743686
decimal?: never;
3687+
datetime?: never;
3688+
duration?: never;
36753689
$unknown?: never;
36763690
}
36773691

@@ -3688,6 +3702,8 @@ export namespace AttributeValue {
36883702
record?: never;
36893703
ipaddr: string;
36903704
decimal?: never;
3705+
datetime?: never;
3706+
duration?: never;
36913707
$unknown?: never;
36923708
}
36933709

@@ -3704,6 +3720,44 @@ export namespace AttributeValue {
37043720
record?: never;
37053721
ipaddr?: never;
37063722
decimal: string;
3723+
datetime?: never;
3724+
duration?: never;
3725+
$unknown?: never;
3726+
}
3727+
3728+
/**
3729+
* <p>An attribute value of <a href="https://docs.cedarpolicy.com/policies/syntax-datatypes.html#datatype-datetime">datetime</a> type.</p> <p>Example: <code>\{"datetime": "2024-10-15T11:35:00Z"\}</code> </p>
3730+
* @public
3731+
*/
3732+
export interface DatetimeMember {
3733+
boolean?: never;
3734+
entityIdentifier?: never;
3735+
long?: never;
3736+
string?: never;
3737+
set?: never;
3738+
record?: never;
3739+
ipaddr?: never;
3740+
decimal?: never;
3741+
datetime: string;
3742+
duration?: never;
3743+
$unknown?: never;
3744+
}
3745+
3746+
/**
3747+
* <p>An attribute value of <a href="https://docs.cedarpolicy.com/policies/syntax-datatypes.html#datatype-duration">duration</a> type.</p> <p>Example: <code>\{"duration": "1h30m"\}</code> </p>
3748+
* @public
3749+
*/
3750+
export interface DurationMember {
3751+
boolean?: never;
3752+
entityIdentifier?: never;
3753+
long?: never;
3754+
string?: never;
3755+
set?: never;
3756+
record?: never;
3757+
ipaddr?: never;
3758+
decimal?: never;
3759+
datetime?: never;
3760+
duration: string;
37073761
$unknown?: never;
37083762
}
37093763

@@ -3719,6 +3773,8 @@ export namespace AttributeValue {
37193773
record?: never;
37203774
ipaddr?: never;
37213775
decimal?: never;
3776+
datetime?: never;
3777+
duration?: never;
37223778
$unknown: [string, any];
37233779
}
37243780

@@ -3731,6 +3787,8 @@ export namespace AttributeValue {
37313787
record: (value: Record<string, AttributeValue>) => T;
37323788
ipaddr: (value: string) => T;
37333789
decimal: (value: string) => T;
3790+
datetime: (value: string) => T;
3791+
duration: (value: string) => T;
37343792
_: (name: string, value: any) => T;
37353793
}
37363794

@@ -3743,6 +3801,8 @@ export namespace AttributeValue {
37433801
if (value.record !== undefined) return visitor.record(value.record);
37443802
if (value.ipaddr !== undefined) return visitor.ipaddr(value.ipaddr);
37453803
if (value.decimal !== undefined) return visitor.decimal(value.decimal);
3804+
if (value.datetime !== undefined) return visitor.datetime(value.datetime);
3805+
if (value.duration !== undefined) return visitor.duration(value.duration);
37463806
return visitor._(value.$unknown[0], value.$unknown[1]);
37473807
};
37483808
}
@@ -5008,6 +5068,8 @@ export const AttributeValueFilterSensitiveLog = (obj: AttributeValue): any => {
50085068
};
50095069
if (obj.ipaddr !== undefined) return { ipaddr: SENSITIVE_STRING };
50105070
if (obj.decimal !== undefined) return { decimal: SENSITIVE_STRING };
5071+
if (obj.datetime !== undefined) return { datetime: SENSITIVE_STRING };
5072+
if (obj.duration !== undefined) return { duration: SENSITIVE_STRING };
50115073
if (obj.$unknown !== undefined) return { [obj.$unknown[0]]: "UNKNOWN" };
50125074
};
50135075

clients/client-verifiedpermissions/src/protocols/Aws_json1_0.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1375,7 +1375,9 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
13751375
const se_AttributeValue = (input: AttributeValue, context: __SerdeContext): any => {
13761376
return AttributeValue.visit(input, {
13771377
boolean: (value) => ({ boolean: value }),
1378+
datetime: (value) => ({ datetime: value }),
13781379
decimal: (value) => ({ decimal: value }),
1380+
duration: (value) => ({ duration: value }),
13791381
entityIdentifier: (value) => ({ entityIdentifier: _json(value) }),
13801382
ipaddr: (value) => ({ ipaddr: value }),
13811383
long: (value) => ({ long: value }),
@@ -1759,9 +1761,15 @@ const de_AttributeValue = (output: any, context: __SerdeContext): AttributeValue
17591761
if (__expectBoolean(output.boolean) !== undefined) {
17601762
return { boolean: __expectBoolean(output.boolean) as any };
17611763
}
1764+
if (__expectString(output.datetime) !== undefined) {
1765+
return { datetime: __expectString(output.datetime) as any };
1766+
}
17621767
if (__expectString(output.decimal) !== undefined) {
17631768
return { decimal: __expectString(output.decimal) as any };
17641769
}
1770+
if (__expectString(output.duration) !== undefined) {
1771+
return { duration: __expectString(output.duration) as any };
1772+
}
17651773
if (output.entityIdentifier != null) {
17661774
return {
17671775
entityIdentifier: _json(output.entityIdentifier),

0 commit comments

Comments
 (0)