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