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

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

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