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\Transcoder\Resource;
19
20use Google\Service\Transcoder\Job;
21use Google\Service\Transcoder\ListJobsResponse;
22use Google\Service\Transcoder\TranscoderEmpty;
23
24/**
25 * The "jobs" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $transcoderService = new Google\Service\Transcoder(...);
29 *   $jobs = $transcoderService->jobs;
30 *  </code>
31 */
32class ProjectsLocationsJobs extends \Google\Service\Resource
33{
34  /**
35   * Creates a job in the specified region. (jobs.create)
36   *
37   * @param string $parent Required. The parent location to create and process
38   * this job. Format: `projects/{project}/locations/{location}`
39   * @param Job $postBody
40   * @param array $optParams Optional parameters.
41   * @return Job
42   */
43  public function create($parent, Job $postBody, $optParams = [])
44  {
45    $params = ['parent' => $parent, 'postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('create', [$params], Job::class);
48  }
49  /**
50   * Deletes a job. (jobs.delete)
51   *
52   * @param string $name Required. The name of the job to delete. Format:
53   * `projects/{project}/locations/{location}/jobs/{job}`
54   * @param array $optParams Optional parameters.
55   *
56   * @opt_param bool allowMissing If set to true, and the job is not found, the
57   * request will succeed but no action will be taken on the server.
58   * @return TranscoderEmpty
59   */
60  public function delete($name, $optParams = [])
61  {
62    $params = ['name' => $name];
63    $params = array_merge($params, $optParams);
64    return $this->call('delete', [$params], TranscoderEmpty::class);
65  }
66  /**
67   * Returns the job data. (jobs.get)
68   *
69   * @param string $name Required. The name of the job to retrieve. Format:
70   * `projects/{project}/locations/{location}/jobs/{job}`
71   * @param array $optParams Optional parameters.
72   * @return Job
73   */
74  public function get($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('get', [$params], Job::class);
79  }
80  /**
81   * Lists jobs in the specified region. (jobs.listProjectsLocationsJobs)
82   *
83   * @param string $parent Required. Format:
84   * `projects/{project}/locations/{location}`
85   * @param array $optParams Optional parameters.
86   *
87   * @opt_param string filter The filter expression, following the syntax outlined
88   * in https://google.aip.dev/160.
89   * @opt_param string orderBy One or more fields to compare and use to sort the
90   * output. See https://google.aip.dev/132#ordering.
91   * @opt_param int pageSize The maximum number of items to return.
92   * @opt_param string pageToken The `next_page_token` value returned from a
93   * previous List request, if any.
94   * @return ListJobsResponse
95   */
96  public function listProjectsLocationsJobs($parent, $optParams = [])
97  {
98    $params = ['parent' => $parent];
99    $params = array_merge($params, $optParams);
100    return $this->call('list', [$params], ListJobsResponse::class);
101  }
102}
103
104// Adding a class alias for backwards compatibility with the previous class name.
105class_alias(ProjectsLocationsJobs::class, 'Google_Service_Transcoder_Resource_ProjectsLocationsJobs');
106