Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add vimeo.videos.embed.setPrivacy to Advanced API #47

Merged
merged 3 commits into from
Sep 13, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ Some methods have optional variables. Pass these as a hash at the end of a call.

video_embed.get_presets({ :page => "1", :per_page => "25" })
video_embed.set_preset("video_id", "preset_id")
video_embed.set_privacy("video_id", "privacy", { :approved_domains => ["example.com"].to_json })

## Uploads

Expand Down
6 changes: 6 additions & 0 deletions lib/vimeo/advanced/video_embed.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ class VideoEmbed < Vimeo::Advanced::Base
"vimeo.videos.embed.setPreset",
:required => [:video_id, :preset_id]

# Sets the privacy for a video embed.
create_api_method :set_privacy,
"vimeo.videos.embed.setPrivacy",
:required => [:video_id, :privacy],
:optional => [:approved_domains]

end # VideoEmbed
end # Advanced
end # Vimeo
4 changes: 4 additions & 0 deletions test/fixtures/advanced/video_embed/set_privacy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"generated_in":"0.4800",
"stat":"ok"
}
9 changes: 8 additions & 1 deletion test/vimeo/advanced/videos_embed_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,12 @@ class VideoEmbedTest < Test::Unit::TestCase
assert_equal "ok", response["stat"]
end

should "be able to set the privacy for a video embed" do
stub_post("?privacy=privacy&video_id=video_id&api_key=12345&format=json&method=vimeo.video.embed.setPrivacy&auth_token=token&api_sig=29c01ef0013d2e0aa1d0dbd3fd19b8cc", "advanced/video_embed/set_privacy.json")
response = @video_embed.set_privacy("video_id", "privacy")

assert_equal "ok", response["stat"]
end

end
end
end
1 change: 1 addition & 0 deletions vimeo.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ Gem::Specification.new do |s|
"test/fixtures/advanced/video/set_title.json",
"test/fixtures/advanced/video_embed/get_presets.json",
"test/fixtures/advanced/video_embed/set_preset.json",
"test/fixtures/advanced/video_embed/set_privacy.json",
"test/fixtures/simple/activity/contacts_did.json",
"test/fixtures/simple/activity/everyone_did.json",
"test/fixtures/simple/activity/happened_to_contacts.json",
Expand Down