daytona_api_client 0.200.1 → 0.201.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,6 +33,9 @@ module DaytonaApiClient
33
33
  # S3 bucket name
34
34
  attr_accessor :bucket
35
35
 
36
+ # Region for the storage backend (e.g. \"us-east-2\")
37
+ attr_accessor :region
38
+
36
39
  # Attribute mapping from ruby-style variable name to JSON key.
37
40
  def self.attribute_map
38
41
  {
@@ -41,7 +44,8 @@ module DaytonaApiClient
41
44
  :'session_token' => :'sessionToken',
42
45
  :'storage_url' => :'storageUrl',
43
46
  :'organization_id' => :'organizationId',
44
- :'bucket' => :'bucket'
47
+ :'bucket' => :'bucket',
48
+ :'region' => :'region'
45
49
  }
46
50
  end
47
51
 
@@ -63,7 +67,8 @@ module DaytonaApiClient
63
67
  :'session_token' => :'String',
64
68
  :'storage_url' => :'String',
65
69
  :'organization_id' => :'String',
66
- :'bucket' => :'String'
70
+ :'bucket' => :'String',
71
+ :'region' => :'String'
67
72
  }
68
73
  end
69
74
 
@@ -124,6 +129,12 @@ module DaytonaApiClient
124
129
  else
125
130
  self.bucket = nil
126
131
  end
132
+
133
+ if attributes.key?(:'region')
134
+ self.region = attributes[:'region']
135
+ else
136
+ self.region = nil
137
+ end
127
138
  end
128
139
 
129
140
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -155,6 +166,10 @@ module DaytonaApiClient
155
166
  invalid_properties.push('invalid value for "bucket", bucket cannot be nil.')
156
167
  end
157
168
 
169
+ if @region.nil?
170
+ invalid_properties.push('invalid value for "region", region cannot be nil.')
171
+ end
172
+
158
173
  invalid_properties
159
174
  end
160
175
 
@@ -168,6 +183,7 @@ module DaytonaApiClient
168
183
  return false if @storage_url.nil?
169
184
  return false if @organization_id.nil?
170
185
  return false if @bucket.nil?
186
+ return false if @region.nil?
171
187
  true
172
188
  end
173
189
 
@@ -231,6 +247,16 @@ module DaytonaApiClient
231
247
  @bucket = bucket
232
248
  end
233
249
 
250
+ # Custom attribute writer method with validation
251
+ # @param [Object] region Value to be assigned
252
+ def region=(region)
253
+ if region.nil?
254
+ fail ArgumentError, 'region cannot be nil'
255
+ end
256
+
257
+ @region = region
258
+ end
259
+
234
260
  # Checks equality by comparing each attribute.
235
261
  # @param [Object] Object to be compared
236
262
  def ==(o)
@@ -241,7 +267,8 @@ module DaytonaApiClient
241
267
  session_token == o.session_token &&
242
268
  storage_url == o.storage_url &&
243
269
  organization_id == o.organization_id &&
244
- bucket == o.bucket
270
+ bucket == o.bucket &&
271
+ region == o.region
245
272
  end
246
273
 
247
274
  # @see the `==` method
@@ -253,7 +280,7 @@ module DaytonaApiClient
253
280
  # Calculates hash code according to all attributes.
254
281
  # @return [Integer] Hash code
255
282
  def hash
256
- [access_key, secret, session_token, storage_url, organization_id, bucket].hash
283
+ [access_key, secret, session_token, storage_url, organization_id, bucket, region].hash
257
284
  end
258
285
 
259
286
  # Builds the object from hash
