Class: MistApi::SwRoutingPolicyTermMatching
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::SwRoutingPolicyTermMatching
- Defined in:
- lib/mist_api/models/sw_routing_policy_term_matching.rb
Overview
zero or more criteria/filter can be specified to match the term, all criteria have to be met
Instance Attribute Summary collapse
-
#as_path ⇒ Array[Object]
TODO: Write general description for this method.
-
#community ⇒ Array[String]
TODO: Write general description for this method.
-
#prefix ⇒ Array[String]
zero or more criteria/filter can be specified to match the term, all criteria have to be met.
-
#protocol ⇒ Array[SwRoutingPolicyTermMatchingProtocolEnum]
zero or more criteria/filter can be specified to match the term, all criteria have to be met.
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(as_path = SKIP, community = SKIP, prefix = SKIP, protocol = SKIP) ⇒ SwRoutingPolicyTermMatching
constructor
A new instance of SwRoutingPolicyTermMatching.
-
#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(as_path = SKIP, community = SKIP, prefix = SKIP, protocol = SKIP) ⇒ SwRoutingPolicyTermMatching
Returns a new instance of SwRoutingPolicyTermMatching.
56 57 58 59 60 61 62 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 56 def initialize(as_path = SKIP, community = SKIP, prefix = SKIP, protocol = SKIP) @as_path = as_path unless as_path == SKIP @community = community unless community == SKIP @prefix = prefix unless prefix == SKIP @protocol = protocol unless protocol == SKIP end |
Instance Attribute Details
#as_path ⇒ Array[Object]
TODO: Write general description for this method
15 16 17 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 15 def as_path @as_path end |
#community ⇒ Array[String]
TODO: Write general description for this method
19 20 21 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 19 def community @community end |
#prefix ⇒ Array[String]
zero or more criteria/filter can be specified to match the term, all criteria have to be met
24 25 26 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 24 def prefix @prefix end |
#protocol ⇒ Array[SwRoutingPolicyTermMatchingProtocolEnum]
zero or more criteria/filter can be specified to match the term, all criteria have to be met
29 30 31 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 29 def protocol @protocol end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 65 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. as_path = hash.key?('as_path') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:BgpAs4), hash['as_path'] ) : SKIP community = hash.key?('community') ? hash['community'] : SKIP prefix = hash.key?('prefix') ? hash['prefix'] : SKIP protocol = hash.key?('protocol') ? hash['protocol'] : SKIP # Create object from extracted values. SwRoutingPolicyTermMatching.new(as_path, community, prefix, protocol) end |
.names ⇒ Object
A mapping from model property names to API property names.
32 33 34 35 36 37 38 39 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 32 def self.names @_hash = {} if @_hash.nil? @_hash['as_path'] = 'as_path' @_hash['community'] = 'community' @_hash['prefix'] = 'prefix' @_hash['protocol'] = 'protocol' @_hash end |
.nullables ⇒ Object
An array for nullable fields
52 53 54 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 52 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
42 43 44 45 46 47 48 49 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 42 def self.optionals %w[ as_path community prefix protocol ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
85 86 87 88 89 90 91 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 85 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.
101 102 103 104 105 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 101 def inspect class_name = self.class.name.split('::').last "<#{class_name} as_path: #{@as_path.inspect}, community: #{@community.inspect}, prefix:"\ " #{@prefix.inspect}, protocol: #{@protocol.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
94 95 96 97 98 |
# File 'lib/mist_api/models/sw_routing_policy_term_matching.rb', line 94 def to_s class_name = self.class.name.split('::').last "<#{class_name} as_path: #{@as_path}, community: #{@community}, prefix: #{@prefix},"\ " protocol: #{@protocol}>" end |