PageRenderTime 15ms CodeModel.GetById 10ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/library/Google/vendor/google/apiclient-services/src/Google/Service/YouTube/Resource/Captions.php

https://gitlab.com/vangtrangbac123/zinkaiuit.tk
PHP | 215 lines | 34 code | 1 blank | 180 comment | 0 complexity | b2b0028248b1ad88a8375e3226de1d11 MD5 | raw file
  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 specified caption track. (captions.delete)
 30   *
 31   * @param string $id The id parameter identifies the caption track that is being
 32   * deleted. The value is a caption track ID as identified by the id property in
 33   * a caption resource.
 34   * @param array $optParams Optional parameters.
 35   *
 36   * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the
 37   * request is be on behalf of
 38   * @opt_param string onBehalfOfContentOwner Note: This parameter is intended
 39   * exclusively for YouTube content partners.
 40   *
 41   * The onBehalfOfContentOwner parameter indicates that the request's
 42   * authorization credentials identify a YouTube CMS user who is acting on behalf
 43   * of the content owner specified in the parameter value. This parameter is
 44   * intended for YouTube content partners that own and manage many different
 45   * YouTube channels. It allows content owners to authenticate once and get
 46   * access to all their video and channel data, without having to provide
 47   * authentication credentials for each individual channel. The actual CMS
 48   * account that the user authenticates with must be linked to the specified
 49   * YouTube content owner.
 50   */
 51  public function delete($id, $optParams = array())
 52  {
 53    $params = array('id' => $id);
 54    $params = array_merge($params, $optParams);
 55    return $this->call('delete', array($params));
 56  }
 57  /**
 58   * Downloads a caption track. The caption track is returned in its original
 59   * format unless the request specifies a value for the tfmt parameter and in its
 60   * original language unless the request specifies a value for the tlang
 61   * parameter. (captions.download)
 62   *
 63   * @param string $id The id parameter identifies the caption track that is being
 64   * retrieved. The value is a caption track ID as identified by the id property
 65   * in a caption resource.
 66   * @param array $optParams Optional parameters.
 67   *
 68   * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the
 69   * request is be on behalf of
 70   * @opt_param string onBehalfOfContentOwner Note: This parameter is intended
 71   * exclusively for YouTube content partners.
 72   *
 73   * The onBehalfOfContentOwner parameter indicates that the request's
 74   * authorization credentials identify a YouTube CMS user who is acting on behalf
 75   * of the content owner specified in the parameter value. This parameter is
 76   * intended for YouTube content partners that own and manage many different
 77   * YouTube channels. It allows content owners to authenticate once and get
 78   * access to all their video and channel data, without having to provide
 79   * authentication credentials for each individual channel. The actual CMS
 80   * account that the user authenticates with must be linked to the specified
 81   * YouTube content owner.
 82   * @opt_param string tfmt The tfmt parameter specifies that the caption track
 83   * should be returned in a specific format. If the parameter is not included in
 84   * the request, the track is returned in its original format.
 85   * @opt_param string tlang The tlang parameter specifies that the API response
 86   * should return a translation of the specified caption track. The parameter
 87   * value is an ISO 639-1 two-letter language code that identifies the desired
 88   * caption language. The translation is generated by using machine translation,
 89   * such as Google Translate.
 90   */
 91  public function download($id, $optParams = array())
 92  {
 93    $params = array('id' => $id);
 94    $params = array_merge($params, $optParams);
 95    return $this->call('download', array($params));
 96  }
 97  /**
 98   * Uploads a caption track. (captions.insert)
 99   *
100   * @param string $part The part parameter specifies the caption resource parts
101   * that the API response will include. Set the parameter value to snippet.
102   * @param Google_Service_YouTube_Caption $postBody
103   * @param array $optParams Optional parameters.
104   *
105   * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the
106   * request is be on behalf of
107   * @opt_param string onBehalfOfContentOwner Note: This parameter is intended
108   * exclusively for YouTube content partners.
109   *
110   * The onBehalfOfContentOwner parameter indicates that the request's
111   * authorization credentials identify a YouTube CMS user who is acting on behalf
112   * of the content owner specified in the parameter value. This parameter is
113   * intended for YouTube content partners that own and manage many different
114   * YouTube channels. It allows content owners to authenticate once and get
115   * access to all their video and channel data, without having to provide
116   * authentication credentials for each individual channel. The actual CMS
117   * account that the user authenticates with must be linked to the specified
118   * YouTube content owner.
119   * @opt_param bool sync The sync parameter indicates whether YouTube should
120   * automatically synchronize the caption file with the audio track of the video.
121   * If you set the value to true, YouTube will disregard any time codes that are
122   * in the uploaded caption file and generate new time codes for the captions.
123   *
124   * You should set the sync parameter to true if you are uploading a transcript,
125   * which has no time codes, or if you suspect the time codes in your file are
126   * incorrect and want YouTube to try to fix them.
127   * @return Google_Service_YouTube_Caption
128   */
129  public function insert($part, Google_Service_YouTube_Caption $postBody, $optParams = array())
130  {
131    $params = array('part' => $part, 'postBody' => $postBody);
132    $params = array_merge($params, $optParams);
133    return $this->call('insert', array($params), "Google_Service_YouTube_Caption");
134  }
135  /**
136   * Returns a list of caption tracks that are associated with a specified video.
137   * Note that the API response does not contain the actual captions and that the
138   * captions.download method provides the ability to retrieve a caption track.
139   * (captions.listCaptions)
140   *
141   * @param string $part The part parameter specifies a comma-separated list of
142   * one or more caption resource parts that the API response will include. The
143   * part names that you can include in the parameter value are id and snippet.
144   * @param string $videoId The videoId parameter specifies the YouTube video ID
145   * of the video for which the API should return caption tracks.
146   * @param array $optParams Optional parameters.
147   *
148   * @opt_param string id The id parameter specifies a comma-separated list of IDs
149   * that identify the caption resources that should be retrieved. Each ID must
150   * identify a caption track associated with the specified video.
151   * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the
152   * request is on behalf of.
153   * @opt_param string onBehalfOfContentOwner Note: This parameter is intended
154   * exclusively for YouTube content partners.
155   *
156   * The onBehalfOfContentOwner parameter indicates that the request's
157   * authorization credentials identify a YouTube CMS user who is acting on behalf
158   * of the content owner specified in the parameter value. This parameter is
159   * intended for YouTube content partners that own and manage many different
160   * YouTube channels. It allows content owners to authenticate once and get
161   * access to all their video and channel data, without having to provide
162   * authentication credentials for each individual channel. The actual CMS
163   * account that the user authenticates with must be linked to the specified
164   * YouTube content owner.
165   * @return Google_Service_YouTube_CaptionListResponse
166   */
167  public function listCaptions($part, $videoId, $optParams = array())
168  {
169    $params = array('part' => $part, 'videoId' => $videoId);
170    $params = array_merge($params, $optParams);
171    return $this->call('list', array($params), "Google_Service_YouTube_CaptionListResponse");
172  }
173  /**
174   * Updates a caption track. When updating a caption track, you can change the
175   * track's draft status, upload a new caption file for the track, or both.
176   * (captions.update)
177   *
178   * @param string $part The part parameter serves two purposes in this operation.
179   * It identifies the properties that the write operation will set as well as the
180   * properties that the API response will include. Set the property value to
181   * snippet if you are updating the track's draft status. Otherwise, set the
182   * property value to id.
183   * @param Google_Service_YouTube_Caption $postBody
184   * @param array $optParams Optional parameters.
185   *
186   * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the
187   * request is be on behalf of
188   * @opt_param string onBehalfOfContentOwner Note: This parameter is intended
189   * exclusively for YouTube content partners.
190   *
191   * The onBehalfOfContentOwner parameter indicates that the request's
192   * authorization credentials identify a YouTube CMS user who is acting on behalf
193   * of the content owner specified in the parameter value. This parameter is
194   * intended for YouTube content partners that own and manage many different
195   * YouTube channels. It allows content owners to authenticate once and get
196   * access to all their video and channel data, without having to provide
197   * authentication credentials for each individual channel. The actual CMS
198   * account that the user authenticates with must be linked to the specified
199   * YouTube content owner.
200   * @opt_param bool sync Note: The API server only processes the parameter value
201   * if the request contains an updated caption file.
202   *
203   * The sync parameter indicates whether YouTube should automatically synchronize
204   * the caption file with the audio track of the video. If you set the value to
205   * true, YouTube will automatically synchronize the caption track with the audio
206   * track.
207   * @return Google_Service_YouTube_Caption
208   */
209  public function update($part, Google_Service_YouTube_Caption $postBody, $optParams = array())
210  {
211    $params = array('part' => $part, 'postBody' => $postBody);
212    $params = array_merge($params, $optParams);
213    return $this->call('update', array($params), "Google_Service_YouTube_Caption");
214  }
215}