appwrite 30.5.0 → 30.6.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f7ad5b280deb7576c81b9ec445f307c82069b1baeae9d9e74b32a562a17258b
4
- data.tar.gz: 8882cd5061bdd6124e8c9f2deb8fd4e34fdb7ef85d53bc275748b20f010f4118
3
+ metadata.gz: 447c78e85fc131f3f17e6835945bc068c922d0d358f9975edae52cfb934af6e5
4
+ data.tar.gz: ba0fa55978db839deb6ddef61316ce1980dc65095a5a1f0761ea1c2754d63b9a
5
5
  SHA512:
6
- metadata.gz: b7d794f588efbb302b8da6b082ff4f7e5e79e7716d9fa688fe82a566c5fcf30fde64ce5288fdfc52931481cd17bd008691967804b4278e296e96da608abb4258
7
- data.tar.gz: 59691258c8bb8dc8376dbaa738772ad48cd3c1107972d7351ce360e293e9b9d559fdac927a984f39176b919a662c8deb03279fdaaa17dba4ff1cb535c482416b
6
+ metadata.gz: '09df4e95d0db7729854d157a397476b68fd7320b9ca93ff1e876f75a4a07ad9a916f0d567d2188b734420bc1457749585c1f0ac874824d2d28bc694d8436704d'
7
+ data.tar.gz: ea9c478133c2dafa4ea69b0f77b8f381cf5162696d3ddc48f31548b988cccea85b77747405a4e58583d21db5042a56d92996f479031d5aa9c7cc4771ff1fa94a
@@ -14,7 +14,7 @@ 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.5.0',
17
+ 'x-sdk-version' => '30.6.0',
18
18
  'X-Appwrite-Response-Format' => '2.7.2'
19
19
  }
20
20
  @endpoint = 'https://cloud.appwrite.io/v1'
