Class: Appwrite::Models::DedicatedDatabaseBackup

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, database_id:, project_id:, policy_id:, trigger:, type:, requested_type:, fallback_reason:, status:, size_bytes:, started_at: nil, completed_at: nil, verified_at: nil, expires_at: nil, log_position: nil, error:) ⇒ DedicatedDatabaseBackup

Returns a new instance of DedicatedDatabaseBackup.



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
52
53
54
55
56
57
58
59
60
# File 'lib/appwrite/models/dedicated_database_backup.rb', line 24

def initialize(
    id:,
    created_at:,
    database_id:,
    project_id:,
    policy_id:,
    trigger:,
    type:,
    requested_type:,
    fallback_reason:,
    status:,
    size_bytes:,
    started_at: nil,
    completed_at: nil,
    verified_at: nil,
    expires_at: nil,
    log_position: nil,
    error:
)
    @id = id
    @created_at = created_at
    @database_id = database_id
    @project_id = project_id
    @policy_id = policy_id
    @trigger = trigger
    @type = type
    @requested_type = requested_type
    @fallback_reason = fallback_reason
    @status = status
    @size_bytes = size_bytes
    @started_at = started_at
    @completed_at = completed_at
    @verified_at = verified_at
    @expires_at = expires_at
    @log_position = log_position
    @error = error
end

Instance Attribute Details

#completed_at ⇒ Object (readonly)

Returns the value of attribute completed_at.



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

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_backup.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_backup.rb', line 8

def database_id
  @database_id
end

#error ⇒ Object (readonly)

Returns the value of attribute error.



22
23
24
# File 'lib/appwrite/models/dedicated_database_backup.rb', line 22

def error
  @error
end

#expires_at ⇒ Object (readonly)

Returns the value of attribute expires_at.



20
21
22
# File 'lib/appwrite/models/dedicated_database_backup.rb', line 20

def expires_at
  @expires_at
end

#fallback_reason ⇒ Object (readonly)

Returns the value of attribute fallback_reason.



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

def fallback_reason
  @fallback_reason
end

#id ⇒ Object (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#log_position ⇒ Object (readonly)

Returns the value of attribute log_position.



21
22
23
# File 'lib/appwrite/models/dedicated_database_backup.rb', line 21

def log_position
  @log_position
end

#policy_id ⇒ Object (readonly)

Returns the value of attribute policy_id.



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

def policy_id
  @policy_id
end

#project_id ⇒ Object (readonly)

Returns the value of attribute project_id.



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

def project_id
  @project_id
end

#requested_type ⇒ Object (readonly)

Returns the value of attribute requested_type.



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

def requested_type
  @requested_type
end

#size_bytes ⇒ Object (readonly)

Returns the value of attribute size_bytes.



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

def size_bytes
  @size_bytes
end

#started_at ⇒ Object (readonly)

Returns the value of attribute started_at.



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

def started_at
  @started_at
end

#status ⇒ Object (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#trigger ⇒ Object (readonly)

Returns the value of attribute trigger.



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

def trigger
  @trigger
end

#type ⇒ Object (readonly)

Returns the value of attribute type.



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

def type
  @type
end

#verified_at ⇒ Object (readonly)

Returns the value of attribute verified_at.



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

def verified_at
  @verified_at
end

Class Method Details

.from(map:) ⇒ Object



62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/appwrite/models/dedicated_database_backup.rb', line 62

def self.from(map:)
    map = { "$id" => "", "$createdAt" => "", "databaseId" => "", "projectId" => "", "policyId" => "", "trigger" => "manual", "type" => "full", "requestedType" => "", "fallbackReason" => "", "status" => "pending", "sizeBytes" => 0, "error" => "" }.merge(map)
    DedicatedDatabaseBackup.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        database_id: map["databaseId"],
        project_id: map["projectId"],
        policy_id: map["policyId"],
        trigger: map["trigger"],
        type: map["type"],
        requested_type: map["requestedType"],
        fallback_reason: map["fallbackReason"],
        status: map["status"],
        size_bytes: map["sizeBytes"],
        started_at: map["startedAt"],
        completed_at: map["completedAt"],
        verified_at: map["verifiedAt"],
        expires_at: map["expiresAt"],
        log_position: map["logPosition"],
        error: map["error"]
    )
end

Instance Method Details

#to_map ⇒ Object



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/appwrite/models/dedicated_database_backup.rb', line 85

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "databaseId": @database_id,
        "projectId": @project_id,
        "policyId": @policy_id,
        "trigger": @trigger,
        "type": @type,
        "requestedType": @requested_type,
        "fallbackReason": @fallback_reason,
        "status": @status,
        "sizeBytes": @size_bytes,
        "startedAt": @started_at,
        "completedAt": @completed_at,
        "verifiedAt": @verified_at,
        "expiresAt": @expires_at,
        "logPosition": @log_position,
        "error": @error
    }
end