@@ -0,0 +1,148 @@
1
+ =begin
2
+ #Daytona
3
+
4
+ #Daytona AI platform API Docs
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@daytona.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DaytonaApiClient
17
+ class UpdateLastActivity < ApiModelBase
18
+ # Optional type of interaction that reset the activity timer.
19
+ attr_accessor :activity_type
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'activity_type' => :'activityType'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'activity_type' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::UpdateLastActivity` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::UpdateLastActivity`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'activity_type')
68
+ self.activity_type = attributes[:'activity_type']
69
+ end
70
+ end
71
+
72
+ # Show invalid properties with the reasons. Usually used together with valid?
73
+ # @return Array for valid properties with the reasons
74
+ def list_invalid_properties
75
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
76
+ invalid_properties = Array.new
77
+ invalid_properties
78
+ end
79
+
80
+ # Check to see if the all the properties in the model are valid
81
+ # @return true if the model is valid
82
+ def valid?
83
+ warn '[DEPRECATED] the `valid?` method is obsolete'
84
+ true
85
+ end
86
+
87
+ # Checks equality by comparing each attribute.
88
+ # @param [Object] Object to be compared
89
+ def ==(o)
90
+ return true if self.equal?(o)
91
+ self.class == o.class &&
92
+ activity_type == o.activity_type
93
+ end
94
+
95
+ # @see the `==` method
96
+ # @param [Object] Object to be compared
97
+ def eql?(o)
98
+ self == o
99
+ end
100
+
101
+ # Calculates hash code according to all attributes.
102
+ # @return [Integer] Hash code
103
+ def hash
104
+ [activity_type].hash
105
+ end
106
+
107
+ # Builds the object from hash
108
+ # @param [Hash] attributes Model attributes in the form of hash
109
+ # @return [Object] Returns the model itself
110
+ def self.build_from_hash(attributes)
111
+ return nil unless attributes.is_a?(Hash)
112
+ attributes = attributes.transform_keys(&:to_sym)
113
+ transformed_hash = {}
114
+ openapi_types.each_pair do |key, type|
115
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
116
+ transformed_hash["#{key}"] = nil
117
+ elsif type =~ /\AArray<(.*)>/i
118
+ # check to ensure the input is an array given that the attribute
119
+ # is documented as an array but the input is not
120
+ if attributes[attribute_map[key]].is_a?(Array)
121
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
122
+ end
123
+ elsif !attributes[attribute_map[key]].nil?
124
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
125
+ end
126
+ end
127
+ new(transformed_hash)
128
+ end
129
+
130
+ # Returns the object in the form of hash
131
+ # @return [Hash] Returns the object in the form of hash
132
+ def to_hash
133
+ hash = {}
134
+ self.class.attribute_map.each_pair do |attr, param|
135
+ value = self.send(attr)
136
+ if value.nil?
137
+ is_nullable = self.class.openapi_nullable.include?(attr)
138
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
139
+ end
140
+
141
+ hash[param] = _to_hash(value)
142
+ end
143
+ hash
144
+ end
145
+
146
+ end
147
+
148
+ end
@@ -35,11 +35,14 @@ module DaytonaApiClient
35
35
 
36
36
  attr_accessor :max_disk_per_non_ephemeral_sandbox
37
37
 
38
- attr_accessor :max_cpu_per_gpu_sandbox
38
+ # CPU maximum per requested GPU unit for GPU sandboxes.
39
+ attr_accessor :max_cpu_per_gpu
39
40
 
40
- attr_accessor :max_memory_per_gpu_sandbox
41
+ # Memory maximum per requested GPU unit for GPU sandboxes.
42
+ attr_accessor :max_memory_per_gpu
41
43
 
42
- attr_accessor :max_disk_per_gpu_sandbox
44
+ # Disk maximum per requested GPU unit for GPU sandboxes.
45
+ attr_accessor :max_disk_per_gpu
43
46
 
44
47
  class EnumAttributeValidator
45
48
  attr_reader :datatype
@@ -76,9 +79,9 @@ module DaytonaApiClient
76
79
  :'max_memory_per_sandbox' => :'maxMemoryPerSandbox',
77
80
  :'max_disk_per_sandbox' => :'maxDiskPerSandbox',
78
81
  :'max_disk_per_non_ephemeral_sandbox' => :'maxDiskPerNonEphemeralSandbox',
79
- :'max_cpu_per_gpu_sandbox' => :'maxCpuPerGpuSandbox',
80
- :'max_memory_per_gpu_sandbox' => :'maxMemoryPerGpuSandbox',
81
- :'max_disk_per_gpu_sandbox' => :'maxDiskPerGpuSandbox'
82
+ :'max_cpu_per_gpu' => :'maxCpuPerGpu',
83
+ :'max_memory_per_gpu' => :'maxMemoryPerGpu',
84
+ :'max_disk_per_gpu' => :'maxDiskPerGpu'
82
85
  }
83
86
  end
84
87
 
@@ -105,9 +108,9 @@ module DaytonaApiClient
105
108
  :'max_memory_per_sandbox' => :'Float',
106
109
  :'max_disk_per_sandbox' => :'Float',