@@ -0,0 +1,11 @@
1
+ module Appwrite
2
+ module Enums
3
+ module VideoCaptionStatus
4
+ PENDING = 'pending'
5
+ STARTED = 'started'
6
+ READY = 'ready'
7
+ ERROR = 'error'
8
+ ABORTED = 'aborted'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ module Appwrite
2
+ module Enums
3
+ module VideoCodecId
4
+ H264 = 'h264'
5
+ HEVC = 'hevc'
6
+ VP9 = 'vp9'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ module Appwrite
2
+ module Enums
3
+ module VideoOutput
4
+ HLS = 'hls'
5
+ DASH = 'dash'
6
+ CMAF = 'cmaf'
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ module Appwrite
2
+ module Enums
3
+ module VideoRenditionStatus
4
+ PENDING = 'pending'
5
+ STARTED = 'started'
6
+ ENDED = 'ended'
7
+ READY = 'ready'
8
+ ERROR = 'error'
9
+ ABORTED = 'aborted'
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ module Appwrite
2
+ module Enums
3
+ module VideoTimelineStatus
4
+ PENDING = 'pending'
5
+ STARTED = 'started'
6
+ READY = 'ready'
7
+ SKIPPED = 'skipped'
8
+ ERROR = 'error'
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,166 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class Video
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :updated_at
9
+ attr_reader :permissions
10
+ attr_reader :bucket_id
11
+ attr_reader :file_id
12
+ attr_reader :name
13
+ attr_reader :size
14
+ attr_reader :format
15
+ attr_reader :duration
16
+ attr_reader :width
17
+ attr_reader :height
18
+ attr_reader :aspect_ratio
19
+ attr_reader :video_codec
20
+ attr_reader :video_format
21
+ attr_reader :video_format_profile
22
+ attr_reader :video_bit_rate
23
+ attr_reader :video_frame_rate
24
+ attr_reader :video_frame_rate_mode
25
+ attr_reader :audio_codec
26
+ attr_reader :audio_format
27
+ attr_reader :audio_bit_rate
28
+ attr_reader :audio_sample_rate
29
+ attr_reader :timeline_status
30
+ attr_reader :timeline_error
31
+
32
+ def initialize(
33
+ id:,
34
+ created_at:,
35
+ updated_at:,
36
+ permissions:,
37
+ bucket_id:,
38
+ file_id:,
39
+ name:,
40
+ size:,
41
+ format:,
42
+ duration:,
43
+ width:,
44
+ height:,
45
+ aspect_ratio:,
46
+ video_codec:,
47
+ video_format:,
48
+ video_format_profile:,
49
+ video_bit_rate:,
50
+ video_frame_rate:,
51
+ video_frame_rate_mode:,
52
+ audio_codec:,
53
+ audio_format:,
54
+ audio_bit_rate:,
55
+ audio_sample_rate:,
56
+ timeline_status:,
57
+ timeline_error:
58
+ )
59
+ @id = id
60
+ @created_at = created_at
61
+ @updated_at = updated_at
62
+ @permissions = permissions
63
+ @bucket_id = bucket_id
64
+ @file_id = file_id
65
+ @name = name
66
+ @size = size
67
+ @format = format
68
+ @duration = duration
69
+ @width = width
70
+ @height = height
71
+ @aspect_ratio = aspect_ratio
72
+ @video_codec = video_codec
73
+ @video_format = video_format
74
+ @video_format_profile = video_format_profile
75
+ @video_bit_rate = video_bit_rate
76
+ @video_frame_rate = video_frame_rate
77
+ @video_frame_rate_mode = video_frame_rate_mode
78
+ @audio_codec = audio_codec
79
+ @audio_format = audio_format
80
+ @audio_bit_rate = audio_bit_rate
81
+ @audio_sample_rate = audio_sample_rate
82
+ @timeline_status = validate_timeline_status(timeline_status)
83
+ @timeline_error = timeline_error
84
+ end
85
+
86
+ def self.from(map:)
87
+ map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "$permissions" => [], "bucketId" => "", "fileId" => "", "name" => "", "size" => 0, "format" => "", "duration" => 0, "width" => 0, "height" => 0, "aspectRatio" => "", "videoCodec" => "", "videoFormat" => "", "videoFormatProfile" => "", "videoBitRate" => 0, "videoFrameRate" => 0, "videoFrameRateMode" => "", "audioCodec" => "", "audioFormat" => "", "audioBitRate" => 0, "audioSampleRate" => 0, "timelineStatus" => "pending", "timelineError" => "" }.merge(map)
88
+ Video.new(
89
+ id: map["$id"],
90
+ created_at: map["$createdAt"],
91
+ updated_at: map["$updatedAt"],
92
+ permissions: map["$permissions"],
93
+ bucket_id: map["bucketId"],
94
+ file_id: map["fileId"],
95
+ name: map["name"],
96
+ size: map["size"],
97
+ format: map["format"],
98
+ duration: map["duration"],
99
+ width: map["width"],
100
+ height: map["height"],
101
+ aspect_ratio: map["aspectRatio"],
102
+ video_codec: map["videoCodec"],
103
+ video_format: map["videoFormat"],
104
+ video_format_profile: map["videoFormatProfile"],
105
+ video_bit_rate: map["videoBitRate"],
106
+ video_frame_rate: map["videoFrameRate"],
107
+ video_frame_rate_mode: map["videoFrameRateMode"],
108
+ audio_codec: map["audioCodec"],
109
+ audio_format: map["audioFormat"],
110
+ audio_bit_rate: map["audioBitRate"],
111
+ audio_sample_rate: map["audioSampleRate"],
112
+ timeline_status: map["timelineStatus"],
113
+ timeline_error: map["timelineError"]
114
+ )
115
+ end
116
+
117
+ def to_map
118
+ {
119
+ "$id": @id,
120
+ "$createdAt": @created_at,
121
+ "$updatedAt": @updated_at,
122
+ "$permissions": @permissions,
123
+ "bucketId": @bucket_id,
124
+ "fileId": @file_id,
125
+ "name": @name,
126
+ "size": @size,
127
+ "format": @format,
128
+ "duration": @duration,
129
+ "width": @width,
130
+ "height": @height,
131
+ "aspectRatio": @aspect_ratio,
132
+ "videoCodec": @video_codec,
133
+ "videoFormat": @video_format,
134
+ "videoFormatProfile": @video_format_profile,
135
+ "videoBitRate": @video_bit_rate,
136
+ "videoFrameRate": @video_frame_rate,
137
+ "videoFrameRateMode": @video_frame_rate_mode,
138
+ "audioCodec": @audio_codec,
139
+ "audioFormat": @audio_format,
140
+ "audioBitRate": @audio_bit_rate,
141
+ "audioSampleRate": @audio_sample_rate,
142
+ "timelineStatus": @timeline_status,
143
+ "timelineError": @timeline_error
144
+ }
145
+ end
146
+
147
+ private
148
+
149
+ def validate_timeline_status(timeline_status)
150
+ valid_timeline_status = [
151
+ Appwrite::Enums::VideoTimelineStatus::PENDING,
152
+ Appwrite::Enums::VideoTimelineStatus::STARTED,
153
+ Appwrite::Enums::VideoTimelineStatus::READY,
154
+ Appwrite::Enums::VideoTimelineStatus::SKIPPED,
155
+ Appwrite::Enums::VideoTimelineStatus::ERROR,
156
+ ]
157
+
158
+ unless valid_timeline_status.include?(timeline_status)
159
+ raise ArgumentError, "Invalid " + timeline_status + ". Must be one of: " + valid_timeline_status.join(', ')
160
+ end
161
+
162
+ timeline_status
163
+ end
164
+ end
165
+ end
166
+ end
@@ -0,0 +1,111 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class VideoCaption
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :updated_at
9
+ attr_reader :video_id
10
+ attr_reader :bucket_id
11
+ attr_reader :file_id
12
+ attr_reader :name
13
+ attr_reader :language
14
+ attr_reader :default
15
+ attr_reader :embedded
16
+ attr_reader :target_duration
17
+ attr_reader :status
18
+ attr_reader :error
19
+ attr_reader :size
20
+
21
+ def initialize(
22
+ id:,
23
+ created_at:,
24
+ updated_at:,
25
+ video_id:,
26
+ bucket_id:,
27
+ file_id:,
28
+ name:,
29
+ language:,
30
+ default:,
31
+ embedded:,
32
+ target_duration:,
33
+ status:,
34
+ error:,
35
+ size:
36
+ )
37
+ @id = id
38
+ @created_at = created_at
39
+ @updated_at = updated_at
40
+ @video_id = video_id
41
+ @bucket_id = bucket_id
42
+ @file_id = file_id
43
+ @name = name
44
+ @language = language
45
+ @default = default
46
+ @embedded = embedded
47
+ @target_duration = target_duration
48
+ @status = validate_status(status)
49
+ @error = error
50
+ @size = size
51
+ end
52
+
53
+ def self.from(map:)
54
+ map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "videoId" => "", "bucketId" => "", "fileId" => "", "name" => "", "language" => "", "default" => false, "embedded" => false, "targetDuration" => 0, "status" => "pending", "error" => "", "size" => 0 }.merge(map)
55
+ VideoCaption.new(
56
+ id: map["$id"],
57
+ created_at: map["$createdAt"],
58
+ updated_at: map["$updatedAt"],
59
+ video_id: map["videoId"],
60
+ bucket_id: map["bucketId"],
61
+ file_id: map["fileId"],
62
+ name: map["name"],
63
+ language: map["language"],
64
+ default: map["default"],
65
+ embedded: map["embedded"],
66
+ target_duration: map["targetDuration"],
67
+ status: map["status"],
68
+ error: map["error"],
69
+ size: map["size"]
70
+ )
71
+ end
72
+
73
+ def to_map
74
+ {
75
+ "$id": @id,
76
+ "$createdAt": @created_at,
77
+ "$updatedAt": @updated_at,
78
+ "videoId": @video_id,
79
+ "bucketId": @bucket_id,
80
+ "fileId": @file_id,
81
+ "name": @name,
82
+ "language": @language,
83
+ "default": @default,
84
+ "embedded": @embedded,
85
+ "targetDuration": @target_duration,
86
+ "status": @status,
87
+ "error": @error,
88
+ "size": @size
89
+ }
90
+ end
91
+
92
+ private
93
+
94
+ def validate_status(status)
95
+ valid_status = [
96
+ Appwrite::Enums::VideoCaptionStatus::PENDING,
97
+ Appwrite::Enums::VideoCaptionStatus::STARTED,
98
+ Appwrite::Enums::VideoCaptionStatus::READY,
99
+ Appwrite::Enums::VideoCaptionStatus::ERROR,
100
+ Appwrite::Enums::VideoCaptionStatus::ABORTED,
101
+ ]
102
+
103
+ unless valid_status.include?(status)
104
+ raise ArgumentError, "Invalid " + status + ". Must be one of: " + valid_status.join(', ')
105
+ end
106
+
107
+ status
108
+ end
109
+ end
110
+ end
111
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class VideoCaptionList
6
+ attr_reader :total
7
+ attr_reader :captions
8
+
9
+ def initialize(
10
+ total:,
11
+ captions:
12
+ )
13
+ @total = total
14
+ @captions = captions
15
+ end
16
+
17
+ def self.from(map:)
18
+ map = { "total" => 0, "captions" => [] }.merge(map)
19
+ VideoCaptionList.new(
20
+ total: map["total"],
21
+ captions: map["captions"].map { |it| VideoCaption.from(map: it) }
22
+ )
23
+ end
24
+
25
+ def to_map
26
+ {
27
+ "total": @total,
28
+ "captions": @captions.map { |it| it.to_map }
29
+ }
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class VideoCodec
6
+ attr_reader :id
7
+ attr_reader :name
8
+ attr_reader :outputs
9
+
10
+ def initialize(
11
+ id:,
12
+ name:,
13
+ outputs:
14
+ )
15
+ @id = id
16
+ @name = name
17
+ @outputs = validate_outputs(outputs)
18
+ end
19
+
20
+ def self.from(map:)
21
+ map = { "$id" => "", "name" => "", "outputs" => [] }.merge(map)
22
+ VideoCodec.new(
23
+ id: map["$id"],
24
+ name: map["name"],
25
+ outputs: map["outputs"]
26
+ )
27
+ end
28
+
29
+ def to_map
30
+ {
31
+ "$id": @id,
32
+ "name": @name,
33
+ "outputs": @outputs
34
+ }
35
+ end
36
+
37
+ private
38
+
39
+ def validate_outputs(outputs)
40
+ valid_outputs = [
41
+ Appwrite::Enums::VideoOutput::HLS,
42
+ Appwrite::Enums::VideoOutput::DASH,
43
+ Appwrite::Enums::VideoOutput::CMAF,
44
+ ]
45
+
46
+ (outputs || []).each do |value|
47
+ unless valid_outputs.include?(value)
48
+ raise ArgumentError, "Invalid " + value.to_s + ". Must be one of: " + valid_outputs.join(', ')
49
+ end
50
+ end
51
+
52
+ outputs
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class VideoCodecList
6
+ attr_reader :total
7
+ attr_reader :codecs
8
+
9
+ def initialize(
10
+ total:,
11
+ codecs:
12
+ )
13
+ @total = total
14
+ @codecs = codecs
15
+ end
16
+
17
+ def self.from(map:)
18
+ map = { "total" => 0, "codecs" => [] }.merge(map)
19
+ VideoCodecList.new(
20
+ total: map["total"],
21
+ codecs: map["codecs"].map { |it| VideoCodec.from(map: it) }
22
+ )
23
+ end
24
+
25
+ def to_map
26
+ {
27
+ "total": @total,
28
+ "codecs": @codecs.map { |it| it.to_map }
29
+ }
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class VideoList
6
+ attr_reader :total
7
+ attr_reader :videos
8
+
9
+ def initialize(
10
+ total:,
11
+ videos:
12
+ )
13
+ @total = total
14
+ @videos = videos
15
+ end
16
+
17
+ def self.from(map:)
18
+ map = { "total" => 0, "videos" => [] }.merge(map)
19
+ VideoList.new(
20
+ total: map["total"],
21
+ videos: map["videos"].map { |it| Video.from(map: it) }
22
+ )
23
+ end
24
+
25
+ def to_map
26
+ {
27
+ "total": @total,
28
+ "videos": @videos.map { |it| it.to_map }
29
+ }
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class VideoProfile
6
+ attr_reader :id
7
+ attr_reader :created_at
8
+ attr_reader :updated_at
9
+ attr_reader :name
10
+ attr_reader :codec
11
+ attr_reader :video_bit_rate
12
+ attr_reader :audio_bit_rate
13
+ attr_reader :width
14
+ attr_reader :height
15
+
16
+ def initialize(
17
+ id:,
18
+ created_at:,
19
+ updated_at:,
20
+ name:,
21
+ codec:,
22
+ video_bit_rate:,
23
+ audio_bit_rate:,
24
+ width:,
25
+ height:
26
+ )
27
+ @id = id
28
+ @created_at = created_at
29
+ @updated_at = updated_at
30
+ @name = name
31
+ @codec = validate_codec(codec)
32
+ @video_bit_rate = video_bit_rate
33
+ @audio_bit_rate = audio_bit_rate
34
+ @width = width
35
+ @height = height
36
+ end
37
+
38
+ def self.from(map:)
39
+ map = { "$id" => "", "$createdAt" => "", "$updatedAt" => "", "name" => "", "codec" => "h264", "videoBitRate" => 0, "audioBitRate" => 0, "width" => 0, "height" => 0 }.merge(map)
40
+ VideoProfile.new(
41
+ id: map["$id"],
42
+ created_at: map["$createdAt"],
43
+ updated_at: map["$updatedAt"],
44
+ name: map["name"],
45
+ codec: map["codec"],
46
+ video_bit_rate: map["videoBitRate"],
47
+ audio_bit_rate: map["audioBitRate"],
48
+ width: map["width"],
49
+ height: map["height"]
50
+ )
51
+ end
52
+
53
+ def to_map
54
+ {
55
+ "$id": @id,
56
+ "$createdAt": @created_at,
57
+ "$updatedAt": @updated_at,
58
+ "name": @name,
59
+ "codec": @codec,
60
+ "videoBitRate": @video_bit_rate,
61
+ "audioBitRate": @audio_bit_rate,
62
+ "width": @width,
63
+ "height": @height
64
+ }
65
+ end
66
+
67
+ private
68
+
69
+ def validate_codec(codec)
70
+ valid_codec = [
71
+ Appwrite::Enums::VideoCodecId::H264,
72
+ Appwrite::Enums::VideoCodecId::HEVC,
73
+ Appwrite::Enums::VideoCodecId::VP9,
74
+ ]
75
+
76
+ unless valid_codec.include?(codec)
77
+ raise ArgumentError, "Invalid " + codec + ". Must be one of: " + valid_codec.join(', ')
78
+ end
79
+
80
+ codec
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Appwrite
4
+ module Models
5
+ class VideoProfileList
6
+ attr_reader :total
7
+ attr_reader :profiles
8
+
9
+ def initialize(
10
+ total:,
11
+ profiles:
12
+ )
13
+ @total = total
14
+ @profiles = profiles
15
+ end
16
+
17
+ def self.from(map:)
18
+ map = { "total" => 0, "profiles" => [] }.merge(map)
19
+ VideoProfileList.new(
20
+ total: map["total"],
21
+ profiles: map["profiles"].map { |it| VideoProfile.from(map: it) }
22
+ )
23
+ end
24
+
25
+ def to_map
26
+ {
27
+ "total": @total,
28
+ "profiles": @profiles.map { |it| it.to_map }
29
+ }
30
+ end
31
+ end
32
+ end
33
+ end