lib/fastly/models/pop_coordinates.rb in fastly-4.1.0 vs lib/fastly/models/pop_coordinates.rb in fastly-4.2.0

- old
+ new

@@ -10,24 +10,19 @@ require 'date' require 'time' module Fastly + # the geographic location of the POP class PopCoordinates - attr_accessor :x - - attr_accessor :y - attr_accessor :latitude attr_accessor :longitude # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { - :'x' => :'x', - :'y' => :'y', :'latitude' => :'latitude', :'longitude' => :'longitude' } end @@ -37,12 +32,10 @@ end # Attribute type mapping. def self.fastly_types { - :'x' => :'Float', - :'y' => :'Float', :'latitude' => :'Float', :'longitude' => :'Float' } end @@ -65,18 +58,10 @@ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::PopCoordinates`. 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?(:'x') - self.x = attributes[:'x'] - end - - if attributes.key?(:'y') - self.y = attributes[:'y'] - end - if attributes.key?(:'latitude') self.latitude = attributes[:'latitude'] end if attributes.key?(:'longitude') @@ -86,26 +71,34 @@ # 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 + if @latitude.nil? + invalid_properties.push('invalid value for "latitude", latitude cannot be nil.') + end + + if @longitude.nil? + invalid_properties.push('invalid value for "longitude", longitude cannot be nil.') + end + 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? + return false if @latitude.nil? + return false if @longitude.nil? 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 && - x == o.x && - y == o.y && latitude == o.latitude && longitude == o.longitude end # @see the `==` method @@ -115,10 +108,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [x, y, latitude, longitude].hash + [latitude, longitude].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself