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\DataLabeling\Resource; 19 20use Google\Service\DataLabeling\GoogleCloudDatalabelingV1beta1CreateInstructionRequest; 21use Google\Service\DataLabeling\GoogleCloudDatalabelingV1beta1Instruction; 22use Google\Service\DataLabeling\GoogleCloudDatalabelingV1beta1ListInstructionsResponse; 23use Google\Service\DataLabeling\GoogleLongrunningOperation; 24use Google\Service\DataLabeling\GoogleProtobufEmpty; 25 26/** 27 * The "instructions" collection of methods. 28 * Typical usage is: 29 * <code> 30 * $datalabelingService = new Google\Service\DataLabeling(...); 31 * $instructions = $datalabelingService->instructions; 32 * </code> 33 */ 34class ProjectsInstructions extends \Google\Service\Resource 35{ 36 /** 37 * Creates an instruction for how data should be labeled. (instructions.create) 38 * 39 * @param string $parent Required. Instruction resource parent, format: 40 * projects/{project_id} 41 * @param GoogleCloudDatalabelingV1beta1CreateInstructionRequest $postBody 42 * @param array $optParams Optional parameters. 43 * @return GoogleLongrunningOperation 44 */ 45 public function create($parent, GoogleCloudDatalabelingV1beta1CreateInstructionRequest $postBody, $optParams = []) 46 { 47 $params = ['parent' => $parent, 'postBody' => $postBody]; 48 $params = array_merge($params, $optParams); 49 return $this->call('create', [$params], GoogleLongrunningOperation::class); 50 } 51 /** 52 * Deletes an instruction object by resource name. (instructions.delete) 53 * 54 * @param string $name Required. Instruction resource name, format: 55 * projects/{project_id}/instructions/{instruction_id} 56 * @param array $optParams Optional parameters. 57 * @return GoogleProtobufEmpty 58 */ 59 public function delete($name, $optParams = []) 60 { 61 $params = ['name' => $name]; 62 $params = array_merge($params, $optParams); 63 return $this->call('delete', [$params], GoogleProtobufEmpty::class); 64 } 65 /** 66 * Gets an instruction by resource name. (instructions.get) 67 * 68 * @param string $name Required. Instruction resource name, format: 69 * projects/{project_id}/instructions/{instruction_id} 70 * @param array $optParams Optional parameters. 71 * @return GoogleCloudDatalabelingV1beta1Instruction 72 */ 73 public function get($name, $optParams = []) 74 { 75 $params = ['name' => $name]; 76 $params = array_merge($params, $optParams); 77 return $this->call('get', [$params], GoogleCloudDatalabelingV1beta1Instruction::class); 78 } 79 /** 80 * Lists instructions for a project. Pagination is supported. 81 * (instructions.listProjectsInstructions) 82 * 83 * @param string $parent Required. Instruction resource parent, format: 84 * projects/{project_id} 85 * @param array $optParams Optional parameters. 86 * 87 * @opt_param string filter Optional. Filter is not supported at this moment. 88 * @opt_param int pageSize Optional. Requested page size. Server may return 89 * fewer results than requested. Default value is 100. 90 * @opt_param string pageToken Optional. A token identifying a page of results 91 * for the server to return. Typically obtained by 92 * ListInstructionsResponse.next_page_token of the previous 93 * [DataLabelingService.ListInstructions] call. Return first page if empty. 94 * @return GoogleCloudDatalabelingV1beta1ListInstructionsResponse 95 */ 96 public function listProjectsInstructions($parent, $optParams = []) 97 { 98 $params = ['parent' => $parent]; 99 $params = array_merge($params, $optParams); 100 return $this->call('list', [$params], GoogleCloudDatalabelingV1beta1ListInstructionsResponse::class); 101 } 102} 103 104// Adding a class alias for backwards compatibility with the previous class name. 105class_alias(ProjectsInstructions::class, 'Google_Service_DataLabeling_Resource_ProjectsInstructions'); 106