Skip to content

Commit 1e309c2

Browse files
author
awstools
committed
feat(client-mediapackagev2): This release enables customers to safely update their MediaPackage v2 channel groups, channels and origin endpoints using entity tags.
1 parent 582eb00 commit 1e309c2

12 files changed

+213
-10
lines changed

clients/client-mediapackagev2/src/commands/CreateChannelCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ export interface CreateChannelCommandOutput extends CreateChannelResponse, __Met
5959
* // Url: "STRING_VALUE",
6060
* // },
6161
* // ],
62+
* // ETag: "STRING_VALUE",
6263
* // Tags: { // TagMap
6364
* // "<keys>": "STRING_VALUE",
6465
* // },

clients/client-mediapackagev2/src/commands/CreateChannelGroupCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export interface CreateChannelGroupCommandOutput extends CreateChannelGroupRespo
5151
* // EgressDomain: "STRING_VALUE", // required
5252
* // CreatedAt: new Date("TIMESTAMP"), // required
5353
* // ModifiedAt: new Date("TIMESTAMP"), // required
54+
* // ETag: "STRING_VALUE",
5455
* // Description: "STRING_VALUE",
5556
* // Tags: { // TagMap
5657
* // "<keys>": "STRING_VALUE",

clients/client-mediapackagev2/src/commands/CreateOriginEndpointCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ export interface CreateOriginEndpointCommandOutput extends CreateOriginEndpointR
193193
* // },
194194
* // },
195195
* // ],
196+
* // ETag: "STRING_VALUE",
196197
* // Tags: { // TagMap
197198
* // "<keys>": "STRING_VALUE",
198199
* // },

clients/client-mediapackagev2/src/commands/GetChannelCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export interface GetChannelCommandOutput extends GetChannelResponse, __MetadataB
5454
* // Url: "STRING_VALUE",
5555
* // },
5656
* // ],
57+
* // ETag: "STRING_VALUE",
5758
* // Tags: { // TagMap
5859
* // "<keys>": "STRING_VALUE",
5960
* // },

clients/client-mediapackagev2/src/commands/GetChannelGroupCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface GetChannelGroupCommandOutput extends GetChannelGroupResponse, _
4747
* // CreatedAt: new Date("TIMESTAMP"), // required
4848
* // ModifiedAt: new Date("TIMESTAMP"), // required
4949
* // Description: "STRING_VALUE",
50+
* // ETag: "STRING_VALUE",
5051
* // Tags: { // TagMap
5152
* // "<keys>": "STRING_VALUE",
5253
* // },

clients/client-mediapackagev2/src/commands/GetOriginEndpointCommand.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ export interface GetOriginEndpointCommandOutput extends GetOriginEndpointRespons
120120
* // },
121121
* // },
122122
* // ],
123+
* // ETag: "STRING_VALUE",
123124
* // Tags: { // TagMap
124125
* // "<keys>": "STRING_VALUE",
125126
* // },

clients/client-mediapackagev2/src/commands/UpdateChannelCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export interface UpdateChannelCommandOutput extends UpdateChannelResponse, __Met
3939
* const input = { // UpdateChannelRequest
4040
* ChannelGroupName: "STRING_VALUE", // required
4141
* ChannelName: "STRING_VALUE", // required
42+
* ETag: "STRING_VALUE",
4243
* Description: "STRING_VALUE",
4344
* };
4445
* const command = new UpdateChannelCommand(input);
@@ -56,6 +57,7 @@ export interface UpdateChannelCommandOutput extends UpdateChannelResponse, __Met
5657
* // Url: "STRING_VALUE",
5758
* // },
5859
* // ],
60+
* // ETag: "STRING_VALUE",
5961
* // Tags: { // TagMap
6062
* // "<keys>": "STRING_VALUE",
6163
* // },

clients/client-mediapackagev2/src/commands/UpdateChannelGroupCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ export interface UpdateChannelGroupCommandOutput extends UpdateChannelGroupRespo
3838
* const client = new MediaPackageV2Client(config);
3939
* const input = { // UpdateChannelGroupRequest
4040
* ChannelGroupName: "STRING_VALUE", // required
41+
* ETag: "STRING_VALUE",
4142
* Description: "STRING_VALUE",
4243
* };
4344
* const command = new UpdateChannelGroupCommand(input);
@@ -49,6 +50,7 @@ export interface UpdateChannelGroupCommandOutput extends UpdateChannelGroupRespo
4950
* // CreatedAt: new Date("TIMESTAMP"), // required
5051
* // ModifiedAt: new Date("TIMESTAMP"), // required
5152
* // Description: "STRING_VALUE",
53+
* // ETag: "STRING_VALUE",
5254
* // Tags: { // TagMap
5355
* // "<keys>": "STRING_VALUE",
5456
* // },

clients/client-mediapackagev2/src/commands/UpdateOriginEndpointCommand.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export interface UpdateOriginEndpointCommandOutput extends UpdateOriginEndpointR
109109
* },
110110
* },
111111
* ],
112+
* ETag: "STRING_VALUE",
112113
* };
113114
* const command = new UpdateOriginEndpointCommand(input);
114115
* const response = await client.send(command);
@@ -190,6 +191,7 @@ export interface UpdateOriginEndpointCommandOutput extends UpdateOriginEndpointR
190191
* // },
191192
* // },
192193
* // ],
194+
* // ETag: "STRING_VALUE",
193195
* // Tags: { // TagMap
194196
* // "<keys>": "STRING_VALUE",
195197
* // },

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

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,12 @@ export interface CreateChannelResponse {
477477
*/
478478
IngestEndpoints?: IngestEndpoint[];
479479

480+
/**
481+
* @public
482+
* <p>The current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource.</p>
483+
*/
484+
ETag?: string;
485+
480486
/**
481487
* @public
482488
* <p>The comma-separated list of tag key:value pairs assigned to the channel.</p>
@@ -591,6 +597,12 @@ export interface GetChannelResponse {
591597
*/
592598
IngestEndpoints?: IngestEndpoint[];
593599

600+
/**
601+
* @public
602+
* <p>The current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource.</p>
603+
*/
604+
ETag?: string;
605+
594606
/**
595607
* @public
596608
* <p>The comma-separated list of tag key:value pairs assigned to the channel.</p>
@@ -1441,6 +1453,12 @@ export interface CreateOriginEndpointResponse {
14411453
*/
14421454
LowLatencyHlsManifests?: GetLowLatencyHlsManifestConfiguration[];
14431455

1456+
/**
1457+
* @public
1458+
* <p>The current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource.</p>
1459+
*/
1460+
ETag?: string;
1461+
14441462
/**
14451463
* @public
14461464
* <p>The comma-separated list of tag key:value pairs assigned to the origin endpoint.</p>
@@ -1575,6 +1593,12 @@ export interface GetOriginEndpointResponse {
15751593
*/
15761594
LowLatencyHlsManifests?: GetLowLatencyHlsManifestConfiguration[];
15771595

1596+
/**
1597+
* @public
1598+
* <p>The current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource.</p>
1599+
*/
1600+
ETag?: string;
1601+
15781602
/**
15791603
* @public
15801604
* <p>The comma-separated list of tag key:value pairs assigned to the origin endpoint.</p>
@@ -1913,6 +1937,12 @@ export interface UpdateOriginEndpointRequest {
19131937
* <p>A low-latency HLS manifest configuration.</p>
19141938
*/
19151939
LowLatencyHlsManifests?: CreateLowLatencyHlsManifestConfiguration[];
1940+
1941+
/**
1942+
* @public
1943+
* <p>The expected current Entity Tag (ETag) for the resource. If the specified ETag does not match the resource's current entity tag, the update request will be rejected.</p>
1944+
*/
1945+
ETag?: string;
19161946
}
19171947

19181948
/**
@@ -1991,6 +2021,12 @@ export interface UpdateOriginEndpointResponse {
19912021
*/
19922022
LowLatencyHlsManifests?: GetLowLatencyHlsManifestConfiguration[];
19932023

2024+
/**
2025+
* @public
2026+
* <p>The current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource.</p>
2027+
*/
2028+
ETag?: string;
2029+
19942030
/**
19952031
* @public
19962032
* <p>The comma-separated list of tag key:value pairs assigned to the origin endpoint.</p>
@@ -2014,6 +2050,12 @@ export interface UpdateChannelRequest {
20142050
*/
20152051
ChannelName: string | undefined;
20162052

