Class: MistApi::SleImpactedClients

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

Overview

SleImpactedClients Model.

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(classifier = SKIP, clients = SKIP, mend = SKIP, failure = SKIP, limit = SKIP, metric = SKIP, page = SKIP, start = SKIP, total_count = SKIP) ⇒ SleImpactedClients

Returns a new instance of SleImpactedClients.



83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'lib/mist_api/models/sle_impacted_clients.rb', line 83

def initialize(classifier = SKIP, clients = SKIP, mend = SKIP,
               failure = SKIP, limit = SKIP, metric = SKIP, page = SKIP,
               start = SKIP, total_count = SKIP)
  @classifier = classifier unless classifier == SKIP
  @clients = clients unless clients == SKIP
  @mend = mend unless mend == SKIP
  @failure = failure unless failure == SKIP
  @limit = limit unless limit == SKIP
  @metric = metric unless metric == SKIP
  @page = page unless page == SKIP
  @start = start unless start == SKIP
  @total_count = total_count unless total_count == SKIP
end

Instance Attribute Details

#classifierString

TODO: Write general description for this method

Returns:

  • (String)


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

def classifier
  @classifier
end

#clientsArray[SleImpactedClientsClient]

TODO: Write general description for this method

Returns:



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

def clients
  @clients
end

#failureString

TODO: Write general description for this method

Returns:

  • (String)


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

def failure
  @failure
end

#limitInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def limit
  @limit
end

#mendInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def mend
  @mend
end

#metricString

TODO: Write general description for this method

Returns:

  • (String)


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

def metric
  @metric
end

#pageInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def page
  @page
end

#startInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def start
  @start
end

#total_countInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def total_count
  @total_count
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/mist_api/models/sle_impacted_clients.rb', line 98

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  classifier = hash.key?('classifier') ? hash['classifier'] : SKIP
  # Parameter is an array, so we need to iterate through it
  clients = nil
  unless hash['clients'].nil?
    clients = []
    hash['clients'].each do |structure|
      clients << (SleImpactedClientsClient.from_hash(structure) if structure)
    end
  end

  clients = SKIP unless hash.key?('clients')
  mend = hash.key?('end') ? hash['end'] : SKIP
  failure = hash.key?('failure') ? hash['failure'] : SKIP
  limit = hash.key?('limit') ? hash['limit'] : SKIP
  metric = hash.key?('metric') ? hash['metric'] : SKIP
  page = hash.key?('page') ? hash['page'] : SKIP
  start = hash.key?('start') ? hash['start'] : SKIP
  total_count = hash.key?('total_count') ? hash['total_count'] : SKIP

  # Create object from extracted values.
  SleImpactedClients.new(classifier,
                         clients,
                         mend,
                         failure,
                         limit,
                         metric,
                         page,
                         start,
                         total_count)
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/sle_impacted_clients.rb', line 49

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['classifier'] = 'classifier'
  @_hash['clients'] = 'clients'
  @_hash['mend'] = 'end'
  @_hash['failure'] = 'failure'
  @_hash['limit'] = 'limit'
  @_hash['metric'] = 'metric'
  @_hash['page'] = 'page'
  @_hash['start'] = 'start'
  @_hash['total_count'] = 'total_count'
  @_hash
end

.nullablesObject

An array for nullable fields



79
80
81
# File 'lib/mist_api/models/sle_impacted_clients.rb', line 79

def self.nullables
  []
end

.optionalsObject

An array for optional fields



64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/mist_api/models/sle_impacted_clients.rb', line 64

def self.optionals
  %w[
    classifier
    clients
    mend
    failure
    limit
    metric
    page
    start
    total_count
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



142
143
144
145
146
147
148
# File 'lib/mist_api/models/sle_impacted_clients.rb', line 142

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} classifier: #{@classifier.inspect}, clients: #{@clients.inspect}, mend:"\
  " #{@mend.inspect}, failure: #{@failure.inspect}, limit: #{@limit.inspect}, metric:"\
  " #{@metric.inspect}, page: #{@page.inspect}, start: #{@start.inspect}, total_count:"\
  " #{@total_count.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



134
135
136
137
138
139
# File 'lib/mist_api/models/sle_impacted_clients.rb', line 134

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} classifier: #{@classifier}, clients: #{@clients}, mend: #{@mend}, failure:"\
  " #{@failure}, limit: #{@limit}, metric: #{@metric}, page: #{@page}, start: #{@start},"\
  " total_count: #{@total_count}>"
end