vimeo

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2016 License: MIT Imports: 15 Imported by: 0

README

Build Status GoDoc codecov Go Report Card

go-vimeo

go-vimeo is a Go client library for accessing the Vimeo API.

Basic usage

import "github.com/silentsokolov/go-vimeo"


func main() {
    client := vimeo.NewClient(nil)

    // Specific optional parameters
	opt := &vimeo.ListCategoryOptions{
		ListOptions: vimeo.ListOptions{Page: 1, PerPage: 2},
	}

	cats, _, err := client.Categories.List(opt)
}
Authentication

The go-vimeo library does not directly handle authentication. Instead, when creating a new client, pass an http.Client that can handle authentication for you, for example the oauth2.

import (
	"golang.org/x/oauth2"
	"github.com/silentsokolov/go-vimeo"
)

func main() {
    ts := oauth2.StaticTokenSource(
        &oauth2.Token{AccessToken: "... your access token ..."},
    )
    tc := oauth2.NewClient(oauth2.NoContext, ts)

    client := vimeo.NewClient(tc)

    cats, _, err := client.Categories.List(nil)
}
Pagination
func main() {
    client := ...

    // Specific optional parameters
	opt := &vimeo.ListCategoryOptions{
		ListOptions: vimeo.ListOptions{Page: 2, PerPage: 2},
	}

	// Any "List" request
	_, resp, _ := client.Categories.List(opt)

	fmt.Printf("Current page: %d\n", resp.Page)
	fmt.Printf("Next page: %s\n", resp.NextPage)
	fmt.Printf("Prev page: %s\n", resp.PrevPage)
	fmt.Printf("Total pages: %d\n", resp.TotalPages)
}
Created/Updated request
func main() {
    client := ...

    // Specific request instance
    req := &vimeo.ChannelRequest{
        Name:        "My Channel",
        Description: "Awesome",
        Privacy:     "anybody",
    }

    ch, _, _ := client.Channels.Create(req)

    fmt.Println(ch)
}
Where "Me" service?

The "Me" service repeats the "Users" service, passing the empty string will authenticated user.

func main() {
    client := ...

    // Call /me API method.
    // Return current authenticated user.
    me, _, _ := client.Users.Get("")

    fmt.Println(me)
}
Upload video
import (
	"os"

	"golang.org/x/oauth2"
	"github.com/silentsokolov/go-vimeo"
)

func main() {
    client := ...
    filePath := "/Users/user/Videos/Awesome.mp4"

    f, _ := os.Open(filePath)

    video, resp, _ := client.Users.UploadVideo("", f)

    fmt.Println(video, resp)
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. API error responses are expected to have either no response body, or a JSON response body that maps to ErrorResponse. Any other response body will be silently ignored.

Types

type Album

type Album struct {
	URI          string    `json:"uri,omitempty"`
	Name         string    `json:"name,omitempty"`
	Description  string    `json:"description,omitempty"`
	Link         string    `json:"link,omitempty"`
	Duration     int       `json:"duration,omitempty"`
	CreatedTime  time.Time `json:"created_time,omitempty"`
	ModifiedTime time.Time `json:"modified_time,omitempty"`
	User         *User     `json:"user,omitempty"`
	Pictures     *Pictures `json:"pictures,omitempty"`
	Privacy      *Privacy  `json:"privacy,omitempty"`
}

Album represents a album.

type AlbumRequest

type AlbumRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Privacy     string `json:"privacy,omitempty"`
	Password    string `json:"password,omitempty"`
	Sort        string `json:"sort,omitempty"`
}

AlbumRequest represents a request to create/edit an album.

type App

type App struct {
	URI  string `json:"uri,omitempty"`
	Name string `json:"name,omitempty"`
}

App internal object provides access to specific app.

type Buttons

type Buttons struct {
	Like       bool `json:"like"`
	WatchLater bool `json:"watchlater"`
	Share      bool `json:"share"`
	Embed      bool `json:"embed"`
	Vote       bool `json:"vote"`
	HD         bool `json:"HD"`
}

Buttons internal object embed settings.

type CategoriesService

type CategoriesService service

CategoriesService handles communication with the categories related methods of the Vimeo API.

Vimeo API docs: https://developer.vimeo.com/api/endpoints/categories

func (*CategoriesService) Get

func (s *CategoriesService) Get(cat string) (*Category, *Response, error)

Get specific category by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/categories/%7Bcategory%7D

func (*CategoriesService) GetVideo

func (s *CategoriesService) GetVideo(cat string, vid int) (*Video, *Response, error)

GetVideo specific video by category name and video ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/categories/%7Bcategory%7D/videos/%7Bvideo_id%7D

func (*CategoriesService) List

List the category.

Vimeo API docs: https://developer.vimeo.com/api/playground/categories

func (*CategoriesService) ListChannel

func (s *CategoriesService) ListChannel(cat string, opt *ListChannelOptions) ([]*Channel, *Response, error)

ListChannel lists the channel for an category.

Vimeo API docs: https://developer.vimeo.com/api/playground/categories/%7Bcategory%7D/channels

func (*CategoriesService) ListGroup

func (s *CategoriesService) ListGroup(cat string, opt *ListGroupOptions) ([]*Group, *Response, error)

ListGroup lists the group for an category.

Vimeo API docs: https://developer.vimeo.com/api/playground/categories/%7Bcategory%7D/groups

func (*CategoriesService) ListVideo

func (s *CategoriesService) ListVideo(cat string, opt *ListVideoOptions) ([]*Video, *Response, error)

ListVideo lists the video for an category.

Vimeo API docs: https://developer.vimeo.com/api/playground/categories/%7Bcategory%7D/videos

type Category

type Category struct {
	URI                   string         `json:"uri,omitempty"`
	Link                  string         `json:"link,omitempty"`
	Name                  string         `json:"name,omitempty"`
	TopLevel              bool           `json:"top_level"`
	Pictures              *Pictures      `json:"pictures,omitempty"`
	LastVideoFeaturedTime string         `json:"last_video_featured_time,omitempty"`
	Parent                string         `json:"parent,omitempty"`
	SubCategories         []*SubCategory `json:"subcategories,omitempty"`
	ResourceKey           string         `json:"resource_key,omitempty"`
}

Category represents a category.

type Channel

type Channel struct {
	URI          string    `json:"uri,omitempty"`
	Name         string    `json:"name,omitempty"`
	Description  string    `json:"description,omitempty"`
	Link         string    `json:"link,omitempty"`
	CreatedTime  time.Time `json:"created_time,omitempty"`
	ModifiedTime time.Time `json:"modified_time,omitempty"`
	User         *User     `json:"user,omitempty"`
	Pictures     *Pictures `json:"pictures,omitempty"`
	Header       *Header   `json:"header,omitempty"`
	Privacy      *Privacy  `json:"privacy,omitempty"`
	ResourceKey  string    `json:"resource_key,omitempty"`
}

