Class: Appwrite::Models::DatabaseStatusReplica

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(index:, role:, healthy:, lag_seconds:) ⇒ DatabaseStatusReplica

Returns a new instance of DatabaseStatusReplica.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/appwrite/models/database_status_replica.rb', line 11

def initialize(
    index:,
    role:,
    healthy:,
    lag_seconds: 
)
    @index = index
    @role = role
    @healthy = healthy
    @lag_seconds = lag_seconds
end

Instance Attribute Details

#healthyObject (readonly)

Returns the value of attribute healthy.



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

def healthy
  @healthy
end

#indexObject (readonly)

Returns the value of attribute index.



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

def index
  @index
end

#lag_secondsObject (readonly)

Returns the value of attribute lag_seconds.



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

def lag_seconds
  @lag_seconds
end

#roleObject (readonly)

Returns the value of attribute role.



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

def role
  @role
end

Class Method Details

.from(map:) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/appwrite/models/database_status_replica.rb', line 23

def self.from(map:)
    DatabaseStatusReplica.new(
        index: map["index"],
        role: map["role"],
        healthy: map["healthy"],
        lag_seconds: map["lagSeconds"]
    )
end

Instance Method Details

#to_mapObject



32
33
34
35
36
37
38
39
# File 'lib/appwrite/models/database_status_replica.rb', line 32

def to_map
    {
        "index": @index,
        "role": @role,
        "healthy": @healthy,
        "lagSeconds": @lag_seconds
    }
end