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

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

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
 /// <summary>
 /// Creates the specified PersonCertification using POST.
 /// </summary>
 /// <param name="personCertificationToCreate">The PersonCertification to create.</param>
 /// <returns>The created PersonCertification.</returns>
 public System.Threading.Tasks.Task <PersonCertification> CreateAsync(PersonCertification personCertificationToCreate)
 {
     return(this.CreateAsync(personCertificationToCreate, CancellationToken.None));
 }
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="personCertificationToInitialize">The <see cref="PersonCertification"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(PersonCertification personCertificationToInitialize)
 {
 }
 /// <summary>
 /// Adds the specified PersonCertification to the collection via POST.
 /// </summary>
 /// <param name="personCertification">The PersonCertification to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created PersonCertification.</returns>
 public System.Threading.Tasks.Task <PersonCertification> AddAsync(PersonCertification personCertification, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <PersonCertification>(personCertification, cancellationToken));
 }
 /// <summary>
 /// Adds the specified PersonCertification to the collection via POST.
 /// </summary>
 /// <param name="personCertification">The PersonCertification to add.</param>
 /// <returns>The created PersonCertification.</returns>
 public System.Threading.Tasks.Task <PersonCertification> AddAsync(PersonCertification personCertification)
 {
     return(this.AddAsync(personCertification, CancellationToken.None));
 }