107
110
  :'max_disk_per_non_ephemeral_sandbox' => :'Float',
108
- :'max_cpu_per_gpu_sandbox' => :'Float',
109
- :'max_memory_per_gpu_sandbox' => :'Float',
110
- :'max_disk_per_gpu_sandbox' => :'Float'
111
+ :'max_cpu_per_gpu' => :'Float',
112
+ :'max_memory_per_gpu' => :'Float',
113
+ :'max_disk_per_gpu' => :'Float'
111
114
  }
112
115
  end
113
116
 
@@ -123,9 +126,9 @@ module DaytonaApiClient
123
126
  :'max_memory_per_sandbox',
124
127
  :'max_disk_per_sandbox',
125
128
  :'max_disk_per_non_ephemeral_sandbox',
126
- :'max_cpu_per_gpu_sandbox',
127
- :'max_memory_per_gpu_sandbox',
128
- :'max_disk_per_gpu_sandbox'
129
+ :'max_cpu_per_gpu',
130
+ :'max_memory_per_gpu',
131
+ :'max_disk_per_gpu'
129
132
  ])
130
133
  end
131
134
 
@@ -195,16 +198,16 @@ module DaytonaApiClient
195
198
  self.max_disk_per_non_ephemeral_sandbox = attributes[:'max_disk_per_non_ephemeral_sandbox']
196
199
  end
197
200
 
198
- if attributes.key?(:'max_cpu_per_gpu_sandbox')
199
- self.max_cpu_per_gpu_sandbox = attributes[:'max_cpu_per_gpu_sandbox']
201
+ if attributes.key?(:'max_cpu_per_gpu')
202
+ self.max_cpu_per_gpu = attributes[:'max_cpu_per_gpu']
200
203
  end
201
204
 
202
- if attributes.key?(:'max_memory_per_gpu_sandbox')
203
- self.max_memory_per_gpu_sandbox = attributes[:'max_memory_per_gpu_sandbox']
205
+ if attributes.key?(:'max_memory_per_gpu')
206
+ self.max_memory_per_gpu = attributes[:'max_memory_per_gpu']
204
207
  end
205
208
 
206
- if attributes.key?(:'max_disk_per_gpu_sandbox')
207
- self.max_disk_per_gpu_sandbox = attributes[:'max_disk_per_gpu_sandbox']
209
+ if attributes.key?(:'max_disk_per_gpu')
210
+ self.max_disk_per_gpu = attributes[:'max_disk_per_gpu']
208
211
  end
209
212
  end
210
213
 
@@ -238,9 +241,9 @@ module DaytonaApiClient
238
241
  max_memory_per_sandbox == o.max_memory_per_sandbox &&
239
242
  max_disk_per_sandbox == o.max_disk_per_sandbox &&
240
243
  max_disk_per_non_ephemeral_sandbox == o.max_disk_per_non_ephemeral_sandbox &&
241
- max_cpu_per_gpu_sandbox == o.max_cpu_per_gpu_sandbox &&
242
- max_memory_per_gpu_sandbox == o.max_memory_per_gpu_sandbox &&
243
- max_disk_per_gpu_sandbox == o.max_disk_per_gpu_sandbox
244
+ max_cpu_per_gpu == o.max_cpu_per_gpu &&
245
+ max_memory_per_gpu == o.max_memory_per_gpu &&
246
+ max_disk_per_gpu == o.max_disk_per_gpu
244
247
  end
245
248
 
246
249
  # @see the `==` method
@@ -252,7 +255,7 @@ module DaytonaApiClient
252
255
  # Calculates hash code according to all attributes.
253
256
  # @return [Integer] Hash code
254
257
  def hash
255
- [sandbox_class, total_cpu_quota, total_memory_quota, total_disk_quota, total_gpu_quota, allowed_gpu_types, max_cpu_per_sandbox, max_memory_per_sandbox, max_disk_per_sandbox, max_disk_per_non_ephemeral_sandbox, max_cpu_per_gpu_sandbox, max_memory_per_gpu_sandbox, max_disk_per_gpu_sandbox].hash
258
+ [sandbox_class, total_cpu_quota, total_memory_quota, total_disk_quota, total_gpu_quota, allowed_gpu_types, max_cpu_per_sandbox, max_memory_per_sandbox, max_disk_per_sandbox, max_disk_per_non_ephemeral_sandbox, max_cpu_per_gpu, max_memory_per_gpu, max_disk_per_gpu].hash
256
259
  end
