appwrite 25.0.0 → 26.0.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 +36 -6
- data/lib/appwrite/enums/billing_plan_group.rb +9 -0
- data/lib/appwrite/enums/database_status.rb +9 -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 +4 -0
- data/lib/appwrite/enums/project_key_scopes.rb +9 -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 +2 -0
- data/lib/appwrite/enums/project_service_id.rb +1 -0
- data/lib/appwrite/models/activity_event.rb +3 -73
- data/lib/appwrite/models/additional_resource.rb +52 -0
- data/lib/appwrite/models/backup_policy.rb +5 -0
- data/lib/appwrite/models/billing_plan.rb +379 -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 +19 -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/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/policy_password_strength.rb +52 -0
- data/lib/appwrite/models/program.rb +67 -0
- data/lib/appwrite/models/project.rb +93 -13
- 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 +88 -2
- data/lib/appwrite/services/activities.rb +4 -0
- data/lib/appwrite/services/advisor.rb +9 -0
- data/lib/appwrite/services/avatars.rb +16 -0
- data/lib/appwrite/services/backups.rb +37 -1
- data/lib/appwrite/services/databases.rb +178 -0
- data/lib/appwrite/services/functions.rb +56 -4
- data/lib/appwrite/services/graphql.rb +4 -0
- data/lib/appwrite/services/locale.rb +16 -0
- data/lib/appwrite/services/messaging.rb +188 -132
- data/lib/appwrite/services/organization.rb +278 -3
- data/lib/appwrite/services/presences.rb +9 -0
- data/lib/appwrite/services/project.rb +417 -49
- data/lib/appwrite/services/proxy.rb +15 -0
- data/lib/appwrite/services/sites.rb +50 -1
- data/lib/appwrite/services/storage.rb +24 -0
- data/lib/appwrite/services/tables_db.rb +139 -1
- data/lib/appwrite/services/teams.rb +24 -0
- data/lib/appwrite/services/tokens.rb +9 -0
- data/lib/appwrite/services/users.rb +81 -1
- data/lib/appwrite/services/webhooks.rb +11 -0
- data/lib/appwrite.rb +17 -15
- metadata +19 -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_queue.rb +0 -27
- data/lib/appwrite/models/health_status.rb +0 -53
- data/lib/appwrite/models/health_status_list.rb +0 -32
- data/lib/appwrite/models/health_time.rb +0 -37
- data/lib/appwrite/models/usage_event.rb +0 -72
- data/lib/appwrite/models/usage_event_list.rb +0 -32
- data/lib/appwrite/models/usage_gauge.rb +0 -47
- data/lib/appwrite/models/usage_gauge_list.rb +0 -32
- data/lib/appwrite/services/health.rb +0 -630
- data/lib/appwrite/services/usage.rb +0 -86
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class BillingPlan
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :name
|
|
8
|
+
attr_reader :desc
|
|
9
|
+
attr_reader :order
|
|
10
|
+
attr_reader :price
|
|
11
|
+
attr_reader :trial
|
|
12
|
+
attr_reader :bandwidth
|
|
13
|
+
attr_reader :storage
|
|
14
|
+
attr_reader :image_transformations
|
|
15
|
+
attr_reader :screenshots_generated
|
|
16
|
+
attr_reader :members
|
|
17
|
+
attr_reader :webhooks
|
|
18
|
+
attr_reader :projects
|
|
19
|
+
attr_reader :platforms
|
|
20
|
+
attr_reader :users
|
|
21
|
+
attr_reader :teams
|
|
22
|
+
attr_reader :databases
|
|
23
|
+
attr_reader :databases_reads
|
|
24
|
+
attr_reader :databases_writes
|
|
25
|
+
attr_reader :databases_batch_size
|
|
26
|
+
attr_reader :buckets
|
|
27
|
+
attr_reader :file_size
|
|
28
|
+
attr_reader :functions
|
|
29
|
+
attr_reader :sites
|
|
30
|
+
attr_reader :executions
|
|
31
|
+
attr_reader :executions_retention_count
|
|
32
|
+
attr_reader :gb_hours
|
|
33
|
+
attr_reader :realtime
|
|
34
|
+
attr_reader :realtime_messages
|
|
35
|
+
attr_reader :messages
|
|
36
|
+
attr_reader :topics
|
|
37
|
+
attr_reader :auth_phone
|
|
38
|
+
attr_reader :domains
|
|
39
|
+
attr_reader :activity_logs
|
|
40
|
+
attr_reader :usage_logs
|
|
41
|
+
attr_reader :usage_logs_intervals
|
|
42
|
+
attr_reader :project_inactivity_days
|
|
43
|
+
attr_reader :alert_limit
|
|
44
|
+
attr_reader :usage
|
|
45
|
+
attr_reader :addons
|
|
46
|
+
attr_reader :budget_cap_enabled
|
|
47
|
+
attr_reader :custom_smtp
|
|
48
|
+
attr_reader :email_branding
|
|
49
|
+
attr_reader :requires_payment_method
|
|
50
|
+
attr_reader :requires_billing_address
|
|
51
|
+
attr_reader :is_available
|
|
52
|
+
attr_reader :self_service
|
|
53
|
+
attr_reader :premium_support
|
|
54
|
+
attr_reader :budgeting
|
|
55
|
+
attr_reader :supports_mock_numbers
|
|
56
|
+
attr_reader :supports_organization_roles
|
|
57
|
+
attr_reader :supports_credits
|
|
58
|
+
attr_reader :supports_disposable_email_validation
|
|
59
|
+
attr_reader :supports_canonical_email_validation
|
|
60
|
+
attr_reader :supports_free_email_validation
|
|
61
|
+
attr_reader :supports_corporate_email_validation
|
|
62
|
+
attr_reader :supports_project_specific_roles
|
|
63
|
+
attr_reader :backups_enabled
|
|
64
|
+
attr_reader :usage_per_project
|
|
65
|
+
attr_reader :supported_addons
|
|
66
|
+
attr_reader :backup_policies
|
|
67
|
+
attr_reader :deployment_size
|
|
68
|
+
attr_reader :build_size
|
|
69
|
+
attr_reader :databases_allow_encrypt
|
|
70
|
+
attr_reader :limits
|
|
71
|
+
attr_reader :group
|
|
72
|
+
attr_reader :program
|
|
73
|
+
attr_reader :dedicated_databases
|
|
74
|
+
|
|
75
|
+
def initialize(
|
|
76
|
+
id:,
|
|
77
|
+
name:,
|
|
78
|
+
desc:,
|
|
79
|
+
order:,
|
|
80
|
+
price:,
|
|
81
|
+
trial:,
|
|
82
|
+
bandwidth:,
|
|
83
|
+
storage:,
|
|
84
|
+
image_transformations:,
|
|
85
|
+
screenshots_generated:,
|
|
86
|
+
members:,
|
|
87
|
+
webhooks:,
|
|
88
|
+
projects:,
|
|
89
|
+
platforms:,
|
|
90
|
+
users:,
|
|
91
|
+
teams:,
|
|
92
|
+
databases:,
|
|
93
|
+
databases_reads:,
|
|
94
|
+
databases_writes:,
|
|
95
|
+
databases_batch_size:,
|
|
96
|
+
buckets:,
|
|
97
|
+
file_size:,
|
|
98
|
+
functions:,
|
|
99
|
+
sites:,
|
|
100
|
+
executions:,
|
|
101
|
+
executions_retention_count:,
|
|
102
|
+
gb_hours:,
|
|
103
|
+
realtime:,
|
|
104
|
+
realtime_messages:,
|
|
105
|
+
messages:,
|
|
106
|
+
topics:,
|
|
107
|
+
auth_phone:,
|
|
108
|
+
domains:,
|
|
109
|
+
activity_logs:,
|
|
110
|
+
usage_logs:,
|
|
111
|
+
usage_logs_intervals: ,
|
|
112
|
+
project_inactivity_days:,
|
|
113
|
+
alert_limit:,
|
|
114
|
+
usage:,
|
|
115
|
+
addons:,
|
|
116
|
+
budget_cap_enabled:,
|
|
117
|
+
custom_smtp:,
|
|
118
|
+
email_branding:,
|
|
119
|
+
requires_payment_method:,
|
|
120
|
+
requires_billing_address:,
|
|
121
|
+
is_available:,
|
|
122
|
+
self_service:,
|
|
123
|
+
premium_support:,
|
|
124
|
+
budgeting:,
|
|
125
|
+
supports_mock_numbers:,
|
|
126
|
+
supports_organization_roles:,
|
|
127
|
+
supports_credits:,
|
|
128
|
+
supports_disposable_email_validation:,
|
|
129
|
+
supports_canonical_email_validation:,
|
|
130
|
+
supports_free_email_validation:,
|
|
131
|
+
supports_corporate_email_validation:,
|
|
132
|
+
supports_project_specific_roles:,
|
|
133
|
+
backups_enabled:,
|
|
134
|
+
usage_per_project:,
|
|
135
|
+
supported_addons:,
|
|
136
|
+
backup_policies:,
|
|
137
|
+
deployment_size:,
|
|
138
|
+
build_size:,
|
|
139
|
+
databases_allow_encrypt:,
|
|
140
|
+
limits: ,
|
|
141
|
+
group:,
|
|
142
|
+
program: ,
|
|
143
|
+
dedicated_databases:
|
|
144
|
+
)
|
|
145
|
+
@id = id
|
|
146
|
+
@name = name
|
|
147
|
+
@desc = desc
|
|
148
|
+
@order = order
|
|
149
|
+
@price = price
|
|
150
|
+
@trial = trial
|
|
151
|
+
@bandwidth = bandwidth
|
|
152
|
+
@storage = storage
|
|
153
|
+
@image_transformations = image_transformations
|
|
154
|
+
@screenshots_generated = screenshots_generated
|
|
155
|
+
@members = members
|
|
156
|
+
@webhooks = webhooks
|
|
157
|
+
@projects = projects
|
|
158
|
+
@platforms = platforms
|
|
159
|
+
@users = users
|
|
160
|
+
@teams = teams
|
|
161
|
+
@databases = databases
|
|
162
|
+
@databases_reads = databases_reads
|
|
163
|
+
@databases_writes = databases_writes
|
|
164
|
+
@databases_batch_size = databases_batch_size
|
|
165
|
+
@buckets = buckets
|
|
166
|
+
@file_size = file_size
|
|
167
|
+
@functions = functions
|
|
168
|
+
@sites = sites
|
|
169
|
+
@executions = executions
|
|
170
|
+
@executions_retention_count = executions_retention_count
|
|
171
|
+
@gb_hours = gb_hours
|
|
172
|
+
@realtime = realtime
|
|
173
|
+
@realtime_messages = realtime_messages
|
|
174
|
+
@messages = messages
|
|
175
|
+
@topics = topics
|
|
176
|
+
@auth_phone = auth_phone
|
|
177
|
+
@domains = domains
|
|
178
|
+
@activity_logs = activity_logs
|
|
179
|
+
@usage_logs = usage_logs
|
|
180
|
+
@usage_logs_intervals = usage_logs_intervals
|
|
181
|
+
@project_inactivity_days = project_inactivity_days
|
|
182
|
+
@alert_limit = alert_limit
|
|
183
|
+
@usage = usage
|
|
184
|
+
@addons = addons
|
|
185
|
+
@budget_cap_enabled = budget_cap_enabled
|
|
186
|
+
@custom_smtp = custom_smtp
|
|
187
|
+
@email_branding = email_branding
|
|
188
|
+
@requires_payment_method = requires_payment_method
|
|
189
|
+
@requires_billing_address = requires_billing_address
|
|
190
|
+
@is_available = is_available
|
|
191
|
+
@self_service = self_service
|
|
192
|
+
@premium_support = premium_support
|
|
193
|
+
@budgeting = budgeting
|
|
194
|
+
@supports_mock_numbers = supports_mock_numbers
|
|
195
|
+
@supports_organization_roles = supports_organization_roles
|
|
196
|
+
@supports_credits = supports_credits
|
|
197
|
+
@supports_disposable_email_validation = supports_disposable_email_validation
|
|
198
|
+
@supports_canonical_email_validation = supports_canonical_email_validation
|
|
199
|
+
@supports_free_email_validation = supports_free_email_validation
|
|
200
|
+
@supports_corporate_email_validation = supports_corporate_email_validation
|
|
201
|
+
@supports_project_specific_roles = supports_project_specific_roles
|
|
202
|
+
@backups_enabled = backups_enabled
|
|
203
|
+
@usage_per_project = usage_per_project
|
|
204
|
+
@supported_addons = supported_addons
|
|
205
|
+
@backup_policies = backup_policies
|
|
206
|
+
@deployment_size = deployment_size
|
|
207
|
+
@build_size = build_size
|
|
208
|
+
@databases_allow_encrypt = databases_allow_encrypt
|
|
209
|
+
@limits = limits
|
|
210
|
+
@group = validate_group(group)
|
|
211
|
+
@program = program
|
|
212
|
+
@dedicated_databases = dedicated_databases
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
def self.from(map:)
|
|
216
|
+
BillingPlan.new(
|
|
217
|
+
id: map["$id"],
|
|
218
|
+
name: map["name"],
|
|
219
|
+
desc: map["desc"],
|
|
220
|
+
order: map["order"],
|
|
221
|
+
price: map["price"],
|
|
222
|
+
trial: map["trial"],
|
|
223
|
+
bandwidth: map["bandwidth"],
|
|
224
|
+
storage: map["storage"],
|
|
225
|
+
image_transformations: map["imageTransformations"],
|
|
226
|
+
screenshots_generated: map["screenshotsGenerated"],
|
|
227
|
+
members: map["members"],
|
|
228
|
+
webhooks: map["webhooks"],
|
|
229
|
+
projects: map["projects"],
|
|
230
|
+
platforms: map["platforms"],
|
|
231
|
+
users: map["users"],
|
|
232
|
+
teams: map["teams"],
|
|
233
|
+
databases: map["databases"],
|
|
234
|
+
databases_reads: map["databasesReads"],
|
|
235
|
+
databases_writes: map["databasesWrites"],
|
|
236
|
+
databases_batch_size: map["databasesBatchSize"],
|
|
237
|
+
buckets: map["buckets"],
|
|
238
|
+
file_size: map["fileSize"],
|
|
239
|
+
functions: map["functions"],
|
|
240
|
+
sites: map["sites"],
|
|
241
|
+
executions: map["executions"],
|
|
242
|
+
executions_retention_count: map["executionsRetentionCount"],
|
|
243
|
+
gb_hours: map["GBHours"],
|
|
244
|
+
realtime: map["realtime"],
|
|
245
|
+
realtime_messages: map["realtimeMessages"],
|
|
246
|
+
messages: map["messages"],
|
|
247
|
+
topics: map["topics"],
|
|
248
|
+
auth_phone: map["authPhone"],
|
|
249
|
+
domains: map["domains"],
|
|
250
|
+
activity_logs: map["activityLogs"],
|
|
251
|
+
usage_logs: map["usageLogs"],
|
|
252
|
+
usage_logs_intervals: map["usageLogsIntervals"],
|
|
253
|
+
project_inactivity_days: map["projectInactivityDays"],
|
|
254
|
+
alert_limit: map["alertLimit"],
|
|
255
|
+
usage: UsageBillingPlan.from(map: map["usage"]),
|
|
256
|
+
addons: BillingPlanAddon.from(map: map["addons"]),
|
|
257
|
+
budget_cap_enabled: map["budgetCapEnabled"],
|
|
258
|
+
custom_smtp: map["customSmtp"],
|
|
259
|
+
email_branding: map["emailBranding"],
|
|
260
|
+
requires_payment_method: map["requiresPaymentMethod"],
|
|
261
|
+
requires_billing_address: map["requiresBillingAddress"],
|
|
262
|
+
is_available: map["isAvailable"],
|
|
263
|
+
self_service: map["selfService"],
|
|
264
|
+
premium_support: map["premiumSupport"],
|
|
265
|
+
budgeting: map["budgeting"],
|
|
266
|
+
supports_mock_numbers: map["supportsMockNumbers"],
|
|
267
|
+
supports_organization_roles: map["supportsOrganizationRoles"],
|
|
268
|
+
supports_credits: map["supportsCredits"],
|
|
269
|
+
supports_disposable_email_validation: map["supportsDisposableEmailValidation"],
|
|
270
|
+
supports_canonical_email_validation: map["supportsCanonicalEmailValidation"],
|
|
271
|
+
supports_free_email_validation: map["supportsFreeEmailValidation"],
|
|
272
|
+
supports_corporate_email_validation: map["supportsCorporateEmailValidation"],
|
|
273
|
+
supports_project_specific_roles: map["supportsProjectSpecificRoles"],
|
|
274
|
+
backups_enabled: map["backupsEnabled"],
|
|
275
|
+
usage_per_project: map["usagePerProject"],
|
|
276
|
+
supported_addons: BillingPlanSupportedAddons.from(map: map["supportedAddons"]),
|
|
277
|
+
backup_policies: map["backupPolicies"],
|
|
278
|
+
deployment_size: map["deploymentSize"],
|
|
279
|
+
build_size: map["buildSize"],
|
|
280
|
+
databases_allow_encrypt: map["databasesAllowEncrypt"],
|
|
281
|
+
limits: map["limits"].nil? ? nil : BillingPlanLimits.from(map: map["limits"]),
|
|
282
|
+
group: map["group"],
|
|
283
|
+
program: map["program"].nil? ? nil : Program.from(map: map["program"]),
|
|
284
|
+
dedicated_databases: map["dedicatedDatabases"].nil? ? nil : BillingPlanDedicatedDatabaseLimits.from(map: map["dedicatedDatabases"])
|
|
285
|
+
)
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
def to_map
|
|
289
|
+
{
|
|
290
|
+
"$id": @id,
|
|
291
|
+
"name": @name,
|
|
292
|
+
"desc": @desc,
|
|
293
|
+
"order": @order,
|
|
294
|
+
"price": @price,
|
|
295
|
+
"trial": @trial,
|
|
296
|
+
"bandwidth": @bandwidth,
|
|
297
|
+
"storage": @storage,
|
|
298
|
+
"imageTransformations": @image_transformations,
|
|
299
|
+
"screenshotsGenerated": @screenshots_generated,
|
|
300
|
+
"members": @members,
|
|
301
|
+
"webhooks": @webhooks,
|
|
302
|
+
"projects": @projects,
|
|
303
|
+
"platforms": @platforms,
|
|
304
|
+
"users": @users,
|
|
305
|
+
"teams": @teams,
|
|
306
|
+
"databases": @databases,
|
|
307
|
+
"databasesReads": @databases_reads,
|
|
308
|
+
"databasesWrites": @databases_writes,
|
|
309
|
+
"databasesBatchSize": @databases_batch_size,
|
|
310
|
+
"buckets": @buckets,
|
|
311
|
+
"fileSize": @file_size,
|
|
312
|
+
"functions": @functions,
|
|
313
|
+
"sites": @sites,
|
|
314
|
+
"executions": @executions,
|
|
315
|
+
"executionsRetentionCount": @executions_retention_count,
|
|
316
|
+
"GBHours": @gb_hours,
|
|
317
|
+
"realtime": @realtime,
|
|
318
|
+
"realtimeMessages": @realtime_messages,
|
|
319
|
+
"messages": @messages,
|
|
320
|
+
"topics": @topics,
|
|
321
|
+
"authPhone": @auth_phone,
|
|
322
|
+
"domains": @domains,
|
|
323
|
+
"activityLogs": @activity_logs,
|
|
324
|
+
"usageLogs": @usage_logs,
|
|
325
|
+
"usageLogsIntervals": @usage_logs_intervals,
|
|
326
|
+
"projectInactivityDays": @project_inactivity_days,
|
|
327
|
+
"alertLimit": @alert_limit,
|
|
328
|
+
"usage": @usage.to_map,
|
|
329
|
+
"addons": @addons.to_map,
|
|
330
|
+
"budgetCapEnabled": @budget_cap_enabled,
|
|
331
|
+
"customSmtp": @custom_smtp,
|
|
332
|
+
"emailBranding": @email_branding,
|
|
333
|
+
"requiresPaymentMethod": @requires_payment_method,
|
|
334
|
+
"requiresBillingAddress": @requires_billing_address,
|
|
335
|
+
"isAvailable": @is_available,
|
|
336
|
+
"selfService": @self_service,
|
|
337
|
+
"premiumSupport": @premium_support,
|
|
338
|
+
"budgeting": @budgeting,
|
|
339
|
+
"supportsMockNumbers": @supports_mock_numbers,
|
|
340
|
+
"supportsOrganizationRoles": @supports_organization_roles,
|
|
341
|
+
"supportsCredits": @supports_credits,
|
|
342
|
+
"supportsDisposableEmailValidation": @supports_disposable_email_validation,
|
|
343
|
+
"supportsCanonicalEmailValidation": @supports_canonical_email_validation,
|
|
344
|
+
"supportsFreeEmailValidation": @supports_free_email_validation,
|
|
345
|
+
"supportsCorporateEmailValidation": @supports_corporate_email_validation,
|
|
346
|
+
"supportsProjectSpecificRoles": @supports_project_specific_roles,
|
|
347
|
+
"backupsEnabled": @backups_enabled,
|
|
348
|
+
"usagePerProject": @usage_per_project,
|
|
349
|
+
"supportedAddons": @supported_addons.to_map,
|
|
350
|
+
"backupPolicies": @backup_policies,
|
|
351
|
+
"deploymentSize": @deployment_size,
|
|
352
|
+
"buildSize": @build_size,
|
|
353
|
+
"databasesAllowEncrypt": @databases_allow_encrypt,
|
|
354
|
+
"limits": @limits&.to_map,
|
|
355
|
+
"group": @group,
|
|
356
|
+
"program": @program&.to_map,
|
|
357
|
+
"dedicatedDatabases": @dedicated_databases&.to_map
|
|
358
|
+
}
|
|
359
|
+
end
|
|
360
|
+
|
|
361
|
+
private
|
|
362
|
+
|
|
363
|
+
def validate_group(group)
|
|
364
|
+
valid_group = [
|
|
365
|
+
Appwrite::Enums::BillingPlanGroup::STARTER,
|
|
366
|
+
Appwrite::Enums::BillingPlanGroup::PRO,
|
|
367
|
+
Appwrite::Enums::BillingPlanGroup::SCALE,
|
|
368
|
+
]
|
|
369
|
+
|
|
370
|
+
unless valid_group.include?(group)
|
|
371
|
+
raise ArgumentError, "Invalid " + group + ". Must be one of: " + valid_group.join(', ')
|
|
372
|
+
end
|
|
373
|
+
|
|
374
|
+
group
|
|
375
|
+
end
|
|
376
|
+
|
|
377
|
+
end
|
|
378
|
+
end
|
|
379
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class BillingPlanAddon
|
|
6
|
+
attr_reader :seats
|
|
7
|
+
attr_reader :projects
|
|
8
|
+
|
|
9
|
+
def initialize(
|
|
10
|
+
seats:,
|
|
11
|
+
projects:
|
|
12
|
+
)
|
|
13
|
+
@seats = seats
|
|
14
|
+
@projects = projects
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.from(map:)
|
|
18
|
+
BillingPlanAddon.new(
|
|
19
|
+
seats: BillingPlanAddonDetails.from(map: map["seats"]),
|
|
20
|
+
projects: BillingPlanAddonDetails.from(map: map["projects"])
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def to_map
|
|
25
|
+
{
|
|
26
|
+
"seats": @seats.to_map,
|
|
27
|
+
"projects": @projects.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 BillingPlanAddonDetails
|
|
6
|
+
attr_reader :supported
|
|
7
|
+
attr_reader :plan_included
|
|
8
|
+
attr_reader :limit
|
|
9
|
+
attr_reader :type
|
|
10
|
+
attr_reader :currency
|
|
11
|
+
attr_reader :price
|
|
12
|
+
attr_reader :value
|
|
13
|
+
attr_reader :invoice_desc
|
|
14
|
+
|
|
15
|
+
def initialize(
|
|
16
|
+
supported:,
|
|
17
|
+
plan_included:,
|
|
18
|
+
limit:,
|
|
19
|
+
type:,
|
|
20
|
+
currency:,
|
|
21
|
+
price:,
|
|
22
|
+
value:,
|
|
23
|
+
invoice_desc:
|
|
24
|
+
)
|
|
25
|
+
@supported = supported
|
|
26
|
+
@plan_included = plan_included
|
|
27
|
+
@limit = limit
|
|
28
|
+
@type = type
|
|
29
|
+
@currency = currency
|
|
30
|
+
@price = price
|
|
31
|
+
@value = value
|
|
32
|
+
@invoice_desc = invoice_desc
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
def self.from(map:)
|
|
36
|
+
BillingPlanAddonDetails.new(
|
|
37
|
+
supported: map["supported"],
|
|
38
|
+
plan_included: map["planIncluded"],
|
|
39
|
+
limit: map["limit"],
|
|
40
|
+
type: map["type"],
|
|
41
|
+
currency: map["currency"],
|
|
42
|
+
price: map["price"],
|
|
43
|
+
value: map["value"],
|
|
44
|
+
invoice_desc: map["invoiceDesc"]
|
|
45
|
+
)
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def to_map
|
|
49
|
+
{
|
|
50
|
+
"supported": @supported,
|
|
51
|
+
"planIncluded": @plan_included,
|
|
52
|
+
"limit": @limit,
|
|
53
|
+
"type": @type,
|
|
54
|
+
"currency": @currency,
|
|
55
|
+
"price": @price,
|
|
56
|
+
"value": @value,
|
|
57
|
+
"invoiceDesc": @invoice_desc
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class BillingPlanDedicatedDatabaseLimits
|
|
6
|
+
attr_reader :min_cpu
|
|
7
|
+
attr_reader :max_cpu
|
|
8
|
+
attr_reader :min_memory_mb
|
|
9
|
+
attr_reader :max_memory_mb
|
|
10
|
+
attr_reader :min_storage_gb
|
|
11
|
+
attr_reader :max_storage_gb
|
|
12
|
+
attr_reader :max_replicas
|
|
13
|
+
attr_reader :max_connections
|
|
14
|
+
attr_reader :max_ip_allowlist_size
|
|
15
|
+
attr_reader :max_extensions
|
|
16
|
+
attr_reader :max_backup_retention_days
|
|
17
|
+
attr_reader :max_pitr_retention_days
|
|
18
|
+
attr_reader :max_sql_api_max_rows
|
|
19
|
+
attr_reader :max_sql_api_max_bytes
|
|
20
|
+
attr_reader :max_sql_api_timeout_seconds
|
|
21
|
+
attr_reader :max_sql_api_allowed_statements
|
|
22
|
+
attr_reader :allowed_sql_statements
|
|
23
|
+
attr_reader :allowed_storage_classes
|
|
24
|
+
attr_reader :allowed_sync_modes
|
|
25
|
+
|
|
26
|
+
def initialize(
|
|
27
|
+
min_cpu: ,
|
|
28
|
+
max_cpu: ,
|
|
29
|
+
min_memory_mb: ,
|
|
30
|
+
max_memory_mb: ,
|
|
31
|
+
min_storage_gb: ,
|
|
32
|
+
max_storage_gb: ,
|
|
33
|
+
max_replicas: ,
|
|
34
|
+
max_connections: ,
|
|
35
|
+
max_ip_allowlist_size: ,
|
|
36
|
+
max_extensions: ,
|
|
37
|
+
max_backup_retention_days: ,
|
|
38
|
+
max_pitr_retention_days: ,
|
|
39
|
+
max_sql_api_max_rows: ,
|
|
40
|
+
max_sql_api_max_bytes: ,
|
|
41
|
+
max_sql_api_timeout_seconds: ,
|
|
42
|
+
max_sql_api_allowed_statements: ,
|
|
43
|
+
allowed_sql_statements: ,
|
|
44
|
+
allowed_storage_classes: ,
|
|
45
|
+
allowed_sync_modes:
|
|
46
|
+
)
|
|
47
|
+
@min_cpu = min_cpu
|
|
48
|
+
@max_cpu = max_cpu
|
|
49
|
+
@min_memory_mb = min_memory_mb
|
|
50
|
+
@max_memory_mb = max_memory_mb
|
|
51
|
+
@min_storage_gb = min_storage_gb
|
|
52
|
+
@max_storage_gb = max_storage_gb
|
|
53
|
+
@max_replicas = max_replicas
|
|
54
|
+
@max_connections = max_connections
|
|
55
|
+
@max_ip_allowlist_size = max_ip_allowlist_size
|
|
56
|
+
@max_extensions = max_extensions
|
|
57
|
+
@max_backup_retention_days = max_backup_retention_days
|
|
58
|
+
@max_pitr_retention_days = max_pitr_retention_days
|
|
59
|
+
@max_sql_api_max_rows = max_sql_api_max_rows
|
|
60
|
+
@max_sql_api_max_bytes = max_sql_api_max_bytes
|
|
61
|
+
@max_sql_api_timeout_seconds = max_sql_api_timeout_seconds
|
|
62
|
+
@max_sql_api_allowed_statements = max_sql_api_allowed_statements
|
|
63
|
+
@allowed_sql_statements = allowed_sql_statements
|
|
64
|
+
@allowed_storage_classes = allowed_storage_classes
|
|
65
|
+
@allowed_sync_modes = allowed_sync_modes
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def self.from(map:)
|
|
69
|
+
BillingPlanDedicatedDatabaseLimits.new(
|
|
70
|
+
min_cpu: map["minCpu"],
|
|
71
|
+
max_cpu: map["maxCpu"],
|
|
72
|
+
min_memory_mb: map["minMemoryMb"],
|
|
73
|
+
max_memory_mb: map["maxMemoryMb"],
|
|
74
|
+
min_storage_gb: map["minStorageGb"],
|
|
75
|
+
max_storage_gb: map["maxStorageGb"],
|
|
76
|
+
max_replicas: map["maxReplicas"],
|
|
77
|
+
max_connections: map["maxConnections"],
|
|
78
|
+
max_ip_allowlist_size: map["maxIpAllowlistSize"],
|
|
79
|
+
max_extensions: map["maxExtensions"],
|
|
80
|
+
max_backup_retention_days: map["maxBackupRetentionDays"],
|
|
81
|
+
max_pitr_retention_days: map["maxPitrRetentionDays"],
|
|
82
|
+
max_sql_api_max_rows: map["maxSqlApiMaxRows"],
|
|
83
|
+
max_sql_api_max_bytes: map["maxSqlApiMaxBytes"],
|
|
84
|
+
max_sql_api_timeout_seconds: map["maxSqlApiTimeoutSeconds"],
|
|
85
|
+
max_sql_api_allowed_statements: map["maxSqlApiAllowedStatements"],
|
|
86
|
+
allowed_sql_statements: map["allowedSqlStatements"],
|
|
87
|
+
allowed_storage_classes: map["allowedStorageClasses"],
|
|
88
|
+
allowed_sync_modes: map["allowedSyncModes"]
|
|
89
|
+
)
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
def to_map
|
|
93
|
+
{
|
|
94
|
+
"minCpu": @min_cpu,
|
|
95
|
+
"maxCpu": @max_cpu,
|
|
96
|
+
"minMemoryMb": @min_memory_mb,
|
|
97
|
+
"maxMemoryMb": @max_memory_mb,
|
|
98
|
+
"minStorageGb": @min_storage_gb,
|
|
99
|
+
"maxStorageGb": @max_storage_gb,
|
|
100
|
+
"maxReplicas": @max_replicas,
|
|
101
|
+
"maxConnections": @max_connections,
|
|
102
|
+
"maxIpAllowlistSize": @max_ip_allowlist_size,
|
|
103
|
+
"maxExtensions": @max_extensions,
|
|
104
|
+
"maxBackupRetentionDays": @max_backup_retention_days,
|
|
105
|
+
"maxPitrRetentionDays": @max_pitr_retention_days,
|
|
106
|
+
"maxSqlApiMaxRows": @max_sql_api_max_rows,
|
|
107
|
+
"maxSqlApiMaxBytes": @max_sql_api_max_bytes,
|
|
108
|
+
"maxSqlApiTimeoutSeconds": @max_sql_api_timeout_seconds,
|
|
109
|
+
"maxSqlApiAllowedStatements": @max_sql_api_allowed_statements,
|
|
110
|
+
"allowedSqlStatements": @allowed_sql_statements,
|
|
111
|
+
"allowedStorageClasses": @allowed_storage_classes,
|
|
112
|
+
"allowedSyncModes": @allowed_sync_modes
|
|
113
|
+
}
|
|
114
|
+
end
|
|
115
|
+
end
|
|
116
|
+
end
|
|
117
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
#frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class BillingPlanLimits
|
|
6
|
+
attr_reader :credits
|
|
7
|
+
attr_reader :daily_credits
|
|
8
|
+
|
|
9
|
+
def initialize(
|
|
10
|
+
credits: ,
|
|
11
|
+
daily_credits:
|
|
12
|
+
)
|
|
13
|
+
@credits = credits
|
|
14
|
+
@daily_credits = daily_credits
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.from(map:)
|
|
18
|
+
BillingPlanLimits.new(
|
|
19
|
+
credits: map["credits"],
|
|
20
|
+
daily_credits: map["dailyCredits"]
|
|
21
|
+
)
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
def to_map
|
|
25
|
+
{
|
|
26
|
+
"credits": @credits,
|
|
27
|
+
"dailyCredits": @daily_credits
|
|
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 BillingPlanSupportedAddons
|
|
6
|
+
attr_reader :baa
|
|
7
|
+
attr_reader :premium_geo_db
|
|
8
|
+
attr_reader :premium_geo_db_org
|
|
9
|
+
|
|
10
|
+
def initialize(
|
|
11
|
+
baa:,
|
|
12
|
+
premium_geo_db:,
|
|
13
|
+
premium_geo_db_org:
|
|
14
|
+
)
|
|
15
|
+
@baa = baa
|
|
16
|
+
@premium_geo_db = premium_geo_db
|
|
17
|
+
@premium_geo_db_org = premium_geo_db_org
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def self.from(map:)
|
|
21
|
+
BillingPlanSupportedAddons.new(
|
|
22
|
+
baa: map["baa"],
|
|
23
|
+
premium_geo_db: map["premiumGeoDB"],
|
|
24
|
+
premium_geo_db_org: map["premiumGeoDBOrg"]
|
|
25
|
+
)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def to_map
|
|
29
|
+
{
|
|
30
|
+
"baa": @baa,
|
|
31
|
+
"premiumGeoDB": @premium_geo_db,
|
|
32
|
+
"premiumGeoDBOrg": @premium_geo_db_org
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
end
|