Skip to content

Commit 943cf7c

Browse files
1 parent 62bc304 commit 943cf7c

File tree

7 files changed

+564
-0
lines changed

7 files changed

+564
-0
lines changed

src/YouTube.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ class YouTube extends \Google\Service
9090
public $watermarks;
9191
public $youtube_v3;
9292
public $youtube_v3_liveChat_messages;
93+
public $youtube_v3_videos;
9394
public $rootUrlTemplate;
9495

9596
/**
@@ -2277,6 +2278,35 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
22772278
]
22782279
]
22792280
);
2281+
$this->youtube_v3_videos = new YouTube\Resource\YoutubeV3Videos(
2282+
$this,
2283+
$this->serviceName,
2284+
'videos',
2285+
[
2286+
'methods' => [
2287+
'batchGetStats' => [
2288+
'path' => 'youtube/v3/videos:batchGetStats',
2289+
'httpMethod' => 'GET',
2290+
'parameters' => [
2291+
'onBehalfOfContentOwner' => [
2292+
'location' => 'query',
2293+
'type' => 'string',
2294+
],
2295+
'part' => [
2296+
'location' => 'query',
2297+
'type' => 'string',
2298+
'repeated' => true,
2299+
],
2300+
'videoIds' => [
2301+
'location' => 'query',
2302+
'type' => 'string',
2303+
'repeated' => true,
2304+
],
2305+
],
2306+
],
2307+
]
2308+
]
2309+
);
22802310
}
22812311
}
22822312

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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;
19+
20+
class BatchGetStatsResponse extends \Google\Collection
21+
{
22+
protected $collection_key = 'items';
23+
/**
24+
* Output only. Etag of this resource.
25+
*
26+
* @var string
27+
*/
28+
public $etag;
29+
protected $itemsType = VideoStat::class;
30+
protected $itemsDataType = 'array';
31+
/**
32+
* Output only. Identifies what kind of resource this is. Value: the fixed
33+
* string "youtube#batchGetStatsResponse".
34+
*
35+
* @var string
36+
*/
37+
public $kind;
38+
39+
/**
40+
* Output only. Etag of this resource.
41+
*
42+
* @param string $etag
43+
*/
44+
public function setEtag($etag)
45+
{
46+
$this->etag = $etag;
47+
}
48+
/**
49+
* @return string
50+
*/
51+
public function getEtag()
52+
{
53+
return $this->etag;
54+
}
55+
/**
56+
* Output only. The videos' stats information.
57+
*
58+
* @param VideoStat[] $items
59+
*/
60+
public function setItems($items)
61+
{
62+
$this->items = $items;
63+
}
64+
/**
65+
* @return VideoStat[]
66+
*/
67+
public function getItems()
68+
{
69+
return $this->items;
70+
}
71+
/**
72+
* Output only. Identifies what kind of resource this is. Value: the fixed
73+
* string "youtube#batchGetStatsResponse".
74+
*
75+
* @param string $kind
76+
*/
77+
public function setKind($kind)
78+
{
79+
$this->kind = $kind;
80+
}
81+
/**
82+
* @return string
83+
*/
84+
public function getKind()
85+
{
86+
return $this->kind;
87+
}
88+
}
89+
90+
// Adding a class alias for backwards compatibility with the previous class name.
91+
class_alias(BatchGetStatsResponse::class, 'Google_Service_YouTube_BatchGetStatsResponse');
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
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\BatchGetStatsResponse;
21+
22+
/**
23+
* The "videos" collection of methods.
24+
* Typical usage is:
25+
* <code>
26+
* $youtubeService = new Google\Service\YouTube(...);
27+
* $videos = $youtubeService->youtube_v3_videos;
28+
* </code>
29+
*/
30+
class YoutubeV3Videos extends \Google\Service\Resource
31+
{
32+
/**
33+
* Retrieves a batch of VideoStat resources, possibly filtered.
34+
* (videos.batchGetStats)
35+
*
36+
* @param array $optParams Optional parameters.
37+
*
38+
* @opt_param string onBehalfOfContentOwner Optional. **Note:** This parameter
39+
* is intended exclusively for YouTube content partners. The
40+
* `onBehalfOfContentOwner` parameter indicates that the request's authorization
41+
* credentials identify a YouTube CMS user who is acting on behalf of the
42+
* content owner specified in the parameter value. This parameter is intended
43+
* for YouTube content partners that own and manage many different YouTube
44+
* channels. It allows content owners to authenticate once and get access to all
45+
* their video and channel data, without having to provide authentication
46+
* credentials for each individual channel. The CMS account that the user
47+
* authenticates with must be linked to the specified YouTube content owner.
48+
* @opt_param string part Required. The `**part**` parameter specifies a comma-
49+
* separated list of one or more `videoStat` resource properties that the API
50+
* response will include. If the parameter identifies a property that contains
51+
* child properties, the child properties will be included in the response. For
52+
* example, in a `videoStat` resource, the `statistics` property contains
53+
* `view_count` and `like_count`. As such, if you set `**part=snippet**`, the
54+
* API response will contain all of those properties.
55+
* @opt_param string videoIds Required. Return videos with the given ids.
56+
* @return BatchGetStatsResponse
57+
* @throws \Google\Service\Exception
58+
*/
59+
public function batchGetStats($optParams = [])
60+
{
61+
$params = [];
62+
$params = array_merge($params, $optParams);
63+
return $this->call('batchGetStats', [$params], BatchGetStatsResponse::class);
64+
}
65+
}
66+
67+
// Adding a class alias for backwards compatibility with the previous class name.
68+
class_alias(YoutubeV3Videos::class, 'Google_Service_YouTube_Resource_YoutubeV3Videos');

