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

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

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }