コード例 #1
0
        /// <summary> Gets a chat thread asynchronously. </summary>
        /// <param name="cancellationToken"> The cancellation token to use. </param>
        /// <exception cref="RequestFailedException">The server returned an error. See <see cref="Exception.Message"/> for details returned from the server.</exception>
        public virtual async Task <Response <ChatThreadProperties> > GetPropertiesAsync(CancellationToken cancellationToken = default)
        {
            using DiagnosticScope scope = _clientDiagnostics.CreateScope($"{nameof(ChatThreadClient)}.{nameof(GetProperties)}");
            scope.Start();
            try
            {
                Response <ChatThreadPropertiesInternal> chatThreadPropertiesInternal = await _chatThreadRestClient.GetChatThreadPropertiesAsync(Id, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(new ChatThreadProperties(chatThreadPropertiesInternal.Value), chatThreadPropertiesInternal.GetRawResponse()));
            }
            catch (Exception ex)
            {
                scope.Failed(ex);
                throw;
            }
        }