From ceef8258a255f27947a6ff8faa17148da803fcc9 Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 17 Nov 2023 20:13:28 +0000 Subject: [PATCH] feat(client-ivschat): type & defaulting refinement to various range properties --- .../src/commands/CreateChatTokenCommand.ts | 11 +++++-- .../src/commands/DisconnectUserCommand.ts | 8 +++-- clients/client-ivschat/src/models/models_0.ts | 27 ++++++++++++++++- codegen/sdk-codegen/aws-models/ivschat.json | 29 ++++++------------- 4 files changed, 49 insertions(+), 26 deletions(-) diff --git a/clients/client-ivschat/src/commands/CreateChatTokenCommand.ts b/clients/client-ivschat/src/commands/CreateChatTokenCommand.ts index 20405f89f7a4..78673c065b6d 100644 --- a/clients/client-ivschat/src/commands/CreateChatTokenCommand.ts +++ b/clients/client-ivschat/src/commands/CreateChatTokenCommand.ts @@ -15,7 +15,12 @@ import { } from "@smithy/types"; import { IvschatClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IvschatClient"; -import { CreateChatTokenRequest, CreateChatTokenResponse } from "../models/models_0"; +import { + CreateChatTokenRequest, + CreateChatTokenRequestFilterSensitiveLog, + CreateChatTokenResponse, + CreateChatTokenResponseFilterSensitiveLog, +} from "../models/models_0"; import { de_CreateChatTokenCommand, se_CreateChatTokenCommand } from "../protocols/Aws_restJson1"; /** @@ -141,8 +146,8 @@ export class CreateChatTokenCommand extends $Command< logger, clientName, commandName, - inputFilterSensitiveLog: (_: any) => _, - outputFilterSensitiveLog: (_: any) => _, + inputFilterSensitiveLog: CreateChatTokenRequestFilterSensitiveLog, + outputFilterSensitiveLog: CreateChatTokenResponseFilterSensitiveLog, [SMITHY_CONTEXT_KEY]: { service: "AmazonInteractiveVideoServiceChat", operation: "CreateChatToken", diff --git a/clients/client-ivschat/src/commands/DisconnectUserCommand.ts b/clients/client-ivschat/src/commands/DisconnectUserCommand.ts index 856199a02d7e..c3940226fb60 100644 --- a/clients/client-ivschat/src/commands/DisconnectUserCommand.ts +++ b/clients/client-ivschat/src/commands/DisconnectUserCommand.ts @@ -15,7 +15,11 @@ import { } from "@smithy/types"; import { IvschatClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../IvschatClient"; -import { DisconnectUserRequest, DisconnectUserResponse } from "../models/models_0"; +import { + DisconnectUserRequest, + DisconnectUserRequestFilterSensitiveLog, + DisconnectUserResponse, +} from "../models/models_0"; import { de_DisconnectUserCommand, se_DisconnectUserCommand } from "../protocols/Aws_restJson1"; /** @@ -125,7 +129,7 @@ export class DisconnectUserCommand extends $Command< logger, clientName, commandName, - inputFilterSensitiveLog: (_: any) => _, + inputFilterSensitiveLog: DisconnectUserRequestFilterSensitiveLog, outputFilterSensitiveLog: (_: any) => _, [SMITHY_CONTEXT_KEY]: { service: "AmazonInteractiveVideoServiceChat", diff --git a/clients/client-ivschat/src/models/models_0.ts b/clients/client-ivschat/src/models/models_0.ts index bea6ead7eec1..a72cd93cd503 100644 --- a/clients/client-ivschat/src/models/models_0.ts +++ b/clients/client-ivschat/src/models/models_0.ts @@ -1,5 +1,5 @@ // smithy-typescript generated code -import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client"; +import { ExceptionOptionType as __ExceptionOptionType, SENSITIVE_STRING } from "@smithy/smithy-client"; import { IvschatServiceException as __BaseException } from "./IvschatServiceException"; @@ -1561,3 +1561,28 @@ export interface UpdateRoomResponse { */ loggingConfigurationIdentifiers?: string[]; } + +/** + * @internal + */ +export const CreateChatTokenRequestFilterSensitiveLog = (obj: CreateChatTokenRequest): any => ({ + ...obj, + ...(obj.userId && { userId: SENSITIVE_STRING }), + ...(obj.attributes && { attributes: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const CreateChatTokenResponseFilterSensitiveLog = (obj: CreateChatTokenResponse): any => ({ + ...obj, + ...(obj.token && { token: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const DisconnectUserRequestFilterSensitiveLog = (obj: DisconnectUserRequest): any => ({ + ...obj, + ...(obj.userId && { userId: SENSITIVE_STRING }), +}); diff --git a/codegen/sdk-codegen/aws-models/ivschat.json b/codegen/sdk-codegen/aws-models/ivschat.json index 4984448b7937..f7c09266d401 100644 --- a/codegen/sdk-codegen/aws-models/ivschat.json +++ b/codegen/sdk-codegen/aws-models/ivschat.json @@ -772,7 +772,10 @@ } }, "com.amazonaws.ivschat#ChatToken": { - "type": "string" + "type": "string", + "traits": { + "smithy.api#sensitive": {} + } }, "com.amazonaws.ivschat#ChatTokenAttributes": { "type": "map", @@ -781,6 +784,9 @@ }, "value": { "target": "com.amazonaws.ivschat#String" + }, + "traits": { + "smithy.api#sensitive": {} } }, "com.amazonaws.ivschat#ChatTokenCapabilities": { @@ -909,7 +915,6 @@ "sessionDurationInMinutes": { "target": "com.amazonaws.ivschat#SessionDurationInMinutes", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Session duration (in minutes), after which the session expires. Default: 60 (1\n hour).

" } }, @@ -1116,14 +1121,12 @@ "maximumMessageRatePerSecond": { "target": "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of messages per second that can be sent to the room (by all clients).\n Default: 10.

" } }, "maximumMessageLength": { "target": "com.amazonaws.ivschat#RoomMaxMessageLength", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of characters in a single message. Messages are expected to be UTF-8\n encoded and this limit applies specifically to rune/code-point count, not number of bytes.\n Default: 500.

" } }, @@ -1183,14 +1186,12 @@ "maximumMessageRatePerSecond": { "target": "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of messages per second that can be sent to the room (by all clients),\n from the request (if specified).

" } }, "maximumMessageLength": { "target": "com.amazonaws.ivschat#RoomMaxMessageLength", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of characters in a single message, from the request (if\n specified).

" } }, @@ -1692,14 +1693,12 @@ "maximumMessageRatePerSecond": { "target": "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of messages per second that can be sent to the room (by all clients).\n Default: 10.

" } }, "maximumMessageLength": { "target": "com.amazonaws.ivschat#RoomMaxMessageLength", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of characters in a single message. Messages are expected to be UTF-8\n encoded and this limit applies specifically to rune/code-point count, not number of bytes.\n Default: 500.

" } }, @@ -1807,7 +1806,6 @@ "maxResults": { "target": "com.amazonaws.ivschat#MaxLoggingConfigurationResults", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of logging configurations to return. Default: 50.

" } } @@ -1882,7 +1880,6 @@ "maxResults": { "target": "com.amazonaws.ivschat#MaxRoomResults", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of rooms to return. Default: 50.

" } }, @@ -2132,7 +2129,6 @@ "com.amazonaws.ivschat#MaxLoggingConfigurationResults": { "type": "integer", "traits": { - "smithy.api#default": 0, "smithy.api#range": { "min": 1, "max": 50 @@ -2142,7 +2138,6 @@ "com.amazonaws.ivschat#MaxRoomResults": { "type": "integer", "traits": { - "smithy.api#default": 0, "smithy.api#range": { "min": 1, "max": 50 @@ -2309,7 +2304,6 @@ "com.amazonaws.ivschat#RoomMaxMessageLength": { "type": "integer", "traits": { - "smithy.api#default": 0, "smithy.api#range": { "min": 1, "max": 500 @@ -2319,7 +2313,6 @@ "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond": { "type": "integer", "traits": { - "smithy.api#default": 0, "smithy.api#range": { "min": 1, "max": 100 @@ -2516,7 +2509,6 @@ "com.amazonaws.ivschat#SessionDurationInMinutes": { "type": "integer", "traits": { - "smithy.api#default": 0, "smithy.api#range": { "min": 1, "max": 180 @@ -2889,14 +2881,12 @@ "maximumMessageRatePerSecond": { "target": "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of messages per second that can be sent to the room (by all clients).\n Default: 10.

" } }, "maximumMessageLength": { "target": "com.amazonaws.ivschat#RoomMaxMessageLength", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

The maximum number of characters in a single message. Messages are expected to be UTF-8\n encoded and this limit applies specifically to rune/code-point count, not number of bytes.\n Default: 500.

" } }, @@ -2950,14 +2940,12 @@ "maximumMessageRatePerSecond": { "target": "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of messages per second that can be sent to the room (by all clients),\n from the request (if specified).

" } }, "maximumMessageLength": { "target": "com.amazonaws.ivschat#RoomMaxMessageLength", "traits": { - "smithy.api#default": 0, "smithy.api#documentation": "

Maximum number of characters in a single message, from the request (if\n specified).

" } }, @@ -2987,7 +2975,8 @@ "smithy.api#length": { "min": 1, "max": 128 - } + }, + "smithy.api#sensitive": {} } }, "com.amazonaws.ivschat#ValidationException": {