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\GoogleCloudAiplatformV1CancelTuningJobRequest;
|
---|
21 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1ListTuningJobsResponse;
|
---|
22 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1RebaseTunedModelRequest;
|
---|
23 | use Google\Service\Aiplatform\GoogleCloudAiplatformV1TuningJob;
|
---|
24 | use Google\Service\Aiplatform\GoogleLongrunningOperation;
|
---|
25 | use Google\Service\Aiplatform\GoogleProtobufEmpty;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * The "tuningJobs" collection of methods.
|
---|
29 | * Typical usage is:
|
---|
30 | * <code>
|
---|
31 | * $aiplatformService = new Google\Service\Aiplatform(...);
|
---|
32 | * $tuningJobs = $aiplatformService->projects_locations_tuningJobs;
|
---|
33 | * </code>
|
---|
34 | */
|
---|
35 | class ProjectsLocationsTuningJobs extends \Google\Service\Resource
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * Cancels a TuningJob. Starts asynchronous cancellation on the TuningJob. The
|
---|
39 | * server makes a best effort to cancel the job, but success is not guaranteed.
|
---|
40 | * Clients can use GenAiTuningService.GetTuningJob or other methods to check
|
---|
41 | * whether the cancellation succeeded or whether the job completed despite
|
---|
42 | * cancellation. On successful cancellation, the TuningJob is not deleted;
|
---|
43 | * instead it becomes a job with a TuningJob.error value with a
|
---|
44 | * google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`, and
|
---|
45 | * TuningJob.state is set to `CANCELLED`. (tuningJobs.cancel)
|
---|
46 | *
|
---|
47 | * @param string $name Required. The name of the TuningJob to cancel. Format:
|
---|
48 | * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
|
---|
49 | * @param GoogleCloudAiplatformV1CancelTuningJobRequest $postBody
|
---|
50 | * @param array $optParams Optional parameters.
|
---|
51 | * @return GoogleProtobufEmpty
|
---|
52 | * @throws \Google\Service\Exception
|
---|
53 | */
|
---|
54 | public function cancel($name, GoogleCloudAiplatformV1CancelTuningJobRequest $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 TuningJob. A created TuningJob right away will be attempted to be
|
---|
62 | * run. (tuningJobs.create)
|
---|
63 | *
|
---|
64 | * @param string $parent Required. The resource name of the Location to create
|
---|
65 | * the TuningJob in. Format: `projects/{project}/locations/{location}`
|
---|
66 | * @param GoogleCloudAiplatformV1TuningJob $postBody
|
---|
67 | * @param array $optParams Optional parameters.
|
---|
68 | * @return GoogleCloudAiplatformV1TuningJob
|
---|
69 | * @throws \Google\Service\Exception
|
---|
70 | */
|
---|
71 | public function create($parent, GoogleCloudAiplatformV1TuningJob $postBody, $optParams = [])
|
---|
72 | {
|
---|
73 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
74 | $params = array_merge($params, $optParams);
|
---|
75 | return $this->call('create', [$params], GoogleCloudAiplatformV1TuningJob::class);
|
---|
76 | }
|
---|
77 | /**
|
---|
78 | * Gets a TuningJob. (tuningJobs.get)
|
---|
79 | *
|
---|
80 | * @param string $name Required. The name of the TuningJob resource. Format:
|
---|
81 | * `projects/{project}/locations/{location}/tuningJobs/{tuning_job}`
|
---|
82 | * @param array $optParams Optional parameters.
|
---|
83 | * @return GoogleCloudAiplatformV1TuningJob
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function get($name, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['name' => $name];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('get', [$params], GoogleCloudAiplatformV1TuningJob::class);
|
---|
91 | }
|
---|
92 | /**
|
---|
93 | * Lists TuningJobs in a Location. (tuningJobs.listProjectsLocationsTuningJobs)
|
---|
94 | *
|
---|
95 | * @param string $parent Required. The resource name of the Location to list the
|
---|
96 | * TuningJobs from. Format: `projects/{project}/locations/{location}`
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | *
|
---|
99 | * @opt_param string filter Optional. The standard list filter.
|
---|
100 | * @opt_param int pageSize Optional. The standard list page size.
|
---|
101 | * @opt_param string pageToken Optional. The standard list page token. Typically
|
---|
102 | * obtained via ListTuningJobsResponse.next_page_token of the previous
|
---|
103 | * GenAiTuningService.ListTuningJob][] call.
|
---|
104 | * @return GoogleCloudAiplatformV1ListTuningJobsResponse
|
---|
105 | * @throws \Google\Service\Exception
|
---|
106 | */
|
---|
107 | public function listProjectsLocationsTuningJobs($parent, $optParams = [])
|
---|
108 | {
|
---|
109 | $params = ['parent' => $parent];
|
---|
110 | $params = array_merge($params, $optParams);
|
---|
111 | return $this->call('list', [$params], GoogleCloudAiplatformV1ListTuningJobsResponse::class);
|
---|
112 | }
|
---|
113 | /**
|
---|
114 | * Rebase a TunedModel. (tuningJobs.rebaseTunedModel)
|
---|
115 | *
|
---|
116 | * @param string $parent Required. The resource name of the Location into which
|
---|
117 | * to rebase the Model. Format: `projects/{project}/locations/{location}`
|
---|
118 | * @param GoogleCloudAiplatformV1RebaseTunedModelRequest $postBody
|
---|
119 | * @param array $optParams Optional parameters.
|
---|
120 | * @return GoogleLongrunningOperation
|
---|
121 | * @throws \Google\Service\Exception
|
---|
122 | */
|
---|
123 | public function rebaseTunedModel($parent, GoogleCloudAiplatformV1RebaseTunedModelRequest $postBody, $optParams = [])
|
---|
124 | {
|
---|
125 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
126 | $params = array_merge($params, $optParams);
|
---|
127 | return $this->call('rebaseTunedModel', [$params], GoogleLongrunningOperation::class);
|
---|
128 | }
|
---|
129 | }
|
---|
130 |
|
---|
131 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
132 | class_alias(ProjectsLocationsTuningJobs::class, 'Google_Service_Aiplatform_Resource_ProjectsLocationsTuningJobs');
|
---|