Class: MistApi::SleImpactedUsers
- Defined in:
- lib/mist_api/models/sle_impacted_users.rb
Overview
SleImpactedUsers Model.
Instance Attribute Summary collapse
-
#classifier ⇒ String
TODO: Write general description for this method.
-
#clients ⇒ Array[SleImpactedUsersClient]
TODO: Write general description for this method.
-
#failure ⇒ String
TODO: Write general description for this method.
-
#limit ⇒ Float
TODO: Write general description for this method.
-
#mend ⇒ Float
TODO: Write general description for this method.
-
#metric ⇒ String
TODO: Write general description for this method.
-
#page ⇒ Float
TODO: Write general description for this method.
-
#start ⇒ Float
TODO: Write general description for this method.
-
#total_count ⇒ Float
TODO: Write general description for this method.
-
#users ⇒ Array[SleImpactedUsersUser]
TODO: Write general description for this method.
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.
Instance Method Summary collapse
-
#initialize(classifier = nil, mend = nil, failure = nil, limit = nil, metric = nil, page = nil, start = nil, total_count = nil, clients = SKIP, users = SKIP) ⇒ SleImpactedUsers
constructor
A new instance of SleImpactedUsers.
-
#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(classifier = nil, mend = nil, failure = nil, limit = nil, metric = nil, page = nil, start = nil, total_count = nil, clients = SKIP, users = SKIP) ⇒ SleImpactedUsers
Returns a new instance of SleImpactedUsers.
81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 81 def initialize(classifier = nil, mend = nil, failure = nil, limit = nil, metric = nil, page = nil, start = nil, total_count = nil, clients = SKIP, users = SKIP) @classifier = classifier @clients = clients unless clients == SKIP @mend = mend @failure = failure @limit = limit @metric = metric @page = page @start = start @total_count = total_count @users = users unless users == SKIP end |
Instance Attribute Details
#classifier ⇒ String
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 14 def classifier @classifier end |
#clients ⇒ Array[SleImpactedUsersClient]
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 18 def clients @clients end |
#failure ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 26 def failure @failure end |
#limit ⇒ Float
TODO: Write general description for this method
30 31 32 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 30 def limit @limit end |
#mend ⇒ Float
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 22 def mend @mend end |
#metric ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 34 def metric @metric end |
#page ⇒ Float
TODO: Write general description for this method
38 39 40 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 38 def page @page end |
#start ⇒ Float
TODO: Write general description for this method
42 43 44 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 42 def start @start end |
#total_count ⇒ Float
TODO: Write general description for this method
46 47 48 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 46 def total_count @total_count end |
#users ⇒ Array[SleImpactedUsersUser]
TODO: Write general description for this method
50 51 52 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 50 def users @users end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
97 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 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 97 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. classifier = hash.key?('classifier') ? hash['classifier'] : nil mend = hash.key?('end') ? hash['end'] : nil failure = hash.key?('failure') ? hash['failure'] : nil limit = hash.key?('limit') ? hash['limit'] : nil metric = hash.key?('metric') ? hash['metric'] : nil page = hash.key?('page') ? hash['page'] : nil start = hash.key?('start') ? hash['start'] : nil total_count = hash.key?('total_count') ? hash['total_count'] : nil # Parameter is an array, so we need to iterate through it clients = nil unless hash['clients'].nil? clients = [] hash['clients'].each do |structure| clients << (SleImpactedUsersClient.from_hash(structure) if structure) end end clients = SKIP unless hash.key?('clients') # Parameter is an array, so we need to iterate through it users = nil unless hash['users'].nil? users = [] hash['users'].each do |structure| users << (SleImpactedUsersUser.from_hash(structure) if structure) end end users = SKIP unless hash.key?('users') # Create object from extracted values. SleImpactedUsers.new(classifier, mend, failure, limit, metric, page, start, total_count, clients, users) end |
.names ⇒ Object
A mapping from model property names to API property names.
53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 53 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['users'] = 'users' @_hash end |
.nullables ⇒ Object
An array for nullable fields
77 78 79 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 77 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
69 70 71 72 73 74 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 69 def self.optionals %w[ clients users ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
152 153 154 155 156 157 158 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 152 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}, users: #{@users.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
144 145 146 147 148 149 |
# File 'lib/mist_api/models/sle_impacted_users.rb', line 144 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}, users: #{@users}>" end |