class Yt::Models::MatchPolicy

Provides methods to interact with YouTube ContentID asset match policies, which YouTube applies to user-uploaded videos that match the asset. @see developers.google.com/youtube/partner/docs/v1/assetMatchPolicy

Public Class Methods

new(options = {}) click to toggle source
# File lib/yt/models/match_policy.rb, line 9
def initialize(options = {})
  @asset_id = options[:asset_id]
  @auth = options[:auth]
end

Public Instance Methods

update(attributes = {}) click to toggle source
# File lib/yt/models/match_policy.rb, line 14
def update(attributes = {})
  underscore_keys! attributes
  do_update body: attributes.slice(:policy_id)
  true
end

Private Instance Methods

update_params() click to toggle source

@see developers.google.com/youtube/partner/docs/v1/assetMatchPolicy/update

Calls superclass method Yt::Actions::Update#update_params
# File lib/yt/models/match_policy.rb, line 23
def update_params
  super.tap do |params|
    params[:path] = "/youtube/partner/v1/assets/#{@asset_id}/matchPolicy"
    params[:params] = {on_behalf_of_content_owner: @auth.owner_name}
    params[:expected_response] = Net::HTTPOK
  end
end