appwrite 25.1.0 → 26.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +18 -4
  3. data/lib/appwrite/enums/billing_plan_group.rb +9 -0
  4. data/lib/appwrite/enums/database_status.rb +20 -0
  5. data/lib/appwrite/enums/database_type.rb +3 -0
  6. data/lib/appwrite/enums/o_auth2_oidc_prompt.rb +10 -0
  7. data/lib/appwrite/enums/o_auth_provider.rb +1 -0
  8. data/lib/appwrite/enums/organization_key_scopes.rb +6 -0
  9. data/lib/appwrite/enums/project_key_scopes.rb +10 -2
  10. data/lib/appwrite/enums/project_o_auth2_oidc_prompt.rb +10 -0
  11. data/lib/appwrite/enums/project_o_auth_provider_id.rb +1 -0
  12. data/lib/appwrite/enums/project_policy_id.rb +1 -0
  13. data/lib/appwrite/enums/project_service_id.rb +1 -0
  14. data/lib/appwrite/models/activity_event.rb +55 -70
  15. data/lib/appwrite/models/additional_resource.rb +52 -0
  16. data/lib/appwrite/models/app.rb +152 -0
  17. data/lib/appwrite/models/app_installation.rb +72 -0
  18. data/lib/appwrite/models/app_installation_list.rb +32 -0
  19. data/lib/appwrite/models/app_key.rb +67 -0
  20. data/lib/appwrite/models/{usage_gauge_list.rb → app_key_list.rb} +7 -7
  21. data/lib/appwrite/models/app_scope.rb +47 -0
  22. data/lib/appwrite/models/{usage_event_list.rb → app_scope_list.rb} +7 -7
  23. data/lib/appwrite/models/app_secret.rb +67 -0
  24. data/lib/appwrite/models/{health_status_list.rb → app_secret_list.rb} +7 -7
  25. data/lib/appwrite/models/app_secret_plaintext.rb +67 -0
  26. data/lib/appwrite/models/apps_list.rb +32 -0
  27. data/lib/appwrite/models/backup_policy.rb +5 -0
  28. data/lib/appwrite/models/billing_plan.rb +384 -0
  29. data/lib/appwrite/models/billing_plan_addon.rb +32 -0
  30. data/lib/appwrite/models/billing_plan_addon_details.rb +62 -0
  31. data/lib/appwrite/models/billing_plan_dedicated_database_limits.rb +117 -0
  32. data/lib/appwrite/models/billing_plan_limits.rb +32 -0
  33. data/lib/appwrite/models/billing_plan_supported_addons.rb +37 -0
  34. data/lib/appwrite/models/block.rb +5 -0
  35. data/lib/appwrite/models/database.rb +54 -6
  36. data/lib/appwrite/models/database_status.rb +62 -0
  37. data/lib/appwrite/models/database_status_connections.rb +32 -0
  38. data/lib/appwrite/models/database_status_replica.rb +42 -0
  39. data/lib/appwrite/models/database_status_volume.rb +42 -0
  40. data/lib/appwrite/models/dedicated_database.rb +267 -0
  41. data/lib/appwrite/models/dedicated_database_member.rb +42 -0
  42. data/lib/appwrite/models/dedicated_database_replicas.rb +37 -0
  43. data/lib/appwrite/models/dedicated_database_specification.rb +67 -0
  44. data/lib/appwrite/models/dedicated_database_specification_list.rb +37 -0
  45. data/lib/appwrite/models/dedicated_database_specification_pricing.rb +47 -0
  46. data/lib/appwrite/models/locale.rb +58 -3
  47. data/lib/appwrite/models/membership.rb +5 -0
  48. data/lib/appwrite/models/o_auth2_appwrite.rb +42 -0
  49. data/lib/appwrite/models/o_auth2_oidc.rb +13 -3
  50. data/lib/appwrite/models/oauth2_approve.rb +27 -0
  51. data/lib/appwrite/models/oauth2_authorize.rb +32 -0
  52. data/lib/appwrite/models/oauth2_consent.rb +72 -0
  53. data/lib/appwrite/models/oauth2_consent_list.rb +32 -0
  54. data/lib/appwrite/models/oauth2_consent_token.rb +77 -0
  55. data/lib/appwrite/models/oauth2_consent_token_list.rb +32 -0
  56. data/lib/appwrite/models/oauth2_device_authorization.rb +52 -0
  57. data/lib/appwrite/models/oauth2_grant.rb +82 -0
  58. data/lib/appwrite/models/{health_queue.rb → oauth2_organization.rb} +7 -7
  59. data/lib/appwrite/models/oauth2_organization_list.rb +32 -0
  60. data/lib/appwrite/models/oauth2_par.rb +32 -0
  61. data/lib/appwrite/models/oauth2_project.rb +37 -0
  62. data/lib/appwrite/models/oauth2_project_list.rb +32 -0
  63. data/lib/appwrite/models/oauth2_reject.rb +27 -0
  64. data/lib/appwrite/models/oauth2_token.rb +57 -0
  65. data/lib/appwrite/models/organization.rb +197 -0
  66. data/lib/appwrite/models/policy_deny_corporate_email.rb +32 -0
  67. data/lib/appwrite/models/policy_membership_privacy.rb +8 -3
  68. data/lib/appwrite/models/program.rb +67 -0
  69. data/lib/appwrite/models/project.rb +56 -11
  70. data/lib/appwrite/models/project_auth_method.rb +3 -3
  71. data/lib/appwrite/models/usage_billing_plan.rb +77 -0
  72. data/lib/appwrite/models/user.rb +25 -0
  73. data/lib/appwrite/query.rb +13 -1
  74. data/lib/appwrite/services/account.rb +251 -1
  75. data/lib/appwrite/services/activities.rb +2 -0
  76. data/lib/appwrite/services/advisor.rb +4 -0
  77. data/lib/appwrite/services/apps.rb +813 -0
  78. data/lib/appwrite/services/avatars.rb +8 -0
  79. data/lib/appwrite/services/backups.rb +38 -1
  80. data/lib/appwrite/services/databases.rb +107 -0
  81. data/lib/appwrite/services/functions.rb +30 -4
  82. data/lib/appwrite/services/graphql.rb +2 -0
  83. data/lib/appwrite/services/locale.rb +8 -0
  84. data/lib/appwrite/services/messaging.rb +42 -136
  85. data/lib/appwrite/services/oauth2.rb +525 -0
  86. data/lib/appwrite/services/organization.rb +436 -3
  87. data/lib/appwrite/services/presences.rb +4 -0
  88. data/lib/appwrite/services/project.rb +192 -9
  89. data/lib/appwrite/services/proxy.rb +7 -0
  90. data/lib/appwrite/services/sites.rb +28 -2
  91. data/lib/appwrite/services/storage.rb +11 -0
  92. data/lib/appwrite/services/tables_db.rb +201 -2
  93. data/lib/appwrite/services/teams.rb +209 -0
  94. data/lib/appwrite/services/tokens.rb +4 -0
  95. data/lib/appwrite/services/users.rb +38 -1
  96. data/lib/appwrite/services/webhooks.rb +5 -0
  97. data/lib/appwrite.rb +54 -15
  98. metadata +56 -17
  99. data/lib/appwrite/enums/health_antivirus_status.rb +0 -9
  100. data/lib/appwrite/enums/health_check_status.rb +0 -8
  101. data/lib/appwrite/enums/health_queue_name.rb +0 -19
  102. data/lib/appwrite/models/health_antivirus.rb +0 -49
  103. data/lib/appwrite/models/health_certificate.rb +0 -52
  104. data/lib/appwrite/models/health_status.rb +0 -53
  105. data/lib/appwrite/models/health_time.rb +0 -37
  106. data/lib/appwrite/models/usage_event.rb +0 -72
  107. data/lib/appwrite/models/usage_gauge.rb +0 -47
  108. data/lib/appwrite/services/health.rb +0 -681
  109. data/lib/appwrite/services/usage.rb +0 -88
