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,127 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class Log
|
6
|
+
attr_reader :event
|
7
|
+
attr_reader :user_id
|
8
|
+
attr_reader :user_email
|
9
|
+
attr_reader :user_name
|
10
|
+
attr_reader :mode
|
11
|
+
attr_reader :ip
|
12
|
+
attr_reader :time
|
13
|
+
attr_reader :os_code
|
14
|
+
attr_reader :os_name
|
15
|
+
attr_reader :os_version
|
16
|
+
attr_reader :client_type
|
17
|
+
attr_reader :client_code
|
18
|
+
attr_reader :client_name
|
19
|
+
attr_reader :client_version
|
20
|
+
attr_reader :client_engine
|
21
|
+
attr_reader :client_engine_version
|
22
|
+
attr_reader :device_name
|
23
|
+
attr_reader :device_brand
|
24
|
+
attr_reader :device_model
|
25
|
+
attr_reader :country_code
|
26
|
+
attr_reader :country_name
|
27
|
+
|
28
|
+
def initialize(
|
29
|
+
event:,
|
30
|
+
user_id:,
|
31
|
+
user_email:,
|
32
|
+
user_name:,
|
33
|
+
mode:,
|
34
|
+
ip:,
|
35
|
+
time:,
|
36
|
+
os_code:,
|
37
|
+
os_name:,
|
38
|
+
os_version:,
|
39
|
+
client_type:,
|
40
|
+
client_code:,
|
41
|
+
client_name:,
|
42
|
+
client_version:,
|
43
|
+
client_engine:,
|
44
|
+
client_engine_version:,
|
45
|
+
device_name:,
|
46
|
+
device_brand:,
|
47
|
+
device_model:,
|
48
|
+
country_code:,
|
49
|
+
country_name:
|
50
|
+
)
|
51
|
+
@event = event
|
52
|
+
@user_id = user_id
|
53
|
+
@user_email = user_email
|
54
|
+
@user_name = user_name
|
55
|
+
@mode = mode
|
56
|
+
@ip = ip
|
57
|
+
@time = time
|
58
|
+
@os_code = os_code
|
59
|
+
@os_name = os_name
|
60
|
+
@os_version = os_version
|
61
|
+
@client_type = client_type
|
62
|
+
@client_code = client_code
|
63
|
+
@client_name = client_name
|
64
|
+
@client_version = client_version
|
65
|
+
@client_engine = client_engine
|
66
|
+
@client_engine_version = client_engine_version
|
67
|
+
@device_name = device_name
|
68
|
+
@device_brand = device_brand
|
69
|
+
@device_model = device_model
|
70
|
+
@country_code = country_code
|
71
|
+
@country_name = country_name
|
72
|
+
end
|
73
|
+
|
74
|
+
def self.from(map:)
|
75
|
+
Log.new(
|
76
|
+
event: map["event"],
|
77
|
+
user_id: map["userId"],
|
78
|
+
user_email: map["userEmail"],
|
79
|
+
user_name: map["userName"],
|
80
|
+
mode: map["mode"],
|
81
|
+
ip: map["ip"],
|
82
|
+
time: map["time"],
|
83
|
+
os_code: map["osCode"],
|
84
|
+
os_name: map["osName"],
|
85
|
+
os_version: map["osVersion"],
|
86
|
+
client_type: map["clientType"],
|
87
|
+
client_code: map["clientCode"],
|
88
|
+
client_name: map["clientName"],
|
89
|
+
client_version: map["clientVersion"],
|
90
|
+
client_engine: map["clientEngine"],
|
91
|
+
client_engine_version: map["clientEngineVersion"],
|
92
|
+
device_name: map["deviceName"],
|
93
|
+
device_brand: map["deviceBrand"],
|
94
|
+
device_model: map["deviceModel"],
|
95
|
+
country_code: map["countryCode"],
|
96
|
+
country_name: map["countryName"]
|
97
|
+
)
|
98
|
+
end
|
99
|
+
|
100
|
+
def to_map
|
101
|
+
{
|
102
|
+
"event": @event,
|
103
|
+
"userId": @user_id,
|
104
|
+
"userEmail": @user_email,
|
105
|
+
"userName": @user_name,
|
106
|
+
"mode": @mode,
|
107
|
+
"ip": @ip,
|
108
|
+
"time": @time,
|
109
|
+
"osCode": @os_code,
|
110
|
+
"osName": @os_name,
|
111
|
+
"osVersion": @os_version,
|
112
|
+
"clientType": @client_type,
|
113
|
+
"clientCode": @client_code,
|
114
|
+
"clientName": @client_name,
|
115
|
+
"clientVersion": @client_version,
|
116
|
+
"clientEngine": @client_engine,
|
117
|
+
"clientEngineVersion": @client_engine_version,
|
118
|
+
"deviceName": @device_name,
|
119
|
+
"deviceBrand": @device_brand,
|
120
|
+
"deviceModel": @device_model,
|
121
|
+
"countryCode": @country_code,
|
122
|
+
"countryName": @country_name
|
123
|
+
}
|
124
|
+
end
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class LogList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :logs
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
logs:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@logs = logs
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
LogList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
logs: map["logs"].map { |it| Log.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"logs": @logs.map { |it| it.to_map }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,67 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class Membership
|
6
|
+
attr_reader :id
|
7
|
+
attr_reader :user_id
|
8
|
+
attr_reader :team_id
|
9
|
+
attr_reader :name
|
10
|
+
attr_reader :email
|
11
|
+
attr_reader :invited
|
12
|
+
attr_reader :joined
|
13
|
+
attr_reader :confirm
|
14
|
+
attr_reader :roles
|
15
|
+
|
16
|
+
def initialize(
|
17
|
+
id:,
|
18
|
+
user_id:,
|
19
|
+
team_id:,
|
20
|
+
name:,
|
21
|
+
email:,
|
22
|
+
invited:,
|
23
|
+
joined:,
|
24
|
+
confirm:,
|
25
|
+
roles:
|
26
|
+
)
|
27
|
+
@id = id
|
28
|
+
@user_id = user_id
|
29
|
+
@team_id = team_id
|
30
|
+
@name = name
|
31
|
+
@email = email
|
32
|
+
@invited = invited
|
33
|
+
@joined = joined
|
34
|
+
@confirm = confirm
|
35
|
+
@roles = roles
|
36
|
+
end
|
37
|
+
|
38
|
+
def self.from(map:)
|
39
|
+
Membership.new(
|
40
|
+
id: map["$id"],
|
41
|
+
user_id: map["userId"],
|
42
|
+
team_id: map["teamId"],
|
43
|
+
name: map["name"],
|
44
|
+
email: map["email"],
|
45
|
+
invited: map["invited"],
|
46
|
+
joined: map["joined"],
|
47
|
+
confirm: map["confirm"],
|
48
|
+
roles: map["roles"]
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
def to_map
|
53
|
+
{
|
54
|
+
"$id": @id,
|
55
|
+
"userId": @user_id,
|
56
|
+
"teamId": @team_id,
|
57
|
+
"name": @name,
|
58
|
+
"email": @email,
|
59
|
+
"invited": @invited,
|
60
|
+
"joined": @joined,
|
61
|
+
"confirm": @confirm,
|
62
|
+
"roles": @roles
|
63
|
+
}
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class MembershipList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :memberships
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
memberships:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@memberships = memberships
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
MembershipList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
memberships: map["memberships"].map { |it| Membership.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"memberships": @memberships.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 Phone
|
6
|
+
attr_reader :code
|
7
|
+
attr_reader :country_code
|
8
|
+
attr_reader :country_name
|
9
|
+
|
10
|
+
def initialize(
|
11
|
+
code:,
|
12
|
+
country_code:,
|
13
|
+
country_name:
|
14
|
+
)
|
15
|
+
@code = code
|
16
|
+
@country_code = country_code
|
17
|
+
@country_name = country_name
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.from(map:)
|
21
|
+
Phone.new(
|
22
|
+
code: map["code"],
|
23
|
+
country_code: map["countryCode"],
|
24
|
+
country_name: map["countryName"]
|
25
|
+
)
|
26
|
+
end
|
27
|
+
|
28
|
+
def to_map
|
29
|
+
{
|
30
|
+
"code": @code,
|
31
|
+
"countryCode": @country_code,
|
32
|
+
"countryName": @country_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 PhoneList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :phones
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
phones:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@phones = phones
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
PhoneList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
phones: map["phones"].map { |it| Phone.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"phones": @phones.map { |it| it.to_map }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class Preferences
|
6
|
+
|
7
|
+
def initialize(
|
8
|
+
data:
|
9
|
+
)
|
10
|
+
@data = data
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.from(map:)
|
14
|
+
Preferences.new(
|
15
|
+
data: map["data"]
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
def to_map
|
20
|
+
{
|
21
|
+
"data": @data
|
22
|
+
}
|
23
|
+
end
|
24
|
+
|
25
|
+
def convert_to(from_json)
|
26
|
+
from_json.call(data)
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class Runtime
|
6
|
+
attr_reader :id
|
7
|
+
attr_reader :name
|
8
|
+
attr_reader :version
|
9
|
+
attr_reader :base
|
10
|
+
attr_reader :image
|
11
|
+
attr_reader :logo
|
12
|
+
attr_reader :supports
|
13
|
+
|
14
|
+
def initialize(
|
15
|
+
id:,
|
16
|
+
name:,
|
17
|
+
version:,
|
18
|
+
base:,
|
19
|
+
image:,
|
20
|
+
logo:,
|
21
|
+
supports:
|
22
|
+
)
|
23
|
+
@id = id
|
24
|
+
@name = name
|
25
|
+
@version = version
|
26
|
+
@base = base
|
27
|
+
@image = image
|
28
|
+
@logo = logo
|
29
|
+
@supports = supports
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.from(map:)
|
33
|
+
Runtime.new(
|
34
|
+
id: map["$id"],
|
35
|
+
name: map["name"],
|
36
|
+
version: map["version"],
|
37
|
+
base: map["base"],
|
38
|
+
image: map["image"],
|
39
|
+
logo: map["logo"],
|
40
|
+
supports: map["supports"]
|
41
|
+
)
|
42
|
+
end
|
43
|
+
|
44
|
+
def to_map
|
45
|
+
{
|
46
|
+
"$id": @id,
|
47
|
+
"name": @name,
|
48
|
+
"version": @version,
|
49
|
+
"base": @base,
|
50
|
+
"image": @image,
|
51
|
+
"logo": @logo,
|
52
|
+
"supports": @supports
|
53
|
+
}
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class RuntimeList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :runtimes
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
runtimes:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@runtimes = runtimes
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
RuntimeList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
runtimes: map["runtimes"].map { |it| Runtime.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"runtimes": @runtimes.map { |it| it.to_map }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,132 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class Session
|
6
|
+
attr_reader :id
|
7
|
+
attr_reader :user_id
|
8
|
+
attr_reader :expire
|
9
|
+
attr_reader :provider
|
10
|
+
attr_reader :provider_uid
|
11
|
+
attr_reader :provider_token
|
12
|
+
attr_reader :ip
|
13
|
+
attr_reader :os_code
|
14
|
+
attr_reader :os_name
|
15
|
+
attr_reader :os_version
|
16
|
+
attr_reader :client_type
|
17
|
+
attr_reader :client_code
|
18
|
+
attr_reader :client_name
|
19
|
+
attr_reader :client_version
|
20
|
+
attr_reader :client_engine
|
21
|
+
attr_reader :client_engine_version
|
22
|
+
attr_reader :device_name
|
23
|
+
attr_reader :device_brand
|
24
|
+
attr_reader :device_model
|
25
|
+
attr_reader :country_code
|
26
|
+
attr_reader :country_name
|
27
|
+
attr_reader :current
|
28
|
+
|
29
|
+
def initialize(
|
30
|
+
id:,
|
31
|
+
user_id:,
|
32
|
+
expire:,
|
33
|
+
provider:,
|
34
|
+
provider_uid:,
|
35
|
+
provider_token:,
|
36
|
+
ip:,
|
37
|
+
os_code:,
|
38
|
+
os_name:,
|
39
|
+
os_version:,
|
40
|
+
client_type:,
|
41
|
+
client_code:,
|
42
|
+
client_name:,
|
43
|
+
client_version:,
|
44
|
+
client_engine:,
|
45
|
+
client_engine_version:,
|
46
|
+
device_name:,
|
47
|
+
device_brand:,
|
48
|
+
device_model:,
|
49
|
+
country_code:,
|
50
|
+
country_name:,
|
51
|
+
current:
|
52
|
+
)
|
53
|
+
@id = id
|
54
|
+
@user_id = user_id
|
55
|
+
@expire = expire
|
56
|
+
@provider = provider
|
57
|
+
@provider_uid = provider_uid
|
58
|
+
@provider_token = provider_token
|
59
|
+
@ip = ip
|
60
|
+
@os_code = os_code
|
61
|
+
@os_name = os_name
|
62
|
+
@os_version = os_version
|
63
|
+
@client_type = client_type
|
64
|
+
@client_code = client_code
|
65
|
+
@client_name = client_name
|
66
|
+
@client_version = client_version
|
67
|
+
@client_engine = client_engine
|
68
|
+
@client_engine_version = client_engine_version
|
69
|
+
@device_name = device_name
|
70
|
+
@device_brand = device_brand
|
71
|
+
@device_model = device_model
|
72
|
+
@country_code = country_code
|
73
|
+
@country_name = country_name
|
74
|
+
@current = current
|
75
|
+
end
|
76
|
+
|
77
|
+
def self.from(map:)
|
78
|
+
Session.new(
|
79
|
+
id: map["$id"],
|
80
|
+
user_id: map["userId"],
|
81
|
+
expire: map["expire"],
|
82
|
+
provider: map["provider"],
|
83
|
+
provider_uid: map["providerUid"],
|
84
|
+
provider_token: map["providerToken"],
|
85
|
+
ip: map["ip"],
|
86
|
+
os_code: map["osCode"],
|
87
|
+
os_name: map["osName"],
|
88
|
+
os_version: map["osVersion"],
|
89
|
+
client_type: map["clientType"],
|
90
|
+
client_code: map["clientCode"],
|
91
|
+
client_name: map["clientName"],
|
92
|
+
client_version: map["clientVersion"],
|
93
|
+
client_engine: map["clientEngine"],
|
94
|
+
client_engine_version: map["clientEngineVersion"],
|
95
|
+
device_name: map["deviceName"],
|
96
|
+
device_brand: map["deviceBrand"],
|
97
|
+
device_model: map["deviceModel"],
|
98
|
+
country_code: map["countryCode"],
|
99
|
+
country_name: map["countryName"],
|
100
|
+
current: map["current"]
|
101
|
+
)
|
102
|
+
end
|
103
|
+
|
104
|
+
def to_map
|
105
|
+
{
|
106
|
+
"$id": @id,
|
107
|
+
"userId": @user_id,
|
108
|
+
"expire": @expire,
|
109
|
+
"provider": @provider,
|
110
|
+
"providerUid": @provider_uid,
|
111
|
+
"providerToken": @provider_token,
|
112
|
+
"ip": @ip,
|
113
|
+
"osCode": @os_code,
|
114
|
+
"osName": @os_name,
|
115
|
+
"osVersion": @os_version,
|
116
|
+
"clientType": @client_type,
|
117
|
+
"clientCode": @client_code,
|
118
|
+
"clientName": @client_name,
|
119
|
+
"clientVersion": @client_version,
|
120
|
+
"clientEngine": @client_engine,
|
121
|
+
"clientEngineVersion": @client_engine_version,
|
122
|
+
"deviceName": @device_name,
|
123
|
+
"deviceBrand": @device_brand,
|
124
|
+
"deviceModel": @device_model,
|
125
|
+
"countryCode": @country_code,
|
126
|
+
"countryName": @country_name,
|
127
|
+
"current": @current
|
128
|
+
}
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class SessionList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :sessions
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
sessions:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@sessions = sessions
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
SessionList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
sessions: map["sessions"].map { |it| Session.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"sessions": @sessions.map { |it| it.to_map }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
#frozen_string_literal: true
|
2
|
+
|
3
|
+
module Appwrite
|
4
|
+
module Models
|
5
|
+
class Tag
|
6
|
+
attr_reader :id
|
7
|
+
attr_reader :function_id
|
8
|
+
attr_reader :date_created
|
9
|
+
attr_reader :command
|
10
|
+
attr_reader :size
|
11
|
+
|
12
|
+
def initialize(
|
13
|
+
id:,
|
14
|
+
function_id:,
|
15
|
+
date_created:,
|
16
|
+
command:,
|
17
|
+
size:
|
18
|
+
)
|
19
|
+
@id = id
|
20
|
+
@function_id = function_id
|
21
|
+
@date_created = date_created
|
22
|
+
@command = command
|
23
|
+
@size = size
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.from(map:)
|
27
|
+
Tag.new(
|
28
|
+
id: map["$id"],
|
29
|
+
function_id: map["functionId"],
|
30
|
+
date_created: map["dateCreated"],
|
31
|
+
command: map["command"],
|
32
|
+
size: map["size"]
|
33
|
+
)
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_map
|
37
|
+
{
|
38
|
+
"$id": @id,
|
39
|
+
"functionId": @function_id,
|
40
|
+
"dateCreated": @date_created,
|
41
|
+
"command": @command,
|
42
|
+
"size": @size
|
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 TagList
|
6
|
+
attr_reader :sum
|
7
|
+
attr_reader :tags
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
sum:,
|
11
|
+
tags:
|
12
|
+
)
|
13
|
+
@sum = sum
|
14
|
+
@tags = tags
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.from(map:)
|
18
|
+
TagList.new(
|
19
|
+
sum: map["sum"],
|
20
|
+
tags: map["tags"].map { |it| Tag.from(map: it) }
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
def to_map
|
25
|
+
{
|
26
|
+
"sum": @sum,
|
27
|
+
"tags": @tags.map { |it| it.to_map }
|
28
|
+
}
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|