/// <summary>
        /// Updates the specified WorkbookChartPoint using PATCH.
        /// </summary>
        /// <param name="workbookChartPointToUpdate">The WorkbookChartPoint 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 WorkbookChartPoint.</returns>
        public async System.Threading.Tasks.Task <WorkbookChartPoint> UpdateAsync(WorkbookChartPoint workbookChartPointToUpdate, CancellationToken cancellationToken)
        {
            if (workbookChartPointToUpdate.AdditionalData != null)
            {
                if (workbookChartPointToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    workbookChartPointToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, workbookChartPointToUpdate.GetType().Name)
                    });
                }
            }
            if (workbookChartPointToUpdate.AdditionalData != null)
            {
                if (workbookChartPointToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    workbookChartPointToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, workbookChartPointToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <WorkbookChartPoint>(workbookChartPointToUpdate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
Example #2
0
        /// <summary>
        /// Creates the specified WorkbookChartPoint using POST.
        /// </summary>
        /// <param name="workbookChartPointToCreate">The WorkbookChartPoint to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created WorkbookChartPoint.</returns>
        public async System.Threading.Tasks.Task <WorkbookChartPoint> CreateAsync(WorkbookChartPoint workbookChartPointToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <WorkbookChartPoint>(workbookChartPointToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
 /// <summary>
 /// Issues the PUT request.
 /// </summary>
 /// <param name="workbookchartpoint">The WorkbookChartPoint 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 <WorkbookChartPoint> PutAsync(WorkbookChartPoint workbookchartpoint,
                                                                  CancellationToken cancellationToken)
 {
     this.Method = "PUT";
     return(this.SendAsync <WorkbookChartPoint>(workbookchartpoint, cancellationToken));
 }
 /// <summary>
 /// Issues the PUT request.
 /// </summary>
 /// <param name="workbookchartpoint">The WorkbookChartPoint object to update.</param>
 /// <returns>The task to await for async call.</returns>
 public System.Threading.Tasks.Task <WorkbookChartPoint> PutAsync(WorkbookChartPoint workbookchartpoint)
 {
     return(this.PutAsync(workbookchartpoint, CancellationToken.None));
 }
Example #5
0
 /// <summary>
 /// Creates the specified WorkbookChartPoint using POST.
 /// </summary>
 /// <param name="workbookChartPointToCreate">The WorkbookChartPoint to create.</param>
 /// <returns>The created WorkbookChartPoint.</returns>
 public System.Threading.Tasks.Task <WorkbookChartPoint> CreateAsync(WorkbookChartPoint workbookChartPointToCreate)
 {
     return(this.CreateAsync(workbookChartPointToCreate, CancellationToken.None));
 }
Example #6
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="workbookChartPointToInitialize">The <see cref="WorkbookChartPoint"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(WorkbookChartPoint workbookChartPointToInitialize)
 {
 }
 /// <summary>
 /// Adds the specified WorkbookChartPoint to the collection via POST.
 /// </summary>
 /// <param name="workbookChartPoint">The WorkbookChartPoint to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created WorkbookChartPoint.</returns>
 public System.Threading.Tasks.Task <WorkbookChartPoint> AddAsync(WorkbookChartPoint workbookChartPoint, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <WorkbookChartPoint>(workbookChartPoint, cancellationToken));
 }