Class: Appwrite::Models::Bucket

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, created_at:, updated_at:, read:, write:, permission:, name:, enabled:, maximum_file_size:, allowed_file_extensions:, encryption:, antivirus:) ⇒ Bucket

Returns a new instance of Bucket.



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/bucket.rb', line 19

def initialize(
    id:,
    created_at:,
    updated_at:,
    read:,
    write:,
    permission:,
    name:,
    enabled:,
    maximum_file_size:,
    allowed_file_extensions:,
    encryption:,
    antivirus:
)
    @id = id
    @created_at = created_at
    @updated_at = updated_at
    @read = read
    @write = write
    @permission = permission
    @name = name
    @enabled = enabled
    @maximum_file_size = maximum_file_size
    @allowed_file_extensions = allowed_file_extensions
    @encryption = encryption
    @antivirus = antivirus
end

Instance Attribute Details

#allowed_file_extensionsObject (readonly)

Returns the value of attribute allowed_file_extensions.



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

def allowed_file_extensions
  @allowed_file_extensions
end

#antivirusObject (readonly)

Returns the value of attribute antivirus.



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

def antivirus
  @antivirus
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#enabledObject (readonly)

Returns the value of attribute enabled.



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

def enabled
  @enabled
end

#encryptionObject (readonly)

Returns the value of attribute encryption.



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

def encryption
  @encryption
end

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#maximum_file_sizeObject (readonly)

Returns the value of attribute maximum_file_size.



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

def maximum_file_size
  @maximum_file_size
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#permissionObject (readonly)

Returns the value of attribute permission.



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

def permission
  @permission
end

#readObject (readonly)

Returns the value of attribute read.



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

def read
  @read
end

#updated_atObject (readonly)

Returns the value of attribute updated_at.



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

def updated_at
  @updated_at
end

#writeObject (readonly)

Returns the value of attribute write.



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

def write
  @write
end

Class Method Details

.from(map:) ⇒ Object



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

def self.from(map:)
    Bucket.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        updated_at: map["$updatedAt"],
        read: map["$read"],
        write: map["$write"],
        permission: map["permission"],
        name: map["name"],
        enabled: map["enabled"],
        maximum_file_size: map["maximumFileSize"],
        allowed_file_extensions: map["allowedFileExtensions"],
        encryption: map["encryption"],
        antivirus: map["antivirus"]
    )
end

Instance Method Details

#to_mapObject



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

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "$updatedAt": @updated_at,
        "$read": @read,
        "$write": @write,
        "permission": @permission,
        "name": @name,
        "enabled": @enabled,
        "maximumFileSize": @maximum_file_size,
        "allowedFileExtensions": @allowed_file_extensions,
        "encryption": @encryption,
        "antivirus": @antivirus
    }
end