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