Class: Yt::Models::Reference
Overview
Provides methods to interact with YouTube ContentID references.
Constant Summary collapse
- STATUSES =
Status
%q(activating active checking computing_fingerprint deleted duplicate_on_hold inactive live_streaming_processing urgent_reference_processing)
- CONTENT_TYPES =
Content Type
%q(audio video audiovisual)
Instance Method Summary collapse
-
#activating? ⇒ Boolean
Whether the reference is pending.
-
#active? ⇒ Boolean
Whether the reference is active.
-
#asset_id ⇒ String
The ID that uniquely identifies the asset that the reference is associated with.
-
#audio? ⇒ Boolean
Whether the reference covers the audio of the content.
-
#audioswap_enabled? ⇒ boolean
Whether or not the reference content is included in YouTube’s AudioSwap program.
-
#audiovisual? ⇒ Boolean
Whether the reference covers the audiovisual of the content.
-
#checking? ⇒ Boolean
Whether the reference is being compared to existing references to identify any reference conflicts that might exist.
-
#claim_id ⇒ String
The claim ID that represents the resulting association between the asset and the video.
-
#computing_fingerprint? ⇒ Boolean
Whether the reference’s fingerprint is being computed.
-
#content_type ⇒ String
Whether the reference covers the audio, video, or audiovisual portion of the claimed content.
-
#delete ⇒ Boolean
Soft-deletes the reference.
-
#deleted? ⇒ Boolean
Whether the reference is deleted.
-
#duplicate_leader ⇒ String
The ID that uniquely identifies the reference that this reference duplicates.
-
#duplicate_on_hold? ⇒ Boolean
Whether the reference iis a duplicate and is on hold.
-
#id ⇒ String
The ID that YouTube assigns and uses to uniquely identify the reference.
-
#ignore_fp_match? ⇒ boolean
Should the reference be used to generate claims.
-
#inactive? ⇒ Boolean
Whether the reference is inactive.
-
#initialize(options = {}) ⇒ Reference
constructor
A new instance of Reference.
-
#length ⇒ Float
The length of the reference in seconds.
-
#live_streaming_processing? ⇒ Boolean
Whether the reference is being processed from a live video stream.
-
#status ⇒ String
The reference’s status.
-
#status_reason ⇒ String
An explanation of how a reference entered its current state.
-
#urgent? ⇒ Boolean
The urgent status of the reference file.
-
#urgent_reference_processing? ⇒ Boolean
Whether the reference is urgent_reference_processing.
-
#video? ⇒ Boolean
Whether the reference covers the video of the content.
-
#video_id ⇒ String
The ID of the source video.
Methods included from Associations::HasReports
Methods included from Associations::HasViewerPercentages
Methods included from Associations::HasOne
Methods included from Associations::HasMany
Methods included from Associations::HasAuthentication
Constructor Details
#initialize(options = {}) ⇒ Reference
Returns a new instance of Reference.
8 9 10 11 12 |
# File 'lib/yt/models/reference.rb', line 8 def initialize( = {}) @data = [:data] @id = [:id] @auth = [:auth] end |
Instance Method Details
#activating? ⇒ Boolean
Returns whether the reference is pending.
94 95 96 |
# File 'lib/yt/models/reference.rb', line 94 def activating? status == 'activating' end |
#active? ⇒ Boolean
Returns whether the reference is active.
99 100 101 |
# File 'lib/yt/models/reference.rb', line 99 def active? status == 'active' end |
#asset_id ⇒ String
Returns the ID that uniquely identifies the asset that the reference is associated with.
33 |
# File 'lib/yt/models/reference.rb', line 33 has_attribute :asset_id |
#audio? ⇒ Boolean
Returns whether the reference covers the audio of the content.
152 153 154 |
# File 'lib/yt/models/reference.rb', line 152 def audio? content_type == 'audio' end |
#audioswap_enabled? ⇒ boolean
Returns whether or not the reference content is included in YouTube’s AudioSwap program. Set this field’s value to true to indicate that the reference content should be included in YouTube’s AudioSwap program.
55 |
# File 'lib/yt/models/reference.rb', line 55 has_attribute :audioswap_enabled?, from: :audioswap_enabled |
#audiovisual? ⇒ Boolean
Returns whether the reference covers the audiovisual of the content.
164 165 166 |
# File 'lib/yt/models/reference.rb', line 164 def audiovisual? content_type == 'audiovisual' end |
#checking? ⇒ Boolean
Returns whether the reference is being compared to existing references to identify any reference conflicts that might exist.
105 106 107 |
# File 'lib/yt/models/reference.rb', line 105 def checking? status == 'checking' end |
#claim_id ⇒ String
Returns the claim ID that represents the resulting association between the asset and the video. This field is only present if the reference was created by associating an asset with an existing YouTube video that was uploaded to a YouTube channel linked to your CMS account.
49 |
# File 'lib/yt/models/reference.rb', line 49 has_attribute :claim_id |
#computing_fingerprint? ⇒ Boolean
Returns whether the reference’s fingerprint is being computed.
111 112 113 |
# File 'lib/yt/models/reference.rb', line 111 def computing_fingerprint? status == 'computing_fingerprint' end |
#content_type ⇒ String
Returns whether the reference covers the audio, video, or audiovisual portion of the claimed content. Valid values are: audio, audiovisual, video.
148 |
# File 'lib/yt/models/reference.rb', line 148 has_attribute :content_type |
#delete ⇒ Boolean
YouTube API does not provide a delete
method for the Reference resource, but only an update
method. Updating the status
of a Reference to “inactive” can be considered a soft-deletion, since it allows to successively create new references for the same claim.
Soft-deletes the reference.
21 22 23 24 25 |
# File 'lib/yt/models/reference.rb', line 21 def delete body = {id: id, status: :inactive} do_update(body: body) {|data| @data = data} inactive? end |
#deleted? ⇒ Boolean
Returns whether the reference is deleted.
116 117 118 |
# File 'lib/yt/models/reference.rb', line 116 def deleted? status == 'deleted' end |
#duplicate_leader ⇒ String
Returns The ID that uniquely identifies the reference that this reference duplicates. This field is only present if the reference’s status is duplicate_on_hold.
80 |
# File 'lib/yt/models/reference.rb', line 80 has_attribute :duplicate_leader |
#duplicate_on_hold? ⇒ Boolean
Returns whether the reference iis a duplicate and is on hold.
121 122 123 |
# File 'lib/yt/models/reference.rb', line 121 def duplicate_on_hold? status == 'duplicate_on_hold' end |
#id ⇒ String
Returns the ID that YouTube assigns and uses to uniquely identify the reference.
29 |
# File 'lib/yt/models/reference.rb', line 29 has_attribute :id |
#ignore_fp_match? ⇒ boolean
Returns should the reference be used to generate claims. Set this value to true to indicate that the reference should not be used to generate claims. This field is only used on AudioSwap references.
60 |
# File 'lib/yt/models/reference.rb', line 60 has_attribute :ignore_fp_match?, from: :ignore_fp_match |
#inactive? ⇒ Boolean
Returns whether the reference is inactive.
126 127 128 |
# File 'lib/yt/models/reference.rb', line 126 def inactive? status == 'inactive' end |
#length ⇒ Float
Returns The length of the reference in seconds.
36 |
# File 'lib/yt/models/reference.rb', line 36 has_attribute :length |
#live_streaming_processing? ⇒ Boolean
Returns whether the reference is being processed from a live video stream.
132 133 134 |
# File 'lib/yt/models/reference.rb', line 132 def live_streaming_processing? status == 'live_streaming_processing' end |
#status ⇒ String
Returns the reference’s status. Valid values are: activating, active, checking, computing_fingerprint, deleted, duplicate_on_hold, inactive, live_streaming_processing, and urgent_reference_processing.
91 |
# File 'lib/yt/models/reference.rb', line 91 has_attribute :status |
#status_reason ⇒ String
Returns An explanation of how a reference entered its current state. This value is only present if the reference’s status is either inactive or deleted.
75 |
# File 'lib/yt/models/reference.rb', line 75 has_attribute :status_reason |
#urgent? ⇒ Boolean
Returns the urgent status of the reference file. Set this value to true to indicate that YouTube should prioritize Content ID processing for a video file. YouTube processes urgent video files before other files that are not marked as urgent. This setting is primarily used for videos of live events or other videos that require time-sensitive processing. The sooner YouTube completes Content ID processing for a video, the sooner YouTube can match user-uploaded videos to that video.
70 |
# File 'lib/yt/models/reference.rb', line 70 has_attribute :urgent?, from: :urgent |
#urgent_reference_processing? ⇒ Boolean
Returns whether the reference is urgent_reference_processing.
137 138 139 |
# File 'lib/yt/models/reference.rb', line 137 def urgent_reference_processing? status == 'urgent_reference_processing' end |
#video? ⇒ Boolean
Returns whether the reference covers the video of the content.
158 159 160 |
# File 'lib/yt/models/reference.rb', line 158 def video? content_type == 'video' end |
#video_id ⇒ String
Returns the ID of the source video. This field is only present if the reference was created by associating an asset with an existing YouTube video that was uploaded to a YouTube channel linked to your CMS account.
42 |
# File 'lib/yt/models/reference.rb', line 42 has_attribute :video_id |