src/YouTube/VideoStat.php

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
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;
19+
20+
class VideoStat extends \Google\Model
21+
{
22+
protected $contentDetailsType = VideoStatsContentDetails::class;
23+
protected $contentDetailsDataType = '';
24+
/**
25+
* Output only. Etag of this resource.
26+
*
27+
* @var string
28+
*/
29+
public $etag;
30+
/**
31+
* Output only. Identifies what kind of resource this is. Value: the fixed
32+
* string "youtube#videoStats".
33+
*
34+
* @var string
35+
*/
36+
public $kind;
37+
/**
38+
* Output only. Identifier. The resource name for the `VideoStats` resource,
39+
* in the format `videoStats/{video_stat}`.
40+
*
41+
* @var string
42+
*/
43+
public $name;
44+
protected $snippetType = VideoStatsSnippet::class;
45+
protected $snippetDataType = '';
46+
protected $statisticsType = VideoStatsStatistics::class;
47+
protected $statisticsDataType = '';
48+
/**
49+
* Output only. The ID that YouTube uses to uniquely identify the video.
50+
*
51+
* @var string
52+
*/
53+
public $videoId;
54+
55+
/**
56+
* Output only. The VideoStatsContentDetails object contains information about
57+
* the video content, including the length of the video.
58+
*
59+
* @param VideoStatsContentDetails $contentDetails
60+
*/
61+
public function setContentDetails(VideoStatsContentDetails $contentDetails)
62+
{
63+
$this->contentDetails = $contentDetails;
64+
}
65+
/**
66+
* @return VideoStatsContentDetails
67+
*/
68+
public function getContentDetails()
69+
{
70+
return $this->contentDetails;
71+
}
72+
/**
73+
* Output only. Etag of this resource.
74+
*
75+
* @param string $etag
76+
*/
77+
public function setEtag($etag)
78+
{
79+
$this->etag = $etag;
80+
}
81+
/**
82+
* @return string
83+
*/
84+
public function getEtag()
85+
{
86+
return $this->etag;
87+
}
88+
/**
89+
* Output only. Identifies what kind of resource this is. Value: the fixed
90+
* string "youtube#videoStats".
91+
*
92+
* @param string $kind
93+
*/
94+
public function setKind($kind)
95+
{
96+
$this->kind = $kind;
97+
}
98+
/**
99+
* @return string
100+
*/
101+
public function getKind()
102+
{
103+
return $this->kind;
104+
}
105+
/**
106+
* Output only. Identifier. The resource name for the `VideoStats` resource,
107+
* in the format `videoStats/{video_stat}`.
108+
*
109+
* @param string $name
110+
*/
111+
public function setName($name)
112+
{
113+
$this->name = $name;
114+
}
115+
/**
116+
* @return string
117+
*/
118+
public function getName()
119+
{
120+
return $this->name;
121+
}
122+
/**
123+
* Output only. The VideoStatsSnippet object contains basic details about the
124+
* video, such publish time.
125+
*
126+
* @param VideoStatsSnippet $snippet
127+
*/
128+
public function setSnippet(VideoStatsSnippet $snippet)
129+
{
130+
$this->snippet = $snippet;
131+
}
132+
/**
133+
* @return VideoStatsSnippet
134+
*/
135+
public function getSnippet()
136+
{
137+
return $this->snippet;
138+
}
139+
/**
140+
* Output only. The VideoStatsStatistics object contains statistics about the
141+
* video.
142+
*
143+
* @param VideoStatsStatistics $statistics
144+
*/
145+
public function setStatistics(VideoStatsStatistics $statistics)
146+
{
147+
$this->statistics = $statistics;
148+
}
149+
/**
150+
* @return VideoStatsStatistics
151+
*/
152+
public function getStatistics()
153+
{
154+
return $this->statistics;
155+
}
156+
/**
157+
* Output only. The ID that YouTube uses to uniquely identify the video.
158+
*
159+
* @param string $videoId
160+
*/
161+
public function setVideoId($videoId)
162+
{
163+
$this->videoId = $videoId;
164+
}
165+
/**
166+
* @return string
167+
*/
168+
public function getVideoId()
169+
{
170+
return $this->videoId;
171+
}
172+
}
173+
174+
// Adding a class alias for backwards compatibility with the previous class name.
175+
class_alias(VideoStat::class, 'Google_Service_YouTube_VideoStat');

0 commit comments

Comments
 (0)