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

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

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