appwrite 25.1.0 → 26.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +18 -4
- data/lib/appwrite/enums/billing_plan_group.rb +9 -0
- data/lib/appwrite/enums/database_status.rb +20 -0
- data/lib/appwrite/enums/database_type.rb +3 -0
- data/lib/appwrite/enums/o_auth2_oidc_prompt.rb +10 -0
- data/lib/appwrite/enums/o_auth_provider.rb +1 -0
- data/lib/appwrite/enums/organization_key_scopes.rb +6 -0
- data/lib/appwrite/enums/project_key_scopes.rb +10 -2
- data/lib/appwrite/enums/project_o_auth2_oidc_prompt.rb +10 -0
- data/lib/appwrite/enums/project_o_auth_provider_id.rb +1 -0
- data/lib/appwrite/enums/project_policy_id.rb +1 -0
- data/lib/appwrite/enums/project_service_id.rb +1 -0
- data/lib/appwrite/models/activity_event.rb +55 -70
- data/lib/appwrite/models/additional_resource.rb +52 -0
- data/lib/appwrite/models/app.rb +152 -0
- data/lib/appwrite/models/app_installation.rb +72 -0
- data/lib/appwrite/models/app_installation_list.rb +32 -0
- data/lib/appwrite/models/app_key.rb +67 -0
- data/lib/appwrite/models/{usage_gauge_list.rb → app_key_list.rb} +7 -7
- data/lib/appwrite/models/app_scope.rb +47 -0
- data/lib/appwrite/models/{usage_event_list.rb → app_scope_list.rb} +7 -7
- data/lib/appwrite/models/app_secret.rb +67 -0
- data/lib/appwrite/models/{health_status_list.rb → app_secret_list.rb} +7 -7
- data/lib/appwrite/models/app_secret_plaintext.rb +67 -0
- data/lib/appwrite/models/apps_list.rb +32 -0
- data/lib/appwrite/models/backup_policy.rb +5 -0
- data/lib/appwrite/models/billing_plan.rb +384 -0
- data/lib/appwrite/models/billing_plan_addon.rb +32 -0
- data/lib/appwrite/models/billing_plan_addon_details.rb +62 -0
- data/lib/appwrite/models/billing_plan_dedicated_database_limits.rb +117 -0
- data/lib/appwrite/models/billing_plan_limits.rb +32 -0
- data/lib/appwrite/models/billing_plan_supported_addons.rb +37 -0
- data/lib/appwrite/models/block.rb +5 -0
- data/lib/appwrite/models/database.rb +54 -6
- data/lib/appwrite/models/database_status.rb +62 -0
- data/lib/appwrite/models/database_status_connections.rb +32 -0
- data/lib/appwrite/models/database_status_replica.rb +42 -0
- data/lib/appwrite/models/database_status_volume.rb +42 -0
- data/lib/appwrite/models/dedicated_database.rb +267 -0
- data/lib/appwrite/models/dedicated_database_member.rb +42 -0
- data/lib/appwrite/models/dedicated_database_replicas.rb +37 -0
- data/lib/appwrite/models/dedicated_database_specification.rb +67 -0
- data/lib/appwrite/models/dedicated_database_specification_list.rb +37 -0
- data/lib/appwrite/models/dedicated_database_specification_pricing.rb +47 -0
- data/lib/appwrite/models/locale.rb +58 -3
- data/lib/appwrite/models/membership.rb +5 -0
- data/lib/appwrite/models/o_auth2_appwrite.rb +42 -0
- data/lib/appwrite/models/o_auth2_oidc.rb +13 -3
- data/lib/appwrite/models/oauth2_approve.rb +27 -0
- data/lib/appwrite/models/oauth2_authorize.rb +32 -0
- data/lib/appwrite/models/oauth2_consent.rb +72 -0
- data/lib/appwrite/models/oauth2_consent_list.rb +32 -0
- data/lib/appwrite/models/oauth2_consent_token.rb +77 -0
- data/lib/appwrite/models/oauth2_consent_token_list.rb +32 -0
- data/lib/appwrite/models/oauth2_device_authorization.rb +52 -0
- data/lib/appwrite/models/oauth2_grant.rb +82 -0
- data/lib/appwrite/models/{health_queue.rb → oauth2_organization.rb} +7 -7
- data/lib/appwrite/models/oauth2_organization_list.rb +32 -0
- data/lib/appwrite/models/oauth2_par.rb +32 -0
- data/lib/appwrite/models/oauth2_project.rb +37 -0
- data/lib/appwrite/models/oauth2_project_list.rb +32 -0
- data/lib/appwrite/models/oauth2_reject.rb +27 -0
- data/lib/appwrite/models/oauth2_token.rb +57 -0
- data/lib/appwrite/models/organization.rb +197 -0
- data/lib/appwrite/models/policy_deny_corporate_email.rb +32 -0
- data/lib/appwrite/models/policy_membership_privacy.rb +8 -3
- data/lib/appwrite/models/program.rb +67 -0
- data/lib/appwrite/models/project.rb +56 -11
- data/lib/appwrite/models/project_auth_method.rb +3 -3
- data/lib/appwrite/models/usage_billing_plan.rb +77 -0
- data/lib/appwrite/models/user.rb +25 -0
- data/lib/appwrite/query.rb +13 -1
- data/lib/appwrite/services/account.rb +251 -1
- data/lib/appwrite/services/activities.rb +2 -0
- data/lib/appwrite/services/advisor.rb +4 -0
- data/lib/appwrite/services/apps.rb +813 -0
- data/lib/appwrite/services/avatars.rb +8 -0
- data/lib/appwrite/services/backups.rb +38 -1
- data/lib/appwrite/services/databases.rb +107 -0
- data/lib/appwrite/services/functions.rb +30 -4
- data/lib/appwrite/services/graphql.rb +2 -0
- data/lib/appwrite/services/locale.rb +8 -0
- data/lib/appwrite/services/messaging.rb +42 -136
- data/lib/appwrite/services/oauth2.rb +525 -0
- data/lib/appwrite/services/organization.rb +436 -3
- data/lib/appwrite/services/presences.rb +4 -0
- data/lib/appwrite/services/project.rb +192 -9
- data/lib/appwrite/services/proxy.rb +7 -0
- data/lib/appwrite/services/sites.rb +28 -2
- data/lib/appwrite/services/storage.rb +11 -0
- data/lib/appwrite/services/tables_db.rb +201 -2
- data/lib/appwrite/services/teams.rb +209 -0
- data/lib/appwrite/services/tokens.rb +4 -0
- data/lib/appwrite/services/users.rb +38 -1
- data/lib/appwrite/services/webhooks.rb +5 -0
- data/lib/appwrite.rb +54 -15
- metadata +56 -17
- data/lib/appwrite/enums/health_antivirus_status.rb +0 -9
- data/lib/appwrite/enums/health_check_status.rb +0 -8
- data/lib/appwrite/enums/health_queue_name.rb +0 -19
- data/lib/appwrite/models/health_antivirus.rb +0 -49
- data/lib/appwrite/models/health_certificate.rb +0 -52
- data/lib/appwrite/models/health_status.rb +0 -53
- data/lib/appwrite/models/health_time.rb +0 -37
- data/lib/appwrite/models/usage_event.rb +0 -72
- data/lib/appwrite/models/usage_gauge.rb +0 -47
- data/lib/appwrite/services/health.rb +0 -681
- data/lib/appwrite/services/usage.rb +0 -88
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: '02891ab1059978945c4a148b229e240f171612f8cfe7ed5d677ddc965796439e'
|
|
4
|
+
data.tar.gz: 390bb97d112b72b6baeb7a2d9d1d38f155bedb6136b2d326e8d62ce3fad44476
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 75ccab76ec05a49ead852f078afe07efbbee3b73b09820737597298e5a0b403d3f5deca9572dd41f0c4a0fd09cae1f98b3ed76ae0025370213b915d3d9aa7b2f
|
|
7
|
+
data.tar.gz: baf6dd1c0e4522e91a5079404619e1df15d221904ef1c7646ede6a3068bbe085167e285cfc6fd27f1cb3f5f3ec2fe7b85f9cb68f4893b8cd46bcd54a186e5d74
|
data/lib/appwrite/client.rb
CHANGED
|
@@ -15,7 +15,7 @@ module Appwrite
|
|
|
15
15
|
'x-sdk-name'=> 'Ruby',
|
|
16
16
|
'x-sdk-platform'=> 'server',
|
|
17
17
|
'x-sdk-language'=> 'ruby',
|
|
18
|
-
'x-sdk-version'=> '
|
|
18
|
+
'x-sdk-version'=> '26.1.0',
|
|
19
19
|
'X-Appwrite-Response-Format' => '1.9.5'
|
|
20
20
|
}
|
|
21
21
|
@endpoint = 'https://cloud.appwrite.io/v1'
|
|
@@ -63,6 +63,20 @@ module Appwrite
|
|
|
63
63
|
self
|
|
64
64
|
end
|
|
65
65
|
|
|
66
|
+
# Set Bearer
|
|
67
|
+
#
|
|
68
|
+
# The OAuth access token to authenticate with
|
|
69
|
+
#
|
|
70
|
+
# @param [String] value The value to set for the Bearer header
|
|
71
|
+
#
|
|
72
|
+
# @return [self]
|
|
73
|
+
def set_bearer(value)
|
|
74
|
+
add_header('authorization', "Bearer #{value}")
|
|
75
|
+
@config['bearer'] = value
|
|
76
|
+
|
|
77
|
+
self
|
|
78
|
+
end
|
|
79
|
+
|
|
66
80
|
# Set Locale
|
|
67
81
|
#
|
|
68
82
|
# @param [String] value The value to set for the Locale header
|
|
@@ -133,7 +147,7 @@ module Appwrite
|
|
|
133
147
|
|
|
134
148
|
# Set ImpersonateUserId
|
|
135
149
|
#
|
|
136
|
-
# Impersonate a user by ID
|
|
150
|
+
# Impersonate a user by ID
|
|
137
151
|
#
|
|
138
152
|
# @param [String] value The value to set for the ImpersonateUserId header
|
|
139
153
|
#
|
|
@@ -147,7 +161,7 @@ module Appwrite
|
|
|
147
161
|
|
|
148
162
|
# Set ImpersonateUserEmail
|
|
149
163
|
#
|
|
150
|
-
# Impersonate a user by email
|
|
164
|
+
# Impersonate a user by email
|
|
151
165
|
#
|
|
152
166
|
# @param [String] value The value to set for the ImpersonateUserEmail header
|
|
153
167
|
#
|
|
@@ -161,7 +175,7 @@ module Appwrite
|
|
|
161
175
|
|
|
162
176
|
# Set ImpersonateUserPhone
|
|
163
177
|
#
|
|
164
|
-
# Impersonate a user by phone
|
|
178
|
+
# Impersonate a user by phone
|
|
165
179
|
#
|
|
166
180
|
# @param [String] value The value to set for the ImpersonateUserPhone header
|
|
167
181
|
#
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
module Appwrite
|
|
2
|
+
module Enums
|
|
3
|
+
module DatabaseStatus
|
|
4
|
+
PROVISIONING = 'provisioning'
|
|
5
|
+
READY = 'ready'
|
|
6
|
+
INACTIVE = 'inactive'
|
|
7
|
+
PAUSED = 'paused'
|
|
8
|
+
FAILED = 'failed'
|
|
9
|
+
DELETING = 'deleting'
|
|
10
|
+
DELETED = 'deleted'
|
|
11
|
+
RESTORING = 'restoring'
|
|
12
|
+
SCALING = 'scaling'
|
|
13
|
+
UPGRADING = 'upgrading'
|
|
14
|
+
MIGRATING = 'migrating'
|
|
15
|
+
PAUSING = 'pausing'
|
|
16
|
+
RESUMING = 'resuming'
|
|
17
|
+
FAILING_OVER = 'failing-over'
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -7,6 +7,12 @@ module Appwrite
|
|
|
7
7
|
DEVKEYS_WRITE = 'devKeys.write'
|
|
8
8
|
ORGANIZATION_KEYS_READ = 'organization.keys.read'
|
|
9
9
|
ORGANIZATION_KEYS_WRITE = 'organization.keys.write'
|
|
10
|
+
ORGANIZATION_INSTALLATIONS_READ = 'organization.installations.read'
|
|
11
|
+
ORGANIZATION_INSTALLATIONS_WRITE = 'organization.installations.write'
|
|
12
|
+
ORGANIZATION_MEMBERSHIPS_READ = 'organization.memberships.read'
|
|
13
|
+
ORGANIZATION_MEMBERSHIPS_WRITE = 'organization.memberships.write'
|
|
14
|
+
ORGANIZATION_READ = 'organization.read'
|
|
15
|
+
ORGANIZATION_WRITE = 'organization.write'
|
|
10
16
|
DOMAINS_READ = 'domains.read'
|
|
11
17
|
DOMAINS_WRITE = 'domains.write'
|
|
12
18
|
KEYS_READ = 'keys.read'
|
|
@@ -13,10 +13,12 @@ module Appwrite
|
|
|
13
13
|
POLICIES_WRITE = 'policies.write'
|
|
14
14
|
PROJECT_POLICIES_READ = 'project.policies.read'
|
|
15
15
|
PROJECT_POLICIES_WRITE = 'project.policies.write'
|
|
16
|
+
PROJECT_OAUTH2_READ = 'project.oauth2.read'
|
|
17
|
+
PROJECT_OAUTH2_WRITE = 'project.oauth2.write'
|
|
16
18
|
TEMPLATES_READ = 'templates.read'
|
|
17
19
|
TEMPLATES_WRITE = 'templates.write'
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
STAGES_READ = 'stages.read'
|
|
21
|
+
STAGES_WRITE = 'stages.write'
|
|
20
22
|
USERS_READ = 'users.read'
|
|
21
23
|
USERS_WRITE = 'users.write'
|
|
22
24
|
SESSIONS_READ = 'sessions.read'
|
|
@@ -91,11 +93,17 @@ module Appwrite
|
|
|
91
93
|
ARCHIVES_WRITE = 'archives.write'
|
|
92
94
|
RESTORATIONS_READ = 'restorations.read'
|
|
93
95
|
RESTORATIONS_WRITE = 'restorations.write'
|
|
96
|
+
DEDICATEDDATABASES_EXECUTE = 'dedicatedDatabases.execute'
|
|
94
97
|
DOMAINS_READ = 'domains.read'
|
|
95
98
|
DOMAINS_WRITE = 'domains.write'
|
|
99
|
+
WAFRULES_READ = 'wafRules.read'
|
|
100
|
+
WAFRULES_WRITE = 'wafRules.write'
|
|
96
101
|
EVENTS_READ = 'events.read'
|
|
97
102
|
APPS_READ = 'apps.read'
|
|
98
103
|
APPS_WRITE = 'apps.write'
|
|
104
|
+
OAUTH2_READ = 'oauth2.read'
|
|
105
|
+
OAUTH2_WRITE = 'oauth2.write'
|
|
106
|
+
OAUTH2_INTROSPECT = 'oauth2.introspect'
|
|
99
107
|
USAGE_READ = 'usage.read'
|
|
100
108
|
end
|
|
101
109
|
end
|
|
@@ -17,24 +17,21 @@ module Appwrite
|
|
|
17
17
|
attr_reader :ip
|
|
18
18
|
attr_reader :mode
|
|
19
19
|
attr_reader :country
|
|
20
|
+
attr_reader :continent_code
|
|
21
|
+
attr_reader :city
|
|
22
|
+
attr_reader :subdivisions
|
|
23
|
+
attr_reader :isp
|
|
24
|
+
attr_reader :autonomous_system_number
|
|
25
|
+
attr_reader :autonomous_system_organization
|
|
26
|
+
attr_reader :connection_type
|
|
27
|
+
attr_reader :connection_usage_type
|
|
28
|
+
attr_reader :connection_organization
|
|
20
29
|
attr_reader :time
|
|
21
30
|
attr_reader :project_id
|
|
22
31
|
attr_reader :team_id
|
|
23
32
|
attr_reader :hostname
|
|
24
|
-
attr_reader :
|
|
25
|
-
attr_reader :
|
|
26
|
-
attr_reader :os_version
|
|
27
|
-
attr_reader :client_type
|
|
28
|
-
attr_reader :client_code
|
|
29
|
-
attr_reader :client_name
|
|
30
|
-
attr_reader :client_version
|
|
31
|
-
attr_reader :client_engine
|
|
32
|
-
attr_reader :client_engine_version
|
|
33
|
-
attr_reader :device_name
|
|
34
|
-
attr_reader :device_brand
|
|
35
|
-
attr_reader :device_model
|
|
36
|
-
attr_reader :country_code
|
|
37
|
-
attr_reader :country_name
|
|
33
|
+
attr_reader :sdk
|
|
34
|
+
attr_reader :sdk_version
|
|
38
35
|
|
|
39
36
|
def initialize(
|
|
40
37
|
id:,
|
|
@@ -51,24 +48,21 @@ module Appwrite
|
|
|
51
48
|
ip:,
|
|
52
49
|
mode:,
|
|
53
50
|
country:,
|
|
51
|
+
continent_code:,
|
|
52
|
+
city:,
|
|
53
|
+
subdivisions:,
|
|
54
|
+
isp:,
|
|
55
|
+
autonomous_system_number:,
|
|
56
|
+
autonomous_system_organization:,
|
|
57
|
+
connection_type:,
|
|
58
|
+
connection_usage_type:,
|
|
59
|
+
connection_organization:,
|
|
54
60
|
time:,
|
|
55
61
|
project_id:,
|
|
56
62
|
team_id:,
|
|
57
63
|
hostname:,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
os_version:,
|
|
61
|
-
client_type:,
|
|
62
|
-
client_code:,
|
|
63
|
-
client_name:,
|
|
64
|
-
client_version:,
|
|
65
|
-
client_engine:,
|
|
66
|
-
client_engine_version:,
|
|
67
|
-
device_name:,
|
|
68
|
-
device_brand:,
|
|
69
|
-
device_model:,
|
|
70
|
-
country_code:,
|
|
71
|
-
country_name:
|
|
64
|
+
sdk:,
|
|
65
|
+
sdk_version:
|
|
72
66
|
)
|
|
73
67
|
@id = id
|
|
74
68
|
@actor_type = actor_type
|
|
@@ -84,24 +78,21 @@ module Appwrite
|
|
|
84
78
|
@ip = ip
|
|
85
79
|
@mode = mode
|
|
86
80
|
@country = country
|
|
81
|
+
@continent_code = continent_code
|
|
82
|
+
@city = city
|
|
83
|
+
@subdivisions = subdivisions
|
|
84
|
+
@isp = isp
|
|
85
|
+
@autonomous_system_number = autonomous_system_number
|
|
86
|
+
@autonomous_system_organization = autonomous_system_organization
|
|
87
|
+
@connection_type = connection_type
|
|
88
|
+
@connection_usage_type = connection_usage_type
|
|
89
|
+
@connection_organization = connection_organization
|
|
87
90
|
@time = time
|
|
88
91
|
@project_id = project_id
|
|
89
92
|
@team_id = team_id
|
|
90
93
|
@hostname = hostname
|
|
91
|
-
@
|
|
92
|
-
@
|
|
93
|
-
@os_version = os_version
|
|
94
|
-
@client_type = client_type
|
|
95
|
-
@client_code = client_code
|
|
96
|
-
@client_name = client_name
|
|
97
|
-
@client_version = client_version
|
|
98
|
-
@client_engine = client_engine
|
|
99
|
-
@client_engine_version = client_engine_version
|
|
100
|
-
@device_name = device_name
|
|
101
|
-
@device_brand = device_brand
|
|
102
|
-
@device_model = device_model
|
|
103
|
-
@country_code = country_code
|
|
104
|
-
@country_name = country_name
|
|
94
|
+
@sdk = sdk
|
|
95
|
+
@sdk_version = sdk_version
|
|
105
96
|
end
|
|
106
97
|
|
|
107
98
|
def self.from(map:)
|
|
@@ -120,24 +111,21 @@ module Appwrite
|
|
|
120
111
|
ip: map["ip"],
|
|
121
112
|
mode: map["mode"],
|
|
122
113
|
country: map["country"],
|
|
114
|
+
continent_code: map["continentCode"],
|
|
115
|
+
city: map["city"],
|
|
116
|
+
subdivisions: map["subdivisions"],
|
|
117
|
+
isp: map["isp"],
|
|
118
|
+
autonomous_system_number: map["autonomousSystemNumber"],
|
|
119
|
+
autonomous_system_organization: map["autonomousSystemOrganization"],
|
|
120
|
+
connection_type: map["connectionType"],
|
|
121
|
+
connection_usage_type: map["connectionUsageType"],
|
|
122
|
+
connection_organization: map["connectionOrganization"],
|
|
123
123
|
time: map["time"],
|
|
124
124
|
project_id: map["projectId"],
|
|
125
125
|
team_id: map["teamId"],
|
|
126
126
|
hostname: map["hostname"],
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
os_version: map["osVersion"],
|
|
130
|
-
client_type: map["clientType"],
|
|
131
|
-
client_code: map["clientCode"],
|
|
132
|
-
client_name: map["clientName"],
|
|
133
|
-
client_version: map["clientVersion"],
|
|
134
|
-
client_engine: map["clientEngine"],
|
|
135
|
-
client_engine_version: map["clientEngineVersion"],
|
|
136
|
-
device_name: map["deviceName"],
|
|
137
|
-
device_brand: map["deviceBrand"],
|
|
138
|
-
device_model: map["deviceModel"],
|
|
139
|
-
country_code: map["countryCode"],
|
|
140
|
-
country_name: map["countryName"]
|
|
127
|
+
sdk: map["sdk"],
|
|
128
|
+
sdk_version: map["sdkVersion"]
|
|
141
129
|
)
|
|
142
130
|
end
|
|
143
131
|
|
|
@@ -157,24 +145,21 @@ module Appwrite
|
|
|
157
145
|
"ip": @ip,
|
|
158
146
|
"mode": @mode,
|
|
159
147
|
"country": @country,
|
|
148
|
+
"continentCode": @continent_code,
|
|
149
|
+
"city": @city,
|
|
150
|
+
"subdivisions": @subdivisions,
|
|
151
|
+
"isp": @isp,
|
|
152
|
+
"autonomousSystemNumber": @autonomous_system_number,
|
|
153
|
+
"autonomousSystemOrganization": @autonomous_system_organization,
|
|
154
|
+
"connectionType": @connection_type,
|
|
155
|
+
"connectionUsageType": @connection_usage_type,
|
|
156
|
+
"connectionOrganization": @connection_organization,
|
|
160
157
|
"time": @time,
|
|
161
158
|
"projectId": @project_id,
|
|
162
159
|
"teamId": @team_id,
|
|
163
160
|
"hostname": @hostname,
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"osVersion": @os_version,
|
|
167
|
-
"clientType": @client_type,
|
|
168
|
-
"clientCode": @client_code,
|
|
169
|
-
"clientName": @client_name,
|
|
170
|
-
"clientVersion": @client_version,
|
|
171
|
-
"clientEngine": @client_engine,
|
|
172
|
-
"clientEngineVersion": @client_engine_version,
|
|
173
|
-
"deviceName": @device_name,
|
|
174
|
-
"deviceBrand": @device_brand,
|
|
175
|
-
"deviceModel": @device_model,
|
|
176
|
-
"countryCode": @country_code,
|
|
177
|
-
"countryName": @country_name
|
|
161
|
+
"sdk": @sdk,
|
|
162
|
+
"sdkVersion": @sdk_version
|
|
178
163
|
}
|
|
179
164
|
end
|
|
180
165
|
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class AdditionalResource
|
|
6
|
+
attr_reader :name
|
|
7
|
+
attr_reader :unit
|
|
8
|
+
attr_reader :currency
|
|
9
|
+
attr_reader :price
|
|
10
|
+
attr_reader :value
|
|
11
|
+
attr_reader :invoice_desc
|
|
12
|
+
|
|
13
|
+
def initialize(
|
|
14
|
+
name:,
|
|
15
|
+
unit:,
|
|
16
|
+
currency:,
|
|
17
|
+
price:,
|
|
18
|
+
value:,
|
|
19
|
+
invoice_desc:
|
|
20
|
+
)
|
|
21
|
+
@name = name
|
|
22
|
+
@unit = unit
|
|
23
|
+
@currency = currency
|
|
24
|
+
@price = price
|
|
25
|
+
@value = value
|
|
26
|
+
@invoice_desc = invoice_desc
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
def self.from(map:)
|
|
30
|
+
AdditionalResource.new(
|
|
31
|
+
name: map["name"],
|
|
32
|
+
unit: map["unit"],
|
|
33
|
+
currency: map["currency"],
|
|
34
|
+
price: map["price"],
|
|
35
|
+
value: map["value"],
|
|
36
|
+
invoice_desc: map["invoiceDesc"]
|
|
37
|
+
)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def to_map
|
|
41
|
+
{
|
|
42
|
+
"name": @name,
|
|
43
|
+
"unit": @unit,
|
|
44
|
+
"currency": @currency,
|
|
45
|
+
"price": @price,
|
|
46
|
+
"value": @value,
|
|
47
|
+
"invoiceDesc": @invoice_desc
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class App
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :created_at
|
|
8
|
+
attr_reader :updated_at
|
|
9
|
+
attr_reader :name
|
|
10
|
+
attr_reader :description
|
|
11
|
+
attr_reader :client_uri
|
|
12
|
+
attr_reader :logo_uri
|
|
13
|
+
attr_reader :privacy_policy_url
|
|
14
|
+
attr_reader :terms_url
|
|
15
|
+
attr_reader :contacts
|
|
16
|
+
attr_reader :tagline
|
|
17
|
+
attr_reader :tags
|
|
18
|
+
attr_reader :labels
|
|
19
|
+
attr_reader :images
|
|
20
|
+
attr_reader :support_url
|
|
21
|
+
attr_reader :data_deletion_url
|
|
22
|
+
attr_reader :redirect_uris
|
|
23
|
+
attr_reader :post_logout_redirect_uris
|
|
24
|
+
attr_reader :enabled
|
|
25
|
+
attr_reader :type
|
|
26
|
+
attr_reader :device_flow
|
|
27
|
+
attr_reader :team_id
|
|
28
|
+
attr_reader :user_id
|
|
29
|
+
attr_reader :installation_scopes
|
|
30
|
+
attr_reader :installation_redirect_url
|
|
31
|
+
attr_reader :secrets
|
|
32
|
+
|
|
33
|
+
def initialize(
|
|
34
|
+
id:,
|
|
35
|
+
created_at:,
|
|
36
|
+
updated_at:,
|
|
37
|
+
name:,
|
|
38
|
+
description:,
|
|
39
|
+
client_uri:,
|
|
40
|
+
logo_uri:,
|
|
41
|
+
privacy_policy_url:,
|
|
42
|
+
terms_url:,
|
|
43
|
+
contacts:,
|
|
44
|
+
tagline:,
|
|
45
|
+
tags:,
|
|
46
|
+
labels:,
|
|
47
|
+
images:,
|
|
48
|
+
support_url:,
|
|
49
|
+
data_deletion_url:,
|
|
50
|
+
redirect_uris:,
|
|
51
|
+
post_logout_redirect_uris:,
|
|
52
|
+
enabled:,
|
|
53
|
+
type:,
|
|
54
|
+
device_flow:,
|
|
55
|
+
team_id:,
|
|
56
|
+
user_id:,
|
|
57
|
+
installation_scopes:,
|
|
58
|
+
installation_redirect_url:,
|
|
59
|
+
secrets:
|
|
60
|
+
)
|
|
61
|
+
@id = id
|
|
62
|
+
@created_at = created_at
|
|
63
|
+
@updated_at = updated_at
|
|
64
|
+
@name = name
|
|
65
|
+
@description = description
|
|
66
|
+
@client_uri = client_uri
|
|
67
|
+
@logo_uri = logo_uri
|
|
68
|
+
@privacy_policy_url = privacy_policy_url
|
|
69
|
+
@terms_url = terms_url
|
|
70
|
+
@contacts = contacts
|
|
71
|
+
@tagline = tagline
|
|
72
|
+
@tags = tags
|
|
73
|
+
@labels = labels
|
|
74
|
+
@images = images
|
|
75
|
+
@support_url = support_url
|
|
76
|
+
@data_deletion_url = data_deletion_url
|
|
77
|
+
@redirect_uris = redirect_uris
|
|
78
|
+
@post_logout_redirect_uris = post_logout_redirect_uris
|
|
79
|
+
@enabled = enabled
|
|
80
|
+
@type = type
|
|
81
|
+
@device_flow = device_flow
|
|
82
|
+
@team_id = team_id
|
|
83
|
+
@user_id = user_id
|
|
84
|
+
@installation_scopes = installation_scopes
|
|
85
|
+
@installation_redirect_url = installation_redirect_url
|
|
86
|
+
@secrets = secrets
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def self.from(map:)
|
|
90
|
+
App.new(
|
|
91
|
+
id: map["$id"],
|
|
92
|
+
created_at: map["$createdAt"],
|
|
93
|
+
updated_at: map["$updatedAt"],
|
|
94
|
+
name: map["name"],
|
|
95
|
+
description: map["description"],
|
|
96
|
+
client_uri: map["clientUri"],
|
|
97
|
+
logo_uri: map["logoUri"],
|
|
98
|
+
privacy_policy_url: map["privacyPolicyUrl"],
|
|
99
|
+
terms_url: map["termsUrl"],
|
|
100
|
+
contacts: map["contacts"],
|
|
101
|
+
tagline: map["tagline"],
|
|
102
|
+
tags: map["tags"],
|
|
103
|
+
labels: map["labels"],
|
|
104
|
+
images: map["images"],
|
|
105
|
+
support_url: map["supportUrl"],
|
|
106
|
+
data_deletion_url: map["dataDeletionUrl"],
|
|
107
|
+
redirect_uris: map["redirectUris"],
|
|
108
|
+
post_logout_redirect_uris: map["postLogoutRedirectUris"],
|
|
109
|
+
enabled: map["enabled"],
|
|
110
|
+
type: map["type"],
|
|
111
|
+
device_flow: map["deviceFlow"],
|
|
112
|
+
team_id: map["teamId"],
|
|
113
|
+
user_id: map["userId"],
|
|
114
|
+
installation_scopes: map["installationScopes"],
|
|
115
|
+
installation_redirect_url: map["installationRedirectUrl"],
|
|
116
|
+
secrets: map["secrets"].map { |it| AppSecret.from(map: it) }
|
|
117
|
+
)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def to_map
|
|
121
|
+
{
|
|
122
|
+
"$id": @id,
|
|
123
|
+
"$createdAt": @created_at,
|
|
124
|
+
"$updatedAt": @updated_at,
|
|
125
|
+
"name": @name,
|
|
126
|
+
"description": @description,
|
|
127
|
+
"clientUri": @client_uri,
|
|
128
|
+
"logoUri": @logo_uri,
|
|
129
|
+
"privacyPolicyUrl": @privacy_policy_url,
|
|
130
|
+
"termsUrl": @terms_url,
|
|
131
|
+
"contacts": @contacts,
|
|
132
|
+
"tagline": @tagline,
|
|
133
|
+
"tags": @tags,
|
|
134
|
+
"labels": @labels,
|
|
135
|
+
"images": @images,
|
|
136
|
+
"supportUrl": @support_url,
|
|
137
|
+
"dataDeletionUrl": @data_deletion_url,
|
|
138
|
+
"redirectUris": @redirect_uris,
|
|
139
|
+
"postLogoutRedirectUris": @post_logout_redirect_uris,
|
|
140
|
+
"enabled": @enabled,
|
|
141
|
+
"type": @type,
|
|
142
|
+
"deviceFlow": @device_flow,
|
|
143
|
+
"teamId": @team_id,
|
|
144
|
+
"userId": @user_id,
|
|
145
|
+
"installationScopes": @installation_scopes,
|
|
146
|
+
"installationRedirectUrl": @installation_redirect_url,
|
|
147
|
+
"secrets": @secrets.map { |it| it.to_map }
|
|
148
|
+
}
|
|
149
|
+
end
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class AppInstallation
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :created_at
|
|
8
|
+
attr_reader :updated_at
|
|
9
|
+
attr_reader :app_id
|
|
10
|
+
attr_reader :team_id
|
|
11
|
+
attr_reader :scopes
|
|
12
|
+
attr_reader :authorization_details
|
|
13
|
+
attr_reader :created_by_id
|
|
14
|
+
attr_reader :created_by_name
|
|
15
|
+
attr_reader :last_accessed_at
|
|
16
|
+
|
|
17
|
+
def initialize(
|
|
18
|
+
id:,
|
|
19
|
+
created_at:,
|
|
20
|
+
updated_at:,
|
|
21
|
+
app_id:,
|
|
22
|
+
team_id:,
|
|
23
|
+
scopes:,
|
|
24
|
+
authorization_details:,
|
|
25
|
+
created_by_id:,
|
|
26
|
+
created_by_name:,
|
|
27
|
+
last_accessed_at:
|
|
28
|
+
)
|
|
29
|
+
@id = id
|
|
30
|
+
@created_at = created_at
|
|
31
|
+
@updated_at = updated_at
|
|
32
|
+
@app_id = app_id
|
|
33
|
+
@team_id = team_id
|
|
34
|
+
@scopes = scopes
|
|
35
|
+
@authorization_details = authorization_details
|
|
36
|
+
@created_by_id = created_by_id
|
|
37
|
+
@created_by_name = created_by_name
|
|
38
|
+
@last_accessed_at = last_accessed_at
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def self.from(map:)
|
|
42
|
+
AppInstallation.new(
|
|
43
|
+
id: map["$id"],
|
|
44
|
+
created_at: map["$createdAt"],
|
|
45
|
+
updated_at: map["$updatedAt"],
|
|
46
|
+
app_id: map["appId"],
|
|
47
|
+
team_id: map["teamId"],
|
|
48
|
+
scopes: map["scopes"],
|
|
49
|
+
authorization_details: map["authorizationDetails"],
|
|
50
|
+
created_by_id: map["createdById"],
|
|
51
|
+
created_by_name: map["createdByName"],
|
|
52
|
+
last_accessed_at: map["lastAccessedAt"]
|
|
53
|
+
)
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def to_map
|
|
57
|
+
{
|
|
58
|
+
"$id": @id,
|
|
59
|
+
"$createdAt": @created_at,
|
|
60
|
+
"$updatedAt": @updated_at,
|
|
61
|
+
"appId": @app_id,
|
|
62
|
+
"teamId": @team_id,
|
|
63
|
+
"scopes": @scopes,
|
|
64
|
+
"authorizationDetails": @authorization_details,
|
|
65
|
+
"createdById": @created_by_id,
|
|
66
|
+
"createdByName": @created_by_name,
|
|
67
|
+
"lastAccessedAt": @last_accessed_at
|
|
68
|
+
}
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|