module Zype class Playlists < Zype::BaseModel # Returns videos for a playlist # # @param id [String] the ID of the playlist # @return [Array] an array of video objects def videos(id:) client.execute(method: :get, path: "/playlists/#{id}/videos") end # Adds videos to a playlist # # @param id [String] the ID of the playlist # @param video_ids [Array] the video IDs to add to the playlist # @return [Array] an array of video objects def add_videos(id:, video_ids:) client.execute(method: :put, path: "/playlists/#{id}/add_videos", params: { video_id: video_ids }) end # Removes videos from a playlist # # @param id [String] the ID of the playlist # @param video_ids [Array] the video IDs to remove to the playlist # @return [Array] an array of video objects def remove_videos(id:, video_ids:) client.execute(method: :put, path: "/playlists/#{id}/remove_videos", params: { video_id: video_ids }) end # Returns all playlists from the API # # @return [Array] all playlists in relational order def relationships client.execute(method: :get, path: '/playlists/relationships') end end end