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