lib/fastly/models/logging_ftp_response.rb in fastly-6.0.2 vs lib/fastly/models/logging_ftp_response.rb in fastly-7.0.0

- old
+ new

@@ -17,34 +17,47 @@ 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). 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 + # How the message should be formatted. attr_accessor :message_type # A timestamp format attr_accessor :timestamp_format + # The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. + attr_accessor :compression_codec + # How frequently log files are finalized so they can be available for reading (in seconds). attr_accessor :period # The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. attr_accessor :gzip_level - # The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. - attr_accessor :compression_codec + # 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 + + attr_accessor :service_id + + attr_accessor :version + # An hostname or IPv4 address. attr_accessor :address # Hostname used. attr_accessor :hostname @@ -56,32 +69,19 @@ attr_accessor :password # The path to upload log files to. If the path ends in `/` then it is treated as a directory. attr_accessor :path - # The port number. - attr_accessor :port - # A PGP public key that Fastly will use to encrypt your log files before writing them to disk. attr_accessor :public_key # The username for the server. Can be anonymous. attr_accessor :user - # Date and time in ISO 8601 format. - attr_accessor :created_at + # The port number. + attr_accessor :port - # Date and time in ISO 8601 format. - attr_accessor :deleted_at - - # Date and time in ISO 8601 format. - attr_accessor :updated_at - - attr_accessor :service_id - - attr_accessor :version - class EnumAttributeValidator attr_reader :datatype attr_reader :allowable_values def initialize(datatype, allowable_values) @@ -105,31 +105,31 @@ # 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', :'message_type' => :'message_type', :'timestamp_format' => :'timestamp_format', + :'compression_codec' => :'compression_codec', :'period' => :'period', :'gzip_level' => :'gzip_level', - :'compression_codec' => :'compression_codec', + :'created_at' => :'created_at', + :'deleted_at' => :'deleted_at', + :'updated_at' => :'updated_at', + :'service_id' => :'service_id', + :'version' => :'version', :'address' => :'address', :'hostname' => :'hostname', :'ipv4' => :'ipv4', :'password' => :'password', :'path' => :'path', - :'port' => :'port', :'public_key' => :'public_key', :'user' => :'user', - :'created_at' => :'created_at', - :'deleted_at' => :'deleted_at', - :'updated_at' => :'updated_at', - :'service_id' => :'service_id', - :'version' => :'version' + :'port' => :'port' } end # Returns all the JSON keys this model knows about def self.acceptable_attributes @@ -139,52 +139,55 @@ # Attribute type mapping. def self.fastly_types { :'name' => :'String', :'placement' => :'String', - :'format_version' => :'Integer', :'response_condition' => :'String', :'format' => :'String', + :'format_version' => :'String', :'message_type' => :'String', :'timestamp_format' => :'String', - :'period' => :'Integer', - :'gzip_level' => :'Integer', :'compression_codec' => :'String', + :'period' => :'String', + :'gzip_level' => :'String', + :'created_at' => :'Time', + :'deleted_at' => :'Time', + :'updated_at' => :'Time', + :'service_id' => :'String', + :'version' => :'String', :'address' => :'String', :'hostname' => :'String', :'ipv4' => :'String', :'password' => :'String', :'path' => :'String', - :'port' => :'Integer', :'public_key' => :'String', :'user' => :'String', - :'created_at' => :'Time', - :'deleted_at' => :'Time', - :'updated_at' => :'Time', - :'service_id' => :'String', - :'version' => :'Integer' + :'port' => :'String' } end # List of attributes with nullable: true def self.fastly_nullable Set.new([ :'placement', :'response_condition', :'timestamp_format', - :'public_key', :'created_at', :'deleted_at', :'updated_at', + :'public_key', ]) end # List of class defined in allOf (OpenAPI v3) def self.fastly_all_of [ - :'LoggingFtp', - :'ServiceIdAndVersion', + :'LoggingCommonResponse', + :'LoggingFtpAdditional', + :'LoggingFtpResponseAllOf', + :'LoggingGenericCommonResponse', + :'ServiceIdAndVersionString', :'Timestamps' ] end # Initializes the object @@ -208,52 +211,72 @@ 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 = '%h %l %u %t \"%r\" %>s %b' end + if attributes.key?(:'format_version') + self.format_version = attributes[:'format_version'] + else + self.format_version = '2' + end + if attributes.key?(:'message_type') self.message_type = attributes[:'message_type'] else self.message_type = 'classic' end if attributes.key?(:'timestamp_format') self.timestamp_format = attributes[:'timestamp_format'] end + if attributes.key?(:'compression_codec') + self.compression_codec = attributes[:'compression_codec'] + end + if attributes.key?(:'period') self.period = attributes[:'period'] else - self.period = 3600 + self.period = '3600' end if attributes.key?(:'gzip_level') self.gzip_level = attributes[:'gzip_level'] else - self.gzip_level = 0 + self.gzip_level = '0' end - if attributes.key?(:'compression_codec') - self.compression_codec = attributes[:'compression_codec'] + if attributes.key?(:'created_at') + self.created_at = attributes[:'created_at'] end + if attributes.key?(:'deleted_at') + self.deleted_at = attributes[:'deleted_at'] + end + + if attributes.key?(:'updated_at') + self.updated_at = attributes[:'updated_at'] + end + + if attributes.key?(:'service_id') + self.service_id = attributes[:'service_id'] + end + + if attributes.key?(:'version') + self.version = attributes[:'version'] + end + if attributes.key?(:'address') self.address = attributes[:'address'] end if attributes.key?(:'hostname') @@ -270,45 +293,25 @@ if attributes.key?(:'path') self.path = attributes[:'path'] end - if attributes.key?(:'port') - self.port = attributes[:'port'] - else - self.port = 21 - end - if attributes.key?(:'public_key') self.public_key = attributes[:'public_key'] else self.public_key = 'null' end if attributes.key?(:'user') self.user = attributes[:'user'] end - if attributes.key?(:'created_at') - self.created_at = attributes[:'created_at'] + if attributes.key?(:'port') + self.port = attributes[:'port'] + else + self.port = '21' end - - if attributes.key?(:'deleted_at') - self.deleted_at = attributes[:'deleted_at'] - end - - if attributes.key?(:'updated_at') - self.updated_at = attributes[:'updated_at'] - end - - if attributes.key?(:'service_id') - self.service_id = attributes[:'service_id'] - end - - if attributes.key?(:'version') - self.version = attributes[:'version'] - end end # Show invalid properties with the reasons. Usually used together with valid? # @return Array for valid properties with the reasons def list_invalid_properties @@ -319,11 +322,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) message_type_validator = EnumAttributeValidator.new('String', ["classic", "loggly", "logplex", "blank"]) return false unless message_type_validator.valid?(@message_type) compression_codec_validator = EnumAttributeValidator.new('String', ["zstd", "snappy", "gzip"]) return false unless compression_codec_validator.valid?(@compression_codec) @@ -341,11 +344,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 @@ -375,31 +378,31 @@ 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 && message_type == o.message_type && timestamp_format == o.timestamp_format && + compression_codec == o.compression_codec && period == o.period && gzip_level == o.gzip_level && - compression_codec == o.compression_codec && + created_at == o.created_at && + deleted_at == o.deleted_at && + updated_at == o.updated_at && + service_id == o.service_id && + version == o.version && address == o.address && hostname == o.hostname && ipv4 == o.ipv4 && password == o.password && path == o.path && - port == o.port && public_key == o.public_key && user == o.user && - created_at == o.created_at && - deleted_at == o.deleted_at && - updated_at == o.updated_at && - service_id == o.service_id && - version == o.version + port == o.port end # @see the `==` method # @param [Object] Object to be compared def eql?(o) @@ -407,10 +410,10 @@ end # Calculates hash code according to all attributes. # @return [Integer] Hash code def hash - [name, placement, format_version, response_condition, format, message_type, timestamp_format, period, gzip_level, compression_codec, address, hostname, ipv4, password, path, port, public_key, user, created_at, deleted_at, updated_at, service_id, version].hash + [name, placement, response_condition, format, format_version, message_type, timestamp_format, compression_codec, period, gzip_level, created_at, deleted_at, updated_at, service_id, version, address, hostname, ipv4, password, path, public_key, user, port].hash end # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself