Class: MistApi::SwRoutingPolicyTermAction
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- MistApi::SwRoutingPolicyTermAction
- Defined in:
- lib/mist_api/models/sw_routing_policy_term_action.rb
Overview
When used as import policy
Instance Attribute Summary collapse
-
#accept ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#community ⇒ Array[String]
When used as export policy, optional.
-
#local_preference ⇒ Object
Optional, for an import policy, local_preference can be changed, value in range 1-4294967294.
-
#prepend_as_path ⇒ Array[String]
When used as export policy, optional.
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(accept = SKIP, community = SKIP, local_preference = SKIP, prepend_as_path = SKIP) ⇒ SwRoutingPolicyTermAction
constructor
A new instance of SwRoutingPolicyTermAction.
-
#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(accept = SKIP, community = SKIP, local_preference = SKIP, prepend_as_path = SKIP) ⇒ SwRoutingPolicyTermAction
Returns a new instance of SwRoutingPolicyTermAction.
55 56 57 58 59 60 61 |
# File 'lib/mist_api/models/sw_routing_policy_term_action.rb', line 55 def initialize(accept = SKIP, community = SKIP, local_preference = SKIP, prepend_as_path = SKIP) @accept = accept unless accept == SKIP @community = community unless community == SKIP @local_preference = local_preference unless local_preference == SKIP @prepend_as_path = prepend_as_path unless prepend_as_path == SKIP end |
Instance Attribute Details
#accept ⇒ TrueClass | FalseClass
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/sw_routing_policy_term_action.rb', line 14 def accept @accept end |
#community ⇒ Array[String]
When used as export policy, optional
18 19 20 |
# File 'lib/mist_api/models/sw_routing_policy_term_action.rb', line 18 def community @community end |
#local_preference ⇒ Object
Optional, for an import policy, local_preference can be changed, value in range 1-4294967294. Can be a Variable (e.g. ‘{bgp_as}`)
23 24 25 |
# File 'lib/mist_api/models/sw_routing_policy_term_action.rb', line 23 def local_preference @local_preference end |
#prepend_as_path ⇒ Array[String]
When used as export policy, optional. By default, the local AS will be prepended, to change it. Can be a Variable (e.g. ‘{as_path}`)
28 29 30 |
# File 'lib/mist_api/models/sw_routing_policy_term_action.rb', line 28 def prepend_as_path @prepend_as_path end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
64 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_action.rb', line 64 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. accept = hash.key?('accept') ? hash['accept'] : SKIP community = hash.key?('community') ? hash['community'] : SKIP local_preference = hash.key?('local_preference') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:RoutingPolicyLocalPreference), hash['local_preference'] ) : SKIP prepend_as_path = hash.key?('prepend_as_path') ? hash['prepend_as_path'] : SKIP # Create object from extracted values. SwRoutingPolicyTermAction.new(accept, community, local_preference, prepend_as_path) end |
.names ⇒ Object
A mapping from model property names to API property names.
31 32 33 34 35 36 37 38 |
# File 'lib/mist_api/models/sw_routing_policy_term_action.rb', line 31 def self.names @_hash = {} if @_hash.nil? @_hash['accept'] = 'accept' @_hash['community'] = 'community' @_hash['local_preference'] = 'local_preference' @_hash['prepend_as_path'] = 'prepend_as_path' @_hash end |
.nullables ⇒ Object
An array for nullable fields
51 52 53 |
# File 'lib/mist_api/models/sw_routing_policy_term_action.rb', line 51 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
41 42 43 44 45 46 47 48 |
# File 'lib/mist_api/models/sw_routing_policy_term_action.rb', line 41 def self.optionals %w[ accept community local_preference prepend_as_path ] 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_action.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 106 |
# File 'lib/mist_api/models/sw_routing_policy_term_action.rb', line 101 def inspect class_name = self.class.name.split('::').last "<#{class_name} accept: #{@accept.inspect}, community: #{@community.inspect},"\ " local_preference: #{@local_preference.inspect}, prepend_as_path:"\ " #{@prepend_as_path.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_action.rb', line 94 def to_s class_name = self.class.name.split('::').last "<#{class_name} accept: #{@accept}, community: #{@community}, local_preference:"\ " #{@local_preference}, prepend_as_path: #{@prepend_as_path}>" end |