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

- old
+ new

@@ -11,26 +11,26 @@ require 'date' require 'time' module Fastly class ResourceResponse + # The ID of the underlying linked resource. + attr_accessor :resource_id + + # The name of the resource link. + attr_accessor :name + # Date and time in ISO 8601 format. attr_accessor :created_at # Date and time in ISO 8601 format. attr_accessor :deleted_at # Date and time in ISO 8601 format. attr_accessor :updated_at - # The name of the resource. - attr_accessor :name - - # The ID of the linked resource. - attr_accessor :resource_id - - # An alphanumeric string identifying the resource. + # An alphanumeric string identifying the resource link. attr_accessor :id # The path to the resource. attr_accessor :href @@ -43,15 +43,15 @@ attr_accessor :resource_type # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'resource_id' => :'resource_id', + :'name' => :'name', :'created_at' => :'created_at', :'deleted_at' => :'deleted_at', :'updated_at' => :'updated_at', - :'name' => :'name', - :'resource_id' => :'resource_id', :'id' => :'id', :'href' => :'href', :'service_id' => :'service_id', :'version' => :'version', :'resource_type' => :'resource_type' @@ -64,15 +64,15 @@ end # Attribute type mapping. def self.fastly_types { + :'resource_id' => :'String', + :'name' => :'String', :'created_at' => :'Time', :'deleted_at' => :'Time', :'updated_at' => :'Time', - :'name' => :'String', - :'resource_id' => :'String', :'id' => :'String', :'href' => :'String', :'service_id' => :'String', :'version' => :'Integer', :'resource_type' => :'TypeResource' @@ -89,11 +89,11 @@ end # List of class defined in allOf (OpenAPI v3) def self.fastly_all_of [ - :'ResourceCreate', + :'Resource', :'ResourceResponseAllOf', :'Timestamps' ] end @@ -110,10 +110,18 @@ fail ArgumentError, "`#{k}` is not a valid attribute in `Fastly::ResourceResponse`. 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 + if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] end if attributes.key?(:'deleted_at') @@ -122,18 +130,10 @@ if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] end - if attributes.key?(:'name') - self.name = attributes[:'name'] - end - - if attributes.key?(:'resource_id') - self.resource_id = attributes[:'resource_id'] - end - if attributes.key?(:'id') self.id = attributes[:'id'] end if attributes.key?(:'href') @@ -171,15 +171,15 @@ # 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 && created_at == o.created_at && deleted_at == o.deleted_at && updated_at == o.updated_at && - name == o.name && - resource_id == o.resource_id && id == o.id && href == o.href && service_id == o.service_id && version == o.version && resource_type == o.resource_type @@ -192,10 +192,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [created_at, deleted_at, updated_at, name, resource_id, id, href, service_id, version, resource_type].hash + [resource_id, name, created_at, deleted_at, updated_at, id, href, service_id, version, resource_type].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself