class FtcEventsClient::ScoreDetailModelAlliance2019
Attributes
Public Class Methods
Returns all the JSON keys this model knows about
# File lib/ftc_events_client/models/score_detail_model_alliance2019.rb, line 127 def self.acceptable_attributes attribute_map.values end
Attribute mapping from ruby-style variable name to JSON key.
# File lib/ftc_events_client/models/score_detail_model_alliance2019.rb, line 87 def self.attribute_map { :'alliance' => :'alliance', :'robot1_navigated' => :'robot1Navigated', :'robot1_parked' => :'robot1Parked', :'robot1_capstone_level' => :'robot1CapstoneLevel', :'robot2_navigated' => :'robot2Navigated', :'robot2_parked' => :'robot2Parked', :'robot2_capstone_level' => :'robot2CapstoneLevel', :'auto_stones' => :'autoStones', :'auto_delivered' => :'autoDelivered', :'auto_returned' => :'autoReturned', :'first_returned_is_skystone' => :'firstReturnedIsSkystone', :'auto_placed' => :'autoPlaced', :'foundation_repositioned' => :'foundationRepositioned', :'foundation_moved' => :'foundationMoved', :'driver_controlled_delivered' => :'driverControlledDelivered', :'driver_controlled_returned' => :'driverControlledReturned', :'driver_controlled_placed' => :'driverControlledPlaced', :'tallest_skyscraper' => :'tallestSkyscraper', :'auto_delivery_points' => :'autoDeliveryPoints', :'auto_placed_points' => :'autoPlacedPoints', :'autonomous_points' => :'autonomousPoints', :'repositioned_points' => :'repositionedPoints', :'navigation_points' => :'navigationPoints', :'driver_controlled_delivery_points' => :'driverControlledDeliveryPoints', :'driver_controlled_placed_points' => :'driverControlledPlacedPoints', :'skyscraper_bonus_points' => :'skyscraperBonusPoints', :'capstone_points' => :'capstonePoints', :'driver_controlled_points' => :'driverControlledPoints', :'parking_points' => :'parkingPoints', :'end_game_points' => :'endGamePoints', :'minor_penalties' => :'minorPenalties', :'major_penalties' => :'majorPenalties', :'penalty_points' => :'penaltyPoints', :'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/score_detail_model_alliance2019.rb, line 402 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/score_detail_model_alliance2019.rb, line 181 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `FtcEventsClient::ScoreDetailModelAlliance2019` 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::ScoreDetailModelAlliance2019`. 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?(:'alliance') self.alliance = attributes[:'alliance'] end if attributes.key?(:'robot1_navigated') self.robot1_navigated = attributes[:'robot1_navigated'] end if attributes.key?(:'robot1_parked') self.robot1_parked = attributes[:'robot1_parked'] end if attributes.key?(:'robot1_capstone_level') self.robot1_capstone_level = attributes[:'robot1_capstone_level'] end if attributes.key?(:'robot2_navigated') self.robot2_navigated = attributes[:'robot2_navigated'] end if attributes.key?(:'robot2_parked') self.robot2_parked = attributes[:'robot2_parked'] end if attributes.key?(:'robot2_capstone_level') self.robot2_capstone_level = attributes[:'robot2_capstone_level'] end if attributes.key?(:'auto_stones') if (value = attributes[:'auto_stones']).is_a?(Array) self.auto_stones = value end end if attributes.key?(:'auto_delivered') self.auto_delivered = attributes[:'auto_delivered'] end if attributes.key?(:'auto_returned') self.auto_returned = attributes[:'auto_returned'] end if attributes.key?(:'first_returned_is_skystone') self.first_returned_is_skystone = attributes[:'first_returned_is_skystone'] end if attributes.key?(:'auto_placed') self.auto_placed = attributes[:'auto_placed'] end if attributes.key?(:'foundation_repositioned') self.foundation_repositioned = attributes[:'foundation_repositioned'] end if attributes.key?(:'foundation_moved') self.foundation_moved = attributes[:'foundation_moved'] end if attributes.key?(:'driver_controlled_delivered') self.driver_controlled_delivered = attributes[:'driver_controlled_delivered'] end if attributes.key?(:'driver_controlled_returned') self.driver_controlled_returned = attributes[:'driver_controlled_returned'] end if attributes.key?(:'driver_controlled_placed') self.driver_controlled_placed = attributes[:'driver_controlled_placed'] end if attributes.key?(:'tallest_skyscraper') self.tallest_skyscraper = attributes[:'tallest_skyscraper'] end if attributes.key?(:'auto_delivery_points') self.auto_delivery_points = attributes[:'auto_delivery_points'] end if attributes.key?(:'auto_placed_points') self.auto_placed_points = attributes[:'auto_placed_points'] end if attributes.key?(:'autonomous_points') self.autonomous_points = attributes[:'autonomous_points'] end if attributes.key?(:'repositioned_points') self.repositioned_points = attributes[:'repositioned_points'] end if attributes.key?(:'navigation_points') self.navigation_points = attributes[:'navigation_points'] end if attributes.key?(:'driver_controlled_delivery_points') self.driver_controlled_delivery_points = attributes[:'driver_controlled_delivery_points'] end if attributes.key?(:'driver_controlled_placed_points') self.driver_controlled_placed_points = attributes[:'driver_controlled_placed_points'] end if attributes.key?(:'skyscraper_bonus_points') self.skyscraper_bonus_points = attributes[:'skyscraper_bonus_points'] end if attributes.key?(:'capstone_points') self.capstone_points = attributes[:'capstone_points'] end if attributes.key?(:'driver_controlled_points') self.driver_controlled_points = attributes[:'driver_controlled_points'] end if attributes.key?(:'parking_points') self.parking_points = attributes[:'parking_points'] end if attributes.key?(:'end_game_points') self.end_game_points = attributes[:'end_game_points'] end if attributes.key?(:'minor_penalties') self.minor_penalties = attributes[:'minor_penalties'] end if attributes.key?(:'major_penalties') self.major_penalties = attributes[:'major_penalties'] end if attributes.key?(:'penalty_points') self.penalty_points = attributes[:'penalty_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/score_detail_model_alliance2019.rb, line 172 def self.openapi_nullable Set.new([ :'alliance', :'auto_stones', ]) end
Attribute type mapping.
# File lib/ftc_events_client/models/score_detail_model_alliance2019.rb, line 132 def self.openapi_types { :'alliance' => :'String', :'robot1_navigated' => :'Boolean', :'robot1_parked' => :'Boolean', :'robot1_capstone_level' => :'Integer', :'robot2_navigated' => :'Boolean', :'robot2_parked' => :'Boolean', :'robot2_capstone_level' => :'Integer', :'auto_stones' => :'Array<Stone>', :'auto_delivered' => :'Integer', :'auto_returned' => :'Integer', :'first_returned_is_skystone' => :'Boolean', :'auto_placed' => :'Integer', :'foundation_repositioned' => :'Boolean', :'foundation_moved' => :'Boolean', :'driver_controlled_delivered' => :'Integer', :'driver_controlled_returned' => :'Integer', :'driver_controlled_placed' => :'Integer', :'tallest_skyscraper' => :'Integer', :'auto_delivery_points' => :'Integer', :'auto_placed_points' => :'Integer', :'autonomous_points' => :'Integer', :'repositioned_points' => :'Integer', :'navigation_points' => :'Integer', :'driver_controlled_delivery_points' => :'Integer', :'driver_controlled_placed_points' => :'Integer', :'skyscraper_bonus_points' => :'Integer', :'capstone_points' => :'Integer', :'driver_controlled_points' => :'Integer', :'parking_points' => :'Integer', :'end_game_points' => :'Integer', :'minor_penalties' => :'Integer', :'major_penalties' => :'Integer', :'penalty_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/score_detail_model_alliance2019.rb, line 348 def ==(o) return true if self.equal?(o) self.class == o.class && alliance == o.alliance && robot1_navigated == o.robot1_navigated && robot1_parked == o.robot1_parked && robot1_capstone_level == o.robot1_capstone_level && robot2_navigated == o.robot2_navigated && robot2_parked == o.robot2_parked && robot2_capstone_level == o.robot2_capstone_level && auto_stones == o.auto_stones && auto_delivered == o.auto_delivered && auto_returned == o.auto_returned && first_returned_is_skystone == o.first_returned_is_skystone && auto_placed == o.auto_placed && foundation_repositioned == o.foundation_repositioned && foundation_moved == o.foundation_moved && driver_controlled_delivered == o.driver_controlled_delivered && driver_controlled_returned == o.driver_controlled_returned && driver_controlled_placed == o.driver_controlled_placed && tallest_skyscraper == o.tallest_skyscraper && auto_delivery_points == o.auto_delivery_points && auto_placed_points == o.auto_placed_points && autonomous_points == o.autonomous_points && repositioned_points == o.repositioned_points && navigation_points == o.navigation_points && driver_controlled_delivery_points == o.driver_controlled_delivery_points && driver_controlled_placed_points == o.driver_controlled_placed_points && skyscraper_bonus_points == o.skyscraper_bonus_points && capstone_points == o.capstone_points && driver_controlled_points == o.driver_controlled_points && parking_points == o.parking_points && end_game_points == o.end_game_points && minor_penalties == o.minor_penalties && major_penalties == o.major_penalties && penalty_points == o.penalty_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/score_detail_model_alliance2019.rb, line 432 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/score_detail_model_alliance2019.rb, line 503 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/score_detail_model_alliance2019.rb, line 409 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/score_detail_model_alliance2019.rb, line 389 def eql?(o) self == o end
Calculates hash code according to all attributes. @return [Integer] Hash code
# File lib/ftc_events_client/models/score_detail_model_alliance2019.rb, line 395 def hash [alliance, robot1_navigated, robot1_parked, robot1_capstone_level, robot2_navigated, robot2_parked, robot2_capstone_level, auto_stones, auto_delivered, auto_returned, first_returned_is_skystone, auto_placed, foundation_repositioned, foundation_moved, driver_controlled_delivered, driver_controlled_returned, driver_controlled_placed, tallest_skyscraper, auto_delivery_points, auto_placed_points, autonomous_points, repositioned_points, navigation_points, driver_controlled_delivery_points, driver_controlled_placed_points, skyscraper_bonus_points, capstone_points, driver_controlled_points, parking_points, end_game_points, minor_penalties, major_penalties, penalty_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/score_detail_model_alliance2019.rb, line 335 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/score_detail_model_alliance2019.rb, line 485 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/score_detail_model_alliance2019.rb, line 473 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/score_detail_model_alliance2019.rb, line 342 def valid? true end