Class: Appwrite::Models::DedicatedDatabaseBranch

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(branch_id:, branch_name:, namespace:, expires_at:, host:, port: nil, database:, username:, password:, ssl:, engine:, connection_string:) ⇒ DedicatedDatabaseBranch

Returns a new instance of DedicatedDatabaseBranch.



19
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
# File 'lib/appwrite/models/dedicated_database_branch.rb', line 19

def initialize(
    branch_id:,
    branch_name:,
    namespace:,
    expires_at:,
    host:,
    port: nil,
    database:,
    username:,
    password:,
    ssl:,
    engine:,
    connection_string:
)
    @branch_id = branch_id
    @branch_name = branch_name
    @namespace = namespace
    @expires_at = expires_at
    @host = host
    @port = port
    @database = database
    @username = username
    @password = password
    @ssl = ssl
    @engine = engine
    @connection_string = connection_string
end

Instance Attribute Details

#branch_id ⇒ Object (readonly)

Returns the value of attribute branch_id.



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

def branch_id
  @branch_id
end

#branch_name ⇒ Object (readonly)

Returns the value of attribute branch_name.



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

def branch_name
  @branch_name
end

#connection_string ⇒ Object (readonly)

Returns the value of attribute connection_string.



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

def connection_string
  @connection_string
end

#database ⇒ Object (readonly)

Returns the value of attribute database.



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

def database
  @database
end

#engine ⇒ Object (readonly)

Returns the value of attribute engine.



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

def engine
  @engine
end

#expires_at ⇒ Object (readonly)

Returns the value of attribute expires_at.



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

def expires_at
  @expires_at
end

#host ⇒ Object (readonly)

Returns the value of attribute host.



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

def host
  @host
end

#namespace ⇒ Object (readonly)

Returns the value of attribute namespace.



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

def namespace
  @namespace
end

#password ⇒ Object (readonly)

Returns the value of attribute password.



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

def password
  @password
end

#port ⇒ Object (readonly)

Returns the value of attribute port.



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

def port
  @port
end

#ssl ⇒ Object (readonly)

Returns the value of attribute ssl.



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

def ssl
  @ssl
end

#username ⇒ Object (readonly)

Returns the value of attribute username.



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

def username
  @username
end

Class Method Details

.from(map:) ⇒ Object



47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/appwrite/models/dedicated_database_branch.rb', line 47

def self.from(map:)
    map = { "branchId" => "", "branchName" => "", "namespace" => "", "expiresAt" => 0, "host" => "", "database" => "", "username" => "", "password" => "", "ssl" => false, "engine" => "", "connectionString" => "" }.merge(map)
    DedicatedDatabaseBranch.new(
        branch_id: map["branchId"],
        branch_name: map["branchName"],
        namespace: map["namespace"],
        expires_at: map["expiresAt"],
        host: map["host"],
        port: map["port"],
        database: map["database"],
        username: map["username"],
        password: map["password"],
        ssl: map["ssl"],
        engine: map["engine"],
        connection_string: map["connectionString"]
    )
end

Instance Method Details

#to_map ⇒ Object



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# File 'lib/appwrite/models/dedicated_database_branch.rb', line 65

def to_map
    {
        "branchId": @branch_id,
        "branchName": @branch_name,
        "namespace": @namespace,
        "expiresAt": @expires_at,
        "host": @host,
        "port": @port,
        "database": @database,
        "username": @username,
        "password": @password,
        "ssl": @ssl,
        "engine": @engine,
        "connectionString": @connection_string
    }
end