257
260
 
258
261
  # Builds the object from hash
@@ -0,0 +1,174 @@
1
+ =begin
2
+ #Daytona
3
+
4
+ #Daytona AI platform API Docs
5
+
6
+ The version of the OpenAPI document: 1.0
7
+ Contact: support@daytona.com
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.21.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module DaytonaApiClient
17
+ class UpdateWarmPool < ApiModelBase
18
+ # New desired number of warm sandboxes (0 drains the pool)
19
+ attr_accessor :pool
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'pool' => :'pool'
25
+ }
26
+ end
27
+
28
+ # Returns attribute mapping this model knows about
29
+ def self.acceptable_attribute_map
30
+ attribute_map
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ acceptable_attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'pool' => :'Float'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::UpdateWarmPool` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ acceptable_attribute_map = self.class.acceptable_attribute_map
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!acceptable_attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `DaytonaApiClient::UpdateWarmPool`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'pool')
68
+ self.pool = attributes[:'pool']
69
+ else
70
+ self.pool = nil
71
+ end
72
+ end
73
+
74
+ # Show invalid properties with the reasons. Usually used together with valid?
75
+ # @return Array for valid properties with the reasons
76
+ def list_invalid_properties
77
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
78
+ invalid_properties = Array.new
79
+ if @pool.nil?
80
+ invalid_properties.push('invalid value for "pool", pool cannot be nil.')
81
+ end
82
+
83
+ if @pool < 0
84
+ invalid_properties.push('invalid value for "pool", must be greater than or equal to 0.')
85
+ end
86
+
87
+ invalid_properties
88
+ end
89
+
90
+ # Check to see if the all the properties in the model are valid
91
+ # @return true if the model is valid
92
+ def valid?
93
+ warn '[DEPRECATED] the `valid?` method is obsolete'
94
+ return false if @pool.nil?
95
+ return false if @pool < 0
96
+ true
97
+ end
98
+
99
+ # Custom attribute writer method with validation
100
+ # @param [Object] pool Value to be assigned
101
+ def pool=(pool)
102
+ if pool.nil?
103
+ fail ArgumentError, 'pool cannot be nil'
104
+ end
105
+
106
+ if pool < 0
107
+ fail ArgumentError, 'invalid value for "pool", must be greater than or equal to 0.'
108
+ end
109
+
110
+ @pool = pool
111
+ end
112
+
113
+ # Checks equality by comparing each attribute.
114
+ # @param [Object] Object to be compared
115
+ def ==(o)
116
+ return true if self.equal?(o)
117
+ self.class == o.class &&
118
+ pool == o.pool
119
+ end
120
+
121
+ # @see the `==` method
122
+ # @param [Object] Object to be compared
123
+ def eql?(o)
124
+ self == o
125
+ end
126
+
127
+ # Calculates hash code according to all attributes.
128
+ # @return [Integer] Hash code
129
+ def hash
130
+ [pool].hash
131
+ end
132
+
133
+ # Builds the object from hash
134
+ # @param [Hash] attributes Model attributes in the form of hash
135
+ # @return [Object] Returns the model itself
136
+ def self.build_from_hash(attributes)
137
+ return nil unless attributes.is_a?(Hash)
138
+ attributes = attributes.transform_keys(&:to_sym)
139
+ transformed_hash = {}
140
+ openapi_types.each_pair do |key, type|
141
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = nil
143
+ elsif type =~ /\AArray<(.*)>/i
144
+ # check to ensure the input is an array given that the attribute
145
+ # is documented as an array but the input is not
146
+ if attributes[attribute_map[key]].is_a?(Array)
147
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
148
+ end
149
+ elsif !attributes[attribute_map[key]].nil?
150
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
151
+ end
152
+ end
153
+ new(transformed_hash)
154
+ end
155
+
156
+ # Returns the object in the form of hash
157
+ # @return [Hash] Returns the object in the form of hash
158
+ def to_hash
159
+ hash = {}
160
+ self.class.attribute_map.each_pair do |attr, param|
161
+ value = self.send(attr)
162
+ if value.nil?
163
+ is_nullable = self.class.openapi_nullable.include?(attr)
164
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
165
+ end
166
+
167
+ hash[param] = _to_hash(value)
168
+ end
169
+ hash
170
+ end
171
+
172
+ end
173
+
174
+ end