Class: MistApi::ProtectReCustom
- Defined in:
- lib/mist_api/models/protect_re_custom.rb
Overview
Custom acls
Instance Attribute Summary collapse
-
#port_range ⇒ String
Matched dst port, “0” means any.
-
#protocol ⇒ ProtectReCustomProtocolEnum
enum: ‘any`, `icmp`, `tcp`, `udp`.
-
#subnets ⇒ Array[String]
enum: ‘any`, `icmp`, `tcp`, `udp`.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(port_range = '0', protocol = ProtectReCustomProtocolEnum::ANY, subnets = SKIP) ⇒ ProtectReCustom
constructor
A new instance of ProtectReCustom.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(port_range = '0', protocol = ProtectReCustomProtocolEnum::ANY, subnets = SKIP) ⇒ ProtectReCustom
Returns a new instance of ProtectReCustom.
47 48 49 50 51 52 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 47 def initialize(port_range = '0', protocol = ProtectReCustomProtocolEnum::ANY, subnets = SKIP) @port_range = port_range unless port_range == SKIP @protocol = protocol unless protocol == SKIP @subnets = subnets unless subnets == SKIP end |
Instance Attribute Details
#port_range ⇒ String
Matched dst port, “0” means any
14 15 16 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 14 def port_range @port_range end |
#protocol ⇒ ProtectReCustomProtocolEnum
enum: ‘any`, `icmp`, `tcp`, `udp`
18 19 20 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 18 def protocol @protocol end |
#subnets ⇒ Array[String]
enum: ‘any`, `icmp`, `tcp`, `udp`
22 23 24 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 22 def subnets @subnets end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 55 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. port_range = hash['port_range'] ||= '0' protocol = hash['protocol'] ||= ProtectReCustomProtocolEnum::ANY subnets = hash.key?('subnets') ? hash['subnets'] : SKIP # Create object from extracted values. ProtectReCustom.new(port_range, protocol, subnets) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['port_range'] = 'port_range' @_hash['protocol'] = 'protocol' @_hash['subnets'] = 'subnets' @_hash end |
.nullables ⇒ Object
An array for nullable fields
43 44 45 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 43 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 39 40 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 34 def self.optionals %w[ port_range protocol subnets ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
71 72 73 74 75 76 77 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 71 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
86 87 88 89 90 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 86 def inspect class_name = self.class.name.split('::').last "<#{class_name} port_range: #{@port_range.inspect}, protocol: #{@protocol.inspect},"\ " subnets: #{@subnets.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
80 81 82 83 |
# File 'lib/mist_api/models/protect_re_custom.rb', line 80 def to_s class_name = self.class.name.split('::').last "<#{class_name} port_range: #{@port_range}, protocol: #{@protocol}, subnets: #{@subnets}>" end |