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