appwrite 28.3.1 → 28.4.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.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +20 -4
  3. data/lib/appwrite/enums/billing_plan_group.rb +2 -0
  4. data/lib/appwrite/enums/build_runtime.rb +2 -0
  5. data/lib/appwrite/enums/databases_index_type.rb +1 -0
  6. data/lib/appwrite/enums/domain_registration_type.rb +10 -0
  7. data/lib/appwrite/enums/domain_transfer_status_enum.rb +14 -0
  8. data/lib/appwrite/enums/framework.rb +1 -0
  9. data/lib/appwrite/enums/id_token_provider.rb +8 -0
  10. data/lib/appwrite/enums/image_gravity.rb +1 -0
  11. data/lib/appwrite/enums/o_auth2_auth0_prompt.rb +9 -0
  12. data/lib/appwrite/enums/o_auth2_discord_prompt.rb +8 -0
  13. data/lib/appwrite/enums/o_auth2_github_prompt.rb +7 -0
  14. data/lib/appwrite/enums/o_auth2_kakao_prompt.rb +10 -0
  15. data/lib/appwrite/enums/o_auth2_microsoft_prompt.rb +10 -0
  16. data/lib/appwrite/enums/o_auth2_okta_prompt.rb +9 -0
  17. data/lib/appwrite/enums/o_auth2_salesforce_prompt.rb +8 -0
  18. data/lib/appwrite/enums/o_auth2_zoho_prompt.rb +7 -0
  19. data/lib/appwrite/enums/o_auth_provider.rb +3 -0
  20. data/lib/appwrite/enums/project_email_template_id.rb +2 -0
  21. data/lib/appwrite/enums/project_key_scopes.rb +4 -0
  22. data/lib/appwrite/enums/project_o_auth2_auth0_prompt.rb +9 -0
  23. data/lib/appwrite/enums/project_o_auth2_discord_prompt.rb +8 -0
  24. data/lib/appwrite/enums/project_o_auth2_git_hub_prompt.rb +7 -0
  25. data/lib/appwrite/enums/project_o_auth2_kakao_prompt.rb +10 -0
  26. data/lib/appwrite/enums/project_o_auth2_microsoft_prompt.rb +10 -0
  27. data/lib/appwrite/enums/project_o_auth2_okta_prompt.rb +9 -0
  28. data/lib/appwrite/enums/project_o_auth2_salesforce_prompt.rb +8 -0
  29. data/lib/appwrite/enums/project_o_auth2_zoho_prompt.rb +7 -0
  30. data/lib/appwrite/enums/project_o_auth_provider_id.rb +3 -0
  31. data/lib/appwrite/enums/project_policy_id.rb +2 -0
  32. data/lib/appwrite/enums/proxy_rule_deployment_resource_type.rb +1 -0
  33. data/lib/appwrite/enums/runtime.rb +2 -0
  34. data/lib/appwrite/enums/tables_db_index_type.rb +1 -0
  35. data/lib/appwrite/enums/waf_rule_action.rb +11 -0
  36. data/lib/appwrite/models/account.rb +143 -0
  37. data/lib/appwrite/models/billing_plan.rb +12 -0
  38. data/lib/appwrite/models/dedicated_database.rb +15 -0
  39. data/lib/appwrite/models/dedicated_database_specification.rb +20 -0
  40. data/lib/appwrite/models/dns_record.rb +83 -0
  41. data/lib/appwrite/models/dns_records_list.rb +33 -0
  42. data/lib/appwrite/models/domain.rb +109 -0
  43. data/lib/appwrite/models/domain_price.rb +63 -0
  44. data/lib/appwrite/models/domain_prices_list.rb +33 -0
  45. data/lib/appwrite/models/domain_transfer_status.rb +59 -0
  46. data/lib/appwrite/models/domains_list.rb +33 -0
  47. data/lib/appwrite/models/identity.rb +8 -3
  48. data/lib/appwrite/models/o_auth2_apple.rb +13 -3
  49. data/lib/appwrite/models/o_auth2_auth0.rb +23 -0
  50. data/lib/appwrite/models/o_auth2_discord.rb +25 -3
  51. data/lib/appwrite/models/o_auth2_github.rb +24 -3
  52. data/lib/appwrite/models/o_auth2_google.rb +17 -5
  53. data/lib/appwrite/models/o_auth2_kakao.rb +67 -0
  54. data/lib/appwrite/models/o_auth2_microsoft.rb +24 -0
  55. data/lib/appwrite/models/o_auth2_oidc.rb +4 -2
  56. data/lib/appwrite/models/o_auth2_okta.rb +23 -0
  57. data/lib/appwrite/models/o_auth2_salesforce.rb +25 -3
  58. data/lib/appwrite/models/o_auth2_tik_tok.rb +43 -0
  59. data/lib/appwrite/models/o_auth2_webflow.rb +43 -0
  60. data/lib/appwrite/models/o_auth2_zoho.rb +24 -3
  61. data/lib/appwrite/models/oauth2_introspection.rb +83 -0
  62. data/lib/appwrite/models/platform_android.rb +8 -3
  63. data/lib/appwrite/models/policy_password_pwned.rb +43 -0
  64. data/lib/appwrite/models/policy_password_rotation.rb +38 -0
  65. data/lib/appwrite/models/project.rb +15 -0
  66. data/lib/appwrite/models/project_service.rb +1 -0
  67. data/lib/appwrite/models/proxy_rule.rb +1 -0
  68. data/lib/appwrite/models/topic.rb +13 -3
  69. data/lib/appwrite/models/user.rb +5 -0
  70. data/lib/appwrite/models/waf_rule_bypass.rb +111 -0
  71. data/lib/appwrite/models/waf_rule_challenge.rb +126 -0
  72. data/lib/appwrite/models/waf_rule_deny.rb +111 -0
  73. data/lib/appwrite/models/waf_rule_list.rb +33 -0
  74. data/lib/appwrite/models/waf_rule_rate_limit.rb +136 -0
  75. data/lib/appwrite/models/waf_rule_redirect.rb +121 -0
  76. data/lib/appwrite/services/account.rb +301 -5
  77. data/lib/appwrite/services/avatars.rb +71 -0
  78. data/lib/appwrite/services/databases.rb +4 -1
  79. data/lib/appwrite/services/documents_db.rb +4 -1
  80. data/lib/appwrite/services/domains.rb +2318 -0
  81. data/lib/appwrite/services/functions.rb +11 -3
  82. data/lib/appwrite/services/locale.rb +49 -14
  83. data/lib/appwrite/services/messaging.rb +130 -6
  84. data/lib/appwrite/services/oauth2.rb +45 -0
  85. data/lib/appwrite/services/organization.rb +225 -0
  86. data/lib/appwrite/services/project.rb +439 -15
  87. data/lib/appwrite/services/sites.rb +11 -3
  88. data/lib/appwrite/services/tables_db.rb +4 -1
  89. data/lib/appwrite/services/teams.rb +4 -1
  90. data/lib/appwrite/services/vectors_db.rb +4 -1
  91. data/lib/appwrite/services/waf.rb +859 -0
  92. data/lib/appwrite.rb +42 -0
  93. metadata +44 -2
