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\MigrationCenterAPI\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\MigrationCenterAPI\ListPreferenceSetsResponse;
|
---|
21 | use Google\Service\MigrationCenterAPI\Operation;
|
---|
22 | use Google\Service\MigrationCenterAPI\PreferenceSet;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "preferenceSets" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $migrationcenterService = new Google\Service\MigrationCenterAPI(...);
|
---|
29 | * $preferenceSets = $migrationcenterService->projects_locations_preferenceSets;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsPreferenceSets extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a new preference set in a given project and location.
|
---|
36 | * (preferenceSets.create)
|
---|
37 | *
|
---|
38 | * @param string $parent Required. Value for parent.
|
---|
39 | * @param PreferenceSet $postBody
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | *
|
---|
42 | * @opt_param string preferenceSetId Required. User specified ID for the
|
---|
43 | * preference set. It will become the last component of the preference set name.
|
---|
44 | * The ID must be unique within the project, must conform with RFC-1034, is
|
---|
45 | * restricted to lower-cased letters, and has a maximum length of 63 characters.
|
---|
46 | * The ID must match the regular expression `[a-z]([a-z0-9-]{0,61}[a-z0-9])?`.
|
---|
47 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
48 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
49 | * the server will know to ignore the request if it has already been completed.
|
---|
50 | * The server will guarantee that for at least 60 minutes since the first
|
---|
51 | * request. For example, consider a situation where you make an initial request
|
---|
52 | * and the request times out. If you make the request again with the same
|
---|
53 | * request ID, the server can check if original operation with the same request
|
---|
54 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
55 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
56 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
57 | * (00000000-0000-0000-0000-000000000000).
|
---|
58 | * @return Operation
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function create($parent, PreferenceSet $postBody, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('create', [$params], Operation::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Deletes a preference set. (preferenceSets.delete)
|
---|
69 | *
|
---|
70 | * @param string $name Required. Name of the group resource.
|
---|
71 | * @param array $optParams Optional parameters.
|
---|
72 | *
|
---|
73 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
74 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
75 | * the server will know to ignore the request if it has already been completed.
|
---|
76 | * The server will guarantee that for at least 60 minutes after the first
|
---|
77 | * request. For example, consider a situation where you make an initial request
|
---|
78 | * and the request times out. If you make the request again with the same
|
---|
79 | * request ID, the server can check if original operation with the same request
|
---|
80 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
81 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
82 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
83 | * (00000000-0000-0000-0000-000000000000).
|
---|
84 | * @return Operation
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function delete($name, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('delete', [$params], Operation::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Gets the details of a preference set. (preferenceSets.get)
|
---|
95 | *
|
---|
96 | * @param string $name Required. Name of the resource.
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | * @return PreferenceSet
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function get($name, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['name' => $name];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('get', [$params], PreferenceSet::class);
|
---|
106 | }
|
---|
107 | /**
|
---|
108 | * Lists all the preference sets in a given project and location.
|
---|
109 | * (preferenceSets.listProjectsLocationsPreferenceSets)
|
---|
110 | *
|
---|
111 | * @param string $parent Required. Parent value for `ListPreferenceSetsRequest`.
|
---|
112 | * @param array $optParams Optional parameters.
|
---|
113 | *
|
---|
114 | * @opt_param string orderBy Field to sort by. See
|
---|
115 | * https://google.aip.dev/132#ordering for more details.
|
---|
116 | * @opt_param int pageSize Requested page size. Server may return fewer items
|
---|
117 | * than requested. If unspecified, at most 500 preference sets will be returned.
|
---|
118 | * The maximum value is 1000; values above 1000 will be coerced to 1000.
|
---|
119 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
120 | * should return.
|
---|
121 | * @return ListPreferenceSetsResponse
|
---|
122 | * @throws \Google\Service\Exception
|
---|
123 | */
|
---|
124 | public function listProjectsLocationsPreferenceSets($parent, $optParams = [])
|
---|
125 | {
|
---|
126 | $params = ['parent' => $parent];
|
---|
127 | $params = array_merge($params, $optParams);
|
---|
128 | return $this->call('list', [$params], ListPreferenceSetsResponse::class);
|
---|
129 | }
|
---|
130 | /**
|
---|
131 | * Updates the parameters of a preference set. (preferenceSets.patch)
|
---|
132 | *
|
---|
133 | * @param string $name Output only. Name of the preference set.
|
---|
134 | * @param PreferenceSet $postBody
|
---|
135 | * @param array $optParams Optional parameters.
|
---|
136 | *
|
---|
137 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
138 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
139 | * the server will know to ignore the request if it has already been completed.
|
---|
140 | * The server will guarantee that for at least 60 minutes since the first
|
---|
141 | * request. For example, consider a situation where you make an initial request
|
---|
142 | * and the request times out. If you make the request again with the same
|
---|
143 | * request ID, the server can check if original operation with the same request
|
---|
144 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
145 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
146 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
147 | * (00000000-0000-0000-0000-000000000000).
|
---|
148 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
149 | * fields to be overwritten in the `PreferenceSet` resource by the update. The
|
---|
150 | * values specified in the `update_mask` field are relative to the resource, not
|
---|
151 | * the full request. A field will be overwritten if it is in the mask. A single
|
---|
152 | * * value in the mask lets you to overwrite all fields.
|
---|
153 | * @return Operation
|
---|
154 | * @throws \Google\Service\Exception
|
---|
155 | */
|
---|
156 | public function patch($name, PreferenceSet $postBody, $optParams = [])
|
---|
157 | {
|
---|
158 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
159 | $params = array_merge($params, $optParams);
|
---|
160 | return $this->call('patch', [$params], Operation::class);
|
---|
161 | }
|
---|
162 | }
|
---|
163 |
|
---|
164 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
165 | class_alias(ProjectsLocationsPreferenceSets::class, 'Google_Service_MigrationCenterAPI_Resource_ProjectsLocationsPreferenceSets');
|
---|