Class: DaytonaApiClient::DaytonaConfiguration

Inherits:
Object
  • Object
show all
Defined in:
lib/daytona_api_client/models/daytona_configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DaytonaConfiguration

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash



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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 123

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::DaytonaConfiguration` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  acceptable_attribute_map = self.class.acceptable_attribute_map
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!acceptable_attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::DaytonaConfiguration`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

  if attributes.key?(:'version')
    self.version = attributes[:'version']
  else
    self.version = nil
  end

  if attributes.key?(:'posthog')
    self.posthog = attributes[:'posthog']
  end

  if attributes.key?(:'oidc')
    self.oidc = attributes[:'oidc']
  else
    self.oidc = nil
  end

  if attributes.key?(:'linked_accounts_enabled')
    self.linked_accounts_enabled = attributes[:'linked_accounts_enabled']
  else
    self.linked_accounts_enabled = nil
  end

  if attributes.key?(:'announcements')
    if (value = attributes[:'announcements']).is_a?(Hash)
      self.announcements = value
    end
  else
    self.announcements = nil
  end

  if attributes.key?(:'pylon_app_id')
    self.pylon_app_id = attributes[:'pylon_app_id']
  end

  if attributes.key?(:'proxy_template_url')
    self.proxy_template_url = attributes[:'proxy_template_url']
  else
    self.proxy_template_url = nil
  end

  if attributes.key?(:'default_snapshot')
    self.default_snapshot = attributes[:'default_snapshot']
  else
    self.default_snapshot = nil
  end

  if attributes.key?(:'dashboard_url')
    self.dashboard_url = attributes[:'dashboard_url']
  else
    self.dashboard_url = nil
  end

  if attributes.key?(:'max_auto_archive_interval')
    self.max_auto_archive_interval = attributes[:'max_auto_archive_interval']
  else
    self.max_auto_archive_interval = nil
  end

  if attributes.key?(:'maintanance_mode')
    self.maintanance_mode = attributes[:'maintanance_mode']
  else
    self.maintanance_mode = nil
  end

  if attributes.key?(:'environment')
    self.environment = attributes[:'environment']
  else
    self.environment = nil
  end

  if attributes.key?(:'billing_api_url')
    self.billing_api_url = attributes[:'billing_api_url']
  end

  if attributes.key?(:'ssh_gateway_command')
    self.ssh_gateway_command = attributes[:'ssh_gateway_command']
  end

  if attributes.key?(:'ssh_gateway_public_key')
    self.ssh_gateway_public_key = attributes[:'ssh_gateway_public_key']
  end
end

Instance Attribute Details

#announcementsObject

System announcements



31
32
33
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 31

def announcements
  @announcements
end

#billing_api_urlObject

Billing API URL



55
56
57
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 55

def billing_api_url
  @billing_api_url
end

#dashboard_urlObject

Dashboard URL



43
44
45
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 43

def dashboard_url
  @dashboard_url
end

#default_snapshotObject

Default snapshot for sandboxes



40
41
42
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 40

def default_snapshot
  @default_snapshot
end

#environmentObject

Current environment



52
53
54
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 52

def environment
  @environment
end

#linked_accounts_enabledObject

Whether linked accounts are enabled



28
29
30
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 28

def linked_accounts_enabled
  @linked_accounts_enabled
end

#maintanance_modeObject

Whether maintenance mode is enabled



49
50
51
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 49

def maintanance_mode
  @maintanance_mode
end

#max_auto_archive_intervalObject

Maximum auto-archive interval in minutes



46
47
48
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 46

def max_auto_archive_interval
  @max_auto_archive_interval
end

#oidcObject

OIDC configuration



25
26
27
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 25

def oidc
  @oidc
end

#posthogObject

PostHog configuration



22
23
24
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 22

def posthog
  @posthog
end

#proxy_template_urlObject

Proxy template URL



37
38
39
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 37

def proxy_template_url
  @proxy_template_url
end

#pylon_app_idObject

Pylon application ID



34
35
36
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 34

def pylon_app_id
  @pylon_app_id
end

#ssh_gateway_commandObject

SSH Gateway command



58
59
60
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 58

def ssh_gateway_command
  @ssh_gateway_command
end

#ssh_gateway_public_keyObject

Base64 encoded SSH Gateway public key



61
62
63
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 61