Channel represents a channel.

func (Channel) GetID

func (c Channel) GetID() string

GetID returns the identifier (ID) of the channel.

type ChannelRequest

type ChannelRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
	Privacy     string `json:"privacy,omitempty"`
}

ChannelRequest represents a request to create/edit an channel.

type ChannelsService

type ChannelsService service

ChannelsService handles communication with the channels related methods of the Vimeo API.

Vimeo API docs: https://developer.vimeo.com/api/endpoints/channels

func (*ChannelsService) AddVideo

func (s *ChannelsService) AddVideo(ch string, vid int) (*Response, error)

AddVideo add video to channel by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels/%7Bchannel_id%7D/videos/%7Bvideo_id%7D

func (*ChannelsService) Create

func (s *ChannelsService) Create(r *ChannelRequest) (*Channel, *Response, error)

Create a new channel.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels

func (*ChannelsService) Delete

func (s *ChannelsService) Delete(ch string) (*Response, error)

Delete specific channel by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels/%7Bchannel_id%7D

func (*ChannelsService) DeleteVideo

func (s *ChannelsService) DeleteVideo(ch string, vid int) (*Response, error)

DeleteVideo specific video by channel name and video ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels/%7Bchannel_id%7D/videos/%7Bvideo_id%7D

func (*ChannelsService) Edit

Edit specific channel by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels/%7Bchannel_id%7D

func (*ChannelsService) Get

func (s *ChannelsService) Get(ch string) (*Channel, *Response, error)

Get specific channel by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels/%7Bchannel_id%7D

func (*ChannelsService) GetVideo

func (s *ChannelsService) GetVideo(ch string, vid int) (*Video, *Response, error)

GetVideo specific video by channel name and video ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels/%7Bchannel_id%7D/videos/%7Bvideo_id%7D

func (*ChannelsService) List

List lists the channel for an category.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels

func (*ChannelsService) ListUser

func (s *ChannelsService) ListUser(ch string, opt *ListUserOptions) ([]*User, *Response, error)

ListUser lists the user for an channel.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels/%7Bchannel_id%7D/users

func (*ChannelsService) ListVideo

func (s *ChannelsService) ListVideo(ch string, opt *ListVideoOptions) ([]*Video, *Response, error)

ListVideo lists the video for an channel.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels/%7Bchannel_id%7D/videos

type Client

type Client struct {
	BaseURL *url.URL

	UserAgent string

	// Services used for communicating with the API
	Categories      *CategoriesService
	Channels        *ChannelsService
	ContentRatings  *ContentRatingsService
	CreativeCommons *CreativeCommonsService
	Groups          *GroupsService
	Languages       *LanguagesService
	Tags            *TagsService
	Videos          *VideosService
	Users           *UsersService
	// contains filtered or unexported fields
}

Client manages communication with Vimeo API.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new Vimeo API client. If a nil httpClient is provided, http.DefaultClient will be used. To use API methods which require authentication, provide an http.Client that will perform the authentication for you (such as that provided by the golang.org/x/oauth2 library).

func (*Client) Client

func (c *Client) Client() *http.Client

Client returns the HTTP client configured for this client.

func (*Client) Do

func (c *Client) Do(req *http.Request, v interface{}) (*Response, error)

Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

NewRequest creates an API request.

func (*Client) NewUploadRequest

func (c *Client) NewUploadRequest(url string, file *os.File, size, lastByte int64) (*http.Request, error)

NewUploadRequest creates an upload request.

type Comment

type Comment struct {
	URI         string `json:"uri,omitempty"`
	Type        string `json:"type,omitempty"`
	Text        string `json:"text,omitempty"`
	CreatedOn   string `json:"created_on,omitempty"`
	User        *User  `json:"user,omitempty"`
	ResourceKey string `json:"resource_key,omitempty"`
}

Comment represents a comment.

type CommentRequest

type CommentRequest struct {
	Text string `json:"text,omitempty"`
}

CommentRequest represents a request to create/edit an comment.

type ContentRating

type ContentRating struct {
	Code string `json:"code,omitempty"`
	Name string `json:"name,omitempty"`
}

ContentRating represents a content rating.

type ContentRatingsService

type ContentRatingsService service

ContentRatingsService handles communication with the content ratings related methods of the Vimeo API.

Vimeo API docs: https://developer.vimeo.com/api/endpoints/contentratings

func (*ContentRatingsService) List

List the content rating.

Vimeo API docs: https://developer.vimeo.com/api/playground/contentratings

type CreativeCommon

type CreativeCommon struct {
	Code string `json:"code,omitempty"`
	Name string `json:"name,omitempty"`
}

CreativeCommon represents a creative common.

type CreativeCommonsService

type CreativeCommonsService service

CreativeCommonsService handles communication with the creative commons related methods of the Vimeo API.

Vimeo API docs: https://developer.vimeo.com/api/endpoints/creativecommons

func (*CreativeCommonsService) List

List the creative common.

Vimeo API docs: https://developer.vimeo.com/api/playground/creativecommons

type Credit

type Credit struct {
	URI   string `json:"uri,omitempty"`
	Name  string `json:"name,omitempty"`
	Role  string `json:"role,omitempty"`
	User  *User  `json:"user,omitempty"`
	Video *Video `json:"user,omitempty"`
}

Credit represents a creadit.

type CreditRequest

type CreditRequest struct {
	Role    string `json:"role,omitempty"`
	Name    string `json:"name,omitempty"`
	Email   string `json:"email,omitempty"`
	UserURI string `json:"user_uri,omitempty"`
}

CreditRequest represents a request to create/edit an creadit.

type Domain

type Domain struct {
	URI  string `json:"uri,omitempty"`
	Name string `json:"name,omitempty"`
}

Domain represents a domain.

type Embed

type Embed struct {
	HTML string `json:"html,omitempty"`
}

Embed internal object provides access to HTML embed code.

type EmbedPresets

type EmbedPresets struct {
	URI      string         `json:"uri,omitempty"`
	Name     string         `json:"name,omitempty"`
	Settings *EmbedSettings `json:"settings,omitempty"`
	User     *User          `json:"user,omitempty"`
}

EmbedPresets internal object present settings.

type EmbedRequest

