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\WorkloadManager\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\WorkloadManager\Execution;
|
---|
21 | use Google\Service\WorkloadManager\ListExecutionsResponse;
|
---|
22 | use Google\Service\WorkloadManager\Operation;
|
---|
23 | use Google\Service\WorkloadManager\RunEvaluationRequest;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "executions" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $workloadmanagerService = new Google\Service\WorkloadManager(...);
|
---|
30 | * $executions = $workloadmanagerService->projects_locations_evaluations_executions;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocationsEvaluationsExecutions extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Deletes a single Execution. (executions.delete)
|
---|
37 | *
|
---|
38 | * @param string $name Required. Name of the resource
|
---|
39 | * @param array $optParams Optional parameters.
|
---|
40 | *
|
---|
41 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
42 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
43 | * the server will know to ignore the request if it has already been completed.
|
---|
44 | * The server will guarantee that for at least 60 minutes after the first
|
---|
45 | * request. For example, consider a situation where you make an initial request
|
---|
46 | * and the request times out. If you make the request again with the same
|
---|
47 | * request ID, the server can check if original operation with the same request
|
---|
48 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
49 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
50 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
51 | * (00000000-0000-0000-0000-000000000000).
|
---|
52 | * @return Operation
|
---|
53 | * @throws \Google\Service\Exception
|
---|
54 | */
|
---|
55 | public function delete($name, $optParams = [])
|
---|
56 | {
|
---|
57 | $params = ['name' => $name];
|
---|
58 | $params = array_merge($params, $optParams);
|
---|
59 | return $this->call('delete', [$params], Operation::class);
|
---|
60 | }
|
---|
61 | /**
|
---|
62 | * Gets details of a single Execution. (executions.get)
|
---|
63 | *
|
---|
64 | * @param string $name Required. Name of the resource
|
---|
65 | * @param array $optParams Optional parameters.
|
---|
66 | * @return Execution
|
---|
67 | * @throws \Google\Service\Exception
|
---|
68 | */
|
---|
69 | public function get($name, $optParams = [])
|
---|
70 | {
|
---|
71 | $params = ['name' => $name];
|
---|
72 | $params = array_merge($params, $optParams);
|
---|
73 | return $this->call('get', [$params], Execution::class);
|
---|
74 | }
|
---|
75 | /**
|
---|
76 | * Lists Executions in a given project and location.
|
---|
77 | * (executions.listProjectsLocationsEvaluationsExecutions)
|
---|
78 | *
|
---|
79 | * @param string $parent Required. The resource prefix of the Execution using
|
---|
80 | * the form: 'projects/{project}/locations/{location}/evaluations/{evaluation}'
|
---|
81 | * @param array $optParams Optional parameters.
|
---|
82 | *
|
---|
83 | * @opt_param string filter Filtering results
|
---|
84 | * @opt_param string orderBy Field to sort by. See
|
---|
85 | * https://google.aip.dev/132#ordering for more details.
|
---|
86 | * @opt_param int pageSize Requested page size. Server may return fewer items
|
---|
87 | * than requested. If unspecified, server will pick an appropriate default.
|
---|
88 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
89 | * should return.
|
---|
90 | * @return ListExecutionsResponse
|
---|
91 | * @throws \Google\Service\Exception
|
---|
92 | */
|
---|
93 | public function listProjectsLocationsEvaluationsExecutions($parent, $optParams = [])
|
---|
94 | {
|
---|
95 | $params = ['parent' => $parent];
|
---|
96 | $params = array_merge($params, $optParams);
|
---|
97 | return $this->call('list', [$params], ListExecutionsResponse::class);
|
---|
98 | }
|
---|
99 | /**
|
---|
100 | * Creates a new Execution in a given project and location. (executions.run)
|
---|
101 | *
|
---|
102 | * @param string $name Required. The resource name of the Execution using the
|
---|
103 | * form: 'projects/{project}/locations/{location}/evaluations/{evaluation}/execu
|
---|
104 | * tions/{execution}'
|
---|
105 | * @param RunEvaluationRequest $postBody
|
---|
106 | * @param array $optParams Optional parameters.
|
---|
107 | * @return Operation
|
---|
108 | * @throws \Google\Service\Exception
|
---|
109 | */
|
---|
110 | public function run($name, RunEvaluationRequest $postBody, $optParams = [])
|
---|
111 | {
|
---|
112 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
113 | $params = array_merge($params, $optParams);
|
---|
114 | return $this->call('run', [$params], Operation::class);
|
---|
115 | }
|
---|
116 | }
|
---|
117 |
|
---|
118 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
119 | class_alias(ProjectsLocationsEvaluationsExecutions::class, 'Google_Service_WorkloadManager_Resource_ProjectsLocationsEvaluationsExecutions');
|
---|