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

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

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