type EmbedRequest struct {
	Buttons                         *Buttons           `json:"buttons,omitempty"`
	Logos                           *Logos             `json:"logos,omitempty"`
	Outro                           string             `json:"outro,omitempty"`
	Portrait                        string             `json:"portrait,omitempty"`
	Title                           *TitleRequest      `json:"title,omitempty"`
	ByLine                          string             `json:"byline,omitempty"`
	Badge                           bool               `json:"badge"`
	ByLineBadge                     bool               `json:"byline_badge"`
	CollectionsButton               bool               `json:"collections_button"`
	PlayBar                         bool               `json:"playbar"`
	Volume                          bool               `json:"volume"`
	FullscreenButton                bool               `json:"fullscreen_button"`
	ScalingButton                   bool               `json:"scaling_button"`
	Autoplay                        bool               `json:"autoplay"`
	Autopause                       bool               `json:"autopause"`
	Loop                            bool               `json:"loop"`
	Color                           string             `json:"color,omitempty"`
	Link                            bool               `json:"link"`
	RatingsRequest                  *RatingsRequest    `json:"ratings,omitempty"`
	ExtraLinks                      *ExtraLinksRequest `json:"external_links,omitempty"`
	OverlayEmailCapture             int                `json:"overlay_email_capture,omitempty"`
	OverlayEmailCaptureText         string             `json:"overlay_email_capture_text,omitempty"`
	OverlayEmailCaptureConfirmation string             `json:"overlay_email_capture_confirmation,omitempty"`
}

EmbedRequest a request to edit an embed settings.

type EmbedSettings

type EmbedSettings struct {
	Buttons                         *Buttons `json:"buttons,omitempty"`
	Logos                           *Logos   `json:"logos,omitempty"`
	Outro                           string   `json:"outro,omitempty"`
	Portrait                        string   `json:"portrait,omitempty"`
	Title                           string   `json:"title,omitempty"`
	ByLine                          string   `json:"byline,omitempty"`
	Badge                           bool     `json:"badge"`
	ByLineBadge                     bool     `json:"byline_badge"`
	CollectionsButton               bool     `json:"collections_button"`
	PlayBar                         bool     `json:"playbar"`
	Volume                          bool     `json:"volume"`
	FullscreenButton                bool     `json:"fullscreen_button"`
	ScalingButton                   bool     `json:"scaling_button"`
	Autoplay                        bool     `json:"autoplay"`
	Autopause                       bool     `json:"autopause"`
	Loop                            bool     `json:"loop"`
	Color                           string   `json:"color,omitempty"`
	Link                            bool     `json:"link"`
	OverlayEmailCapture             int      `json:"overlay_email_capture,omitempty"`
	OverlayEmailCaptureText         string   `json:"overlay_email_capture_text,omitempty"`
	OverlayEmailCaptureConfirmation string   `json:"overlay_email_capture_confirmation,omitempty"`
}

EmbedSettings internal object provides access to embed settings.

type ErrorResponse

type ErrorResponse struct {
	Response *http.Response
	Message  string `json:"error"`
}

ErrorResponse is a Vimeo error response. This wraps the standard http.Response. Provides access error message returned Vimeo.

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type ExtraLinksRequest

type ExtraLinksRequest struct {
	IMDB           string `json:"imdb,omitempty"`
	RottenTomatoes string `json:"rotten_tomatoes,omitempty"`
}

ExtraLinksRequest a request to edit video.

type Feed

type Feed struct {
	URI  string `json:"uri,omitempty"`
	Clip *Video `json:"clip,omitempty"`
}

Feed represents a feed.

type Group

type Group struct {
	URI          string    `json:"uri,omitempty"`
	Name         string    `json:"name,omitempty"`
	Description  string    `json:"description,omitempty"`
	Link         string    `json:"link,omitempty"`
	CreatedTime  time.Time `json:"created_time,omitempty"`
	ModifiedTime time.Time `json:"modified_time,omitempty"`
	Privacy      *Privacy  `json:"privacy,omitempty"`
	Pictures     *Pictures `json:"pictures,omitempty"`
	Header       *Header   `json:"header,omitempty"`
	User         *User     `json:"user,omitempty"`
	ResourceKey  string    `json:"resource_key,omitempty"`
}

Group represents a group.

func (Group) GetID

func (g Group) GetID() string

GetID returns the identifier (ID) of the group.

type GroupRequest

type GroupRequest struct {
	Name        string `json:"name,omitempty"`
	Description string `json:"description,omitempty"`
}

GroupRequest represents a request to create/edit an group.

type GroupsService

type GroupsService service

GroupsService handles communication with the group related methods of the Vimeo API.

Vimeo API docs: https://developer.vimeo.com/api/endpoints/groups

func (*GroupsService) Create

func (s *GroupsService) Create(r *GroupRequest) (*Group, *Response, error)

Create a new group.

Vimeo API docs: https://developer.vimeo.com/api/playground/groups

func (*GroupsService) Delete

func (s *GroupsService) Delete(gr string) (*Response, error)

Delete specific group by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/groups/%7Bgroup_id%7D

func (*GroupsService) DeleteVideo

func (s *GroupsService) DeleteVideo(gr string, vid int) (*Response, error)

DeleteVideo specific video by group name and video ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/groups/%7Bgroup_id%7D/videos/%7Bvideo_id%7D

func (*GroupsService) Get

func (s *GroupsService) Get(gr string) (*Group, *Response, error)

Get specific group by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/groups/%7Bgroup_id%7D

func (*GroupsService) GetVideo

func (s *GroupsService) GetVideo(gr string, vid int) (*Video, *Response, error)

GetVideo specific video by group name and video ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/groups/%7Bgroup_id%7D/videos/%7Bvideo_id%7D

func (*GroupsService) List

func (s *GroupsService) List(opt *ListGroupOptions) ([]*Group, *Response, error)

List lists the group.

Vimeo API docs: https://developer.vimeo.com/api/playground/groups

func (*GroupsService) ListUser

func (s *GroupsService) ListUser(gr string, opt *ListUserOptions) ([]*User, *Response, error)

ListUser lists the user for an group.

Vimeo API docs: https://developer.vimeo.com/api/playground/groups/%7Bgroup_id%7D/users

func (*GroupsService) ListVideo

func (s *GroupsService) ListVideo(gr string, opt *ListVideoOptions) ([]*Video, *Response, error)

ListVideo lists the video for an group.

Vimeo API docs: https://developer.vimeo.com/api/playground/groups/%7Bgroup_id%7D/videos

type Header struct {
	URI         string         `json:"uri,omitempty"`
	Active      bool           `json:"active"`
	Type        string         `json:"type,omitempty"`
	Sizes       []*PictureSize `json:"sizes,omitempty"`
	ResourceKey string         `json:"resource_key,omitempty"`
}