@@ -0,0 +1,2318 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ class Domains < Service
5
+ def initialize(client)
6
+ @client = client
7
+ end
8
+
9
+ # List all domains registered for this project. This endpoint supports
10
+ # pagination.
11
+ #
12
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on attributes such as domain name, teamInternalId, expiration, etc.
13
+ # @param [String] search Search term to filter your list results. Max length: 256 chars.
14
+ #
15
+ # @return [DomainsList]
16
+ def list(
17
+ queries: nil,
18
+ search: nil
19
+ )
20
+ api_path = '/domains'
21
+
22
+ api_params = {
23
+ queries: queries,
24
+ search: search,
25
+ }
26
+
27
+ api_headers = {
28
+ "X-Appwrite-Project": @client.get_config('project'),
29
+ "accept": 'application/json',
30
+ }
31
+
32
+ @client.call(
33
+ method: 'GET',
34
+ path: api_path,
35
+ headers: api_headers,
36
+ params: api_params,
37
+ response_type: Models::DomainsList
38
+ )
39
+ end
40
+
41
+ # Create a new domain. Before creating a domain, you need to ensure that your
42
+ # DNS provider is properly configured. After creating the domain, you can use
43
+ # the verification endpoint to check if the domain is ready to be used.
44
+ #
45
+ # @param [String] team_id Team unique ID.
46
+ # @param [String] domain Domain name (e.g. &quot;example.com&quot;).
47
+ #
48
+ # @return [Domain]
49
+ def create(
50
+ team_id:,
51
+ domain:
52
+ )
53
+ if team_id.nil?
54
+ raise Appwrite::Exception.new('Missing required parameter: "teamId"')
55
+ end
56
+
57
+ if domain.nil?
58
+ raise Appwrite::Exception.new('Missing required parameter: "domain"')
59
+ end
60
+
61
+ api_path = '/domains'
62
+
63
+ api_params = {
64
+ teamId: team_id,
65
+ domain: domain,
66
+ }
67
+
68
+ api_headers = {
69
+ "X-Appwrite-Project": @client.get_config('project'),
70
+ "content-type": 'application/json',
71
+ "accept": 'application/json',
72
+ }
73
+
74
+ @client.call(
75
+ method: 'POST',
76
+ path: api_path,
77
+ headers: api_headers,
78
+ params: api_params,
79
+ response_type: Models::Domain
80
+ )
81
+ end
82
+
83
+ #
84
+ # @deprecated This API has been deprecated since 2.0.0. Please use `Domains.listPrices` instead.
85
+ #
86
+ # Get the registration price for a domain name.
87
+ #
88
+ # @param [String] domain Domain name to get price for.
89
+ # @param [Integer] period_years Number of years to calculate the domain price for. Must be at least 1.
90
+ # @param [DomainRegistrationType] registration_type Type of registration pricing to fetch. Allowed values: new, transfer, renewal, trade.
91
+ #
92
+ # @return [DomainPrice]
93
+ def get_price(
94
+ domain:,
95
+ period_years: nil,
96
+ registration_type: nil
97
+ )
98
+ if domain.nil?
99
+ raise Appwrite::Exception.new('Missing required parameter: "domain"')
100
+ end
101
+
102
+ api_path = '/domains/price'
103
+
104
+ api_params = {
105
+ domain: domain,
106
+ periodYears: period_years,
107
+ registrationType: registration_type,
108
+ }
109
+
110
+ api_headers = {
111
+ "X-Appwrite-Project": @client.get_config('project'),
112
+ "accept": 'application/json',
113
+ }
114
+
115
+ @client.call(
116
+ method: 'GET',
117
+ path: api_path,
118
+ headers: api_headers,
119
+ params: api_params,
120
+ response_type: Models::DomainPrice
121
+ )
122
+ end
123
+
124
+ # Check availability and get the requested registration price for one or more
125
+ # domain names. Availability is resolved for all domains in a single
126
+ # registrar lookup. Unavailable domains have a null price for new
127
+ # registrations, but can still be priced for renewal, transfer, or trade.
128
+ # Every priced domain also carries its renewal price for the same period, so
129
+ # a separate renewal lookup is not needed. A domain whose price could not be
130
+ # resolved, for example because its TLD is not supported, is returned with a
131
+ # null price.
132
+ #
133
+ # @param [Array] domains Domain names to check availability and price for. Maximum of 50 domains per request.
134
+ # @param [Integer] period_years Number of years to calculate the domain price for. Must be at least 1.
135
+ # @param [DomainRegistrationType] registration_type Type of registration pricing to fetch. Allowed values: new, transfer, renewal, trade.
136
+ #
137
+ # @return [DomainPricesList]
138
+ def list_prices(
139
+ domains:,
140
+ period_years: nil,
141
+ registration_type: nil
142
+ )
143
+ if domains.nil?
144
+ raise Appwrite::Exception.new('Missing required parameter: "domains"')
145
+ end
146
+
147
+ api_path = '/domains/prices'
148
+
149
+ api_params = {
150
+ domains: domains,
151
+ periodYears: period_years,
152
+ registrationType: registration_type,
153
+ }
154
+
155
+ api_headers = {
156
+ "X-Appwrite-Project": @client.get_config('project'),
157
+ "accept": 'application/json',
158
+ }
159
+
160
+ @client.call(
161
+ method: 'GET',
162
+ path: api_path,
163
+ headers: api_headers,
164
+ params: api_params,
165
+ response_type: Models::DomainPricesList
166
+ )
167
+ end
168
+
169
+ # Get a domain by its unique ID.
170
+ #
171
+ # @param [String] domain_id Domain unique ID.
172
+ #
173
+ # @return [Domain]
174
+ def get(
175
+ domain_id:
176
+ )
177
+ if domain_id.nil?
178
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
179
+ end
180
+
181
+ api_path = '/domains/{domainId}'
182
+ .gsub('{domainId}', domain_id)
183
+
184
+ api_params = {}
185
+
186
+ api_headers = {
187
+ "X-Appwrite-Project": @client.get_config('project'),
188
+ "accept": 'application/json',
189
+ }
190
+
191
+ @client.call(
192
+ method: 'GET',
193
+ path: api_path,
194
+ headers: api_headers,
195
+ params: api_params,
196
+ response_type: Models::Domain
197
+ )
198
+ end
199
+
200
+ # Delete a domain by its unique ID. This endpoint can be used to delete a
201
+ # domain from your project.
202
+ # Once deleted, the domain will no longer be available for use and all
203
+ # associated resources will be removed.
204
+ #
205
+ # @param [String] domain_id Domain unique ID.
206
+ #
207
+ # @return []
208
+ def delete(
209
+ domain_id:
210
+ )
211
+ if domain_id.nil?
212
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
213
+ end
214
+
215
+ api_path = '/domains/{domainId}'
216
+ .gsub('{domainId}', domain_id)
217
+
218
+ api_params = {}
219
+
220
+ api_headers = {
221
+ "X-Appwrite-Project": @client.get_config('project'),
222
+ "content-type": 'application/json',
223
+ "accept": 'application/json',
224
+ }
225
+
226
+ @client.call(
227
+ method: 'DELETE',
228
+ path: api_path,
229
+ headers: api_headers,
230
+ params: api_params,
231
+ )
232
+ end
233
+
234
+ # Update the registrar nameservers for the given domain. When nameservers are
235
+ # not provided,
236
+ # the domain will be updated to use Appwrite nameservers.
237
+ #
238
+ # @param [String] domain_id Domain unique ID.
239
+ # @param [Array] nameservers Nameservers to set for the domain. Defaults to Appwrite nameservers when omitted.
240
+ #
241
+ # @return [Domain]
242
+ def update_nameservers(
243
+ domain_id:,
244
+ nameservers: nil
245
+ )
246
+ if domain_id.nil?
247
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
248
+ end
249
+
250
+ api_path = '/domains/{domainId}/nameservers'
251
+ .gsub('{domainId}', domain_id)
252
+
253
+ api_params = {
254
+ nameservers: nameservers,
255
+ }
256
+
257
+ api_headers = {
258
+ "X-Appwrite-Project": @client.get_config('project'),
259
+ "content-type": 'application/json',
260
+ "accept": 'application/json',
261
+ }
262
+
263
+ @client.call(
264
+ method: 'PATCH',
265
+ path: api_path,
266
+ headers: api_headers,
267
+ params: api_params,
268
+ response_type: Models::Domain
269
+ )
270
+ end
271
+
272
+ # Verify which NS records are used and update the domain accordingly. This
273
+ # will check the domain&#039;s
274
+ # nameservers and update the domain&#039;s status based on whether the nameservers
275
+ # match the expected
276
+ # Appwrite nameservers.
277
+ #
278
+ # @param [String] domain_id Domain unique ID.
279
+ #
280
+ # @return [Domain]
281
+ def verify_nameservers(
282
+ domain_id:
283
+ )
284
+ if domain_id.nil?
285
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
286
+ end
287
+
288
+ api_path = '/domains/{domainId}/nameservers/verification'
289
+ .gsub('{domainId}', domain_id)
290
+
291
+ api_params = {}
292
+
293
+ api_headers = {
294
+ "X-Appwrite-Project": @client.get_config('project'),
295
+ "content-type": 'application/json',
296
+ "accept": 'application/json',
297
+ }
298
+
299
+ @client.call(
300
+ method: 'PATCH',
301
+ path: api_path,
302
+ headers: api_headers,
303
+ params: api_params,
304
+ response_type: Models::Domain
305
+ )
306
+ end
307
+
308
+ # List Google Workspace DNS records.
309
+ #
310
+ # @param [String] domain_id Domain unique ID.
311
+ #
312
+ # @return [DnsRecordsList]
313
+ def get_preset_google_workspace(
314
+ domain_id:
315
+ )
316
+ if domain_id.nil?
317
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
318
+ end
319
+
320
+ api_path = '/domains/{domainId}/presets/google-workspace'
321
+ .gsub('{domainId}', domain_id)
322
+
323
+ api_params = {}
324
+
325
+ api_headers = {
326
+ "X-Appwrite-Project": @client.get_config('project'),
327
+ "accept": 'application/json',
328
+ }
329
+
330
+ @client.call(
331
+ method: 'GET',
332
+ path: api_path,
333
+ headers: api_headers,
334
+ params: api_params,
335
+ response_type: Models::DnsRecordsList
336
+ )
337
+ end
338
+
339
+ # Add Google Workspace DNS records to the domain. This will create the
340
+ # required MX records
341
+ # for Google Workspace email hosting.
342
+ #
343
+ # @param [String] domain_id Domain unique ID.
344
+ #
345
+ # @return [DnsRecordsList]
346
+ def create_preset_google_workspace(
347
+ domain_id:
348
+ )
349
+ if domain_id.nil?
350
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
351
+ end
352
+
353
+ api_path = '/domains/{domainId}/presets/google-workspace'
354
+ .gsub('{domainId}', domain_id)
355
+
356
+ api_params = {}
357
+
358
+ api_headers = {
359
+ "X-Appwrite-Project": @client.get_config('project'),
360
+ "content-type": 'application/json',
361
+ "accept": 'application/json',
362
+ }
363
+
364
+ @client.call(
365
+ method: 'POST',
366
+ path: api_path,
367
+ headers: api_headers,
368
+ params: api_params,
369
+ response_type: Models::DnsRecordsList
370
+ )
371
+ end
372
+
373
+ # List iCloud DNS records.
374
+ #
375
+ # @param [String] domain_id Domain unique ID.
376
+ #
377
+ # @return [DnsRecordsList]
378
+ def get_preset_i_cloud(
379
+ domain_id:
380
+ )
381
+ if domain_id.nil?
382
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
383
+ end
384
+
385
+ api_path = '/domains/{domainId}/presets/icloud'
386
+ .gsub('{domainId}', domain_id)
387
+
388
+ api_params = {}
389
+
390
+ api_headers = {
391
+ "X-Appwrite-Project": @client.get_config('project'),
392
+ "accept": 'application/json',
393
+ }
394
+
395
+ @client.call(
396
+ method: 'GET',
397
+ path: api_path,
398
+ headers: api_headers,
399
+ params: api_params,
400
+ response_type: Models::DnsRecordsList
401
+ )
402
+ end
403
+
404
+ # Add iCloud DNS records to the domain. This will create the required MX and
405
+ # SPF records
406
+ # for using iCloud email services with your domain.
407
+ #
408
+ # @param [String] domain_id Domain unique ID.
409
+ #
410
+ # @return [DnsRecordsList]
411
+ def create_preset_i_cloud(
412
+ domain_id:
413
+ )
414
+ if domain_id.nil?
415
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
416
+ end
417
+
418
+ api_path = '/domains/{domainId}/presets/icloud'
419
+ .gsub('{domainId}', domain_id)
420
+
421
+ api_params = {}
422
+
423
+ api_headers = {
424
+ "X-Appwrite-Project": @client.get_config('project'),
425
+ "content-type": 'application/json',
426
+ "accept": 'application/json',
427
+ }
428
+
429
+ @client.call(
430
+ method: 'POST',
431
+ path: api_path,
432
+ headers: api_headers,
433
+ params: api_params,
434
+ response_type: Models::DnsRecordsList
435
+ )
436
+ end
437
+
438
+ # List Mailgun DNS records.
439
+ #
440
+ # @param [String] domain_id Domain unique ID.
441
+ #
442
+ # @return [DnsRecordsList]
443
+ def get_preset_mailgun(
444
+ domain_id:
445
+ )
446
+ if domain_id.nil?
447
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
448
+ end
449
+
450
+ api_path = '/domains/{domainId}/presets/mailgun'
451
+ .gsub('{domainId}', domain_id)
452
+
453
+ api_params = {}
454
+
455
+ api_headers = {
456
+ "X-Appwrite-Project": @client.get_config('project'),
457
+ "accept": 'application/json',
458
+ }
459
+
460
+ @client.call(
461
+ method: 'GET',
462
+ path: api_path,
463
+ headers: api_headers,
464
+ params: api_params,
465
+ response_type: Models::DnsRecordsList
466
+ )
467
+ end
468
+
469
+ # Add Mailgun DNS records to the domain. This endpoint will create the
470
+ # required DNS records
471
+ # for Mailgun in the specified domain.
472
+ #
473
+ # @param [String] domain_id Domain unique ID.
474
+ #
475
+ # @return [DnsRecordsList]
476
+ def create_preset_mailgun(
477
+ domain_id:
478
+ )
479
+ if domain_id.nil?
480
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
481
+ end
482
+
483
+ api_path = '/domains/{domainId}/presets/mailgun'
484
+ .gsub('{domainId}', domain_id)
485
+
486
+ api_params = {}
487
+
488
+ api_headers = {
489
+ "X-Appwrite-Project": @client.get_config('project'),
490
+ "content-type": 'application/json',
491
+ "accept": 'application/json',
492
+ }
493
+
494
+ @client.call(
495
+ method: 'POST',
496
+ path: api_path,
497
+ headers: api_headers,
498
+ params: api_params,
499
+ response_type: Models::DnsRecordsList
500
+ )
501
+ end
502
+
503
+ # List Outlook DNS records.
504
+ #
505
+ # @param [String] domain_id Domain unique ID.
506
+ #
507
+ # @return [DnsRecordsList]
508
+ def get_preset_outlook(
509
+ domain_id:
510
+ )
511
+ if domain_id.nil?
512
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
513
+ end
514
+
515
+ api_path = '/domains/{domainId}/presets/outlook'
516
+ .gsub('{domainId}', domain_id)
517
+
518
+ api_params = {}
519
+
520
+ api_headers = {
521
+ "X-Appwrite-Project": @client.get_config('project'),
522
+ "accept": 'application/json',
523
+ }
524
+
525
+ @client.call(
526
+ method: 'GET',
527
+ path: api_path,
528
+ headers: api_headers,
529
+ params: api_params,
530
+ response_type: Models::DnsRecordsList
531
+ )
532
+ end
533
+
534
+ # Add Outlook DNS records to the domain. This will create the required MX
535
+ # records
536
+ # for setting up Outlook email hosting for your domain.
537
+ #
538
+ # @param [String] domain_id Domain unique ID.
539
+ #
540
+ # @return [DnsRecordsList]
541
+ def create_preset_outlook(
542
+ domain_id:
543
+ )
544
+ if domain_id.nil?
545
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
546
+ end
547
+
548
+ api_path = '/domains/{domainId}/presets/outlook'
549
+ .gsub('{domainId}', domain_id)
550
+
551
+ api_params = {}
552
+
553
+ api_headers = {
554
+ "X-Appwrite-Project": @client.get_config('project'),
555
+ "content-type": 'application/json',
556
+ "accept": 'application/json',
557
+ }
558
+
559
+ @client.call(
560
+ method: 'POST',
561
+ path: api_path,
562
+ headers: api_headers,
563
+ params: api_params,
564
+ response_type: Models::DnsRecordsList
565
+ )
566
+ end
567
+
568
+ # List ProtonMail DNS records.
569
+ #
570
+ # @param [String] domain_id Domain unique ID.
571
+ #
572
+ # @return [DnsRecordsList]
573
+ def get_preset_proton_mail(
574
+ domain_id:
575
+ )
576
+ if domain_id.nil?
577
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
578
+ end
579
+
580
+ api_path = '/domains/{domainId}/presets/proton-mail'
581
+ .gsub('{domainId}', domain_id)
582
+
583
+ api_params = {}
584
+
585
+ api_headers = {
586
+ "X-Appwrite-Project": @client.get_config('project'),
587
+ "accept": 'application/json',
588
+ }
589
+
590
+ @client.call(
591
+ method: 'GET',
592
+ path: api_path,
593
+ headers: api_headers,
594
+ params: api_params,
595
+ response_type: Models::DnsRecordsList
596
+ )
597
+ end
598
+
599
+ # Add ProtonMail DNS records to the domain. This will create the required MX
600
+ # records
601
+ # for using ProtonMail with your custom domain.
602
+ #
603
+ # @param [String] domain_id Domain unique ID.
604
+ #
605
+ # @return [DnsRecordsList]
606
+ def create_preset_proton_mail(
607
+ domain_id:
608
+ )
609
+ if domain_id.nil?
610
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
611
+ end
612
+
613
+ api_path = '/domains/{domainId}/presets/proton-mail'
614
+ .gsub('{domainId}', domain_id)
615
+
616
+ api_params = {}
617
+
618
+ api_headers = {
619
+ "X-Appwrite-Project": @client.get_config('project'),
620
+ "content-type": 'application/json',
621
+ "accept": 'application/json',
622
+ }
623
+
624
+ @client.call(
625
+ method: 'POST',
626
+ path: api_path,
627
+ headers: api_headers,
628
+ params: api_params,
629
+ response_type: Models::DnsRecordsList
630
+ )
631
+ end
632
+
633
+ # List Zoho DNS records.
634
+ #
635
+ # @param [String] domain_id Domain unique ID.
636
+ #
637
+ # @return [DnsRecordsList]
638
+ def get_preset_zoho(
639
+ domain_id:
640
+ )
641
+ if domain_id.nil?
642
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
643
+ end
644
+
645
+ api_path = '/domains/{domainId}/presets/zoho'
646
+ .gsub('{domainId}', domain_id)
647
+
648
+ api_params = {}
649
+
650
+ api_headers = {
651
+ "X-Appwrite-Project": @client.get_config('project'),
652
+ "accept": 'application/json',
653
+ }
654
+
655
+ @client.call(
656
+ method: 'GET',
657
+ path: api_path,
658
+ headers: api_headers,
659
+ params: api_params,
660
+ response_type: Models::DnsRecordsList
661
+ )
662
+ end
663
+
664
+ # Add Zoho Mail DNS records to the domain. This will create the required MX
665
+ # records
666
+ # for setting up Zoho Mail on your domain.
667
+ #
668
+ # @param [String] domain_id Domain unique ID.
669
+ #
670
+ # @return [DnsRecordsList]
671
+ def create_preset_zoho(
672
+ domain_id:
673
+ )
674
+ if domain_id.nil?
675
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
676
+ end
677
+
678
+ api_path = '/domains/{domainId}/presets/zoho'
679
+ .gsub('{domainId}', domain_id)
680
+
681
+ api_params = {}
682
+
683
+ api_headers = {
684
+ "X-Appwrite-Project": @client.get_config('project'),
685
+ "content-type": 'application/json',
686
+ "accept": 'application/json',
687
+ }
688
+
689
+ @client.call(
690
+ method: 'POST',
691
+ path: api_path,
692
+ headers: api_headers,
693
+ params: api_params,
694
+ response_type: Models::DnsRecordsList
695
+ )
696
+ end
697
+
698
+ # List DNS records for a given domain. You can use this endpoint to list all
699
+ # the DNS records
700
+ # associated with your domain.
701
+ #
702
+ # @param [String] domain_id Domain unique ID.
703
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. You may filter on attributes such as type, name, value, etc. Maximum of 100 queries are allowed, each 4096 characters long.
704
+ #
705
+ # @return [DnsRecordsList]
706
+ def list_records(
707
+ domain_id:,
708
+ queries: nil
709
+ )
710
+ if domain_id.nil?
711
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
712
+ end
713
+
714
+ api_path = '/domains/{domainId}/records'
715
+ .gsub('{domainId}', domain_id)
716
+
717
+ api_params = {
718
+ queries: queries,
719
+ }
720
+
721
+ api_headers = {
722
+ "X-Appwrite-Project": @client.get_config('project'),
723
+ "accept": 'application/json',
724
+ }
725
+
726
+ @client.call(
727
+ method: 'GET',
728
+ path: api_path,
729
+ headers: api_headers,
730
+ params: api_params,
731
+ response_type: Models::DnsRecordsList
732
+ )
733
+ end
734
+
735
+ # Create a new A record for the given domain. A records are used to point a
736
+ # domain name
737
+ # to an IPv4 address. The record value should be a valid IPv4 address.
738
+ #
739
+ # @param [String] domain_id Domain unique ID.
740
+ # @param [String] name Record name (subdomain).
741
+ # @param [String] value IPv4 address for this A record.
742
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
743
+ # @param [String] comment A comment explaining what this record is for.
744
+ #
745
+ # @return [DnsRecord]
746
+ def create_record_a(
747
+ domain_id:,
748
+ name:,
749
+ value:,
750
+ ttl:,
751
+ comment: nil
752
+ )
753
+ if domain_id.nil?
754
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
755
+ end
756
+
757
+ if name.nil?
758
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
759
+ end
760
+
761
+ if value.nil?
762
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
763
+ end
764
+
765
+ if ttl.nil?
766
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
767
+ end
768
+
769
+ api_path = '/domains/{domainId}/records/a'
770
+ .gsub('{domainId}', domain_id)
771
+
772
+ api_params = {
773
+ name: name,
774
+ value: value,
775
+ ttl: ttl,
776
+ comment: comment,
777
+ }
778
+
779
+ api_headers = {
780
+ "X-Appwrite-Project": @client.get_config('project'),
781
+ "content-type": 'application/json',
782
+ "accept": 'application/json',
783
+ }
784
+
785
+ @client.call(
786
+ method: 'POST',
787
+ path: api_path,
788
+ headers: api_headers,
789
+ params: api_params,
790
+ response_type: Models::DnsRecord
791
+ )
792
+ end
793
+
794
+ # Update an existing A record for the given domain. This endpoint allows you
795
+ # to modify
796
+ # the properties of an A record including its name (subdomain), IPv4 address,
797
+ # TTL,
798
+ # and optional comment.
799
+ #
800
+ # @param [String] domain_id Domain unique ID.
801
+ # @param [String] record_id DNS record unique ID.
802
+ # @param [String] name Record name (subdomain).
803
+ # @param [String] value IPv4 address for this A record.
804
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
805
+ # @param [String] comment A comment explaining what this record is for.
806
+ #
807
+ # @return [DnsRecord]
808
+ def update_record_a(
809
+ domain_id:,
810
+ record_id:,
811
+ name:,
812
+ value:,
813
+ ttl:,
814
+ comment: nil
815
+ )
816
+ if domain_id.nil?
817
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
818
+ end
819
+
820
+ if record_id.nil?
821
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
822
+ end
823
+
824
+ if name.nil?
825
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
826
+ end
827
+
828
+ if value.nil?
829
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
830
+ end
831
+
832
+ if ttl.nil?
833
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
834
+ end
835
+
836
+ api_path = '/domains/{domainId}/records/a/{recordId}'
837
+ .gsub('{domainId}', domain_id)
838
+ .gsub('{recordId}', record_id)
839
+
840
+ api_params = {
841
+ name: name,
842
+ value: value,
843
+ ttl: ttl,
844
+ comment: comment,
845
+ }
846
+
847
+ api_headers = {
848
+ "X-Appwrite-Project": @client.get_config('project'),
849
+ "content-type": 'application/json',
850
+ "accept": 'application/json',
851
+ }
852
+
853
+ @client.call(
854
+ method: 'PUT',
855
+ path: api_path,
856
+ headers: api_headers,
857
+ params: api_params,
858
+ response_type: Models::DnsRecord
859
+ )
860
+ end
861
+
862
+ # Create a new AAAA record for the given domain. This endpoint allows you to
863
+ # add a new IPv6 DNS record
864
+ # to your domain. The record will be used to point a hostname to an IPv6
865
+ # address.
866
+ #
867
+ # @param [String] domain_id Domain unique ID.
868
+ # @param [String] name Record name (subdomain).
869
+ # @param [String] value IPv6 address for this AAAA record.
870
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
871
+ # @param [String] comment A comment explaining what this record is for.
872
+ #
873
+ # @return [DnsRecord]
874
+ def create_record_aaaa(
875
+ domain_id:,
876
+ name:,
877
+ value:,
878
+ ttl:,
879
+ comment: nil
880
+ )
881
+ if domain_id.nil?
882
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
883
+ end
884
+
885
+ if name.nil?
886
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
887
+ end
888
+
889
+ if value.nil?
890
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
891
+ end
892
+
893
+ if ttl.nil?
894
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
895
+ end
896
+
897
+ api_path = '/domains/{domainId}/records/aaaa'
898
+ .gsub('{domainId}', domain_id)
899
+
900
+ api_params = {
901
+ name: name,
902
+ value: value,
903
+ ttl: ttl,
904
+ comment: comment,
905
+ }
906
+
907
+ api_headers = {
908
+ "X-Appwrite-Project": @client.get_config('project'),
909
+ "content-type": 'application/json',
910
+ "accept": 'application/json',
911
+ }
912
+
913
+ @client.call(
914
+ method: 'POST',
915
+ path: api_path,
916
+ headers: api_headers,
917
+ params: api_params,
918
+ response_type: Models::DnsRecord
919
+ )
920
+ end
921
+
922
+ # Update an existing AAAA record for the given domain. This endpoint allows
923
+ # you to modify
924
+ # the properties of an existing AAAA record, including its name (subdomain),
925
+ # IPv6 address,
926
+ # TTL, and optional comment.
927
+ #
928
+ # @param [String] domain_id Domain unique ID.
929
+ # @param [String] record_id DNS record unique ID.
930
+ # @param [String] name Record name (subdomain).
931
+ # @param [String] value IPv6 address for this AAAA record.
932
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
933
+ # @param [String] comment A comment for this record.
934
+ #
935
+ # @return [DnsRecord]
936
+ def update_record_aaaa(
937
+ domain_id:,
938
+ record_id:,
939
+ name:,
940
+ value:,
941
+ ttl:,
942
+ comment: nil
943
+ )
944
+ if domain_id.nil?
945
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
946
+ end
947
+
948
+ if record_id.nil?
949
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
950
+ end
951
+
952
+ if name.nil?
953
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
954
+ end
955
+
956
+ if value.nil?
957
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
958
+ end
959
+
960
+ if ttl.nil?
961
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
962
+ end
963
+
964
+ api_path = '/domains/{domainId}/records/aaaa/{recordId}'
965
+ .gsub('{domainId}', domain_id)
966
+ .gsub('{recordId}', record_id)
967
+
968
+ api_params = {
969
+ name: name,
970
+ value: value,
971
+ ttl: ttl,
972
+ comment: comment,
973
+ }
974
+
975
+ api_headers = {
976
+ "X-Appwrite-Project": @client.get_config('project'),
977
+ "content-type": 'application/json',
978
+ "accept": 'application/json',
979
+ }
980
+
981
+ @client.call(
982
+ method: 'PUT',
983
+ path: api_path,
984
+ headers: api_headers,
985
+ params: api_params,
986
+ response_type: Models::DnsRecord
987
+ )
988
+ end
989
+
990
+ # Create a new ALIAS record for the given domain. This record type can be
991
+ # used to point your domain
992
+ # to another domain name that will serve as an alias. This is particularly
993
+ # useful when you want to
994
+ # map your domain to a target domain that may change its IP address.
995
+ #
996
+ # @param [String] domain_id Domain unique ID.
997
+ # @param [String] name Record name.
998
+ # @param [String] value Target domain for this ALIAS record.
999
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1000
+ # @param [String] comment A comment for this record.
1001
+ #
1002
+ # @return [DnsRecord]
1003
+ def create_record_alias(
1004
+ domain_id:,
1005
+ name:,
1006
+ value:,
1007
+ ttl:,
1008
+ comment: nil
1009
+ )
1010
+ if domain_id.nil?
1011
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1012
+ end
1013
+
1014
+ if name.nil?
1015
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1016
+ end
1017
+
1018
+ if value.nil?
1019
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1020
+ end
1021
+
1022
+ if ttl.nil?
1023
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1024
+ end
1025
+
1026
+ api_path = '/domains/{domainId}/records/alias'
1027
+ .gsub('{domainId}', domain_id)
1028
+
1029
+ api_params = {
1030
+ name: name,
1031
+ value: value,
1032
+ ttl: ttl,
1033
+ comment: comment,
1034
+ }
1035
+
1036
+ api_headers = {
1037
+ "X-Appwrite-Project": @client.get_config('project'),
1038
+ "content-type": 'application/json',
1039
+ "accept": 'application/json',
1040
+ }
1041
+
1042
+ @client.call(
1043
+ method: 'POST',
1044
+ path: api_path,
1045
+ headers: api_headers,
1046
+ params: api_params,
1047
+ response_type: Models::DnsRecord
1048
+ )
1049
+ end
1050
+
1051
+ # Update an existing ALIAS record for the specified domain. This endpoint
1052
+ # allows you to modify
1053
+ # the properties of an existing ALIAS record including its name, target
1054
+ # domain, TTL, and comment.
1055
+ #
1056
+ # The ALIAS record type is similar to a CNAME record but can be used at the
1057
+ # zone apex (root domain).
1058
+ # It provides a way to map one domain name to another.
1059
+ #
1060
+ # @param [String] domain_id Domain unique ID.
1061
+ # @param [String] record_id DNS record unique ID.
1062
+ # @param [String] name Record name.
1063
+ # @param [String] value Target domain for this ALIAS record.
1064
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1065
+ # @param [String] comment A comment for this record.
1066
+ #
1067
+ # @return [DnsRecord]
1068
+ def update_record_alias(
1069
+ domain_id:,
1070
+ record_id:,
1071
+ name:,
1072
+ value:,
1073
+ ttl:,
1074
+ comment: nil
1075
+ )
1076
+ if domain_id.nil?
1077
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1078
+ end
1079
+
1080
+ if record_id.nil?
1081
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
1082
+ end
1083
+
1084
+ if name.nil?
1085
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1086
+ end
1087
+
1088
+ if value.nil?
1089
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1090
+ end
1091
+
1092
+ if ttl.nil?
1093
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1094
+ end
1095
+
1096
+ api_path = '/domains/{domainId}/records/alias/{recordId}'
1097
+ .gsub('{domainId}', domain_id)
1098
+ .gsub('{recordId}', record_id)
1099
+
1100
+ api_params = {
1101
+ name: name,
1102
+ value: value,
1103
+ ttl: ttl,
1104
+ comment: comment,
1105
+ }
1106
+
1107
+ api_headers = {
1108
+ "X-Appwrite-Project": @client.get_config('project'),
1109
+ "content-type": 'application/json',
1110
+ "accept": 'application/json',
1111
+ }
1112
+
1113
+ @client.call(
1114
+ method: 'PUT',
1115
+ path: api_path,
1116
+ headers: api_headers,
1117
+ params: api_params,
1118
+ response_type: Models::DnsRecord
1119
+ )
1120
+ end
1121
+
1122
+ # Create a new CAA record for the given domain. CAA records are used to
1123
+ # specify which
1124
+ # Certificate Authorities (CAs) are allowed to issue SSL/TLS certificates for
1125
+ # your domain.
1126
+ #
1127
+ # @param [String] domain_id Domain unique ID.
1128
+ # @param [String] name Record name.
1129
+ # @param [String] value CAA value (e.g. issuer domain).
1130
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1131
+ # @param [String] comment A comment for this record.
1132
+ #
1133
+ # @return [DnsRecord]
1134
+ def create_record_caa(
1135
+ domain_id:,
1136
+ name:,
1137
+ value:,
1138
+ ttl:,
1139
+ comment: nil
1140
+ )
1141
+ if domain_id.nil?
1142
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1143
+ end
1144
+
1145
+ if name.nil?
1146
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1147
+ end
1148
+
1149
+ if value.nil?
1150
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1151
+ end
1152
+
1153
+ if ttl.nil?
1154
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1155
+ end
1156
+
1157
+ api_path = '/domains/{domainId}/records/caa'
1158
+ .gsub('{domainId}', domain_id)
1159
+
1160
+ api_params = {
1161
+ name: name,
1162
+ value: value,
1163
+ ttl: ttl,
1164
+ comment: comment,
1165
+ }
1166
+
1167
+ api_headers = {
1168
+ "X-Appwrite-Project": @client.get_config('project'),
1169
+ "content-type": 'application/json',
1170
+ "accept": 'application/json',
1171
+ }
1172
+
1173
+ @client.call(
1174
+ method: 'POST',
1175
+ path: api_path,
1176
+ headers: api_headers,
1177
+ params: api_params,
1178
+ response_type: Models::DnsRecord
1179
+ )
1180
+ end
1181
+
1182
+ # Update an existing CAA record for the given domain. A CAA (Certification
1183
+ # Authority Authorization)
1184
+ # record is used to specify which certificate authorities (CAs) are
1185
+ # authorized to issue certificates
1186
+ # for a domain.
1187
+ #
1188
+ # @param [String] domain_id Domain unique ID.
1189
+ # @param [String] record_id DNS record unique ID.
1190
+ # @param [String] name Record name.
1191
+ # @param [String] value CAA value (e.g. issuer domain).
1192
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1193
+ # @param [String] comment A comment for this record.
1194
+ #
1195
+ # @return [DnsRecord]
1196
+ def update_record_caa(
1197
+ domain_id:,
1198
+ record_id:,
1199
+ name:,
1200
+ value:,
1201
+ ttl:,
1202
+ comment: nil
1203
+ )
1204
+ if domain_id.nil?
1205
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1206
+ end
1207
+
1208
+ if record_id.nil?
1209
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
1210
+ end
1211
+
1212
+ if name.nil?
1213
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1214
+ end
1215
+
1216
+ if value.nil?
1217
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1218
+ end
1219
+
1220
+ if ttl.nil?
1221
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1222
+ end
1223
+
1224
+ api_path = '/domains/{domainId}/records/caa/{recordId}'
1225
+ .gsub('{domainId}', domain_id)
1226
+ .gsub('{recordId}', record_id)
1227
+
1228
+ api_params = {
1229
+ name: name,
1230
+ value: value,
1231
+ ttl: ttl,
1232
+ comment: comment,
1233
+ }
1234
+
1235
+ api_headers = {
1236
+ "X-Appwrite-Project": @client.get_config('project'),
1237
+ "content-type": 'application/json',
1238
+ "accept": 'application/json',
1239
+ }
1240
+
1241
+ @client.call(
1242
+ method: 'PUT',
1243
+ path: api_path,
1244
+ headers: api_headers,
1245
+ params: api_params,
1246
+ response_type: Models::DnsRecord
1247
+ )
1248
+ end
1249
+
1250
+ # Create a new CNAME record for the given domain.
1251
+ #
1252
+ # A CNAME record maps a subdomain to another domain name, allowing you to
1253
+ # create aliases
1254
+ # for your domain. For example, you can create a CNAME record to point
1255
+ # &#039;blog.example.com&#039;
1256
+ # to &#039;example.wordpress.com&#039;.
1257
+ #
1258
+ # @param [String] domain_id Domain unique ID.
1259
+ # @param [String] name Record name (subdomain).
1260
+ # @param [String] value Canonical target for this CNAME record.
1261
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1262
+ # @param [String] comment A comment for this record.
1263
+ #
1264
+ # @return [DnsRecord]
1265
+ def create_record_cname(
1266
+ domain_id:,
1267
+ name:,
1268
+ value:,
1269
+ ttl:,
1270
+ comment: nil
1271
+ )
1272
+ if domain_id.nil?
1273
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1274
+ end
1275
+
1276
+ if name.nil?
1277
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1278
+ end
1279
+
1280
+ if value.nil?
1281
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1282
+ end
1283
+
1284
+ if ttl.nil?
1285
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1286
+ end
1287
+
1288
+ api_path = '/domains/{domainId}/records/cname'
1289
+ .gsub('{domainId}', domain_id)
1290
+
1291
+ api_params = {
1292
+ name: name,
1293
+ value: value,
1294
+ ttl: ttl,
1295
+ comment: comment,
1296
+ }
1297
+
1298
+ api_headers = {
1299
+ "X-Appwrite-Project": @client.get_config('project'),
1300
+ "content-type": 'application/json',
1301
+ "accept": 'application/json',
1302
+ }
1303
+
1304
+ @client.call(
1305
+ method: 'POST',
1306
+ path: api_path,
1307
+ headers: api_headers,
1308
+ params: api_params,
1309
+ response_type: Models::DnsRecord
1310
+ )
1311
+ end
1312
+
1313
+ # Update an existing CNAME record for the given domain.
1314
+ #
1315
+ # @param [String] domain_id Domain unique ID.
1316
+ # @param [String] record_id DNS record unique ID.
1317
+ # @param [String] name Record name (subdomain).
1318
+ # @param [String] value Canonical target for this CNAME record.
1319
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1320
+ # @param [String] comment A comment for this record.
1321
+ #
1322
+ # @return [DnsRecord]
1323
+ def update_record_cname(
1324
+ domain_id:,
1325
+ record_id:,
1326
+ name:,
1327
+ value:,
1328
+ ttl:,
1329
+ comment: nil
1330
+ )
1331
+ if domain_id.nil?
1332
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1333
+ end
1334
+
1335
+ if record_id.nil?
1336
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
1337
+ end
1338
+
1339
+ if name.nil?
1340
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1341
+ end
1342
+
1343
+ if value.nil?
1344
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1345
+ end
1346
+
1347
+ if ttl.nil?
1348
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1349
+ end
1350
+
1351
+ api_path = '/domains/{domainId}/records/cname/{recordId}'
1352
+ .gsub('{domainId}', domain_id)
1353
+ .gsub('{recordId}', record_id)
1354
+
1355
+ api_params = {
1356
+ name: name,
1357
+ value: value,
1358
+ ttl: ttl,
1359
+ comment: comment,
1360
+ }
1361
+
1362
+ api_headers = {
1363
+ "X-Appwrite-Project": @client.get_config('project'),
1364
+ "content-type": 'application/json',
1365
+ "accept": 'application/json',
1366
+ }
1367
+
1368
+ @client.call(
1369
+ method: 'PUT',
1370
+ path: api_path,
1371
+ headers: api_headers,
1372
+ params: api_params,
1373
+ response_type: Models::DnsRecord
1374
+ )
1375
+ end
1376
+
1377
+ # Create a new HTTPS record for the given domain. This record is used to
1378
+ # configure HTTPS
1379
+ # settings for your domain, enabling secure communication over SSL/TLS.
1380
+ #
1381
+ # @param [String] domain_id Domain unique ID.
1382
+ # @param [String] name Record name (subdomain).
1383
+ # @param [String] value Target for the HTTPS record.
1384
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1385
+ # @param [String] comment A comment for this record.
1386
+ #
1387
+ # @return [DnsRecord]
1388
+ def create_record_https(
1389
+ domain_id:,
1390
+ name:,
1391
+ value:,
1392
+ ttl:,
1393
+ comment: nil
1394
+ )
1395
+ if domain_id.nil?
1396
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1397
+ end
1398
+
1399
+ if name.nil?
1400
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1401
+ end
1402
+
1403
+ if value.nil?
1404
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1405
+ end
1406
+
1407
+ if ttl.nil?
1408
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1409
+ end
1410
+
1411
+ api_path = '/domains/{domainId}/records/https'
1412
+ .gsub('{domainId}', domain_id)
1413
+
1414
+ api_params = {
1415
+ name: name,
1416
+ value: value,
1417
+ ttl: ttl,
1418
+ comment: comment,
1419
+ }
1420
+
1421
+ api_headers = {
1422
+ "X-Appwrite-Project": @client.get_config('project'),
1423
+ "content-type": 'application/json',
1424
+ "accept": 'application/json',
1425
+ }
1426
+
1427
+ @client.call(
1428
+ method: 'POST',
1429
+ path: api_path,
1430
+ headers: api_headers,
1431
+ params: api_params,
1432
+ response_type: Models::DnsRecord
1433
+ )
1434
+ end
1435
+
1436
+ # Update an existing HTTPS record for the given domain. This endpoint allows
1437
+ # you to modify
1438
+ # the properties of an HTTPS record associated with your domain, including
1439
+ # the name (subdomain),
1440
+ # target value, TTL, and optional comment.
1441
+ #
1442
+ # @param [String] domain_id Domain unique ID.
1443
+ # @param [String] record_id DNS record unique ID.
1444
+ # @param [String] name Record name (subdomain).
1445
+ # @param [String] value Target for the HTTPS record.
1446
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1447
+ # @param [String] comment A comment for this record.
1448
+ #
1449
+ # @return [DnsRecord]
1450
+ def update_record_https(
1451
+ domain_id:,
1452
+ record_id:,
1453
+ name:,
1454
+ value:,
1455
+ ttl:,
1456
+ comment: nil
1457
+ )
1458
+ if domain_id.nil?
1459
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1460
+ end
1461
+
1462
+ if record_id.nil?
1463
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
1464
+ end
1465
+
1466
+ if name.nil?
1467
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1468
+ end
1469
+
1470
+ if value.nil?
1471
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1472
+ end
1473
+
1474
+ if ttl.nil?
1475
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1476
+ end
1477
+
1478
+ api_path = '/domains/{domainId}/records/https/{recordId}'
1479
+ .gsub('{domainId}', domain_id)
1480
+ .gsub('{recordId}', record_id)
1481
+
1482
+ api_params = {
1483
+ name: name,
1484
+ value: value,
1485
+ ttl: ttl,
1486
+ comment: comment,
1487
+ }
1488
+
1489
+ api_headers = {
1490
+ "X-Appwrite-Project": @client.get_config('project'),
1491
+ "content-type": 'application/json',
1492
+ "accept": 'application/json',
1493
+ }
1494
+
1495
+ @client.call(
1496
+ method: 'PUT',
1497
+ path: api_path,
1498
+ headers: api_headers,
1499
+ params: api_params,
1500
+ response_type: Models::DnsRecord
1501
+ )
1502
+ end
1503
+
1504
+ # Create a new MX record for the given domain. MX records are used to define
1505
+ # the mail servers responsible
1506
+ # for accepting email messages for the domain. Multiple MX records can be
1507
+ # created with different priorities.
1508
+ # The priority parameter determines the order in which mail servers are used,
1509
+ # with lower values indicating
1510
+ # higher priority.
1511
+ #
1512
+ # @param [String] domain_id Domain unique ID.
1513
+ # @param [String] name Record name (subdomain).
1514
+ # @param [String] value Mail server domain for this MX record.
1515
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1516
+ # @param [Integer] priority MX priority. Lower values are tried first.
1517
+ # @param [String] comment A comment for this record.
1518
+ #
1519
+ # @return [DnsRecord]
1520
+ def create_record_mx(
1521
+ domain_id:,
1522
+ name:,
1523
+ value:,
1524
+ ttl:,
1525
+ priority:,
1526
+ comment: nil
1527
+ )
1528
+ if domain_id.nil?
1529
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1530
+ end
1531
+
1532
+ if name.nil?
1533
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1534
+ end
1535
+
1536
+ if value.nil?
1537
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1538
+ end
1539
+
1540
+ if ttl.nil?
1541
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1542
+ end
1543
+
1544
+ if priority.nil?
1545
+ raise Appwrite::Exception.new('Missing required parameter: "priority"')
1546
+ end
1547
+
1548
+ api_path = '/domains/{domainId}/records/mx'
1549
+ .gsub('{domainId}', domain_id)
1550
+
1551
+ api_params = {
1552
+ name: name,
1553
+ value: value,
1554
+ ttl: ttl,
1555
+ priority: priority,
1556
+ comment: comment,
1557
+ }
1558
+
1559
+ api_headers = {
1560
+ "X-Appwrite-Project": @client.get_config('project'),
1561
+ "content-type": 'application/json',
1562
+ "accept": 'application/json',
1563
+ }
1564
+
1565
+ @client.call(
1566
+ method: 'POST',
1567
+ path: api_path,
1568
+ headers: api_headers,
1569
+ params: api_params,
1570
+ response_type: Models::DnsRecord
1571
+ )
1572
+ end
1573
+
1574
+ # Update an existing MX record for the given domain.
1575
+ #
1576
+ # @param [String] domain_id Domain unique ID.
1577
+ # @param [String] record_id DNS record unique ID.
1578
+ # @param [String] name Record name (subdomain).
1579
+ # @param [String] value Mail server domain for this MX record.
1580
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1581
+ # @param [Integer] priority MX priority. Lower values are tried first.
1582
+ # @param [String] comment A comment for this record.
1583
+ #
1584
+ # @return [DnsRecord]
1585
+ def update_record_mx(
1586
+ domain_id:,
1587
+ record_id:,
1588
+ name:,
1589
+ value:,
1590
+ ttl:,
1591
+ priority:,
1592
+ comment: nil
1593
+ )
1594
+ if domain_id.nil?
1595
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1596
+ end
1597
+
1598
+ if record_id.nil?
1599
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
1600
+ end
1601
+
1602
+ if name.nil?
1603
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1604
+ end
1605
+
1606
+ if value.nil?
1607
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1608
+ end
1609
+
1610
+ if ttl.nil?
1611
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1612
+ end
1613
+
1614
+ if priority.nil?
1615
+ raise Appwrite::Exception.new('Missing required parameter: "priority"')
1616
+ end
1617
+
1618
+ api_path = '/domains/{domainId}/records/mx/{recordId}'
1619
+ .gsub('{domainId}', domain_id)
1620
+ .gsub('{recordId}', record_id)
1621
+
1622
+ api_params = {
1623
+ name: name,
1624
+ value: value,
1625
+ ttl: ttl,
1626
+ priority: priority,
1627
+ comment: comment,
1628
+ }
1629
+
1630
+ api_headers = {
1631
+ "X-Appwrite-Project": @client.get_config('project'),
1632
+ "content-type": 'application/json',
1633
+ "accept": 'application/json',
1634
+ }
1635
+
1636
+ @client.call(
1637
+ method: 'PUT',
1638
+ path: api_path,
1639
+ headers: api_headers,
1640
+ params: api_params,
1641
+ response_type: Models::DnsRecord
1642
+ )
1643
+ end
1644
+
1645
+ # Create a new NS record for the given domain. NS records specify the
1646
+ # nameservers that are used
1647
+ # to resolve the domain name to IP addresses. Each domain can have multiple
1648
+ # NS records.
1649
+ #
1650
+ # @param [String] domain_id Domain unique ID.
1651
+ # @param [String] name Record name (subdomain).
1652
+ # @param [String] value Nameserver target for this NS record.
1653
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1654
+ # @param [String] comment A comment for this record.
1655
+ #
1656
+ # @return [DnsRecord]
1657
+ def create_record_ns(
1658
+ domain_id:,
1659
+ name:,
1660
+ value:,
1661
+ ttl:,
1662
+ comment: nil
1663
+ )
1664
+ if domain_id.nil?
1665
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1666
+ end
1667
+
1668
+ if name.nil?
1669
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1670
+ end
1671
+
1672
+ if value.nil?
1673
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1674
+ end
1675
+
1676
+ if ttl.nil?
1677
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1678
+ end
1679
+
1680
+ api_path = '/domains/{domainId}/records/ns'
1681
+ .gsub('{domainId}', domain_id)
1682
+
1683
+ api_params = {
1684
+ name: name,
1685
+ value: value,
1686
+ ttl: ttl,
1687
+ comment: comment,
1688
+ }
1689
+
1690
+ api_headers = {
1691
+ "X-Appwrite-Project": @client.get_config('project'),
1692
+ "content-type": 'application/json',
1693
+ "accept": 'application/json',
1694
+ }
1695
+
1696
+ @client.call(
1697
+ method: 'POST',
1698
+ path: api_path,
1699
+ headers: api_headers,
1700
+ params: api_params,
1701
+ response_type: Models::DnsRecord
1702
+ )
1703
+ end
1704
+
1705
+ # Update an existing NS record for the given domain. This endpoint allows you
1706
+ # to modify
1707
+ # the properties of an NS (nameserver) record associated with your domain.
1708
+ # You can update
1709
+ # the record name (subdomain), target nameserver value, TTL, and add or
1710
+ # modify comments
1711
+ # for better record management.
1712
+ #
1713
+ # @param [String] domain_id Domain unique ID.
1714
+ # @param [String] record_id DNS record unique ID.
1715
+ # @param [String] name Record name (subdomain).
1716
+ # @param [String] value Nameserver target for this NS record.
1717
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1718
+ # @param [String] comment A comment for this record.
1719
+ #
1720
+ # @return [DnsRecord]
1721
+ def update_record_ns(
1722
+ domain_id:,
1723
+ record_id:,
1724
+ name:,
1725
+ value:,
1726
+ ttl:,
1727
+ comment: nil
1728
+ )
1729
+ if domain_id.nil?
1730
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1731
+ end
1732
+
1733
+ if record_id.nil?
1734
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
1735
+ end
1736
+
1737
+ if name.nil?
1738
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1739
+ end
1740
+
1741
+ if value.nil?
1742
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1743
+ end
1744
+
1745
+ if ttl.nil?
1746
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1747
+ end
1748
+
1749
+ api_path = '/domains/{domainId}/records/ns/{recordId}'
1750
+ .gsub('{domainId}', domain_id)
1751
+ .gsub('{recordId}', record_id)
1752
+
1753
+ api_params = {
1754
+ name: name,
1755
+ value: value,
1756
+ ttl: ttl,
1757
+ comment: comment,
1758
+ }
1759
+
1760
+ api_headers = {
1761
+ "X-Appwrite-Project": @client.get_config('project'),
1762
+ "content-type": 'application/json',
1763
+ "accept": 'application/json',
1764
+ }
1765
+
1766
+ @client.call(
1767
+ method: 'PUT',
1768
+ path: api_path,
1769
+ headers: api_headers,
1770
+ params: api_params,
1771
+ response_type: Models::DnsRecord
1772
+ )
1773
+ end
1774
+
1775
+ # Create a new SRV record for the given domain. SRV records are used to
1776
+ # define the location
1777
+ # of servers for specific services. For example, they can be used to specify
1778
+ # which server
1779
+ # handles a specific service like SIP or XMPP for the domain.
1780
+ #
1781
+ # @param [String] domain_id Domain unique ID.
1782
+ # @param [String] name Record name (service name).
1783
+ # @param [String] value Target hostname for this SRV record.
1784
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1785
+ # @param [Integer] priority Record priority. Lower values are tried first.
1786
+ # @param [Integer] weight Record weight, used to share load between targets of equal priority.
1787
+ # @param [Integer] port Port number for the service.
1788
+ # @param [String] comment A comment for this record.
1789
+ #
1790
+ # @return [DnsRecord]
1791
+ def create_record_srv(
1792
+ domain_id:,
1793
+ name:,
1794
+ value:,
1795
+ ttl:,
1796
+ priority:,
1797
+ weight:,
1798
+ port:,
1799
+ comment: nil
1800
+ )
1801
+ if domain_id.nil?
1802
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1803
+ end
1804
+
1805
+ if name.nil?
1806
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1807
+ end
1808
+
1809
+ if value.nil?
1810
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1811
+ end
1812
+
1813
+ if ttl.nil?
1814
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1815
+ end
1816
+
1817
+ if priority.nil?
1818
+ raise Appwrite::Exception.new('Missing required parameter: "priority"')
1819
+ end
1820
+
1821
+ if weight.nil?
1822
+ raise Appwrite::Exception.new('Missing required parameter: "weight"')
1823
+ end
1824
+
1825
+ if port.nil?
1826
+ raise Appwrite::Exception.new('Missing required parameter: "port"')
1827
+ end
1828
+
1829
+ api_path = '/domains/{domainId}/records/srv'
1830
+ .gsub('{domainId}', domain_id)
1831
+
1832
+ api_params = {
1833
+ name: name,
1834
+ value: value,
1835
+ ttl: ttl,
1836
+ priority: priority,
1837
+ weight: weight,
1838
+ port: port,
1839
+ comment: comment,
1840
+ }
1841
+
1842
+ api_headers = {
1843
+ "X-Appwrite-Project": @client.get_config('project'),
1844
+ "content-type": 'application/json',
1845
+ "accept": 'application/json',
1846
+ }
1847
+
1848
+ @client.call(
1849
+ method: 'POST',
1850
+ path: api_path,
1851
+ headers: api_headers,
1852
+ params: api_params,
1853
+ response_type: Models::DnsRecord
1854
+ )
1855
+ end
1856
+
1857
+ # Update an existing SRV record for the given domain.
1858
+ #
1859
+ # Required parameters:
1860
+ # - domainId: Domain unique ID
1861
+ # - recordId: DNS record unique ID
1862
+ # - name: Record name (service name)
1863
+ # - value: Target hostname for this SRV record
1864
+ # - ttl: Time to live, in seconds
1865
+ # - priority: Record priority
1866
+ # - weight: Record weight
1867
+ # - port: Port number for the service
1868
+ #
1869
+ # Optional parameters:
1870
+ # - comment: A comment for this record
1871
+ #
1872
+ # @param [String] domain_id Domain unique ID.
1873
+ # @param [String] record_id DNS record unique ID.
1874
+ # @param [String] name Record name (service name).
1875
+ # @param [String] value Target hostname for this SRV record.
1876
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1877
+ # @param [Integer] priority Record priority. Lower values are tried first.
1878
+ # @param [Integer] weight Record weight, used to share load between targets of equal priority.
1879
+ # @param [Integer] port Port number for the service.
1880
+ # @param [String] comment A comment for this record.
1881
+ #
1882
+ # @return [DnsRecord]
1883
+ def update_record_srv(
1884
+ domain_id:,
1885
+ record_id:,
1886
+ name:,
1887
+ value:,
1888
+ ttl:,
1889
+ priority:,
1890
+ weight:,
1891
+ port:,
1892
+ comment: nil
1893
+ )
1894
+ if domain_id.nil?
1895
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1896
+ end
1897
+
1898
+ if record_id.nil?
1899
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
1900
+ end
1901
+
1902
+ if name.nil?
1903
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1904
+ end
1905
+
1906
+ if value.nil?
1907
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
1908
+ end
1909
+
1910
+ if ttl.nil?
1911
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1912
+ end
1913
+
1914
+ if priority.nil?
1915
+ raise Appwrite::Exception.new('Missing required parameter: "priority"')
1916
+ end
1917
+
1918
+ if weight.nil?
1919
+ raise Appwrite::Exception.new('Missing required parameter: "weight"')
1920
+ end
1921
+
1922
+ if port.nil?
1923
+ raise Appwrite::Exception.new('Missing required parameter: "port"')
1924
+ end
1925
+
1926
+ api_path = '/domains/{domainId}/records/srv/{recordId}'
1927
+ .gsub('{domainId}', domain_id)
1928
+ .gsub('{recordId}', record_id)
1929
+
1930
+ api_params = {
1931
+ name: name,
1932
+ value: value,
1933
+ ttl: ttl,
1934
+ priority: priority,
1935
+ weight: weight,
1936
+ port: port,
1937
+ comment: comment,
1938
+ }
1939
+
1940
+ api_headers = {
1941
+ "X-Appwrite-Project": @client.get_config('project'),
1942
+ "content-type": 'application/json',
1943
+ "accept": 'application/json',
1944
+ }
1945
+
1946
+ @client.call(
1947
+ method: 'PUT',
1948
+ path: api_path,
1949
+ headers: api_headers,
1950
+ params: api_params,
1951
+ response_type: Models::DnsRecord
1952
+ )
1953
+ end
1954
+
1955
+ # Create a new TXT record for the given domain. TXT records can be used
1956
+ # to provide additional information about your domain, such as domain
1957
+ # verification records, SPF records, or DKIM records.
1958
+ #
1959
+ # @param [String] domain_id Domain unique ID.
1960
+ # @param [String] name Record name (subdomain) for the TXT record.
1961
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
1962
+ # @param [String] value TXT record value.
1963
+ # @param [String] comment A comment for this record.
1964
+ #
1965
+ # @return [DnsRecord]
1966
+ def create_record_txt(
1967
+ domain_id:,
1968
+ name:,
1969
+ ttl:,
1970
+ value: nil,
1971
+ comment: nil
1972
+ )
1973
+ if domain_id.nil?
1974
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
1975
+ end
1976
+
1977
+ if name.nil?
1978
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
1979
+ end
1980
+
1981
+ if ttl.nil?
1982
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
1983
+ end
1984
+
1985
+ api_path = '/domains/{domainId}/records/txt'
1986
+ .gsub('{domainId}', domain_id)
1987
+
1988
+ api_params = {
1989
+ name: name,
1990
+ value: value,
1991
+ ttl: ttl,
1992
+ comment: comment,
1993
+ }
1994
+
1995
+ api_headers = {
1996
+ "X-Appwrite-Project": @client.get_config('project'),
1997
+ "content-type": 'application/json',
1998
+ "accept": 'application/json',
1999
+ }
2000
+
2001
+ @client.call(
2002
+ method: 'POST',
2003
+ path: api_path,
2004
+ headers: api_headers,
2005
+ params: api_params,
2006
+ response_type: Models::DnsRecord
2007
+ )
2008
+ end
2009
+
2010
+ # Update an existing TXT record for the given domain.
2011
+ #
2012
+ # Update the TXT record details for a specific domain by providing the domain
2013
+ # ID,
2014
+ # record ID, and the new record configuration including name, value, TTL, and
2015
+ # an optional comment.
2016
+ #
2017
+ # @param [String] domain_id Domain unique ID.
2018
+ # @param [String] record_id DNS record unique ID.
2019
+ # @param [String] name Record name (subdomain) for the TXT record.
2020
+ # @param [String] value TXT record value.
2021
+ # @param [Integer] ttl Time to live, in seconds. Must be between 1 and 2147483647.
2022
+ # @param [String] comment A comment for this record.
2023
+ #
2024
+ # @return [DnsRecord]
2025
+ def update_record_txt(
2026
+ domain_id:,
2027
+ record_id:,
2028
+ name:,
2029
+ value:,
2030
+ ttl:,
2031
+ comment: nil
2032
+ )
2033
+ if domain_id.nil?
2034
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
2035
+ end
2036
+
2037
+ if record_id.nil?
2038
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
2039
+ end
2040
+
2041
+ if name.nil?
2042
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
2043
+ end
2044
+
2045
+ if value.nil?
2046
+ raise Appwrite::Exception.new('Missing required parameter: "value"')
2047
+ end
2048
+
2049
+ if ttl.nil?
2050
+ raise Appwrite::Exception.new('Missing required parameter: "ttl"')
2051
+ end
2052
+
2053
+ api_path = '/domains/{domainId}/records/txt/{recordId}'
2054
+ .gsub('{domainId}', domain_id)
2055
+ .gsub('{recordId}', record_id)
2056
+
2057
+ api_params = {
2058
+ name: name,
2059
+ value: value,
2060
+ ttl: ttl,
2061
+ comment: comment,
2062
+ }
2063
+
2064
+ api_headers = {
2065
+ "X-Appwrite-Project": @client.get_config('project'),
2066
+ "content-type": 'application/json',
2067
+ "accept": 'application/json',
2068
+ }
2069
+
2070
+ @client.call(
2071
+ method: 'PUT',
2072
+ path: api_path,
2073
+ headers: api_headers,
2074
+ params: api_params,
2075
+ response_type: Models::DnsRecord
2076
+ )
2077
+ end
2078
+
2079
+ # Get a single DNS record for a given domain by record ID.
2080
+ #
2081
+ # This endpoint allows you to retrieve a specific DNS record associated with
2082
+ # a domain
2083
+ # using its unique identifier. The record contains information about the DNS
2084
+ # configuration
2085
+ # such as type, value, and TTL settings.
2086
+ #
2087
+ # @param [String] domain_id Domain unique ID.
2088
+ # @param [String] record_id DNS record unique ID.
2089
+ #
2090
+ # @return [DnsRecord]
2091
+ def get_record(
2092
+ domain_id:,
2093
+ record_id:
2094
+ )
2095
+ if domain_id.nil?
2096
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
2097
+ end
2098
+
2099
+ if record_id.nil?
2100
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
2101
+ end
2102
+
2103
+ api_path = '/domains/{domainId}/records/{recordId}'
2104
+ .gsub('{domainId}', domain_id)
2105
+ .gsub('{recordId}', record_id)
2106
+
2107
+ api_params = {}
2108
+
2109
+ api_headers = {
2110
+ "X-Appwrite-Project": @client.get_config('project'),
2111
+ "accept": 'application/json',
2112
+ }
2113
+
2114
+ @client.call(
2115
+ method: 'GET',
2116
+ path: api_path,
2117
+ headers: api_headers,
2118
+ params: api_params,
2119
+ response_type: Models::DnsRecord
2120
+ )
2121
+ end
2122
+
2123
+ # Delete a DNS record for the given domain. This endpoint allows you to
2124
+ # delete an existing DNS record
2125
+ # from a specific domain.
2126
+ #
2127
+ # @param [String] domain_id Domain unique ID.
2128
+ # @param [String] record_id DNS record unique ID.
2129
+ #
2130
+ # @return []
2131
+ def delete_record(
2132
+ domain_id:,
2133
+ record_id:
2134
+ )
2135
+ if domain_id.nil?
2136
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
2137
+ end
2138
+
2139
+ if record_id.nil?
2140
+ raise Appwrite::Exception.new('Missing required parameter: "recordId"')
2141
+ end
2142
+
2143
+ api_path = '/domains/{domainId}/records/{recordId}'
2144
+ .gsub('{domainId}', domain_id)
2145
+ .gsub('{recordId}', record_id)
2146
+
2147
+ api_params = {}
2148
+
2149
+ api_headers = {
2150
+ "X-Appwrite-Project": @client.get_config('project'),
2151
+ "content-type": 'application/json',
2152
+ "accept": 'application/json',
2153
+ }
2154
+
2155
+ @client.call(
2156
+ method: 'DELETE',
2157
+ path: api_path,
2158
+ headers: api_headers,
2159
+ params: api_params,
2160
+ )
2161
+ end
2162
+
2163
+ # Update the team ID for a specific domain. The caller must administer the
2164
+ # current
2165
+ # team and be an owner of the destination team.
2166
+ #
2167
+ # Updating the team ID will transfer ownership and access control of the
2168
+ # domain
2169
+ # and all its DNS records to the new team.
2170
+ #
2171
+ # @param [String] domain_id Domain unique ID.
2172
+ # @param [String] team_id New team unique ID.
2173
+ #
2174
+ # @return [Domain]
2175
+ def update_team(
2176
+ domain_id:,
2177
+ team_id:
2178
+ )
2179
+ if domain_id.nil?
2180
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
2181
+ end
2182
+
2183
+ if team_id.nil?
2184
+ raise Appwrite::Exception.new('Missing required parameter: "teamId"')
2185
+ end
2186
+
2187
+ api_path = '/domains/{domainId}/team'
2188
+ .gsub('{domainId}', domain_id)
2189
+
2190
+ api_params = {
2191
+ teamId: team_id,
2192
+ }
2193
+
2194
+ api_headers = {
2195
+ "X-Appwrite-Project": @client.get_config('project'),
2196
+ "content-type": 'application/json',
2197
+ "accept": 'application/json',
2198
+ }
2199
+
2200
+ @client.call(
2201
+ method: 'PATCH',
2202
+ path: api_path,
2203
+ headers: api_headers,
2204
+ params: api_params,
2205
+ response_type: Models::Domain
2206
+ )
2207
+ end
2208
+
2209
+ # Retrieve the current transfer status for a domain. Returns the status, an
2210
+ # optional reason, and a timestamp of the last status change.
2211
+ #
2212
+ # @param [String] domain_id Domain unique ID.
2213
+ #
2214
+ # @return [DomainTransferStatus]
2215
+ def get_transfer_status(
2216
+ domain_id:
2217
+ )
2218
+ if domain_id.nil?
2219
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
2220
+ end
2221
+
2222
+ api_path = '/domains/{domainId}/transfers/status'
2223
+ .gsub('{domainId}', domain_id)
2224
+
2225
+ api_params = {}
2226
+
2227
+ api_headers = {
2228
+ "X-Appwrite-Project": @client.get_config('project'),
2229
+ "accept": 'application/json',
2230
+ }
2231
+
2232
+ @client.call(
2233
+ method: 'GET',
2234
+ path: api_path,
2235
+ headers: api_headers,
2236
+ params: api_params,
2237
+ response_type: Models::DomainTransferStatus
2238
+ )
2239
+ end
2240
+
2241
+ # Retrieve the DNS zone file for the given domain. This endpoint will return
2242
+ # the DNS
2243
+ # zone file in a standardized format that can be used to configure DNS
2244
+ # servers.
2245
+ #
2246
+ # @param [String] domain_id Domain unique ID.
2247
+ #
2248
+ # @return [String]
2249
+ def get_zone(
2250
+ domain_id:
2251
+ )
2252
+ if domain_id.nil?
2253
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
2254
+ end
2255
+
2256
+ api_path = '/domains/{domainId}/zone'
2257
+ .gsub('{domainId}', domain_id)
2258
+
2259
+ api_params = {}
2260
+
2261
+ api_headers = {
2262
+ "X-Appwrite-Project": @client.get_config('project'),
2263
+ "accept": 'text/plain',
2264
+ }
2265
+
2266
+ @client.call(
2267
+ method: 'GET',
2268
+ path: api_path,
2269
+ headers: api_headers,
2270
+ params: api_params,
2271
+ response_type: "text"
2272
+ )
2273
+ end
2274
+
2275
+ # Update the DNS zone for the given domain using the provided zone file
2276
+ # content.
2277
+ # All parsed records are imported and then the main domain document is
2278
+ # returned.
2279
+ #
2280
+ # @param [String] domain_id Domain unique ID.
2281
+ # @param [String] content DNS zone file content as a string.
2282
+ #
2283
+ # @return [Domain]
2284
+ def update_zone(
2285
+ domain_id:,
2286
+ content:
2287
+ )
2288
+ if domain_id.nil?
2289
+ raise Appwrite::Exception.new('Missing required parameter: "domainId"')
2290
+ end
2291
+
2292
+ if content.nil?
2293
+ raise Appwrite::Exception.new('Missing required parameter: "content"')
2294
+ end
2295
+
2296
+ api_path = '/domains/{domainId}/zone'
2297
+ .gsub('{domainId}', domain_id)
2298
+
2299
+ api_params = {
2300
+ content: content,
2301
+ }
2302
+
2303
+ api_headers = {
2304
+ "X-Appwrite-Project": @client.get_config('project'),
2305
+ "content-type": 'application/json',
2306
+ "accept": 'application/json',
2307
+ }
2308
+
2309
+ @client.call(
2310
+ method: 'PUT',
2311
+ path: api_path,
2312
+ headers: api_headers,
2313
+ params: api_params,
2314
+ response_type: Models::Domain
2315
+ )
2316
+ end
2317
+ end
2318
+ end