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

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

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