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 | namespace Google\Service\YouTube\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\YouTube\Caption;
|
---|
21 | use Google\Service\YouTube\CaptionListResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "captions" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $youtubeService = new Google\Service\YouTube(...);
|
---|
28 | * $captions = $youtubeService->captions;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class Captions extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Deletes a resource. (captions.delete)
|
---|
35 | *
|
---|
36 | * @param string $id
|
---|
37 | * @param array $optParams Optional parameters.
|
---|
38 | *
|
---|
39 | * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the
|
---|
40 | * request is be on behalf of
|
---|
41 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
42 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
43 | * parameter indicates that the request's authorization credentials identify a
|
---|
44 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
45 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
46 | * that own and manage many different YouTube channels. It allows content owners
|
---|
47 | * to authenticate once and get access to all their video and channel data,
|
---|
48 | * without having to provide authentication credentials for each individual
|
---|
49 | * channel. The actual CMS account that the user authenticates with must be
|
---|
50 | * linked to the specified YouTube content owner.
|
---|
51 | * @throws \Google\Service\Exception
|
---|
52 | */
|
---|
53 | public function delete($id, $optParams = [])
|
---|
54 | {
|
---|
55 | $params = ['id' => $id];
|
---|
56 | $params = array_merge($params, $optParams);
|
---|
57 | return $this->call('delete', [$params]);
|
---|
58 | }
|
---|
59 | /**
|
---|
60 | * Downloads a caption track. (captions.download)
|
---|
61 | *
|
---|
62 | * @param string $id The ID of the caption track to download, required for One
|
---|
63 | * Platform.
|
---|
64 | * @param array $optParams Optional parameters.
|
---|
65 | *
|
---|
66 | * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the
|
---|
67 | * request is be on behalf of
|
---|
68 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
69 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
70 | * parameter indicates that the request's authorization credentials identify a
|
---|
71 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
72 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
73 | * that own and manage many different YouTube channels. It allows content owners
|
---|
74 | * to authenticate once and get access to all their video and channel data,
|
---|
75 | * without having to provide authentication credentials for each individual
|
---|
76 | * channel. The actual CMS account that the user authenticates with must be
|
---|
77 | * linked to the specified YouTube content owner.
|
---|
78 | * @opt_param string tfmt Convert the captions into this format. Supported
|
---|
79 | * options are sbv, srt, and vtt.
|
---|
80 | * @opt_param string tlang tlang is the language code; machine translate the
|
---|
81 | * captions into this language.
|
---|
82 | * @throws \Google\Service\Exception
|
---|
83 | */
|
---|
84 | public function download($id, $optParams = [])
|
---|
85 | {
|
---|
86 | $params = ['id' => $id];
|
---|
87 | $params = array_merge($params, $optParams);
|
---|
88 | return $this->call('download', [$params]);
|
---|
89 | }
|
---|
90 | /**
|
---|
91 | * Inserts a new resource into this collection. (captions.insert)
|
---|
92 | *
|
---|
93 | * @param string|array $part The *part* parameter specifies the caption resource
|
---|
94 | * parts that the API response will include. Set the parameter value to snippet.
|
---|
95 | * @param Caption $postBody
|
---|
96 | * @param array $optParams Optional parameters.
|
---|
97 | *
|
---|
98 | * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the
|
---|
99 | * request is be on behalf of
|
---|
100 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
101 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
102 | * parameter indicates that the request's authorization credentials identify a
|
---|
103 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
104 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
105 | * that own and manage many different YouTube channels. It allows content owners
|
---|
106 | * to authenticate once and get access to all their video and channel data,
|
---|
107 | * without having to provide authentication credentials for each individual
|
---|
108 | * channel. The actual CMS account that the user authenticates with must be
|
---|
109 | * linked to the specified YouTube content owner.
|
---|
110 | * @opt_param bool sync Extra parameter to allow automatically syncing the
|
---|
111 | * uploaded caption/transcript with the audio.
|
---|
112 | * @return Caption
|
---|
113 | * @throws \Google\Service\Exception
|
---|
114 | */
|
---|
115 | public function insert($part, Caption $postBody, $optParams = [])
|
---|
116 | {
|
---|
117 | $params = ['part' => $part, 'postBody' => $postBody];
|
---|
118 | $params = array_merge($params, $optParams);
|
---|
119 | return $this->call('insert', [$params], Caption::class);
|
---|
120 | }
|
---|
121 | /**
|
---|
122 | * Retrieves a list of resources, possibly filtered. (captions.listCaptions)
|
---|
123 | *
|
---|
124 | * @param string|array $part The *part* parameter specifies a comma-separated
|
---|
125 | * list of one or more caption resource parts that the API response will
|
---|
126 | * include. The part names that you can include in the parameter value are id
|
---|
127 | * and snippet.
|
---|
128 | * @param string $videoId Returns the captions for the specified video.
|
---|
129 | * @param array $optParams Optional parameters.
|
---|
130 | *
|
---|
131 | * @opt_param string id Returns the captions with the given IDs for Stubby or
|
---|
132 | * Apiary.
|
---|
133 | * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the
|
---|
134 | * request is on behalf of.
|
---|
135 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
136 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
137 | * parameter indicates that the request's authorization credentials identify a
|
---|
138 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
139 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
140 | * that own and manage many different YouTube channels. It allows content owners
|
---|
141 | * to authenticate once and get access to all their video and channel data,
|
---|
142 | * without having to provide authentication credentials for each individual
|
---|
143 | * channel. The actual CMS account that the user authenticates with must be
|
---|
144 | * linked to the specified YouTube content owner.
|
---|
145 | * @return CaptionListResponse
|
---|
146 | * @throws \Google\Service\Exception
|
---|
147 | */
|
---|
148 | public function listCaptions($part, $videoId, $optParams = [])
|
---|
149 | {
|
---|
150 | $params = ['part' => $part, 'videoId' => $videoId];
|
---|
151 | $params = array_merge($params, $optParams);
|
---|
152 | return $this->call('list', [$params], CaptionListResponse::class);
|
---|
153 | }
|
---|
154 | /**
|
---|
155 | * Updates an existing resource. (captions.update)
|
---|
156 | *
|
---|
157 | * @param string|array $part The *part* parameter specifies a comma-separated
|
---|
158 | * list of one or more caption resource parts that the API response will
|
---|
159 | * include. The part names that you can include in the parameter value are id
|
---|
160 | * and snippet.
|
---|
161 | * @param Caption $postBody
|
---|
162 | * @param array $optParams Optional parameters.
|
---|
163 | *
|
---|
164 | * @opt_param string onBehalfOf ID of the Google+ Page for the channel that the
|
---|
165 | * request is on behalf of.
|
---|
166 | * @opt_param string onBehalfOfContentOwner *Note:* This parameter is intended
|
---|
167 | * exclusively for YouTube content partners. The *onBehalfOfContentOwner*
|
---|
168 | * parameter indicates that the request's authorization credentials identify a
|
---|
169 | * YouTube CMS user who is acting on behalf of the content owner specified in
|
---|
170 | * the parameter value. This parameter is intended for YouTube content partners
|
---|
171 | * that own and manage many different YouTube channels. It allows content owners
|
---|
172 | * to authenticate once and get access to all their video and channel data,
|
---|
173 | * without having to provide authentication credentials for each individual
|
---|
174 | * channel. The actual CMS account that the user authenticates with must be
|
---|
175 | * linked to the specified YouTube content owner.
|
---|
176 | * @opt_param bool sync Extra parameter to allow automatically syncing the
|
---|
177 | * uploaded caption/transcript with the audio.
|
---|
178 | * @return Caption
|
---|
179 | * @throws \Google\Service\Exception
|
---|
180 | */
|
---|
181 | public function update($part, Caption $postBody, $optParams = [])
|
---|
182 | {
|
---|
183 | $params = ['part' => $part, 'postBody' => $postBody];
|
---|
184 | $params = array_merge($params, $optParams);
|
---|
185 | return $this->call('update', [$params], Caption::class);
|
---|
186 | }
|
---|
187 | }
|
---|
188 |
|
---|
189 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
190 | class_alias(Captions::class, 'Google_Service_YouTube_Resource_Captions');
|
---|