appwrite 30.5.0 → 30.7.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 (31) hide show
  1. checksums.yaml +4 -4
  2. data/lib/appwrite/client.rb +1 -1
  3. data/lib/appwrite/enums/analytics_dimension.rb +32 -0
  4. data/lib/appwrite/enums/analytics_interval.rb +10 -0
  5. data/lib/appwrite/enums/analytics_property_type.rb +9 -0
  6. data/lib/appwrite/enums/video_caption_status.rb +11 -0
  7. data/lib/appwrite/enums/video_codec_id.rb +9 -0
  8. data/lib/appwrite/enums/video_output.rb +9 -0
  9. data/lib/appwrite/enums/video_rendition_status.rb +12 -0
  10. data/lib/appwrite/enums/video_timeline_status.rb +11 -0
  11. data/lib/appwrite/models/analytics_annotation.rb +58 -0
  12. data/lib/appwrite/models/analytics_annotation_list.rb +33 -0
  13. data/lib/appwrite/models/analytics_metric.rb +88 -0
  14. data/lib/appwrite/models/analytics_metric_list.rb +33 -0
  15. data/lib/appwrite/models/analytics_property.rb +94 -0
  16. data/lib/appwrite/models/analytics_property_list.rb +33 -0
  17. data/lib/appwrite/models/video.rb +166 -0
  18. data/lib/appwrite/models/video_caption.rb +111 -0
  19. data/lib/appwrite/models/video_caption_list.rb +33 -0
  20. data/lib/appwrite/models/video_codec.rb +56 -0
  21. data/lib/appwrite/models/video_codec_list.rb +33 -0
  22. data/lib/appwrite/models/video_list.rb +33 -0
  23. data/lib/appwrite/models/video_profile.rb +84 -0
  24. data/lib/appwrite/models/video_profile_list.rb +33 -0
  25. data/lib/appwrite/models/video_rendition.rb +165 -0
  26. data/lib/appwrite/models/video_rendition_list.rb +33 -0
  27. data/lib/appwrite/services/analytics.rb +594 -0
  28. data/lib/appwrite/services/project.rb +233 -0
  29. data/lib/appwrite/services/videos.rb +966 -0
  30. data/lib/appwrite.rb +26 -0
  31. metadata +28 -2
@@ -5791,5 +5791,238 @@ module Appwrite
5791
5791
  params: api_params,
5792
5792
  )
5793
5793
  end
