appwrite 2.2.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +134 -57
- data/lib/appwrite/exception.rb +5 -7
- data/lib/appwrite/file.rb +5 -13
- data/lib/appwrite/models/attribute_boolean.rb +52 -0
- data/lib/appwrite/models/attribute_email.rb +57 -0
- data/lib/appwrite/models/attribute_enum.rb +62 -0
- data/lib/appwrite/models/attribute_float.rb +62 -0
- data/lib/appwrite/models/attribute_integer.rb +62 -0
- data/lib/appwrite/models/attribute_ip.rb +57 -0
- data/lib/appwrite/models/attribute_list.rb +32 -0
- data/lib/appwrite/models/attribute_string.rb +57 -0
- data/lib/appwrite/models/attribute_url.rb +57 -0
- data/lib/appwrite/models/collection.rb +62 -0
- data/lib/appwrite/models/collection_list.rb +32 -0
- data/lib/appwrite/models/continent.rb +32 -0
- data/lib/appwrite/models/continent_list.rb +32 -0
- data/lib/appwrite/models/country.rb +32 -0
- data/lib/appwrite/models/country_list.rb +32 -0
- data/lib/appwrite/models/currency.rb +57 -0
- data/lib/appwrite/models/currency_list.rb +32 -0
- data/lib/appwrite/models/document.rb +50 -0
- data/lib/appwrite/models/document_list.rb +36 -0
- data/lib/appwrite/models/execution.rb +72 -0
- data/lib/appwrite/models/execution_list.rb +32 -0
- data/lib/appwrite/models/file.rb +62 -0
- data/lib/appwrite/models/file_list.rb +32 -0
- data/lib/appwrite/models/function.rb +92 -0
- data/lib/appwrite/models/function_list.rb +32 -0
- data/lib/appwrite/models/health_antivirus.rb +32 -0
- data/lib/appwrite/models/health_queue.rb +27 -0
- data/lib/appwrite/models/health_status.rb +32 -0
- data/lib/appwrite/models/health_time.rb +37 -0
- data/lib/appwrite/models/index.rb +47 -0
- data/lib/appwrite/models/index_list.rb +32 -0
- data/lib/appwrite/models/language.rb +37 -0
- data/lib/appwrite/models/language_list.rb +32 -0
- data/lib/appwrite/models/locale.rb +57 -0
- data/lib/appwrite/models/log.rb +127 -0
- data/lib/appwrite/models/log_list.rb +32 -0
- data/lib/appwrite/models/membership.rb +67 -0
- data/lib/appwrite/models/membership_list.rb +32 -0
- data/lib/appwrite/models/phone.rb +37 -0
- data/lib/appwrite/models/phone_list.rb +32 -0
- data/lib/appwrite/models/preferences.rb +30 -0
- data/lib/appwrite/models/runtime.rb +57 -0
- data/lib/appwrite/models/runtime_list.rb +32 -0
- data/lib/appwrite/models/session.rb +132 -0
- data/lib/appwrite/models/session_list.rb +32 -0
- data/lib/appwrite/models/tag.rb +47 -0
- data/lib/appwrite/models/tag_list.rb +32 -0
- data/lib/appwrite/models/team.rb +42 -0
- data/lib/appwrite/models/team_list.rb +32 -0
- data/lib/appwrite/models/token.rb +42 -0
- data/lib/appwrite/models/user.rb +62 -0
- data/lib/appwrite/models/user_list.rb +32 -0
- data/lib/appwrite/query.rb +42 -0
- data/lib/appwrite/service.rb +0 -5
- data/lib/appwrite/services/account.rb +380 -133
- data/lib/appwrite/services/avatars.rb +189 -125
- data/lib/appwrite/services/database.rb +876 -130
- data/lib/appwrite/services/functions.rb +366 -184
- data/lib/appwrite/services/health.rb +202 -58
- data/lib/appwrite/services/locale.rb +134 -32
- data/lib/appwrite/services/storage.rb +211 -118
- data/lib/appwrite/services/teams.rb +299 -118
- data/lib/appwrite/services/users.rb +372 -85
- data/lib/appwrite.rb +55 -0
- metadata +72 -103
- data/.travis.yml +0 -16
- data/CHANGELOG.md +0 -1
- data/Gemfile +0 -4
- data/LICENSE +0 -12
- data/README.md +0 -97
- data/appwrite.gemspec +0 -11
- data/docs/examples/account/create-recovery.md +0 -15
- data/docs/examples/account/create-verification.md +0 -15
- data/docs/examples/account/delete-session.md +0 -15
- data/docs/examples/account/delete-sessions.md +0 -15
- data/docs/examples/account/delete.md +0 -15
- data/docs/examples/account/get-logs.md +0 -15
- data/docs/examples/account/get-prefs.md +0 -15
- data/docs/examples/account/get-sessions.md +0 -15
- data/docs/examples/account/get.md +0 -15
- data/docs/examples/account/update-email.md +0 -15
- data/docs/examples/account/update-name.md +0 -15
- data/docs/examples/account/update-password.md +0 -15
- data/docs/examples/account/update-prefs.md +0 -15
- data/docs/examples/account/update-recovery.md +0 -15
- data/docs/examples/account/update-verification.md +0 -15
- data/docs/examples/avatars/get-browser.md +0 -15
- data/docs/examples/avatars/get-credit-card.md +0 -15
- data/docs/examples/avatars/get-favicon.md +0 -15
- data/docs/examples/avatars/get-flag.md +0 -15
- data/docs/examples/avatars/get-image.md +0 -15
- data/docs/examples/avatars/get-initials.md +0 -15
- data/docs/examples/avatars/get-q-r.md +0 -15
- data/docs/examples/database/create-collection.md +0 -15
- data/docs/examples/database/create-document.md +0 -15
- data/docs/examples/database/delete-collection.md +0 -15
- data/docs/examples/database/delete-document.md +0 -15
- data/docs/examples/database/get-collection.md +0 -15
- data/docs/examples/database/get-document.md +0 -15
- data/docs/examples/database/list-collections.md +0 -15
- data/docs/examples/database/list-documents.md +0 -15
- data/docs/examples/database/update-collection.md +0 -15
- data/docs/examples/database/update-document.md +0 -15
- data/docs/examples/functions/create-execution.md +0 -15
- data/docs/examples/functions/create-tag.md +0 -15
- data/docs/examples/functions/create.md +0 -15
- data/docs/examples/functions/delete-tag.md +0 -15
- data/docs/examples/functions/delete.md +0 -15
- data/docs/examples/functions/get-execution.md +0 -15
- data/docs/examples/functions/get-tag.md +0 -15
- data/docs/examples/functions/get.md +0 -15
- data/docs/examples/functions/list-executions.md +0 -15
- data/docs/examples/functions/list-tags.md +0 -15
- data/docs/examples/functions/list.md +0 -15
- data/docs/examples/functions/update-tag.md +0 -15
- data/docs/examples/functions/update.md +0 -15
- data/docs/examples/health/get-anti-virus.md +0 -15
- data/docs/examples/health/get-cache.md +0 -15
- data/docs/examples/health/get-d-b.md +0 -15
- data/docs/examples/health/get-queue-certificates.md +0 -15
- data/docs/examples/health/get-queue-functions.md +0 -15
- data/docs/examples/health/get-queue-logs.md +0 -15
- data/docs/examples/health/get-queue-tasks.md +0 -15
- data/docs/examples/health/get-queue-usage.md +0 -15
- data/docs/examples/health/get-queue-webhooks.md +0 -15
- data/docs/examples/health/get-storage-local.md +0 -15
- data/docs/examples/health/get-time.md +0 -15
- data/docs/examples/health/get.md +0 -15
- data/docs/examples/locale/get-continents.md +0 -15
- data/docs/examples/locale/get-countries-e-u.md +0 -15
- data/docs/examples/locale/get-countries-phones.md +0 -15
- data/docs/examples/locale/get-countries.md +0 -15
- data/docs/examples/locale/get-currencies.md +0 -15
- data/docs/examples/locale/get-languages.md +0 -15
- data/docs/examples/locale/get.md +0 -15
- data/docs/examples/storage/create-file.md +0 -15
- data/docs/examples/storage/delete-file.md +0 -15
- data/docs/examples/storage/get-file-download.md +0 -15
- data/docs/examples/storage/get-file-preview.md +0 -15
- data/docs/examples/storage/get-file-view.md +0 -15
- data/docs/examples/storage/get-file.md +0 -15
- data/docs/examples/storage/list-files.md +0 -15
- data/docs/examples/storage/update-file.md +0 -15
- data/docs/examples/teams/create-membership.md +0 -15
- data/docs/examples/teams/create.md +0 -15
- data/docs/examples/teams/delete-membership.md +0 -15
- data/docs/examples/teams/delete.md +0 -15
- data/docs/examples/teams/get-memberships.md +0 -15
- data/docs/examples/teams/get.md +0 -15
- data/docs/examples/teams/list.md +0 -15
- data/docs/examples/teams/update-membership-roles.md +0 -15
- data/docs/examples/teams/update-membership-status.md +0 -15
- data/docs/examples/teams/update.md +0 -15
- data/docs/examples/users/create.md +0 -15
- data/docs/examples/users/delete-session.md +0 -15
- data/docs/examples/users/delete-sessions.md +0 -15
- data/docs/examples/users/delete.md +0 -15
- data/docs/examples/users/get-logs.md +0 -15
- data/docs/examples/users/get-prefs.md +0 -15
- data/docs/examples/users/get-sessions.md +0 -15
- data/docs/examples/users/get.md +0 -15
- data/docs/examples/users/list.md +0 -15
- data/docs/examples/users/update-prefs.md +0 -15
- data/docs/examples/users/update-status.md +0 -15
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class ExecutionList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :executions
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
executions:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@executions = executions
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
ExecutionList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
executions: map["executions"].map { |it| Execution.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"executions": @executions.map { |it| it.to_map }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class File
|
6
|
+
attr_reader :id
|
7
|
+
attr_reader :read
|
8
|
+
attr_reader :write
|
9
|
+
attr_reader :name
|
10
|
+
attr_reader :date_created
|
11
|
+
attr_reader :signature
|
12
|
+
attr_reader :mime_type
|
13
|
+
attr_reader :size_original
|
14
|
+
|
15
|
+
def initialize(
|
16
|
+
id:,
|
17
|
+
read:,
|
18
|
+
write:,
|
19
|
+
name:,
|
20
|
+
date_created:,
|
21
|
+
signature:,
|
22
|
+
mime_type:,
|
23
|
+
size_original:
|
24
|
+
)
|
25
|
+
@id = id
|
26
|
+
@read = read
|
27
|
+
@write = write
|
28
|
+
@name = name
|
29
|
+
@date_created = date_created
|
30
|
+
@signature = signature
|
31
|
+
@mime_type = mime_type
|
32
|
+
@size_original = size_original
|
33
|
+
end
|
34
|
+
|
35
|
+
def self.from(map:)
|
36
|
+
File.new(
|
37
|
+
id: map["$id"],
|
38
|
+
read: map["$read"],
|
39
|
+
write: map["$write"],
|
40
|
+
name: map["name"],
|
41
|
+
date_created: map["dateCreated"],
|
42
|
+
signature: map["signature"],
|
43
|
+
mime_type: map["mimeType"],
|
44
|
+
size_original: map["sizeOriginal"]
|
45
|
+
)
|
46
|
+
end
|
47
|
+
|
48
|
+
def to_map
|
49
|
+
{
|
50
|
+
"$id": @id,
|
51
|
+
"$read": @read,
|
52
|
+
"$write": @write,
|
53
|
+
"name": @name,
|
54
|
+
"dateCreated": @date_created,
|
55
|
+
"signature": @signature,
|
56
|
+
"mimeType": @mime_type,
|
57
|
+
"sizeOriginal": @size_original
|
58
|
+
}
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class FileList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :files
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
files:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@files = files
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
FileList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
files: map["files"].map { |it| File.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"files": @files.map { |it| it.to_map }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class Function
|
6
|
+
attr_reader :id
|
7
|
+
attr_reader :execute
|
8
|
+
attr_reader :name
|
9
|
+
attr_reader :date_created
|
10
|
+
attr_reader :date_updated
|
11
|
+
attr_reader :status
|
12
|
+
attr_reader :runtime
|
13
|
+
attr_reader :tag
|
14
|
+
attr_reader :vars
|
15
|
+
attr_reader :events
|
16
|
+
attr_reader :schedule
|
17
|
+
attr_reader :schedule_next
|
18
|
+
attr_reader :schedule_previous
|
19
|
+
attr_reader :timeout
|
20
|
+
|
21
|
+
def initialize(
|
22
|
+
id:,
|
23
|
+
execute:,
|
24
|
+
name:,
|
25
|
+
date_created:,
|
26
|
+
date_updated:,
|
27
|
+
status:,
|
28
|
+
runtime:,
|
29
|
+
tag:,
|
30
|
+
vars:,
|
31
|
+
events:,
|
32
|
+
schedule:,
|
33
|
+
schedule_next:,
|
34
|
+
schedule_previous:,
|
35
|
+
timeout:
|
36
|
+
)
|
37
|
+
@id = id
|
38
|
+
@execute = execute
|
39
|
+
@name = name
|
40
|
+
@date_created = date_created
|
41
|
+
@date_updated = date_updated
|
42
|
+
@status = status
|
43
|
+
@runtime = runtime
|
44
|
+
@tag = tag
|
45
|
+
@vars = vars
|
46
|
+
@events = events
|
47
|
+
@schedule = schedule
|
48
|
+
@schedule_next = schedule_next
|
49
|
+
@schedule_previous = schedule_previous
|
50
|
+
@timeout = timeout
|
51
|
+
end
|
52
|
+
|
53
|
+
def self.from(map:)
|
54
|
+
Function.new(
|
55
|
+
id: map["$id"],
|
56
|
+
execute: map["execute"],
|
57
|
+
name: map["name"],
|
58
|
+
date_created: map["dateCreated"],
|
59
|
+
date_updated: map["dateUpdated"],
|
60
|
+
status: map["status"],
|
61
|
+
runtime: map["runtime"],
|
62
|
+
tag: map["tag"],
|
63
|
+
vars: map["vars"],
|
64
|
+
events: map["events"],
|
65
|
+
schedule: map["schedule"],
|
66
|
+
schedule_next: map["scheduleNext"],
|
67
|
+
schedule_previous: map["schedulePrevious"],
|
68
|
+
timeout: map["timeout"]
|
69
|
+
)
|
70
|
+
end
|
71
|
+
|
72
|
+
def to_map
|
73
|
+
{
|
74
|
+
"$id": @id,
|
75
|
+
"execute": @execute,
|
76
|
+
"name": @name,
|
77
|
+
"dateCreated": @date_created,
|
78
|
+
"dateUpdated": @date_updated,
|
79
|
+
"status": @status,
|
80
|
+
"runtime": @runtime,
|
81
|
+
"tag": @tag,
|
82
|
+
"vars": @vars,
|
83
|
+
"events": @events,
|
84
|
+
"schedule": @schedule,
|
85
|
+
"scheduleNext": @schedule_next,
|
86
|
+
"schedulePrevious": @schedule_previous,
|
87
|
+
"timeout": @timeout
|
88
|
+
}
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class FunctionList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :functions
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
functions:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@functions = functions
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
FunctionList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
functions: map["functions"].map { |it| Function.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"functions": @functions.map { |it| it.to_map }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class HealthAntivirus
|
6
|
+
attr_reader :version
|
7
|
+
attr_reader :status
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
version:,
|
11
|
+
status:
|
12
|
+
)
|
13
|
+
@version = version
|
14
|
+
@status = status
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
HealthAntivirus.new(
|
19
|
+
version: map["version"],
|
20
|
+
status: map["status"]
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"version": @version,
|
27
|
+
"status": @status
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class HealthQueue
|
6
|
+
attr_reader :size
|
7
|
+
|
8
|
+
def initialize(
|
9
|
+
size:
|
10
|
+
)
|
11
|
+
@size = size
|
12
|
+
end
|
13
|
+
|
14
|
+
def self.from(map:)
|
15
|
+
HealthQueue.new(
|
16
|
+
size: map["size"]
|
17
|
+
)
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_map
|
21
|
+
{
|
22
|
+
"size": @size
|
23
|
+
}
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class HealthStatus
|
6
|
+
attr_reader :ping
|
7
|
+
attr_reader :status
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
ping:,
|
11
|
+
status:
|
12
|
+
)
|
13
|
+
@ping = ping
|
14
|
+
@status = status
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
HealthStatus.new(
|
19
|
+
ping: map["ping"],
|
20
|
+
status: map["status"]
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"ping": @ping,
|
27
|
+
"status": @status
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class HealthTime
|
6
|
+
attr_reader :remote_time
|
7
|
+
attr_reader :local_time
|
8
|
+
attr_reader :diff
|
9
|
+
|
10
|
+
def initialize(
|
11
|
+
remote_time:,
|
12
|
+
local_time:,
|
13
|
+
diff:
|
14
|
+
)
|
15
|
+
@remote_time = remote_time
|
16
|
+
@local_time = local_time
|
17
|
+
@diff = diff
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.from(map:)
|
21
|
+
HealthTime.new(
|
22
|
+
remote_time: map["remoteTime"],
|
23
|
+
local_time: map["localTime"],
|
24
|
+
diff: map["diff"]
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_map
|
29
|
+
{
|
30
|
+
"remoteTime": @remote_time,
|
31
|
+
"localTime": @local_time,
|
32
|
+
"diff": @diff
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class Index
|
6
|
+
attr_reader :key
|
7
|
+
attr_reader :type
|
8
|
+
attr_reader :status
|
9
|
+
attr_reader :attributes
|
10
|
+
attr_reader :orders
|
11
|
+
|
12
|
+
def initialize(
|
13
|
+
key:,
|
14
|
+
type:,
|
15
|
+
status:,
|
16
|
+
attributes:,
|
17
|
+
orders:
|
18
|
+
)
|
19
|
+
@key = key
|
20
|
+
@type = type
|
21
|
+
@status = status
|
22
|
+
@attributes = attributes
|
23
|
+
@orders = orders
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.from(map:)
|
27
|
+
Index.new(
|
28
|
+
key: map["key"],
|
29
|
+
type: map["type"],
|
30
|
+
status: map["status"],
|
31
|
+
attributes: map["attributes"],
|
32
|
+
orders: map["orders"]
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_map
|
37
|
+
{
|
38
|
+
"key": @key,
|
39
|
+
"type": @type,
|
40
|
+
"status": @status,
|
41
|
+
"attributes": @attributes,
|
42
|
+
"orders": @orders
|
43
|
+
}
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class IndexList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :indexes
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
indexes:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@indexes = indexes
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
IndexList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
indexes: map["indexes"].map { |it| Index.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"indexes": @indexes.map { |it| it.to_map }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class Language
|
6
|
+
attr_reader :name
|
7
|
+
attr_reader :code
|
8
|
+
attr_reader :native_name
|
9
|
+
|
10
|
+
def initialize(
|
11
|
+
name:,
|
12
|
+
code:,
|
13
|
+
native_name:
|
14
|
+
)
|
15
|
+
@name = name
|
16
|
+
@code = code
|
17
|
+
@native_name = native_name
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.from(map:)
|
21
|
+
Language.new(
|
22
|
+
name: map["name"],
|
23
|
+
code: map["code"],
|
24
|
+
native_name: map["nativeName"]
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_map
|
29
|
+
{
|
30
|
+
"name": @name,
|
31
|
+
"code": @code,
|
32
|
+
"nativeName": @native_name
|
33
|
+
}
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class LanguageList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :languages
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
languages:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@languages = languages
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
LanguageList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
languages: map["languages"].map { |it| Language.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"languages": @languages.map { |it| it.to_map }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class Locale
|
6
|
+
attr_reader :ip
|
7
|
+
attr_reader :country_code
|
8
|
+
attr_reader :country
|
9
|
+
attr_reader :continent_code
|
10
|
+
attr_reader :continent
|
11
|
+
attr_reader :eu
|
12
|
+
attr_reader :currency
|
13
|
+
|
14
|
+
def initialize(
|
15
|
+
ip:,
|
16
|
+
country_code:,
|
17
|
+
country:,
|
18
|
+
continent_code:,
|
19
|
+
continent:,
|
20
|
+
eu:,
|
21
|
+
currency:
|
22
|
+
)
|
23
|
+
@ip = ip
|
24
|
+
@country_code = country_code
|
25
|
+
@country = country
|
26
|
+
@continent_code = continent_code
|
27
|
+
@continent = continent
|
28
|
+
@eu = eu
|
29
|
+
@currency = currency
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.from(map:)
|
33
|
+
Locale.new(
|
34
|
+
ip: map["ip"],
|
35
|
+
country_code: map["countryCode"],
|
36
|
+
country: map["country"],
|
37
|
+
continent_code: map["continentCode"],
|
38
|
+
continent: map["continent"],
|
39
|
+
eu: map["eu"],
|
40
|
+
currency: map["currency"]
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def to_map
|
45
|
+
{
|
46
|
+
"ip": @ip,
|
47
|
+
"countryCode": @country_code,
|
48
|
+
"country": @country,
|
49
|
+
"continentCode": @continent_code,
|
50
|
+
"continent": @continent,
|
51
|
+
"eu": @eu,
|
52
|
+
"currency": @currency
|
53
|
+
}
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|