Class: Appwrite::Models::DedicatedDatabaseRestoration

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, database_id:, source_database_id: nil, project_id:, backup_id: nil, type:, restore_mode:, status:, target_time: nil, started_at: nil, completed_at: nil, error:) ⇒ DedicatedDatabaseRestoration

Returns a new instance of DedicatedDatabaseRestoration.



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_restoration.rb', line 20

def initialize(
    id:,
    created_at:,
    database_id:,
    source_database_id: nil,
    project_id:,
    backup_id: nil,
    type:,
    restore_mode:,
    status:,
    target_time: nil,
    started_at: nil,
    completed_at: nil,
    error:
)
    @id = id
    @created_at = created_at
    @database_id = database_id
    @source_database_id = source_database_id
    @project_id = project_id
    @backup_id = backup_id
    @type = type
    @restore_mode = restore_mode
    @status = status
    @target_time = target_time
    @started_at = started_at
    @completed_at = completed_at
    @error = error
end

Instance Attribute Details

#backup_id ⇒ Object (readonly)

Returns the value of attribute backup_id.



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

def backup_id
  @backup_id
end

#completed_at ⇒ Object (readonly)

Returns the value of attribute completed_at.



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

def completed_at
  @completed_at
end

#created_at ⇒ Object (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#database_id ⇒ Object (readonly)

Returns the value of attribute database_id.



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

def database_id
  @database_id
end

#error ⇒ Object (readonly)

Returns the value of attribute error.



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

def error
  @error
end

#id ⇒ Object (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#project_id ⇒ Object (readonly)

Returns the value of attribute project_id.



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

def project_id
  @project_id
end

#restore_mode ⇒ Object (readonly)

Returns the value of attribute restore_mode.



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

def restore_mode
  @restore_mode
end

#source_database_id ⇒ Object (readonly)

Returns the value of attribute source_database_id.



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

def source_database_id
  @source_database_id
end

#started_at ⇒ Object (readonly)

Returns the value of attribute started_at.



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

def started_at
  @started_at
end

#status ⇒ Object (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#target_time ⇒ Object (readonly)

Returns the value of attribute target_time.



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

def target_time
  @target_time
end

#type ⇒ Object (readonly)

Returns the value of attribute type.



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

def type
  @type
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_restoration.rb', line 50

def self.from(map:)
    map = { "$id" => "", "$createdAt" => "", "databaseId" => "", "projectId" => "", "type" => "backup", "restoreMode" => "in_place", "status" => "pending", "error" => "" }.merge(map)
    DedicatedDatabaseRestoration.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        database_id: map["databaseId"],
        source_database_id: map["sourceDatabaseId"],
        project_id: map["projectId"],
        backup_id: map["backupId"],
        type: map["type"],
        restore_mode: map["restoreMode"],
        status: map["status"],
        target_time: map["targetTime"],
        started_at: map["startedAt"],
        completed_at: map["completedAt"],
        error: map["error"]
    )
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_restoration.rb', line 69

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "databaseId": @database_id,
        "sourceDatabaseId": @source_database_id,
        "projectId": @project_id,
        "backupId": @backup_id,
        "type": @type,
        "restoreMode": @restore_mode,
        "status": @status,
        "targetTime": @target_time,
        "startedAt": @started_at,
        "completedAt": @completed_at,
        "error": @error
    }
end