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\AppHub\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\AppHub\ListWorkloadsResponse;
|
---|
21 | use Google\Service\AppHub\Operation;
|
---|
22 | use Google\Service\AppHub\Workload;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "workloads" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $apphubService = new Google\Service\AppHub(...);
|
---|
29 | * $workloads = $apphubService->projects_locations_applications_workloads;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsApplicationsWorkloads extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a Workload in an Application. (workloads.create)
|
---|
36 | *
|
---|
37 | * @param string $parent Required. Fully qualified name of the Application to
|
---|
38 | * create Workload in. Expected format:
|
---|
39 | * `projects/{project}/locations/{location}/applications/{application}`.
|
---|
40 | * @param Workload $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | *
|
---|
43 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
44 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
45 | * the server will know to ignore the request if it has already been completed.
|
---|
46 | * The server will guarantee that for at least 60 minutes since the first
|
---|
47 | * request. For example, consider a situation where you make an initial request
|
---|
48 | * and the request times out. If you make the request again with the same
|
---|
49 | * request ID, the server can check if original operation with the same request
|
---|
50 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
51 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
52 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
53 | * (00000000-0000-0000-0000-000000000000).
|
---|
54 | * @opt_param string workloadId Required. The Workload identifier. Must contain
|
---|
55 | * only lowercase letters, numbers or hyphens, with the first character a
|
---|
56 | * letter, the last a letter or a number, and a 63 character maximum.
|
---|
57 | * @return Operation
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function create($parent, Workload $postBody, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('create', [$params], Operation::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Deletes a Workload from an Application. (workloads.delete)
|
---|
68 | *
|
---|
69 | * @param string $name Required. Fully qualified name of the Workload to delete
|
---|
70 | * from an Application. Expected format: `projects/{project}/locations/{location
|
---|
71 | * }/applications/{application}/workloads/{workload}`.
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | *
|
---|
74 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
75 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
76 | * the server will know to ignore the request if it has already been completed.
|
---|
77 | * The server will guarantee that for at least 60 minutes after the first
|
---|
78 | * request. For example, consider a situation where you make an initial request
|
---|
79 | * and the request times out. If you make the request again with the same
|
---|
80 | * request ID, the server can check if original operation with the same request
|
---|
81 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
82 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
83 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
84 | * (00000000-0000-0000-0000-000000000000).
|
---|
85 | * @return Operation
|
---|
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], Operation::class);
|
---|
93 | }
|
---|
94 | /**
|
---|
95 | * Gets a Workload in an Application. (workloads.get)
|
---|
96 | *
|
---|
97 | * @param string $name Required. Fully qualified name of the Workload to fetch.
|
---|
98 | * Expected format: `projects/{project}/locations/{location}/applications/{appli
|
---|
99 | * cation}/workloads/{workload}`.
|
---|
100 | * @param array $optParams Optional parameters.
|
---|
101 | * @return Workload
|
---|
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], Workload::class);
|
---|
109 | }
|
---|
110 | /**
|
---|
111 | * Lists Workloads in an Application.
|
---|
112 | * (workloads.listProjectsLocationsApplicationsWorkloads)
|
---|
113 | *
|
---|
114 | * @param string $parent Required. Fully qualified name of the parent
|
---|
115 | * Application to list Workloads for. Expected format:
|
---|
116 | * `projects/{project}/locations/{location}/applications/{application}`.
|
---|
117 | * @param array $optParams Optional parameters.
|
---|
118 | *
|
---|
119 | * @opt_param string filter Optional. Filtering results.
|
---|
120 | * @opt_param string orderBy Optional. Hint for how to order the results.
|
---|
121 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
122 | * fewer items than requested. If unspecified, server will pick an appropriate
|
---|
123 | * default.
|
---|
124 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
125 | * the server should return.
|
---|
126 | * @return ListWorkloadsResponse
|
---|
127 | * @throws \Google\Service\Exception
|
---|
128 | */
|
---|
129 | public function listProjectsLocationsApplicationsWorkloads($parent, $optParams = [])
|
---|
130 | {
|
---|
131 | $params = ['parent' => $parent];
|
---|
132 | $params = array_merge($params, $optParams);
|
---|
133 | return $this->call('list', [$params], ListWorkloadsResponse::class);
|
---|
134 | }
|
---|
135 | /**
|
---|
136 | * Updates a Workload in an Application. (workloads.patch)
|
---|
137 | *
|
---|
138 | * @param string $name Identifier. The resource name of the Workload. Format:
|
---|
139 | * `"projects/{host-project-id}/locations/{location}/applications/{application-
|
---|
140 | * id}/workloads/{workload-id}"`
|
---|
141 | * @param Workload $postBody
|
---|
142 | * @param array $optParams Optional parameters.
|
---|
143 | *
|
---|
144 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
145 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
146 | * the server will know to ignore the request if it has already been completed.
|
---|
147 | * The server will guarantee that for at least 60 minutes since the first
|
---|
148 | * request. For example, consider a situation where you make an initial request
|
---|
149 | * and the request times out. If you make the request again with the same
|
---|
150 | * request ID, the server can check if original operation with the same request
|
---|
151 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
152 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
153 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
154 | * (00000000-0000-0000-0000-000000000000).
|
---|
155 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
156 | * fields to be overwritten in the Workload resource by the update. The fields
|
---|
157 | * specified in the update_mask are relative to the resource, not the full
|
---|
158 | * request. The API changes the values of the fields as specified in the
|
---|
159 | * update_mask. The API ignores the values of all fields not covered by the
|
---|
160 | * update_mask. You can also unset a field by not specifying it in the updated
|
---|
161 | * message, but adding the field to the mask. This clears whatever value the
|
---|
162 | * field previously had.
|
---|
163 | * @return Operation
|
---|
164 | * @throws \Google\Service\Exception
|
---|
165 | */
|
---|
166 | public function patch($name, Workload $postBody, $optParams = [])
|
---|
167 | {
|
---|
168 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
169 | $params = array_merge($params, $optParams);
|
---|
170 | return $this->call('patch', [$params], Operation::class);
|
---|
171 | }
|
---|
172 | }
|
---|
173 |
|
---|
174 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
175 | class_alias(ProjectsLocationsApplicationsWorkloads::class, 'Google_Service_AppHub_Resource_ProjectsLocationsApplicationsWorkloads');
|
---|