Header internal object provides access to header pictures.

type Language

type Language struct {
	Code string `json:"code,omitempty"`
	Name string `json:"name,omitempty"`
}

Language represents a language.

type LanguagesService

type LanguagesService service

LanguagesService handles communication with the languages related methods of the Vimeo API.

Vimeo API docs: https://developer.vimeo.com/api/endpoints/languages

func (*LanguagesService) List

List the languages.

Vimeo API docs: https://developer.vimeo.com/api/playground/languages

type ListAlbumOptions

type ListAlbumOptions struct {
	Query     string `url:"query,omitempty"`
	Sort      string `url:"sort,omitempty"`
	Direction string `url:"direction,omitempty"`
	ListOptions
}

ListAlbumOptions specifies the optional parameters to the ListAlbum method.

type ListCategoryOptions

type ListCategoryOptions struct {
	ListOptions
}

ListCategoryOptions specifies the optional parameters to the CategoriesService.List method.

type ListChannelOptions

type ListChannelOptions struct {
	Query  string `url:"query,omitempty"`
	Filter string `url:"filter,omitempty"`
	ListOptions
}

ListChannelOptions specifies the optional parameters to the CategoriesService.ListChannel method.

type ListCommentOptions

type ListCommentOptions struct {
	Query     string `url:"query,omitempty"`
	Direction string `url:"direction,omitempty"`
	ListOptions
}

ListCommentOptions specifies the optional parameters to the ListCommentOptions.VideoListComment method.

type ListContentRatingOptions

type ListContentRatingOptions struct {
	ListOptions
}

ListContentRatingOptions specifies the optional parameters to the ContentRatingsService.List method.

type ListCreativeCommonOptions

type ListCreativeCommonOptions struct {
	ListOptions
}

ListCreativeCommonOptions specifies the optional parameters to the CreativeCommonsService.List method.

type ListCreditOptions

type ListCreditOptions struct {
	Query     string `url:"query,omitempty"`
	Sort      string `url:"sort,omitempty"`
	Direction string `url:"direction,omitempty"`
	ListOptions
}

ListCreditOptions specifies the optional parameters to the ListCredit method.

type ListFeedOptions

type ListFeedOptions struct {
	ListOptions
}

ListFeedOptions specifies the optional parameters to the Feed method.

type ListGroupOptions

type ListGroupOptions struct {
	Query     string `url:"query,omitempty"`
	Filter    string `url:"filter,omitempty"`
	Sort      string `url:"sort,omitempty"`
	Direction string `url:"direction,omitempty"`
	ListOptions
}

ListGroupOptions specifies the optional parameters to ListGroup method.

type ListLanguageOptions

type ListLanguageOptions struct {
	Filter string `url:"filter,omitempty"`
	ListOptions
}

ListLanguageOptions specifies the optional parameters to the LanguagesService.List method.

type ListOptions

type ListOptions struct {
	Page      int `url:"page,omitempty"`
	PerPage   int `url:"per_page,omitempty"`
	Sort      int `url:"sort,omitempty"`
	Direction int `url:"direction,omitempty"`
}

ListOptions specifies the optional parameters to various List methods that support pagination.

type ListPortfolioOptions

type ListPortfolioOptions struct {
	Query     string `url:"query,omitempty"`
	Sort      string `url:"sort,omitempty"`
	Direction string `url:"direction,omitempty"`
	ListOptions
}

ListPortfolioOptions specifies the optional parameters to the ListPortfolio method.

type ListPresetOptions

type ListPresetOptions struct {
	Query string `url:"query,omitempty"`
	ListOptions
}

ListPresetOptions specifies the optional parameters to the ListPreset method.

type ListRepliesOptions

type ListRepliesOptions struct {
	ListOptions
}

ListRepliesOptions specifies the optional parameters to the ListRepliesOptions.ListReplies method.

type ListUserOptions

type ListUserOptions struct {
	Query  string `url:"query,omitempty"`
	Filter string `url:"filter,omitempty"`
	ListOptions
}

ListUserOptions specifies the optional parameters to the ListUser method.

type ListVideoOptions

type ListVideoOptions struct {
	Query            string `url:"query,omitempty"`
	Filter           string `url:"filter,omitempty"`
	FilterEmbeddable string `url:"filter_embeddable,omitempty"`
	Sort             string `url:"sort,omitempty"`
	Direction        string `url:"direction,omitempty"`
	FilterPlayable   string `url:"filter_playable,omitempty"`
	ListOptions
}

ListVideoOptions specifies the optional parameters to the CategoriesService.ListVideo method.

type Logos

type Logos struct {
	Vimeo        bool `json:"vimeo"`
	Custom       bool `json:"custom"`
	StickyCustom bool `json:"sticky_custom"`
}

Logos internal object embed settings.

type PictureSize

type PictureSize struct {
	Width              int    `json:"width,omitempty"`
	Height             int    `json:"height,omitempty"`
	Link               string `json:"link,omitempty"`
	LinkWithPlayButton string `json:"link_with_play_button,omitempty"`
}

PictureSize internal object provides access to picture size.

type Pictures

type Pictures struct {
	URI         string         `json:"uri,omitempty"`
	Active      bool           `json:"active"`
	Type        string         `json:"type,omitempty"`
	Sizes       []*PictureSize `json:"sizes,omitempty"`
	ResourceKey string         `json:"resource_key,omitempty"`
}

Pictures internal object provides access to pictures.

type PicturesRequest

type PicturesRequest struct {
	Time   float32 `json:"time,omitempty"`
	Active bool    `json:"active,omitempty"`
}

PicturesRequest represents a request to create/edit an pictures.

type Portfolio

type Portfolio struct {
	URI          string    `json:"uri,omitempty"`
	Name         string    `json:"name,omitempty"`
	Description  string    `json:"description,omitempty"`
	Link         string    `json:"link,omitempty"`
	CreatedTime  time.Time `json:"created_time,omitempty"`
	ModifiedTime time.Time `json:"modified_time,omitempty"`
	Sort         string    `json:"sort,omitempty"`
}

Portfolio represents a portfolio.

type Preset

type Preset struct {
	URI  string `json:"uri,omitempty"`
	Name string `json:"name,omitempty"`
}

Preset represents a preset.

type Privacy

type Privacy struct {
	View     string `json:"view,omitempty"`
	Join     string `json:"join,omitempty"`
	Videos   string `json:"videos,omitempty"`
	Comment  string `json:"comment,omitempty"`
	Forums   string `json:"forums,omitempty"`
	Invite   string `json:"invite,omitempty"`
	Embed    string `json:"embed,omitempty"`
	Download bool   `json:"download"`
	Add      bool   `json:"add"`
}

Privacy internal object provides access to privacy.

type RatingMPAARequest

type RatingMPAARequest struct {
	Rating string `json:"rating,omitempty"`
	Reason string `json:"reason,omitempty"`
}

RatingMPAARequest a request to edit video.

type RatingTVRequest

type RatingTVRequest struct {
	Rating string `json:"rating,omitempty"`
	Reason string `json:"reason,omitempty"`
}

RatingTVRequest a request to edit video.

type RatingsRequest

type RatingsRequest struct {
	RatingTVRequest   string `json:"tv,omitempty"`
	RatingMPAARequest string `json:"mpaa,omitempty"`
}

RatingsRequest a request to edit an embed settings.

type Response

type Response struct {
	*http.Response
	// Pagination
	Page       int
	TotalPages int
	NextPage   string
	PrevPage   string
	FirstPage  string
	LastPage   string
}

Response is a Vimeo response. This wraps the standard http.Response. Provides access pagination links.

type Stats

type Stats struct {
	Plays int `json:"plays,omitempty"`
}

Stats internal object provides access to video statistic.

type SubCategory

type SubCategory struct {
	URI  string `json:"URI,omitempty"`
	Name string `json:"name,omitempty"`
	Link string `json:"link,omitempty"`
}

SubCategory internal object provides access to subcategory in category.

type Tag

type Tag struct {
	URI         string `json:"uri,omitempty"`
	Name        string `json:"name,omitempty"`
	Tag         string `json:"tag,omitempty"`
	Canonical   string `json:"canonical,omitempty"`
	ResourceKey string `json:"resource_key,omitempty"`
}

Tag represents a tag.

type TagsService

type TagsService service

TagsService handles communication with the tag related methods of the Vimeo API.

Vimeo API docs: https://developer.vimeo.com/api/endpoints/tags

func (*TagsService) Get

func (s *TagsService) Get(t string) (*Tag, *Response, error)

Get specific tag by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/tags/%7Bword%7D

func (*TagsService) ListVideo

func (s *TagsService) ListVideo(t string, opt *ListVideoOptions) ([]*Video, *Response, error)

ListVideo lists the video for an tag.

Vimeo API docs: https://developer.vimeo.com/api/playground/tags/%7Bword%7D/videos

type TextTrack

type TextTrack struct {
	URI  string `json:"uri,omitempty"`
	Name string `json:"name,omitempty"`
}

TextTrack represents a text track. TODO: Need full object.

type TextTrackRequest

type TextTrackRequest struct {
	Active   bool   `json:"role"`
	Type     string `json:"type,omitempty"`
	Language string `json:"language,omitempty"`
	Name     string `json:"name,omitempty"`
}

TextTrackRequest represents a request to create/edit text track.

type TitleRequest

type TitleRequest struct {
	Owner    string `json:"owner,omitempty"`
	Portrait string `json:"portrait,omitempty"`
	Name     string `json:"name,omitempty"`
}

TitleRequest a request to edit an embed settings.

type UploadVideo

type UploadVideo struct {
	URI              string `json:"uri,omitempty"`
	TicketID         string `json:"ticket_id,omitempty"`
	User             *User  `json:"user,omitempty"`
	UploadLink       string `json:"upload_link,omitempty"`
	UploadLinkSecure string `json:"upload_link_secure,omitempty"`
	CompleteURI      string `json:"complete_uri,omitempty"`
}

UploadVideo represents a video.

type UploadVideoOptions added in v1.1.0

type UploadVideoOptions struct {
	Type string `json:"type,omitempty"`
}

UploadVideoOptions specifies the optional parameters to the uploadVideo method.

type User

type User struct {
	URI           string     `json:"uri,omitempty"`
	Name          string     `json:"name,omitempty"`
	Link          string     `json:"link,omitempty"`
	Location      string     `json:"location,omitempty"`
	Bio           string     `json:"bio,omitempty"`
	CreatedTime   time.Time  `json:"created_time,omitempty"`
	Account       string     `json:"account,omitempty"`
	Pictures      *Pictures  `json:"pictures,omitempty"`
	WebSites      []*WebSite `json:"websites,omitempty"`
	ContentFilter []string   `json:"content_filter,omitempty"`
	ResourceKey   string     `json:"resource_key,omitempty"`
}

User represents a user.

type UserRequest

type UserRequest struct {
	Name     string `json:"name,omitempty"`
	Location string `json:"location,omitempty"`
	Bio      string `json:"bio,omitempty"`
}

UserRequest represents a request to create/edit an user.

type UsersService

type UsersService service

UsersService handles communication with the users related methods of the Vimeo API.

Vimeo API docs: https://developer.vimeo.com/api/endpoints/users

func (*UsersService) AlbumAddVideo

func (s *UsersService) AlbumAddVideo(uid string, ab string, vid int) (*Response, error)

AlbumAddVideo add specific video by album name and video ID. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/albums/%7Balbum_id%7D/videos/%7Bvideo_id%7D

func (*UsersService) AlbumDeleteVideo

func (s *UsersService) AlbumDeleteVideo(uid string, ab string, vid int) (*Response, error)

AlbumDeleteVideo delete specific video by album name and video ID. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/albums/%7Balbum_id%7D/videos/%7Bvideo_id%7D

func (*UsersService) AlbumGetVideo

func (s *UsersService) AlbumGetVideo(uid string, ab string, vid int) (*Video, *Response, error)

AlbumGetVideo get specific video by album name and video ID. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/albums/%7Balbum_id%7D/videos/%7Bvideo_id%7D

func (*UsersService) AlbumListVideo

func (s *UsersService) AlbumListVideo(uid string, ab string, opt *ListVideoOptions) ([]*Video, *Response, error)

AlbumListVideo lists the video for an album. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/albums/%7Balbum_id%7D/videos

func (*UsersService) ClearWatchedList

func (s *UsersService) ClearWatchedList(uid string) (*Response, error)

ClearWatchedList delete all video from watch history.

Vimeo API docs: https://developer.vimeo.com/api/playground/me/watchlater/%7Bvideo_id%7D

func (*UsersService) CreateAlbum

func (s *UsersService) CreateAlbum(uid string, r *AlbumRequest) (*Album, *Response, error)

CreateAlbum a new album. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/albums

func (*UsersService) DeleteAlbum

func (s *UsersService) DeleteAlbum(uid string, ab string) (*Response, error)

DeleteAlbum specific album by name. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/albums/%7Balbum_id%7D

func (*UsersService) Edit

func (s *UsersService) Edit(uid string, r *UserRequest) (*User, *Response, error)

Edit one user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D

func (*UsersService) EditAlbum

