Skip to content

Commit efb2454

Browse files
committed
chore: update title and desc
1 parent 5f1c422 commit efb2454

18 files changed

+298
-16
lines changed

appwrite.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Gem::Specification.new do |spec|
22

33
spec.name = 'appwrite'
4-
spec.version = '18.2.0'
4+
spec.version = '19.0.0'
55
spec.license = 'BSD-3-Clause'
66
spec.summary = 'Appwrite is an open-source self-hosted backend server that abstract and simplify complex and repetitive development tasks behind a very simple REST API'
77
spec.author = 'Appwrite Team'

lib/appwrite/client.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def initialize
1515
'x-sdk-name'=> 'Ruby',
1616
'x-sdk-platform'=> 'server',
1717
'x-sdk-language'=> 'ruby',
18-
'x-sdk-version'=> '18.2.0',
18+
'x-sdk-version'=> '19.0.0',
1919
'X-Appwrite-Response-Format' => '1.8.0'
2020
}
2121
@endpoint = 'https://cloud.appwrite.io/v1'
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module Appwrite
2+
module Enums
3+
module ColumnStatus
4+
AVAILABLE = 'available'
5+
PROCESSING = 'processing'
6+
DELETING = 'deleting'
7+
STUCK = 'stuck'
8+
FAILED = 'failed'
9+
end
10+
end
11+
end
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module Appwrite
2+
module Enums
3+
module DatabaseType
4+
LEGACY = 'legacy'
5+
TABLESDB = 'tablesdb'
6+
end
7+
end
8+
end

lib/appwrite/models/column_boolean.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def initialize(
2626
)
2727
@key = key
2828
@type = type
29-
@status = status
29+
@status = validate_status(status)
3030
@error = error
3131
@required = required
3232
@array = array
@@ -62,6 +62,25 @@ def to_map
6262
"default": @default
6363
}
6464
end
65+
66+
private
67+
68+
def validate_status(status)
69+
valid_status = [
70+
Appwrite::Enums::ColumnStatus::AVAILABLE,
71+
Appwrite::Enums::ColumnStatus::PROCESSING,
72+
Appwrite::Enums::ColumnStatus::DELETING,
73+
Appwrite::Enums::ColumnStatus::STUCK,
74+
Appwrite::Enums::ColumnStatus::FAILED,
75+
]
76+
77+
unless valid_status.include?(status)
78+
raise ArgumentError, "Invalid " + status + ". Must be one of: " + valid_status.join(', ')
79+
end
80+
81+
status
82+
end
83+
6584
end
6685
end
6786
end

lib/appwrite/models/column_datetime.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def initialize(
2828
)
2929
@key = key
3030
@type = type
31-
@status = status
31+
@status = validate_status(status)
3232
@error = error
3333
@required = required
3434
@array = array
@@ -67,6 +67,25 @@ def to_map
6767
"default": @default
6868
}
6969
end
70+
71+
private
72+
73+
def validate_status(status)
74+
valid_status = [
75+
Appwrite::Enums::ColumnStatus::AVAILABLE,
76+
Appwrite::Enums::ColumnStatus::PROCESSING,
77+
Appwrite::Enums::ColumnStatus::DELETING,
78+
Appwrite::Enums::ColumnStatus::STUCK,
79+
Appwrite::Enums::ColumnStatus::FAILED,
80+
]
81+
82+
unless valid_status.include?(status)
83+
raise ArgumentError, "Invalid " + status + ". Must be one of: " + valid_status.join(', ')
84+
end
85+
86+
status
87+
end
88+
7089
end
7190
end
7291
end

lib/appwrite/models/column_email.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def initialize(
2828
)
2929
@key = key
3030
@type = type
31-
@status = status
31+
@status = validate_status(status)
3232
@error = error
3333
@required = required
3434
@array = array
@@ -67,6 +67,25 @@ def to_map
6767
"default": @default
6868
}
6969
end
70+
71+
private
72+
73+
def validate_status(status)
74+
valid_status = [
75+
Appwrite::Enums::ColumnStatus::AVAILABLE,
76+
Appwrite::Enums::ColumnStatus::PROCESSING,
77+
Appwrite::Enums::ColumnStatus::DELETING,
78+
Appwrite::Enums::ColumnStatus::STUCK,
79+
Appwrite::Enums::ColumnStatus::FAILED,
80+
]
81+
82+
unless valid_status.include?(status)
83+
raise ArgumentError, "Invalid " + status + ". Must be one of: " + valid_status.join(', ')
84+
end
85+
86+
status
87+
end
88+
7089
end
7190
end
7291
end

lib/appwrite/models/column_enum.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def initialize(
3030
)
3131
@key = key
3232
@type = type
33-
@status = status
33+
@status = validate_status(status)
3434
@error = error
3535
@required = required
3636
@array = array
@@ -72,6 +72,25 @@ def to_map
7272
"default": @default
7373
}
7474
end
75+
76+
private
77+
78+
def validate_status(status)
79+
valid_status = [
80+
Appwrite::Enums::ColumnStatus::AVAILABLE,
81+
Appwrite::Enums::ColumnStatus::PROCESSING,
82+
Appwrite::Enums::ColumnStatus::DELETING,
83+
Appwrite::Enums::ColumnStatus::STUCK,
84+
Appwrite::Enums::ColumnStatus::FAILED,
85+
]
86+
87+
unless valid_status.include?(status)
88+
raise ArgumentError, "Invalid " + status + ". Must be one of: " + valid_status.join(', ')
89+
end
90+
91+
status
92+
end
93+
7594
end
7695
end
7796
end

lib/appwrite/models/column_float.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def initialize(
3030
)
3131
@key = key
3232
@type = type
33-
@status = status
33+
@status = validate_status(status)
3434
@error = error
3535
@required = required
3636
@array = array
@@ -72,6 +72,25 @@ def to_map
7272
"default": @default
7373
}
7474
end
75+
76+
private
77+
78+
def validate_status(status)
79+
valid_status = [
80+
Appwrite::Enums::ColumnStatus::AVAILABLE,
81+
Appwrite::Enums::ColumnStatus::PROCESSING,
82+
Appwrite::Enums::ColumnStatus::DELETING,
83+
Appwrite::Enums::ColumnStatus::STUCK,
84+
Appwrite::Enums::ColumnStatus::FAILED,
85+
]
86+
87+
unless valid_status.include?(status)
88+
raise ArgumentError, "Invalid " + status + ". Must be one of: " + valid_status.join(', ')
89+
end
90+
91+
status
92+
end
93+
7594
end
7695
end
7796
end

lib/appwrite/models/column_integer.rb

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def initialize(
3030
)
3131
@key = key
3232
@type = type
33-
@status = status
33+
@status = validate_status(status)
3434
@error = error
3535
@required = required
3636
@array = array
@@ -72,6 +72,25 @@ def to_map
7272
"default": @default
7373
}
7474
end
75+
76+
private
77+
78+
def validate_status(status)
79+
valid_status = [
80+
Appwrite::Enums::ColumnStatus::AVAILABLE,
81+
Appwrite::Enums::ColumnStatus::PROCESSING,
82+
Appwrite::Enums::ColumnStatus::DELETING,
83+
Appwrite::Enums::ColumnStatus::STUCK,
84+
Appwrite::Enums::ColumnStatus::FAILED,
85+
]
86+
87+
unless valid_status.include?(status)
88+
raise ArgumentError, "Invalid " + status + ". Must be one of: " + valid_status.join(', ')
89+
end
90+
91+
status
92+
end
93+
7594
end
7695
end
7796
end

0 commit comments

Comments
 (0)