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

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

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