-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Claims#list and ClaimSearch#list
- Loading branch information
Showing
5 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Yt | ||
module Collections | ||
class ClaimSearches < Base | ||
|
||
private | ||
|
||
def new_item(data) | ||
Yt::Models::Claim.new data: data | ||
end | ||
|
||
# @return [Hash] the parameters to submit to YouTube to list claims that match the search criteria. | ||
# @see https://developers.google.com/youtube/partner/docs/v1/claimSearch/list | ||
def list_params | ||
super.tap do |params| | ||
params[:path] = "/youtube/partner/v1/claimSearch" | ||
params[:params] = {onBehalfOfContentOwner: @parent.owner_name}.merge(@extra_params || {}) | ||
end | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Yt | ||
module Collections | ||
class Claims < Base | ||
|
||
private | ||
|
||
def new_item(data) | ||
Yt::Models::Claim.new data: data | ||
end | ||
|
||
# @return [Hash] the parameters to submit to YouTube to list claims administered by the content owner. | ||
# @see https://developers.google.com/youtube/partner/docs/v1/claims/list | ||
def list_params | ||
super.tap do |params| | ||
params[:path] = "/youtube/partner/v1/claims" | ||
params[:params] = {onBehalfOfContentOwner: @parent.owner_name}.merge(@extra_params || {}) | ||
end | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
require 'yt/models/resource' | ||
|
||
module Yt | ||
module Models | ||
class Claim < Base | ||
def initialize(options = {}) | ||
@data = options[:data] | ||
end | ||
|
||
def id | ||
@data["id"] | ||
end | ||
|
||
def asset_id | ||
@data["assetId"] | ||
end | ||
|
||
def video_id | ||
@data["videoId"] | ||
end | ||
|
||
def status | ||
@data["status"] | ||
end | ||
|
||
def policy | ||
@data["policy"] | ||
end | ||
|
||
def content_type | ||
@data["contentType"] | ||
end | ||
|
||
def time_created | ||
@data["timeCreated"] | ||
end | ||
|
||
def block_outside_ownership | ||
@data["blockOutsideOwnership"] | ||
end | ||
|
||
def origin | ||
@data["origin"] | ||
end | ||
|
||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters