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\Aiplatform\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1BatchPredictionJob;
|
---|
21 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1CancelBatchPredictionJobRequest;
|
---|
22 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1ListBatchPredictionJobsResponse;
|
---|
23 | use Google\Service\Aiplatform\GoogleLongrunningOperation;
|
---|
24 | use Google\Service\Aiplatform\GoogleProtobufEmpty;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "batchPredictionJobs" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $aiplatformService = new Google\Service\Aiplatform(...);
|
---|
31 | * $batchPredictionJobs = $aiplatformService->projects_locations_batchPredictionJobs;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsLocationsBatchPredictionJobs extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Cancels a BatchPredictionJob. Starts asynchronous cancellation on the
|
---|
38 | * BatchPredictionJob. The server makes the best effort to cancel the job, but
|
---|
39 | * success is not guaranteed. Clients can use JobService.GetBatchPredictionJob
|
---|
40 | * or other methods to check whether the cancellation succeeded or whether the
|
---|
41 | * job completed despite cancellation. On a successful cancellation, the
|
---|
42 | * BatchPredictionJob is not deleted;instead its BatchPredictionJob.state is set
|
---|
43 | * to `CANCELLED`. Any files already outputted by the job are not deleted.
|
---|
44 | * (batchPredictionJobs.cancel)
|
---|
45 | *
|
---|
46 | * @param string $name Required. The name of the BatchPredictionJob to cancel.
|
---|
47 | * Format: `projects/{project}/locations/{location}/batchPredictionJobs/{batch_p
|
---|
48 | * rediction_job}`
|
---|
49 | * @param GoogleCloudAiplatformV1CancelBatchPredictionJobRequest $postBody
|
---|
50 | * @param array $optParams Optional parameters.
|
---|
51 | * @return GoogleProtobufEmpty
|
---|
52 | * @throws \Google\Service\Exception
|
---|
53 | */
|
---|
54 | public function cancel($name, GoogleCloudAiplatformV1CancelBatchPredictionJobRequest $postBody, $optParams = [])
|
---|
55 | {
|
---|
56 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
57 | $params = array_merge($params, $optParams);
|
---|
58 | return $this->call('cancel', [$params], GoogleProtobufEmpty::class);
|
---|
59 | }
|
---|
60 | /**
|
---|
61 | * Creates a BatchPredictionJob. A BatchPredictionJob once created will right
|
---|
62 | * away be attempted to start. (batchPredictionJobs.create)
|
---|
63 | *
|
---|
64 | * @param string $parent Required. The resource name of the Location to create
|
---|
65 | * the BatchPredictionJob in. Format: `projects/{project}/locations/{location}`
|
---|
66 | * @param GoogleCloudAiplatformV1BatchPredictionJob $postBody
|
---|
67 | * @param array $optParams Optional parameters.
|
---|
68 | * @return GoogleCloudAiplatformV1BatchPredictionJob
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function create($parent, GoogleCloudAiplatformV1BatchPredictionJob $postBody, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('create', [$params], GoogleCloudAiplatformV1BatchPredictionJob::class);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * Deletes a BatchPredictionJob. Can only be called on jobs that already
|
---|
79 | * finished. (batchPredictionJobs.delete)
|
---|
80 | *
|
---|
81 | * @param string $name Required. The name of the BatchPredictionJob resource to
|
---|
82 | * be deleted. Format: `projects/{project}/locations/{location}/batchPredictionJ
|
---|
83 | * obs/{batch_prediction_job}`
|
---|
84 | * @param array $optParams Optional parameters.
|
---|
85 | * @return GoogleLongrunningOperation
|
---|
86 | * @throws \Google\Service\Exception
|
---|
87 | */
|
---|
88 | public function delete($name, $optParams = [])
|
---|
89 | {
|
---|
90 | $params = ['name' => $name];
|
---|
91 | $params = array_merge($params, $optParams);
|
---|
92 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
93 | }
|
---|
94 | /**
|
---|
95 | * Gets a BatchPredictionJob (batchPredictionJobs.get)
|
---|
96 | *
|
---|
97 | * @param string $name Required. The name of the BatchPredictionJob resource.
|
---|
98 | * Format: `projects/{project}/locations/{location}/batchPredictionJobs/{batch_p
|
---|
99 | * rediction_job}`
|
---|
100 | * @param array $optParams Optional parameters.
|
---|
101 | * @return GoogleCloudAiplatformV1BatchPredictionJob
|
---|
102 | * @throws \Google\Service\Exception
|
---|
103 | */
|
---|
104 | public function get($name, $optParams = [])
|
---|
105 | {
|
---|
106 | $params = ['name' => $name];
|
---|
107 | $params = array_merge($params, $optParams);
|
---|
108 | return $this->call('get', [$params], GoogleCloudAiplatformV1BatchPredictionJob::class);
|
---|
109 | }
|
---|
110 | /**
|
---|
111 | * Lists BatchPredictionJobs in a Location.
|
---|
112 | * (batchPredictionJobs.listProjectsLocationsBatchPredictionJobs)
|
---|
113 | *
|
---|
114 | * @param string $parent Required. The resource name of the Location to list the
|
---|
115 | * BatchPredictionJobs from. Format: `projects/{project}/locations/{location}`
|
---|
116 | * @param array $optParams Optional parameters.
|
---|
117 | *
|
---|
118 | * @opt_param string filter The standard list filter. Supported fields: *
|
---|
119 | * `display_name` supports `=`, `!=` comparisons, and `:` wildcard. *
|
---|
120 | * `model_display_name` supports `=`, `!=` comparisons. * `state` supports `=`,
|
---|
121 | * `!=` comparisons. * `create_time` supports `=`, `!=`,`<`, `<=`,`>`, `>=`
|
---|
122 | * comparisons. `create_time` must be in RFC 3339 format. * `labels` supports
|
---|
123 | * general map functions that is: `labels.key=value` - key:value equality
|
---|
124 | * `labels.key:* - key existence Some examples of using the filter are: *
|
---|
125 | * `state="JOB_STATE_SUCCEEDED" AND display_name:"my_job_*"` *
|
---|
126 | * `state!="JOB_STATE_FAILED" OR display_name="my_job"` * `NOT
|
---|
127 | * display_name="my_job"` * `create_time>"2021-05-18T00:00:00Z"` *
|
---|
128 | * `labels.keyA=valueA` * `labels.keyB:*`
|
---|
129 | * @opt_param int pageSize The standard list page size.
|
---|
130 | * @opt_param string pageToken The standard list page token. Typically obtained
|
---|
131 | * via ListBatchPredictionJobsResponse.next_page_token of the previous
|
---|
132 | * JobService.ListBatchPredictionJobs call.
|
---|
133 | * @opt_param string readMask Mask specifying which fields to read.
|
---|
134 | * @return GoogleCloudAiplatformV1ListBatchPredictionJobsResponse
|
---|
135 | * @throws \Google\Service\Exception
|
---|
136 | */
|
---|
137 | public function listProjectsLocationsBatchPredictionJobs($parent, $optParams = [])
|
---|
138 | {
|
---|
139 | $params = ['parent' => $parent];
|
---|
140 | $params = array_merge($params, $optParams);
|
---|
141 | return $this->call('list', [$params], GoogleCloudAiplatformV1ListBatchPredictionJobsResponse::class);
|
---|
142 | }
|
---|
143 | }
|
---|
144 |
|
---|
145 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
146 | class_alias(ProjectsLocationsBatchPredictionJobs::class, 'Google_Service_Aiplatform_Resource_ProjectsLocationsBatchPredictionJobs');
|
---|