=begin
#Daytona Toolbox API

#Daytona Toolbox API

The version of the OpenAPI document: v0.0.0-dev

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

=end

require 'date'
require 'time'

module DaytonaToolboxApiClient
  class ChartElement < ApiModelBase
    attr_accessor :angle

    attr_accessor :first_quartile

    attr_accessor :group

    attr_accessor :label

    attr_accessor :max

    attr_accessor :median

    attr_accessor :min

    attr_accessor :outliers

    attr_accessor :png

    attr_accessor :points

    attr_accessor :radius

    attr_accessor :third_quartile

    attr_accessor :title

    attr_accessor :type

    attr_accessor :value

    attr_accessor :x_label

    attr_accessor :y_label

    # Attribute mapping from ruby-style variable name to JSON key.
    def self.attribute_map
      {
        :'angle' => :'angle',
        :'first_quartile' => :'first_quartile',
        :'group' => :'group',
        :'label' => :'label',
        :'max' => :'max',
        :'median' => :'median',
        :'min' => :'min',
        :'outliers' => :'outliers',
        :'png' => :'png',
        :'points' => :'points',
        :'radius' => :'radius',
        :'third_quartile' => :'third_quartile',
        :'title' => :'title',
        :'type' => :'type',
        :'value' => :'value',
        :'x_label' => :'x_label',
        :'y_label' => :'y_label'
      }
    end

    # Returns attribute mapping this model knows about
    def self.acceptable_attribute_map
      attribute_map
    end

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

    # Attribute type mapping.
    def self.openapi_types
      {
        :'angle' => :'Float',
        :'first_quartile' => :'Float',
        :'group' => :'String',
        :'label' => :'String',
        :'max' => :'Float',
        :'median' => :'Float',
        :'min' => :'Float',
        :'outliers' => :'Array<Float>',
        :'png' => :'String',
        :'points' => :'Array<Array<Float>>',
        :'radius' => :'Float',
        :'third_quartile' => :'Float',
        :'title' => :'String',
        :'type' => :'String',
        :'value' => :'String',
        :'x_label' => :'String',
        :'y_label' => :'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 `DaytonaToolboxApiClient::ChartElement` initialize method"
      end

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

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

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

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

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

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

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

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

      if attributes.key?(:'outliers')
        if (value = attributes[:'outliers']).is_a?(Array)
          self.outliers = value
        end
      end

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

      if attributes.key?(:'points')
        if (value = attributes[:'points']).is_a?(Array)
          self.points = value
        end
      end

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

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

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

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

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

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

      if attributes.key?(:'y_label')
        self.y_label = attributes[:'y_label']
      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
      warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
      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?
      warn '[DEPRECATED] the `valid?` method is obsolete'
      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 &&
          angle == o.angle &&
          first_quartile == o.first_quartile &&
          group == o.group &&
          label == o.label &&
          max == o.max &&
          median == o.median &&
          min == o.min &&
          outliers == o.outliers &&
          png == o.png &&
          points == o.points &&
          radius == o.radius &&
          third_quartile == o.third_quartile &&
          title == o.title &&
          type == o.type &&
          value == o.value &&
          x_label == o.x_label &&
          y_label == o.y_label
    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
      [angle, first_quartile, group, label, max, median, min, outliers, png, points, radius, third_quartile, title, type, value, x_label, y_label].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)
      return nil unless attributes.is_a?(Hash)
      attributes = attributes.transform_keys(&:to_sym)
      transformed_hash = {}
      openapi_types.each_pair do |key, type|
        if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
          transformed_hash["#{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[attribute_map[key]].is_a?(Array)
            transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
          end
        elsif !attributes[attribute_map[key]].nil?
          transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
        end
      end
      new(transformed_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

  end

end
