Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use string union instead of string in Chat message type #15703

Merged
merged 1 commit into from
Jun 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export interface ChatMessageReadReceipt {
}

// @public
export type ChatMessageType = string;
export type ChatMessageType = "text" | "html" | "topicUpdated" | "participantAdded" | "participantRemoved";

// @public
export interface ChatParticipant {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,14 @@ export const SendChatMessageRequest: coreHttp.CompositeMapper = {
type: {
serializedName: "type",
type: {
name: "String"
name: "Enum",
allowedValues: [
"text",
juancamilor marked this conversation as resolved.
Show resolved Hide resolved
"html",
"topicUpdated",
"participantAdded",
"participantRemoved"
]
}
},
metadata: {
Expand Down Expand Up @@ -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: {
Expand Down
10 changes: 10 additions & 0 deletions sdk/communication/communication-chat/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,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;
```