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

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

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