lib/fastly/models/logging_newrelic_response.rb in fastly-6.0.2 vs lib/fastly/models/logging_newrelic_response.rb in fastly-7.0.0
- old
+ new
@@ -17,19 +17,19 @@
attr_accessor :name
# Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`.
attr_accessor :placement
- # The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`.
- attr_accessor :format_version
-
# The name of an existing condition in the configured endpoint, or leave blank to always execute.
attr_accessor :response_condition
# A Fastly [log format string](https://docs.fastly.com/en/guides/custom-log-formats). Must produce valid JSON that New Relic Logs can ingest.
attr_accessor :format
+ # The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`.
+ attr_accessor :format_version
+
# The Insert API key from the Account page of your New Relic account. Required.
attr_accessor :token
# The region to which to stream logs.
attr_accessor :region
@@ -72,13 +72,13 @@
# Attribute mapping from ruby-style variable name to JSON key.
def self.attribute_map
{
:'name' => :'name',
:'placement' => :'placement',
- :'format_version' => :'format_version',
:'response_condition' => :'response_condition',
:'format' => :'format',
+ :'format_version' => :'format_version',
:'token' => :'token',
:'region' => :'region',
:'created_at' => :'created_at',
:'deleted_at' => :'deleted_at',
:'updated_at' => :'updated_at',
@@ -95,20 +95,20 @@
# Attribute type mapping.
def self.fastly_types
{
:'name' => :'String',
:'placement' => :'String',
- :'format_version' => :'Integer',
:'response_condition' => :'String',
:'format' => :'String',
+ :'format_version' => :'String',
:'token' => :'String',
:'region' => :'String',
:'created_at' => :'Time',
:'deleted_at' => :'Time',
:'updated_at' => :'Time',
:'service_id' => :'String',
- :'version' => :'Integer'
+ :'version' => :'String'
}
end
# List of attributes with nullable: true
def self.fastly_nullable
@@ -122,12 +122,13 @@
end
# List of class defined in allOf (OpenAPI v3)
def self.fastly_all_of
[
- :'LoggingNewrelic',
- :'ServiceIdAndVersion',
+ :'LoggingCommonResponse',
+ :'LoggingNewrelicAdditional',
+ :'ServiceIdAndVersionString',
:'Timestamps'
]
end
# Initializes the object
@@ -151,26 +152,26 @@
if attributes.key?(:'placement')
self.placement = attributes[:'placement']
end
- if attributes.key?(:'format_version')
- self.format_version = attributes[:'format_version']
- else
- self.format_version = FORMAT_VERSION::v2
- end
-
if attributes.key?(:'response_condition')
self.response_condition = attributes[:'response_condition']
end
if attributes.key?(:'format')
self.format = attributes[:'format']
else
self.format = '{\"timestamp\":\"%{begin:%Y-%m-%dT%H:%M:%S}t\",\"time_elapsed\":\"%{time.elapsed.usec}V\",\"is_tls\":\"%{if(req.is_ssl, \\\"true\\\", \\\"false\\\")}V\",\"client_ip\":\"%{req.http.Fastly-Client-IP}V\",\"geo_city\":\"%{client.geo.city}V\",\"geo_country_code\":\"%{client.geo.country_code}V\",\"request\":\"%{req.request}V\",\"host\":\"%{req.http.Fastly-Orig-Host}V\",\"url\":\"%{json.escape(req.url)}V\",\"request_referer\":\"%{json.escape(req.http.Referer)}V\",\"request_user_agent\":\"%{json.escape(req.http.User-Agent)}V\",\"request_accept_language\":\"%{json.escape(req.http.Accept-Language)}V\",\"request_accept_charset\":\"%{json.escape(req.http.Accept-Charset)}V\",\"cache_status\":\"%{regsub(fastly_info.state, \\\"^(HIT-(SYNTH)|(HITPASS|HIT|MISS|PASS|ERROR|PIPE)).*\\\", \\\"\\\\2\\\\3\\\") }V\"}'
end
+ if attributes.key?(:'format_version')
+ self.format_version = attributes[:'format_version']
+ else
+ self.format_version = '2'
+ end
+
if attributes.key?(:'token')
self.token = attributes[:'token']
end
if attributes.key?(:'region')
@@ -210,11 +211,11 @@
# Check to see if the all the properties in the model are valid
# @return true if the model is valid
def valid?
placement_validator = EnumAttributeValidator.new('String', ["none", "waf_debug", "null"])
return false unless placement_validator.valid?(@placement)
- format_version_validator = EnumAttributeValidator.new('Integer', [1, 2])
+ format_version_validator = EnumAttributeValidator.new('String', ["1", "2"])
return false unless format_version_validator.valid?(@format_version)
region_validator = EnumAttributeValidator.new('String', ["US", "EU"])
return false unless region_validator.valid?(@region)
true
end
@@ -230,11 +231,11 @@
end
# Custom attribute writer method checking allowed values (enum).
# @param [Object] format_version Object to be assigned
def format_version=(format_version)
- validator = EnumAttributeValidator.new('Integer', [1, 2])
+ validator = EnumAttributeValidator.new('String', ["1", "2"])
unless validator.valid?(format_version)
fail ArgumentError, "invalid value for \"format_version\", must be one of #{validator.allowable_values}."
end
@format_version = format_version
end
@@ -254,13 +255,13 @@
def ==(o)
return true if self.equal?(o)
self.class == o.class &&
name == o.name &&
placement == o.placement &&
- format_version == o.format_version &&
response_condition == o.response_condition &&
format == o.format &&
+ format_version == o.format_version &&
token == o.token &&
region == o.region &&
created_at == o.created_at &&
deleted_at == o.deleted_at &&
updated_at == o.updated_at &&
@@ -275,10 +276,10 @@
end
# Calculates hash code according to all attributes.
# @return [Integer] Hash code
def hash
- [name, placement, format_version, response_condition, format, token, region, created_at, deleted_at, updated_at, service_id, version].hash
+ [name, placement, response_condition, format, format_version, token, region, created_at, deleted_at, updated_at, service_id, version].hash
end
# Builds the object from hash
# @param [Hash] attributes Model attributes in the form of hash
# @return [Object] Returns the model itself