Class: Appwrite::Models::DedicatedDatabaseSpecification

Inherits:
Object
  • Object
show all
Defined in:
lib/appwrite/models/dedicated_database_specification.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(slug:, name:, price:, storage_overage_rate:, bandwidth_overage_rate:, replica_rate:, pitr_rate:, cpu:, memory:, max_connections:, included_storage:, included_bandwidth:, enabled:) ⇒ DedicatedDatabaseSpecification

Returns a new instance of DedicatedDatabaseSpecification.



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 20

def initialize(
    slug:,
    name:,
    price:,
    storage_overage_rate:,
    bandwidth_overage_rate:,
    replica_rate:,
    pitr_rate:,
    cpu:,
    memory:,
    max_connections:,
    included_storage:,
    included_bandwidth:,
    enabled:
)
    @slug = slug
    @name = name
    @price = price
    @storage_overage_rate = storage_overage_rate
    @bandwidth_overage_rate = bandwidth_overage_rate
    @replica_rate = replica_rate
    @pitr_rate = pitr_rate
    @cpu = cpu
    @memory = memory
    @max_connections = max_connections
    @included_storage = included_storage
    @included_bandwidth = included_bandwidth
    @enabled = enabled
end

Instance Attribute Details

#bandwidth_overage_rate ⇒ Object (readonly)

Returns the value of attribute bandwidth_overage_rate.



10
11
12
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 10

def bandwidth_overage_rate
  @bandwidth_overage_rate
end

#cpu ⇒ Object (readonly)

Returns the value of attribute cpu.



13
14
15
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 13

def cpu
  @cpu
end

#enabled ⇒ Object (readonly)

Returns the value of attribute enabled.



18
19
20
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 18

def enabled
  @enabled
end

#included_bandwidth ⇒ Object (readonly)

Returns the value of attribute included_bandwidth.



17
18
19
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 17

def included_bandwidth
  @included_bandwidth
end

#included_storage ⇒ Object (readonly)

Returns the value of attribute included_storage.



16
17
18
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 16

def included_storage
  @included_storage
end

#max_connections ⇒ Object (readonly)

Returns the value of attribute max_connections.



15
16
17
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 15

def max_connections
  @max_connections
end

#memory ⇒ Object (readonly)

Returns the value of attribute memory.



14
15
16
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 14

def memory
  @memory
end

#name ⇒ Object (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 7

def name
  @name
end

#pitr_rate ⇒ Object (readonly)

Returns the value of attribute pitr_rate.



12
13
14
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 12

def pitr_rate
  @pitr_rate
end

#price ⇒ Object (readonly)

Returns the value of attribute price.



8
9
10
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 8

def price
  @price
end

#replica_rate ⇒ Object (readonly)

Returns the value of attribute replica_rate.



11
12
13
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 11

def replica_rate
  @replica_rate
end

#slug ⇒ Object (readonly)

Returns the value of attribute slug.



6
7
8
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 6

def slug
  @slug
end

#storage_overage_rate ⇒ Object (readonly)

Returns the value of attribute storage_overage_rate.



9
10
11
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 9

def storage_overage_rate
  @storage_overage_rate
end

Class Method Details

.from(map:) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 50

def self.from(map:)
    map = { "slug" => "", "name" => "", "price" => 0, "storageOverageRate" => 0, "bandwidthOverageRate" => 0, "replicaRate" => 0, "pitrRate" => 0, "cpu" => 0, "memory" => 0, "maxConnections" => 0, "includedStorage" => 0, "includedBandwidth" => 0, "enabled" => false }.merge(map)
    DedicatedDatabaseSpecification.new(
        slug: map["slug"],
        name: map["name"],
        price: map["price"],
        storage_overage_rate: map["storageOverageRate"],
        bandwidth_overage_rate: map["bandwidthOverageRate"],
        replica_rate: map["replicaRate"],
        pitr_rate: map["pitrRate"],
        cpu: map["cpu"],
        memory: map["memory"],
        max_connections: map["maxConnections"],
        included_storage: map["includedStorage"],
        included_bandwidth: map["includedBandwidth"],
        enabled: map["enabled"]
    )
end

Instance Method Details

#to_map ⇒ Object



69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/appwrite/models/dedicated_database_specification.rb', line 69

def to_map
    {
        "slug": @slug,
        "name": @name,
        "price": @price,
        "storageOverageRate": @storage_overage_rate,
        "bandwidthOverageRate": @bandwidth_overage_rate,
        "replicaRate": @replica_rate,
        "pitrRate": @pitr_rate,
        "cpu": @cpu,
        "memory": @memory,
        "maxConnections": @max_connections,
        "includedStorage": @included_storage,
        "includedBandwidth": @included_bandwidth,
        "enabled": @enabled
    }
end