5794
+
5795
+ # Get a list of video profiles in the current project (`GET
5796
+ # /v1/project/videos/profiles`). Every profile is returned regardless of
5797
+ # codec. Filter with `queries`, for example `Query.equal('codec', ['h264'])`
5798
+ # for one encode ladder, or on `name`, `width`, `height`, `videoBitRate` and
5799
+ # `audioBitRate`. Search with `Query.search()` on the `search` attribute.
5800
+ #
5801
+ #
5802
+ # @param [Array] queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, codec, width, height, videoBitRate, audioBitRate, search
5803
+ # @param [] total When set to false, the total count returned will be 0 and will not be calculated.
5804
+ #
5805
+ # @return [VideoProfileList]
5806
+ def list_video_profiles(
5807
+ queries: nil,
5808
+ total: nil
5809
+ )
5810
+ api_path = '/project/videos/profiles'
5811
+
5812
+ api_params = {
5813
+ queries: queries,
5814
+ total: total,
5815
+ }
5816
+
5817
+ api_headers = {
5818
+ "X-Appwrite-Project": @client.get_config('project'),
5819
+ "accept": 'application/json',
5820
+ }
5821
+
5822
+ @client.call(
5823
+ method: 'GET',
5824
+ path: api_path,
5825
+ headers: api_headers,
5826
+ params: api_params,
5827
+ response_type: Models::VideoProfileList
5828
+ )
5829
+ end
5830
+
5831
+ # Create a video profile (`POST /v1/project/videos/profiles`) describing an
5832
+ # encoding target: output dimensions, video/audio bitrates, and encode codec.
5833
+ # Only codecs enabled on this instance are accepted; the default is `h264`. A
5834
+ # disabled codec is rejected. Creating a profile with the same width, height,
5835
+ # bitrates, and codec fails with `video_profile_already_exists`. Bitrates are
5836
+ # in bits per second and must be multiples of 1000. Renditions are encoded
5837
+ # against a profile.
5838
+ #
5839
+ #
5840
+ # @param [String] profile_id Video profile ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
5841
+ # @param [String] name Video profile name.
5842
+ # @param [Integer] video_bit_rate Target video bitrate in bits per second. Must be a multiple of 1000.
5843
+ # @param [Integer] audio_bit_rate Target audio bitrate in bits per second. Must be a multiple of 1000.
5844
+ # @param [Integer] width Target video width in pixels. Must be an even number.
5845
+ # @param [Integer] height Target video height in pixels. Must be an even number.
5846
+ # @param [VideoCodecId] codec Video encode codec. Codecs not enabled on this instance are rejected. Defaults to `h264`.
5847
+ #
5848
+ # @return [VideoProfile]
5849
+ def create_video_profile(
5850
+ profile_id:,
5851
+ name:,
5852
+ video_bit_rate:,
5853
+ audio_bit_rate:,
5854
+ width:,
5855
+ height:,
5856
+ codec: nil
5857
+ )
5858
+ if profile_id.nil?
5859
+ raise Appwrite::Exception.new('Missing required parameter: "profileId"')
5860
+ end
5861
+
5862
+ if name.nil?
5863
+ raise Appwrite::Exception.new('Missing required parameter: "name"')
5864
+ end
5865
+
5866
+ if video_bit_rate.nil?
5867
+ raise Appwrite::Exception.new('Missing required parameter: "videoBitRate"')
5868
+ end
5869
+
5870
+ if audio_bit_rate.nil?
5871
+ raise Appwrite::Exception.new('Missing required parameter: "audioBitRate"')
5872
+ end
5873
+
5874
+ if width.nil?
5875
+ raise Appwrite::Exception.new('Missing required parameter: "width"')
5876
+ end
5877
+
5878
+ if height.nil?
5879
+ raise Appwrite::Exception.new('Missing required parameter: "height"')
5880
+ end
5881
+
5882
+ api_path = '/project/videos/profiles'
5883
+
5884
+ api_params = {
5885
+ profileId: profile_id,
5886
+ name: name,
5887
+ videoBitRate: video_bit_rate,
5888
+ audioBitRate: audio_bit_rate,
5889
+ width: width,
5890
+ height: height,
5891
+ codec: codec,
5892
+ }
5893
+
5894
+ api_headers = {
5895
+ "X-Appwrite-Project": @client.get_config('project'),
5896
+ "content-type": 'application/json',
5897
+ "accept": 'application/json',
5898
+ }
5899
+
5900
+ @client.call(
5901
+ method: 'POST',
5902
+ path: api_path,
5903
+ headers: api_headers,
5904
+ params: api_params,
5905
+ response_type: Models::VideoProfile
5906
+ )
5907
+ end
5908
+
5909
+ # Get a video profile by its unique ID (`GET
5910
+ # /v1/project/videos/profiles/:profileId`).
5911
+ #
5912
+ #
5913
+ # @param [String] profile_id Video profile unique ID.
5914
+ #
5915
+ # @return [VideoProfile]
5916
+ def get_video_profile(
5917
+ profile_id:
5918
+ )
5919
+ if profile_id.nil? || profile_id == ''
5920
+ raise Appwrite::Exception.new('Missing required parameter: "profileId"')
5921
+ end
5922
+
5923
+ api_path = '/project/videos/profiles/{profileId}'
5924
+ .gsub('{profileId}', @client.encode_path(profile_id))
5925
+
5926
+ api_params = {}
5927
+
5928
+ api_headers = {
5929
+ "X-Appwrite-Project": @client.get_config('project'),
5930
+ "accept": 'application/json',
5931
+ }
5932
+
5933
+ @client.call(
5934
+ method: 'GET',
5935
+ path: api_path,
5936
+ headers: api_headers,
5937
+ params: api_params,
5938
+ response_type: Models::VideoProfile
5939
+ )
5940
+ end
5941
+
5942
+ # Update a video profile by its unique ID (`PATCH
5943
+ # /v1/project/videos/profiles/:profileId`). Existing renditions are not
5944
+ # re-encoded. Changing the profile onto the same width, height, bitrates, and
5945
+ # codec as another profile fails with `video_profile_already_exists`.
5946
+ #
5947
+ #
5948
+ # @param [String] profile_id Video profile unique ID.
5949
+ # @param [String] name Video profile name.
5950
+ # @param [Integer] video_bit_rate Target video bitrate in bits per second. Must be a multiple of 1000.
5951
+ # @param [Integer] audio_bit_rate Target audio bitrate in bits per second. Must be a multiple of 1000.
5952
+ # @param [Integer] width Target video width in pixels. Must be an even number.
5953
+ # @param [Integer] height Target video height in pixels. Must be an even number.
5954
+ #
5955
+ # @return [VideoProfile]
5956
+ def update_video_profile(
5957
+ profile_id:,
5958
+ name: nil,
5959
+ video_bit_rate: nil,
5960
+ audio_bit_rate: nil,
5961
+ width: nil,
5962
+ height: nil
5963
+ )
5964
+ if profile_id.nil? || profile_id == ''
5965
+ raise Appwrite::Exception.new('Missing required parameter: "profileId"')
5966
+ end
5967
+
5968
+ api_path = '/project/videos/profiles/{profileId}'
5969
+ .gsub('{profileId}', @client.encode_path(profile_id))
5970
+
5971
+ api_params = {
5972
+ name: name,
5973
+ videoBitRate: video_bit_rate,
5974
+ audioBitRate: audio_bit_rate,
5975
+ width: width,
5976
+ height: height,
5977
+ }
5978
+
5979
+ api_headers = {
5980
+ "X-Appwrite-Project": @client.get_config('project'),
5981
+ "content-type": 'application/json',
5982
+ "accept": 'application/json',
5983
+ }
5984
+
5985
+ @client.call(
5986
+ method: 'PATCH',
5987
+ path: api_path,
5988
+ headers: api_headers,
5989
+ params: api_params,
5990
+ response_type: Models::VideoProfile
5991
+ )
5992
+ end
5993
+
5994
+ # Delete a video profile by its unique ID (`DELETE
5995
+ # /v1/project/videos/profiles/:profileId`). Renditions already encoded
5996
+ # against it are left in place.
5997
+ #
5998
+ #
5999
+ # @param [String] profile_id Video profile unique ID.
6000
+ #
6001
+ # @return []
6002
+ def delete_video_profile(
6003
+ profile_id:
6004
+ )
6005
+ if profile_id.nil? || profile_id == ''
6006
+ raise Appwrite::Exception.new('Missing required parameter: "profileId"')
6007
+ end
6008
+
6009
+ api_path = '/project/videos/profiles/{profileId}'
6010
+ .gsub('{profileId}', @client.encode_path(profile_id))
6011
+
6012
+ api_params = {}
6013
+
6014
+ api_headers = {
6015
+ "X-Appwrite-Project": @client.get_config('project'),
6016
+ "content-type": 'application/json',
6017
+ "accept": 'application/json',
6018
+ }
6019
+
6020
+ @client.call(
6021
+ method: 'DELETE',
6022
+ path: api_path,
6023
+ headers: api_headers,
6024
+ params: api_params,
6025
+ )
6026
+ end
5794
6027
  end
5795
6028
  end