wsc_sdk 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.circleci/config.yml +146 -0
- data/.circleci/docker/build/Dockerfile +3 -0
- data/.circleci/helpers/add_preamble.rb +29 -0
- data/.circleci/helpers/build_docs.sh +5 -0
- data/.circleci/helpers/build_gem.sh +5 -0
- data/.circleci/helpers/debundle-context.sh +14 -0
- data/.circleci/helpers/finalize_release.sh +24 -0
- data/.circleci/helpers/publish_docs.sh +10 -0
- data/.circleci/helpers/release_gem.sh +8 -0
- data/.circleci/helpers/setup.sh +11 -0
- data/.circleci/helpers/setup_aws.sh +13 -0
- data/.circleci/helpers/setup_gem.sh +2 -0
- data/.circleci/helpers/setup_git.sh +27 -0
- data/.circleci/helpers/setup_rubygems.sh +15 -0
- data/.circleci/helpers/test_integration.sh +12 -0
- data/.circleci/helpers/test_unit.sh +6 -0
- data/.circleci/jobs/publish-production.sh +17 -0
- data/.circleci/jobs/publish-staging.sh +17 -0
- data/.circleci/jobs/release-production.sh +21 -0
- data/.circleci/jobs/test-integration.sh +9 -0
- data/.circleci/jobs/test-unit.sh +9 -0
- data/.circleci/tag_repo.rb +46 -0
- data/.gitignore +28 -0
- data/.rspec +2 -0
- data/.yard/config +2 -0
- data/.yard/template/default/fulldoc/html/css/custom.css +151 -0
- data/.yard/template/default/layout/html/footer.erb +0 -0
- data/.yard/template/default/layout/html/headers.erb +10 -0
- data/.yard/template/default/layout/html/layout.erb +45 -0
- data/.yard/template/default/layout/html/setup.rb +24 -0
- data/.yardopts +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +99 -0
- data/LICENSE.txt +28 -0
- data/README.md +397 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/doc/Hash.html +291 -0
- data/doc/WscSdk.html +570 -0
- data/doc/WscSdk/ApiResponse.html +242 -0
- data/doc/WscSdk/Attributes.html +128 -0
- data/doc/WscSdk/Attributes/Mode.html +191 -0
- data/doc/WscSdk/Attributes/Type.html +389 -0
- data/doc/WscSdk/Client.html +2677 -0
- data/doc/WscSdk/Configuration.html +595 -0
- data/doc/WscSdk/Endpoint.html +2974 -0
- data/doc/WscSdk/Endpoints.html +141 -0
- data/doc/WscSdk/Endpoints/CustomStreamTargets.html +383 -0
- data/doc/WscSdk/Endpoints/LiveStreams.html +197 -0
- data/doc/WscSdk/Endpoints/OutputStreamTargets.html +180 -0
- data/doc/WscSdk/Endpoints/Outputs.html +180 -0
- data/doc/WscSdk/Endpoints/StreamTargets.html +446 -0
- data/doc/WscSdk/Endpoints/Transcoders.html +197 -0
- data/doc/WscSdk/Endpoints/UllStreamTargets.html +383 -0
- data/doc/WscSdk/Endpoints/WowzaStreamTargets.html +383 -0
- data/doc/WscSdk/Enum.html +225 -0
- data/doc/WscSdk/Enums.html +321 -0
- data/doc/WscSdk/Enums/BillingMode.html +188 -0
- data/doc/WscSdk/Enums/BroadcastLocation.html +396 -0
- data/doc/WscSdk/Enums/BufferSize.html +301 -0
- data/doc/WscSdk/Enums/ClosedCaptionType.html +221 -0
- data/doc/WscSdk/Enums/CustomProvider.html +252 -0
- data/doc/WscSdk/Enums/DeliveryMethod.html +188 -0
- data/doc/WscSdk/Enums/DeliveryType.html +188 -0
- data/doc/WscSdk/Enums/Encoder.html +460 -0
- data/doc/WscSdk/Enums/Errors.html +555 -0
- data/doc/WscSdk/Enums/IdleTimeout.html +398 -0
- data/doc/WscSdk/Enums/ImagePosition.html +220 -0
- data/doc/WscSdk/Enums/ModelMode.html +175 -0
- data/doc/WscSdk/Enums/ModelType.html +373 -0
- data/doc/WscSdk/Enums/PlayerType.html +188 -0
- data/doc/WscSdk/Enums/Protocol.html +204 -0
- data/doc/WscSdk/Enums/TargetDeliveryProtocol.html +188 -0
- data/doc/WscSdk/Enums/TranscoderType.html +188 -0
- data/doc/WscSdk/Enums/UserRegion.html +383 -0
- data/doc/WscSdk/Enums/WowzaProvider.html +188 -0
- data/doc/WscSdk/Errors.html +683 -0
- data/doc/WscSdk/Loggable.html +346 -0
- data/doc/WscSdk/Model.html +3316 -0
- data/doc/WscSdk/ModelList.html +442 -0
- data/doc/WscSdk/ModelTemplate.html +267 -0
- data/doc/WscSdk/Models.html +141 -0
- data/doc/WscSdk/Models/CustomStreamTarget.html +192 -0
- data/doc/WscSdk/Models/Error.html +351 -0
- data/doc/WscSdk/Models/LiveStream.html +601 -0
- data/doc/WscSdk/Models/LiveStreamConnectionCode.html +192 -0
- data/doc/WscSdk/Models/LiveStreamState.html +200 -0
- data/doc/WscSdk/Models/LiveStreamStats.html +200 -0
- data/doc/WscSdk/Models/LiveStreamThumbnailUrl.html +200 -0
- data/doc/WscSdk/Models/Output.html +294 -0
- data/doc/WscSdk/Models/OutputStreamTarget.html +274 -0
- data/doc/WscSdk/Models/StreamTarget.html +273 -0
- data/doc/WscSdk/Models/Transcoder.html +793 -0
- data/doc/WscSdk/Models/TranscoderBooleanStat.html +278 -0
- data/doc/WscSdk/Models/TranscoderConnectionCode.html +192 -0
- data/doc/WscSdk/Models/TranscoderFloatStat.html +278 -0
- data/doc/WscSdk/Models/TranscoderIntegerStat.html +278 -0
- data/doc/WscSdk/Models/TranscoderState.html +196 -0
- data/doc/WscSdk/Models/TranscoderStats.html +196 -0
- data/doc/WscSdk/Models/TranscoderStreamTargetState.html +192 -0
- data/doc/WscSdk/Models/TranscoderStringStat.html +278 -0
- data/doc/WscSdk/Models/TranscoderThumbnailUrl.html +196 -0
- data/doc/WscSdk/Models/UllStreamTarget.html +360 -0
- data/doc/WscSdk/Models/WowzaStreamTarget.html +380 -0
- data/doc/WscSdk/Pagination.html +1277 -0
- data/doc/WscSdk/Schema.html +861 -0
- data/doc/WscSdk/SchemaAttribute.html +2400 -0
- data/doc/WscSdk/Templates.html +141 -0
- data/doc/WscSdk/Templates/CustomStreamTarget.html +1045 -0
- data/doc/WscSdk/Templates/LiveStream.html +1432 -0
- data/doc/WscSdk/Templates/Output.html +829 -0
- data/doc/WscSdk/Templates/Transcoder.html +699 -0
- data/doc/WscSdk/Templates/UllStreamTarget.html +411 -0
- data/doc/WscSdk/Templates/WowzaStreamTarget.html +447 -0
- data/doc/WscSdk/TranscoderSharedMethods.html +1113 -0
- data/doc/_index.html +705 -0
- data/doc/class_list.html +51 -0
- data/doc/css/bootstrap.css +5 -0
- data/doc/css/common.css +1 -0
- data/doc/css/custom.css +151 -0
- data/doc/css/full_list.css +58 -0
- data/doc/css/style.css +496 -0
- data/doc/file.README.html +570 -0
- data/doc/file_list.html +56 -0
- data/doc/frames.html +17 -0
- data/doc/images/wsc-ruby-1800x400.png +0 -0
- data/doc/index.html +570 -0
- data/doc/js/app.js +292 -0
- data/doc/js/full_list.js +216 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +1731 -0
- data/doc/top-level-namespace.html +182 -0
- data/examples/client.rb +40 -0
- data/examples/helpers.rb +100 -0
- data/examples/live_streams/create.rb +39 -0
- data/examples/live_streams/delete.rb +32 -0
- data/examples/live_streams/find.rb +22 -0
- data/examples/live_streams/flood.rb +126 -0
- data/examples/live_streams/list.rb +24 -0
- data/examples/live_streams/regenerate_connection_code.rb +29 -0
- data/examples/live_streams/reset.rb +32 -0
- data/examples/live_streams/reset_and_wait.rb +51 -0
- data/examples/live_streams/start.rb +33 -0
- data/examples/live_streams/start_and_wait.rb +51 -0
- data/examples/live_streams/state.rb +33 -0
- data/examples/live_streams/stats.rb +43 -0
- data/examples/live_streams/stop.rb +33 -0
- data/examples/live_streams/stop_and_wait.rb +51 -0
- data/examples/live_streams/thumbnail_url.rb +46 -0
- data/examples/live_streams/update.rb +43 -0
- data/examples/live_streams/workflow.rb +165 -0
- data/examples/output_stream_targets/create.rb +56 -0
- data/examples/output_stream_targets/delete.rb +45 -0
- data/examples/output_stream_targets/find.rb +37 -0
- data/examples/output_stream_targets/list.rb +36 -0
- data/examples/output_stream_targets/update.rb +56 -0
- data/examples/outputs/create.rb +49 -0
- data/examples/outputs/delete.rb +39 -0
- data/examples/outputs/find.rb +31 -0
- data/examples/outputs/list.rb +29 -0
- data/examples/outputs/update.rb +50 -0
- data/examples/stream_targets/custom/create.rb +42 -0
- data/examples/stream_targets/custom/delete.rb +31 -0
- data/examples/stream_targets/custom/find.rb +23 -0
- data/examples/stream_targets/custom/list.rb +24 -0
- data/examples/stream_targets/custom/update.rb +43 -0
- data/examples/stream_targets/list.rb +24 -0
- data/examples/stream_targets/ull/create.rb +41 -0
- data/examples/stream_targets/ull/delete.rb +31 -0
- data/examples/stream_targets/ull/find.rb +23 -0
- data/examples/stream_targets/ull/list.rb +24 -0
- data/examples/stream_targets/ull/update.rb +43 -0
- data/examples/stream_targets/wowza/create.rb +42 -0
- data/examples/stream_targets/wowza/delete.rb +31 -0
- data/examples/stream_targets/wowza/find.rb +23 -0
- data/examples/stream_targets/wowza/list.rb +23 -0
- data/examples/stream_targets/wowza/update.rb +43 -0
- data/examples/transcoders/create.rb +39 -0
- data/examples/transcoders/delete.rb +31 -0
- data/examples/transcoders/find.rb +23 -0
- data/examples/transcoders/list.rb +24 -0
- data/examples/transcoders/reset.rb +32 -0
- data/examples/transcoders/reset_and_wait.rb +48 -0
- data/examples/transcoders/start.rb +33 -0
- data/examples/transcoders/start_and_wait.rb +50 -0
- data/examples/transcoders/state.rb +33 -0
- data/examples/transcoders/stats.rb +43 -0
- data/examples/transcoders/stop.rb +33 -0
- data/examples/transcoders/stop_and_wait.rb +50 -0
- data/examples/transcoders/thumbnail_url.rb +46 -0
- data/examples/transcoders/update.rb +43 -0
- data/images/wsc-ruby-1800x400.png +0 -0
- data/lib/wsc_sdk.rb +81 -0
- data/lib/wsc_sdk/client.rb +417 -0
- data/lib/wsc_sdk/configuration.rb +21 -0
- data/lib/wsc_sdk/constants.rb +29 -0
- data/lib/wsc_sdk/endpoint.rb +492 -0
- data/lib/wsc_sdk/endpoints/custom_stream_targets.rb +44 -0
- data/lib/wsc_sdk/endpoints/live_streams.rb +34 -0
- data/lib/wsc_sdk/endpoints/output_stream_targets.rb +17 -0
- data/lib/wsc_sdk/endpoints/outputs.rb +17 -0
- data/lib/wsc_sdk/endpoints/stream_targets.rb +45 -0
- data/lib/wsc_sdk/endpoints/transcoders.rb +38 -0
- data/lib/wsc_sdk/endpoints/ull_stream_targets.rb +44 -0
- data/lib/wsc_sdk/endpoints/wowza_stream_targets.rb +44 -0
- data/lib/wsc_sdk/enums.rb +31 -0
- data/lib/wsc_sdk/enums/billing_mode.rb +20 -0
- data/lib/wsc_sdk/enums/broadcast_location.rb +58 -0
- data/lib/wsc_sdk/enums/buffer_size.rb +41 -0
- data/lib/wsc_sdk/enums/closed_caption_type.rb +26 -0
- data/lib/wsc_sdk/enums/custom_provider.rb +32 -0
- data/lib/wsc_sdk/enums/delivery_method.rb +20 -0
- data/lib/wsc_sdk/enums/delivery_type.rb +20 -0
- data/lib/wsc_sdk/enums/encoder.rb +71 -0
- data/lib/wsc_sdk/enums/idle_timeout.rb +50 -0
- data/lib/wsc_sdk/enums/image_position.rb +26 -0
- data/lib/wsc_sdk/enums/player_type.rb +20 -0
- data/lib/wsc_sdk/enums/protocol.rb +23 -0
- data/lib/wsc_sdk/enums/target_delivery_protocol.rb +20 -0
- data/lib/wsc_sdk/enums/transcoder_type.rb +20 -0
- data/lib/wsc_sdk/enums/wowza_provider.rb +20 -0
- data/lib/wsc_sdk/errors.rb +115 -0
- data/lib/wsc_sdk/model.rb +515 -0
- data/lib/wsc_sdk/model_list.rb +42 -0
- data/lib/wsc_sdk/model_template.rb +27 -0
- data/lib/wsc_sdk/models/custom_stream_target.rb +34 -0
- data/lib/wsc_sdk/models/error.rb +53 -0
- data/lib/wsc_sdk/models/live_stream.rb +130 -0
- data/lib/wsc_sdk/models/live_stream_connection_code.rb +31 -0
- data/lib/wsc_sdk/models/live_stream_state.rb +20 -0
- data/lib/wsc_sdk/models/live_stream_stats.rb +20 -0
- data/lib/wsc_sdk/models/live_stream_thumbnail_url.rb +20 -0
- data/lib/wsc_sdk/models/output.rb +61 -0
- data/lib/wsc_sdk/models/output_stream_target.rb +37 -0
- data/lib/wsc_sdk/models/stream_target.rb +29 -0
- data/lib/wsc_sdk/models/transcoder.rb +135 -0
- data/lib/wsc_sdk/models/transcoder_boolean_stat.rb +41 -0
- data/lib/wsc_sdk/models/transcoder_connection_code.rb +29 -0
- data/lib/wsc_sdk/models/transcoder_float_stat.rb +40 -0
- data/lib/wsc_sdk/models/transcoder_integer_stat.rb +40 -0
- data/lib/wsc_sdk/models/transcoder_state.rb +31 -0
- data/lib/wsc_sdk/models/transcoder_stats.rb +51 -0
- data/lib/wsc_sdk/models/transcoder_stream_target_state.rb +29 -0
- data/lib/wsc_sdk/models/transcoder_string_stat.rb +40 -0
- data/lib/wsc_sdk/models/transcoder_thumbnail_url.rb +29 -0
- data/lib/wsc_sdk/models/ull_stream_target.rb +54 -0
- data/lib/wsc_sdk/models/wowza_stream_target.rb +60 -0
- data/lib/wsc_sdk/modules/api_response.rb +24 -0
- data/lib/wsc_sdk/modules/loggable.rb +44 -0
- data/lib/wsc_sdk/modules/transcoder_shared_methods.rb +221 -0
- data/lib/wsc_sdk/pagination.rb +89 -0
- data/lib/wsc_sdk/schema.rb +140 -0
- data/lib/wsc_sdk/schema_attribute.rb +349 -0
- data/lib/wsc_sdk/templates/custom_stream_target.rb +154 -0
- data/lib/wsc_sdk/templates/live_stream.rb +234 -0
- data/lib/wsc_sdk/templates/output.rb +133 -0
- data/lib/wsc_sdk/templates/transcoder.rb +97 -0
- data/lib/wsc_sdk/templates/ull_stream_target.rb +49 -0
- data/lib/wsc_sdk/templates/wowza_stream_target.rb +57 -0
- data/lib/wsc_sdk/version.rb +7 -0
- data/wsc_sdk.gemspec +48 -0
- metadata +460 -0
@@ -0,0 +1,42 @@
|
|
1
|
+
####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
|
2
|
+
####> This code is licensed pursuant to the BSD 3-Clause License.
|
3
|
+
|
4
|
+
module WscSdk
|
5
|
+
|
6
|
+
# A class to manage lists of models
|
7
|
+
#
|
8
|
+
class ModelList < Hash
|
9
|
+
include WscSdk::ApiResponse
|
10
|
+
|
11
|
+
# Add a model to the list
|
12
|
+
#
|
13
|
+
# @param model [WscSdk::Model]
|
14
|
+
# The model to add to the list
|
15
|
+
#
|
16
|
+
def add(model)
|
17
|
+
self[model.primary_key] = model
|
18
|
+
end
|
19
|
+
|
20
|
+
# Assign pagination data to the list
|
21
|
+
#
|
22
|
+
# @param pagination [Hash,WscSdk::Pagination]
|
23
|
+
# A hash of pagination options or an instance of WscSdk::Pagination
|
24
|
+
#
|
25
|
+
def pagination= pagination
|
26
|
+
if pagination.is_a?(Hash)
|
27
|
+
@pagination = WscSdk::Pagination.new(pagination)
|
28
|
+
elsif pagination.is_a?(WscSdk::Pagination)
|
29
|
+
@pagination = pagination
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
# Get pagination data for the list
|
34
|
+
#
|
35
|
+
# @return [Hash] A hash of pagination data
|
36
|
+
#
|
37
|
+
def pagination
|
38
|
+
@pagination ||= WscSdk::Pagination.new()
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
|
2
|
+
####> This code is licensed pursuant to the BSD 3-Clause License.
|
3
|
+
|
4
|
+
module WscSdk
|
5
|
+
|
6
|
+
# A module that contains the various templates
|
7
|
+
module Templates
|
8
|
+
|
9
|
+
end
|
10
|
+
|
11
|
+
# A base class for the model templates.
|
12
|
+
#
|
13
|
+
class ModelTemplate
|
14
|
+
|
15
|
+
# Modifies a hash with a hash of modifiers
|
16
|
+
#
|
17
|
+
# @param [Hash] data
|
18
|
+
# The initial hash to be modified
|
19
|
+
#
|
20
|
+
# @param [Hash] modifiers
|
21
|
+
# A hash of modifiers for the final template output.
|
22
|
+
#
|
23
|
+
def self.merge(data, modifiers)
|
24
|
+
data.deep_merge(modifiers)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
|
2
|
+
####> This code is licensed pursuant to the BSD 3-Clause License.
|
3
|
+
|
4
|
+
require 'wsc_sdk/model'
|
5
|
+
require 'wsc_sdk/models/stream_target'
|
6
|
+
|
7
|
+
module WscSdk
|
8
|
+
module Models
|
9
|
+
|
10
|
+
# A model to represent a Custom Stream Target in the Wowza Streaming Cloud API.
|
11
|
+
#
|
12
|
+
class CustomStreamTarget < WscSdk::Model
|
13
|
+
|
14
|
+
model_name_singular :stream_target_custom
|
15
|
+
model_name_plural :stream_targets_custom
|
16
|
+
|
17
|
+
attribute :id, :string, access: :read
|
18
|
+
attribute :name, :string, required: true
|
19
|
+
attribute :type, :string, access: :read
|
20
|
+
attribute :provider, :string
|
21
|
+
attribute :use_https, :boolean
|
22
|
+
attribute :stream_name, :string
|
23
|
+
attribute :username, :string
|
24
|
+
attribute :password, :string
|
25
|
+
attribute :primary_url, :string
|
26
|
+
attribute :backup_url, :string
|
27
|
+
attribute :hds_playback_url, :string
|
28
|
+
attribute :hls_playback_url, :string
|
29
|
+
attribute :rtmp_playback_url, :string
|
30
|
+
attribute :created_at, :datetime, access: :read
|
31
|
+
attribute :updated_at, :datetime, access: :read
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,53 @@
|
|
1
|
+
####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
|
2
|
+
####> This code is licensed pursuant to the BSD 3-Clause License.
|
3
|
+
|
4
|
+
require 'wsc_sdk/model'
|
5
|
+
|
6
|
+
module WscSdk
|
7
|
+
module Models
|
8
|
+
|
9
|
+
# A model to represent an error returned from the API.
|
10
|
+
#
|
11
|
+
class Error < WscSdk::Model
|
12
|
+
|
13
|
+
model_name_singular :meta
|
14
|
+
model_name_plural :meta
|
15
|
+
|
16
|
+
#---------------------------------------------------------------------------
|
17
|
+
# ___ _
|
18
|
+
# / __| __| |_ ___ _ __ __ _
|
19
|
+
# \__ \/ _| ' \/ -_) ' \/ _` |
|
20
|
+
# |___/\__|_||_\___|_|_|_\__,_|
|
21
|
+
#
|
22
|
+
#---------------------------------------------------------------------------
|
23
|
+
|
24
|
+
attribute :status, :integer, access: :read
|
25
|
+
attribute :code, :string, access: :read
|
26
|
+
attribute :title, :string, access: :read
|
27
|
+
attribute :message, :string, access: :read
|
28
|
+
attribute :description, :string, access: :read
|
29
|
+
|
30
|
+
#---------------------------------------------------------------------------
|
31
|
+
# ___ _ _
|
32
|
+
# / __| |_ __ _| |_ ___
|
33
|
+
# \__ \ _/ _` | _/ -_)
|
34
|
+
# |___/\__\__,_|\__\___|
|
35
|
+
#
|
36
|
+
#---------------------------------------------------------------------------
|
37
|
+
|
38
|
+
# Since this is an error response the success is always false.
|
39
|
+
#
|
40
|
+
# @return [Boolean] An indication of the status of the API call.
|
41
|
+
#
|
42
|
+
def success?
|
43
|
+
@success = false
|
44
|
+
end
|
45
|
+
|
46
|
+
# Generates a string with the details of the error.
|
47
|
+
#
|
48
|
+
def to_s
|
49
|
+
"#{code} | #{title} | #{message} | #{description}"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,130 @@
|
|
1
|
+
####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
|
2
|
+
####> This code is licensed pursuant to the BSD 3-Clause License.
|
3
|
+
|
4
|
+
require 'wsc_sdk/model'
|
5
|
+
|
6
|
+
module WscSdk
|
7
|
+
module Models
|
8
|
+
|
9
|
+
# A model to represent a Live Stream in the Wowza Streaming Cloud API.
|
10
|
+
#
|
11
|
+
class LiveStream < WscSdk::Model
|
12
|
+
include WscSdk::TranscoderSharedMethods
|
13
|
+
|
14
|
+
model_name_singular :live_stream
|
15
|
+
model_name_plural :live_streams
|
16
|
+
|
17
|
+
#---------------------------------------------------------------------------
|
18
|
+
# ___ _
|
19
|
+
# / __| __| |_ ___ _ __ __ _
|
20
|
+
# \__ \/ _| ' \/ -_) ' \/ _` |
|
21
|
+
# |___/\__|_||_\___|_|_|_\__,_|
|
22
|
+
#
|
23
|
+
#---------------------------------------------------------------------------
|
24
|
+
|
25
|
+
attribute :id, :string, access: :read
|
26
|
+
attribute :name, :string, required: true
|
27
|
+
attribute :transcoder_type, :string, required: true, validate: Enums::TranscoderType.values, default: Enums::TranscoderType::TRANSCODED
|
28
|
+
attribute :billing_mode, :string, required: true, validate: Enums::BillingMode.values, default: Enums::BillingMode::PAY_AS_YOU_GO
|
29
|
+
attribute :broadcast_location, :string, required: true, validate: Enums::BroadcastLocation.values
|
30
|
+
# attribute :protocol, :string, required: true, validate: Enums::Protocol.values
|
31
|
+
attribute :encoder, :string, required: true, validate: Enums::Encoder.values
|
32
|
+
attribute :delivery_method, :string, required: true, validate: Enums::DeliveryMethod.values, default: Enums::DeliveryMethod::PUSH
|
33
|
+
attribute :delivery_type, :string, required: :delivery_type_is_required?, validate: Enums::DeliveryType.values, default: Enums::DeliveryType::SINGLE_BITRATE
|
34
|
+
attribute :recording, :boolean
|
35
|
+
attribute :closed_caption_type, :string, validate: Enums::ClosedCaptionType.values
|
36
|
+
attribute :target_delivery_protocol, :string, default: Enums::TargetDeliveryProtocol::HLS_HTTPS
|
37
|
+
attribute :use_stream_source, :boolean
|
38
|
+
attribute :stream_source_id, :string, access: :read
|
39
|
+
attribute :aspect_ratio_width, :integer, required: true
|
40
|
+
attribute :aspect_ratio_height, :integer, required: true
|
41
|
+
attribute :source_url, :string, access: :write, required: :source_url_is_required?, default: :default_source_url
|
42
|
+
attribute :connection_code, :string, access: :read
|
43
|
+
attribute :connection_code_expires_at, :datetime, access: :read
|
44
|
+
attribute :disable_authentication, :boolean, access: :write
|
45
|
+
attribute :username, :string, access: :write
|
46
|
+
attribute :password, :string, access: :write
|
47
|
+
attribute :delivery_protocols, :array
|
48
|
+
attribute :source_connection_information, :hash, access: :read
|
49
|
+
attribute :direct_playback_urls, :hash, access: :read
|
50
|
+
|
51
|
+
attribute :player_id, :string, access: :read
|
52
|
+
attribute :player_type, :string, validate: Enums::PlayerType.values
|
53
|
+
attribute :player_responsive, :boolean
|
54
|
+
attribute :player_width, :integer
|
55
|
+
attribute :player_video_poster_image_url, :string, access: :read
|
56
|
+
attribute :player_video_poster_image, :string, access: :write
|
57
|
+
attribute :remove_player_video_poster_image, :boolean, access: :write
|
58
|
+
attribute :player_countdown, :boolean
|
59
|
+
attribute :player_countdown_at, :datetime
|
60
|
+
attribute :player_logo_image_url, :string, access: :read
|
61
|
+
attribute :player_logo_image, :string, access: :write
|
62
|
+
attribute :remove_player_logo_image, :boolean, access: :write
|
63
|
+
attribute :player_logo_position, :string, validate: Enums::ImagePosition.values
|
64
|
+
attribute :player_embed_code, :string, access: :read
|
65
|
+
attribute :player_hds_playback_url, :string, access: :read
|
66
|
+
attribute :player_hls_playback_url, :string, access: :read
|
67
|
+
|
68
|
+
attribute :hosted_page, :boolean, access: :hosted_page_access
|
69
|
+
attribute :hosted_page_title, :string
|
70
|
+
attribute :hosted_page_description, :string
|
71
|
+
attribute :hosted_page_url, :string, access: :read
|
72
|
+
attribute :hosted_page_logo_image_url, :string, access: :read
|
73
|
+
attribute :hosted_page_logo_image, :string, access: :write
|
74
|
+
attribute :remove_hosted_page_logo_image, :boolean, access: :write
|
75
|
+
attribute :hosted_page_sharing_icons, :boolean
|
76
|
+
|
77
|
+
|
78
|
+
attribute :created_at, :datetime, access: :read
|
79
|
+
attribute :updated_at, :datetime, access: :read
|
80
|
+
|
81
|
+
# Determine if the source_url attribute is required
|
82
|
+
#
|
83
|
+
def source_url_is_required?
|
84
|
+
delivery_method == Enums::DeliveryMethod::PULL
|
85
|
+
end
|
86
|
+
|
87
|
+
# Determine if the delivery type opitons is required
|
88
|
+
#
|
89
|
+
def delivery_type_is_required?
|
90
|
+
encoder == Enums::Encoder::WOWZA_STREAMING_ENGINE
|
91
|
+
end
|
92
|
+
|
93
|
+
# Determine if the hosted page option can be set
|
94
|
+
#
|
95
|
+
def hosted_page_access
|
96
|
+
self.new_model? ? :read_write : :read
|
97
|
+
end
|
98
|
+
|
99
|
+
# Since the source_url is a write only attribute, when we update the
|
100
|
+
# live stream the value is no longer present, so we will default it to
|
101
|
+
# the value returned in the source_connection_information attribute, if it
|
102
|
+
# is present.
|
103
|
+
#
|
104
|
+
def default_source_url
|
105
|
+
sci = (self.attributes[:source_connection_information] || {})
|
106
|
+
return sci[:source_url] if sci.has_key?(:source_url)
|
107
|
+
return nil
|
108
|
+
end
|
109
|
+
|
110
|
+
#---------------------------------------------------------------------------
|
111
|
+
# _ _ _
|
112
|
+
# /_\ __| |_(_)___ _ _ ___
|
113
|
+
# / _ \/ _| _| / _ \ ' \(_-<
|
114
|
+
# /_/ \_\__|\__|_\___/_||_/__/
|
115
|
+
#
|
116
|
+
#---------------------------------------------------------------------------
|
117
|
+
|
118
|
+
|
119
|
+
# Regenerates the connection code for the transcoder.
|
120
|
+
#
|
121
|
+
# @return [WscSdk::Models::TranscoderConnectionCode]
|
122
|
+
# The regenerated connection code information.
|
123
|
+
#
|
124
|
+
def regenerate_connection_code
|
125
|
+
return self.endpoint.regenerate_connection_code(self.id)
|
126
|
+
end
|
127
|
+
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
|
2
|
+
####> This code is licensed pursuant to the BSD 3-Clause License.
|
3
|
+
|
4
|
+
require 'wsc_sdk/model'
|
5
|
+
require 'wsc_sdk/models/transcoder_connection_code'
|
6
|
+
|
7
|
+
module WscSdk
|
8
|
+
module Models
|
9
|
+
|
10
|
+
# A model to represent the connection code of a Live Stream in the Wowza Streaming
|
11
|
+
# Cloud API.
|
12
|
+
#
|
13
|
+
class LiveStreamConnectionCode < WscSdk::Model
|
14
|
+
|
15
|
+
model_name_singular :live_stream
|
16
|
+
model_name_plural :live_streams
|
17
|
+
|
18
|
+
|
19
|
+
#---------------------------------------------------------------------------
|
20
|
+
# ___ _
|
21
|
+
# / __| __| |_ ___ _ __ __ _
|
22
|
+
# \__ \/ _| ' \/ -_) ' \/ _` |
|
23
|
+
# |___/\__|_||_\___|_|_|_\__,_|
|
24
|
+
#
|
25
|
+
#---------------------------------------------------------------------------
|
26
|
+
|
27
|
+
attribute :connection_code, :string, access: :read
|
28
|
+
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
|
2
|
+
####> This code is licensed pursuant to the BSD 3-Clause License.
|
3
|
+
|
4
|
+
require 'wsc_sdk/model'
|
5
|
+
require 'wsc_sdk/models/transcoder_state'
|
6
|
+
|
7
|
+
module WscSdk
|
8
|
+
module Models
|
9
|
+
|
10
|
+
# A model to represent the State of a Live Stream in the Wowza Streaming
|
11
|
+
# Cloud API.
|
12
|
+
#
|
13
|
+
class LiveStreamState < TranscoderState
|
14
|
+
|
15
|
+
model_name_singular :live_stream
|
16
|
+
model_name_plural :live_streams
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
|
2
|
+
####> This code is licensed pursuant to the BSD 3-Clause License.
|
3
|
+
|
4
|
+
require 'wsc_sdk/model'
|
5
|
+
require 'wsc_sdk/models/transcoder_stats'
|
6
|
+
|
7
|
+
module WscSdk
|
8
|
+
module Models
|
9
|
+
|
10
|
+
# A model to represent the Stats of a Live Stream in the Wowza Streaming
|
11
|
+
# Cloud API.
|
12
|
+
#
|
13
|
+
class LiveStreamStats < TranscoderStats
|
14
|
+
|
15
|
+
model_name_singular :live_stream
|
16
|
+
model_name_plural :live_streams
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
|
2
|
+
####> This code is licensed pursuant to the BSD 3-Clause License.
|
3
|
+
|
4
|
+
require 'wsc_sdk/model'
|
5
|
+
require 'wsc_sdk/models/transcoder_thumbnail_url'
|
6
|
+
|
7
|
+
module WscSdk
|
8
|
+
module Models
|
9
|
+
|
10
|
+
# A model to represent the Thumbnail URL of a Live Stream in the Wowza Streaming
|
11
|
+
# Cloud API.
|
12
|
+
#
|
13
|
+
class LiveStreamThumbnailUrl < TranscoderThumbnailUrl
|
14
|
+
|
15
|
+
model_name_singular :live_stream
|
16
|
+
model_name_plural :live_streams
|
17
|
+
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
####> This code and all components © 2015 – 2019 Wowza Media Systems, LLC. All rights reserved.
|
2
|
+
####> This code is licensed pursuant to the BSD 3-Clause License.
|
3
|
+
|
4
|
+
module WscSdk
|
5
|
+
module Models
|
6
|
+
|
7
|
+
# A model to repesent an Ouput in the Wowza Streaming Cloud API.
|
8
|
+
#
|
9
|
+
class Output < WscSdk::Model
|
10
|
+
|
11
|
+
model_name_singular :output
|
12
|
+
model_name_plural :outputs
|
13
|
+
|
14
|
+
|
15
|
+
#---------------------------------------------------------------------------
|
16
|
+
# ___ _
|
17
|
+
# / __| __| |_ ___ _ __ __ _
|
18
|
+
# \__ \/ _| ' \/ -_) ' \/ _` |
|
19
|
+
# |___/\__|_||_\___|_|_|_\__,_|
|
20
|
+
#
|
21
|
+
#---------------------------------------------------------------------------
|
22
|
+
|
23
|
+
attribute :id, :string, access: :read
|
24
|
+
attribute :name, :string, access: :read
|
25
|
+
attribute :transcoder_id, :string, access: :read
|
26
|
+
attribute :stream_format, :string
|
27
|
+
attribute :passthrough_video, :boolean
|
28
|
+
attribute :passthrough_audio, :boolean
|
29
|
+
attribute :aspect_ratio_height, :integer
|
30
|
+
attribute :aspect_ratio_width, :integer
|
31
|
+
attribute :bitrate_audio, :integer
|
32
|
+
attribute :bitrate_video, :integer
|
33
|
+
attribute :h264_profile, :string
|
34
|
+
attribute :framerate_reduction, :string
|
35
|
+
attribute :keyframes, :string
|
36
|
+
attribute :created_at, :datetime, access: :read
|
37
|
+
attribute :updated_at, :datetime, access: :read
|
38
|
+
|
39
|
+
#---------------------------------------------------------------------------
|
40
|
+
# _ _ _ _
|
41
|
+
# /_\ ______ ___ __(_)__ _| |_(_)___ _ _ ___
|
42
|
+
# / _ \ (_-<_-</ _ \/ _| / _` | _| / _ \ ' \(_-<
|
43
|
+
# /_/ \_\/__/__/\___/\__|_\__,_|\__|_\___/_||_/__/
|
44
|
+
#
|
45
|
+
#---------------------------------------------------------------------------
|
46
|
+
|
47
|
+
|
48
|
+
# Output Stream Targets endpoint for stream targets associated with the
|
49
|
+
# output.
|
50
|
+
#
|
51
|
+
# @return [WscSdk::Endpoints::OutputStreamTargets]
|
52
|
+
# An instance of the OutputStreamTargets endpoint, with the results
|
53
|
+
# limited to the outputs stream targets associted with this output.
|
54
|
+
#
|
55
|
+
def output_stream_targets
|
56
|
+
@output_stream_targets ||= WscSdk::Endpoints::OutputStreamTargets.new(endpoint.client, parent_path: endpoint.find_path(self.primary_key))
|
57
|
+
end
|
58
|
+
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|