def ssh_gateway_public_key
  @ssh_gateway_public_key
end

#versionObject

Daytona version



19
20
21
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 19

def version
  @version
end

Class Method Details

._deserialize(type, value) ⇒ Object

Deserializes the data based on type

Parameters:

  • string

    type Data type

  • string

    value Value to be deserialized

Returns:

  • (Object)

    Deserialized data



446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 446

def self._deserialize(type, value)
  case type.to_sym
  when :Time
    Time.parse(value)
  when :Date
    Date.parse(value)
  when :String
    value.to_s
  when :Integer
    value.to_i
  when :Float
    value.to_f
  when :Boolean
    if value.to_s =~ /\A(true|t|yes|y|1)\z/i
      true
    else
      false
    end
  when :Object
    # generic object (usually a Hash), return directly
    value
  when /\AArray<(?<inner_type>.+)>\z/
    inner_type = Regexp.last_match[:inner_type]
    value.map { |v| _deserialize(inner_type, v) }
  when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
    k_type = Regexp.last_match[:k_type]
    v_type = Regexp.last_match[:v_type]
    {}.tap do |hash|
      value.each do |k, v|
        hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
      end
    end
  else # model
    # models (e.g. Pet) or oneOf
    klass = DaytonaApiClient.const_get(type)
    klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
  end
end

.acceptable_attribute_mapObject

Returns attribute mapping this model knows about



85
86
87
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 85

def self.acceptable_attribute_map
  attribute_map
end

.acceptable_attributesObject

Returns all the JSON keys this model knows about



90
91
92
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 90

def self.acceptable_attributes
  acceptable_attribute_map.values
end

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 64

def self.attribute_map
  {
    :'version' => :'version',
    :'posthog' => :'posthog',
    :'oidc' => :'oidc',
    :'linked_accounts_enabled' => :'linkedAccountsEnabled',
    :'announcements' => :'announcements',
    :'pylon_app_id' => :'pylonAppId',
    :'proxy_template_url' => :'proxyTemplateUrl',
    :'default_snapshot' => :'defaultSnapshot',
    :'dashboard_url' => :'dashboardUrl',
    :'max_auto_archive_interval' => :'maxAutoArchiveInterval',
    :'maintanance_mode' => :'maintananceMode',
    :'environment' => :'environment',
    :'billing_api_url' => :'billingApiUrl',
    :'ssh_gateway_command' => :'sshGatewayCommand',
    :'ssh_gateway_public_key' => :'sshGatewayPublicKey'
  }
end

.build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 422

def self.build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  attributes = attributes.transform_keys(&:to_sym)
  transformed_hash = {}
  openapi_types.each_pair do |key, type|
    if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = nil
    elsif type =~ /\AArray<(.*)>/i
      # check to ensure the input is an array given that the attribute
      # is documented as an array but the input is not
      if attributes[attribute_map[key]].is_a?(Array)
        transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
      end
    elsif !attributes[attribute_map[key]].nil?
      transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
    end
  end
  new(transformed_hash)
end

.openapi_nullableObject

List of attributes with nullable: true



116
117
118
119
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 116

def self.openapi_nullable
  Set.new([
  ])
end

.openapi_typesObject

Attribute type mapping.



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

def self.openapi_types
  {
    :'version' => :'String',
    :'posthog' => :'PosthogConfig',
    :'oidc' => :'OidcConfig',
    :'linked_accounts_enabled' => :'Boolean',
    :'announcements' => :'Hash<String, Announcement>',
    :'pylon_app_id' => :'String',
    :'proxy_template_url' => :'String',
    :'default_snapshot' => :'String',
    :'dashboard_url' => :'String',
    :'max_auto_archive_interval' => :'Float',
    :'maintanance_mode' => :'Boolean',
    :'environment' => :'String',
    :'billing_api_url' => :'String',
    :'ssh_gateway_command' => :'String',
    :'ssh_gateway_public_key' => :'String'
  }
end

Instance Method Details

#==(o) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • Object (Object)

    to be compared



387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 387

