lib/fastly/models/schemas_snippet_response.rb in fastly-7.1.1 vs lib/fastly/models/schemas_snippet_response.rb in fastly-7.2.0
- old
+ new
@@ -14,22 +14,22 @@
module Fastly
class SchemasSnippetResponse
# The name for the snippet.
attr_accessor :name
- # Sets the snippet version.
- attr_accessor :dynamic
-
# The location in generated VCL where the snippet should be placed.
attr_accessor :type
# The VCL code that specifies exactly what the snippet does.
attr_accessor :content
# Priority determines execution order. Lower numbers execute first.
attr_accessor :priority
+ # Sets the snippet version.
+ attr_accessor :dynamic
+
# Date and time in ISO 8601 format.
attr_accessor :created_at
# Date and time in ISO 8601 format.
attr_accessor :deleted_at
@@ -68,14 +68,14 @@
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'name' => :'name',
- :'dynamic' => :'dynamic',
:'type' => :'type',
:'content' => :'content',
:'priority' => :'priority',
+ :'dynamic' => :'dynamic',
:'created_at' => :'created_at',
:'deleted_at' => :'deleted_at',
:'updated_at' => :'updated_at',
:'service_id' => :'service_id',
:'version' => :'version',
@@ -90,14 +90,14 @@
# Attribute type mapping.
def self.fastly_types
{
:'name' => :'String',
- :'dynamic' => :'String',
:'type' => :'String',
:'content' => :'String',
:'priority' => :'String',
+ :'dynamic' => :'String',
:'created_at' => :'Time',
:'deleted_at' => :'Time',
:'updated_at' => :'Time',
:'service_id' => :'String',
:'version' => :'String',
@@ -115,13 +115,12 @@
end
# List of class defined in allOf (OpenAPI v3)
def self.fastly_all_of
[
- :'Snippet',
- :'SnippetResponseAllOf',
- :'Timestamps'
+ :'SchemasSnippetResponseCommon',
+ :'Snippet'
]
end
# Initializes the object
# @param [Hash] attributes Model attributes in the form of hash
@@ -140,14 +139,10 @@
if attributes.key?(:'name')
self.name = attributes[:'name']
end
- if attributes.key?(:'dynamic')
- self.dynamic = attributes[:'dynamic']
- end
-
if attributes.key?(:'type')
self.type = attributes[:'type']
end
if attributes.key?(:'content')
@@ -158,10 +153,14 @@
self.priority = attributes[:'priority']
else
self.priority = '100'
end
+ if attributes.key?(:'dynamic')
+ self.dynamic = attributes[:'dynamic']
+ end
+
if attributes.key?(:'created_at')
self.created_at = attributes[:'created_at']
end
if attributes.key?(:'deleted_at')
@@ -193,47 +192,47 @@
end
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
- dynamic_validator = EnumAttributeValidator.new('String', ["0", "1"])
- return false unless dynamic_validator.valid?(@dynamic)
type_validator = EnumAttributeValidator.new('String', ["init", "recv", "hash", "hit", "miss", "pass", "fetch", "error", "deliver", "log", "none"])
return false unless type_validator.valid?(@type)
+ dynamic_validator = EnumAttributeValidator.new('String', ["0", "1"])
+ return false unless dynamic_validator.valid?(@dynamic)
true
end
# Custom attribute writer method checking allowed values (enum).
- # @param [Object] dynamic Object to be assigned
- def dynamic=(dynamic)
- validator = EnumAttributeValidator.new('String', ["0", "1"])
- unless validator.valid?(dynamic)
- fail ArgumentError, "invalid value for \"dynamic\", must be one of #{validator.allowable_values}."
- end
- @dynamic = dynamic
- end
-
- # Custom attribute writer method checking allowed values (enum).
# @param [Object] type Object to be assigned
def type=(type)
validator = EnumAttributeValidator.new('String', ["init", "recv", "hash", "hit", "miss", "pass", "fetch", "error", "deliver", "log", "none"])
unless validator.valid?(type)
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
end
@type = type
end
+ # Custom attribute writer method checking allowed values (enum).
+ # @param [Object] dynamic Object to be assigned
+ def dynamic=(dynamic)
+ validator = EnumAttributeValidator.new('String', ["0", "1"])
+ unless validator.valid?(dynamic)
+ fail ArgumentError, "invalid value for \"dynamic\", must be one of #{validator.allowable_values}."
+ end
+ @dynamic = dynamic
+ 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 &&
name == o.name &&
- dynamic == o.dynamic &&
type == o.type &&
content == o.content &&
priority == o.priority &&
+ dynamic == o.dynamic &&
created_at == o.created_at &&
deleted_at == o.deleted_at &&
updated_at == o.updated_at &&
service_id == o.service_id &&
version == o.version &&
@@ -247,10 +246,10 @@
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [name, dynamic, type, content, priority, created_at, deleted_at, updated_at, service_id, version, id].hash
+ [name, type, content, priority, dynamic, created_at, deleted_at, updated_at, service_id, version, id].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself