Class: Yt::Models::ContentOwner
- Defined in:
- lib/yt/models/content_owner.rb
Overview
Provides methods to interact with YouTube CMS accounts.
Instance Attribute Summary collapse
-
#assets ⇒ Yt::Collection::Assets
readonly
The assets administered by the content owner.
-
#bulk_report_jobs ⇒ Yt::Collections::BulkReportJobs
readonly
The bulk reporting jobs managed by the content owner.
-
#claims ⇒ Yt::Collections::Claims
readonly
The claims administered by the content owner.
-
#display_name ⇒ String
readonly
The display name of the content owner.
-
#partnered_channels ⇒ Yt::Collections::PartneredChannels
readonly
The channels managed by the CMS account.
-
#policies ⇒ Yt::Collections::Policies
readonly
The policies saved by the content owner.
-
#references ⇒ Yt::Collections::References
readonly
The references administered by the content owner.
-
#video_groups ⇒ Yt::Collections::VideoGroups
readonly
The video-groups managed by the content owner.
Attributes inherited from Account
#channel, #content_owners, #email, #family_name, #given_name, #id, #name, #owner_name, #playlists, #related_playlists, #subscribed_channels, #subscribers, #videos
Instance Method Summary collapse
- #create_asset(params = {}) ⇒ Object
- #create_claim(params = {}) ⇒ Object
- #create_reference(params = {}) ⇒ Object
-
#initialize(options = {}) ⇒ ContentOwner
constructor
A new instance of ContentOwner.
- #insert_playlist_item_params ⇒ Object
- #playlist_items_params ⇒ Object
- #update_playlist_params ⇒ Object
- #update_video_params ⇒ Object
-
#upload_reference_file(path_or_url, params = {}) ⇒ Yt::Models::Reference
Uploads a reference file to YouTube.
- #upload_thumbnail_params ⇒ Object
Methods inherited from Account
#avatar_url, #create_playlist, #delete_playlists, #gender, #has_verified_email?, #hd, #locale, #profile_url, #upload_video
Constructor Details
#initialize(options = {}) ⇒ ContentOwner
Returns a new instance of ContentOwner.
43 44 45 46 47 |
# File 'lib/yt/models/content_owner.rb', line 43 def initialize( = {}) super @owner_name = [:owner_name] @display_name = [:display_name] end |
Instance Attribute Details
#assets ⇒ Yt::Collection::Assets (readonly)
Returns the assets administered by the content owner.
20 |
# File 'lib/yt/models/content_owner.rb', line 20 has_many :assets |
#bulk_report_jobs ⇒ Yt::Collections::BulkReportJobs (readonly)
Returns the bulk reporting jobs managed by the content owner.
41 |
# File 'lib/yt/models/content_owner.rb', line 41 has_many :bulk_report_jobs |
#claims ⇒ Yt::Collections::Claims (readonly)
Returns the claims administered by the content owner.
16 |
# File 'lib/yt/models/content_owner.rb', line 16 has_many :claims |
#display_name ⇒ String (readonly)
Returns The display name of the content owner.
31 32 33 |
# File 'lib/yt/models/content_owner.rb', line 31 def display_name @display_name end |
#partnered_channels ⇒ Yt::Collections::PartneredChannels (readonly)
Returns the channels managed by the CMS account.
12 |
# File 'lib/yt/models/content_owner.rb', line 12 has_many :partnered_channels |
#policies ⇒ Yt::Collections::Policies (readonly)
Returns the policies saved by the content owner.
28 |
# File 'lib/yt/models/content_owner.rb', line 28 has_many :policies |
#references ⇒ Yt::Collections::References (readonly)
Returns the references administered by the content owner.
24 |
# File 'lib/yt/models/content_owner.rb', line 24 has_many :references |
#video_groups ⇒ Yt::Collections::VideoGroups (readonly)
Returns the video-groups managed by the content owner.
36 |
# File 'lib/yt/models/content_owner.rb', line 36 has_many :video_groups |
Instance Method Details
#create_asset(params = {}) ⇒ Object
69 70 71 |
# File 'lib/yt/models/content_owner.rb', line 69 def create_asset(params = {}) assets.insert params end |
#create_claim(params = {}) ⇒ Object
73 74 75 |
# File 'lib/yt/models/content_owner.rb', line 73 def create_claim(params = {}) claims.insert params end |
#create_reference(params = {}) ⇒ Object
65 66 67 |
# File 'lib/yt/models/content_owner.rb', line 65 def create_reference(params = {}) references.insert params end |
#insert_playlist_item_params ⇒ Object
122 123 124 |
# File 'lib/yt/models/content_owner.rb', line 122 def insert_playlist_item_params {on_behalf_of_content_owner: @owner_name} end |
#playlist_items_params ⇒ Object
106 107 108 |
# File 'lib/yt/models/content_owner.rb', line 106 def playlist_items_params {on_behalf_of_content_owner: @owner_name} end |
#update_playlist_params ⇒ Object
114 115 116 |
# File 'lib/yt/models/content_owner.rb', line 114 def update_playlist_params {on_behalf_of_content_owner: @owner_name} end |
#update_video_params ⇒ Object
110 111 112 |
# File 'lib/yt/models/content_owner.rb', line 110 def update_video_params {on_behalf_of_content_owner: @owner_name} end |
#upload_reference_file(path_or_url, params = {}) ⇒ Yt::Models::Reference
Uploads a reference file to YouTube.
56 57 58 59 60 61 62 63 |
# File 'lib/yt/models/content_owner.rb', line 56 def upload_reference_file(path_or_url, params = {}) file = open path_or_url, 'rb' session = resumable_sessions.insert file.size, params session.update(body: file) do |data| Yt::Reference.new id: data['id'], data: data, auth: self end end |
#upload_thumbnail_params ⇒ Object
118 119 120 |
# File 'lib/yt/models/content_owner.rb', line 118 def upload_thumbnail_params {on_behalf_of_content_owner: @owner_name} end |