=begin
#Marketing Emails

#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

The version of the OpenAPI document: v3

Generated by: https://openapi-generator.tech
OpenAPI Generator version: 6.2.1

=end

require 'date'
require 'time'

module Hubspot
  module Marketing
    module Emails
      class PublicEmailStyleSettings
        attr_accessor :email_body_padding

        attr_accessor :color_picker_favorite5

        attr_accessor :body_color

        attr_accessor :color_picker_favorite6

        attr_accessor :background_image

        attr_accessor :email_body_width

        attr_accessor :secondary_font

        attr_accessor :primary_accent_color

        attr_accessor :color_picker_favorite3

        attr_accessor :primary_font_line_height

        attr_accessor :color_picker_favorite4

        attr_accessor :secondary_font_color

        attr_accessor :color_picker_favorite1

        attr_accessor :color_picker_favorite2

        attr_accessor :body_border_color

        attr_accessor :body_border_width

        attr_accessor :links_font

        attr_accessor :background_color

        attr_accessor :background_image_type

        attr_accessor :divider_style_settings

        attr_accessor :secondary_accent_color

        attr_accessor :secondary_font_line_height

        attr_accessor :primary_font_size

        attr_accessor :secondary_font_size

        attr_accessor :primary_font_color

        attr_accessor :heading_one_font

        attr_accessor :primary_font

        attr_accessor :heading_two_font

        attr_accessor :button_style_settings

        attr_accessor :body_border_color_choice

        # Attribute mapping from ruby-style variable name to JSON key.
        def self.attribute_map
          {
            :'email_body_padding' => :'emailBodyPadding',
            :'color_picker_favorite5' => :'colorPickerFavorite5',
            :'body_color' => :'bodyColor',
            :'color_picker_favorite6' => :'colorPickerFavorite6',
            :'background_image' => :'backgroundImage',
            :'email_body_width' => :'emailBodyWidth',
            :'secondary_font' => :'secondaryFont',
            :'primary_accent_color' => :'primaryAccentColor',
            :'color_picker_favorite3' => :'colorPickerFavorite3',
            :'primary_font_line_height' => :'primaryFontLineHeight',
            :'color_picker_favorite4' => :'colorPickerFavorite4',
            :'secondary_font_color' => :'secondaryFontColor',
            :'color_picker_favorite1' => :'colorPickerFavorite1',
            :'color_picker_favorite2' => :'colorPickerFavorite2',
            :'body_border_color' => :'bodyBorderColor',
            :'body_border_width' => :'bodyBorderWidth',
            :'links_font' => :'linksFont',
            :'background_color' => :'backgroundColor',
            :'background_image_type' => :'backgroundImageType',
            :'divider_style_settings' => :'dividerStyleSettings',
            :'secondary_accent_color' => :'secondaryAccentColor',
            :'secondary_font_line_height' => :'secondaryFontLineHeight',
            :'primary_font_size' => :'primaryFontSize',
            :'secondary_font_size' => :'secondaryFontSize',
            :'primary_font_color' => :'primaryFontColor',
            :'heading_one_font' => :'headingOneFont',
            :'primary_font' => :'primaryFont',
            :'heading_two_font' => :'headingTwoFont',
            :'button_style_settings' => :'buttonStyleSettings',
            :'body_border_color_choice' => :'bodyBorderColorChoice'
          }
        end

        # Returns all the JSON keys this model knows about
        def self.acceptable_attributes
          attribute_map.values
        end

        # Attribute type mapping.
        def self.openapi_types
          {
            :'email_body_padding' => :'String',
            :'color_picker_favorite5' => :'String',
            :'body_color' => :'String',
            :'color_picker_favorite6' => :'String',
            :'background_image' => :'String',
            :'email_body_width' => :'String',
            :'secondary_font' => :'String',
            :'primary_accent_color' => :'String',
            :'color_picker_favorite3' => :'String',
            :'primary_font_line_height' => :'String',
            :'color_picker_favorite4' => :'String',
            :'secondary_font_color' => :'String',
            :'color_picker_favorite1' => :'String',
            :'color_picker_favorite2' => :'String',
            :'body_border_color' => :'String',
            :'body_border_width' => :'Integer',
            :'links_font' => :'PublicFontStyle',
            :'background_color' => :'String',
            :'background_image_type' => :'String',
            :'divider_style_settings' => :'PublicDividerStyleSettings',
            :'secondary_accent_color' => :'String',
            :'secondary_font_line_height' => :'String',
            :'primary_font_size' => :'Integer',
            :'secondary_font_size' => :'Integer',
            :'primary_font_color' => :'String',
            :'heading_one_font' => :'PublicFontStyle',
            :'primary_font' => :'String',
            :'heading_two_font' => :'PublicFontStyle',
            :'button_style_settings' => :'PublicButtonStyleSettings',
            :'body_border_color_choice' => :'String'
          }
        end

        # List of attributes with nullable: true
        def self.openapi_nullable
          Set.new([
          ])
        end

        # Initializes the object
        # @param [Hash] attributes Model attributes in the form of hash
        def initialize(attributes = {})
          if (!attributes.is_a?(Hash))
            fail ArgumentError, "The input argument (attributes) must be a hash in `Hubspot::Marketing::Emails::PublicEmailStyleSettings` initialize method"
          end

          # check to see if the attribute exists and convert string to symbol for hash key
          attributes = attributes.each_with_object({}) { |(k, v), h|
            if (!self.class.attribute_map.key?(k.to_sym))
              fail ArgumentError, "`#{k}` is not a valid attribute in `Hubspot::Marketing::Emails::PublicEmailStyleSettings`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
            end
            h[k.to_sym] = v
          }

          if attributes.key?(:'email_body_padding')
            self.email_body_padding = attributes[:'email_body_padding']
          end

          if attributes.key?(:'color_picker_favorite5')
            self.color_picker_favorite5 = attributes[:'color_picker_favorite5']
          end

          if attributes.key?(:'body_color')
            self.body_color = attributes[:'body_color']
          end

          if attributes.key?(:'color_picker_favorite6')
            self.color_picker_favorite6 = attributes[:'color_picker_favorite6']
          end

          if attributes.key?(:'background_image')
            self.background_image = attributes[:'background_image']
          end

          if attributes.key?(:'email_body_width')
            self.email_body_width = attributes[:'email_body_width']
          end

          if attributes.key?(:'secondary_font')
            self.secondary_font = attributes[:'secondary_font']
          end

          if attributes.key?(:'primary_accent_color')
            self.primary_accent_color = attributes[:'primary_accent_color']
          end

          if attributes.key?(:'color_picker_favorite3')
            self.color_picker_favorite3 = attributes[:'color_picker_favorite3']
          end

          if attributes.key?(:'primary_font_line_height')
            self.primary_font_line_height = attributes[:'primary_font_line_height']
          end

          if attributes.key?(:'color_picker_favorite4')
            self.color_picker_favorite4 = attributes[:'color_picker_favorite4']
          end

          if attributes.key?(:'secondary_font_color')
            self.secondary_font_color = attributes[:'secondary_font_color']
          end

          if attributes.key?(:'color_picker_favorite1')
            self.color_picker_favorite1 = attributes[:'color_picker_favorite1']
          end

          if attributes.key?(:'color_picker_favorite2')
            self.color_picker_favorite2 = attributes[:'color_picker_favorite2']
          end

          if attributes.key?(:'body_border_color')
            self.body_border_color = attributes[:'body_border_color']
          end

          if attributes.key?(:'body_border_width')
            self.body_border_width = attributes[:'body_border_width']
          end

          if attributes.key?(:'links_font')
            self.links_font = attributes[:'links_font']
          end

          if attributes.key?(:'background_color')
            self.background_color = attributes[:'background_color']
          end

          if attributes.key?(:'background_image_type')
            self.background_image_type = attributes[:'background_image_type']
          end

          if attributes.key?(:'divider_style_settings')
            self.divider_style_settings = attributes[:'divider_style_settings']
          end

          if attributes.key?(:'secondary_accent_color')
            self.secondary_accent_color = attributes[:'secondary_accent_color']
          end

          if attributes.key?(:'secondary_font_line_height')
            self.secondary_font_line_height = attributes[:'secondary_font_line_height']
          end

          if attributes.key?(:'primary_font_size')
            self.primary_font_size = attributes[:'primary_font_size']
          end

          if attributes.key?(:'secondary_font_size')
            self.secondary_font_size = attributes[:'secondary_font_size']
          end

          if attributes.key?(:'primary_font_color')
            self.primary_font_color = attributes[:'primary_font_color']
          end

          if attributes.key?(:'heading_one_font')
            self.heading_one_font = attributes[:'heading_one_font']
          end

          if attributes.key?(:'primary_font')
            self.primary_font = attributes[:'primary_font']
          end

          if attributes.key?(:'heading_two_font')
            self.heading_two_font = attributes[:'heading_two_font']
          end

          if attributes.key?(:'button_style_settings')
            self.button_style_settings = attributes[:'button_style_settings']
          end

          if attributes.key?(:'body_border_color_choice')
            self.body_border_color_choice = attributes[:'body_border_color_choice']
          end
        end

        # Show invalid properties with the reasons. Usually used together with valid?
        # @return Array for valid properties with the reasons
        def list_invalid_properties
          invalid_properties = Array.new
          invalid_properties
        end

        # Check to see if the all the properties in the model are valid
        # @return true if the model is valid
        def valid?
          true
        end

        # Checks equality by comparing each attribute.
        # @param [Object] Object to be compared
        def ==(o)
          return true if self.equal?(o)
          self.class == o.class &&
              email_body_padding == o.email_body_padding &&
              color_picker_favorite5 == o.color_picker_favorite5 &&
              body_color == o.body_color &&
              color_picker_favorite6 == o.color_picker_favorite6 &&
              background_image == o.background_image &&
              email_body_width == o.email_body_width &&
              secondary_font == o.secondary_font &&
              primary_accent_color == o.primary_accent_color &&
              color_picker_favorite3 == o.color_picker_favorite3 &&
              primary_font_line_height == o.primary_font_line_height &&
              color_picker_favorite4 == o.color_picker_favorite4 &&
              secondary_font_color == o.secondary_font_color &&
              color_picker_favorite1 == o.color_picker_favorite1 &&
              color_picker_favorite2 == o.color_picker_favorite2 &&
              body_border_color == o.body_border_color &&
              body_border_width == o.body_border_width &&
              links_font == o.links_font &&
              background_color == o.background_color &&
              background_image_type == o.background_image_type &&
              divider_style_settings == o.divider_style_settings &&
              secondary_accent_color == o.secondary_accent_color &&
              secondary_font_line_height == o.secondary_font_line_height &&
              primary_font_size == o.primary_font_size &&
              secondary_font_size == o.secondary_font_size &&
              primary_font_color == o.primary_font_color &&
              heading_one_font == o.heading_one_font &&
              primary_font == o.primary_font &&
              heading_two_font == o.heading_two_font &&
              button_style_settings == o.button_style_settings &&
              body_border_color_choice == o.body_border_color_choice
        end

        # @see the `==` method
        # @param [Object] Object to be compared
        def eql?(o)
          self == o
        end

        # Calculates hash code according to all attributes.
        # @return [Integer] Hash code
        def hash
          [email_body_padding, color_picker_favorite5, body_color, color_picker_favorite6, background_image, email_body_width, secondary_font, primary_accent_color, color_picker_favorite3, primary_font_line_height, color_picker_favorite4, secondary_font_color, color_picker_favorite1, color_picker_favorite2, body_border_color, body_border_width, links_font, background_color, background_image_type, divider_style_settings, secondary_accent_color, secondary_font_line_height, primary_font_size, secondary_font_size, primary_font_color, heading_one_font, primary_font, heading_two_font, button_style_settings, body_border_color_choice].hash
        end

        # Builds the object from hash
        # @param [Hash] attributes Model attributes in the form of hash
        # @return [Object] Returns the model itself
        def self.build_from_hash(attributes)
          new.build_from_hash(attributes)
        end

        # Builds the object from hash
        # @param [Hash] attributes Model attributes in the form of hash
        # @return [Object] Returns the model itself
        def build_from_hash(attributes)
          return nil unless attributes.is_a?(Hash)
          attributes = attributes.transform_keys(&:to_sym)
          self.class.openapi_types.each_pair do |key, type|
            if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
              self.send("#{key}=", nil)
            elsif type =~ /\AArray<(.*)>/i
              # check to ensure the input is an array given that the attribute
              # is documented as an array but the input is not
              if attributes[self.class.attribute_map[key]].is_a?(Array)
                self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
              end
            elsif !attributes[self.class.attribute_map[key]].nil?
              self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
            end
          end

          self
        end

        # Deserializes the data based on type
        # @param string type Data type
        # @param string value Value to be deserialized
        # @return [Object] Deserialized data
        def _deserialize(type, value)
          case type.to_sym
          when :Time
            Time.parse(value)
          when :Date
            Date.parse(value)
          when :String
            value.to_s
          when :Integer
            value.to_i
          when :Float
            value.to_f
          when :Boolean
            if value.to_s =~ /\A(true|t|yes|y|1)\z/i
              true
            else
              false
            end
          when :Object
            # generic object (usually a Hash), return directly
            value
          when /\AArray<(?<inner_type>.+)>\z/
            inner_type = Regexp.last_match[:inner_type]
            value.map { |v| _deserialize(inner_type, v) }
          when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
            k_type = Regexp.last_match[:k_type]
            v_type = Regexp.last_match[:v_type]
            {}.tap do |hash|
              value.each do |k, v|
                hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
              end
            end
          else # model
            # models (e.g. Pet) or oneOf
            klass = Hubspot::Marketing::Emails.const_get(type)
            klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
          end
        end

        # Returns the string representation of the object
        # @return [String] String presentation of the object
        def to_s
          to_hash.to_s
        end

        # to_body is an alias to to_hash (backward compatibility)
        # @return [Hash] Returns the object in the form of hash
        def to_body
          to_hash
        end

        # Returns the object in the form of hash
        # @return [Hash] Returns the object in the form of hash
        def to_hash
          hash = {}
          self.class.attribute_map.each_pair do |attr, param|
            value = self.send(attr)
            if value.nil?
              is_nullable = self.class.openapi_nullable.include?(attr)
              next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
            end

            hash[param] = _to_hash(value)
          end
          hash
        end

        # Outputs non-array value in the form of hash
        # For object, use to_hash. Otherwise, just return the value
        # @param [Object] value Any valid value
        # @return [Hash] Returns the value in the form of hash
        def _to_hash(value)
          if value.is_a?(Array)
            value.compact.map { |v| _to_hash(v) }
          elsif value.is_a?(Hash)
            {}.tap do |hash|
              value.each { |k, v| hash[k] = _to_hash(v) }
            end
          elsif value.respond_to? :to_hash
            value.to_hash
          else
            value
          end
        end

      end

    end
  end
end
