Class: Yt::Models::Asset
Overview
Provides methods to interact with YouTube ContentID assets.
Constant Summary collapse
- STATUSES =
Status
%q(active inactive pending)
Instance Attribute Summary collapse
-
#auth ⇒ Object
readonly
Returns the value of attribute auth.
-
#ownership ⇒ Yt::Models::Ownership
readonly
The asset’s ownership.
Instance Method Summary collapse
-
#id ⇒ String
The ID that YouTube assigns and uses to uniquely identify the asset.
-
#initialize(options = {}) ⇒ Asset
constructor
A new instance of Asset.
-
#label ⇒ Array<Yt::Models::Tag>
The list of asset labels associated with the asset.
- #metadata_effective ⇒ Object
- #metadata_mine ⇒ Object
-
#type ⇒ String
The asset’s type.
- #update(attributes = {}) ⇒ Object
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 = {}) ⇒ Asset
Returns a new instance of Asset.
11 12 13 14 15 |
# File 'lib/yt/models/asset.rb', line 11 def initialize( = {}) @data = .fetch(:data, {}) @id = [:id] @auth = [:auth] end |
Instance Attribute Details
#auth ⇒ Object (readonly)
Returns the value of attribute auth.
9 10 11 |
# File 'lib/yt/models/asset.rb', line 9 def auth @auth end |
#ownership ⇒ Yt::Models::Ownership (readonly)
Returns the asset’s ownership.
25 |
# File 'lib/yt/models/asset.rb', line 25 has_one :ownership |
Instance Method Details
#id ⇒ String
Returns the ID that YouTube assigns and uses to uniquely identify the asset.
54 |
# File 'lib/yt/models/asset.rb', line 54 has_attribute :id |
#label ⇒ Array<Yt::Models::Tag>
Returns the list of asset labels associated with the asset. You can apply a label to multiple assets to group them. You can use the labels as search filters to perform bulk updates, to download reports, or to filter YouTube Analytics.
70 |
# File 'lib/yt/models/asset.rb', line 70 has_attribute :label |
#metadata_effective ⇒ Object
33 34 35 |
# File 'lib/yt/models/asset.rb', line 33 def @metadata_effective ||= Yt::Models::AssetMetadata.new data: @data.fetch('metadataEffective', {}) end |
#metadata_mine ⇒ Object
29 30 31 |
# File 'lib/yt/models/asset.rb', line 29 def @metadata_mine ||= Yt::Models::AssetMetadata.new data: @data.fetch('metadataMine', {}) end |
#type ⇒ String
Returns the asset’s type. This value determines the metadata fields that you can set for the asset. In addition, certain API functions may only be supported for specific types of assets. For example, composition assets may have more complex ownership data than other types of assets. Valid values for this property are: art_track_video, composition, episode, general, movie, music_video, season, show, sound_recording, video_game, and web.
64 |
# File 'lib/yt/models/asset.rb', line 64 has_attribute :type |
#update(attributes = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/yt/models/asset.rb', line 17 def update(attributes = {}) underscore_keys! attributes do_patch body: attributes true end |