func (s *UsersService) EditAlbum(uid string, ab string, r *AlbumRequest) (*Album, *Response, error)

EditAlbum specific album by name. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/albums/%7Balbum_id%7D

func (*UsersService) Feed

func (s *UsersService) Feed(uid string, opt *ListFeedOptions) ([]*Feed, *Response, error)

Feed lists the feed for an user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/feed

func (*UsersService) FollowUser

func (s *UsersService) FollowUser(uid string, fid string) (*Response, error)

FollowUser follow a user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/following/%7Bfollow_user_id%7D

func (*UsersService) Get

func (s *UsersService) Get(uid string) (*User, *Response, error)

Get show one user. Passing the empty string will authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D

func (*UsersService) GetAlbum

func (s *UsersService) GetAlbum(uid string, ab string) (*Album, *Response, error)

GetAlbum specific album by name. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/albums/%7Balbum_id%7D

func (*UsersService) GetPreset

func (s *UsersService) GetPreset(uid string, p int) (*Preset, *Response, error)

GetPreset get preset by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/presets/%7Bpreset_id%7D

func (*UsersService) GetProtfolio

func (s *UsersService) GetProtfolio(uid string, p string) (*Portfolio, *Response, error)

GetProtfolio get portfolio by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/portfolios/%7Bportfolio_id%7D

func (*UsersService) GetVideo

func (s *UsersService) GetVideo(uid string, vid int) (*Video, *Response, error)

GetVideo get specific video by video ID. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/videos

func (*UsersService) JoinGroup

func (s *UsersService) JoinGroup(uid string, gid string) (*Response, error)

JoinGroup join user to group. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/groups/%7Bgroup_id%7D

func (*UsersService) LeaveGroup

func (s *UsersService) LeaveGroup(uid string, gid string) (*Response, error)

LeaveGroup leaved user from group. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/groups/%7Bgroup_id%7D

func (*UsersService) LikeVideo

func (s *UsersService) LikeVideo(uid string, vid int) (*Response, error)

LikeVideo like one video. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/likes/%7Bvideo_id%7D

func (*UsersService) ListAlbum

func (s *UsersService) ListAlbum(uid string, opt *ListAlbumOptions) ([]*Album, *Response, error)

ListAlbum lists the album for an current user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/albums

func (*UsersService) ListAppearance

func (s *UsersService) ListAppearance(uid string, opt *ListVideoOptions) ([]*Video, *Response, error)

ListAppearance all videos a user is credited in. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/appearances

func (*UsersService) ListCategory

func (s *UsersService) ListCategory(uid string, opt *ListCategoryOptions) ([]*Category, *Response, error)

ListCategory list the subscribed category for user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/categories

func (*UsersService) ListChannel

func (s *UsersService) ListChannel(uid string, opt *ListChannelOptions) ([]*Channel, *Response, error)

ListChannel list the subscribed channel for user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/channels

func (*UsersService) ListFollowed

func (s *UsersService) ListFollowed(uid string, opt *ListUserOptions) ([]*User, *Response, error)

ListFollowed lists the following. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/following

func (*UsersService) ListFollower

func (s *UsersService) ListFollower(uid string, opt *ListUserOptions) ([]*User, *Response, error)

ListFollower lists the followers. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/followers

func (*UsersService) ListGroup

func (s *UsersService) ListGroup(uid string, opt *ListGroupOptions) ([]*Group, *Response, error)

ListGroup lists all joined groups. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/groups

func (*UsersService) ListLikedVideo

func (s *UsersService) ListLikedVideo(uid string, opt *ListVideoOptions) ([]*Video, *Response, error)

ListLikedVideo all liked videos. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/likes

func (*UsersService) ListPortfolio

func (s *UsersService) ListPortfolio(uid string, opt *ListPortfolioOptions) ([]*Portfolio, *Response, error)

ListPortfolio lists the portfolio for user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/portfolios

func (*UsersService) ListPreset

func (s *UsersService) ListPreset(uid string, opt *ListPresetOptions) ([]*Preset, *Response, error)

ListPreset lists the preset for an current user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/presets

func (*UsersService) ListVideo

func (s *UsersService) ListVideo(uid string, opt *ListVideoOptions) ([]*Video, *Response, error)

ListVideo lists the video for user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/videos

func (*UsersService) PresetListVideo

func (s *UsersService) PresetListVideo(uid string, p int, opt *ListVideoOptions) ([]*Video, *Response, error)

PresetListVideo lists the preset for an preset.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/presets/%7Bpreset_id%7D/videos

func (*UsersService) ProtfolioAddVideo

func (s *UsersService) ProtfolioAddVideo(uid string, p string, vid int) (*Response, error)

ProtfolioAddVideo add one video.

Vimeo API docs: hhttps://developer.vimeo.com/api/playground/users/%7Buser_id%7D/portfolios/%7Bportfolio_id%7D/videos/%7Bvideo_id%7D

func (*UsersService) ProtfolioDeleteVideo

func (s *UsersService) ProtfolioDeleteVideo(uid string, p string, vid int) (*Response, error)

ProtfolioDeleteVideo delete specific video by portfolio name and video ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/portfolios/%7Bportfolio_id%7D/videos/%7Bvideo_id%7D

func (*UsersService) ProtfolioGetVideo

func (s *UsersService) ProtfolioGetVideo(uid string, p string, vid int) (*Video, *Response, error)

ProtfolioGetVideo get specific video by portfolio name and video ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/portfolios/%7Bportfolio_id%7D/videos/%7Bvideo_id%7D

func (*UsersService) ProtfolioListVideo

func (s *UsersService) ProtfolioListVideo(uid string, p string, opt *ListVideoOptions) ([]*Video, *Response, error)

ProtfolioListVideo lists the video for an portfolio.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/portfolios/%7Bportfolio_id%7D/videos

func (*UsersService) RemovePortrait

func (s *UsersService) RemovePortrait(uid string, pid string) (*Response, error)

RemovePortrait removed specific a portrait. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/pictures/%7Bportraitset_id%7D

func (*UsersService) Search

func (s *UsersService) Search(opt *ListUserOptions) ([]*User, *Response, error)

Search users.

Vimeo API docs: https://developer.vimeo.com/api/playground/channels/%7Bchannel_id%7D/users

func (*UsersService) SubscribeCategory

func (s *UsersService) SubscribeCategory(uid string, cat string) (*Response, error)

SubscribeCategory subscribe category user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/categories/%7Bcategory%7D

func (*UsersService) SubscribeChannel

func (s *UsersService) SubscribeChannel(uid string, ch string) (*Response, error)

