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