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

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

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
コード例 #5
0
        /// <summary>
        /// Issues the PATCH request.
        /// </summary>
        /// <param name="skypeforbusinessdeviceusagedistributionusercounts">The SkypeForBusinessDeviceUsageDistributionUserCounts object set with the properties to update.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The task to await for async call.</returns>
        public async System.Threading.Tasks.Task <IReportRootGetSkypeForBusinessDeviceUsageDistributionUserCountsCollectionPage> PatchAsync(SkypeForBusinessDeviceUsageDistributionUserCounts skypeforbusinessdeviceusagedistributionusercounts,
                                                                                                                                            CancellationToken cancellationToken)
        {
            this.Method = "PATCH";
            var response = await this.SendAsync <ReportRootGetSkypeForBusinessDeviceUsageDistributionUserCountsCollectionResponse>(skypeforbusinessdeviceusagedistributionusercounts, cancellationToken).ConfigureAwait(false);

            if (response != null && response.Value != null && response.Value.CurrentPage != null)
            {
                if (response.AdditionalData != null)
                {
                    response.Value.AdditionalData = response.AdditionalData;

                    object nextPageLink;
                    response.AdditionalData.TryGetValue("@odata.nextLink", out nextPageLink);

                    var nextPageLinkString = nextPageLink as string;

                    if (!string.IsNullOrEmpty(nextPageLinkString))
                    {
                        response.Value.InitializeNextPageRequest(
                            this.Client,
                            nextPageLinkString);
                    }
                }

                return(response.Value);
            }

            return(null);
        }
コード例 #6
0
 /// <summary>
 /// Issues the PATCH request.
 /// </summary>
 /// <param name="skypeforbusinessdeviceusagedistributionusercounts">The SkypeForBusinessDeviceUsageDistributionUserCounts object set with the properties to update.</param>
 /// <returns>The task to await for async call.</returns>
 public System.Threading.Tasks.Task <IReportRootGetSkypeForBusinessDeviceUsageDistributionUserCountsCollectionPage> PatchAsync(SkypeForBusinessDeviceUsageDistributionUserCounts skypeforbusinessdeviceusagedistributionusercounts)
 {
     return(this.PatchAsync(skypeforbusinessdeviceusagedistributionusercounts, CancellationToken.None));
 }