Skip to content

Commit

Permalink
feat(client-ivschat): type & defaulting refinement to various range p…
Browse files Browse the repository at this point in the history
…roperties
  • Loading branch information
awstools committed Nov 17, 2023
1 parent 1c081b9 commit ceef825
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 26 deletions.
11 changes: 8 additions & 3 deletions clients/client-ivschat/src/commands/CreateChatTokenCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down Expand Up @@ -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",
Expand Down
8 changes: 6 additions & 2 deletions clients/client-ivschat/src/commands/DisconnectUserCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/**
Expand Down Expand Up @@ -125,7 +129,7 @@ export class DisconnectUserCommand extends $Command<
logger,
clientName,
commandName,
inputFilterSensitiveLog: (_: any) => _,
inputFilterSensitiveLog: DisconnectUserRequestFilterSensitiveLog,
outputFilterSensitiveLog: (_: any) => _,
[SMITHY_CONTEXT_KEY]: {
service: "AmazonInteractiveVideoServiceChat",
Expand Down
27 changes: 26 additions & 1 deletion clients/client-ivschat/src/models/models_0.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down Expand Up @@ -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 }),
});
29 changes: 9 additions & 20 deletions codegen/sdk-codegen/aws-models/ivschat.json
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,10 @@
}
},
"com.amazonaws.ivschat#ChatToken": {
"type": "string"
"type": "string",
"traits": {
"smithy.api#sensitive": {}
}
},
"com.amazonaws.ivschat#ChatTokenAttributes": {
"type": "map",
Expand All @@ -781,6 +784,9 @@
},
"value": {
"target": "com.amazonaws.ivschat#String"
},
"traits": {
"smithy.api#sensitive": {}
}
},
"com.amazonaws.ivschat#ChatTokenCapabilities": {
Expand Down Expand Up @@ -909,7 +915,6 @@
"sessionDurationInMinutes": {
"target": "com.amazonaws.ivschat#SessionDurationInMinutes",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>Session duration (in minutes), after which the session expires. Default: 60 (1\n hour).</p>"
}
},
Expand Down Expand Up @@ -1116,14 +1121,12 @@
"maximumMessageRatePerSecond": {
"target": "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>Maximum number of messages per second that can be sent to the room (by all clients).\n Default: 10. </p>"
}
},
"maximumMessageLength": {
"target": "com.amazonaws.ivschat#RoomMaxMessageLength",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>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.</p>"
}
},
Expand Down Expand Up @@ -1183,14 +1186,12 @@
"maximumMessageRatePerSecond": {
"target": "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>Maximum number of messages per second that can be sent to the room (by all clients),\n from the request (if specified).</p>"
}
},
"maximumMessageLength": {
"target": "com.amazonaws.ivschat#RoomMaxMessageLength",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>Maximum number of characters in a single message, from the request (if\n specified).</p>"
}
},
Expand Down Expand Up @@ -1692,14 +1693,12 @@
"maximumMessageRatePerSecond": {
"target": "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>Maximum number of messages per second that can be sent to the room (by all clients).\n Default: 10.</p>"
}
},
"maximumMessageLength": {
"target": "com.amazonaws.ivschat#RoomMaxMessageLength",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>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.</p>"
}
},
Expand Down Expand Up @@ -1807,7 +1806,6 @@
"maxResults": {
"target": "com.amazonaws.ivschat#MaxLoggingConfigurationResults",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>Maximum number of logging configurations to return. Default: 50.</p>"
}
}
Expand Down Expand Up @@ -1882,7 +1880,6 @@
"maxResults": {
"target": "com.amazonaws.ivschat#MaxRoomResults",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>Maximum number of rooms to return. Default: 50.</p>"
}
},
Expand Down Expand Up @@ -2132,7 +2129,6 @@
"com.amazonaws.ivschat#MaxLoggingConfigurationResults": {
"type": "integer",
"traits": {
"smithy.api#default": 0,
"smithy.api#range": {
"min": 1,
"max": 50
Expand All @@ -2142,7 +2138,6 @@
"com.amazonaws.ivschat#MaxRoomResults": {
"type": "integer",
"traits": {
"smithy.api#default": 0,
"smithy.api#range": {
"min": 1,
"max": 50
Expand Down Expand Up @@ -2309,7 +2304,6 @@
"com.amazonaws.ivschat#RoomMaxMessageLength": {
"type": "integer",
"traits": {
"smithy.api#default": 0,
"smithy.api#range": {
"min": 1,
"max": 500
Expand All @@ -2319,7 +2313,6 @@
"com.amazonaws.ivschat#RoomMaxMessageRatePerSecond": {
"type": "integer",
"traits": {
"smithy.api#default": 0,
"smithy.api#range": {
"min": 1,
"max": 100
Expand Down Expand Up @@ -2516,7 +2509,6 @@
"com.amazonaws.ivschat#SessionDurationInMinutes": {
"type": "integer",
"traits": {
"smithy.api#default": 0,
"smithy.api#range": {
"min": 1,
"max": 180
Expand Down Expand Up @@ -2889,14 +2881,12 @@
"maximumMessageRatePerSecond": {
"target": "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>Maximum number of messages per second that can be sent to the room (by all clients).\n Default: 10.</p>"
}
},
"maximumMessageLength": {
"target": "com.amazonaws.ivschat#RoomMaxMessageLength",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>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.</p>"
}
},
Expand Down Expand Up @@ -2950,14 +2940,12 @@
"maximumMessageRatePerSecond": {
"target": "com.amazonaws.ivschat#RoomMaxMessageRatePerSecond",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>Maximum number of messages per second that can be sent to the room (by all clients),\n from the request (if specified).</p>"
}
},
"maximumMessageLength": {
"target": "com.amazonaws.ivschat#RoomMaxMessageLength",
"traits": {
"smithy.api#default": 0,
"smithy.api#documentation": "<p>Maximum number of characters in a single message, from the request (if\n specified).</p>"
}
},
Expand Down Expand Up @@ -2987,7 +2975,8 @@
"smithy.api#length": {
"min": 1,
"max": 128
}
},
"smithy.api#sensitive": {}
}
},
"com.amazonaws.ivschat#ValidationException": {
Expand Down

0 comments on commit ceef825

Please sign in to comment.