1<?php 2/* 3 * Copyright 2014 Google Inc. 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not 6 * use this file except in compliance with the License. You may obtain a copy of 7 * the License at 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 14 * License for the specific language governing permissions and limitations under 15 * the License. 16 */ 17 18/** 19 * The "captions" collection of methods. 20 * Typical usage is: 21 * <code> 22 * $youtubeService = new Google_Service_YouTube(...); 23 * $captions = $youtubeService->captions; 24 * </code> 25 */ 26class Google_Service_YouTube_Resource_Captions extends Google_Service_Resource 27{ 28 /** 29 * Deletes a resource. (captions.delete) 30 * 31 * @param string $id 32 * @param array $optParams Optional parameters. 33 * 34 * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the 35 * request is be on behalf of 36 * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended 37 * exclusively for YouTube content partners. The *onBehalfOfContentOwner* 38 * parameter indicates that the request's authorization credentials identify a 39 * YouTube CMS user who is acting on behalf of the content owner specified in 40 * the parameter value. This parameter is intended for YouTube content partners 41 * that own and manage many different YouTube channels. It allows content owners 42 * to authenticate once and get access to all their video and channel data, 43 * without having to provide authentication credentials for each individual 44 * channel. The actual CMS account that the user authenticates with must be 45 * linked to the specified YouTube content owner. 46 */ 47 public function delete($id, $optParams = array()) 48 { 49 $params = array('id' => $id); 50 $params = array_merge($params, $optParams); 51 return $this->call('delete', array($params)); 52 } 53 /** 54 * Downloads a caption track. (captions.download) 55 * 56 * @param string $id The ID of the caption track to download, required for One 57 * Platform. 58 * @param array $optParams Optional parameters. 59 * 60 * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the 61 * request is be on behalf of 62 * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended 63 * exclusively for YouTube content partners. The *onBehalfOfContentOwner* 64 * parameter indicates that the request's authorization credentials identify a 65 * YouTube CMS user who is acting on behalf of the content owner specified in 66 * the parameter value. This parameter is intended for YouTube content partners 67 * that own and manage many different YouTube channels. It allows content owners 68 * to authenticate once and get access to all their video and channel data, 69 * without having to provide authentication credentials for each individual 70 * channel. The actual CMS account that the user authenticates with must be 71 * linked to the specified YouTube content owner. 72 * @opt_param string tfmt Convert the captions into this format. Supported 73 * options are sbv, srt, and vtt. 74 * @opt_param string tlang tlang is the language code; machine translate the 75 * captions into this language. 76 */ 77 public function download($id, $optParams = array()) 78 { 79 $params = array('id' => $id); 80 $params = array_merge($params, $optParams); 81 return $this->call('download', array($params)); 82 } 83 /** 84 * Inserts a new resource into this collection. (captions.insert) 85 * 86 * @param string|array $part The *part* parameter specifies the caption resource 87 * parts that the API response will include. Set the parameter value to snippet. 88 * @param Google_Service_YouTube_Caption $postBody 89 * @param array $optParams Optional parameters. 90 * 91 * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the 92 * request is be on behalf of 93 * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended 94 * exclusively for YouTube content partners. The *onBehalfOfContentOwner* 95 * parameter indicates that the request's authorization credentials identify a 96 * YouTube CMS user who is acting on behalf of the content owner specified in 97 * the parameter value. This parameter is intended for YouTube content partners 98 * that own and manage many different YouTube channels. It allows content owners 99 * to authenticate once and get access to all their video and channel data, 100 * without having to provide authentication credentials for each individual 101 * channel. The actual CMS account that the user authenticates with must be 102 * linked to the specified YouTube content owner. 103 * @opt_param bool sync Extra parameter to allow automatically syncing the 104 * uploaded caption/transcript with the audio. 105 * @return Google_Service_YouTube_Caption 106 */ 107 public function insert($part, Google_Service_YouTube_Caption $postBody, $optParams = array()) 108 { 109 $params = array('part' => $part, 'postBody' => $postBody); 110 $params = array_merge($params, $optParams); 111 return $this->call('insert', array($params), "Google_Service_YouTube_Caption"); 112 } 113 /** 114 * Retrieves a list of resources, possibly filtered. (captions.listCaptions) 115 * 116 * @param string|array $part The *part* parameter specifies a comma-separated 117 * list of one or more caption resource parts that the API response will 118 * include. The part names that you can include in the parameter value are id 119 * and snippet. 120 * @param string $videoId Returns the captions for the specified video. 121 * @param array $optParams Optional parameters. 122 * 123 * @opt_param string id Returns the captions with the given IDs for Stubby or 124 * Apiary. 125 * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the 126 * request is on behalf of. 127 * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended 128 * exclusively for YouTube content partners. The *onBehalfOfContentOwner* 129 * parameter indicates that the request's authorization credentials identify a 130 * YouTube CMS user who is acting on behalf of the content owner specified in 131 * the parameter value. This parameter is intended for YouTube content partners 132 * that own and manage many different YouTube channels. It allows content owners 133 * to authenticate once and get access to all their video and channel data, 134 * without having to provide authentication credentials for each individual 135 * channel. The actual CMS account that the user authenticates with must be 136 * linked to the specified YouTube content owner. 137 * @return Google_Service_YouTube_CaptionListResponse 138 */ 139 public function listCaptions($part, $videoId, $optParams = array()) 140 { 141 $params = array('part' => $part, 'videoId' => $videoId); 142 $params = array_merge($params, $optParams); 143 return $this->call('list', array($params), "Google_Service_YouTube_CaptionListResponse"); 144 } 145 /** 146 * Updates an existing resource. (captions.update) 147 * 148 * @param string|array $part The *part* parameter specifies a comma-separated 149 * list of one or more caption resource parts that the API response will 150 * include. The part names that you can include in the parameter value are id 151 * and snippet. 152 * @param Google_Service_YouTube_Caption $postBody 153 * @param array $optParams Optional parameters. 154 * 155 * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the 156 * request is on behalf of. 157 * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended 158 * exclusively for YouTube content partners. The *onBehalfOfContentOwner* 159 * parameter indicates that the request's authorization credentials identify a 160 * YouTube CMS user who is acting on behalf of the content owner specified in 161 * the parameter value. This parameter is intended for YouTube content partners 162 * that own and manage many different YouTube channels. It allows content owners 163 * to authenticate once and get access to all their video and channel data, 164 * without having to provide authentication credentials for each individual 165 * channel. The actual CMS account that the user authenticates with must be 166 * linked to the specified YouTube content owner. 167 * @opt_param bool sync Extra parameter to allow automatically syncing the 168 * uploaded caption/transcript with the audio. 169 * @return Google_Service_YouTube_Caption 170 */ 171 public function update($part, Google_Service_YouTube_Caption $postBody, $optParams = array()) 172 { 173 $params = array('part' => $part, 'postBody' => $postBody); 174 $params = array_merge($params, $optParams); 175 return $this->call('update', array($params), "Google_Service_YouTube_Caption"); 176 } 177} 178