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

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

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