Class: MultiAuthSample::ServiceStatus

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/multi_auth_sample/models/service_status.rb

Overview

ServiceStatus Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#to_hash, #to_json

Constructor Details

#initialize(status = nil, app = SKIP, moto = SKIP, notes = SKIP, users = SKIP, time = SKIP, os = SKIP, php_version = SKIP, additional_properties = {}) ⇒ ServiceStatus

Returns a new instance of ServiceStatus.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# File 'lib/multi_auth_sample/models/service_status.rb', line 76

def initialize(status = nil,
               app = SKIP,
               moto = SKIP,
               notes = SKIP,
               users = SKIP,
               time = SKIP,
               os = SKIP,
               php_version = SKIP,
               additional_properties = {})
  @app = app unless app == SKIP
  @moto = moto unless moto == SKIP
  @notes = notes unless notes == SKIP
  @users = users unless users == SKIP
  @time = time unless time == SKIP
  @os = os unless os == SKIP
  @php_version = php_version unless php_version == SKIP
  @status = status

  # Add additional model properties to the instance.
  additional_properties.each do |_name, _value|
    instance_variable_set("@#{_name}", _value)
  end
end

Instance Attribute Details

#appString

TODO: Write general description for this method

Returns:

  • (String)


14
15
16
# File 'lib/multi_auth_sample/models/service_status.rb', line 14

def app
  @app
end

#motoString

TODO: Write general description for this method

Returns:

  • (String)


18
19
20
# File 'lib/multi_auth_sample/models/service_status.rb', line 18

def moto
  @moto
end

#notesInteger

TODO: Write general description for this method

Returns:

  • (Integer)


22
23
24
# File 'lib/multi_auth_sample/models/service_status.rb', line 22

def notes
  @notes
end

#osString

TODO: Write general description for this method

Returns:

  • (String)


34
35
36
# File 'lib/multi_auth_sample/models/service_status.rb', line 34

def os
  @os
end

#php_versionString

TODO: Write general description for this method

Returns:

  • (String)


38
39
40
# File 'lib/multi_auth_sample/models/service_status.rb', line 38

def php_version
  @php_version
end

#statusString

TODO: Write general description for this method

Returns:

  • (String)


42
43
44
# File 'lib/multi_auth_sample/models/service_status.rb', line 42

def status
  @status
end

#timeString

TODO: Write general description for this method

Returns:

  • (String)


30
31
32
# File 'lib/multi_auth_sample/models/service_status.rb', line 30

def time
  @time
end

#usersInteger

TODO: Write general description for this method

Returns:

  • (Integer)


26
27
28
# File 'lib/multi_auth_sample/models/service_status.rb', line 26

def users
  @users
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/multi_auth_sample/models/service_status.rb', line 101

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  status = hash.key?('status') ? hash['status'] : nil
  app = hash.key?('app') ? hash['app'] : SKIP
  moto = hash.key?('moto') ? hash['moto'] : SKIP
  notes = hash.key?('notes') ? hash['notes'] : SKIP
  users = hash.key?('users') ? hash['users'] : SKIP
  time = hash.key?('time') ? hash['time'] : SKIP
  os = hash.key?('os') ? hash['os'] : SKIP
  php_version = hash.key?('php_version') ? hash['php_version'] : SKIP

  # Clean out expected properties from Hash.
  names.each_value { |k| hash.delete(k) }

  # Create object from extracted values.
  ServiceStatus.new(status,
                    app,
                    moto,
                    notes,
                    users,
                    time,
                    os,
                    php_version,
                    hash)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/multi_auth_sample/models/service_status.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['app'] = 'app'
  @_hash['moto'] = 'moto'
  @_hash['notes'] = 'notes'
  @_hash['users'] = 'users'
  @_hash['time'] = 'time'
  @_hash['os'] = 'os'
  @_hash['php_version'] = 'php_version'
  @_hash['status'] = 'status'
  @_hash
end

.nullablesObject

An array for nullable fields



72
73
74
# File 'lib/multi_auth_sample/models/service_status.rb', line 72

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
62
63
64
65
66
67
68
69
# File 'lib/multi_auth_sample/models/service_status.rb', line 59

def self.optionals
  %w[
    app
    moto
    notes
    users
    time
    os
    php_version
  ]
end