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

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