Class: Appwrite::Models::DatabaseStatus

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(health:, ready:, engine:, version:, uptime:, connections:, sync_mode:, effective_sync_mode:, sync_degraded:, sync_acknowledgements:, sync_standby_count:, sync_state_confirmed:, replicas:, volumes:) ⇒ DatabaseStatus

Returns a new instance of DatabaseStatus.



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
49
50
51
# File 'lib/appwrite/models/database_status.rb', line 21

def initialize(
    health:,
    ready:,
    engine:,
    version:,
    uptime:,
    connections:,
    sync_mode:,
    effective_sync_mode: ,
    sync_degraded:,
    sync_acknowledgements:,
    sync_standby_count:,
    sync_state_confirmed: ,
    replicas:,
    volumes:
)
    @health = health
    @ready = ready
    @engine = engine
    @version = version
    @uptime = uptime
    @connections = connections
    @sync_mode = sync_mode
    @effective_sync_mode = effective_sync_mode
    @sync_degraded = sync_degraded
    @sync_acknowledgements = sync_acknowledgements
    @sync_standby_count = sync_standby_count
    @sync_state_confirmed = sync_state_confirmed
    @replicas = replicas
    @volumes = volumes
end

Instance Attribute Details

#connectionsObject (readonly)

Returns the value of attribute connections.



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

def connections
  @connections
end

#effective_sync_modeObject (readonly)

Returns the value of attribute effective_sync_mode.



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

def effective_sync_mode
  @effective_sync_mode
end

#engineObject (readonly)

Returns the value of attribute engine.



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

def engine
  @engine
end

#healthObject (readonly)

Returns the value of attribute health.



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

def health
  @health
end

#readyObject (readonly)

Returns the value of attribute ready.



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

def ready
  @ready
end

#replicasObject (readonly)

Returns the value of attribute replicas.



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

def replicas
  @replicas
end

#sync_acknowledgementsObject (readonly)

Returns the value of attribute sync_acknowledgements.



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

def sync_acknowledgements
  @sync_acknowledgements
end

#sync_degradedObject (readonly)

Returns the value of attribute sync_degraded.



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

def sync_degraded
  @sync_degraded
end

#sync_modeObject (readonly)

Returns the value of attribute sync_mode.



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

def sync_mode
  @sync_mode
end

#sync_standby_countObject (readonly)

Returns the value of attribute sync_standby_count.



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

def sync_standby_count
  @sync_standby_count
end

#sync_state_confirmedObject (readonly)

Returns the value of attribute sync_state_confirmed.



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

def sync_state_confirmed
  @sync_state_confirmed
end

#uptimeObject (readonly)

Returns the value of attribute uptime.



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

def uptime
  @uptime
end

#versionObject (readonly)

Returns the value of attribute version.



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

def version
  @version
end

#volumesObject (readonly)

Returns the value of attribute volumes.



19
20
21
# File 'lib/appwrite/models/database_status.rb', line 19

def volumes
  @volumes
end

Class Method Details

.from(map:) ⇒ Object



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/appwrite/models/database_status.rb', line 53

def self.from(map:)
    DatabaseStatus.new(
        health: map["health"],
        ready: map["ready"],
        engine: map["engine"],
        version: map["version"],
        uptime: map["uptime"],
        connections: DatabaseStatusConnections.from(map: map["connections"]),
        sync_mode: map["syncMode"],
        effective_sync_mode: map["effectiveSyncMode"],
        sync_degraded: map["syncDegraded"],
        sync_acknowledgements: map["syncAcknowledgements"],
        sync_standby_count: map["syncStandbyCount"],
        sync_state_confirmed: map["syncStateConfirmed"],
        replicas: map["replicas"].map { |it| DatabaseStatusReplica.from(map: it) },
        volumes: map["volumes"].map { |it| DatabaseStatusVolume.from(map: it) }
    )
end

Instance Method Details

#to_mapObject



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/appwrite/models/database_status.rb', line 72

def to_map
    {
        "health": @health,
        "ready": @ready,
        "engine": @engine,
        "version": @version,
        "uptime": @uptime,
        "connections": @connections.to_map,
        "syncMode": @sync_mode,
        "effectiveSyncMode": @effective_sync_mode,
        "syncDegraded": @sync_degraded,
        "syncAcknowledgements": @sync_acknowledgements,
        "syncStandbyCount": @sync_standby_count,
        "syncStateConfirmed": @sync_state_confirmed,
        "replicas": @replicas.map { |it| it.to_map },
        "volumes": @volumes.map { |it| it.to_map }
    }
end