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

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

            return(newEntity);
        }
 /// <summary>
 /// Initializes any collection properties after deserialization, like next requests for paging.
 /// </summary>
 /// <param name="windowsPhone81CertificateProfileBaseToInitialize">The <see cref="WindowsPhone81CertificateProfileBase"/> with the collection properties to initialize.</param>
 private void InitializeCollectionProperties(WindowsPhone81CertificateProfileBase windowsPhone81CertificateProfileBaseToInitialize)
 {
 }