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

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

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