Class: MistApi::StatsWxrule

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/stats_wxrule.rb

Overview

Wxrule statistics

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(action = nil, client_mac = nil, dst_allow_wxtags = nil, dst_deny_wxtags = nil, dst_wxtags = nil, name = nil, order = nil, src_wxtags = nil, usage = nil) ⇒ StatsWxrule

Returns a new instance of StatsWxrule.



73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/mist_api/models/stats_wxrule.rb', line 73

def initialize(action = nil, client_mac = nil, dst_allow_wxtags = nil,
               dst_deny_wxtags = nil, dst_wxtags = nil, name = nil,
               order = nil, src_wxtags = nil, usage = nil)
  @action = action
  @client_mac = client_mac
  @dst_allow_wxtags = dst_allow_wxtags
  @dst_deny_wxtags = dst_deny_wxtags
  @dst_wxtags = dst_wxtags
  @name = name
  @order = order
  @src_wxtags = src_wxtags
  @usage = usage
end

Instance Attribute Details

#actionStatsWxruleActionEnum

enum: ‘allow`, `block`



14
15
16
# File 'lib/mist_api/models/stats_wxrule.rb', line 14

def action
  @action
end

#client_macArray[String]

enum: ‘allow`, `block`

Returns:

  • (Array[String])


18
19
20
# File 'lib/mist_api/models/stats_wxrule.rb', line 18

def client_mac
  @client_mac
end

#dst_allow_wxtagsArray[UUID | String]

enum: ‘allow`, `block`

Returns:

  • (Array[UUID | String])


22
23
24
# File 'lib/mist_api/models/stats_wxrule.rb', line 22

def dst_allow_wxtags
  @dst_allow_wxtags
end

#dst_deny_wxtagsArray[UUID | String]

enum: ‘allow`, `block`

Returns:

  • (Array[UUID | String])


26
27
28
# File 'lib/mist_api/models/stats_wxrule.rb', line 26

def dst_deny_wxtags
  @dst_deny_wxtags
end

#dst_wxtagsArray[UUID | String]

enum: ‘allow`, `block`

Returns:

  • (Array[UUID | String])


30
31
32
# File 'lib/mist_api/models/stats_wxrule.rb', line 30

def dst_wxtags
  @dst_wxtags
end

#nameString

enum: ‘allow`, `block`

Returns:

  • (String)


34
35
36
# File 'lib/mist_api/models/stats_wxrule.rb', line 34

def name
  @name
end

#orderInteger

enum: ‘allow`, `block`

Returns:

  • (Integer)


38
39
40
# File 'lib/mist_api/models/stats_wxrule.rb', line 38

def order
  @order
end

#src_wxtagsArray[UUID | String]

enum: ‘allow`, `block`

Returns:

  • (Array[UUID | String])


42
43
44
# File 'lib/mist_api/models/stats_wxrule.rb', line 42

def src_wxtags
  @src_wxtags
end

#usageHash[String, StatsWxruleUsageProperties]

enum: ‘allow`, `block`

Returns:



46
47
48
# File 'lib/mist_api/models/stats_wxrule.rb', line 46

def usage
  @usage
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# File 'lib/mist_api/models/stats_wxrule.rb', line 88

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  action = hash.key?('action') ? hash['action'] : nil
  client_mac = hash.key?('client_mac') ? hash['client_mac'] : nil
  dst_allow_wxtags =
    hash.key?('dst_allow_wxtags') ? hash['dst_allow_wxtags'] : nil
  dst_deny_wxtags =
    hash.key?('dst_deny_wxtags') ? hash['dst_deny_wxtags'] : nil
  dst_wxtags = hash.key?('dst_wxtags') ? hash['dst_wxtags'] : nil
  name = hash.key?('name') ? hash['name'] : nil
  order = hash.key?('order') ? hash['order'] : nil
  src_wxtags = hash.key?('src_wxtags') ? hash['src_wxtags'] : nil
  usage = StatsWxruleUsageProperties.from_hash(hash['usage']) if hash['usage']

  usage = nil unless hash.key?('usage')

  # Create object from extracted values.
  StatsWxrule.new(action,
                  client_mac,
                  dst_allow_wxtags,
                  dst_deny_wxtags,
                  dst_wxtags,
                  name,
                  order,
                  src_wxtags,
                  usage)
end

.namesObject

A mapping from model property names to API property names.



49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'lib/mist_api/models/stats_wxrule.rb', line 49

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['action'] = 'action'
  @_hash['client_mac'] = 'client_mac'
  @_hash['dst_allow_wxtags'] = 'dst_allow_wxtags'
  @_hash['dst_deny_wxtags'] = 'dst_deny_wxtags'
  @_hash['dst_wxtags'] = 'dst_wxtags'
  @_hash['name'] = 'name'
  @_hash['order'] = 'order'
  @_hash['src_wxtags'] = 'src_wxtags'
  @_hash['usage'] = 'usage'
  @_hash
end

.nullablesObject

An array for nullable fields



69
70
71
# File 'lib/mist_api/models/stats_wxrule.rb', line 69

def self.nullables
  []
end

.optionalsObject

An array for optional fields



64
65
66
# File 'lib/mist_api/models/stats_wxrule.rb', line 64

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



127
128
129
130
131
132
133
# File 'lib/mist_api/models/stats_wxrule.rb', line 127

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} action: #{@action.inspect}, client_mac: #{@client_mac.inspect},"\
  " dst_allow_wxtags: #{@dst_allow_wxtags.inspect}, dst_deny_wxtags:"\
  " #{@dst_deny_wxtags.inspect}, dst_wxtags: #{@dst_wxtags.inspect}, name: #{@name.inspect},"\
  " order: #{@order.inspect}, src_wxtags: #{@src_wxtags.inspect}, usage: #{@usage.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



119
120
121
122
123
124
# File 'lib/mist_api/models/stats_wxrule.rb', line 119

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} action: #{@action}, client_mac: #{@client_mac}, dst_allow_wxtags:"\
  " #{@dst_allow_wxtags}, dst_deny_wxtags: #{@dst_deny_wxtags}, dst_wxtags: #{@dst_wxtags},"\
  " name: #{@name}, order: #{@order}, src_wxtags: #{@src_wxtags}, usage: #{@usage}>"
end