Skip to content

Commit

Permalink
[Communication Chat] GA 2023-11-07 for inline image feature (Azure#39319
Browse files Browse the repository at this point in the history
)

* Updated autorest.md with new tag and commit

* Correct build command and update commit number

* First build

* Update ChatMessageContent to use new internal model

* Update factory

* Remove Kind workaround

* Update version and tests

* Disable ApiCompat temporarily

* Update API

* Override constructor for chat attachment

* Update API with file type removed.

* Remove constructor for ChatAttachment

* Update URL to be string to match updated swagger

* Address API View comments

* Correct APICompat

* Remove extension property

* Update test recording

* Update test recordings

* Update changes

* Add sanatize for uris and identiy.

Update recordings

* Update recordings
  • Loading branch information
palatter authored Nov 27, 2023
1 parent b9e0786 commit 1e56406
Show file tree
Hide file tree
Showing 27 changed files with 457 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,32 @@ public partial class AddChatParticipantsResult
internal AddChatParticipantsResult() { }
public System.Collections.Generic.IReadOnlyList<Azure.Communication.Chat.ChatError> InvalidParticipants { get { throw null; } }
}
public partial class ChatAttachment
{
internal ChatAttachment() { }
public Azure.Communication.Chat.ChatAttachmentType AttachmentType { get { throw null; } }
public string Id { get { throw null; } }
public string Name { get { throw null; } }
public System.Uri PreviewUri { get { throw null; } }
public System.Uri Uri { get { throw null; } }
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct ChatAttachmentType : System.IEquatable<Azure.Communication.Chat.ChatAttachmentType>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public ChatAttachmentType(string value) { throw null; }
public static Azure.Communication.Chat.ChatAttachmentType Image { get { throw null; } }
public bool Equals(Azure.Communication.Chat.ChatAttachmentType other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static bool operator ==(Azure.Communication.Chat.ChatAttachmentType left, Azure.Communication.Chat.ChatAttachmentType right) { throw null; }
public static implicit operator Azure.Communication.Chat.ChatAttachmentType (string value) { throw null; }
public static bool operator !=(Azure.Communication.Chat.ChatAttachmentType left, Azure.Communication.Chat.ChatAttachmentType right) { throw null; }
public override string ToString() { throw null; }
}
public partial class ChatClient
{
protected ChatClient() { }
Expand All @@ -19,11 +45,12 @@ public ChatClient(System.Uri endpoint, Azure.Communication.CommunicationTokenCre
}
public partial class ChatClientOptions : Azure.Core.ClientOptions
{
public ChatClientOptions(Azure.Communication.Chat.ChatClientOptions.ServiceVersion version = Azure.Communication.Chat.ChatClientOptions.ServiceVersion.V2021_09_07) { }
public ChatClientOptions(Azure.Communication.Chat.ChatClientOptions.ServiceVersion version = Azure.Communication.Chat.ChatClientOptions.ServiceVersion.V2023_11_07) { }
public enum ServiceVersion
{
V2021_03_07 = 1,
V2021_09_07 = 2,
V2023_11_07 = 3,
}
}
public partial class ChatError
Expand Down Expand Up @@ -53,6 +80,7 @@ internal ChatMessage() { }
public partial class ChatMessageContent
{
internal ChatMessageContent() { }
public System.Collections.Generic.IReadOnlyList<Azure.Communication.Chat.ChatAttachment> Attachments { get { throw null; } }
public Azure.Communication.CommunicationIdentifier Initiator { get { throw null; } }
public string Message { get { throw null; } }
public System.Collections.Generic.IReadOnlyList<Azure.Communication.Chat.ChatParticipant> Participants { get { throw null; } }
Expand Down Expand Up @@ -89,12 +117,14 @@ internal ChatMessageReadReceipt() { }
public static partial class ChatModelFactory
{
public static Azure.Communication.Chat.AddChatParticipantsResult AddChatParticipantsResult(System.Collections.Generic.IEnumerable<Azure.Communication.Chat.ChatError> invalidParticipants = null) { throw null; }
public static Azure.Communication.Chat.ChatAttachment ChatAttachment(string id, Azure.Communication.Chat.ChatAttachmentType attachmentType, string name, System.Uri uri, System.Uri previewUri) { throw null; }
public static Azure.Communication.Chat.ChatError ChatError(string code = null, string message = null, string target = null, System.Collections.Generic.IEnumerable<Azure.Communication.Chat.ChatError> details = null, Azure.Communication.Chat.ChatError innerError = null) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Communication.Chat.ChatMessage ChatMessage(string id, Azure.Communication.Chat.ChatMessageType type, string sequenceId, string version, Azure.Communication.Chat.ChatMessageContent content, string senderDisplayName, System.DateTimeOffset createdOn, string senderId, System.DateTimeOffset? deletedOn, System.DateTimeOffset? editedOn) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Communication.Chat.ChatMessage ChatMessage(string id, Azure.Communication.Chat.ChatMessageType type, string sequenceId, string version, Azure.Communication.Chat.ChatMessageContent content, string senderDisplayName, System.DateTimeOffset createdOn, string senderId, System.DateTimeOffset? deletedOn, System.DateTimeOffset? editedOn, System.Collections.Generic.IReadOnlyDictionary<string, string> metadata) { throw null; }
public static Azure.Communication.Chat.ChatMessageContent ChatMessageContent(string message, string topic, Azure.Communication.CommunicationUserIdentifier communicationUserIdentifier, System.Collections.Generic.IEnumerable<Azure.Communication.Chat.ChatParticipant> participants) { throw null; }
public static Azure.Communication.Chat.ChatMessageContent ChatMessageContent(string message, string topic, Azure.Communication.CommunicationUserIdentifier communicationUserIdentifier, System.Collections.Generic.IEnumerable<Azure.Communication.Chat.ChatParticipant> participants, System.Collections.Generic.IEnumerable<Azure.Communication.Chat.ChatAttachment> attachments = null) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static Azure.Communication.Chat.ChatMessageReadReceipt ChatMessageReadReceipt(Azure.Communication.CommunicationIdentifier sender, string chatMessageId, System.DateTimeOffset readOn) { throw null; }
public static Azure.Communication.Chat.ChatParticipant ChatParticipant(Azure.Communication.CommunicationIdentifier user, string displayName, System.DateTimeOffset? shareHistoryTime) { throw null; }
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/Azure.Communication.Chat/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "net",
"TagPrefix": "net/communication/Azure.Communication.Chat",
"Tag": "net/communication/Azure.Communication.Chat_477f878af5"
"Tag": "net/communication/Azure.Communication.Chat_34c8b4c801"
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ChatClientOptions : ClientOptions
/// <summary>
/// The latest version of the Chat service.
/// </summary>
internal const ServiceVersion LatestVersion = ServiceVersion.V2021_09_07;
internal const ServiceVersion LatestVersion = ServiceVersion.V2023_11_07;

internal string ApiVersion { get; }

Expand All @@ -27,6 +27,7 @@ public ChatClientOptions(ServiceVersion version = LatestVersion)
{
ServiceVersion.V2021_03_07 => "2021-03-07",
ServiceVersion.V2021_09_07 => "2021-09-07",
ServiceVersion.V2023_11_07 => "2023-11-07",
_ => throw new ArgumentOutOfRangeException(nameof(version)),
};
}
Expand All @@ -44,8 +45,13 @@ public enum ServiceVersion
/// <summary>
/// The V2021_09_07 of the Chat service.
/// </summary>
V2021_09_07 = 2
#pragma warning restore CA1707 // Identifiers should not contain underscores
V2021_09_07 = 2,
/// <summary>
/// The V2023_11_07 of the Chat service.
/// </summary>
#pragma warning restore CA1707 // Identifiers should not contain underscores
V2023_11_07 = 3
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,9 @@ public virtual async Task<Response> RemoveParticipantAsync(CommunicationIdentifi
try
{
CommunicationIdentifierModel communicationIdentifierModel = CommunicationIdentifierSerializer.Serialize(identifier);
return await _chatThreadRestClient.RemoveChatParticipantAsync(Id, communicationIdentifierModel.RawId,
return await _chatThreadRestClient.RemoveChatParticipantAsync(Id,
communicationIdentifierModel.Kind,
communicationIdentifierModel.RawId,
communicationIdentifierModel.CommunicationUser,
communicationIdentifierModel.PhoneNumber,
communicationIdentifierModel.MicrosoftTeamsUser,
Expand All @@ -620,7 +622,9 @@ public virtual Response RemoveParticipant(CommunicationIdentifier identifier, Ca
try
{
CommunicationIdentifierModel communicationIdentifierModel = CommunicationIdentifierSerializer.Serialize(identifier);
return _chatThreadRestClient.RemoveChatParticipant(Id, communicationIdentifierModel.RawId,
return _chatThreadRestClient.RemoveChatParticipant(Id,
communicationIdentifierModel.Kind,
communicationIdentifierModel.RawId,
communicationIdentifierModel.CommunicationUser,
communicationIdentifierModel.PhoneNumber,
communicationIdentifierModel.MicrosoftTeamsUser,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1e56406

Please sign in to comment.