lib/ionoscloud/models/flow_log_properties.rb in ionoscloud-6.0.0.beta.4 vs lib/ionoscloud/models/flow_log_properties.rb in ionoscloud-6.0.0

- old
+ new

@@ -1,11 +1,11 @@ =begin #CLOUD API #IONOS Enterprise-grade Infrastructure as a Service (IaaS) solutions can be managed through the Cloud API, in addition or as an alternative to the \"Data Center Designer\" (DCD) browser-based tool. Both methods employ consistent concepts and features, deliver similar power and flexibility, and can be used to perform a multitude of management tasks, including adding servers, volumes, configuring networks, and so on. -The version of the OpenAPI document: 6.0-SDK.3 +The version of the OpenAPI document: 6.0 Generated by: https://openapi-generator.tech OpenAPI Generator version: 5.2.1-SNAPSHOT =end @@ -13,19 +13,23 @@ require 'date' require 'time' module Ionoscloud class FlowLogProperties - # A name of that resource + + # The name of the resource. attr_accessor :name + # Specifies the traffic action pattern. attr_accessor :action + # Specifies the traffic direction pattern. attr_accessor :direction + # S3 bucket name of an existing IONOS Cloud S3 bucket. attr_accessor :bucket class EnumAttributeValidator attr_reader :datatype @@ -50,13 +54,17 @@ end # Attribute mapping from ruby-style variable name to JSON key. def self.attribute_map { + :'name' => :'name', + :'action' => :'action', + :'direction' => :'direction', + :'bucket' => :'bucket' } end # Returns all the JSON keys this model knows about @@ -65,20 +73,28 @@ end # Attribute type mapping. def self.openapi_types { + :'name' => :'String', + :'action' => :'String', + :'direction' => :'String', + :'bucket' => :'String' } end # List of attributes with nullable: true def self.openapi_nullable Set.new([ + + + + ]) end # Initializes the object # @param [Hash] attributes Model attributes in the form of hash @@ -92,93 +108,109 @@ if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Ionoscloud::FlowLogProperties`. 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?(:'name') self.name = attributes[:'name'] end + if attributes.key?(:'action') self.action = attributes[:'action'] end + if attributes.key?(:'direction') self.direction = attributes[:'direction'] end + if attributes.key?(:'bucket') self.bucket = attributes[:'bucket'] 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 invalid_properties = Array.new + if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end + if @action.nil? invalid_properties.push('invalid value for "action", action cannot be nil.') end + if @direction.nil? invalid_properties.push('invalid value for "direction", direction cannot be nil.') end + if @bucket.nil? invalid_properties.push('invalid value for "bucket", bucket cannot be nil.') end invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? + return false if @name.nil? + return false if @action.nil? action_validator = EnumAttributeValidator.new('String', ["ACCEPTED", "REJECTED", "ALL"]) return false unless action_validator.valid?(@action) + return false if @direction.nil? direction_validator = EnumAttributeValidator.new('String', ["INGRESS", "EGRESS", "BIDIRECTIONAL"]) return false unless direction_validator.valid?(@direction) + return false if @bucket.nil? true end + + # Custom attribute writer method checking allowed values (enum). # @param [Object] action Object to be assigned def action=(action) validator = EnumAttributeValidator.new('String', ["ACCEPTED", "REJECTED", "ALL"]) unless validator.valid?(action) fail ArgumentError, "invalid value for \"action\", must be one of #{validator.allowable_values}." end @action = action end + # Custom attribute writer method checking allowed values (enum). # @param [Object] direction Object to be assigned def direction=(direction) validator = EnumAttributeValidator.new('String', ["INGRESS", "EGRESS", "BIDIRECTIONAL"]) unless validator.valid?(direction) fail ArgumentError, "invalid value for \"direction\", must be one of #{validator.allowable_values}." end @direction = direction 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 && - action == o.action && - direction == o.direction && - bucket == o.bucket + name == o.name && + action == o.action && + direction == o.direction && + bucket == o.bucket end # @see the `==` method # @param [Object] Object to be compared def eql?(o)