appwrite 30.1.0 → 30.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/appwrite/client.rb +16 -2
- data/lib/appwrite/enums/appwrite_migration_resource.rb +1 -0
- data/lib/appwrite/enums/image_format.rb +1 -0
- data/lib/appwrite/enums/o_auth_provider.rb +3 -0
- data/lib/appwrite/enums/project_auth_method_id.rb +1 -0
- data/lib/appwrite/enums/project_key_scopes.rb +12 -0
- data/lib/appwrite/enums/project_ldap_encryption.rb +9 -0
- data/lib/appwrite/enums/project_o_auth_provider_id.rb +3 -0
- data/lib/appwrite/enums/project_policy_id.rb +1 -0
- data/lib/appwrite/models/activity_event.rb +9 -4
- data/lib/appwrite/models/device.rb +58 -0
- data/lib/appwrite/models/domain_price.rb +8 -3
- data/lib/appwrite/models/environment.rb +48 -0
- data/lib/appwrite/models/environment_list.rb +33 -0
- data/lib/appwrite/models/o_auth2_naver.rb +43 -0
- data/lib/appwrite/models/o_auth2_vipps.rb +43 -0
- data/lib/appwrite/models/organization.rb +16 -1
- data/lib/appwrite/models/policy_account_devices.rb +33 -0
- data/lib/appwrite/models/project.rb +91 -1
- data/lib/appwrite/models/project_auth_method.rb +1 -0
- data/lib/appwrite/models/proxy_rule.rb +11 -1
- data/lib/appwrite/models/session.rb +6 -1
- data/lib/appwrite/models/site.rb +14 -4
- data/lib/appwrite/models/waf_rule_bypass.rb +8 -3
- data/lib/appwrite/models/waf_rule_challenge.rb +5 -0
- data/lib/appwrite/models/waf_rule_deny.rb +8 -3
- data/lib/appwrite/models/waf_rule_rate_limit.rb +5 -0
- data/lib/appwrite/models/waf_rule_redirect.rb +5 -0
- data/lib/appwrite/services/account.rb +206 -1
- data/lib/appwrite/services/avatars.rb +5 -2
- data/lib/appwrite/services/domains.rb +7 -6
- data/lib/appwrite/services/project.rb +402 -21
- data/lib/appwrite/services/proxy.rb +154 -1
- data/lib/appwrite/services/sites.rb +44 -0
- data/lib/appwrite/services/storage.rb +7 -4
- data/lib/appwrite/services/waf.rb +40 -10
- data/lib/appwrite.rb +7 -0
- metadata +9 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d7518dcd2e08b6917cae0f5d68ae9d50bcf47dcafc900571435e2f10c81b85c8
|
|
4
|
+
data.tar.gz: 370850a37e56b5a72b6a700d932a42584603ec97818c46a7eb133c22f3d96ebd
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f275b0df7a824ed73aa1b7314de9c8111de7f29a3c11cc27069dcbd86ca55a44ee66b75b84ed7e4f085ddcd0620a4d18ff17bdebea3e839546083284d83eb210
|
|
7
|
+
data.tar.gz: f2b1069325a832912a369204908d3026ae92377d67b97c56978fbd6a98161b14a0f895126cfe8cce21de73e4c7c99118fb9da278ddba5bf3336c7fa5c867bc5e
|
data/lib/appwrite/client.rb
CHANGED
|
@@ -14,8 +14,8 @@ module Appwrite
|
|
|
14
14
|
'x-sdk-name' => 'Ruby',
|
|
15
15
|
'x-sdk-platform' => 'server',
|
|
16
16
|
'x-sdk-language' => 'ruby',
|
|
17
|
-
'x-sdk-version' => '30.
|
|
18
|
-
'X-Appwrite-Response-Format' => '2.
|
|
17
|
+
'x-sdk-version' => '30.3.0',
|
|
18
|
+
'X-Appwrite-Response-Format' => '2.7.2'
|
|
19
19
|
}
|
|
20
20
|
@endpoint = 'https://cloud.appwrite.io/v1'
|
|
21
21
|
@config = {}
|
|
@@ -102,6 +102,20 @@ module Appwrite
|
|
|
102
102
|
self
|
|
103
103
|
end
|
|
104
104
|
|
|
105
|
+
# Set Environment
|
|
106
|
+
#
|
|
107
|
+
# The ID of the project environment to act in, alongside the project ID. Used with Appwrite Cloud projects that have environments.
|
|
108
|
+
#
|
|
109
|
+
# @param [String] value The value to set for the Environment header
|
|
110
|
+
#
|
|
111
|
+
# @return [self]
|
|
112
|
+
def set_environment(value)
|
|
113
|
+
add_header('x-appwrite-environment', value)
|
|
114
|
+
@config['environment'] = value
|
|
115
|
+
|
|
116
|
+
self
|
|
117
|
+
end
|
|
118
|
+
|
|
105
119
|
# Set Session
|
|
106
120
|
#
|
|
107
121
|
# The user session to authenticate with
|
|
@@ -37,6 +37,7 @@ module Appwrite
|
|
|
37
37
|
PROJECT_VARIABLE = 'project-variable'
|
|
38
38
|
PROJECT_PROTOCOLS = 'project-protocols'
|
|
39
39
|
PROJECT_LABELS = 'project-labels'
|
|
40
|
+
PROJECT_PREFERENCES = 'project-preferences'
|
|
40
41
|
PROJECT_SERVICES = 'project-services'
|
|
41
42
|
PROJECT_EMAIL_TEMPLATE = 'project-email-template'
|
|
42
43
|
PROJECT_ENVIRONMENT = 'project-environment'
|
|
@@ -28,6 +28,7 @@ module Appwrite
|
|
|
28
28
|
KICK = 'kick'
|
|
29
29
|
LINKEDIN = 'linkedin'
|
|
30
30
|
MICROSOFT = 'microsoft'
|
|
31
|
+
NAVER = 'naver'
|
|
31
32
|
NOTION = 'notion'
|
|
32
33
|
OIDC = 'oidc'
|
|
33
34
|
OKTA = 'okta'
|
|
@@ -43,6 +44,8 @@ module Appwrite
|
|
|
43
44
|
TRADESHIFT = 'tradeshift'
|
|
44
45
|
TRADESHIFTBOX = 'tradeshiftBox'
|
|
45
46
|
TWITCH = 'twitch'
|
|
47
|
+
VIPPS = 'vipps'
|
|
48
|
+
VIPPSSANDBOX = 'vippsSandbox'
|
|
46
49
|
WEBFLOW = 'webflow'
|
|
47
50
|
WORDPRESS = 'wordpress'
|
|
48
51
|
X = 'x'
|
|
@@ -14,8 +14,11 @@ module Appwrite
|
|
|
14
14
|
POLICIES_WRITE = 'policies.write'
|
|
15
15
|
PROJECT_POLICIES_READ = 'project.policies.read'
|
|
16
16
|
PROJECT_POLICIES_WRITE = 'project.policies.write'
|
|
17
|
+
PROJECT_VIDEOS_PROFILES_READ = 'project.videos.profiles.read'
|
|
18
|
+
PROJECT_VIDEOS_PROFILES_WRITE = 'project.videos.profiles.write'
|
|
17
19
|
PROJECT_OAUTH2_READ = 'project.oauth2.read'
|
|
18
20
|
PROJECT_OAUTH2_WRITE = 'project.oauth2.write'
|
|
21
|
+
PROJECT_LDAP_WRITE = 'project.ldap.write'
|
|
19
22
|
TEMPLATES_READ = 'templates.read'
|
|
20
23
|
TEMPLATES_WRITE = 'templates.write'
|
|
21
24
|
STAGES_READ = 'stages.read'
|
|
@@ -89,6 +92,10 @@ module Appwrite
|
|
|
89
92
|
RULES_WRITE = 'rules.write'
|
|
90
93
|
WEBHOOKS_READ = 'webhooks.read'
|
|
91
94
|
WEBHOOKS_WRITE = 'webhooks.write'
|
|
95
|
+
MONITORS_READ = 'monitors.read'
|
|
96
|
+
MONITORS_WRITE = 'monitors.write'
|
|
97
|
+
ALERTS_READ = 'alerts.read'
|
|
98
|
+
ALERTS_WRITE = 'alerts.write'
|
|
92
99
|
LOCALE_READ = 'locale.read'
|
|
93
100
|
AVATARS_READ = 'avatars.read'
|
|
94
101
|
AVATARS_WRITE = 'avatars.write'
|
|
@@ -104,8 +111,13 @@ module Appwrite
|
|
|
104
111
|
INSIGHTS_WRITE = 'insights.write'
|
|
105
112
|
REPORTS_READ = 'reports.read'
|
|
106
113
|
REPORTS_WRITE = 'reports.write'
|
|
114
|
+
REVIEWS_READ = 'reviews.read'
|
|
115
|
+
REVIEWS_WRITE = 'reviews.write'
|
|
107
116
|
PRESENCES_READ = 'presences.read'
|
|
108
117
|
PRESENCES_WRITE = 'presences.write'
|
|
118
|
+
VIDEOS_PLAY = 'videos.play'
|
|
119
|
+
VIDEOS_READ = 'videos.read'
|
|
120
|
+
VIDEOS_WRITE = 'videos.write'
|
|
109
121
|
DEDICATEDDATABASES_EXECUTE = 'dedicatedDatabases.execute'
|
|
110
122
|
BACKUPS_POLICIES_READ = 'backups.policies.read'
|
|
111
123
|
BACKUPS_POLICIES_WRITE = 'backups.policies.write'
|
|
@@ -28,6 +28,7 @@ module Appwrite
|
|
|
28
28
|
KICK = 'kick'
|
|
29
29
|
LINKEDIN = 'linkedin'
|
|
30
30
|
MICROSOFT = 'microsoft'
|
|
31
|
+
NAVER = 'naver'
|
|
31
32
|
NOTION = 'notion'
|
|
32
33
|
OIDC = 'oidc'
|
|
33
34
|
OKTA = 'okta'
|
|
@@ -43,6 +44,8 @@ module Appwrite
|
|
|
43
44
|
TRADESHIFT = 'tradeshift'
|
|
44
45
|
TRADESHIFTBOX = 'tradeshiftBox'
|
|
45
46
|
TWITCH = 'twitch'
|
|
47
|
+
VIPPS = 'vipps'
|
|
48
|
+
VIPPSSANDBOX = 'vippsSandbox'
|
|
46
49
|
WEBFLOW = 'webflow'
|
|
47
50
|
WORDPRESS = 'wordpress'
|
|
48
51
|
X = 'x'
|
|
@@ -32,6 +32,7 @@ module Appwrite
|
|
|
32
32
|
attr_reader :hostname
|
|
33
33
|
attr_reader :sdk
|
|
34
34
|
attr_reader :sdk_version
|
|
35
|
+
attr_reader :reason
|
|
35
36
|
|
|
36
37
|
def initialize(
|
|
37
38
|
id:,
|
|
@@ -62,7 +63,8 @@ module Appwrite
|
|
|
62
63
|
team_id:,
|
|
63
64
|
hostname:,
|
|
64
65
|
sdk:,
|
|
65
|
-
sdk_version
|
|
66
|
+
sdk_version:,
|
|
67
|
+
reason:
|
|
66
68
|
)
|
|
67
69
|
@id = id
|
|
68
70
|
@actor_type = actor_type
|
|
@@ -93,10 +95,11 @@ module Appwrite
|
|
|
93
95
|
@hostname = hostname
|
|
94
96
|
@sdk = sdk
|
|
95
97
|
@sdk_version = sdk_version
|
|
98
|
+
@reason = reason
|
|
96
99
|
end
|
|
97
100
|
|
|
98
101
|
def self.from(map:)
|
|
99
|
-
map = { "$id" => "", "actorType" => "", "actorId" => "", "actorEmail" => "", "actorName" => "", "resourceParent" => "", "resourceType" => "", "resourceId" => "", "resource" => "", "event" => "", "userAgent" => "", "ip" => "", "mode" => "", "country" => "", "continentCode" => "", "city" => "", "subdivisions" => "", "isp" => "", "autonomousSystemNumber" => "", "autonomousSystemOrganization" => "", "connectionType" => "", "connectionUsageType" => "", "connectionOrganization" => "", "time" => "", "projectId" => "", "teamId" => "", "hostname" => "", "sdk" => "", "sdkVersion" => "" }.merge(map)
|
|
102
|
+
map = { "$id" => "", "actorType" => "", "actorId" => "", "actorEmail" => "", "actorName" => "", "resourceParent" => "", "resourceType" => "", "resourceId" => "", "resource" => "", "event" => "", "userAgent" => "", "ip" => "", "mode" => "", "country" => "", "continentCode" => "", "city" => "", "subdivisions" => "", "isp" => "", "autonomousSystemNumber" => "", "autonomousSystemOrganization" => "", "connectionType" => "", "connectionUsageType" => "", "connectionOrganization" => "", "time" => "", "projectId" => "", "teamId" => "", "hostname" => "", "sdk" => "", "sdkVersion" => "", "reason" => "" }.merge(map)
|
|
100
103
|
ActivityEvent.new(
|
|
101
104
|
id: map["$id"],
|
|
102
105
|
actor_type: map["actorType"],
|
|
@@ -126,7 +129,8 @@ module Appwrite
|
|
|
126
129
|
team_id: map["teamId"],
|
|
127
130
|
hostname: map["hostname"],
|
|
128
131
|
sdk: map["sdk"],
|
|
129
|
-
sdk_version: map["sdkVersion"]
|
|
132
|
+
sdk_version: map["sdkVersion"],
|
|
133
|
+
reason: map["reason"]
|
|
130
134
|
)
|
|
131
135
|
end
|
|
132
136
|
|
|
@@ -160,7 +164,8 @@ module Appwrite
|
|
|
160
164
|
"teamId": @team_id,
|
|
161
165
|
"hostname": @hostname,
|
|
162
166
|
"sdk": @sdk,
|
|
163
|
-
"sdkVersion": @sdk_version
|
|
167
|
+
"sdkVersion": @sdk_version,
|
|
168
|
+
"reason": @reason
|
|
164
169
|
}
|
|
165
170
|
end
|
|
166
171
|
end
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class Device
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :created_at
|
|
8
|
+
attr_reader :updated_at
|
|
9
|
+
attr_reader :expire
|
|
10
|
+
attr_reader :active_session_id
|
|
11
|
+
attr_reader :sessions
|
|
12
|
+
attr_reader :secret
|
|
13
|
+
|
|
14
|
+
def initialize(
|
|
15
|
+
id:,
|
|
16
|
+
created_at:,
|
|
17
|
+
updated_at:,
|
|
18
|
+
expire:,
|
|
19
|
+
active_session_id:,
|
|
20
|
+
sessions:,
|
|
21
|
+
secret:
|
|
22
|
+
)
|
|
23
|
+
@id = id
|
|
24
|
+
@created_at = created_at
|
|
25
|
+
@updated_at = updated_at
|
|
26
|
+
@expire = expire
|
|
27
|
+
@active_session_id = active_session_id
|
|
28
|
+
@sessions = sessions
|
|
29
|
+
@secret = secret
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def self.from(map:)
|
|
33
|
+
map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "expire" => "", "activeSessionId" => "", "sessions" => [], "secret" => "" }.merge(map)
|
|
34
|
+
Device.new(
|
|
35
|
+
id: map["$id"],
|
|
36
|
+
created_at: map["$createdAt"],
|
|
37
|
+
updated_at: map["$updatedAt"],
|
|
38
|
+
expire: map["expire"],
|
|
39
|
+
active_session_id: map["activeSessionId"],
|
|
40
|
+
sessions: map["sessions"].map { |it| Session.from(map: it) },
|
|
41
|
+
secret: map["secret"]
|
|
42
|
+
)
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def to_map
|
|
46
|
+
{
|
|
47
|
+
"$id": @id,
|
|
48
|
+
"$createdAt": @created_at,
|
|
49
|
+
"$updatedAt": @updated_at,
|
|
50
|
+
"expire": @expire,
|
|
51
|
+
"activeSessionId": @active_session_id,
|
|
52
|
+
"sessions": @sessions.map { |it| it.to_map },
|
|
53
|
+
"secret": @secret
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -11,6 +11,7 @@ module Appwrite
|
|
|
11
11
|
attr_reader :premium
|
|
12
12
|
attr_reader :renewal_price
|
|
13
13
|
attr_reader :renewal_period_years
|
|
14
|
+
attr_reader :reason
|
|
14
15
|
|
|
15
16
|
def initialize(
|
|
16
17
|
domain:,
|
|
@@ -20,7 +21,8 @@ module Appwrite
|
|
|
20
21
|
period_years:,
|
|
21
22
|
premium:,
|
|
22
23
|
renewal_price: nil,
|
|
23
|
-
renewal_period_years
|
|
24
|
+
renewal_period_years:,
|
|
25
|
+
reason: nil
|
|
24
26
|
)
|
|
25
27
|
@domain = domain
|
|
26
28
|
@tld = tld
|
|
@@ -30,6 +32,7 @@ module Appwrite
|
|
|
30
32
|
@premium = premium
|
|
31
33
|
@renewal_price = renewal_price
|
|
32
34
|
@renewal_period_years = renewal_period_years
|
|
35
|
+
@reason = reason
|
|
33
36
|
end
|
|
34
37
|
|
|
35
38
|
def self.from(map:)
|
|
@@ -42,7 +45,8 @@ module Appwrite
|
|
|
42
45
|
period_years: map["periodYears"],
|
|
43
46
|
premium: map["premium"],
|
|
44
47
|
renewal_price: map["renewalPrice"],
|
|
45
|
-
renewal_period_years: map["renewalPeriodYears"]
|
|
48
|
+
renewal_period_years: map["renewalPeriodYears"],
|
|
49
|
+
reason: map["reason"]
|
|
46
50
|
)
|
|
47
51
|
end
|
|
48
52
|
|
|
@@ -55,7 +59,8 @@ module Appwrite
|
|
|
55
59
|
"periodYears": @period_years,
|
|
56
60
|
"premium": @premium,
|
|
57
61
|
"renewalPrice": @renewal_price,
|
|
58
|
-
"renewalPeriodYears": @renewal_period_years
|
|
62
|
+
"renewalPeriodYears": @renewal_period_years,
|
|
63
|
+
"reason": @reason
|
|
59
64
|
}
|
|
60
65
|
end
|
|
61
66
|
end
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class Environment
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :created_at
|
|
8
|
+
attr_reader :updated_at
|
|
9
|
+
attr_reader :project_id
|
|
10
|
+
attr_reader :name
|
|
11
|
+
|
|
12
|
+
def initialize(
|
|
13
|
+
id:,
|
|
14
|
+
created_at:,
|
|
15
|
+
updated_at:,
|
|
16
|
+
project_id:,
|
|
17
|
+
name:
|
|
18
|
+
)
|
|
19
|
+
@id = id
|
|
20
|
+
@created_at = created_at
|
|
21
|
+
@updated_at = updated_at
|
|
22
|
+
@project_id = project_id
|
|
23
|
+
@name = name
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def self.from(map:)
|
|
27
|
+
map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "projectId" => "", "name" => "" }.merge(map)
|
|
28
|
+
Environment.new(
|
|
29
|
+
id: map["$id"],
|
|
30
|
+
created_at: map["$createdAt"],
|
|
31
|
+
updated_at: map["$updatedAt"],
|
|
32
|
+
project_id: map["projectId"],
|
|
33
|
+
name: map["name"]
|
|
34
|
+
)
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def to_map
|
|
38
|
+
{
|
|
39
|
+
"$id": @id,
|
|
40
|
+
"$createdAt": @created_at,
|
|
41
|
+
"$updatedAt": @updated_at,
|
|
42
|
+
"projectId": @project_id,
|
|
43
|
+
"name": @name
|
|
44
|
+
}
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class EnvironmentList
|
|
6
|
+
attr_reader :total
|
|
7
|
+
attr_reader :environments
|
|
8
|
+
|
|
9
|
+
def initialize(
|
|
10
|
+
total:,
|
|
11
|
+
environments:
|
|
12
|
+
)
|
|
13
|
+
@total = total
|
|
14
|
+
@environments = environments
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.from(map:)
|
|
18
|
+
map = { "total" => 0, "environments" => [] }.merge(map)
|
|
19
|
+
EnvironmentList.new(
|
|
20
|
+
total: map["total"],
|
|
21
|
+
environments: map["environments"].map { |it| Environment.from(map: it) }
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def to_map
|
|
26
|
+
{
|
|
27
|
+
"total": @total,
|
|
28
|
+
"environments": @environments.map { |it| it.to_map }
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class OAuth2Naver
|
|
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
|
+
map = { "$id" => "", "enabled" => false, "clientId" => "", "clientSecret" => "" }.merge(map)
|
|
25
|
+
OAuth2Naver.new(
|
|
26
|
+
id: map["$id"],
|
|
27
|
+
enabled: map["enabled"],
|
|
28
|
+
client_id: map["clientId"],
|
|
29
|
+
client_secret: map["clientSecret"]
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def to_map
|
|
34
|
+
{
|
|
35
|
+
"$id": @id,
|
|
36
|
+
"enabled": @enabled,
|
|
37
|
+
"clientId": @client_id,
|
|
38
|
+
"clientSecret": @client_secret
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class OAuth2Vipps
|
|
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
|
+
map = { "$id" => "", "enabled" => false, "clientId" => "", "clientSecret" => "" }.merge(map)
|
|
25
|
+
OAuth2Vipps.new(
|
|
26
|
+
id: map["$id"],
|
|
27
|
+
enabled: map["enabled"],
|
|
28
|
+
client_id: map["clientId"],
|
|
29
|
+
client_secret: map["clientSecret"]
|
|
30
|
+
)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def to_map
|
|
34
|
+
{
|
|
35
|
+
"$id": @id,
|
|
36
|
+
"enabled": @enabled,
|
|
37
|
+
"clientId": @client_id,
|
|
38
|
+
"clientSecret": @client_secret
|
|
39
|
+
}
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|
|
43
|
+
end
|
|
@@ -11,6 +11,8 @@ module Appwrite
|
|
|
11
11
|
attr_reader :prefs
|
|
12
12
|
attr_reader :billing_budget
|
|
13
13
|
attr_reader :budget_alerts
|
|
14
|
+
attr_reader :budget_notify
|
|
15
|
+
attr_reader :budget_critical
|
|
14
16
|
attr_reader :billing_plan
|
|
15
17
|
attr_reader :billing_plan_id
|
|
16
18
|
attr_reader :billing_plan_details
|
|
@@ -32,6 +34,7 @@ module Appwrite
|
|
|
32
34
|
attr_reader :program_manager_calendar
|
|
33
35
|
attr_reader :program_discord_channel_name
|
|
34
36
|
attr_reader :program_discord_channel_url
|
|
37
|
+
attr_reader :education_expires_at
|
|
35
38
|
attr_reader :billing_limits
|
|
36
39
|
attr_reader :billing_plan_downgrade
|
|
37
40
|
attr_reader :billing_tax_id
|
|
@@ -48,6 +51,8 @@ module Appwrite
|
|
|
48
51
|
prefs:,
|
|
49
52
|
billing_budget: nil,
|
|
50
53
|
budget_alerts:,
|
|
54
|
+
budget_notify:,
|
|
55
|
+
budget_critical:,
|
|
51
56
|
billing_plan:,
|
|
52
57
|
billing_plan_id:,
|
|
53
58
|
billing_plan_details:,
|
|
@@ -69,6 +74,7 @@ module Appwrite
|
|
|
69
74
|
program_manager_calendar: nil,
|
|
70
75
|
program_discord_channel_name: nil,
|
|
71
76
|
program_discord_channel_url: nil,
|
|
77
|
+
education_expires_at: nil,
|
|
72
78
|
billing_limits: nil,
|
|
73
79
|
billing_plan_downgrade: nil,
|
|
74
80
|
billing_tax_id: nil,
|
|
@@ -84,6 +90,8 @@ module Appwrite
|
|
|
84
90
|
@prefs = prefs
|
|
85
91
|
@billing_budget = billing_budget
|
|
86
92
|
@budget_alerts = budget_alerts
|
|
93
|
+
@budget_notify = budget_notify
|
|
94
|
+
@budget_critical = budget_critical
|
|
87
95
|
@billing_plan = billing_plan
|
|
88
96
|
@billing_plan_id = billing_plan_id
|
|
89
97
|
@billing_plan_details = billing_plan_details
|
|
@@ -105,6 +113,7 @@ module Appwrite
|
|
|
105
113
|
@program_manager_calendar = program_manager_calendar
|
|
106
114
|
@program_discord_channel_name = program_discord_channel_name
|
|
107
115
|
@program_discord_channel_url = program_discord_channel_url
|
|
116
|
+
@education_expires_at = education_expires_at
|
|
108
117
|
@billing_limits = billing_limits
|
|
109
118
|
@billing_plan_downgrade = billing_plan_downgrade
|
|
110
119
|
@billing_tax_id = billing_tax_id
|
|
@@ -114,7 +123,7 @@ module Appwrite
|
|
|
114
123
|
end
|
|
115
124
|
|
|
116
125
|
def self.from(map:)
|
|
117
|
-
map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "name" => "", "total" => 0, "budgetAlerts" => [75], "billingPlan" => "tier-0", "billingPlanId" => "tier-0", "billingEmail" => "", "status" => "draft", "markedForDeletion" => false, "platform" => "appwrite", "projects" => [] }.merge(map)
|
|
126
|
+
map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "name" => "", "total" => 0, "budgetAlerts" => [75], "budgetNotify" => ["owner", "billing"], "budgetCritical" => [], "billingPlan" => "tier-0", "billingPlanId" => "tier-0", "billingEmail" => "", "status" => "draft", "markedForDeletion" => false, "platform" => "appwrite", "projects" => [] }.merge(map)
|
|
118
127
|
Organization.new(
|
|
119
128
|
id: map["$id"],
|
|
120
129
|
created_at: map["$createdAt"],
|
|
@@ -124,6 +133,8 @@ module Appwrite
|
|
|
124
133
|
prefs: Preferences.from(map: map["prefs"]),
|
|
125
134
|
billing_budget: map["billingBudget"],
|
|
126
135
|
budget_alerts: map["budgetAlerts"],
|
|
136
|
+
budget_notify: map["budgetNotify"],
|
|
137
|
+
budget_critical: map["budgetCritical"],
|
|
127
138
|
billing_plan: map["billingPlan"],
|
|
128
139
|
billing_plan_id: map["billingPlanId"],
|
|
129
140
|
billing_plan_details: BillingPlan.from(map: map["billingPlanDetails"]),
|
|
@@ -145,6 +156,7 @@ module Appwrite
|
|
|
145
156
|
program_manager_calendar: map["programManagerCalendar"],
|
|
146
157
|
program_discord_channel_name: map["programDiscordChannelName"],
|
|
147
158
|
program_discord_channel_url: map["programDiscordChannelUrl"],
|
|
159
|
+
education_expires_at: map["educationExpiresAt"],
|
|
148
160
|
billing_limits: map["billingLimits"].nil? ? nil : BillingLimits.from(map: map["billingLimits"]),
|
|
149
161
|
billing_plan_downgrade: map["billingPlanDowngrade"],
|
|
150
162
|
billing_tax_id: map["billingTaxId"],
|
|
@@ -164,6 +176,8 @@ module Appwrite
|
|
|
164
176
|
"prefs": @prefs.to_map,
|
|
165
177
|
"billingBudget": @billing_budget,
|
|
166
178
|
"budgetAlerts": @budget_alerts,
|
|
179
|
+
"budgetNotify": @budget_notify,
|
|
180
|
+
"budgetCritical": @budget_critical,
|
|
167
181
|
"billingPlan": @billing_plan,
|
|
168
182
|
"billingPlanId": @billing_plan_id,
|
|
169
183
|
"billingPlanDetails": @billing_plan_details.to_map,
|
|
@@ -185,6 +199,7 @@ module Appwrite
|
|
|
185
199
|
"programManagerCalendar": @program_manager_calendar,
|
|
186
200
|
"programDiscordChannelName": @program_discord_channel_name,
|
|
187
201
|
"programDiscordChannelUrl": @program_discord_channel_url,
|
|
202
|
+
"educationExpiresAt": @education_expires_at,
|
|
188
203
|
"billingLimits": @billing_limits&.to_map,
|
|
189
204
|
"billingPlanDowngrade": @billing_plan_downgrade,
|
|
190
205
|
"billingTaxId": @billing_tax_id,
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Appwrite
|
|
4
|
+
module Models
|
|
5
|
+
class PolicyAccountDevices
|
|
6
|
+
attr_reader :id
|
|
7
|
+
attr_reader :enabled
|
|
8
|
+
|
|
9
|
+
def initialize(
|
|
10
|
+
id:,
|
|
11
|
+
enabled:
|
|
12
|
+
)
|
|
13
|
+
@id = id
|
|
14
|
+
@enabled = enabled
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
def self.from(map:)
|
|
18
|
+
map = { "$id" => "", "enabled" => true }.merge(map)
|
|
19
|
+
PolicyAccountDevices.new(
|
|
20
|
+
id: map["$id"],
|
|
21
|
+
enabled: map["enabled"]
|
|
22
|
+
)
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def to_map
|
|
26
|
+
{
|
|
27
|
+
"$id": @id,
|
|
28
|
+
"enabled": @enabled
|
|
29
|
+
}
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
end
|