Class: MistApi::Msp

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

Overview

Msp 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(allow_mist = SKIP, created_time = SKIP, id = SKIP, logo_url = SKIP, modified_time = SKIP, name = SKIP, tier = MspTierEnum::BASE, url = SKIP, additional_properties = nil) ⇒ Msp

Returns a new instance of Msp.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/mist_api/models/msp.rb', line 77

def initialize(allow_mist = SKIP, created_time = SKIP, id = SKIP,
               logo_url = SKIP, modified_time = SKIP, name = SKIP,
               tier = MspTierEnum::BASE, url = SKIP,
               additional_properties = nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @allow_mist = allow_mist unless allow_mist == SKIP
  @created_time = created_time unless created_time == SKIP
  @id = id unless id == SKIP
  @logo_url = logo_url unless logo_url == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @name = name unless name == SKIP
  @tier = tier unless tier == SKIP
  @url = url unless url == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#allow_mistTrueClass | FalseClass

TODO: Write general description for this method

Returns:

  • (TrueClass | FalseClass)


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

def allow_mist
  @allow_mist
end

#created_timeFloat

When the object has been created, in epoch

Returns:

  • (Float)


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

def created_time
  @created_time
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
end

#logo_urlString

For advanced tier (uMSPs) only

Returns:

  • (String)


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

def logo_url
  @logo_url
end

#modified_timeFloat

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

Returns:

  • (Float)


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

def modified_time
  @modified_time
end

#nameString

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

Returns:

  • (String)


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

def name
  @name
end

#tierMspTierEnum

enum: ‘advanced`, `base`

Returns:



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

def tier
  @tier
end

#urlString

For advanced tier (uMSPs) only

Returns:

  • (String)


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

def url
  @url
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



96
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
# File 'lib/mist_api/models/msp.rb', line 96

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  allow_mist = hash.key?('allow_mist') ? hash['allow_mist'] : SKIP
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  logo_url = hash.key?('logo_url') ? hash['logo_url'] : SKIP
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  name = hash.key?('name') ? hash['name'] : SKIP
  tier = hash['tier'] ||= MspTierEnum::BASE
  url = hash.key?('url') ? hash['url'] : SKIP

  # 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.
  Msp.new(allow_mist,
          created_time,
          id,
          logo_url,
          modified_time,
          name,
          tier,
          url,
          additional_properties)
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/mist_api/models/msp.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['allow_mist'] = 'allow_mist'
  @_hash['created_time'] = 'created_time'
  @_hash['id'] = 'id'
  @_hash['logo_url'] = 'logo_url'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['tier'] = 'tier'
  @_hash['url'] = 'url'
  @_hash
end

.nullablesObject

An array for nullable fields



73
74
75
# File 'lib/mist_api/models/msp.rb', line 73

def self.nullables
  []
end

.optionalsObject

An array for optional fields



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

def self.optionals
  %w[
    allow_mist
    created_time
    id
    logo_url
    modified_time
    name
    tier
    url
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



137
138
139
140
141
142
143
# File 'lib/mist_api/models/msp.rb', line 137

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} allow_mist: #{@allow_mist.inspect}, created_time: #{@created_time.inspect},"\
  " id: #{@id.inspect}, logo_url: #{@logo_url.inspect}, modified_time:"\
  " #{@modified_time.inspect}, name: #{@name.inspect}, tier: #{@tier.inspect}, url:"\
  " #{@url.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



129
130
131
132
133
134
# File 'lib/mist_api/models/msp.rb', line 129

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} allow_mist: #{@allow_mist}, created_time: #{@created_time}, id: #{@id},"\
  " logo_url: #{@logo_url}, modified_time: #{@modified_time}, name: #{@name}, tier: #{@tier},"\
  " url: #{@url}, additional_properties: #{@additional_properties}>"
end