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

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

            this.InitializeCollectionProperties(updatedEntity);
            return(updatedEntity);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="userExperienceAnalyticsDeviceStartupHistoryToInitialize">The <see cref="UserExperienceAnalyticsDeviceStartupHistory"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(UserExperienceAnalyticsDeviceStartupHistory userExperienceAnalyticsDeviceStartupHistoryToInitialize)
 {
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Adds the specified UserExperienceAnalyticsDeviceStartupHistory to the collection via POST.
 /// </summary>
 /// <param name="userExperienceAnalyticsDeviceStartupHistory">The UserExperienceAnalyticsDeviceStartupHistory to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created UserExperienceAnalyticsDeviceStartupHistory.</returns>
 public System.Threading.Tasks.Task <UserExperienceAnalyticsDeviceStartupHistory> AddAsync(UserExperienceAnalyticsDeviceStartupHistory userExperienceAnalyticsDeviceStartupHistory, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <UserExperienceAnalyticsDeviceStartupHistory>(userExperienceAnalyticsDeviceStartupHistory, cancellationToken));
 }