2053+
/**
2054+
* @public
2055+
* <p>The expected current Entity Tag (ETag) for the resource. If the specified ETag does not match the resource's current entity tag, the update request will be rejected.</p>
2056+
*/
2057+
ETag?: string;
2058+
20172059
/**
20182060
* @public
20192061
* <p>Any descriptive information that you want to add to the channel for future identification purposes.</p>
@@ -2067,6 +2109,12 @@ export interface UpdateChannelResponse {
20672109
*/
20682110
IngestEndpoints?: IngestEndpoint[];
20692111

2112+
/**
2113+
* @public
2114+
* <p>The current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource.</p>
2115+
*/
2116+
ETag?: string;
2117+
20702118
/**
20712119
* @public
20722120
* <p>The comma-separated list of tag key:value pairs assigned to the channel.</p>
@@ -2143,6 +2191,12 @@ export interface CreateChannelGroupResponse {
21432191
*/
21442192
ModifiedAt: Date | undefined;
21452193

2194+
/**
2195+
* @public
2196+
* <p>The current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource.</p>
2197+
*/
2198+
ETag?: string;
2199+
21462200
/**
21472201
* @public
21482202
* <p>The description for your channel group.</p>
@@ -2223,6 +2277,12 @@ export interface GetChannelGroupResponse {
22232277
*/
22242278
Description?: string;
22252279

2280+
/**
2281+
* @public
2282+
* <p>The current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource.</p>
2283+
*/
2284+
ETag?: string;
2285+
22262286
/**
22272287
* @public
22282288
* <p>The comma-separated list of tag key:value pairs assigned to the channel group.</p>
@@ -2274,6 +2334,12 @@ export interface UpdateChannelGroupRequest {
22742334
*/
22752335
ChannelGroupName: string | undefined;
22762336

2337+
/**
2338+
* @public
2339+
* <p>The expected current Entity Tag (ETag) for the resource. If the specified ETag does not match the resource's current entity tag, the update request will be rejected.</p>
2340+
*/
2341+
ETag?: string;
2342+
22772343
/**
22782344
* @public
22792345
* <p>Any descriptive information that you want to add to the channel group for future identification purposes.</p>
@@ -2321,6 +2387,12 @@ export interface UpdateChannelGroupResponse {
23212387
*/
23222388
Description?: string;
23232389

