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:, description:, enabled:, maximum_file_size:, allowed_file_extensions:, compression:, encryption:, antivirus:, transformations:, strip_metadata:, total_size:) ⇒ Bucket

Returns a new instance of Bucket.



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
49
50
51
52
53
54
55
56
57
# File 'lib/appwrite/models/bucket.rb', line 23

def initialize(
    id:,
    created_at:,
    updated_at:,
    permissions:,
    file_security:,
    name:,
    description:,
    enabled:,
    maximum_file_size:,
    allowed_file_extensions:,
    compression:,
    encryption:,
    antivirus:,
    transformations:,
    strip_metadata:,
    total_size:
)
    @id = id
    @created_at = created_at
    @updated_at = updated_at
    @permissions = permissions
    @file_security = file_security
    @name = name
    @description = description
    @enabled = enabled
    @maximum_file_size = maximum_file_size
    @allowed_file_extensions = allowed_file_extensions
    @compression = compression
    @encryption = encryption
    @antivirus = antivirus
    @transformations = transformations
    @strip_metadata = 
    @total_size = total_size
end

Instance Attribute Details

#allowed_file_extensions ⇒ Object (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

#antivirus ⇒ Object (readonly)

Returns the value of attribute antivirus.



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

def antivirus
  @antivirus
end

#compression ⇒ Object (readonly)

Returns the value of attribute compression.



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

def compression
  @compression
end

#created_at ⇒ Object (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

#description ⇒ Object (readonly)

Returns the value of attribute description.



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

def description
  @description
end

#enabled ⇒ Object (readonly)

Returns the value of attribute enabled.



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

def enabled
  @enabled
end

#encryption ⇒ Object (readonly)

Returns the value of attribute encryption.



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

def encryption
  @encryption
end

#file_security ⇒ Object (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

#id ⇒ Object (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#maximum_file_size ⇒ Object (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

#name ⇒ Object (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#permissions ⇒ Object (readonly)

Returns the value of attribute permissions.



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

def permissions
  @permissions
end

#strip_metadata ⇒ Object (readonly)

Returns the value of attribute strip_metadata.



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

def 
  @strip_metadata
end

#total_size ⇒ Object (readonly)

Returns the value of attribute total_size.



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

def total_size
  @total_size
end

#transformations ⇒ Object (readonly)

Returns the value of attribute transformations.



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

def transformations
  @transformations
end

#updated_at ⇒ Object (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



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

def self.from(map:)
    map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "$permissions" => [], "fileSecurity" => false, "name" => "", "description" => "", "enabled" => true, "maximumFileSize" => 0, "allowedFileExtensions" => [], "compression" => "", "encryption" => true, "antivirus" => true, "transformations" => true, "stripMetadata" => false, "totalSize" => 0 }.merge(map)
    Bucket.new(
        id: map["$id"],
        created_at: map["$createdAt"],
        updated_at: map["$updatedAt"],
        permissions: map["$permissions"],
        file_security: map["fileSecurity"],
        name: map["name"],
        description: map["description"],
        enabled: map["enabled"],
        maximum_file_size: map["maximumFileSize"],
        allowed_file_extensions: map["allowedFileExtensions"],
        compression: map["compression"],
        encryption: map["encryption"],
        antivirus: map["antivirus"],
        transformations: map["transformations"],
        strip_metadata: map["stripMetadata"],
        total_size: map["totalSize"]
    )
end

Instance Method Details

#to_map ⇒ Object



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
# File 'lib/appwrite/models/bucket.rb', line 81

def to_map
    {
        "$id": @id,
        "$createdAt": @created_at,
        "$updatedAt": @updated_at,
        "$permissions": @permissions,
        "fileSecurity": @file_security,
        "name": @name,
        "description": @description,
        "enabled": @enabled,
        "maximumFileSize": @maximum_file_size,
        "allowedFileExtensions": @allowed_file_extensions,
        "compression": @compression,
        "encryption": @encryption,
        "antivirus": @antivirus,
        "transformations": @transformations,
        "stripMetadata": @strip_metadata,
        "totalSize": @total_size
    }
end