Class: MistApi::Sdkinvite

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

Overview

SDK invite

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(name = nil, created_time = SKIP, enabled = true, expire_time = SKIP, id = SKIP, modified_time = SKIP, org_id = SKIP, quota = SKIP, quota_limited = false, site_id = SKIP, additional_properties = nil) ⇒ Sdkinvite

Returns a new instance of Sdkinvite.



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# File 'lib/mist_api/models/sdkinvite.rb', line 88

def initialize(name = nil, created_time = SKIP, enabled = true,
               expire_time = SKIP, id = SKIP, modified_time = SKIP,
               org_id = SKIP, quota = SKIP, quota_limited = false,
               site_id = 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
  @enabled = enabled unless enabled == SKIP
  @expire_time = expire_time unless expire_time == SKIP
  @id = id unless id == SKIP
  @modified_time = modified_time unless modified_time == SKIP
  @name = name
  @org_id = org_id unless org_id == SKIP
  @quota = quota unless quota == SKIP
  @quota_limited = quota_limited unless quota_limited == SKIP
  @site_id = site_id unless site_id == 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/sdkinvite.rb', line 14

def created_time
  @created_time
end

#enabledTrueClass | FalseClass

When the object has been created, in epoch

Returns:

  • (TrueClass | FalseClass)


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

def enabled
  @enabled
end

#expire_timeInteger

When the object has been created, in epoch

Returns:

  • (Integer)


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

def expire_time
  @expire_time
end

#idUUID | String

Unique ID of the object instance in the Mist Organization

Returns:

  • (UUID | String)


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

def id
  @id
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/sdkinvite.rb', line 30

def modified_time
  @modified_time
end

#nameString

Name, will show up in mobile

Returns:

  • (String)


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

def name
  @name
end

#org_idUUID | String

Name, will show up in mobile

Returns:

  • (UUID | String)


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

def org_id
  @org_id
end

#quotaInteger

Number of time this invite can be used

Returns:

  • (Integer)


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

def quota
  @quota
end

#quota_limitedTrueClass | FalseClass

Whether quota limiting is enabled

Returns:

  • (TrueClass | FalseClass)


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

def quota_limited
  @quota_limited
end

#site_idUUID | String

Whether quota limiting is enabled

Returns:

  • (UUID | String)


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

def site_id
  @site_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
142
143
# File 'lib/mist_api/models/sdkinvite.rb', line 109

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  created_time = hash.key?('created_time') ? hash['created_time'] : SKIP
  enabled = hash['enabled'] ||= true
  expire_time = hash.key?('expire_time') ? hash['expire_time'] : SKIP
  id = hash.key?('id') ? hash['id'] : SKIP
  modified_time = hash.key?('modified_time') ? hash['modified_time'] : SKIP
  org_id = hash.key?('org_id') ? hash['org_id'] : SKIP
  quota = hash.key?('quota') ? hash['quota'] : SKIP
  quota_limited = hash['quota_limited'] ||= false
  site_id = hash.key?('site_id') ? hash['site_id'] : 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.
  Sdkinvite.new(name,
                created_time,
                enabled,
                expire_time,
                id,
                modified_time,
                org_id,
                quota,
                quota_limited,
                site_id,
                additional_properties)
end

.namesObject

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/sdkinvite.rb', line 53

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['created_time'] = 'created_time'
  @_hash['enabled'] = 'enabled'
  @_hash['expire_time'] = 'expire_time'
  @_hash['id'] = 'id'
  @_hash['modified_time'] = 'modified_time'
  @_hash['name'] = 'name'
  @_hash['org_id'] = 'org_id'
  @_hash['quota'] = 'quota'
  @_hash['quota_limited'] = 'quota_limited'
  @_hash['site_id'] = 'site_id'
  @_hash
end

.nullablesObject

An array for nullable fields



84
85
86
# File 'lib/mist_api/models/sdkinvite.rb', line 84

def self.nullables
  []
end

.optionalsObject

An array for optional fields



69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/mist_api/models/sdkinvite.rb', line 69

def self.optionals
  %w[
    created_time
    enabled
    expire_time
    id
    modified_time
    org_id
    quota
    quota_limited
    site_id
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



155
156
157
158
159
160
161
162
# File 'lib/mist_api/models/sdkinvite.rb', line 155

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time.inspect}, enabled: #{@enabled.inspect},"\
  " expire_time: #{@expire_time.inspect}, id: #{@id.inspect}, modified_time:"\
  " #{@modified_time.inspect}, name: #{@name.inspect}, org_id: #{@org_id.inspect}, quota:"\
  " #{@quota.inspect}, quota_limited: #{@quota_limited.inspect}, site_id: #{@site_id.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



146
147
148
149
150
151
152
# File 'lib/mist_api/models/sdkinvite.rb', line 146

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} created_time: #{@created_time}, enabled: #{@enabled}, expire_time:"\
  " #{@expire_time}, id: #{@id}, modified_time: #{@modified_time}, name: #{@name}, org_id:"\
  " #{@org_id}, quota: #{@quota}, quota_limited: #{@quota_limited}, site_id: #{@site_id},"\
  " additional_properties: #{@additional_properties}>"
end