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

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
Beispiel #2
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="teamsDeviceUsageDistributionUserCountsToInitialize">The <see cref="TeamsDeviceUsageDistributionUserCounts"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(TeamsDeviceUsageDistributionUserCounts teamsDeviceUsageDistributionUserCountsToInitialize)
 {
 }
Beispiel #3
0
 /// <summary>
 /// Updates the specified TeamsDeviceUsageDistributionUserCounts using PATCH.
 /// </summary>
 /// <param name="teamsDeviceUsageDistributionUserCountsToUpdate">The TeamsDeviceUsageDistributionUserCounts to update.</param>
 /// <returns>The updated TeamsDeviceUsageDistributionUserCounts.</returns>
 public System.Threading.Tasks.Task <TeamsDeviceUsageDistributionUserCounts> UpdateAsync(TeamsDeviceUsageDistributionUserCounts teamsDeviceUsageDistributionUserCountsToUpdate)
 {
     return(this.UpdateAsync(teamsDeviceUsageDistributionUserCountsToUpdate, CancellationToken.None));
 }