Class: DaytonaApiClient::Organization
- Inherits:
-
Object
- Object
- DaytonaApiClient::Organization
- Defined in:
- lib/daytona_api_client/models/organization.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Creation timestamp.
-
#created_by ⇒ Object
User ID of the organization creator.
-
#id ⇒ Object
Organization ID.
-
#max_cpu_per_sandbox ⇒ Object
Max CPU per sandbox.
-
#max_disk_per_sandbox ⇒ Object
Max disk per sandbox.
-
#max_memory_per_sandbox ⇒ Object
Max memory per sandbox.
-
#name ⇒ Object
Organization name.
-
#personal ⇒ Object
Personal organization flag.
-
#sandbox_limited_network_egress ⇒ Object
Sandbox default network block all.
-
#suspended ⇒ Object
Suspended flag.
-
#suspended_at ⇒ Object
Suspended at.
-
#suspended_until ⇒ Object
Suspended until.
-
#suspension_cleanup_grace_period_hours ⇒ Object
Suspension cleanup grace period hours.
-
#suspension_reason ⇒ Object
Suspended reason.
-
#total_cpu_quota ⇒ Object
Total CPU quota.
-
#total_disk_quota ⇒ Object
Total disk quota.
-
#total_memory_quota ⇒ Object
Total memory quota.
-
#updated_at ⇒ Object
Last update timestamp.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attribute_map ⇒ Object
Returns attribute mapping this model knows about.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Organization
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Organization
Initializes the object
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 219 220 221 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 |
# File 'lib/daytona_api_client/models/organization.rb', line 138 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `DaytonaApiClient::Organization` 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::Organization`. 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?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'created_by') self.created_by = attributes[:'created_by'] else self.created_by = nil end if attributes.key?(:'personal') self.personal = attributes[:'personal'] else self.personal = nil end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] else self.created_at = nil end if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] else self.updated_at = nil end if attributes.key?(:'suspended') self.suspended = attributes[:'suspended'] else self.suspended = nil end if attributes.key?(:'suspended_at') self.suspended_at = attributes[:'suspended_at'] else self.suspended_at = nil end if attributes.key?(:'suspension_reason') self.suspension_reason = attributes[:'suspension_reason'] else self.suspension_reason = nil end if attributes.key?(:'suspended_until') self.suspended_until = attributes[:'suspended_until'] else self.suspended_until = nil end if attributes.key?(:'suspension_cleanup_grace_period_hours') self.suspension_cleanup_grace_period_hours = attributes[:'suspension_cleanup_grace_period_hours'] else self.suspension_cleanup_grace_period_hours = nil end if attributes.key?(:'total_cpu_quota') self.total_cpu_quota = attributes[:'total_cpu_quota'] else self.total_cpu_quota = nil end if attributes.key?(:'total_memory_quota') self.total_memory_quota = attributes[:'total_memory_quota'] else self.total_memory_quota = nil end if attributes.key?(:'total_disk_quota') self.total_disk_quota = attributes[:'total_disk_quota'] else self.total_disk_quota = nil end if attributes.key?(:'max_cpu_per_sandbox') self.max_cpu_per_sandbox = attributes[:'max_cpu_per_sandbox'] else self.max_cpu_per_sandbox = nil end if attributes.key?(:'max_memory_per_sandbox') self.max_memory_per_sandbox = attributes[:'max_memory_per_sandbox'] else self.max_memory_per_sandbox = nil end if attributes.key?(:'max_disk_per_sandbox') self.max_disk_per_sandbox = attributes[:'max_disk_per_sandbox'] else self.max_disk_per_sandbox = nil end if attributes.key?(:'sandbox_limited_network_egress') self.sandbox_limited_network_egress = attributes[:'sandbox_limited_network_egress'] else self.sandbox_limited_network_egress = nil end end |
Instance Attribute Details
#created_at ⇒ Object
Creation timestamp
31 32 33 |
# File 'lib/daytona_api_client/models/organization.rb', line 31 def created_at @created_at end |
#created_by ⇒ Object
User ID of the organization creator
25 26 27 |
# File 'lib/daytona_api_client/models/organization.rb', line 25 def created_by @created_by end |
#id ⇒ Object
Organization ID
19 20 21 |
# File 'lib/daytona_api_client/models/organization.rb', line 19 def id @id end |
#max_cpu_per_sandbox ⇒ Object
Max CPU per sandbox
61 62 63 |
# File 'lib/daytona_api_client/models/organization.rb', line 61 def max_cpu_per_sandbox @max_cpu_per_sandbox end |
#max_disk_per_sandbox ⇒ Object
Max disk per sandbox
67 68 69 |
# File 'lib/daytona_api_client/models/organization.rb', line 67 def max_disk_per_sandbox @max_disk_per_sandbox end |
#max_memory_per_sandbox ⇒ Object
Max memory per sandbox
64 65 66 |
# File 'lib/daytona_api_client/models/organization.rb', line 64 def max_memory_per_sandbox @max_memory_per_sandbox end |
#name ⇒ Object
Organization name
22 23 24 |
# File 'lib/daytona_api_client/models/organization.rb', line 22 def name @name end |
#personal ⇒ Object
Personal organization flag
28 29 30 |
# File 'lib/daytona_api_client/models/organization.rb', line 28 def personal @personal end |
#sandbox_limited_network_egress ⇒ Object
Sandbox default network block all
70 71 72 |
# File 'lib/daytona_api_client/models/organization.rb', line 70 def sandbox_limited_network_egress @sandbox_limited_network_egress end |
#suspended ⇒ Object
Suspended flag
37 38 39 |
# File 'lib/daytona_api_client/models/organization.rb', line 37 def suspended @suspended end |
#suspended_at ⇒ Object
Suspended at
40 41 42 |
# File 'lib/daytona_api_client/models/organization.rb', line 40 def suspended_at @suspended_at end |
#suspended_until ⇒ Object
Suspended until
46 47 48 |
# File 'lib/daytona_api_client/models/organization.rb', line 46 def suspended_until @suspended_until end |
#suspension_cleanup_grace_period_hours ⇒ Object
Suspension cleanup grace period hours
49 50 51 |
# File 'lib/daytona_api_client/models/organization.rb', line 49 def suspension_cleanup_grace_period_hours @suspension_cleanup_grace_period_hours end |
#suspension_reason ⇒ Object
Suspended reason
43 44 45 |
# File 'lib/daytona_api_client/models/organization.rb', line 43 def suspension_reason @suspension_reason end |
#total_cpu_quota ⇒ Object
Total CPU quota
52 53 54 |
# File 'lib/daytona_api_client/models/organization.rb', line 52 def total_cpu_quota @total_cpu_quota end |
#total_disk_quota ⇒ Object
Total disk quota
58 59 60 |
# File 'lib/daytona_api_client/models/organization.rb', line 58 def total_disk_quota @total_disk_quota end |
#total_memory_quota ⇒ Object
Total memory quota
55 56 57 |
# File 'lib/daytona_api_client/models/organization.rb', line 55 def total_memory_quota @total_memory_quota end |
#updated_at ⇒ Object
Last update timestamp
34 35 36 |
# File 'lib/daytona_api_client/models/organization.rb', line 34 def updated_at @updated_at end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 |
# File 'lib/daytona_api_client/models/organization.rb', line 610 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_map ⇒ Object
Returns attribute mapping this model knows about
97 98 99 |
# File 'lib/daytona_api_client/models/organization.rb', line 97 def self.acceptable_attribute_map attribute_map end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
102 103 104 |
# File 'lib/daytona_api_client/models/organization.rb', line 102 def self.acceptable_attributes acceptable_attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/daytona_api_client/models/organization.rb', line 73 def self.attribute_map { :'id' => :'id', :'name' => :'name', :'created_by' => :'createdBy', :'personal' => :'personal', :'created_at' => :'createdAt', :'updated_at' => :'updatedAt', :'suspended' => :'suspended', :'suspended_at' => :'suspendedAt', :'suspension_reason' => :'suspensionReason', :'suspended_until' => :'suspendedUntil', :'suspension_cleanup_grace_period_hours' => :'suspensionCleanupGracePeriodHours', :'total_cpu_quota' => :'totalCpuQuota', :'total_memory_quota' => :'totalMemoryQuota', :'total_disk_quota' => :'totalDiskQuota', :'max_cpu_per_sandbox' => :'maxCpuPerSandbox', :'max_memory_per_sandbox' => :'maxMemoryPerSandbox', :'max_disk_per_sandbox' => :'maxDiskPerSandbox', :'sandbox_limited_network_egress' => :'sandboxLimitedNetworkEgress' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 |
# File 'lib/daytona_api_client/models/organization.rb', line 586 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_nullable ⇒ Object
List of attributes with nullable: true
131 132 133 134 |
# File 'lib/daytona_api_client/models/organization.rb', line 131 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/daytona_api_client/models/organization.rb', line 107 def self.openapi_types { :'id' => :'String', :'name' => :'String', :'created_by' => :'String', :'personal' => :'Boolean', :'created_at' => :'Time', :'updated_at' => :'Time', :'suspended' => :'Boolean', :'suspended_at' => :'Time', :'suspension_reason' => :'String', :'suspended_until' => :'Time', :'suspension_cleanup_grace_period_hours' => :'Float', :'total_cpu_quota' => :'Float', :'total_memory_quota' => :'Float', :'total_disk_quota' => :'Float', :'max_cpu_per_sandbox' => :'Float', :'max_memory_per_sandbox' => :'Float', :'max_disk_per_sandbox' => :'Float', :'sandbox_limited_network_egress' => :'Boolean' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 |
# File 'lib/daytona_api_client/models/organization.rb', line 548 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && created_by == o.created_by && personal == o.personal && created_at == o.created_at && updated_at == o.updated_at && suspended == o.suspended && suspended_at == o.suspended_at && suspension_reason == o.suspension_reason && suspended_until == o.suspended_until && suspension_cleanup_grace_period_hours == o.suspension_cleanup_grace_period_hours && total_cpu_quota == o.total_cpu_quota && total_memory_quota == o.total_memory_quota && total_disk_quota == o.total_disk_quota && max_cpu_per_sandbox == o.max_cpu_per_sandbox && max_memory_per_sandbox == o.max_memory_per_sandbox && max_disk_per_sandbox == o.max_disk_per_sandbox && sandbox_limited_network_egress == o.sandbox_limited_network_egress end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
681 682 683 684 685 686 687 688 689 690 691 692 693 |
# File 'lib/daytona_api_client/models/organization.rb', line 681 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
573 574 575 |
# File 'lib/daytona_api_client/models/organization.rb', line 573 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
579 580 581 |
# File 'lib/daytona_api_client/models/organization.rb', line 579 def hash [id, name, created_by, personal, created_at, updated_at, suspended, suspended_at, suspension_reason, suspended_until, suspension_cleanup_grace_period_hours, total_cpu_quota, total_memory_quota, total_disk_quota, max_cpu_per_sandbox, max_memory_per_sandbox, max_disk_per_sandbox, sandbox_limited_network_egress].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 |
# File 'lib/daytona_api_client/models/organization.rb', line 263 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @created_by.nil? invalid_properties.push('invalid value for "created_by", created_by cannot be nil.') end if @personal.nil? invalid_properties.push('invalid value for "personal", personal cannot be nil.') end if @created_at.nil? invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') end if @updated_at.nil? invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') end if @suspended.nil? invalid_properties.push('invalid value for "suspended", suspended cannot be nil.') end if @suspended_at.nil? invalid_properties.push('invalid value for "suspended_at", suspended_at cannot be nil.') end if @suspension_reason.nil? invalid_properties.push('invalid value for "suspension_reason", suspension_reason cannot be nil.') end if @suspended_until.nil? invalid_properties.push('invalid value for "suspended_until", suspended_until cannot be nil.') end if @suspension_cleanup_grace_period_hours.nil? invalid_properties.push('invalid value for "suspension_cleanup_grace_period_hours", suspension_cleanup_grace_period_hours cannot be nil.') end if @total_cpu_quota.nil? invalid_properties.push('invalid value for "total_cpu_quota", total_cpu_quota cannot be nil.') end if @total_memory_quota.nil? invalid_properties.push('invalid value for "total_memory_quota", total_memory_quota cannot be nil.') end if @total_disk_quota.nil? invalid_properties.push('invalid value for "total_disk_quota", total_disk_quota cannot be nil.') end if @max_cpu_per_sandbox.nil? invalid_properties.push('invalid value for "max_cpu_per_sandbox", max_cpu_per_sandbox cannot be nil.') end if @max_memory_per_sandbox.nil? invalid_properties.push('invalid value for "max_memory_per_sandbox", max_memory_per_sandbox cannot be nil.') end if @max_disk_per_sandbox.nil? invalid_properties.push('invalid value for "max_disk_per_sandbox", max_disk_per_sandbox cannot be nil.') end if @sandbox_limited_network_egress.nil? invalid_properties.push('invalid value for "sandbox_limited_network_egress", sandbox_limited_network_egress cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
657 658 659 |
# File 'lib/daytona_api_client/models/organization.rb', line 657 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
663 664 665 666 667 668 669 670 671 672 673 674 675 |
# File 'lib/daytona_api_client/models/organization.rb', line 663 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_s ⇒ String
Returns the string representation of the object
651 652 653 |
# File 'lib/daytona_api_client/models/organization.rb', line 651 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 |
# File 'lib/daytona_api_client/models/organization.rb', line 343 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @name.nil? return false if @created_by.nil? return false if @personal.nil? return false if @created_at.nil? return false if @updated_at.nil? return false if @suspended.nil? return false if @suspended_at.nil? return false if @suspension_reason.nil? return false if @suspended_until.nil? return false if @suspension_cleanup_grace_period_hours.nil? return false if @total_cpu_quota.nil? return false if @total_memory_quota.nil? return false if @total_disk_quota.nil? return false if @max_cpu_per_sandbox.nil? return false if @max_memory_per_sandbox.nil? return false if @max_disk_per_sandbox.nil? return false if @sandbox_limited_network_egress.nil? true end |