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\YouTubeReporting\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\YouTubeReporting\ListReportsResponse;
|
---|
21 | use Google\Service\YouTubeReporting\Report;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "reports" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $youtubereportingService = new Google\Service\YouTubeReporting(...);
|
---|
28 | * $reports = $youtubereportingService->jobs_reports;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class JobsReports extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Gets the metadata of a specific report. (reports.get)
|
---|
35 | *
|
---|
36 | * @param string $jobId The ID of the job.
|
---|
37 | * @param string $reportId The ID of the report to retrieve.
|
---|
38 | * @param array $optParams Optional parameters.
|
---|
39 | *
|
---|
40 | * @opt_param string onBehalfOfContentOwner The content owner's external ID on
|
---|
41 | * which behalf the user is acting on. If not set, the user is acting for
|
---|
42 | * himself (his own channel).
|
---|
43 | * @return Report
|
---|
44 | * @throws \Google\Service\Exception
|
---|
45 | */
|
---|
46 | public function get($jobId, $reportId, $optParams = [])
|
---|
47 | {
|
---|
48 | $params = ['jobId' => $jobId, 'reportId' => $reportId];
|
---|
49 | $params = array_merge($params, $optParams);
|
---|
50 | return $this->call('get', [$params], Report::class);
|
---|
51 | }
|
---|
52 | /**
|
---|
53 | * Lists reports created by a specific job. Returns NOT_FOUND if the job does
|
---|
54 | * not exist. (reports.listJobsReports)
|
---|
55 | *
|
---|
56 | * @param string $jobId The ID of the job.
|
---|
57 | * @param array $optParams Optional parameters.
|
---|
58 | *
|
---|
59 | * @opt_param string createdAfter If set, only reports created after the
|
---|
60 | * specified date/time are returned.
|
---|
61 | * @opt_param string onBehalfOfContentOwner The content owner's external ID on
|
---|
62 | * which behalf the user is acting on. If not set, the user is acting for
|
---|
63 | * himself (his own channel).
|
---|
64 | * @opt_param int pageSize Requested page size. Server may return fewer report
|
---|
65 | * types than requested. If unspecified, server will pick an appropriate
|
---|
66 | * default.
|
---|
67 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
68 | * should return. Typically, this is the value of
|
---|
69 | * ListReportsResponse.next_page_token returned in response to the previous call
|
---|
70 | * to the `ListReports` method.
|
---|
71 | * @opt_param string startTimeAtOrAfter If set, only reports whose start time is
|
---|
72 | * greater than or equal the specified date/time are returned.
|
---|
73 | * @opt_param string startTimeBefore If set, only reports whose start time is
|
---|
74 | * smaller than the specified date/time are returned.
|
---|
75 | * @return ListReportsResponse
|
---|
76 | * @throws \Google\Service\Exception
|
---|
77 | */
|
---|
78 | public function listJobsReports($jobId, $optParams = [])
|
---|
79 | {
|
---|
80 | $params = ['jobId' => $jobId];
|
---|
81 | $params = array_merge($params, $optParams);
|
---|
82 | return $this->call('list', [$params], ListReportsResponse::class);
|
---|
83 | }
|
---|
84 | }
|
---|
85 |
|
---|
86 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
87 | class_alias(JobsReports::class, 'Google_Service_YouTubeReporting_Resource_JobsReports');
|
---|