/// <summary>
 /// Adds the specified UserExperienceAnalyticsNotAutopilotReadyDevice to the collection via POST.
 /// </summary>
 /// <param name="userExperienceAnalyticsNotAutopilotReadyDevice">The UserExperienceAnalyticsNotAutopilotReadyDevice to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created UserExperienceAnalyticsNotAutopilotReadyDevice.</returns>
 public System.Threading.Tasks.Task <UserExperienceAnalyticsNotAutopilotReadyDevice> AddAsync(UserExperienceAnalyticsNotAutopilotReadyDevice userExperienceAnalyticsNotAutopilotReadyDevice, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <UserExperienceAnalyticsNotAutopilotReadyDevice>(userExperienceAnalyticsNotAutopilotReadyDevice, cancellationToken));
 }
 /// <summary>
 /// Adds the specified UserExperienceAnalyticsNotAutopilotReadyDevice to the collection via POST.
 /// </summary>
 /// <param name="userExperienceAnalyticsNotAutopilotReadyDevice">The UserExperienceAnalyticsNotAutopilotReadyDevice to add.</param>
 /// <returns>The created UserExperienceAnalyticsNotAutopilotReadyDevice.</returns>
 public System.Threading.Tasks.Task <UserExperienceAnalyticsNotAutopilotReadyDevice> AddAsync(UserExperienceAnalyticsNotAutopilotReadyDevice userExperienceAnalyticsNotAutopilotReadyDevice)
 {
     return(this.AddAsync(userExperienceAnalyticsNotAutopilotReadyDevice, CancellationToken.None));
 }
示例#3
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="userExperienceAnalyticsNotAutopilotReadyDeviceToInitialize">The <see cref="UserExperienceAnalyticsNotAutopilotReadyDevice"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(UserExperienceAnalyticsNotAutopilotReadyDevice userExperienceAnalyticsNotAutopilotReadyDeviceToInitialize)
 {
 }
示例#4
0
        /// <summary>
        /// Creates the specified UserExperienceAnalyticsNotAutopilotReadyDevice using POST.
        /// </summary>
        /// <param name="userExperienceAnalyticsNotAutopilotReadyDeviceToCreate">The UserExperienceAnalyticsNotAutopilotReadyDevice to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created UserExperienceAnalyticsNotAutopilotReadyDevice.</returns>
        public async System.Threading.Tasks.Task <UserExperienceAnalyticsNotAutopilotReadyDevice> CreateAsync(UserExperienceAnalyticsNotAutopilotReadyDevice userExperienceAnalyticsNotAutopilotReadyDeviceToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <UserExperienceAnalyticsNotAutopilotReadyDevice>(userExperienceAnalyticsNotAutopilotReadyDeviceToCreate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(newEntity);
            return(newEntity);
        }
示例#5
0
        /// <summary>
        /// Updates the specified UserExperienceAnalyticsNotAutopilotReadyDevice using PATCH.
        /// </summary>
        /// <param name="userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate">The UserExperienceAnalyticsNotAutopilotReadyDevice 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 UserExperienceAnalyticsNotAutopilotReadyDevice.</returns>
        public async System.Threading.Tasks.Task <UserExperienceAnalyticsNotAutopilotReadyDevice> UpdateAsync(UserExperienceAnalyticsNotAutopilotReadyDevice userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate, CancellationToken cancellationToken)
        {
            if (userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate.AdditionalData != null)
            {
                if (userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate.GetType().Name)
                    });
                }
            }
            if (userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate.AdditionalData != null)
            {
                if (userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.ResponseHeaders) ||
                    userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate.AdditionalData.ContainsKey(Constants.HttpPropertyNames.StatusCode))
                {
                    throw new ClientException(
                              new Error
                    {
                        Code    = GeneratedErrorConstants.Codes.NotAllowed,
                        Message = String.Format(GeneratedErrorConstants.Messages.ResponseObjectUsedForUpdate, userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate.GetType().Name)
                    });
                }
            }
            this.ContentType = "application/json";
            this.Method      = "PATCH";
            var updatedEntity = await this.SendAsync <UserExperienceAnalyticsNotAutopilotReadyDevice>(userExperienceAnalyticsNotAutopilotReadyDeviceToUpdate, cancellationToken).ConfigureAwait(false);

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }