示例#1
0
        /// <summary>
        /// Issues the PATCH request.
        /// </summary>
        /// <param name="skypeforbusinessactivityusercounts">The SkypeForBusinessActivityUserCounts 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 <IReportRootGetSkypeForBusinessActivityUserCountsCollectionPage> PatchAsync(SkypeForBusinessActivityUserCounts skypeforbusinessactivityusercounts,
                                                                                                                             CancellationToken cancellationToken)
        {
            this.Method = "PATCH";
            var response = await this.SendAsync <ReportRootGetSkypeForBusinessActivityUserCountsCollectionResponse>(skypeforbusinessactivityusercounts, 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);
        }
示例#2
0
 /// <summary>
 /// Issues the PATCH request.
 /// </summary>
 /// <param name="skypeforbusinessactivityusercounts">The SkypeForBusinessActivityUserCounts object set with the properties to update.</param>
 /// <returns>The task to await for async call.</returns>
 public System.Threading.Tasks.Task <IReportRootGetSkypeForBusinessActivityUserCountsCollectionPage> PatchAsync(SkypeForBusinessActivityUserCounts skypeforbusinessactivityusercounts)
 {
     return(this.PatchAsync(skypeforbusinessactivityusercounts, CancellationToken.None));
 }
示例#3
0
        /// <summary>
        /// Creates the specified SkypeForBusinessActivityUserCounts using POST.
        /// </summary>
        /// <param name="skypeForBusinessActivityUserCountsToCreate">The SkypeForBusinessActivityUserCounts to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created SkypeForBusinessActivityUserCounts.</returns>
        public async System.Threading.Tasks.Task <SkypeForBusinessActivityUserCounts> CreateAsync(SkypeForBusinessActivityUserCounts skypeForBusinessActivityUserCountsToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <SkypeForBusinessActivityUserCounts>(skypeForBusinessActivityUserCountsToCreate, cancellationToken).ConfigureAwait(false);

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

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