/// <summary>
 /// Adds the specified AndroidManagedStoreAppConfigurationSchema to the collection via POST.
 /// </summary>
 /// <param name="androidManagedStoreAppConfigurationSchema">The AndroidManagedStoreAppConfigurationSchema to add.</param>
 /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
 /// <returns>The created AndroidManagedStoreAppConfigurationSchema.</returns>
 public System.Threading.Tasks.Task <AndroidManagedStoreAppConfigurationSchema> AddAsync(AndroidManagedStoreAppConfigurationSchema androidManagedStoreAppConfigurationSchema, CancellationToken cancellationToken)
 {
     this.ContentType = "application/json";
     this.Method      = "POST";
     return(this.SendAsync <AndroidManagedStoreAppConfigurationSchema>(androidManagedStoreAppConfigurationSchema, cancellationToken));
 }
 /// <summary>
 /// Adds the specified AndroidManagedStoreAppConfigurationSchema to the collection via POST.
 /// </summary>
 /// <param name="androidManagedStoreAppConfigurationSchema">The AndroidManagedStoreAppConfigurationSchema to add.</param>
 /// <returns>The created AndroidManagedStoreAppConfigurationSchema.</returns>
 public System.Threading.Tasks.Task <AndroidManagedStoreAppConfigurationSchema> AddAsync(AndroidManagedStoreAppConfigurationSchema androidManagedStoreAppConfigurationSchema)
 {
     return(this.AddAsync(androidManagedStoreAppConfigurationSchema, CancellationToken.None));
 }
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="androidManagedStoreAppConfigurationSchemaToInitialize">The <see cref="AndroidManagedStoreAppConfigurationSchema"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(AndroidManagedStoreAppConfigurationSchema androidManagedStoreAppConfigurationSchemaToInitialize)
 {
 }
        /// <summary>
        /// Creates the specified AndroidManagedStoreAppConfigurationSchema using POST.
        /// </summary>
        /// <param name="androidManagedStoreAppConfigurationSchemaToCreate">The AndroidManagedStoreAppConfigurationSchema to create.</param>
        /// <param name="cancellationToken">The <see cref="CancellationToken"/> for the request.</param>
        /// <returns>The created AndroidManagedStoreAppConfigurationSchema.</returns>
        public async System.Threading.Tasks.Task <AndroidManagedStoreAppConfigurationSchema> CreateAsync(AndroidManagedStoreAppConfigurationSchema androidManagedStoreAppConfigurationSchemaToCreate, CancellationToken cancellationToken)
        {
            this.ContentType = "application/json";
            this.Method      = "POST";
            var newEntity = await this.SendAsync <AndroidManagedStoreAppConfigurationSchema>(androidManagedStoreAppConfigurationSchemaToCreate, cancellationToken).ConfigureAwait(false);

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

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