telestream_cloud 1.1.0 → 2.0.0.1
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/.gitignore +2 -0
- data/README.md +16 -354
- data/flip/.gitignore +39 -0
- data/flip/.rspec +2 -0
- data/flip/.swagger-codegen-ignore +23 -0
- data/flip/.swagger-codegen/VERSION +1 -0
- data/flip/Gemfile +7 -0
- data/flip/README.md +130 -0
- data/flip/Rakefile +8 -0
- data/flip/docs/CanceledResponse.md +8 -0
- data/flip/docs/CloudNotificationSettings.md +11 -0
- data/flip/docs/CloudNotificationSettingsEvents.md +11 -0
- data/flip/docs/CopyProfileBody.md +9 -0
- data/flip/docs/CountResponse.md +8 -0
- data/flip/docs/CreateEncodingBody.md +10 -0
- data/flip/docs/CreateVideoBody.md +12 -0
- data/flip/docs/DeletedResponse.md +8 -0
- data/flip/docs/Encoding.md +38 -0
- data/flip/docs/EncodingSignedUrl.md +8 -0
- data/flip/docs/EncodingSignedUrls.md +8 -0
- data/flip/docs/Error.md +9 -0
- data/flip/docs/ExtraFile.md +10 -0
- data/flip/docs/Factory.md +25 -0
- data/flip/docs/FactoryBody.md +23 -0
- data/flip/docs/FactoryBodyStorageCredentialAttributes.md +11 -0
- data/flip/docs/FactorySync.md +8 -0
- data/flip/docs/FactorySyncBody.md +8 -0
- data/flip/docs/FlipApi.md +2179 -0
- data/flip/docs/PaginatedEncodingsCollection.md +11 -0
- data/flip/docs/PaginatedFactoryCollection.md +11 -0
- data/flip/docs/PaginatedProfilesCollection.md +11 -0
- data/flip/docs/PaginatedVideoCollection.md +11 -0
- data/flip/docs/PaginatedWorkflowsCollection.md +11 -0
- data/flip/docs/Profile.md +135 -0
- data/flip/docs/ProfileBody.md +137 -0
- data/flip/docs/ResubmitVideoBody.md +8 -0
- data/flip/docs/RetriedResponse.md +8 -0
- data/flip/docs/SignedVideoUrl.md +8 -0
- data/flip/docs/UpdateEncodingBody.md +9 -0
- data/flip/docs/UploadSession.md +13 -0
- data/flip/docs/Video.md +31 -0
- data/flip/docs/VideoMetadata.md +7 -0
- data/flip/docs/VideoUploadBody.md +24 -0
- data/flip/git_push.sh +55 -0
- data/flip/lib/telestream_cloud_flip.rb +79 -0
- data/flip/lib/telestream_cloud_flip/api/flip_api.rb +2385 -0
- data/flip/lib/telestream_cloud_flip/api_client.rb +389 -0
- data/flip/lib/telestream_cloud_flip/api_error.rb +38 -0
- data/flip/lib/telestream_cloud_flip/configuration.rb +209 -0
- data/flip/lib/telestream_cloud_flip/models/canceled_response.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/cloud_notification_settings.rb +237 -0
- data/flip/lib/telestream_cloud_flip/models/cloud_notification_settings_events.rb +239 -0
- data/flip/lib/telestream_cloud_flip/models/copy_profile_body.rb +209 -0
- data/flip/lib/telestream_cloud_flip/models/count_response.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/create_encoding_body.rb +214 -0
- data/flip/lib/telestream_cloud_flip/models/create_video_body.rb +231 -0
- data/flip/lib/telestream_cloud_flip/models/deleted_response.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/encoding.rb +486 -0
- data/flip/lib/telestream_cloud_flip/models/encoding_signed_url.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/encoding_signed_urls.rb +191 -0
- data/flip/lib/telestream_cloud_flip/models/error.rb +199 -0
- data/flip/lib/telestream_cloud_flip/models/extra_file.rb +221 -0
- data/flip/lib/telestream_cloud_flip/models/factory.rb +388 -0
- data/flip/lib/telestream_cloud_flip/models/factory_body.rb +374 -0
- data/flip/lib/telestream_cloud_flip/models/factory_body_storage_credential_attributes.rb +215 -0
- data/flip/lib/telestream_cloud_flip/models/factory_sync.rb +222 -0
- data/flip/lib/telestream_cloud_flip/models/factory_sync_body.rb +227 -0
- data/flip/lib/telestream_cloud_flip/models/paginated_encodings_collection.rb +240 -0
- data/flip/lib/telestream_cloud_flip/models/paginated_factory_collection.rb +220 -0
- data/flip/lib/telestream_cloud_flip/models/paginated_profiles_collection.rb +220 -0
- data/flip/lib/telestream_cloud_flip/models/paginated_video_collection.rb +220 -0
- data/flip/lib/telestream_cloud_flip/models/paginated_workflows_collection.rb +220 -0
- data/flip/lib/telestream_cloud_flip/models/profile.rb +1777 -0
- data/flip/lib/telestream_cloud_flip/models/profile_body.rb +1762 -0
- data/flip/lib/telestream_cloud_flip/models/resubmit_video_body.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/retried_response.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/signed_video_url.rb +189 -0
- data/flip/lib/telestream_cloud_flip/models/update_encoding_body.rb +199 -0
- data/flip/lib/telestream_cloud_flip/models/upload_session.rb +249 -0
- data/flip/lib/telestream_cloud_flip/models/video.rb +418 -0
- data/flip/lib/telestream_cloud_flip/models/video_metadata.rb +179 -0
- data/flip/lib/telestream_cloud_flip/models/video_upload_body.rb +362 -0
- data/flip/lib/telestream_cloud_flip/uploader.rb +244 -0
- data/flip/lib/telestream_cloud_flip/version.rb +18 -0
- data/flip/spec/api/flip_api_spec.rb +550 -0
- data/flip/spec/api_client_spec.rb +226 -0
- data/flip/spec/configuration_spec.rb +42 -0
- data/flip/spec/models/canceled_response_spec.rb +42 -0
- data/flip/spec/models/cloud_notification_settings_events_spec.rb +60 -0
- data/flip/spec/models/cloud_notification_settings_spec.rb +60 -0
- data/flip/spec/models/copy_profile_body_spec.rb +48 -0
- data/flip/spec/models/count_response_spec.rb +42 -0
- data/flip/spec/models/create_encoding_body_spec.rb +54 -0
- data/flip/spec/models/create_video_body_spec.rb +66 -0
- data/flip/spec/models/deleted_response_spec.rb +42 -0
- data/flip/spec/models/encoding_signed_url_spec.rb +42 -0
- data/flip/spec/models/encoding_signed_urls_spec.rb +42 -0
- data/flip/spec/models/encoding_spec.rb +222 -0
- data/flip/spec/models/error_spec.rb +48 -0
- data/flip/spec/models/extra_file_spec.rb +54 -0
- data/flip/spec/models/factory_body_spec.rb +136 -0
- data/flip/spec/models/factory_body_storage_credential_attributes_spec.rb +60 -0
- data/flip/spec/models/factory_spec.rb +148 -0
- data/flip/spec/models/factory_sync_body_spec.rb +46 -0
- data/flip/spec/models/factory_sync_spec.rb +46 -0
- data/flip/spec/models/paginated_encodings_collection_spec.rb +60 -0
- data/flip/spec/models/paginated_factory_collection_spec.rb +60 -0
- data/flip/spec/models/paginated_profiles_collection_spec.rb +60 -0
- data/flip/spec/models/paginated_video_collection_spec.rb +60 -0
- data/flip/spec/models/paginated_workflows_collection_spec.rb +60 -0
- data/flip/spec/models/profile_body_spec.rb +916 -0
- data/flip/spec/models/profile_spec.rb +916 -0
- data/flip/spec/models/resubmit_video_body_spec.rb +42 -0
- data/flip/spec/models/retried_response_spec.rb +42 -0
- data/flip/spec/models/signed_video_url_spec.rb +42 -0
- data/flip/spec/models/update_encoding_body_spec.rb +48 -0
- data/flip/spec/models/upload_session_spec.rb +72 -0
- data/flip/spec/models/video_metadata_spec.rb +36 -0
- data/flip/spec/models/video_spec.rb +180 -0
- data/flip/spec/models/video_upload_body_spec.rb +138 -0
- data/flip/spec/spec_helper.rb +111 -0
- data/flip/telestream_cloud_flip.gemspec +47 -0
- data/lib/telestream_cloud.rb +0 -31
- data/lib/telestream_cloud/flip.rb +1 -9
- data/lib/telestream_cloud/qc.rb +1 -0
- data/lib/telestream_cloud/tts.rb +1 -0
- data/lib/telestream_cloud/version.rb +1 -1
- data/qc/.gitignore +39 -0
- data/qc/.rspec +2 -0
- data/qc/.swagger-codegen-ignore +23 -0
- data/qc/.swagger-codegen/VERSION +1 -0
- data/qc/Gemfile +7 -0
- data/qc/README.md +58 -0
- data/qc/Rakefile +8 -0
- data/qc/docs/Alert.md +13 -0
- data/qc/docs/AudioStream.md +13 -0
- data/qc/docs/Container.md +9 -0
- data/qc/docs/Data.md +10 -0
- data/qc/docs/Data1.md +9 -0
- data/qc/docs/ExtraFile.md +10 -0
- data/qc/docs/Job.md +12 -0
- data/qc/docs/JobData.md +9 -0
- data/qc/docs/JobDetails.md +9 -0
- data/qc/docs/JobDetailsResult.md +8 -0
- data/qc/docs/JobsCollection.md +12 -0
- data/qc/docs/Media.md +10 -0
- data/qc/docs/Options.md +7 -0
- data/qc/docs/Project.md +12 -0
- data/qc/docs/Proxy.md +12 -0
- data/qc/docs/QcApi.md +719 -0
- data/qc/docs/UploadSession.md +13 -0
- data/qc/docs/VideoStream.md +13 -0
- data/qc/docs/VideoUploadBody.md +12 -0
- data/qc/git_push.sh +55 -0
- data/qc/lib/telestream_cloud_qc.rb +64 -0
- data/qc/lib/telestream_cloud_qc/api/qc_api.rb +781 -0
- data/qc/lib/telestream_cloud_qc/api_client.rb +389 -0
- data/qc/lib/telestream_cloud_qc/api_error.rb +38 -0
- data/qc/lib/telestream_cloud_qc/configuration.rb +209 -0
- data/qc/lib/telestream_cloud_qc/models/alert.rb +236 -0
- data/qc/lib/telestream_cloud_qc/models/audio_stream.rb +238 -0
- data/qc/lib/telestream_cloud_qc/models/container.rb +198 -0
- data/qc/lib/telestream_cloud_qc/models/data.rb +208 -0
- data/qc/lib/telestream_cloud_qc/models/data_1.rb +197 -0
- data/qc/lib/telestream_cloud_qc/models/extra_file.rb +221 -0
- data/qc/lib/telestream_cloud_qc/models/job.rb +269 -0
- data/qc/lib/telestream_cloud_qc/models/job_data.rb +197 -0
- data/qc/lib/telestream_cloud_qc/models/job_details.rb +199 -0
- data/qc/lib/telestream_cloud_qc/models/job_details_result.rb +190 -0
- data/qc/lib/telestream_cloud_qc/models/jobs_collection.rb +230 -0
- data/qc/lib/telestream_cloud_qc/models/media.rb +210 -0
- data/qc/lib/telestream_cloud_qc/models/options.rb +179 -0
- data/qc/lib/telestream_cloud_qc/models/project.rb +262 -0
- data/qc/lib/telestream_cloud_qc/models/proxy.rb +224 -0
- data/qc/lib/telestream_cloud_qc/models/upload_session.rb +249 -0
- data/qc/lib/telestream_cloud_qc/models/video_stream.rb +235 -0
- data/qc/lib/telestream_cloud_qc/models/video_upload_body.rb +242 -0
- data/qc/lib/telestream_cloud_qc/uploader.rb +244 -0
- data/qc/lib/telestream_cloud_qc/version.rb +18 -0
- data/qc/spec/api/qc_api_spec.rb +202 -0
- data/qc/spec/api_client_spec.rb +226 -0
- data/qc/spec/configuration_spec.rb +42 -0
- data/qc/spec/models/alert_spec.rb +72 -0
- data/qc/spec/models/audio_stream_spec.rb +72 -0
- data/qc/spec/models/container_spec.rb +48 -0
- data/qc/spec/models/data_1_spec.rb +48 -0
- data/qc/spec/models/data_spec.rb +54 -0
- data/qc/spec/models/extra_file_spec.rb +54 -0
- data/qc/spec/models/job_data_spec.rb +48 -0
- data/qc/spec/models/job_details_result_spec.rb +42 -0
- data/qc/spec/models/job_details_spec.rb +48 -0
- data/qc/spec/models/job_spec.rb +74 -0
- data/qc/spec/models/jobs_collection_spec.rb +66 -0
- data/qc/spec/models/media_spec.rb +54 -0
- data/qc/spec/models/options_spec.rb +36 -0
- data/qc/spec/models/project_spec.rb +70 -0
- data/qc/spec/models/proxy_spec.rb +66 -0
- data/qc/spec/models/upload_session_spec.rb +72 -0
- data/qc/spec/models/video_stream_spec.rb +72 -0
- data/qc/spec/models/video_upload_body_spec.rb +66 -0
- data/qc/spec/spec_helper.rb +111 -0
- data/qc/telestream_cloud_qc.gemspec +47 -0
- data/telestream_cloud.gemspec +7 -12
- data/tts/.gitignore +39 -0
- data/tts/.rspec +2 -0
- data/tts/.swagger-codegen-ignore +23 -0
- data/tts/.swagger-codegen/VERSION +1 -0
- data/tts/Gemfile +7 -0
- data/tts/README.md +92 -0
- data/tts/Rakefile +8 -0
- data/tts/docs/CorporaCollection.md +8 -0
- data/tts/docs/Corpus.md +9 -0
- data/tts/docs/ErrorResponse.md +7 -0
- data/tts/docs/ExtraFile.md +10 -0
- data/tts/docs/Fragment.md +10 -0
- data/tts/docs/FragmentVariant.md +9 -0
- data/tts/docs/Job.md +23 -0
- data/tts/docs/JobResult.md +8 -0
- data/tts/docs/JobsCollection.md +12 -0
- data/tts/docs/Project.md +18 -0
- data/tts/docs/ProjectsCollection.md +12 -0
- data/tts/docs/Result.md +12 -0
- data/tts/docs/TtsApi.md +902 -0
- data/tts/docs/UploadSession.md +13 -0
- data/tts/docs/VideoUploadBody.md +12 -0
- data/tts/git_push.sh +55 -0
- data/tts/lib/telestream_cloud_tts.rb +60 -0
- data/tts/lib/telestream_cloud_tts/api/tts_api.rb +946 -0
- data/tts/lib/telestream_cloud_tts/api_client.rb +389 -0
- data/tts/lib/telestream_cloud_tts/api_error.rb +38 -0
- data/tts/lib/telestream_cloud_tts/configuration.rb +209 -0
- data/tts/lib/telestream_cloud_tts/models/corpora_collection.rb +191 -0
- data/tts/lib/telestream_cloud_tts/models/corpus.rb +199 -0
- data/tts/lib/telestream_cloud_tts/models/error_response.rb +179 -0
- data/tts/lib/telestream_cloud_tts/models/extra_file.rb +221 -0
- data/tts/lib/telestream_cloud_tts/models/fragment.rb +211 -0
- data/tts/lib/telestream_cloud_tts/models/fragment_variant.rb +199 -0
- data/tts/lib/telestream_cloud_tts/models/job.rb +372 -0
- data/tts/lib/telestream_cloud_tts/models/job_result.rb +191 -0
- data/tts/lib/telestream_cloud_tts/models/jobs_collection.rb +230 -0
- data/tts/lib/telestream_cloud_tts/models/project.rb +322 -0
- data/tts/lib/telestream_cloud_tts/models/projects_collection.rb +230 -0
- data/tts/lib/telestream_cloud_tts/models/result.rb +230 -0
- data/tts/lib/telestream_cloud_tts/models/upload_session.rb +249 -0
- data/tts/lib/telestream_cloud_tts/models/video_upload_body.rb +241 -0
- data/tts/lib/telestream_cloud_tts/uploader.rb +244 -0
- data/tts/lib/telestream_cloud_tts/version.rb +18 -0
- data/tts/spec/api/tts_api_spec.rb +236 -0
- data/tts/spec/api_client_spec.rb +226 -0
- data/tts/spec/configuration_spec.rb +42 -0
- data/tts/spec/models/corpora_collection_spec.rb +42 -0
- data/tts/spec/models/corpus_spec.rb +48 -0
- data/tts/spec/models/error_response_spec.rb +36 -0
- data/tts/spec/models/extra_file_spec.rb +54 -0
- data/tts/spec/models/fragment_spec.rb +54 -0
- data/tts/spec/models/fragment_variant_spec.rb +48 -0
- data/tts/spec/models/job_result_spec.rb +42 -0
- data/tts/spec/models/job_spec.rb +136 -0
- data/tts/spec/models/jobs_collection_spec.rb +66 -0
- data/tts/spec/models/project_spec.rb +106 -0
- data/tts/spec/models/projects_collection_spec.rb +66 -0
- data/tts/spec/models/result_spec.rb +66 -0
- data/tts/spec/models/upload_session_spec.rb +72 -0
- data/tts/spec/models/video_upload_body_spec.rb +66 -0
- data/tts/spec/spec_helper.rb +111 -0
- data/tts/telestream_cloud_tts.gemspec +47 -0
- metadata +281 -123
- data/Gemfile +0 -2
- data/lib/telestream_cloud/api_authentication.rb +0 -66
- data/lib/telestream_cloud/base.rb +0 -111
- data/lib/telestream_cloud/config.rb +0 -87
- data/lib/telestream_cloud/connection.rb +0 -101
- data/lib/telestream_cloud/errors.rb +0 -17
- data/lib/telestream_cloud/faraday.rb +0 -84
- data/lib/telestream_cloud/modules/associations.rb +0 -55
- data/lib/telestream_cloud/modules/builders.rb +0 -45
- data/lib/telestream_cloud/modules/destroyers.rb +0 -25
- data/lib/telestream_cloud/modules/factory_connection.rb +0 -7
- data/lib/telestream_cloud/modules/finders.rb +0 -68
- data/lib/telestream_cloud/modules/router.rb +0 -62
- data/lib/telestream_cloud/modules/updatable.rb +0 -31
- data/lib/telestream_cloud/modules/video_state.rb +0 -16
- data/lib/telestream_cloud/parallel_uploader.rb +0 -52
- data/lib/telestream_cloud/proxies/encoding_scope.rb +0 -56
- data/lib/telestream_cloud/proxies/profile_scope.rb +0 -7
- data/lib/telestream_cloud/proxies/proxy.rb +0 -27
- data/lib/telestream_cloud/proxies/scope.rb +0 -94
- data/lib/telestream_cloud/proxies/video_scope.rb +0 -28
- data/lib/telestream_cloud/resources/encoding.rb +0 -47
- data/lib/telestream_cloud/resources/factory.rb +0 -72
- data/lib/telestream_cloud/resources/profile.rb +0 -22
- data/lib/telestream_cloud/resources/resource.rb +0 -48
- data/lib/telestream_cloud/resources/video.rb +0 -39
- data/lib/telestream_cloud/telestream_cloud.rb +0 -69
- data/lib/telestream_cloud/upload_session.rb +0 -40
- data/lib/telestream_cloud/uploader.rb +0 -123
- data/lib/telestream_cloud/uploader/file_reader.rb +0 -27
- data/spec/cloud_spec.rb +0 -132
- data/spec/encoding_spec.rb +0 -260
- data/spec/heroku_spec.rb +0 -32
- data/spec/panda_spec.rb +0 -206
- data/spec/profile_spec.rb +0 -117
- data/spec/spec_helper.rb +0 -18
- data/spec/uploader_spec.rb +0 -143
- data/spec/video_spec.rb +0 -399
@@ -1,94 +0,0 @@
|
|
1
|
-
require 'forwardable'
|
2
|
-
|
3
|
-
module TelestreamCloud
|
4
|
-
class Scope < Proxy
|
5
|
-
extend Forwardable
|
6
|
-
|
7
|
-
def respond_to?(method)
|
8
|
-
scoped_methods = [].methods.map{|i| i.to_sym} - non_delegate_methods + [:reload, :non_delegate_methods]
|
9
|
-
!(scoped_methods).include?(method.to_sym)
|
10
|
-
end
|
11
|
-
|
12
|
-
def non_delegate_methods
|
13
|
-
[:nil?, :send, :object_id, :respond_to?, :class, :find, :find_by, :create, :create!, :all, :factory, :connection]
|
14
|
-
end
|
15
|
-
|
16
|
-
def initialize(parent, klass)
|
17
|
-
super
|
18
|
-
|
19
|
-
initialize_scope_attributes
|
20
|
-
initialize_scopes
|
21
|
-
end
|
22
|
-
|
23
|
-
# Overide the function to set the factory_id as the same as the scope
|
24
|
-
def find_by_path(url, map={})
|
25
|
-
object = find_object_by_path(url, map)
|
26
|
-
|
27
|
-
if object.is_a?(Array)
|
28
|
-
object.map{|o| klass.new(o.merge('factory_id' => factory.id))}
|
29
|
-
elsif object['id']
|
30
|
-
klass.new(object.merge('factory_id' => factory.id))
|
31
|
-
else
|
32
|
-
raise APIError.new(object)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
def create(attributes)
|
37
|
-
scoped_attrs = attributes.merge(@scoped_attributes)
|
38
|
-
super(scoped_attrs)
|
39
|
-
end
|
40
|
-
|
41
|
-
def create!(attributes)
|
42
|
-
scoped_attrs = attributes.merge(@scoped_attributes)
|
43
|
-
super(scoped_attrs)
|
44
|
-
end
|
45
|
-
|
46
|
-
def all(attributes={})
|
47
|
-
@scoped_attributes.merge!(attributes)
|
48
|
-
trigger_request
|
49
|
-
end
|
50
|
-
|
51
|
-
def reload
|
52
|
-
@found = trigger_request
|
53
|
-
end
|
54
|
-
|
55
|
-
private
|
56
|
-
|
57
|
-
def initialize_scope_attributes
|
58
|
-
@scoped_attributes={}
|
59
|
-
if @parent.is_a?(TelestreamCloud::Resource)
|
60
|
-
@scoped_attributes[parent_relation_name.to_sym] = @parent.id
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
def proxy_found
|
65
|
-
@found ||= trigger_request
|
66
|
-
end
|
67
|
-
|
68
|
-
def initialize_scopes
|
69
|
-
([].methods + [:to_json]).each do |m|
|
70
|
-
unless m.to_s =~ /^__/ || non_delegate_methods.include?(m.to_sym)
|
71
|
-
self.class.class_eval do
|
72
|
-
def_delegators :proxy_found, m.to_sym
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
76
|
-
end
|
77
|
-
|
78
|
-
def trigger_request
|
79
|
-
if @parent.is_a?(Resource)
|
80
|
-
path = build_hash_many_path(many_path, parent_relation_name)
|
81
|
-
else
|
82
|
-
path = many_path
|
83
|
-
end
|
84
|
-
|
85
|
-
find_by_path(path, @scoped_attributes)
|
86
|
-
end
|
87
|
-
|
88
|
-
def parent_relation_name
|
89
|
-
"#{@parent.class.sti_name.downcase}_id"
|
90
|
-
end
|
91
|
-
|
92
|
-
end
|
93
|
-
end
|
94
|
-
|
@@ -1,28 +0,0 @@
|
|
1
|
-
module TelestreamCloud
|
2
|
-
class VideoScope < Scope
|
3
|
-
|
4
|
-
def initialize(parent)
|
5
|
-
super(parent, Video)
|
6
|
-
end
|
7
|
-
|
8
|
-
def non_delegate_methods
|
9
|
-
super + [:status, :page, :per_page]
|
10
|
-
end
|
11
|
-
|
12
|
-
def page(this_page)
|
13
|
-
@scoped_attributes[:page] = this_page
|
14
|
-
self
|
15
|
-
end
|
16
|
-
|
17
|
-
def per_page(this_per_page)
|
18
|
-
@scoped_attributes[:per_page] = this_per_page
|
19
|
-
self
|
20
|
-
end
|
21
|
-
|
22
|
-
def status(this_status)
|
23
|
-
@scoped_attributes[:status] = this_status
|
24
|
-
self
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
28
|
-
end
|
@@ -1,47 +0,0 @@
|
|
1
|
-
module TelestreamCloud
|
2
|
-
class Encoding < Resource
|
3
|
-
include VideoState
|
4
|
-
|
5
|
-
belongs_to :video
|
6
|
-
has_one :profile
|
7
|
-
|
8
|
-
class << self
|
9
|
-
def first
|
10
|
-
EncodingScope.new(self).per_page(1).first
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def url(options={})
|
15
|
-
default_options = {:https => false}
|
16
|
-
options = default_options.merge(options)
|
17
|
-
full_path = "#{path}#{extname}"
|
18
|
-
get_url(full_path, options[:https]) if files.include?(full_path)
|
19
|
-
end
|
20
|
-
|
21
|
-
def urls(options={})
|
22
|
-
default_options = {:https => false}
|
23
|
-
options = default_options.merge(options)
|
24
|
-
files.map {|f| get_url(f, options[:https])}
|
25
|
-
end
|
26
|
-
|
27
|
-
def screenshots(options={})
|
28
|
-
default_options = {:https => false}
|
29
|
-
options = default_options.merge(options)
|
30
|
-
((1..7).map{|i| get_url("#{path}_#{i}.jpg", options[:https])} if success?) || []
|
31
|
-
end
|
32
|
-
|
33
|
-
def cancel
|
34
|
-
connection.post("/encodings/#{id}/cancel.json")['canceled']
|
35
|
-
end
|
36
|
-
|
37
|
-
def retry
|
38
|
-
connection.post("/encodings/#{id}/retry.json")['retried']
|
39
|
-
end
|
40
|
-
|
41
|
-
private
|
42
|
-
|
43
|
-
def get_url(end_path, https)
|
44
|
-
"#{https ? factory.https_url : factory.url}#{end_path}"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
end
|
@@ -1,72 +0,0 @@
|
|
1
|
-
module TelestreamCloud
|
2
|
-
class Factory < Base
|
3
|
-
include TelestreamCloud::Updatable
|
4
|
-
|
5
|
-
attr_reader :connection
|
6
|
-
|
7
|
-
def initialize(attributes={})
|
8
|
-
super(attributes)
|
9
|
-
connection_params = TelestreamCloud.connection.to_hash.merge!(:factory_id => id)
|
10
|
-
@connection = Connection.new(connection_params)
|
11
|
-
TelestreamCloud.factories[id] = self
|
12
|
-
end
|
13
|
-
|
14
|
-
class << self
|
15
|
-
|
16
|
-
def connection
|
17
|
-
TelestreamCloud.connection
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def build_resource(attributes)
|
23
|
-
resource = TelestreamCloud::Factory.new(attributes)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def https_url
|
28
|
-
uri = URI.parse(url)
|
29
|
-
uri.scheme = "https"
|
30
|
-
uri.to_s
|
31
|
-
end
|
32
|
-
|
33
|
-
def eu?
|
34
|
-
region == "eu"
|
35
|
-
end
|
36
|
-
|
37
|
-
def us?
|
38
|
-
region == "us"
|
39
|
-
end
|
40
|
-
|
41
|
-
def region
|
42
|
-
return 'eu' if connection.api_host == TelestreamCloud::EU_API_HOST
|
43
|
-
return 'us' if connection.api_host == TelestreamCloud::US_API_HOST
|
44
|
-
return 'gce' if connection.api_host == TelestreamCloud::GCE_API_HOST
|
45
|
-
end
|
46
|
-
|
47
|
-
def videos
|
48
|
-
VideoScope.new(self)
|
49
|
-
end
|
50
|
-
|
51
|
-
def encodings
|
52
|
-
EncodingScope.new(self)
|
53
|
-
end
|
54
|
-
|
55
|
-
def profiles
|
56
|
-
ProfileScope.new(self)
|
57
|
-
end
|
58
|
-
|
59
|
-
def method_missing(method_symbol, *arguments)
|
60
|
-
lazy_load
|
61
|
-
super
|
62
|
-
end
|
63
|
-
|
64
|
-
private
|
65
|
-
|
66
|
-
def lazy_load
|
67
|
-
reload unless @loaded
|
68
|
-
end
|
69
|
-
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module TelestreamCloud
|
2
|
-
class Profile < Resource
|
3
|
-
include TelestreamCloud::Updatable
|
4
|
-
|
5
|
-
has_many :encodings
|
6
|
-
|
7
|
-
def preset?
|
8
|
-
!preset_name
|
9
|
-
end
|
10
|
-
|
11
|
-
# override attributes command and preset_name
|
12
|
-
# to ovoid <method undefined> when profile is a preset or not
|
13
|
-
def command
|
14
|
-
@attributes['command']
|
15
|
-
end
|
16
|
-
|
17
|
-
def preset_name
|
18
|
-
@attributes['preset_name']
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
22
|
-
end
|
@@ -1,48 +0,0 @@
|
|
1
|
-
module TelestreamCloud
|
2
|
-
class Resource < Base
|
3
|
-
include TelestreamCloud::Destroyers
|
4
|
-
include TelestreamCloud::Associations
|
5
|
-
include TelestreamCloud::FactoryConnection
|
6
|
-
|
7
|
-
def initialize(attributes={})
|
8
|
-
super(attributes)
|
9
|
-
@attributes['factory_id'] ||= TelestreamCloud.factory.id
|
10
|
-
end
|
11
|
-
|
12
|
-
class << self
|
13
|
-
include TelestreamCloud::FactoryConnection
|
14
|
-
|
15
|
-
def factory
|
16
|
-
TelestreamCloud.factory
|
17
|
-
end
|
18
|
-
|
19
|
-
# delegate to the scope if the method exists
|
20
|
-
def method_missing(method_symbol, *args, &block)
|
21
|
-
scope = TelestreamCloud::const_get("#{sti_name}Scope").new(self)
|
22
|
-
if scope.respond_to?(method_symbol)
|
23
|
-
scope.send(method_symbol, *args, &block)
|
24
|
-
else
|
25
|
-
super
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|
30
|
-
|
31
|
-
def factory
|
32
|
-
TelestreamCloud.factories[factory_id]
|
33
|
-
end
|
34
|
-
|
35
|
-
def reload
|
36
|
-
perform_reload("factory_id" => factory_id)
|
37
|
-
reset_associations
|
38
|
-
self
|
39
|
-
end
|
40
|
-
|
41
|
-
private
|
42
|
-
|
43
|
-
def load_and_reset(response)
|
44
|
-
load_response(response.merge('factory_id' => factory.id))
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
module TelestreamCloud
|
2
|
-
class Video < Resource
|
3
|
-
include VideoState
|
4
|
-
has_many :encodings
|
5
|
-
|
6
|
-
class << self
|
7
|
-
def first
|
8
|
-
VideoScope.new(self).per_page(1).first
|
9
|
-
end
|
10
|
-
end
|
11
|
-
|
12
|
-
def metadata
|
13
|
-
connection.get("/videos/#{id}/metadata.json")
|
14
|
-
end
|
15
|
-
|
16
|
-
def delete_source
|
17
|
-
connection.delete("/videos/#{id}/source.json")
|
18
|
-
end
|
19
|
-
|
20
|
-
def preview_url(options={})
|
21
|
-
default_options = {:https => false}
|
22
|
-
options = default_options.merge(options)
|
23
|
-
get_url("#{path}_1.jpg", options[:https]) if success?
|
24
|
-
end
|
25
|
-
|
26
|
-
def url(options={})
|
27
|
-
default_options = {:https => false}
|
28
|
-
options = default_options.merge(options)
|
29
|
-
get_url("#{path}#{extname}", options[:https]) if success?
|
30
|
-
end
|
31
|
-
|
32
|
-
private
|
33
|
-
|
34
|
-
def get_url(end_path, https)
|
35
|
-
"#{https ? factory.https_url : factory.url}#{end_path}"
|
36
|
-
end
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
@@ -1,69 +0,0 @@
|
|
1
|
-
module TelestreamCloud
|
2
|
-
|
3
|
-
extend self
|
4
|
-
extend Forwardable
|
5
|
-
|
6
|
-
attr_reader :factory, :factories
|
7
|
-
attr_reader :connection
|
8
|
-
|
9
|
-
def_delegators :connection, :get, :post, :put, :delete, :api_url, :setup_bucket, :signed_params
|
10
|
-
|
11
|
-
RESOURCES = {
|
12
|
-
flip: TelestreamCloud::Flip
|
13
|
-
}
|
14
|
-
|
15
|
-
def configure(auth_params=nil, &block)
|
16
|
-
raise ArgumentError, "missing auth params or block" unless auth_params || block_given?
|
17
|
-
|
18
|
-
if !auth_params
|
19
|
-
config = Config.new
|
20
|
-
if (block.arity > 0)
|
21
|
-
block.call(config)
|
22
|
-
else
|
23
|
-
config.instance_eval(&block)
|
24
|
-
end
|
25
|
-
elsif auth_params.is_a?(String)
|
26
|
-
config = Config.from_panda_url(auth_params)
|
27
|
-
else
|
28
|
-
config = Config.from_hash(auth_params)
|
29
|
-
end
|
30
|
-
|
31
|
-
configure_with_auth_params(config)
|
32
|
-
true
|
33
|
-
end
|
34
|
-
|
35
|
-
def configure_heroku
|
36
|
-
configure_with_auth_params Config.from_panda_url(ENV['PANDASTREAM_URL'])
|
37
|
-
true
|
38
|
-
end
|
39
|
-
|
40
|
-
def connect!(auth_params)
|
41
|
-
@connection = Connection.new(auth_params)
|
42
|
-
end
|
43
|
-
|
44
|
-
def connection
|
45
|
-
raise TelestreamCloud::ConfigurationError, "Telestream Cloud is not configured!" unless @connection
|
46
|
-
@connection
|
47
|
-
end
|
48
|
-
|
49
|
-
def default_adapter=(adapter_name)
|
50
|
-
@adapter = adapter_name.to_sym
|
51
|
-
end
|
52
|
-
|
53
|
-
def default_adapter
|
54
|
-
@adapter
|
55
|
-
end
|
56
|
-
|
57
|
-
def resources(resource_name)
|
58
|
-
RESOURCES[resource_name].new
|
59
|
-
end
|
60
|
-
|
61
|
-
private
|
62
|
-
|
63
|
-
def configure_with_auth_params(config)
|
64
|
-
config.validate!
|
65
|
-
connect!(config.to_hash)
|
66
|
-
@factories = {}
|
67
|
-
@factory = Factory::new(:id => @connection.factory_id)
|
68
|
-
end
|
69
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
module TelestreamCloud
|
2
|
-
class UploadSession
|
3
|
-
attr_reader :uploader
|
4
|
-
|
5
|
-
def initialize(file_name, options = {})
|
6
|
-
@uploader = Uploader.new(options.merge(file: File.new(file_name)))
|
7
|
-
end
|
8
|
-
|
9
|
-
def error_message
|
10
|
-
uploader.error && uploader.error.message
|
11
|
-
end
|
12
|
-
|
13
|
-
def start(_ = nil)
|
14
|
-
uploader.upload
|
15
|
-
end
|
16
|
-
|
17
|
-
def status
|
18
|
-
uploader.status.to_s
|
19
|
-
end
|
20
|
-
|
21
|
-
def resume
|
22
|
-
start
|
23
|
-
end
|
24
|
-
|
25
|
-
def video
|
26
|
-
uploader.video
|
27
|
-
end
|
28
|
-
|
29
|
-
def file_name
|
30
|
-
uploader.reader.name
|
31
|
-
end
|
32
|
-
|
33
|
-
def file_size
|
34
|
-
uploader.reader.size
|
35
|
-
end
|
36
|
-
|
37
|
-
def abort
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|