@@ -0,0 +1,67 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class DedicatedDatabaseSpecification
6
+ attr_reader :slug
7
+ attr_reader :name
8
+ attr_reader :price
9
+ attr_reader :cpu
10
+ attr_reader :memory
11
+ attr_reader :max_connections
12
+ attr_reader :included_storage
13
+ attr_reader :included_bandwidth
14
+ attr_reader :enabled
15
+
16
+ def initialize(
17
+ slug:,
18
+ name:,
19
+ price:,
20
+ cpu:,
21
+ memory:,
22
+ max_connections:,
23
+ included_storage:,
24
+ included_bandwidth:,
25
+ enabled:
26
+ )
27
+ @slug = slug
28
+ @name = name
29
+ @price = price
30
+ @cpu = cpu
31
+ @memory = memory
32
+ @max_connections = max_connections
33
+ @included_storage = included_storage
34
+ @included_bandwidth = included_bandwidth
35
+ @enabled = enabled
36
+ end
37
+
38
+ def self.from(map:)
39
+ DedicatedDatabaseSpecification.new(
40
+ slug: map["slug"],
41
+ name: map["name"],
42
+ price: map["price"],
43
+ cpu: map["cpu"],
44
+ memory: map["memory"],
45
+ max_connections: map["maxConnections"],
46
+ included_storage: map["includedStorage"],
47
+ included_bandwidth: map["includedBandwidth"],
48
+ enabled: map["enabled"]
49
+ )
50
+ end
51
+
52
+ def to_map
53
+ {
54
+ "slug": @slug,
55
+ "name": @name,
56
+ "price": @price,
57
+ "cpu": @cpu,
58
+ "memory": @memory,
59
+ "maxConnections": @max_connections,
60
+ "includedStorage": @included_storage,
61
+ "includedBandwidth": @included_bandwidth,
62
+ "enabled": @enabled
63
+ }
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,37 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class DedicatedDatabaseSpecificationList
6
+ attr_reader :specifications
7
+ attr_reader :total
8
+ attr_reader :pricing
9
+
10
+ def initialize(
11
+ specifications:,
12
+ total:,
13
+ pricing:
14
+ )
15
+ @specifications = specifications
16
+ @total = total
17
+ @pricing = pricing
18
+ end
19
+
20
+ def self.from(map:)
21
+ DedicatedDatabaseSpecificationList.new(
22
+ specifications: map["specifications"].map { |it| DedicatedDatabaseSpecification.from(map: it) },
23
+ total: map["total"],
24
+ pricing: DedicatedDatabaseSpecificationPricing.from(map: map["pricing"])
25
+ )
26
+ end
27
+
28
+ def to_map
29
+ {
30
+ "specifications": @specifications.map { |it| it.to_map },
31
+ "total": @total,
32
+ "pricing": @pricing.to_map
33
+ }
34
+ end
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,47 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class DedicatedDatabaseSpecificationPricing
6
+ attr_reader :storage_overage_rate
7
+ attr_reader :bandwidth_overage_rate
8
+ attr_reader :replica_rate
9
+ attr_reader :cross_region_replica_rate
10
+ attr_reader :pitr_rate
11
+
12
+ def initialize(
13
+ storage_overage_rate:,
14
+ bandwidth_overage_rate:,
15
+ replica_rate:,
16
+ cross_region_replica_rate:,
17
+ pitr_rate:
18
+ )
19
+ @storage_overage_rate = storage_overage_rate
20
+ @bandwidth_overage_rate = bandwidth_overage_rate
21
+ @replica_rate = replica_rate
22
+ @cross_region_replica_rate = cross_region_replica_rate
23
+ @pitr_rate = pitr_rate
24
+ end
25
+
26
+ def self.from(map:)
27
+ DedicatedDatabaseSpecificationPricing.new(
28
+ storage_overage_rate: map["storageOverageRate"],
29
+ bandwidth_overage_rate: map["bandwidthOverageRate"],
30
+ replica_rate: map["replicaRate"],
31
+ cross_region_replica_rate: map["crossRegionReplicaRate"],
32
+ pitr_rate: map["pitrRate"]
33
+ )
34
+ end
35
+
36
+ def to_map
37
+ {
38
+ "storageOverageRate": @storage_overage_rate,
39
+ "bandwidthOverageRate": @bandwidth_overage_rate,
40
+ "replicaRate": @replica_rate,
41
+ "crossRegionReplicaRate": @cross_region_replica_rate,
42
+ "pitrRate": @pitr_rate
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -10,6 +10,17 @@ module Appwrite
10
10
  attr_reader :continent
11
11
  attr_reader :eu
12
12
  attr_reader :currency
13
+ attr_reader :city
14
+ attr_reader :time_zone
15
+ attr_reader :postal_code
16
+ attr_reader :latitude
17
+ attr_reader :longitude
18
+ attr_reader :autonomous_system_number
19
+ attr_reader :autonomous_system_organization
20
+ attr_reader :isp
21
+ attr_reader :connection_type
22
+ attr_reader :connection_usage_type
23
+ attr_reader :connection_organization
13
24
 
14
25
  def initialize(
15
26
  ip:,
@@ -18,7 +29,18 @@ module Appwrite
18
29
  continent_code:,
19
30
  continent:,
20
31
  eu:,
21
- currency:
32
+ currency:,
33
+ city: ,
34
+ time_zone: ,
35
+ postal_code: ,
36
+ latitude: ,
37
+ longitude: ,
38
+ autonomous_system_number: ,
39
+ autonomous_system_organization: ,
40
+ isp: ,
41
+ connection_type: ,
42
+ connection_usage_type: ,
43
+ connection_organization:
22
44
  )
23
45
  @ip = ip
24
46
  @country_code = country_code
@@ -27,6 +49,17 @@ module Appwrite
27
49
  @continent = continent
28
50
  @eu = eu
29
51
  @currency = currency
52
+ @city = city
53
+ @time_zone = time_zone
54
+ @postal_code = postal_code
55
+ @latitude = latitude
56
+ @longitude = longitude
57
+ @autonomous_system_number = autonomous_system_number
58
+ @autonomous_system_organization = autonomous_system_organization
59
+ @isp = isp
60
+ @connection_type = connection_type
61
+ @connection_usage_type = connection_usage_type
62
+ @connection_organization = connection_organization
30
63
  end
31
64
 
32
65
  def self.from(map:)
@@ -37,7 +70,18 @@ module Appwrite
37
70
  continent_code: map["continentCode"],
38
71
  continent: map["continent"],
39
72
  eu: map["eu"],
40
- currency: map["currency"]
73
+ currency: map["currency"],
74
+ city: map["city"],
75
+ time_zone: map["timeZone"],
76
+ postal_code: map["postalCode"],
77
+ latitude: map["latitude"],
78
+ longitude: map["longitude"],
79
+ autonomous_system_number: map["autonomousSystemNumber"],
80
+ autonomous_system_organization: map["autonomousSystemOrganization"],
81
+ isp: map["isp"],
82
+ connection_type: map["connectionType"],
83
+ connection_usage_type: map["connectionUsageType"],
84
+ connection_organization: map["connectionOrganization"]
41
85
  )
42
86
  end
43
87
 
@@ -49,7 +93,18 @@ module Appwrite
49
93
  "continentCode": @continent_code,
50
94
  "continent": @continent,
51
95
  "eu": @eu,
52
- "currency": @currency
96
+ "currency": @currency,
97
+ "city": @city,
98
+ "timeZone": @time_zone,
99
+ "postalCode": @postal_code,
100
+ "latitude": @latitude,
101
+ "longitude": @longitude,
102
+ "autonomousSystemNumber": @autonomous_system_number,
103
+ "autonomousSystemOrganization": @autonomous_system_organization,
104
+ "isp": @isp,
105
+ "connectionType": @connection_type,
106
+ "connectionUsageType": @connection_usage_type,
107
+ "connectionOrganization": @connection_organization
53
108
  }
54
109
  end
55
110
  end
@@ -16,6 +16,7 @@ module Appwrite
16
16
  attr_reader :joined
17
17
  attr_reader :confirm
18
18
  attr_reader :mfa
19
+ attr_reader :user_accessed_at
19
20
  attr_reader :roles
20
21
 
21
22
  def initialize(
@@ -32,6 +33,7 @@ module Appwrite
32
33
  joined:,
33
34
  confirm:,
34
35
  mfa:,
36
+ user_accessed_at:,
35
37
  roles:
36
38
  )
37
39
  @id = id
@@ -47,6 +49,7 @@ module Appwrite
47
49
  @joined = joined
48
50
  @confirm = confirm
49
51
  @mfa = mfa
52
+ @user_accessed_at = user_accessed_at
50
53
  @roles = roles
51
54
  end
52
55
 
@@ -65,6 +68,7 @@ module Appwrite
65
68
  joined: map["joined"],
66
69
  confirm: map["confirm"],
67
70
  mfa: map["mfa"],
71
+ user_accessed_at: map["userAccessedAt"],
68
72
  roles: map["roles"]
69
73
  )
70
74
  end
@@ -84,6 +88,7 @@ module Appwrite
84
88
  "joined": @joined,
85
89
  "confirm": @confirm,
86
90
  "mfa": @mfa,
91
+ "userAccessedAt": @user_accessed_at,
87
92
  "roles": @roles
88
93
  }
89
94
  end
@@ -0,0 +1,42 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class OAuth2Appwrite
6
+ attr_reader :id
7
+ attr_reader :enabled
8
+ attr_reader :client_id
9
+ attr_reader :client_secret
10
+
11
+ def initialize(
12
+ id:,
13
+ enabled:,
14
+ client_id:,
15
+ client_secret:
16
+ )
17
+ @id = id
18
+ @enabled = enabled
19
+ @client_id = client_id
20
+ @client_secret = client_secret
21
+ end
22
+
23
+ def self.from(map:)
24
+ OAuth2Appwrite.new(
25
+ id: map["$id"],
26
+ enabled: map["enabled"],
27
+ client_id: map["clientId"],
28
+ client_secret: map["clientSecret"]
29
+ )
30
+ end
31
+
32
+ def to_map
33
+ {
34
+ "$id": @id,
35
+ "enabled": @enabled,
36
+ "clientId": @client_id,
37
+ "clientSecret": @client_secret
38
+ }
39
+ end
40
+ end
41
+ end
42
+ end
@@ -11,6 +11,8 @@ module Appwrite
11
11
  attr_reader :authorization_url
12
12
  attr_reader :token_url
13
13
  attr_reader :user_info_url
14
+ attr_reader :prompt
15
+ attr_reader :max_age
14
16
 
15
17
  def initialize(
16
18
  id:,
@@ -20,7 +22,9 @@ module Appwrite
20
22
  well_known_url:,
21
23
  authorization_url:,
22
24
  token_url:,
23
- user_info_url:
25
+ user_info_url:,
26
+ prompt:,
27
+ max_age:
24
28
  )
25
29
  @id = id
26
30
  @enabled = enabled
@@ -30,6 +34,8 @@ module Appwrite
30
34
  @authorization_url = authorization_url
31
35
  @token_url = token_url
32
36
  @user_info_url = user_info_url
37
+ @prompt = prompt
38
+ @max_age = max_age
33
39
  end
34
40
 
35
41
  def self.from(map:)
@@ -41,7 +47,9 @@ module Appwrite
41
47
  well_known_url: map["wellKnownURL"],
42
48
  authorization_url: map["authorizationURL"],
43
49
  token_url: map["tokenURL"],
44
- user_info_url: map["userInfoURL"]
50
+ user_info_url: map["userInfoURL"],
51
+ prompt: map["prompt"],
52
+ max_age: map["maxAge"]
45
53
  )
46
54
  end
47
55
 
@@ -54,7 +62,9 @@ module Appwrite
54
62
  "wellKnownURL": @well_known_url,
55
63
  "authorizationURL": @authorization_url,
56
64
  "tokenURL": @token_url,
57
- "userInfoURL": @user_info_url
65
+ "userInfoURL": @user_info_url,
66
+ "prompt": @prompt,
67
+ "maxAge": @max_age
58
68
  }
59
69
  end
60
70
  end
@@ -0,0 +1,27 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Oauth2Approve
6
+ attr_reader :redirect_url
7
+
8
+ def initialize(
9
+ redirect_url:
10
+ )
11
+ @redirect_url = redirect_url
12
+ end
13
+
14
+ def self.from(map:)
15
+ Oauth2Approve.new(
16
+ redirect_url: map["redirectUrl"]
17
+ )
18
+ end
19
+
20
+ def to_map
21
+ {
22
+ "redirectUrl": @redirect_url
23
+ }
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,32 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Oauth2Authorize
6
+ attr_reader :grant_id
7
+ attr_reader :redirect_url
8
+
9
+ def initialize(
10
+ grant_id:,
11
+ redirect_url:
12
+ )
13
+ @grant_id = grant_id
14
+ @redirect_url = redirect_url
15
+ end
16
+
17
+ def self.from(map:)
18
+ Oauth2Authorize.new(
19
+ grant_id: map["grantId"],
20
+ redirect_url: map["redirectUrl"]
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "grantId": @grant_id,
27
+ "redirectUrl": @redirect_url
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,72 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Oauth2Consent
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :updated_at
9
+ attr_reader :user_id
10
+ attr_reader :app_id
11
+ attr_reader :cimd_url
12
+ attr_reader :scopes
13
+ attr_reader :resources
14
+ attr_reader :authorization_details
15
+ attr_reader :expire
16
+
17
+ def initialize(
18
+ id:,
19
+ created_at:,
20
+ updated_at:,
21
+ user_id:,
22
+ app_id:,
23
+ cimd_url:,
24
+ scopes:,
25
+ resources:,
26
+ authorization_details:,
27
+ expire:
28
+ )
29
+ @id = id
30
+ @created_at = created_at
31
+ @updated_at = updated_at
32
+ @user_id = user_id
33
+ @app_id = app_id
34
+ @cimd_url = cimd_url
35
+ @scopes = scopes
36
+ @resources = resources
37
+ @authorization_details = authorization_details
38
+ @expire = expire
39
+ end
40
+
41
+ def self.from(map:)
42
+ Oauth2Consent.new(
43
+ id: map["$id"],
44
+ created_at: map["$createdAt"],
45
+ updated_at: map["$updatedAt"],
46
+ user_id: map["userId"],
47
+ app_id: map["appId"],
48
+ cimd_url: map["cimdUrl"],
49
+ scopes: map["scopes"],
50
+ resources: map["resources"],
51
+ authorization_details: map["authorizationDetails"],
52
+ expire: map["expire"]
53
+ )
54
+ end
55
+
56
+ def to_map
57
+ {
58
+ "$id": @id,
59
+ "$createdAt": @created_at,
60
+ "$updatedAt": @updated_at,
61
+ "userId": @user_id,
62
+ "appId": @app_id,
63
+ "cimdUrl": @cimd_url,
64
+ "scopes": @scopes,
65
+ "resources": @resources,
66
+ "authorizationDetails": @authorization_details,
67
+ "expire": @expire
68
+ }
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,32 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Oauth2ConsentList
6
+ attr_reader :total
7
+ attr_reader :consents
8
+
9
+ def initialize(
10
+ total:,
11
+ consents:
12
+ )
13
+ @total = total
14
+ @consents = consents
15
+ end
16
+
17
+ def self.from(map:)
18
+ Oauth2ConsentList.new(
19
+ total: map["total"],
20
+ consents: map["consents"].map { |it| Oauth2Consent.from(map: it) }
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "total": @total,
27
+ "consents": @consents.map { |it| it.to_map }
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,77 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Oauth2ConsentToken
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :updated_at
9
+ attr_reader :consent_id
10
+ attr_reader :user_id
11
+ attr_reader :app_id
12
+ attr_reader :cimd_url
13
+ attr_reader :scopes
14
+ attr_reader :resources
15
+ attr_reader :authorization_details
16
+ attr_reader :expire
17
+
18
+ def initialize(
19
+ id:,
20
+ created_at:,
21
+ updated_at:,
22
+ consent_id:,
23
+ user_id:,
24
+ app_id:,
25
+ cimd_url:,
26
+ scopes:,
27
+ resources:,
28
+ authorization_details:,
29
+ expire:
30
+ )
31
+ @id = id
32
+ @created_at = created_at
33
+ @updated_at = updated_at
34
+ @consent_id = consent_id
35
+ @user_id = user_id
36
+ @app_id = app_id
37
+ @cimd_url = cimd_url
38
+ @scopes = scopes
39
+ @resources = resources
40
+ @authorization_details = authorization_details
41
+ @expire = expire
42
+ end
43
+
44
+ def self.from(map:)
45
+ Oauth2ConsentToken.new(
46
+ id: map["$id"],
47
+ created_at: map["$createdAt"],
48
+ updated_at: map["$updatedAt"],
49
+ consent_id: map["consentId"],
50
+ user_id: map["userId"],
51
+ app_id: map["appId"],
52
+ cimd_url: map["cimdUrl"],
53
+ scopes: map["scopes"],
54
+ resources: map["resources"],
55
+ authorization_details: map["authorizationDetails"],
56
+ expire: map["expire"]
57
+ )
58
+ end
59
+
60
+ def to_map
61
+ {
62
+ "$id": @id,
63
+ "$createdAt": @created_at,
64
+ "$updatedAt": @updated_at,
65
+ "consentId": @consent_id,
66
+ "userId": @user_id,
67
+ "appId": @app_id,
68
+ "cimdUrl": @cimd_url,
69
+ "scopes": @scopes,
70
+ "resources": @resources,
71
+ "authorizationDetails": @authorization_details,
72
+ "expire": @expire
73
+ }
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,32 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Oauth2ConsentTokenList
6
+ attr_reader :total
7
+ attr_reader :tokens
8
+
9
+ def initialize(
10
+ total:,
11
+ tokens:
12
+ )
13
+ @total = total
14
+ @tokens = tokens
15
+ end
16
+
17
+ def self.from(map:)
18
+ Oauth2ConsentTokenList.new(
19
+ total: map["total"],
20
+ tokens: map["tokens"].map { |it| Oauth2ConsentToken.from(map: it) }
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "total": @total,
27
+ "tokens": @tokens.map { |it| it.to_map }
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end