/// <summary> /// Creates the specified WorkbookChartGridlines using POST. /// </summary> /// <param name="workbookChartGridlinesToCreate">The WorkbookChartGridlines to create.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created WorkbookChartGridlines.</returns> public async System.Threading.Tasks.Task <WorkbookChartGridlines> CreateAsync(WorkbookChartGridlines workbookChartGridlinesToCreate, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; var newEntity = await this.SendAsync <WorkbookChartGridlines>(workbookChartGridlinesToCreate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(newEntity); return(newEntity); }
/// <summary> /// Initializes any collection properties after deserialization, like next requests for paging. /// </summary> /// <param name="workbookChartGridlinesToInitialize">The <see cref="WorkbookChartGridlines"/> with the collection properties to initialize.</param> private void InitializeCollectionProperties(WorkbookChartGridlines workbookChartGridlinesToInitialize) { }
/// <summary> /// Creates the specified WorkbookChartGridlines using POST. /// </summary> /// <param name="workbookChartGridlinesToCreate">The WorkbookChartGridlines to create.</param> /// <returns>The created WorkbookChartGridlines.</returns> public System.Threading.Tasks.Task <WorkbookChartGridlines> CreateAsync(WorkbookChartGridlines workbookChartGridlinesToCreate) { return(this.CreateAsync(workbookChartGridlinesToCreate, CancellationToken.None)); }
/// <summary> /// Updates the specified WorkbookChartGridlines using PATCH. /// </summary> /// <param name="workbookChartGridlinesToUpdate">The WorkbookChartGridlines to update.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <exception cref="ClientException">Thrown when an object returned in a response is used for updating an object in Microsoft Graph.</exception> /// <returns>The updated WorkbookChartGridlines.</returns> public async System.Threading.Tasks.Task <WorkbookChartGridlines> UpdateAsync(WorkbookChartGridlines workbookChartGridlinesToUpdate, CancellationToken cancellationToken) { if (workbookChartGridlinesToUpdate.AdditionalData != null) { if (workbookChartGridlinesToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) || workbookChartGridlinesToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode)) { throw new ClientException( new Error { Code = GeneratedErrorConstants.Codes.NotAllowed, Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, workbookChartGridlinesToUpdate.GetType().Name) }); } } if (workbookChartGridlinesToUpdate.AdditionalData != null) { if (workbookChartGridlinesToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) || workbookChartGridlinesToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode)) { throw new ClientException( new Error { Code = GeneratedErrorConstants.Codes.NotAllowed, Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, workbookChartGridlinesToUpdate.GetType().Name) }); } } this.ContentType = "application/json"; this.Method = "PATCH"; var updatedEntity = await this.SendAsync <WorkbookChartGridlines>(workbookChartGridlinesToUpdate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(updatedEntity); return(updatedEntity); }