SubscribeChannel subscribe channel user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/channels/%7Bchannel_id%7D

func (*UsersService) UnfollowUser

func (s *UsersService) UnfollowUser(uid string, fid string) (*Response, error)

UnfollowUser unfollow a user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/following/%7Bfollow_user_id%7D

func (*UsersService) UnlikeVideo

func (s *UsersService) UnlikeVideo(uid string, vid int) (*Response, error)

UnlikeVideo unlike one video. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/likes/%7Bvideo_id%7D

func (*UsersService) UnsubscribeCategory

func (s *UsersService) UnsubscribeCategory(uid string, cat string) (*Response, error)

UnsubscribeCategory unsubscribe category current user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/categories/%7Bcategory%7D

func (*UsersService) UnsubscribeChannel

func (s *UsersService) UnsubscribeChannel(uid string, ch string) (*Response, error)

UnsubscribeChannel unsubscribe channel user. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/channels/%7Bchannel_id%7D

func (*UsersService) UploadVideo

func (s *UsersService) UploadVideo(uid string, file *os.File) (*Video, *Response, error)

UploadVideo upload video file. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/videos

func (*UsersService) WatchLaterAddVideo

func (s *UsersService) WatchLaterAddVideo(uid string, vid int) (*Response, error)

WatchLaterAddVideo add video to watch later list. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/watchlater/%7Bvideo_id%7D

func (*UsersService) WatchLaterDeleteVideo

func (s *UsersService) WatchLaterDeleteVideo(uid string, vid int) (*Response, error)

WatchLaterDeleteVideo delete video from watch later list. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/watchlater/%7Bvideo_id%7D

func (*UsersService) WatchLaterGetVideo

func (s *UsersService) WatchLaterGetVideo(uid string, vid int) (*Video, *Response, error)

WatchLaterGetVideo get specific video by video ID. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/watchlater/%7Bvideo_id%7D

func (*UsersService) WatchLaterListVideo

func (s *UsersService) WatchLaterListVideo(uid string, opt *ListVideoOptions) ([]*Video, *Response, error)

WatchLaterListVideo lists the video. Passing the empty string will edit authenticated user.

Vimeo API docs: https://developer.vimeo.com/api/playground/users/%7Buser_id%7D/watchlater

func (*UsersService) WatchedDeleteVideo

func (s *UsersService) WatchedDeleteVideo(uid string, vid int) (*Response, error)

WatchedDeleteVideo delete specific video from watch history.

Vimeo API docs: https://developer.vimeo.com/api/playground/me/watched/videos/%7Bvideo_id%7D

func (*UsersService) WatchedListVideo

func (s *UsersService) WatchedListVideo(uid string, opt *ListVideoOptions) ([]*Video, *Response, error)

WatchedListVideo lists the video.

Vimeo API docs: https://developer.vimeo.com/api/playground/me/watched/videos

type Video

type Video struct {
	URI           string        `json:"uri,omitempty"`
	Name          string        `json:"name,omitempty"`
	Description   string        `json:"description,omitempty"`
	Link          string        `json:"link,omitempty"`
	Duration      int           `json:"duration,omitempty"`
	Width         int           `json:"width,omitempty"`
	Height        int           `json:"height,omitempty"`
	Language      string        `json:"language,omitempty"`
	Embed         *Embed        `json:"embed,omitempty"`
	CreatedTime   time.Time     `json:"created_time,omitempty"`
	ModifiedTime  time.Time     `json:"modified_time,omitempty"`
	ReleaseTime   time.Time     `json:"release_time,omitempty"`
	ContentRating []string      `json:"content_rating,omitempty"`
	License       string        `json:"license,omitempty"`
	Privacy       *Privacy      `json:"privacy,omitempty"`
	Pictures      *Pictures     `json:"pictures,omitempty"`
	Tags          []*Tag        `json:"tags,omitempty"`
	Stats         *Stats        `json:"stats,omitempty"`
	User          *User         `json:"user,omitempty"`
	App           *App          `json:"app,omitempty"`
	Status        string        `json:"status,omitempty"`
	ResourceKey   string        `json:"resource_key,omitempty"`
	EmbedPresets  *EmbedPresets `json:"embed_presets,omitempty"`
}

Video represents a video.

func (Video) GetID

func (v Video) GetID() int

GetID returns the numeric identifier (ID) of the video.

type VideoRequest

type VideoRequest struct {
	Name          string        `json:"name,omitempty"`
	Description   string        `json:"description,omitempty"`
	License       string        `json:"license,omitempty"`
	Privacy       *Privacy      `json:"privacy,omitempty"`
	Password      string        `json:"password,omitempty"`
	ReviewLink    bool          `json:"review_link"`
	Locale        string        `json:"locale,omitempty"`
	ContentRating []string      `json:"content_rating,omitempty"`
	Embed         *EmbedRequest `json:"embed,omitempty"`
}

VideoRequest represents a request to edit an video.

type VideosService

type VideosService service

VideosService handles communication with the videos related methods of the Vimeo API.

Vimeo API docs: https://developer.vimeo.com/api/endpoints/videos

func (*VideosService) AddComment

func (s *VideosService) AddComment(vid int, r *CommentRequest) (*Comment, *Response, error)

AddComment add comment.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/comments

func (*VideosService) AddCredit

func (s *VideosService) AddCredit(vid int, r *CreditRequest) (*Credit, *Response, error)

AddCredit add credit.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/credits

func (*VideosService) AddTextTrack

func (s *VideosService) AddTextTrack(vid int, r *TextTrackRequest) (*TextTrack, *Response, error)

AddTextTrack add text tracks.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/texttracks

func (*VideosService) AllowDomain

func (s *VideosService) AllowDomain(vid int, d string) (*Response, error)

AllowDomain embedding on a domain.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/privacy/domains/%7Bdomain%7D

func (*VideosService) AllowUser

func (s *VideosService) AllowUser(vid int, uid string) (*Response, error)

AllowUser allow users to view this video.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/privacy/users/%7Buser_id%7D

func (*VideosService) AllowUsers

func (s *VideosService) AllowUsers(vid int) (*Response, error)

AllowUsers allow users to view this video.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/privacy/users

func (*VideosService) AssignPreset

func (s *VideosService) AssignPreset(vid int, p int) (*Response, error)

AssignPreset embed preset by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/presets/%7Bpreset_id%7D

func (*VideosService) AssignTag

func (s *VideosService) AssignTag(vid int, t string) (*Response, error)

AssignTag specific tag by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/tags/%7Bword%7D

func (*VideosService) CreatePictures

func (s *VideosService) CreatePictures(vid int, r *PicturesRequest) (*Pictures, *Response, error)

