|
| 1 | +// ------------------------------------------------------------------------------ |
| 2 | +// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information. |
| 3 | +// ------------------------------------------------------------------------------ |
| 4 | + |
| 5 | +// **NOTE** This file was generated by a tool and any changes will be overwritten. |
| 6 | +// <auto-generated/> |
| 7 | + |
| 8 | +// Template Source: EntityReferenceRequest.cs.tt |
| 9 | + |
| 10 | +namespace Microsoft.Graph |
| 11 | +{ |
| 12 | + using System.Collections.Generic; |
| 13 | + using System.Net.Http; |
| 14 | + using System.Threading; |
| 15 | + |
| 16 | + /// <summary> |
| 17 | + /// The type ChatMessageReferenceRequest. |
| 18 | + /// </summary> |
| 19 | + public partial class ChatMessageReferenceRequest : BaseRequest, IChatMessageReferenceRequest |
| 20 | + { |
| 21 | + /// <summary> |
| 22 | + /// Constructs a new ChatMessageReferenceRequest. |
| 23 | + /// </summary> |
| 24 | + /// <param name="requestUrl">The URL for the built request.</param> |
| 25 | + /// <param name="client">The <see cref="IBaseClient"/> for handling requests.</param> |
| 26 | + /// <param name="options">Query and header option name value pairs for the request.</param> |
| 27 | + public ChatMessageReferenceRequest( |
| 28 | + string requestUrl, |
| 29 | + IBaseClient client, |
| 30 | + IEnumerable<Option> options) |
| 31 | + : base(requestUrl, client, options) |
| 32 | + { |
| 33 | + } |
| 34 | + |
| 35 | + /// <summary> |
| 36 | + /// Deletes the specified ChatMessage reference. |
| 37 | + /// </summary> |
| 38 | + /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> |
| 39 | + /// <returns>The task to await.</returns> |
| 40 | + public async System.Threading.Tasks.Task DeleteAsync(CancellationToken cancellationToken = default) |
| 41 | + { |
| 42 | + this.Method = HttpMethods.DELETE; |
| 43 | + await this.SendAsync<ChatMessage>(null, cancellationToken).ConfigureAwait(false); |
| 44 | + } |
| 45 | + |
| 46 | + /// <summary> |
| 47 | + /// Deletes the specified ChatMessage reference and returns a <see cref="GraphResponse"/> object. |
| 48 | + /// </summary> |
| 49 | + /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> |
| 50 | + /// <returns>The task of <see cref="GraphResponse"/> to await.</returns> |
| 51 | + public System.Threading.Tasks.Task<GraphResponse> DeleteResponseAsync(CancellationToken cancellationToken = default) |
| 52 | + { |
| 53 | + this.Method = HttpMethods.DELETE; |
| 54 | + return this.SendAsyncWithGraphResponse(null, cancellationToken); |
| 55 | + } |
| 56 | + |
| 57 | + /// <summary> |
| 58 | + /// Puts the specified ChatMessage reference. |
| 59 | + /// </summary> |
| 60 | + /// <param name="id">The ChatMessage reference to update.</param> |
| 61 | + /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> |
| 62 | + /// <returns>The task to await.</returns> |
| 63 | + public System.Threading.Tasks.Task PutAsync(string id, CancellationToken cancellationToken = default) |
| 64 | + { |
| 65 | + this.Method = HttpMethods.PUT; |
| 66 | + this.ContentType = CoreConstants.MimeTypeNames.Application.Json; |
| 67 | + var referenceRequestBody = new ReferenceRequestBody() |
| 68 | + { |
| 69 | + ODataId = string.Format(@"{0}/users/{1}", this.Client.BaseUrl, id) |
| 70 | + }; |
| 71 | + return this.SendAsync(referenceRequestBody, cancellationToken); |
| 72 | + } |
| 73 | + |
| 74 | + /// <summary> |
| 75 | + /// Puts the specified ChatMessage reference and returns <see cref="GraphResponse"/> object. |
| 76 | + /// </summary> |
| 77 | + /// <param name="id">The ChatMessage reference to update.</param> |
| 78 | + /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> |
| 79 | + /// <returns>The task to await of <see cref="GraphResponse"/>.</returns> |
| 80 | + public System.Threading.Tasks.Task<GraphResponse> PutResponseAsync(string id, CancellationToken cancellationToken = default) |
| 81 | + { |
| 82 | + this.Method = HttpMethods.PUT; |
| 83 | + this.ContentType = CoreConstants.MimeTypeNames.Application.Json; |
| 84 | + var referenceRequestBody = new ReferenceRequestBody() |
| 85 | + { |
| 86 | + ODataId = string.Format(@"{0}/users/{1}", this.Client.BaseUrl, id) |
| 87 | + }; |
| 88 | + return this.SendAsyncWithGraphResponse(referenceRequestBody, cancellationToken); |
| 89 | + } |
| 90 | + } |
| 91 | +} |
0 commit comments