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

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

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
Exemple #5
0
        /// <summary>
        /// Issues the PATCH request.
        /// </summary>
        /// <param name="skypeforbusinessparticipantactivityusercounts">The SkypeForBusinessParticipantActivityUserCounts 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 <IReportRootGetSkypeForBusinessParticipantActivityUserCountsCollectionPage> PatchAsync(SkypeForBusinessParticipantActivityUserCounts skypeforbusinessparticipantactivityusercounts,
                                                                                                                                        CancellationToken cancellationToken)
        {
            this.Method = "PATCH";
            var response = await this.SendAsync <ReportRootGetSkypeForBusinessParticipantActivityUserCountsCollectionResponse>(skypeforbusinessparticipantactivityusercounts, 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);
        }
Exemple #6
0
 /// <summary>
 /// Issues the PATCH request.
 /// </summary>
 /// <param name="skypeforbusinessparticipantactivityusercounts">The SkypeForBusinessParticipantActivityUserCounts object set with the properties to update.</param>
 /// <returns>The task to await for async call.</returns>
 public System.Threading.Tasks.Task <IReportRootGetSkypeForBusinessParticipantActivityUserCountsCollectionPage> PatchAsync(SkypeForBusinessParticipantActivityUserCounts skypeforbusinessparticipantactivityusercounts)
 {
     return(this.PatchAsync(skypeforbusinessparticipantactivityusercounts, CancellationToken.None));
 }