CreatePictures create a thumbnail.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/pictures

func (*VideosService) Delete

func (s *VideosService) Delete(vid int) (*Response, error)

Delete specific video by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D

func (*VideosService) DeleteComment

func (s *VideosService) DeleteComment(vid int, cid int) (*Response, error)

DeleteComment delete specific comment by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/comments/%7Bcomment_id%7D

func (*VideosService) DeleteCredit

func (s *VideosService) DeleteCredit(vid int, cid int) (*Response, error)

DeleteCredit delete specific credit by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/credits/%7Bcredit_id%7D

func (*VideosService) DeletePictures

func (s *VideosService) DeletePictures(vid int, pid int) (*Response, error)

DeletePictures delete specific pictures by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/comments/%7Bcomment_id%7D

func (*VideosService) DeleteTextTrack

func (s *VideosService) DeleteTextTrack(vid int, tid int) (*Response, error)

DeleteTextTrack delete specific text track by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/texttracks/%7Btexttrack_id%7D

func (*VideosService) DisallowDomain

func (s *VideosService) DisallowDomain(vid int, d string) (*Response, error)

DisallowDomain embedding on a domain.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/privacy/domains/%7Bdomain%7D

func (*VideosService) DisallowUser

func (s *VideosService) DisallowUser(vid int, uid string) (*Response, error)

DisallowUser disallow user from viewing this video.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/privacy/users/%7Buser_id%7D

func (*VideosService) Edit

func (s *VideosService) Edit(vid int, r *VideoRequest) (*Video, *Response, error)

Edit specific video by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D

func (*VideosService) EditComment

func (s *VideosService) EditComment(vid int, cid int, r *CommentRequest) (*Comment, *Response, error)

EditComment edit specific comment by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/comments/%7Bcomment_id%7D

func (*VideosService) EditCredit

func (s *VideosService) EditCredit(vid int, cid int, r *CreditRequest) (*Credit, *Response, error)

EditCredit edit specific credit by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/credits/%7Bcredit_id%7D

func (*VideosService) EditPictures

func (s *VideosService) EditPictures(vid int, pid int, r *PicturesRequest) (*Pictures, *Response, error)

EditPictures edit specific pictures by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/pictures/%7Bpicture_id%7D

func (*VideosService) EditTextTrack

func (s *VideosService) EditTextTrack(vid int, tid int, r *TextTrackRequest) (*TextTrack, *Response, error)

EditTextTrack edit specific text track by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/texttracks/%7Btexttrack_id%7D

func (*VideosService) Get

func (s *VideosService) Get(vid int) (*Video, *Response, error)

Get specific video by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D

func (*VideosService) GetComment

func (s *VideosService) GetComment(vid int, cid int) (*Comment, *Response, error)

GetComment get specific comment by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/comments/%7Bcomment_id%7D

func (*VideosService) GetCredit

func (s *VideosService) GetCredit(vid int, cid int) (*Credit, *Response, error)

GetCredit get specific credit by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/credits/%7Bcredit_id%7D

func (*VideosService) GetPictures

func (s *VideosService) GetPictures(vid int, pid int) (*Pictures, *Response, error)

GetPictures get one thumbnail.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/pictures

func (*VideosService) GetPreset

func (s *VideosService) GetPreset(vid int, p int) (*Preset, *Response, error)

GetPreset get preset by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/presets/%7Bpreset_id%7D

func (*VideosService) GetTag

func (s *VideosService) GetTag(vid int, t string) (*Tag, *Response, error)

GetTag specific tag by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/tags/%7Bword%7D

func (*VideosService) GetTextTrack

func (s *VideosService) GetTextTrack(vid int, tid int) (*TextTrack, *Response, error)

GetTextTrack get specific text track by ID.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/texttracks/%7Btexttrack_id%7D

func (*VideosService) LikeList

func (s *VideosService) LikeList(vid int, opt *ListUserOptions) ([]*User, *Response, error)

LikeList lists users who liked this video.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/likes

func (*VideosService) List

func (s *VideosService) List(opt *ListVideoOptions) ([]*Video, *Response, error)

List lists the videos.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos

func (*VideosService) ListCategory

func (s *VideosService) ListCategory(vid int, opt *ListCategoryOptions) ([]*Category, *Response, error)

ListCategory lists the video category.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/categories

func (*VideosService) ListComment

func (s *VideosService) ListComment(vid int, opt *ListCommentOptions) ([]*Comment, *Response, error)

ListComment lists the comments.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/comments

func (*VideosService) ListCredit

func (s *VideosService) ListCredit(vid int, opt *ListCreditOptions) ([]*Credit, *Response, error)

ListCredit lists the credits.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/credits

func (*VideosService) ListDomain

func (s *VideosService) ListDomain(vid int) ([]*Domain, *Response, error)

ListDomain lists the domains.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/privacy/domains

func (*VideosService) ListPictures

func (s *VideosService) ListPictures(vid int) ([]*Pictures, *Response, error)

ListPictures lists thumbnails.

https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/pictures

func (*VideosService) ListRelatedVideo

func (s *VideosService) ListRelatedVideo(vid int, opt *ListVideoOptions) ([]*Video, *Response, error)

ListRelatedVideo lists the related video.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/videos

func (*VideosService) ListReplies

func (s *VideosService) ListReplies(vid int, cid int, opt *ListRepliesOptions) ([]*Comment, *Response, error)

ListReplies lists the comment replies.

https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/comments/%7Bcomment_id%7D/replies

func (*VideosService) ListTag

func (s *VideosService) ListTag(vid int) ([]*Tag, *Response, error)

ListTag list a video's tags

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/tags

func (*VideosService) ListTextTrack

func (s *VideosService) ListTextTrack(vid int) ([]*TextTrack, *Response, error)

ListTextTrack lists the text tracks.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/texttracks

func (*VideosService) ListUser

func (s *VideosService) ListUser(vid int) ([]*User, *Response, error)

ListUser list the all allowed users

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/privacy/users

func (*VideosService) UnassignPreset

func (s *VideosService) UnassignPreset(vid int, p int) (*Response, error)

UnassignPreset embed preset by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/presets/%7Bpreset_id%7D

func (*VideosService) UnassignTag

func (s *VideosService) UnassignTag(vid int, t string) (*Response, error)

UnassignTag specific tag by name.

Vimeo API docs: https://developer.vimeo.com/api/playground/videos/%7Bvideo_id%7D/tags/%7Bword%7D

type WebSite

type WebSite struct {
	Name        string `json:"name,omitempty"`
	Link        string `json:"link,omitempty"`
	Description string `json:"description,omitempty"`
}

WebSite represents a web site.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL