appwrite 26.0.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 (58) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +1 -1
  3. data/lib/appwrite/enums/database_status.rb +11 -0
  4. data/lib/appwrite/enums/database_type.rb +3 -0
  5. data/lib/appwrite/enums/organization_key_scopes.rb +2 -0
  6. data/lib/appwrite/enums/project_key_scopes.rb +3 -0
  7. data/lib/appwrite/models/activity_event.rb +58 -3
  8. data/lib/appwrite/models/app.rb +152 -0
  9. data/lib/appwrite/models/app_installation.rb +72 -0
  10. data/lib/appwrite/models/app_installation_list.rb +32 -0
  11. data/lib/appwrite/models/app_key.rb +67 -0
  12. data/lib/appwrite/models/app_key_list.rb +32 -0
  13. data/lib/appwrite/models/app_scope.rb +47 -0
  14. data/lib/appwrite/models/app_scope_list.rb +32 -0
  15. data/lib/appwrite/models/app_secret.rb +67 -0
  16. data/lib/appwrite/models/app_secret_list.rb +32 -0
  17. data/lib/appwrite/models/app_secret_plaintext.rb +67 -0
  18. data/lib/appwrite/models/apps_list.rb +32 -0
  19. data/lib/appwrite/models/billing_plan.rb +5 -0
  20. data/lib/appwrite/models/database.rb +35 -6
  21. data/lib/appwrite/models/database_status.rb +62 -0
  22. data/lib/appwrite/models/database_status_connections.rb +32 -0
  23. data/lib/appwrite/models/database_status_replica.rb +42 -0
  24. data/lib/appwrite/models/database_status_volume.rb +42 -0
  25. data/lib/appwrite/models/dedicated_database.rb +267 -0
  26. data/lib/appwrite/models/dedicated_database_member.rb +42 -0
  27. data/lib/appwrite/models/dedicated_database_replicas.rb +37 -0
  28. data/lib/appwrite/models/dedicated_database_specification.rb +67 -0
  29. data/lib/appwrite/models/dedicated_database_specification_list.rb +37 -0
  30. data/lib/appwrite/models/dedicated_database_specification_pricing.rb +47 -0
  31. data/lib/appwrite/models/oauth2_approve.rb +27 -0
  32. data/lib/appwrite/models/oauth2_authorize.rb +32 -0
  33. data/lib/appwrite/models/oauth2_consent.rb +72 -0
  34. data/lib/appwrite/models/oauth2_consent_list.rb +32 -0
  35. data/lib/appwrite/models/oauth2_consent_token.rb +77 -0
  36. data/lib/appwrite/models/oauth2_consent_token_list.rb +32 -0
  37. data/lib/appwrite/models/oauth2_device_authorization.rb +52 -0
  38. data/lib/appwrite/models/oauth2_grant.rb +82 -0
  39. data/lib/appwrite/models/oauth2_organization.rb +27 -0
  40. data/lib/appwrite/models/oauth2_organization_list.rb +32 -0
  41. data/lib/appwrite/models/oauth2_par.rb +32 -0
  42. data/lib/appwrite/models/oauth2_project.rb +37 -0
  43. data/lib/appwrite/models/oauth2_project_list.rb +32 -0
  44. data/lib/appwrite/models/oauth2_reject.rb +27 -0
  45. data/lib/appwrite/models/oauth2_token.rb +57 -0
  46. data/lib/appwrite/models/project.rb +10 -0
  47. data/lib/appwrite/models/project_auth_method.rb +3 -3
  48. data/lib/appwrite/services/account.rb +209 -0
  49. data/lib/appwrite/services/apps.rb +813 -0
  50. data/lib/appwrite/services/backups.rb +25 -12
  51. data/lib/appwrite/services/oauth2.rb +525 -0
  52. data/lib/appwrite/services/organization.rb +168 -0
  53. data/lib/appwrite/services/project.rb +3 -1
  54. data/lib/appwrite/services/sites.rb +3 -1
  55. data/lib/appwrite/services/tables_db.rb +134 -2
  56. data/lib/appwrite/services/teams.rb +198 -0
  57. data/lib/appwrite.rb +38 -0
  58. metadata +40 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a98589c4711b73704142a881aa5557531fe64568b384863acde2515b859b4d02
