Class: MistApi::Org
- Defined in:
- lib/mist_api/models/org.rb
Overview
Org Model.
Instance Attribute Summary collapse
-
#alarmtemplate_id ⇒ UUID | String
TODO: Write general description for this method.
-
#allow_mist ⇒ TrueClass | FalseClass
TODO: Write general description for this method.
-
#created_time ⇒ Float
When the object has been created, in epoch.
-
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization.
-
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch.
-
#msp_id ⇒ UUID | String
When the object has been modified for the last time, in epoch.
-
#msp_logo_url ⇒ String
logo uploaded by the MSP with advanced tier, only present if provided.
-
#msp_name ⇒ String
Name of the msp the org belongs to.
-
#name ⇒ String
Name of the msp the org belongs to.
-
#orggroup_ids ⇒ Array[UUID | String]
Name of the msp the org belongs to.
-
#session_expiry ⇒ Integer
Name of the msp the org belongs to.
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(name = nil, alarmtemplate_id = SKIP, allow_mist = true, created_time = SKIP, id = SKIP, modified_time = SKIP, msp_id = SKIP, msp_logo_url = SKIP, msp_name = SKIP, orggroup_ids = SKIP, session_expiry = 1440, additional_properties = nil) ⇒ Org
constructor
A new instance of Org.
-
#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(name = nil, alarmtemplate_id = SKIP, allow_mist = true, created_time = SKIP, id = SKIP, modified_time = SKIP, msp_id = SKIP, msp_logo_url = SKIP, msp_name = SKIP, orggroup_ids = SKIP, session_expiry = 1440, additional_properties = nil) ⇒ Org
Returns a new instance of Org.
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/org.rb', line 96 def initialize(name = nil, alarmtemplate_id = SKIP, allow_mist = true, created_time = SKIP, id = SKIP, modified_time = SKIP, msp_id = SKIP, msp_logo_url = SKIP, msp_name = SKIP, orggroup_ids = SKIP, session_expiry = 1440, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @alarmtemplate_id = alarmtemplate_id unless alarmtemplate_id == SKIP @allow_mist = allow_mist unless allow_mist == SKIP @created_time = created_time unless created_time == SKIP @id = id unless id == SKIP @modified_time = modified_time unless modified_time == SKIP @msp_id = msp_id unless msp_id == SKIP @msp_logo_url = msp_logo_url unless msp_logo_url == SKIP @msp_name = msp_name unless msp_name == SKIP @name = name @orggroup_ids = orggroup_ids unless orggroup_ids == SKIP @session_expiry = session_expiry unless session_expiry == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#alarmtemplate_id ⇒ UUID | String
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/org.rb', line 14 def alarmtemplate_id @alarmtemplate_id end |
#allow_mist ⇒ TrueClass | FalseClass
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/org.rb', line 18 def allow_mist @allow_mist end |
#created_time ⇒ Float
When the object has been created, in epoch
22 23 24 |
# File 'lib/mist_api/models/org.rb', line 22 def created_time @created_time end |
#id ⇒ UUID | String
Unique ID of the object instance in the Mist Organization
26 27 28 |
# File 'lib/mist_api/models/org.rb', line 26 def id @id end |
#modified_time ⇒ Float
When the object has been modified for the last time, in epoch
30 31 32 |
# File 'lib/mist_api/models/org.rb', line 30 def modified_time @modified_time end |
#msp_id ⇒ UUID | String
When the object has been modified for the last time, in epoch
34 35 36 |
# File 'lib/mist_api/models/org.rb', line 34 def msp_id @msp_id end |
#msp_logo_url ⇒ String
logo uploaded by the MSP with advanced tier, only present if provided
38 39 40 |
# File 'lib/mist_api/models/org.rb', line 38 def msp_logo_url @msp_logo_url end |
#msp_name ⇒ String
Name of the msp the org belongs to
42 43 44 |
# File 'lib/mist_api/models/org.rb', line 42 def msp_name @msp_name end |
#name ⇒ String
Name of the msp the org belongs to
46 47 48 |
# File 'lib/mist_api/models/org.rb', line 46 def name @name end |
#orggroup_ids ⇒ Array[UUID | String]
Name of the msp the org belongs to
50 51 52 |
# File 'lib/mist_api/models/org.rb', line 50 def orggroup_ids @orggroup_ids end |
#session_expiry ⇒ Integer
Name of the msp the org belongs to
54 55 56 |
# File 'lib/mist_api/models/org.rb', line 54 def session_expiry @session_expiry end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/mist_api/models/org.rb', line 119 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. name = hash.key?('name') ? hash['name'] : nil alarmtemplate_id = hash.key?('alarmtemplate_id') ? hash['alarmtemplate_id'] : SKIP allow_mist = hash['allow_mist'] ||= true created_time = hash.key?('created_time') ? hash['created_time'] : SKIP id = hash.key?('id') ? hash['id'] : SKIP modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP msp_id = hash.key?('msp_id') ? hash['msp_id'] : SKIP msp_logo_url = hash.key?('msp_logo_url') ? hash['msp_logo_url'] : SKIP msp_name = hash.key?('msp_name') ? hash['msp_name'] : SKIP orggroup_ids = hash.key?('orggroup_ids') ? hash['orggroup_ids'] : SKIP session_expiry = hash['session_expiry'] ||= 1440 # 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. Org.new(name, alarmtemplate_id, allow_mist, created_time, id, modified_time, msp_id, msp_logo_url, msp_name, orggroup_ids, session_expiry, additional_properties) end |
.names ⇒ Object
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.rb', line 57 def self.names @_hash = {} if @_hash.nil? @_hash['alarmtemplate_id'] = 'alarmtemplate_id' @_hash['allow_mist'] = 'allow_mist' @_hash['created_time'] = 'created_time' @_hash['id'] = 'id' @_hash['modified_time'] = 'modified_time' @_hash['msp_id'] = 'msp_id' @_hash['msp_logo_url'] = 'msp_logo_url' @_hash['msp_name'] = 'msp_name' @_hash['name'] = 'name' @_hash['orggroup_ids'] = 'orggroup_ids' @_hash['session_expiry'] = 'session_expiry' @_hash end |
.nullables ⇒ Object
An array for nullable fields
90 91 92 93 94 |
# File 'lib/mist_api/models/org.rb', line 90 def self.nullables %w[ alarmtemplate_id ] end |
.optionals ⇒ Object
An array for optional fields
74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/mist_api/models/org.rb', line 74 def self.optionals %w[ alarmtemplate_id allow_mist created_time id modified_time msp_id msp_logo_url msp_name orggroup_ids session_expiry ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
169 170 171 172 173 174 175 176 177 |
# File 'lib/mist_api/models/org.rb', line 169 def inspect class_name = self.class.name.split('::').last "<#{class_name} alarmtemplate_id: #{@alarmtemplate_id.inspect}, allow_mist:"\ " #{@allow_mist.inspect}, created_time: #{@created_time.inspect}, id: #{@id.inspect},"\ " modified_time: #{@modified_time.inspect}, msp_id: #{@msp_id.inspect}, msp_logo_url:"\ " #{@msp_logo_url.inspect}, msp_name: #{@msp_name.inspect}, name: #{@name.inspect},"\ " orggroup_ids: #{@orggroup_ids.inspect}, session_expiry: #{@session_expiry.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
159 160 161 162 163 164 165 166 |
# File 'lib/mist_api/models/org.rb', line 159 def to_s class_name = self.class.name.split('::').last "<#{class_name} alarmtemplate_id: #{@alarmtemplate_id}, allow_mist: #{@allow_mist},"\ " created_time: #{@created_time}, id: #{@id}, modified_time: #{@modified_time}, msp_id:"\ " #{@msp_id}, msp_logo_url: #{@msp_logo_url}, msp_name: #{@msp_name}, name: #{@name},"\ " orggroup_ids: #{@orggroup_ids}, session_expiry: #{@session_expiry}, additional_properties:"\ " #{@additional_properties}>" end |