Class: Yt::Models::Reference

Inherits:
Base
  • Object
show all
Defined in:
lib/yt/models/reference.rb

Overview

Provides methods to interact with YouTube ContentID references.

Instance Method Summary collapse

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(options = {})
  @data = options[:data]
  @id = options[:id]
  @auth = options[:auth]
end

Instance Method Details

#activating?Boolean

Returns whether the reference is pending.

Returns:

  • (Boolean)

    whether the reference is pending.


91
92
93
# File 'lib/yt/models/reference.rb', line 91

def activating?
  status == 'activating'
end

#active?Boolean

Returns whether the reference is active.

Returns:

  • (Boolean)

    whether the reference is active.


96
97
98
# File 'lib/yt/models/reference.rb', line 96

def active?
  status == 'active'
end

#asset_idString

Returns the ID that uniquely identifies the asset that the reference is associated with.

Returns:

  • (String)

    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 only the audio.

Returns:

  • (Boolean)

    whether the reference covers only the audio.


146
147
148
# File 'lib/yt/models/reference.rb', line 146

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.

Returns:

  • (boolean)

    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 both audio and video.

Returns:

  • (Boolean)

    whether the reference covers both audio and video.


156
157
158
# File 'lib/yt/models/reference.rb', line 156

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.

Returns:

  • (Boolean)

    whether the reference is being compared to existing references to identify any reference conflicts that might exist.


102
103
104
# File 'lib/yt/models/reference.rb', line 102

def checking?
  status == 'checking'
end

#claim_idString

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.

Returns:

  • (String)

    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.

Returns:

  • (Boolean)

    whether the reference’s fingerprint is being computed.


108
109
110
# File 'lib/yt/models/reference.rb', line 108

def computing_fingerprint?
  status == 'computing_fingerprint'
end

#content_typeString

Returns the audiovisual portion of the referenced content.

Returns:

  • (String)

    the audiovisual portion of the referenced content. Possible values are: 'audio', 'audiovisual', 'video'.


143
# File 'lib/yt/models/reference.rb', line 143

has_attribute :content_type

#deleteBoolean

Note:

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.

Returns:

  • (Boolean)

    whether the reference is inactive.


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.

Returns:

  • (Boolean)

    whether the reference is deleted.


113
114
115
# File 'lib/yt/models/reference.rb', line 113

def deleted?
  status == 'deleted'
end

#duplicate_leaderString

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.

Returns:

  • (String)

    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.

Returns:

  • (Boolean)

    whether the reference iis a duplicate and is on hold.


118
119
120
# File 'lib/yt/models/reference.rb', line 118

def duplicate_on_hold?
  status == 'duplicate_on_hold'
end

#idString

Returns the ID that YouTube assigns and uses to uniquely identify the reference.

Returns:

  • (String)

    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.

Returns:

  • (boolean)

    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.

Returns:

  • (Boolean)

    whether the reference is inactive.


123
124
125
# File 'lib/yt/models/reference.rb', line 123

def inactive?
  status == 'inactive'
end

#lengthFloat

Returns The length of the reference in seconds.

Returns:

  • (Float)

    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.

Returns:

  • (Boolean)

    whether the reference is being processed from a live video stream.


129
130
131
# File 'lib/yt/models/reference.rb', line 129

def live_streaming_processing?
  status == 'live_streaming_processing'
end

#statusString

Returns the reference’s status. Possible values are: 'activating', 'active', 'checking', 'computing_fingerprint', 'deleted', 'duplicate_on_hold', 'inactive', 'live_streaming_processing', 'urgent_reference_processing'.

Returns:

  • (String)

    the reference’s status. Possible values are: 'activating', 'active', 'checking', 'computing_fingerprint', 'deleted', 'duplicate_on_hold', 'inactive', 'live_streaming_processing', 'urgent_reference_processing'.


88
# File 'lib/yt/models/reference.rb', line 88

has_attribute :status

#status_reasonString

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.

Returns:

  • (String)

    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.

Returns:

  • (Boolean)

    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.

Returns:

  • (Boolean)

    whether the reference is urgent_reference_processing.


134
135
136
# File 'lib/yt/models/reference.rb', line 134

def urgent_reference_processing?
  status == 'urgent_reference_processing'
end

#video?Boolean

Returns whether the reference covers only the video.

Returns:

  • (Boolean)

    whether the reference covers only the video.


151
152
153
# File 'lib/yt/models/reference.rb', line 151

def video?
  content_type == 'video'
end

#video_idString

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.

Returns:

  • (String)

    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