4
- data.tar.gz: 30ad6133e6b2e48d8cf623feb89d599f716cba7734493334a54e5ee366891c93
3
+ metadata.gz: '02891ab1059978945c4a148b229e240f171612f8cfe7ed5d677ddc965796439e'
4
+ data.tar.gz: 390bb97d112b72b6baeb7a2d9d1d38f155bedb6136b2d326e8d62ce3fad44476
5
5
  SHA512:
6
- metadata.gz: 90f23c7c48e5cb73cf9cf8404062cec4094673e79151b7f440ec657d84d72e363ee5523f8e8cc472a1f9d764ed68c1656169dc5f8578f13994ae7f456598991a
7
- data.tar.gz: 7f11755dbcf35959f7227cbba73131e21566d7f6c096633d1a9dd369afaf3a312a466dd8e239b80e567f8356cedeb2034d86cf2b44d38db4a23147b03bc8ce74
6
+ metadata.gz: 75ccab76ec05a49ead852f078afe07efbbee3b73b09820737597298e5a0b403d3f5deca9572dd41f0c4a0fd09cae1f98b3ed76ae0025370213b915d3d9aa7b2f
7
+ data.tar.gz: baf6dd1c0e4522e91a5079404619e1df15d221904ef1c7646ede6a3068bbe085167e285cfc6fd27f1cb3f5f3ec2fe7b85f9cb68f4893b8cd46bcd54a186e5d74
@@ -15,7 +15,7 @@ module Appwrite
15
15
  'x-sdk-name'=> 'Ruby',
16
16
  'x-sdk-platform'=> 'server',
17
17
  'x-sdk-language'=> 'ruby',
18
- 'x-sdk-version'=> '26.0.0',
18
+ 'x-sdk-version'=> '26.1.0',
19
19
  'X-Appwrite-Response-Format' => '1.9.5'
20
20
  }
21
21
  @endpoint = 'https://cloud.appwrite.io/v1'
@@ -3,7 +3,18 @@ module Appwrite
3
3
  module DatabaseStatus
4
4
  PROVISIONING = 'provisioning'
5
5
  READY = 'ready'
6
+ INACTIVE = 'inactive'
7
+ PAUSED = 'paused'
6
8
  FAILED = 'failed'
9
+ DELETING = 'deleting'
10
+ DELETED = 'deleted'
11
+ RESTORING = 'restoring'
12
+ SCALING = 'scaling'
13
+ UPGRADING = 'upgrading'
14
+ MIGRATING = 'migrating'
15
+ PAUSING = 'pausing'
16
+ RESUMING = 'resuming'
17
+ FAILING_OVER = 'failing-over'
7
18
  end
8
19
  end
9
20
  end
@@ -5,6 +5,9 @@ module Appwrite
5
5
  TABLESDB = 'tablesdb'
6
6
  DOCUMENTSDB = 'documentsdb'
7
7
  VECTORSDB = 'vectorsdb'
8
+ MYSQL = 'mysql'
9
+ POSTGRESQL = 'postgresql'
10
+ MONGODB = 'mongodb'
8
11
  end
9
12
  end
10
13
  end
@@ -7,6 +7,8 @@ module Appwrite
7
7
  DEVKEYS_WRITE = 'devKeys.write'
8
8
  ORGANIZATION_KEYS_READ = 'organization.keys.read'
9
9
  ORGANIZATION_KEYS_WRITE = 'organization.keys.write'
10
+ ORGANIZATION_INSTALLATIONS_READ = 'organization.installations.read'
11
+ ORGANIZATION_INSTALLATIONS_WRITE = 'organization.installations.write'
10
12
  ORGANIZATION_MEMBERSHIPS_READ = 'organization.memberships.read'
11
13
  ORGANIZATION_MEMBERSHIPS_WRITE = 'organization.memberships.write'
12
14
  ORGANIZATION_READ = 'organization.read'
@@ -96,11 +96,14 @@ module Appwrite
96
96
  DEDICATEDDATABASES_EXECUTE = 'dedicatedDatabases.execute'
97
97
  DOMAINS_READ = 'domains.read'
98
98
  DOMAINS_WRITE = 'domains.write'
99
+ WAFRULES_READ = 'wafRules.read'
100
+ WAFRULES_WRITE = 'wafRules.write'
99
101
  EVENTS_READ = 'events.read'
100
102
  APPS_READ = 'apps.read'
101
103
  APPS_WRITE = 'apps.write'
102
104
  OAUTH2_READ = 'oauth2.read'
103
105
  OAUTH2_WRITE = 'oauth2.write'
106
+ OAUTH2_INTROSPECT = 'oauth2.introspect'
104
107
  USAGE_READ = 'usage.read'
105
108
  end
106
109
  end
@@ -17,10 +17,21 @@ module Appwrite
17
17
  attr_reader :ip
18
18
  attr_reader :mode
19
19
  attr_reader :country
20
+ attr_reader :continent_code
21
+ attr_reader :city
22
+ attr_reader :subdivisions
23
+ attr_reader :isp
24
+ attr_reader :autonomous_system_number
25
+ attr_reader :autonomous_system_organization
26
+ attr_reader :connection_type
27
+ attr_reader :connection_usage_type
28
+ attr_reader :connection_organization
20
29
  attr_reader :time
21
30
  attr_reader :project_id
22
31
  attr_reader :team_id
23
32
  attr_reader :hostname
33
+ attr_reader :sdk
34
+ attr_reader :sdk_version
24
35
 
25
36
  def initialize(
26
37
  id:,
@@ -37,10 +48,21 @@ module Appwrite
37
48
  ip:,
38
49
  mode:,
39
50
  country:,
51
+ continent_code:,
52
+ city:,
53
+ subdivisions:,
54
+ isp:,
55
+ autonomous_system_number:,
56
+ autonomous_system_organization:,
57
+ connection_type:,
58
+ connection_usage_type:,
59
+ connection_organization:,
40
60
  time:,
41
61
  project_id:,
42
62
  team_id:,
43
- hostname:
63
+ hostname:,
64
+ sdk:,
65
+ sdk_version:
44
66
  )
45
67
  @id = id
46
68
  @actor_type = actor_type
@@ -56,10 +78,21 @@ module Appwrite
56
78
  @ip = ip
57
79
  @mode = mode
58
80
  @country = country
81
+ @continent_code = continent_code
82
+ @city = city
83
+ @subdivisions = subdivisions
84
+ @isp = isp
85
+ @autonomous_system_number = autonomous_system_number
86
+ @autonomous_system_organization = autonomous_system_organization
87
+ @connection_type = connection_type
88
+ @connection_usage_type = connection_usage_type
89
+ @connection_organization = connection_organization
59
90
  @time = time
60
91
  @project_id = project_id
61
92
  @team_id = team_id
62
93
  @hostname = hostname
94
+ @sdk = sdk
95
+ @sdk_version = sdk_version
63
96
  end
64
97
 
65
98
  def self.from(map:)
@@ -78,10 +111,21 @@ module Appwrite
78
111
  ip: map["ip"],
79
112
  mode: map["mode"],
80
113
  country: map["country"],
114
+ continent_code: map["continentCode"],
115
+ city: map["city"],
116
+ subdivisions: map["subdivisions"],
117
+ isp: map["isp"],
118
+ autonomous_system_number: map["autonomousSystemNumber"],
119
+ autonomous_system_organization: map["autonomousSystemOrganization"],
120
+ connection_type: map["connectionType"],
121
+ connection_usage_type: map["connectionUsageType"],
122
+ connection_organization: map["connectionOrganization"],
81
123
  time: map["time"],
82
124
  project_id: map["projectId"],
83
125
  team_id: map["teamId"],
84
- hostname: map["hostname"]
126
+ hostname: map["hostname"],
127
+ sdk: map["sdk"],
128
+ sdk_version: map["sdkVersion"]
85
129
  )
86
130
  end
87
131
 
@@ -101,10 +145,21 @@ module Appwrite
101
145
  "ip": @ip,
102
146
  "mode": @mode,
103
147
  "country": @country,
