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