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:, permissions:, file_security:, name:, enabled:, maximum_file_size:, allowed_file_extensions:, compression:, encryption:, antivirus:) ⇒ 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:,
    permissions:,
    file_security:,
    name:,
    enabled:,
    maximum_file_size:,
    allowed_file_extensions:,
    compression:,
    encryption:,
    antivirus:
)
    @id = id
    @created_at = created_at
    @updated_at = updated_at
    @permissions = permissions
    @file_security = file_security
    @name = name
    @enabled = enabled
    @maximum_file_size = maximum_file_size
    @allowed_file_extensions = allowed_file_extensions
    @compression = compression
    @encryption = encryption
    @antivirus = antivirus
end

Instance Attribute Details

#allowed_file_extensionsObject (readonly)

Returns the value of attribute allowed_file_extensions.



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

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

#compressionObject (readonly)

Returns the value of attribute compression.



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

def compression
  @compression
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.



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

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

#file_securityObject (readonly)

Returns the value of attribute file_security.



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

def file_security
  @file_security
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.



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

def maximum_file_size
  @maximum_file_size
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#permissionsObject (readonly)

Returns the value of attribute permissions.



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

def permissions
  @permissions
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

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"],
        permissions: map["$permissions"],
        file_security: map["fileSecurity"],
        name: map["name"],
        enabled: map["enabled"],
        maximum_file_size: map["maximumFileSize"],
        allowed_file_extensions: map["allowedFileExtensions"],
        compression: map["compression"],
        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,
        "$permissions": @permissions,
        "fileSecurity": @file_security,
        "name": @name,
        "enabled": @enabled,
        "maximumFileSize": @maximum_file_size,
        "allowedFileExtensions": @allowed_file_extensions,
        "compression": @compression,
        "encryption": @encryption,
        "antivirus": @antivirus
    }
end