lib/fastly/models/resource.rb in fastly-4.1.0 vs lib/fastly/models/resource.rb in fastly-4.2.0
- old
+ new
@@ -11,16 +11,20 @@
require 'date'
require 'time'
module Fastly
class Resource
- # The name of the resource.
+ # The ID of the underlying linked resource.
+ attr_accessor :resource_id
+
+ # The name of the resource link.
attr_accessor :name
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
+ :'resource_id' => :'resource_id',
:'name' => :'name'
}
end
# Returns all the JSON keys this model knows about
@@ -29,10 +33,11 @@
end
# Attribute type mapping.
def self.fastly_types
{
+ :'resource_id' => :'String',
:'name' => :'String'
}
end
# List of attributes with nullable: true
@@ -54,10 +59,14 @@
fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::Resource`. 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?(:'resource_id')
+ self.resource_id = attributes[:'resource_id']
+ end
+
if attributes.key?(:'name')
self.name = attributes[:'name']
end
end
@@ -77,10 +86,11 @@
# Checks equality by comparing each attribute.
# @param [Object] Object to be compared
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
+ resource_id == o.resource_id &&
name == o.name
end
# @see the `==` method
# @param [Object] Object to be compared
@@ -89,10 +99,10 @@
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [name].hash
+ [resource_id, name].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself