Skip to content

Commit

Permalink
feat(client-mediapackagev2): This release enables customers to safely…
Browse files Browse the repository at this point in the history
… update their MediaPackage v2 channel groups, channels and origin endpoints using entity tags.
  • Loading branch information
awstools committed Mar 11, 2024
1 parent 582eb00 commit 1e309c2
Show file tree
Hide file tree
Showing 12 changed files with 213 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export interface CreateChannelCommandOutput extends CreateChannelResponse, __Met
* // Url: "STRING_VALUE",
* // },
* // ],
* // ETag: "STRING_VALUE",
* // Tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export interface CreateChannelGroupCommandOutput extends CreateChannelGroupRespo
* // EgressDomain: "STRING_VALUE", // required
* // CreatedAt: new Date("TIMESTAMP"), // required
* // ModifiedAt: new Date("TIMESTAMP"), // required
* // ETag: "STRING_VALUE",
* // Description: "STRING_VALUE",
* // Tags: { // TagMap
* // "<keys>": "STRING_VALUE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ export interface CreateOriginEndpointCommandOutput extends CreateOriginEndpointR
* // },
* // },
* // ],
* // ETag: "STRING_VALUE",
* // Tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface GetChannelCommandOutput extends GetChannelResponse, __MetadataB
* // Url: "STRING_VALUE",
* // },
* // ],
* // ETag: "STRING_VALUE",
* // Tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export interface GetChannelGroupCommandOutput extends GetChannelGroupResponse, _
* // CreatedAt: new Date("TIMESTAMP"), // required
* // ModifiedAt: new Date("TIMESTAMP"), // required
* // Description: "STRING_VALUE",
* // ETag: "STRING_VALUE",
* // Tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ export interface GetOriginEndpointCommandOutput extends GetOriginEndpointRespons
* // },
* // },
* // ],
* // ETag: "STRING_VALUE",
* // Tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface UpdateChannelCommandOutput extends UpdateChannelResponse, __Met
* const input = { // UpdateChannelRequest
* ChannelGroupName: "STRING_VALUE", // required
* ChannelName: "STRING_VALUE", // required
* ETag: "STRING_VALUE",
* Description: "STRING_VALUE",
* };
* const command = new UpdateChannelCommand(input);
Expand All @@ -56,6 +57,7 @@ export interface UpdateChannelCommandOutput extends UpdateChannelResponse, __Met
* // Url: "STRING_VALUE",
* // },
* // ],
* // ETag: "STRING_VALUE",
* // Tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export interface UpdateChannelGroupCommandOutput extends UpdateChannelGroupRespo
* const client = new MediaPackageV2Client(config);
* const input = { // UpdateChannelGroupRequest
* ChannelGroupName: "STRING_VALUE", // required
* ETag: "STRING_VALUE",
* Description: "STRING_VALUE",
* };
* const command = new UpdateChannelGroupCommand(input);
Expand All @@ -49,6 +50,7 @@ export interface UpdateChannelGroupCommandOutput extends UpdateChannelGroupRespo
* // CreatedAt: new Date("TIMESTAMP"), // required
* // ModifiedAt: new Date("TIMESTAMP"), // required
* // Description: "STRING_VALUE",
* // ETag: "STRING_VALUE",
* // Tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export interface UpdateOriginEndpointCommandOutput extends UpdateOriginEndpointR
* },
* },
* ],
* ETag: "STRING_VALUE",
* };
* const command = new UpdateOriginEndpointCommand(input);
* const response = await client.send(command);
Expand Down Expand Up @@ -190,6 +191,7 @@ export interface UpdateOriginEndpointCommandOutput extends UpdateOriginEndpointR
* // },
* // },
* // ],
* // ETag: "STRING_VALUE",
* // Tags: { // TagMap
* // "<keys>": "STRING_VALUE",
* // },
Expand Down
72 changes: 72 additions & 0 deletions clients/client-mediapackagev2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,12 @@ export interface CreateChannelResponse {
*/
IngestEndpoints?: IngestEndpoint[];

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>The comma-separated list of tag key:value pairs assigned to the channel.</p>
Expand Down Expand Up @@ -591,6 +597,12 @@ export interface GetChannelResponse {
*/
IngestEndpoints?: IngestEndpoint[];

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>The comma-separated list of tag key:value pairs assigned to the channel.</p>
Expand Down Expand Up @@ -1441,6 +1453,12 @@ export interface CreateOriginEndpointResponse {
*/
LowLatencyHlsManifests?: GetLowLatencyHlsManifestConfiguration[];

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>The comma-separated list of tag key:value pairs assigned to the origin endpoint.</p>
Expand Down Expand Up @@ -1575,6 +1593,12 @@ export interface GetOriginEndpointResponse {
*/
LowLatencyHlsManifests?: GetLowLatencyHlsManifestConfiguration[];

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>The comma-separated list of tag key:value pairs assigned to the origin endpoint.</p>
Expand Down Expand Up @@ -1913,6 +1937,12 @@ export interface UpdateOriginEndpointRequest {
* <p>A low-latency HLS manifest configuration.</p>
*/
LowLatencyHlsManifests?: CreateLowLatencyHlsManifestConfiguration[];

/**
* @public
* <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>
*/
ETag?: string;
}

/**
Expand Down Expand Up @@ -1991,6 +2021,12 @@ export interface UpdateOriginEndpointResponse {
*/
LowLatencyHlsManifests?: GetLowLatencyHlsManifestConfiguration[];

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>The comma-separated list of tag key:value pairs assigned to the origin endpoint.</p>
Expand All @@ -2014,6 +2050,12 @@ export interface UpdateChannelRequest {
*/
ChannelName: string | undefined;

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>Any descriptive information that you want to add to the channel for future identification purposes.</p>
Expand Down Expand Up @@ -2067,6 +2109,12 @@ export interface UpdateChannelResponse {
*/
IngestEndpoints?: IngestEndpoint[];

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>The comma-separated list of tag key:value pairs assigned to the channel.</p>
Expand Down Expand Up @@ -2143,6 +2191,12 @@ export interface CreateChannelGroupResponse {
*/
ModifiedAt: Date | undefined;

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>The description for your channel group.</p>
Expand Down Expand Up @@ -2223,6 +2277,12 @@ export interface GetChannelGroupResponse {
*/
Description?: string;

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>The comma-separated list of tag key:value pairs assigned to the channel group.</p>
Expand Down Expand Up @@ -2274,6 +2334,12 @@ export interface UpdateChannelGroupRequest {
*/
ChannelGroupName: string | undefined;

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>Any descriptive information that you want to add to the channel group for future identification purposes.</p>
Expand Down Expand Up @@ -2321,6 +2387,12 @@ export interface UpdateChannelGroupResponse {
*/
Description?: string;

/**
* @public
* <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>
*/
ETag?: string;

/**
* @public
* <p>The comma-separated list of tag key:value pairs assigned to the channel group.</p>
Expand Down
26 changes: 20 additions & 6 deletions clients/client-mediapackagev2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,9 +537,10 @@ export const se_UpdateChannelCommand = async (
context: __SerdeContext
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = {
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
};
[_xauim]: input[_ET]!,
});
b.bp("/channelGroup/{ChannelGroupName}/channel/{ChannelName}");
b.p("ChannelGroupName", () => input.ChannelGroupName!, "{ChannelGroupName}", false);
b.p("ChannelName", () => input.ChannelName!, "{ChannelName}", false);
Expand All @@ -561,9 +562,10 @@ export const se_UpdateChannelGroupCommand = async (
context: __SerdeContext
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = {
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
};
[_xauim]: input[_ET]!,
});
b.bp("/channelGroup/{ChannelGroupName}");
b.p("ChannelGroupName", () => input.ChannelGroupName!, "{ChannelGroupName}", false);
let body: any;
Expand All @@ -584,9 +586,10 @@ export const se_UpdateOriginEndpointCommand = async (
context: __SerdeContext
): Promise<__HttpRequest> => {
const b = rb(input, context);
const headers: any = {
const headers: any = map({}, isSerializableHeaderValue, {
"content-type": "application/json",
};
[_xauim]: input[_ET]!,
});
b.bp("/channelGroup/{ChannelGroupName}/channel/{ChannelName}/originEndpoint/{OriginEndpointName}");
b.p("ChannelGroupName", () => input.ChannelGroupName!, "{ChannelGroupName}", false);
b.p("ChannelName", () => input.ChannelName!, "{ChannelName}", false);
Expand Down Expand Up @@ -626,6 +629,7 @@ export const de_CreateChannelCommand = async (
ChannelName: __expectString,
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Description: __expectString,
ETag: __expectString,
IngestEndpoints: _json,
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Tags: _json,
Expand Down Expand Up @@ -653,6 +657,7 @@ export const de_CreateChannelGroupCommand = async (
ChannelGroupName: __expectString,
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Description: __expectString,
ETag: __expectString,
EgressDomain: __expectString,
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Tags: _json,
Expand Down Expand Up @@ -682,6 +687,7 @@ export const de_CreateOriginEndpointCommand = async (
ContainerType: __expectString,
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Description: __expectString,
ETag: __expectString,
HlsManifests: (_) => de_GetHlsManifests(_, context),
LowLatencyHlsManifests: (_) => de_GetLowLatencyHlsManifests(_, context),
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Expand Down Expand Up @@ -799,6 +805,7 @@ export const de_GetChannelCommand = async (
ChannelName: __expectString,
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Description: __expectString,
ETag: __expectString,
IngestEndpoints: _json,
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Tags: _json,
Expand Down Expand Up @@ -826,6 +833,7 @@ export const de_GetChannelGroupCommand = async (
ChannelGroupName: __expectString,
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Description: __expectString,
ETag: __expectString,
EgressDomain: __expectString,
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Tags: [, _json, `tags`],
Expand Down Expand Up @@ -878,6 +886,7 @@ export const de_GetOriginEndpointCommand = async (
ContainerType: __expectString,
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Description: __expectString,
ETag: __expectString,
HlsManifests: (_) => de_GetHlsManifests(_, context),
LowLatencyHlsManifests: (_) => de_GetLowLatencyHlsManifests(_, context),
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Expand Down Expand Up @@ -1089,6 +1098,7 @@ export const de_UpdateChannelCommand = async (
ChannelName: __expectString,
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Description: __expectString,
ETag: __expectString,
IngestEndpoints: _json,
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Tags: [, _json, `tags`],
Expand Down Expand Up @@ -1116,6 +1126,7 @@ export const de_UpdateChannelGroupCommand = async (
ChannelGroupName: __expectString,
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Description: __expectString,
ETag: __expectString,
EgressDomain: __expectString,
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Tags: [, _json, `tags`],
Expand Down Expand Up @@ -1145,6 +1156,7 @@ export const de_UpdateOriginEndpointCommand = async (
ContainerType: __expectString,
CreatedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Description: __expectString,
ETag: __expectString,
HlsManifests: (_) => de_GetHlsManifests(_, context),
LowLatencyHlsManifests: (_) => de_GetLowLatencyHlsManifests(_, context),
ModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
Expand Down Expand Up @@ -1626,10 +1638,12 @@ const isSerializableHeaderValue = (value: any): boolean =>
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);

const _CT = "ClientToken";
const _ET = "ETag";
const _MR = "MaxResults";
const _NT = "NextToken";
const _TK = "TagKeys";
const _mR = "maxResults";
const _nT = "nextToken";
const _tK = "tagKeys";
const _xact = "x-amzn-client-token";
const _xauim = "x-amzn-update-if-match";
Loading

0 comments on commit 1e309c2

Please sign in to comment.