class FtcEventsClient::AllianceScore2020
Attributes
Public Class Methods
Returns all the JSON keys this model knows about
# File lib/ftc_events_client/models/alliance_score2020.rb, line 130 def self.acceptable_attributes attribute_map.values end
Attribute mapping from ruby-style variable name to JSON key.
# File lib/ftc_events_client/models/alliance_score2020.rb, line 89 def self.attribute_map { :'adjust' => :'adjust', :'dc_points' => :'dcPoints', :'auto_points' => :'autoPoints', :'dc_tower_low' => :'dcTowerLow', :'dc_tower_mid' => :'dcTowerMid', :'dc_tower_high' => :'dcTowerHigh', :'navigated1' => :'navigated1', :'navigated2' => :'navigated2', :'wobble_delivered1' => :'wobbleDelivered1', :'wobble_delivered2' => :'wobbleDelivered2', :'auto_tower_low' => :'autoTowerLow', :'auto_tower_mid' => :'autoTowerMid', :'auto_tower_high' => :'autoTowerHigh', :'auto_tower_points' => :'autoTowerPoints', :'auto_power_shot_left' => :'autoPowerShotLeft', :'auto_power_shot_center' => :'autoPowerShotCenter', :'auto_power_shot_right' => :'autoPowerShotRight', :'auto_power_shot_points' => :'autoPowerShotPoints', :'wobble_rings1' => :'wobbleRings1', :'wobble_rings2' => :'wobbleRings2', :'wobble_end1' => :'wobbleEnd1', :'wobble_end2' => :'wobbleEnd2', :'wobble_end_points' => :'wobbleEndPoints', :'wobble_ring_points' => :'wobbleRingPoints', :'auto_wobble_points' => :'autoWobblePoints', :'end_power_shot_left' => :'endPowerShotLeft', :'end_power_shot_center' => :'endPowerShotCenter', :'end_power_shot_right' => :'endPowerShotRight', :'end_power_shot_points' => :'endPowerShotPoints', :'penalty_points' => :'penaltyPoints', :'major_penalties' => :'majorPenalties', :'minor_penalties' => :'minorPenalties', :'navigation_points' => :'navigationPoints', :'endgame_points' => :'endgamePoints', :'total_points' => :'totalPoints' } end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/ftc_events_client/models/alliance_score2020.rb, line 407 def self.build_from_hash(attributes) new.build_from_hash(attributes) end
Initializes the object @param [Hash] attributes Model attributes in the form of hash
# File lib/ftc_events_client/models/alliance_score2020.rb, line 183 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `FtcEventsClient::AllianceScore2020` 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 `FtcEventsClient::AllianceScore2020`. 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?(:'adjust') self.adjust = attributes[:'adjust'] end if attributes.key?(:'dc_points') self.dc_points = attributes[:'dc_points'] end if attributes.key?(:'auto_points') self.auto_points = attributes[:'auto_points'] end if attributes.key?(:'dc_tower_low') self.dc_tower_low = attributes[:'dc_tower_low'] end if attributes.key?(:'dc_tower_mid') self.dc_tower_mid = attributes[:'dc_tower_mid'] end if attributes.key?(:'dc_tower_high') self.dc_tower_high = attributes[:'dc_tower_high'] end if attributes.key?(:'navigated1') self.navigated1 = attributes[:'navigated1'] end if attributes.key?(:'navigated2') self.navigated2 = attributes[:'navigated2'] end if attributes.key?(:'wobble_delivered1') self.wobble_delivered1 = attributes[:'wobble_delivered1'] end if attributes.key?(:'wobble_delivered2') self.wobble_delivered2 = attributes[:'wobble_delivered2'] end if attributes.key?(:'auto_tower_low') self.auto_tower_low = attributes[:'auto_tower_low'] end if attributes.key?(:'auto_tower_mid') self.auto_tower_mid = attributes[:'auto_tower_mid'] end if attributes.key?(:'auto_tower_high') self.auto_tower_high = attributes[:'auto_tower_high'] end if attributes.key?(:'auto_tower_points') self.auto_tower_points = attributes[:'auto_tower_points'] end if attributes.key?(:'auto_power_shot_left') self.auto_power_shot_left = attributes[:'auto_power_shot_left'] end if attributes.key?(:'auto_power_shot_center') self.auto_power_shot_center = attributes[:'auto_power_shot_center'] end if attributes.key?(:'auto_power_shot_right') self.auto_power_shot_right = attributes[:'auto_power_shot_right'] end if attributes.key?(:'auto_power_shot_points') self.auto_power_shot_points = attributes[:'auto_power_shot_points'] end if attributes.key?(:'wobble_rings1') self.wobble_rings1 = attributes[:'wobble_rings1'] end if attributes.key?(:'wobble_rings2') self.wobble_rings2 = attributes[:'wobble_rings2'] end if attributes.key?(:'wobble_end1') self.wobble_end1 = attributes[:'wobble_end1'] end if attributes.key?(:'wobble_end2') self.wobble_end2 = attributes[:'wobble_end2'] end if attributes.key?(:'wobble_end_points') self.wobble_end_points = attributes[:'wobble_end_points'] end if attributes.key?(:'wobble_ring_points') self.wobble_ring_points = attributes[:'wobble_ring_points'] end if attributes.key?(:'auto_wobble_points') self.auto_wobble_points = attributes[:'auto_wobble_points'] end if attributes.key?(:'end_power_shot_left') self.end_power_shot_left = attributes[:'end_power_shot_left'] end if attributes.key?(:'end_power_shot_center') self.end_power_shot_center = attributes[:'end_power_shot_center'] end if attributes.key?(:'end_power_shot_right') self.end_power_shot_right = attributes[:'end_power_shot_right'] end if attributes.key?(:'end_power_shot_points') self.end_power_shot_points = attributes[:'end_power_shot_points'] end if attributes.key?(:'penalty_points') self.penalty_points = attributes[:'penalty_points'] end if attributes.key?(:'major_penalties') self.major_penalties = attributes[:'major_penalties'] end if attributes.key?(:'minor_penalties') self.minor_penalties = attributes[:'minor_penalties'] end if attributes.key?(:'navigation_points') self.navigation_points = attributes[:'navigation_points'] end if attributes.key?(:'endgame_points') self.endgame_points = attributes[:'endgame_points'] end if attributes.key?(:'total_points') self.total_points = attributes[:'total_points'] end end
List of attributes with nullable: true
# File lib/ftc_events_client/models/alliance_score2020.rb, line 176 def self.openapi_nullable Set.new([ ]) end
Attribute type mapping.
# File lib/ftc_events_client/models/alliance_score2020.rb, line 135 def self.openapi_types { :'adjust' => :'Integer', :'dc_points' => :'Integer', :'auto_points' => :'Integer', :'dc_tower_low' => :'Integer', :'dc_tower_mid' => :'Integer', :'dc_tower_high' => :'Integer', :'navigated1' => :'Boolean', :'navigated2' => :'Boolean', :'wobble_delivered1' => :'Boolean', :'wobble_delivered2' => :'Boolean', :'auto_tower_low' => :'Integer', :'auto_tower_mid' => :'Integer', :'auto_tower_high' => :'Integer', :'auto_tower_points' => :'Integer', :'auto_power_shot_left' => :'Boolean', :'auto_power_shot_center' => :'Boolean', :'auto_power_shot_right' => :'Boolean', :'auto_power_shot_points' => :'Integer', :'wobble_rings1' => :'Integer', :'wobble_rings2' => :'Integer', :'wobble_end1' => :'Integer', :'wobble_end2' => :'Integer', :'wobble_end_points' => :'Integer', :'wobble_ring_points' => :'Integer', :'auto_wobble_points' => :'Integer', :'end_power_shot_left' => :'Boolean', :'end_power_shot_center' => :'Boolean', :'end_power_shot_right' => :'Boolean', :'end_power_shot_points' => :'Integer', :'penalty_points' => :'Integer', :'major_penalties' => :'Integer', :'minor_penalties' => :'Integer', :'navigation_points' => :'Integer', :'endgame_points' => :'Integer', :'total_points' => :'Integer' } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] Object to be compared
# File lib/ftc_events_client/models/alliance_score2020.rb, line 352 def ==(o) return true if self.equal?(o) self.class == o.class && adjust == o.adjust && dc_points == o.dc_points && auto_points == o.auto_points && dc_tower_low == o.dc_tower_low && dc_tower_mid == o.dc_tower_mid && dc_tower_high == o.dc_tower_high && navigated1 == o.navigated1 && navigated2 == o.navigated2 && wobble_delivered1 == o.wobble_delivered1 && wobble_delivered2 == o.wobble_delivered2 && auto_tower_low == o.auto_tower_low && auto_tower_mid == o.auto_tower_mid && auto_tower_high == o.auto_tower_high && auto_tower_points == o.auto_tower_points && auto_power_shot_left == o.auto_power_shot_left && auto_power_shot_center == o.auto_power_shot_center && auto_power_shot_right == o.auto_power_shot_right && auto_power_shot_points == o.auto_power_shot_points && wobble_rings1 == o.wobble_rings1 && wobble_rings2 == o.wobble_rings2 && wobble_end1 == o.wobble_end1 && wobble_end2 == o.wobble_end2 && wobble_end_points == o.wobble_end_points && wobble_ring_points == o.wobble_ring_points && auto_wobble_points == o.auto_wobble_points && end_power_shot_left == o.end_power_shot_left && end_power_shot_center == o.end_power_shot_center && end_power_shot_right == o.end_power_shot_right && end_power_shot_points == o.end_power_shot_points && penalty_points == o.penalty_points && major_penalties == o.major_penalties && minor_penalties == o.minor_penalties && navigation_points == o.navigation_points && endgame_points == o.endgame_points && total_points == o.total_points end
Deserializes the data based on type @param string type Data type @param string value Value to be deserialized @return [Object] Deserialized data
# File lib/ftc_events_client/models/alliance_score2020.rb, line 437 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 = FtcEventsClient.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end 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
# File lib/ftc_events_client/models/alliance_score2020.rb, line 508 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
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/ftc_events_client/models/alliance_score2020.rb, line 414 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) 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
@see the `==` method @param [Object] Object to be compared
# File lib/ftc_events_client/models/alliance_score2020.rb, line 394 def eql?(o) self == o end
Calculates hash code according to all attributes. @return [Integer] Hash code
# File lib/ftc_events_client/models/alliance_score2020.rb, line 400 def hash [adjust, dc_points, auto_points, dc_tower_low, dc_tower_mid, dc_tower_high, navigated1, navigated2, wobble_delivered1, wobble_delivered2, auto_tower_low, auto_tower_mid, auto_tower_high, auto_tower_points, auto_power_shot_left, auto_power_shot_center, auto_power_shot_right, auto_power_shot_points, wobble_rings1, wobble_rings2, wobble_end1, wobble_end2, wobble_end_points, wobble_ring_points, auto_wobble_points, end_power_shot_left, end_power_shot_center, end_power_shot_right, end_power_shot_points, penalty_points, major_penalties, minor_penalties, navigation_points, endgame_points, total_points].hash end
Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons
# File lib/ftc_events_client/models/alliance_score2020.rb, line 339 def list_invalid_properties invalid_properties = Array.new invalid_properties end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/ftc_events_client/models/alliance_score2020.rb, line 490 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
Returns the string representation of the object @return [String] String presentation of the object
# File lib/ftc_events_client/models/alliance_score2020.rb, line 478 def to_s to_hash.to_s end
Check to see if the all the properties in the model are valid @return true if the model is valid
# File lib/ftc_events_client/models/alliance_score2020.rb, line 346 def valid? true end