Пример #1
0
        /// <summary>
        /// Initializes any collection properties after deserialization, like next requests for paging.
        /// </summary>
        /// <param name="userExperienceAnalyticsRegressionSummaryToInitialize">The <see cref="UserExperienceAnalyticsRegressionSummary"/> with the collection properties to initialize.</param>
        private void InitializeCollectionProperties(UserExperienceAnalyticsRegressionSummary userExperienceAnalyticsRegressionSummaryToInitialize)
        {
            if (userExperienceAnalyticsRegressionSummaryToInitialize != null && userExperienceAnalyticsRegressionSummaryToInitialize.AdditionalData != null)
            {
                if (userExperienceAnalyticsRegressionSummaryToInitialize.ModelRegression != null && userExperienceAnalyticsRegressionSummaryToInitialize.ModelRegression.CurrentPage != null)
                {
                    userExperienceAnalyticsRegressionSummaryToInitialize.ModelRegression.AdditionalData = userExperienceAnalyticsRegressionSummaryToInitialize.AdditionalData;

                    object nextPageLink;
                    userExperienceAnalyticsRegressionSummaryToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink);
                    var nextPageLinkString = nextPageLink as string;

                    if (!string.IsNullOrEmpty(nextPageLinkString))
                    {
                        userExperienceAnalyticsRegressionSummaryToInitialize.ModelRegression.InitializeNextPageRequest(
                            this.Client,
                            nextPageLinkString);
                    }
                }

                if (userExperienceAnalyticsRegressionSummaryToInitialize.ManufacturerRegression != null && userExperienceAnalyticsRegressionSummaryToInitialize.ManufacturerRegression.CurrentPage != null)
                {
                    userExperienceAnalyticsRegressionSummaryToInitialize.ManufacturerRegression.AdditionalData = userExperienceAnalyticsRegressionSummaryToInitialize.AdditionalData;

                    object nextPageLink;
                    userExperienceAnalyticsRegressionSummaryToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink);
                    var nextPageLinkString = nextPageLink as string;

                    if (!string.IsNullOrEmpty(nextPageLinkString))
                    {
                        userExperienceAnalyticsRegressionSummaryToInitialize.ManufacturerRegression.InitializeNextPageRequest(
                            this.Client,
                            nextPageLinkString);
                    }
                }

                if (userExperienceAnalyticsRegressionSummaryToInitialize.OperatingSystemRegression != null && userExperienceAnalyticsRegressionSummaryToInitialize.OperatingSystemRegression.CurrentPage != null)
                {
                    userExperienceAnalyticsRegressionSummaryToInitialize.OperatingSystemRegression.AdditionalData = userExperienceAnalyticsRegressionSummaryToInitialize.AdditionalData;

                    object nextPageLink;
                    userExperienceAnalyticsRegressionSummaryToInitialize.AdditionalData.TryGetValue("*****@*****.**", out nextPageLink);
                    var nextPageLinkString = nextPageLink as string;

                    if (!string.IsNullOrEmpty(nextPageLinkString))
                    {
                        userExperienceAnalyticsRegressionSummaryToInitialize.OperatingSystemRegression.InitializeNextPageRequest(
                            this.Client,
                            nextPageLinkString);
                    }
                }
            }
        }
Пример #2
0
        /// <summary>
        /// Creates the specified UserExperienceAnalyticsRegressionSummary using POST.
        /// </summary>
        /// <param name="userExperienceAnalyticsRegressionSummaryToCreate">The UserExperienceAnalyticsRegressionSummary to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created UserExperienceAnalyticsRegressionSummary.</returns>
        public async System.Threading.Tasks.Task <UserExperienceAnalyticsRegressionSummary> CreateAsync(UserExperienceAnalyticsRegressionSummary userExperienceAnalyticsRegressionSummaryToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <UserExperienceAnalyticsRegressionSummary>(userExperienceAnalyticsRegressionSummaryToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
Пример #3
0
 /// <summary>
 /// Creates the specified UserExperienceAnalyticsRegressionSummary using POST.
 /// </summary>
 /// <param name="userExperienceAnalyticsRegressionSummaryToCreate">The UserExperienceAnalyticsRegressionSummary to create.</param>
 /// <returns>The created UserExperienceAnalyticsRegressionSummary.</returns>
 public System.Threading.Tasks.Task <UserExperienceAnalyticsRegressionSummary> CreateAsync(UserExperienceAnalyticsRegressionSummary userExperienceAnalyticsRegressionSummaryToCreate)
 {
     return(this.CreateAsync(userExperienceAnalyticsRegressionSummaryToCreate, CancellationToken.None));
 }
Пример #4
0
        /// <summary>
        /// Updates the specified UserExperienceAnalyticsRegressionSummary using PATCH.
        /// </summary>
        /// <param name="userExperienceAnalyticsRegressionSummaryToUpdate">The UserExperienceAnalyticsRegressionSummary 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 UserExperienceAnalyticsRegressionSummary.</returns>
        public async System.Threading.Tasks.Task <UserExperienceAnalyticsRegressionSummary> UpdateAsync(UserExperienceAnalyticsRegressionSummary userExperienceAnalyticsRegressionSummaryToUpdate, CancellationToken cancellationToken)
        {
            if (userExperienceAnalyticsRegressionSummaryToUpdate.AdditionalData != null)
            {
                if (userExperienceAnalyticsRegressionSummaryToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    userExperienceAnalyticsRegressionSummaryToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, userExperienceAnalyticsRegressionSummaryToUpdate.GetType().Name)
                    });
                }
            }
            if (userExperienceAnalyticsRegressionSummaryToUpdate.AdditionalData != null)
            {
                if (userExperienceAnalyticsRegressionSummaryToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    userExperienceAnalyticsRegressionSummaryToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, userExperienceAnalyticsRegressionSummaryToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <UserExperienceAnalyticsRegressionSummary>(userExperienceAnalyticsRegressionSummaryToUpdate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
 /// <summary>
 /// Issues the PUT request.
 /// </summary>
 /// <param name="userexperienceanalyticsregressionsummary">The UserExperienceAnalyticsRegressionSummary object to update.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The task to await for async call.</returns>
 public System.Threading.Tasks.Task <UserExperienceAnalyticsRegressionSummary> PutAsync(UserExperienceAnalyticsRegressionSummary userexperienceanalyticsregressionsummary,
                                                                                        CancellationToken cancellationToken)
 {
     this.Method = "PUT";
     return(this.SendAsync <UserExperienceAnalyticsRegressionSummary>(userexperienceanalyticsregressionsummary, cancellationToken));
 }
 /// <summary>
 /// Issues the PUT request.
 /// </summary>
 /// <param name="userexperienceanalyticsregressionsummary">The UserExperienceAnalyticsRegressionSummary object to update.</param>
 /// <returns>The task to await for async call.</returns>
 public System.Threading.Tasks.Task <UserExperienceAnalyticsRegressionSummary> PutAsync(UserExperienceAnalyticsRegressionSummary userexperienceanalyticsregressionsummary)
 {
     return(this.PutAsync(userexperienceanalyticsregressionsummary, CancellationToken.None));
 }