2390+
/**
2391+
* @public
2392+
* <p>The current Entity Tag (ETag) associated with this resource. The entity tag can be used to safely make concurrent updates to the resource.</p>
2393+
*/
2394+
ETag?: string;
2395+
23242396
/**
23252397
* @public
23262398
* <p>The comma-separated list of tag key:value pairs assigned to the channel group.</p>

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

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -537,9 +537,10 @@ export const se_UpdateChannelCommand = async (
537537
context: __SerdeContext
538538
): Promise<__HttpRequest> => {
539539
const b = rb(input, context);
540-
const headers: any = {
540+
const headers: any = map({}, isSerializableHeaderValue, {
541541
"content-type": "application/json",
542-
};
542+
[_xauim]: input[_ET]!,
543+
});
543544
b.bp("/channelGroup/{ChannelGroupName}/channel/{ChannelName}");
544545
b.p("ChannelGroupName", () => input.ChannelGroupName!, "{ChannelGroupName}", false);
545546
b.p("ChannelName", () => input.ChannelName!, "{ChannelName}", false);
@@ -561,9 +562,10 @@ export const se_UpdateChannelGroupCommand = async (
561562
context: __SerdeContext
562563
): Promise<__HttpRequest> => {
563564
const b = rb(input, context);
564-
const headers: any = {
565+
const headers: any = map({}, isSerializableHeaderValue, {
565566
"content-type": "application/json",
566-
};
567+
[_xauim]: input[_ET]!,
568+
});
567569
b.bp("/channelGroup/{ChannelGroupName}");
568570
b.p("ChannelGroupName", () => input.ChannelGroupName!, "{ChannelGroupName}", false);
569571
let body: any;
@@ -584,9 +586,10 @@ export const se_UpdateOriginEndpointCommand = async (
584586
context: __SerdeContext
585587
): Promise<__HttpRequest> => {
586588
const b = rb(input, context);
587-
const headers: any = {
589+
const headers: any = map({}, isSerializableHeaderValue, {
588590
"content-type": "application/json",
589-
};
591+
[_xauim]: input[_ET]!,
592+
});
590593
b.bp("/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}");
591594
b.p("ChannelGroupName", () => input.ChannelGroupName!, "{ChannelGroupName}", false);
592595
b.p("ChannelName", () => input.ChannelName!, "{ChannelName}", false);
@@ -626,6 +629,7 @@ export const de_CreateChannelCommand = async (
626629
ChannelName: __expectString,
627630
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
628631
Description: __expectString,
632+
ETag: __expectString,
629633
IngestEndpoints: _json,
630634
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
631635
Tags: _json,
@@ -653,6 +657,7 @@ export const de_CreateChannelGroupCommand = async (
653657
ChannelGroupName: __expectString,
654658
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
655659
Description: __expectString,
660+
ETag: __expectString,
656661
EgressDomain: __expectString,
657662
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
658663
Tags: _json,
@@ -682,6 +687,7 @@ export const de_CreateOriginEndpointCommand = async (
682687
ContainerType: __expectString,
683688
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
684689
Description: __expectString,
690+
ETag: __expectString,
685691
HlsManifests: (_) => de_GetHlsManifests(_, context),
686692
LowLatencyHlsManifests: (_) => de_GetLowLatencyHlsManifests(_, context),
687693
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
@@ -799,6 +805,7 @@ export const de_GetChannelCommand = async (
799805
ChannelName: __expectString,
800806
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
801807
Description: __expectString,
808+
ETag: __expectString,
802809
IngestEndpoints: _json,
803810
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
804811
Tags: _json,
@@ -826,6 +833,7 @@ export const de_GetChannelGroupCommand = async (
826833
ChannelGroupName: __expectString,
827834
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
828835
Description: __expectString,
836+
ETag: __expectString,
829837
EgressDomain: __expectString,
830838
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
831839
Tags: [, _json, `tags`],
@@ -878,6 +886,7 @@ export const de_GetOriginEndpointCommand = async (
878886
ContainerType: __expectString,
879887
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
880888
Description: __expectString,
889+
ETag: __expectString,
881890
HlsManifests: (_) => de_GetHlsManifests(_, context),
882891
LowLatencyHlsManifests: (_) => de_GetLowLatencyHlsManifests(_, context),
883892
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
@@ -1089,6 +1098,7 @@ export const de_UpdateChannelCommand = async (
10891098
ChannelName: __expectString,
10901099
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
10911100
Description: __expectString,
1101+
ETag: __expectString,
10921102
IngestEndpoints: _json,
10931103
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
10941104
Tags: [, _json, `tags`],
@@ -1116,6 +1126,7 @@ export const de_UpdateChannelGroupCommand = async (
11161126
ChannelGroupName: __expectString,
11171127
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
11181128
Description: __expectString,
1129+
ETag: __expectString,
11191130
EgressDomain: __expectString,
11201131
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
11211132
Tags: [, _json, `tags`],
@@ -1145,6 +1156,7 @@ export const de_UpdateOriginEndpointCommand = async (
11451156
ContainerType: __expectString,
11461157
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
11471158
Description: __expectString,
1159+
ETag: __expectString,
11481160
HlsManifests: (_) => de_GetHlsManifests(_, context),
11491161
LowLatencyHlsManifests: (_) => de_GetLowLatencyHlsManifests(_, context),
11501162
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
@@ -1626,10 +1638,12 @@ const isSerializableHeaderValue = (value: any): boolean =>
16261638
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
16271639

16281640
const _CT = "ClientToken";
1641+
const _ET = "ETag";
16291642
const _MR = "MaxResults";
16301643
const _NT = "NextToken";
16311644
const _TK = "TagKeys";
16321645
const _mR = "maxResults";
16331646
const _nT = "nextToken";
16341647
const _tK = "tagKeys";
16351648
const _xact = "x-amzn-client-token";
1649+
const _xauim = "x-amzn-update-if-match";

0 commit comments

Comments
 (0)