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