class Yt::Models::ContentOwner
Provides methods to interact with YouTube CMS accounts. @see cms.youtube.com @see developers.google.com/youtube/analytics/v1/content_owner_reports
Attributes
@return [String] The display name of the content owner.
Public Class Methods
Source
# File lib/yt/models/content_owner.rb, line 43 def initialize(options = {}) super options @owner_name = options[:owner_name] @display_name = options[:display_name] end
Yt::Models::Account::new
Public Instance Methods
Source
# File lib/yt/models/content_owner.rb, line 69 def create_asset(params = {}) assets.insert params end
Source
# File lib/yt/models/content_owner.rb, line 73 def create_claim(params = {}) claims.insert params end
Source
# File lib/yt/models/content_owner.rb, line 65 def create_reference(params = {}) references.insert params end
Source
# File lib/yt/models/content_owner.rb, line 122 def insert_playlist_item_params {on_behalf_of_content_owner: @owner_name} end
Source
# File lib/yt/models/content_owner.rb, line 106 def playlist_items_params {on_behalf_of_content_owner: @owner_name} end
Source
# File lib/yt/models/content_owner.rb, line 114 def update_playlist_params {on_behalf_of_content_owner: @owner_name} end
Source
# File lib/yt/models/content_owner.rb, line 110 def update_video_params {on_behalf_of_content_owner: @owner_name} end
Source
# File lib/yt/models/content_owner.rb, line 95 def upload_params {part: 'snippet,status', on_behalf_of_content_owner: self.owner_name} end
@private Tells ‘has_many :resumable_sessions` what params are set for the object associated to the uploaded file.
Source
# File lib/yt/models/content_owner.rb, line 81 def upload_path '/upload/youtube/partner/v1/references' end
@private Tells ‘has_many :resumable_sessions` what path to hit to upload a file.
Source
# File lib/yt/models/content_owner.rb, line 56 def upload_reference_file(path_or_url, params = {}) file = URI.open(path_or_url) 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
Uploads a reference file to YouTube. @param [String] path_or_url is the video or audio file to upload. Can either be the
path of a local file or the URL of a remote file.
@param [Hash] params the metadata to add to the uploaded reference. @option params [String] :asset_id The id of the asset the uploaded reference belongs to. @option params [String] :content_type The type of content being uploaded. @return [Yt::Models::Reference] the newly uploaded reference.
Source
# File lib/yt/models/content_owner.rb, line 118 def upload_thumbnail_params {on_behalf_of_content_owner: @owner_name} end
Source
# File lib/yt/models/content_owner.rb, line 102 def video_groups_params {on_behalf_of_content_owner: @owner_name} end
@private Tells ‘has_many :video_groups` that content_owner.video_groups should return all the video-groups *on behalf of* the content owner
Source
# File lib/yt/models/content_owner.rb, line 88 def videos_params {for_content_owner: true, on_behalf_of_content_owner: @owner_name} end
@private Tells ‘has_many :videos` that account.videos should return all the videos *on behalf of* the content owner (public, private, unlisted).