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
18namespace Google\Service\YouTubeReporting\Resource;
19
20use Google\Service\YouTubeReporting\Job;
21use Google\Service\YouTubeReporting\ListJobsResponse;
22use Google\Service\YouTubeReporting\YoutubereportingEmpty;
23
24/**
25 * The "jobs" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $youtubereportingService = new Google\Service\YouTubeReporting(...);
29 *   $jobs = $youtubereportingService->jobs;
30 *  </code>
31 */
32class Jobs extends \Google\Service\Resource
33{
34  /**
35   * Creates a job and returns it. (jobs.create)
36   *
37   * @param Job $postBody
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 Job
44   */
45  public function create(Job $postBody, $optParams = [])
46  {
47    $params = ['postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('create', [$params], Job::class);
50  }
51  /**
52   * Deletes a job. (jobs.delete)
53   *
54   * @param string $jobId The ID of the job to delete.
55   * @param array $optParams Optional parameters.
56   *
57   * @opt_param string onBehalfOfContentOwner The content owner's external ID on
58   * which behalf the user is acting on. If not set, the user is acting for
59   * himself (his own channel).
60   * @return YoutubereportingEmpty
61   */
62  public function delete($jobId, $optParams = [])
63  {
64    $params = ['jobId' => $jobId];
65    $params = array_merge($params, $optParams);
66    return $this->call('delete', [$params], YoutubereportingEmpty::class);
67  }
68  /**
69   * Gets a job. (jobs.get)
70   *
71   * @param string $jobId The ID of the job to retrieve.
72   * @param array $optParams Optional parameters.
73   *
74   * @opt_param string onBehalfOfContentOwner The content owner's external ID on
75   * which behalf the user is acting on. If not set, the user is acting for
76   * himself (his own channel).
77   * @return Job
78   */
79  public function get($jobId, $optParams = [])
80  {
81    $params = ['jobId' => $jobId];
82    $params = array_merge($params, $optParams);
83    return $this->call('get', [$params], Job::class);
84  }
85  /**
86   * Lists jobs. (jobs.listJobs)
87   *
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param bool includeSystemManaged If set to true, also system-managed jobs
91   * will be returned; otherwise only user-created jobs will be returned. System-
92   * managed jobs can neither be modified nor deleted.
93   * @opt_param string onBehalfOfContentOwner The content owner's external ID on
94   * which behalf the user is acting on. If not set, the user is acting for
95   * himself (his own channel).
96   * @opt_param int pageSize Requested page size. Server may return fewer jobs
97   * than requested. If unspecified, server will pick an appropriate default.
98   * @opt_param string pageToken A token identifying a page of results the server
99   * should return. Typically, this is the value of
100   * ListReportTypesResponse.next_page_token returned in response to the previous
101   * call to the `ListJobs` method.
102   * @return ListJobsResponse
103   */
104  public function listJobs($optParams = [])
105  {
106    $params = [];
107    $params = array_merge($params, $optParams);
108    return $this->call('list', [$params], ListJobsResponse::class);
109  }
110}
111
112// Adding a class alias for backwards compatibility with the previous class name.
113class_alias(Jobs::class, 'Google_Service_YouTubeReporting_Resource_Jobs');
114