148
+ "continentCode": @continent_code,
149
+ "city": @city,
150
+ "subdivisions": @subdivisions,
151
+ "isp": @isp,
152
+ "autonomousSystemNumber": @autonomous_system_number,
153
+ "autonomousSystemOrganization": @autonomous_system_organization,
154
+ "connectionType": @connection_type,
155
+ "connectionUsageType": @connection_usage_type,
156
+ "connectionOrganization": @connection_organization,
104
157
  "time": @time,
105
158
  "projectId": @project_id,
106
159
  "teamId": @team_id,
107
- "hostname": @hostname
160
+ "hostname": @hostname,
161
+ "sdk": @sdk,
162
+ "sdkVersion": @sdk_version
108
163
  }
109
164
  end
110
165
  end
@@ -0,0 +1,152 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class App
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :updated_at
9
+ attr_reader :name
10
+ attr_reader :description
11
+ attr_reader :client_uri
12
+ attr_reader :logo_uri
13
+ attr_reader :privacy_policy_url
14
+ attr_reader :terms_url
15
+ attr_reader :contacts
16
+ attr_reader :tagline
17
+ attr_reader :tags
18
+ attr_reader :labels
19
+ attr_reader :images
20
+ attr_reader :support_url
21
+ attr_reader :data_deletion_url
22
+ attr_reader :redirect_uris
23
+ attr_reader :post_logout_redirect_uris
24
+ attr_reader :enabled
25
+ attr_reader :type
26
+ attr_reader :device_flow
27
+ attr_reader :team_id
28
+ attr_reader :user_id
29
+ attr_reader :installation_scopes
30
+ attr_reader :installation_redirect_url
31
+ attr_reader :secrets
32
+
33
+ def initialize(
34
+ id:,
35
+ created_at:,
36
+ updated_at:,
37
+ name:,
38
+ description:,
39
+ client_uri:,
40
+ logo_uri:,
41
+ privacy_policy_url:,
42
+ terms_url:,
43
+ contacts:,
44
+ tagline:,
45
+ tags:,
46
+ labels:,
47
+ images:,
48
+ support_url:,
49
+ data_deletion_url:,
50
+ redirect_uris:,
51
+ post_logout_redirect_uris:,
52
+ enabled:,
53
+ type:,
54
+ device_flow:,
55
+ team_id:,
56
+ user_id:,
57
+ installation_scopes:,
58
+ installation_redirect_url:,
59
+ secrets:
60
+ )
61
+ @id = id
62
+ @created_at = created_at
63
+ @updated_at = updated_at
64
+ @name = name
65
+ @description = description
66
+ @client_uri = client_uri
67
+ @logo_uri = logo_uri
68
+ @privacy_policy_url = privacy_policy_url
69
+ @terms_url = terms_url
70
+ @contacts = contacts
71
+ @tagline = tagline
72
+ @tags = tags
73
+ @labels = labels
74
+ @images = images
75
+ @support_url = support_url
76
+ @data_deletion_url = data_deletion_url
77
+ @redirect_uris = redirect_uris
78
+ @post_logout_redirect_uris = post_logout_redirect_uris
79
+ @enabled = enabled
80
+ @type = type
81
+ @device_flow = device_flow
82
+ @team_id = team_id
83
+ @user_id = user_id
84
+ @installation_scopes = installation_scopes
85
+ @installation_redirect_url = installation_redirect_url
86
+ @secrets = secrets
87
+ end
88
+
89
+ def self.from(map:)
90
+ App.new(
91
+ id: map["$id"],
92
+ created_at: map["$createdAt"],
93
+ updated_at: map["$updatedAt"],
94
+ name: map["name"],
95
+ description: map["description"],
96
+ client_uri: map["clientUri"],
97
+ logo_uri: map["logoUri"],
98
+ privacy_policy_url: map["privacyPolicyUrl"],
99
+ terms_url: map["termsUrl"],
100
+ contacts: map["contacts"],
101
+ tagline: map["tagline"],
102
+ tags: map["tags"],
103
+ labels: map["labels"],
104
+ images: map["images"],
105
+ support_url: map["supportUrl"],
106
+ data_deletion_url: map["dataDeletionUrl"],
107
+ redirect_uris: map["redirectUris"],
108
+ post_logout_redirect_uris: map["postLogoutRedirectUris"],
109
+ enabled: map["enabled"],
110
+ type: map["type"],
111
+ device_flow: map["deviceFlow"],
112
+ team_id: map["teamId"],
113
+ user_id: map["userId"],
114
+ installation_scopes: map["installationScopes"],
115
+ installation_redirect_url: map["installationRedirectUrl"],
116
+ secrets: map["secrets"].map { |it| AppSecret.from(map: it) }
117
+ )
118
+ end
119
+
120
+ def to_map
121
+ {
122
+ "$id": @id,
123
+ "$createdAt": @created_at,
124
+ "$updatedAt": @updated_at,
125
+ "name": @name,
126
+ "description": @description,
127
+ "clientUri": @client_uri,
128
+ "logoUri": @logo_uri,
129
+ "privacyPolicyUrl": @privacy_policy_url,
130
+ "termsUrl": @terms_url,
131
+ "contacts": @contacts,
132
+ "tagline": @tagline,
133
+ "tags": @tags,
134
+ "labels": @labels,
135
+ "images": @images,
136
+ "supportUrl": @support_url,
137
+ "dataDeletionUrl": @data_deletion_url,
138
+ "redirectUris": @redirect_uris,
139
+ "postLogoutRedirectUris": @post_logout_redirect_uris,
140
+ "enabled": @enabled,
141
+ "type": @type,
142
+ "deviceFlow": @device_flow,
143
+ "teamId": @team_id,
144
+ "userId": @user_id,
145
+ "installationScopes": @installation_scopes,
146
+ "installationRedirectUrl": @installation_redirect_url,
147
+ "secrets": @secrets.map { |it| it.to_map }
148
+ }
149
+ end
150
+ end
151
+ end
152
+ end
@@ -0,0 +1,72 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class AppInstallation
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :updated_at
9
+ attr_reader :app_id
10
+ attr_reader :team_id
11
+ attr_reader :scopes
12
+ attr_reader :authorization_details
13
+ attr_reader :created_by_id
14
+ attr_reader :created_by_name
15
+ attr_reader :last_accessed_at
16
+
17
+ def initialize(
18
+ id:,
19
+ created_at:,
20
+ updated_at:,
21
+ app_id:,
22
+ team_id:,
23
+ scopes:,
24
+ authorization_details:,
25
+ created_by_id:,
26
+ created_by_name:,
27
+ last_accessed_at:
28
+ )
29
+ @id = id
30
+ @created_at = created_at
31
+ @updated_at = updated_at
32
+ @app_id = app_id
33
+ @team_id = team_id
34
+ @scopes = scopes
35
+ @authorization_details = authorization_details
36
+ @created_by_id = created_by_id
37
+ @created_by_name = created_by_name
38
+ @last_accessed_at = last_accessed_at
39
+ end
40
+
41
+ def self.from(map:)
42
+ AppInstallation.new(
43
+ id: map["$id"],
44
+ created_at: map["$createdAt"],
45
+ updated_at: map["$updatedAt"],
46
+ app_id: map["appId"],
47
+ team_id: map["teamId"],
48
+ scopes: map["scopes"],
49
+ authorization_details: map["authorizationDetails"],
50
+ created_by_id: map["createdById"],
51
+ created_by_name: map["createdByName"],
52
+ last_accessed_at: map["lastAccessedAt"]
53
+ )
54
+ end
55
+
56
+ def to_map
57
+ {
58
+ "$id": @id,
59
+ "$createdAt": @created_at,
60
+ "$updatedAt": @updated_at,
61
+ "appId": @app_id,
62
+ "teamId": @team_id,
63
+ "scopes": @scopes,
64
+ "authorizationDetails": @authorization_details,
65
+ "createdById": @created_by_id,
66
+ "createdByName": @created_by_name,
67
+ "lastAccessedAt": @last_accessed_at
68
+ }
69
+ end
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,32 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class AppInstallationList
6
+ attr_reader :total
7
+ attr_reader :installations
8
+
9
+ def initialize(
10
+ total:,
11
+ installations:
12
+ )
13
+ @total = total
14
+ @installations = installations
15
+ end
16
+
17
+ def self.from(map:)
18
+ AppInstallationList.new(
19
+ total: map["total"],
20
+ installations: map["installations"].map { |it| AppInstallation.from(map: it) }
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "total": @total,
27
+ "installations": @installations.map { |it| it.to_map }
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,67 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class AppKey
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :updated_at
9
+ attr_reader :app_id
10
+ attr_reader :secret
11
+ attr_reader :hint
12
+ attr_reader :created_by_id
13
+ attr_reader :created_by_name
14
+ attr_reader :last_accessed_at
15
+
16
+ def initialize(
17
+ id:,
18
+ created_at:,
19
+ updated_at:,
20
+ app_id:,
21
+ secret:,
22
+ hint:,
23
+ created_by_id:,
24
+ created_by_name:,
25
+ last_accessed_at:
26
+ )
27
+ @id = id
28
+ @created_at = created_at
29
+ @updated_at = updated_at
30
+ @app_id = app_id
31
+ @secret = secret
32
+ @hint = hint
33
+ @created_by_id = created_by_id
34
+ @created_by_name = created_by_name
35
+ @last_accessed_at = last_accessed_at
36
+ end
37
+
38
+ def self.from(map:)
39
+ AppKey.new(
40
+ id: map["$id"],
41
+ created_at: map["$createdAt"],
42
+ updated_at: map["$updatedAt"],
43
+ app_id: map["appId"],
44
+ secret: map["secret"],
45
+ hint: map["hint"],
46
+ created_by_id: map["createdById"],
47
+ created_by_name: map["createdByName"],
48
+ last_accessed_at: map["lastAccessedAt"]
49
+ )
50
+ end
51
+
52
+ def to_map
53
+ {
54
+ "$id": @id,
55
+ "$createdAt": @created_at,
56
+ "$updatedAt": @updated_at,
57
+ "appId": @app_id,
58
+ "secret": @secret,
59
+ "hint": @hint,
60
+ "createdById": @created_by_id,
61
+ "createdByName": @created_by_name,
62
+ "lastAccessedAt": @last_accessed_at
63
+ }
64
+ end
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,32 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class AppKeyList
6
+ attr_reader :total
7
+ attr_reader :keys
8
+
9
+ def initialize(
10
+ total:,
11
+ keys:
12
+ )
13
+ @total = total
14
+ @keys = keys
15
+ end
16
+
17
+ def self.from(map:)
18
+ AppKeyList.new(
19
+ total: map["total"],
20
+ keys: map["keys"].map { |it| AppKey.from(map: it) }
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "total": @total,
27
+ "keys": @keys.map { |it| it.to_map }
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,47 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class AppScope
6
+ attr_reader :value
7
+ attr_reader :description
8
+ attr_reader :type
9
+ attr_reader :category
10
+ attr_reader :deprecated
11
+
12
+ def initialize(
13
+ value:,
14
+ description:,
15
+ type:,
16
+ category:,
17
+ deprecated:
18
+ )
19
+ @value = value
20
+ @description = description
21
+ @type = type
22
+ @category = category
23
+ @deprecated = deprecated
24
+ end
25
+
26
+ def self.from(map:)
27
+ AppScope.new(
28
+ value: map["value"],
29
+ description: map["description"],
30
+ type: map["type"],
31
+ category: map["category"],
32
+ deprecated: map["deprecated"]
33
+ )
34
+ end
35
+
36
+ def to_map
37
+ {
38
+ "value": @value,
39
+ "description": @description,
40
+ "type": @type,
41
+ "category": @category,
42
+ "deprecated": @deprecated
43
+ }
44
+ end
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,32 @@
1
+ #frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class AppScopeList
6
+ attr_reader :total
7
+ attr_reader :scopes
8
+
9
+ def initialize(
10
+ total:,
11
+ scopes:
12
+ )
13
+ @total = total
14
+ @scopes = scopes
15
+ end
16
+
17
+ def self.from(map:)
18
+ AppScopeList.new(
19
+ total: map["total"],
20
+ scopes: map["scopes"].map { |it| AppScope.from(map: it) }
21
+ )
22
+ end
23
+
24
+ def to_map
25
+ {
26
+ "total": @total,
27
+ "scopes": @scopes.map { |it| it.to_map }
28
+ }
29
+ end
30
+ end
31
+ end
32
+ end