/// <summary> /// Updates the specified WorkbookTableColumn using PATCH. /// </summary> /// <param name="workbookTableColumnToUpdate">The WorkbookTableColumn 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 WorkbookTableColumn.</returns> public async System.Threading.Tasks.Task <WorkbookTableColumn> UpdateAsync(WorkbookTableColumn workbookTableColumnToUpdate, CancellationToken cancellationToken) { if (workbookTableColumnToUpdate.AdditionalData != null) { if (workbookTableColumnToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) || workbookTableColumnToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode)) { throw new ClientException( new Error { Code = GeneratedErrorConstants.Codes.NotAllowed, Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, workbookTableColumnToUpdate.GetType().Name) }); } } if (workbookTableColumnToUpdate.AdditionalData != null) { if (workbookTableColumnToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) || workbookTableColumnToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode)) { throw new ClientException( new Error { Code = GeneratedErrorConstants.Codes.NotAllowed, Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, workbookTableColumnToUpdate.GetType().Name) }); } } this.ContentType = "application/json"; this.Method = "PATCH"; var updatedEntity = await this.SendAsync <WorkbookTableColumn>(workbookTableColumnToUpdate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(updatedEntity); return(updatedEntity); }
/// <summary> /// Creates the specified WorkbookTableColumn using POST. /// </summary> /// <param name="workbookTableColumnToCreate">The WorkbookTableColumn to create.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created WorkbookTableColumn.</returns> public async System.Threading.Tasks.Task <WorkbookTableColumn> CreateAsync(WorkbookTableColumn workbookTableColumnToCreate, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; var newEntity = await this.SendAsync <WorkbookTableColumn>(workbookTableColumnToCreate, cancellationToken).ConfigureAwait(false); this.InitializeCollectionProperties(newEntity); return(newEntity); }
/// <summary> /// Creates the specified WorkbookTableColumn using POST. /// </summary> /// <param name="workbookTableColumnToCreate">The WorkbookTableColumn to create.</param> /// <returns>The created WorkbookTableColumn.</returns> public System.Threading.Tasks.Task <WorkbookTableColumn> CreateAsync(WorkbookTableColumn workbookTableColumnToCreate) { return(this.CreateAsync(workbookTableColumnToCreate, CancellationToken.None)); }
/// <summary> /// Initializes any collection properties after deserialization, like next requests for paging. /// </summary> /// <param name="workbookTableColumnToInitialize">The <see cref="WorkbookTableColumn"/> with the collection properties to initialize.</param> private void InitializeCollectionProperties(WorkbookTableColumn workbookTableColumnToInitialize) { }
/// <summary> /// Adds the specified WorkbookTableColumn to the collection via POST. /// </summary> /// <param name="workbookTableColumn">The WorkbookTableColumn to add.</param> /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param> /// <returns>The created WorkbookTableColumn.</returns> public System.Threading.Tasks.Task <WorkbookTableColumn> AddAsync(WorkbookTableColumn workbookTableColumn, CancellationToken cancellationToken) { this.ContentType = "application/json"; this.Method = "POST"; return(this.SendAsync <WorkbookTableColumn>(workbookTableColumn, cancellationToken)); }
/// <summary> /// Adds the specified WorkbookTableColumn to the collection via POST. /// </summary> /// <param name="workbookTableColumn">The WorkbookTableColumn to add.</param> /// <returns>The created WorkbookTableColumn.</returns> public System.Threading.Tasks.Task <WorkbookTableColumn> AddAsync(WorkbookTableColumn workbookTableColumn) { return(this.AddAsync(workbookTableColumn, CancellationToken.None)); }
/// <summary> /// Issues the PUT request. /// </summary> /// <param name=workbooktablecolumn>The WorkbookTableColumn object to update.</param> /// <param name=""cancellationToken"">The <see cref=""CancellationToken""/> for the request.</param> /// <returns>The task to await for async call.</returns> public System.Threading.Tasks.Task <WorkbookTableColumn> PutAsync(WorkbookTableColumn workbooktablecolumn, CancellationToken cancellationToken) { this.Method = "PUT"; return(this.SendAsync <WorkbookTableColumn>(workbooktablecolumn, cancellationToken)); }