diff --git a/sdk/communication/communication-chat/review/communication-chat.api.md b/sdk/communication/communication-chat/review/communication-chat.api.md index 2489f5687c22..c421d79196d8 100644 --- a/sdk/communication/communication-chat/review/communication-chat.api.md +++ b/sdk/communication/communication-chat/review/communication-chat.api.md @@ -110,7 +110,7 @@ export interface ChatMessageReadReceipt { } // @public -export type ChatMessageType = string; +export type ChatMessageType = "text" | "html" | "topicUpdated" | "participantAdded" | "participantRemoved"; // @public export interface ChatParticipant { diff --git a/sdk/communication/communication-chat/src/generated/src/chatApiClientContext.ts b/sdk/communication/communication-chat/src/generated/src/chatApiClientContext.ts index 4f80ac33423b..d8555851910b 100644 --- a/sdk/communication/communication-chat/src/generated/src/chatApiClientContext.ts +++ b/sdk/communication/communication-chat/src/generated/src/chatApiClientContext.ts @@ -10,7 +10,7 @@ import * as coreHttp from "@azure/core-http"; import { ChatApiClientOptionalParams } from "./models"; const packageName = "azure-communication-chat"; -const packageVersion = "1.0.0"; +const packageVersion = "1.1.0-beta.1"; export class ChatApiClientContext extends coreHttp.ServiceClient { endpoint: string; diff --git a/sdk/communication/communication-chat/src/generated/src/models/index.ts b/sdk/communication/communication-chat/src/generated/src/models/index.ts index ea0f03892209..7e3b660cc55c 100644 --- a/sdk/communication/communication-chat/src/generated/src/models/index.ts +++ b/sdk/communication/communication-chat/src/generated/src/models/index.ts @@ -291,28 +291,13 @@ export const enum KnownCommunicationCloudEnvironmentModel { * **gcch** */ export type CommunicationCloudEnvironmentModel = string; - -/** Known values of {@link ChatMessageType} that the service accepts. */ -export const enum KnownChatMessageType { - Text = "text", - Html = "html", - TopicUpdated = "topicUpdated", - ParticipantAdded = "participantAdded", - ParticipantRemoved = "participantRemoved" -} - -/** - * Defines values for ChatMessageType. \ - * {@link KnownChatMessageType} can be used interchangeably with ChatMessageType, - * this enum contains the known values that the service supports. - * ### Know values supported by the service - * **text** \ - * **html** \ - * **topicUpdated** \ - * **participantAdded** \ - * **participantRemoved** - */ -export type ChatMessageType = string; +/** Defines values for ChatMessageType. */ +export type ChatMessageType = + | "text" + | "html" + | "topicUpdated" + | "participantAdded" + | "participantRemoved"; /** Optional parameters. */ export interface ChatThreadListChatReadReceiptsOptionalParams diff --git a/sdk/communication/communication-chat/src/generated/src/models/mappers.ts b/sdk/communication/communication-chat/src/generated/src/models/mappers.ts index 42fb0740a2fb..f1742de53bb9 100644 --- a/sdk/communication/communication-chat/src/generated/src/models/mappers.ts +++ b/sdk/communication/communication-chat/src/generated/src/models/mappers.ts @@ -266,7 +266,14 @@ export const SendChatMessageRequest: coreHttp.CompositeMapper = { type: { serializedName: "type", type: { - name: "String" + name: "Enum", + allowedValues: [ + "text", + "html", + "topicUpdated", + "participantAdded", + "participantRemoved" + ] } }, metadata: { @@ -341,7 +348,14 @@ export const ChatMessage: coreHttp.CompositeMapper = { serializedName: "type", required: true, type: { - name: "String" + name: "Enum", + allowedValues: [ + "text", + "html", + "topicUpdated", + "participantAdded", + "participantRemoved" + ] } }, sequenceId: { diff --git a/sdk/communication/communication-chat/swagger/README.md b/sdk/communication/communication-chat/swagger/README.md index 735ad526a6f4..efbb991153b8 100644 --- a/sdk/communication/communication-chat/swagger/README.md +++ b/sdk/communication/communication-chat/swagger/README.md @@ -33,3 +33,13 @@ directive: transform: > $["x-ms-client-name"] = "ChatError"; ``` + +### Set ChatMessageType Model as string false + +```yaml +directive: + from: swagger-document + where: "$.definitions.ChatMessageType" + transform: > + $["x-ms-enum"].modelAsString = false; +```