Class: MistApi::OrgUiSettings

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

Overview

OrgUiSettings 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(created_time = SKIP, description = SKIP, for_site = SKIP, id = SKIP, is_custom_databoard = SKIP, modified_time = SKIP, name = SKIP, org_id = SKIP, purpose = SKIP, site_id = SKIP, tiles = SKIP, additional_properties = nil) ⇒ OrgUiSettings

Returns a new instance of OrgUiSettings.



95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/mist_api/models/org_ui_settings.rb', line 95

def initialize(created_time = SKIP, description = SKIP, for_site = SKIP,
               id = SKIP, is_custom_databoard = SKIP, modified_time = SKIP,
               name = SKIP, org_id = SKIP, purpose = SKIP, site_id = SKIP,
               tiles = SKIP, additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @created_time = created_time unless created_time == SKIP
  @description = description unless description == SKIP
  @for_site = for_site unless for_site == SKIP
  @id = id unless id == SKIP
  @is_custom_databoard = is_custom_databoard unless is_custom_databoard == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @name = name unless name == SKIP
  @org_id = org_id unless org_id == SKIP
  @purpose = purpose unless purpose == SKIP
  @site_id = site_id unless site_id == SKIP
  @tiles = tiles unless tiles == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#descriptionString

When the object has been created, in epoch

Returns:

  • (String)


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

def description
  @description
end

#for_siteTrueClass | FalseClass

When the object has been created, in epoch

Returns:

  • (TrueClass | FalseClass)


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

def for_site
  @for_site
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#is_custom_databoardTrueClass | FalseClass

Whether this is a custom databoard or not

Returns:

  • (TrueClass | FalseClass)


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

def is_custom_databoard
  @is_custom_databoard
end

#modified_timeFloat

When the object has been modified for the last time, in epoch

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#nameString

Name of the databoard

Returns:

  • (String)


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

def name
  @name
end

#org_idUUID | String

Name of the databoard

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#purposeOrgUiSettingsPurposeEnum

enum: ‘marvisdashboard`



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

def purpose
  @purpose
end

#site_idUUID | String

enum: ‘marvisdashboard`

Returns:

  • (UUID | String)


50
51
52
# File 'lib/mist_api/models/org_ui_settings.rb', line 50

def site_id
  @site_id
end

#tilesArray[OrgUiSettingsTile]

List of tiles in the databoard

Returns:



54
55
56
# File 'lib/mist_api/models/org_ui_settings.rb', line 54

def tiles
  @tiles
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
# File 'lib/mist_api/models/org_ui_settings.rb', line 117

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  description = hash.key?('description') ? hash['description'] : SKIP
  for_site = hash.key?('for_site') ? hash['for_site'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  is_custom_databoard =
    hash.key?('isCustomDataboard') ? hash['isCustomDataboard'] : SKIP
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  purpose = hash.key?('purpose') ? hash['purpose'] : SKIP
  site_id = hash.key?('site_id') ? hash['site_id'] : SKIP
  # Parameter is an array, so we need to iterate through it
  tiles = nil
  unless hash['tiles'].nil?
    tiles = []
    hash['tiles'].each do |structure|
      tiles << (OrgUiSettingsTile.from_hash(structure) if structure)
    end
  end

  tiles = SKIP unless hash.key?('tiles')

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  OrgUiSettings.new(created_time,
                    description,
                    for_site,
                    id,
                    is_custom_databoard,
                    modified_time,
                    name,
                    org_id,
                    purpose,
                    site_id,
                    tiles,
                    additional_properties)
end

.namesObject

A mapping from model property names to API property names.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/mist_api/models/org_ui_settings.rb', line 57

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['created_time'] = 'created_time'
  @_hash['description'] = 'description'
  @_hash['for_site'] = 'for_site'
  @_hash['id'] = 'id'
  @_hash['is_custom_databoard'] = 'isCustomDataboard'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['org_id'] = 'org_id'
  @_hash['purpose'] = 'purpose'
  @_hash['site_id'] = 'site_id'
  @_hash['tiles'] = 'tiles'
  @_hash
end

.nullablesObject

An array for nullable fields



91
92
93
# File 'lib/mist_api/models/org_ui_settings.rb', line 91

def self.nullables
  []
end

.optionalsObject

An array for optional fields



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/mist_api/models/org_ui_settings.rb', line 74

def self.optionals
  %w[
    created_time
    description
    for_site
    id
    is_custom_databoard
    modified_time
    name
    org_id
    purpose
    site_id
    tiles
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



175
176
177
178
179
180
181
182
183
# File 'lib/mist_api/models/org_ui_settings.rb', line 175

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time.inspect}, description:"\
  " #{@description.inspect}, for_site: #{@for_site.inspect}, id: #{@id.inspect},"\
  " is_custom_databoard: #{@is_custom_databoard.inspect}, modified_time:"\
  " #{@modified_time.inspect}, name: #{@name.inspect}, org_id: #{@org_id.inspect}, purpose:"\
  " #{@purpose.inspect}, site_id: #{@site_id.inspect}, tiles: #{@tiles.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



166
167
168
169
170
171
172
# File 'lib/mist_api/models/org_ui_settings.rb', line 166

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time}, description: #{@description}, for_site:"\
  " #{@for_site}, id: #{@id}, is_custom_databoard: #{@is_custom_databoard}, modified_time:"\
  " #{@modified_time}, name: #{@name}, org_id: #{@org_id}, purpose: #{@purpose}, site_id:"\
  " #{@site_id}, tiles: #{@tiles}, additional_properties: #{@additional_properties}>"
end