def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      version == o.version &&
      posthog == o.posthog &&
      oidc == o.oidc &&
      linked_accounts_enabled == o.linked_accounts_enabled &&
      announcements == o.announcements &&
      pylon_app_id == o.pylon_app_id &&
      proxy_template_url == o.proxy_template_url &&
      default_snapshot == o.default_snapshot &&
      dashboard_url == o.dashboard_url &&
      max_auto_archive_interval == o.max_auto_archive_interval &&
      maintanance_mode == o.maintanance_mode &&
      environment == o.environment &&
      billing_api_url == o.billing_api_url &&
      ssh_gateway_command == o.ssh_gateway_command &&
      ssh_gateway_public_key == o.ssh_gateway_public_key
end

#_to_hash(value) ⇒ Hash

Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

Parameters:

  • value (Object)

    Any valid value

Returns:

  • (Hash)

    Returns the value in the form of hash



517
518
519
520
521
522
523
524
525
526
527
528
529
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 517

def _to_hash(value)
  if value.is_a?(Array)
    value.compact.map { |v| _to_hash(v) }
  elsif value.is_a?(Hash)
    {}.tap do |hash|
      value.each { |k, v| hash[k] = _to_hash(v) }
    end
  elsif value.respond_to? :to_hash
    value.to_hash
  else
    value
  end
end

#eql?(o) ⇒ Boolean

Parameters:

  • Object (Object)

    to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


409
410
411
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 409

def eql?(o)
  self == o
end

#hashInteger

Calculates hash code according to all attributes.

Returns:

  • (Integer)

    Hash code



415
416
417
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 415

def hash
  [version, posthog, oidc, linked_accounts_enabled, announcements, pylon_app_id, proxy_template_url, default_snapshot, dashboard_url, max_auto_archive_interval, maintanance_mode, environment, billing_api_url, ssh_gateway_command, ssh_gateway_public_key].hash
end

#list_invalid_propertiesObject

Show invalid properties with the reasons. Usually used together with valid?

Returns:

  • Array for valid properties with the reasons



222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 222

def list_invalid_properties
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
  invalid_properties = Array.new
  if @version.nil?
    invalid_properties.push('invalid value for "version", version cannot be nil.')
  end

  if @oidc.nil?
    invalid_properties.push('invalid value for "oidc", oidc cannot be nil.')
  end

  if @linked_accounts_enabled.nil?
    invalid_properties.push('invalid value for "linked_accounts_enabled", linked_accounts_enabled cannot be nil.')
  end

  if @announcements.nil?
    invalid_properties.push('invalid value for "announcements", announcements cannot be nil.')
  end

  if @proxy_template_url.nil?
    invalid_properties.push('invalid value for "proxy_template_url", proxy_template_url cannot be nil.')
  end

  if @default_snapshot.nil?
    invalid_properties.push('invalid value for "default_snapshot", default_snapshot cannot be nil.')
  end

  if @dashboard_url.nil?
    invalid_properties.push('invalid value for "dashboard_url", dashboard_url cannot be nil.')
  end

  if @max_auto_archive_interval.nil?
    invalid_properties.push('invalid value for "max_auto_archive_interval", max_auto_archive_interval cannot be nil.')
  end

  if @maintanance_mode.nil?
    invalid_properties.push('invalid value for "maintanance_mode", maintanance_mode cannot be nil.')
  end

  if @environment.nil?
    invalid_properties.push('invalid value for "environment", environment cannot be nil.')
  end

  invalid_properties
end

#to_bodyHash

to_body is an alias to to_hash (backward compatibility)

Returns:

  • (Hash)

    Returns the object in the form of hash



493
494
495
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 493

def to_body
  to_hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 499

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = self.send(attr)
    if value.nil?
      is_nullable = self.class.openapi_nullable.include?(attr)
      next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
    end

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



487
488
489
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 487

def to_s
  to_hash.to_s
end

#valid?Boolean

Check to see if the all the properties in the model are valid

Returns:

  • (Boolean)

    true if the model is valid



270
271
272
273
274
275
276
277
278
279
280
281
282
283
# File 'lib/daytona_api_client/models/daytona_configuration.rb', line 270

def valid?
  warn '[DEPRECATED] the `valid?` method is obsolete'
  return false if @version.nil?
  return false if @oidc.nil?
  return false if @linked_accounts_enabled.nil?
  return false if @announcements.nil?
  return false if @proxy_template_url.nil?
  return false if @default_snapshot.nil?
  return false if @dashboard_url.nil?
  return false if @max_auto_archive_interval.nil?
  return false if @maintanance_mode.nil?
  return false if @environment.nil?
  true
end