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\ServiceDirectory\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\ServiceDirectory\GetIamPolicyRequest;
|
---|
21 | use Google\Service\ServiceDirectory\ListServicesResponse;
|
---|
22 | use Google\Service\ServiceDirectory\Policy;
|
---|
23 | use Google\Service\ServiceDirectory\ResolveServiceRequest;
|
---|
24 | use Google\Service\ServiceDirectory\ResolveServiceResponse;
|
---|
25 | use Google\Service\ServiceDirectory\Service;
|
---|
26 | use Google\Service\ServiceDirectory\ServicedirectoryEmpty;
|
---|
27 | use Google\Service\ServiceDirectory\SetIamPolicyRequest;
|
---|
28 | use Google\Service\ServiceDirectory\TestIamPermissionsRequest;
|
---|
29 | use Google\Service\ServiceDirectory\TestIamPermissionsResponse;
|
---|
30 |
|
---|
31 | /**
|
---|
32 | * The "services" collection of methods.
|
---|
33 | * Typical usage is:
|
---|
34 | * <code>
|
---|
35 | * $servicedirectoryService = new Google\Service\ServiceDirectory(...);
|
---|
36 | * $services = $servicedirectoryService->projects_locations_namespaces_services;
|
---|
37 | * </code>
|
---|
38 | */
|
---|
39 | class ProjectsLocationsNamespacesServices extends \Google\Service\Resource
|
---|
40 | {
|
---|
41 | /**
|
---|
42 | * Creates a service, and returns the new service. (services.create)
|
---|
43 | *
|
---|
44 | * @param string $parent Required. The resource name of the namespace this
|
---|
45 | * service will belong to.
|
---|
46 | * @param Service $postBody
|
---|
47 | * @param array $optParams Optional parameters.
|
---|
48 | *
|
---|
49 | * @opt_param string serviceId Required. The Resource ID must be 1-63 characters
|
---|
50 | * long, and comply with RFC1035. Specifically, the name must be 1-63 characters
|
---|
51 | * long and match the regular expression `[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?`
|
---|
52 | * which means the first character must be a lowercase letter, and all following
|
---|
53 | * characters must be a dash, lowercase letter, or digit, except the last
|
---|
54 | * character, which cannot be a dash.
|
---|
55 | * @return Service
|
---|
56 | * @throws \Google\Service\Exception
|
---|
57 | */
|
---|
58 | public function create($parent, Service $postBody, $optParams = [])
|
---|
59 | {
|
---|
60 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
61 | $params = array_merge($params, $optParams);
|
---|
62 | return $this->call('create', [$params], Service::class);
|
---|
63 | }
|
---|
64 | /**
|
---|
65 | * Deletes a service. This also deletes all endpoints associated with the
|
---|
66 | * service. (services.delete)
|
---|
67 | *
|
---|
68 | * @param string $name Required. The name of the service to delete.
|
---|
69 | * @param array $optParams Optional parameters.
|
---|
70 | * @return ServicedirectoryEmpty
|
---|
71 | * @throws \Google\Service\Exception
|
---|
72 | */
|
---|
73 | public function delete($name, $optParams = [])
|
---|
74 | {
|
---|
75 | $params = ['name' => $name];
|
---|
76 | $params = array_merge($params, $optParams);
|
---|
77 | return $this->call('delete', [$params], ServicedirectoryEmpty::class);
|
---|
78 | }
|
---|
79 | /**
|
---|
80 | * Gets a service. (services.get)
|
---|
81 | *
|
---|
82 | * @param string $name Required. The name of the service to get.
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | * @return Service
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function get($name, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('get', [$params], Service::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Gets the IAM Policy for a resource (namespace or service only).
|
---|
95 | * (services.getIamPolicy)
|
---|
96 | *
|
---|
97 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
98 | * requested. See [Resource
|
---|
99 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
100 | * appropriate value for this field.
|
---|
101 | * @param GetIamPolicyRequest $postBody
|
---|
102 | * @param array $optParams Optional parameters.
|
---|
103 | * @return Policy
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * Lists all services belonging to a namespace.
|
---|
114 | * (services.listProjectsLocationsNamespacesServices)
|
---|
115 | *
|
---|
116 | * @param string $parent Required. The resource name of the namespace whose
|
---|
117 | * services you'd like to list.
|
---|
118 | * @param array $optParams Optional parameters.
|
---|
119 | *
|
---|
120 | * @opt_param string filter Optional. The filter to list results by. General
|
---|
121 | * `filter` string syntax: ` ()` * `` can be `name` or `annotations.` for map
|
---|
122 | * field * `` can be `<`, `>`, `<=`, `>=`, `!=`, `=`, `:`. Of which `:` means
|
---|
123 | * `HAS`, and is roughly the same as `=` * `` must be the same data type as
|
---|
124 | * field * `` can be `AND`, `OR`, `NOT` Examples of valid filters: *
|
---|
125 | * `annotations.owner` returns services that have a annotation with the key
|
---|
126 | * `owner`, this is the same as `annotations:owner` *
|
---|
127 | * `annotations.protocol=gRPC` returns services that have key/value
|
---|
128 | * `protocol=gRPC` * `name>projects/my-project/locations/us-east1/namespaces/my-
|
---|
129 | * namespace/services/service-c` returns services that have name that is
|
---|
130 | * alphabetically later than the string, so "service-e" is returned but
|
---|
131 | * "service-a" is not * `annotations.owner!=sd AND annotations.foo=bar` returns
|
---|
132 | * services that have `owner` in annotation key but value is not `sd` AND have
|
---|
133 | * key/value `foo=bar` * `doesnotexist.foo=bar` returns an empty list. Note that
|
---|
134 | * service doesn't have a field called "doesnotexist". Since the filter does not
|
---|
135 | * match any services, it returns no results For more information about
|
---|
136 | * filtering, see [API Filtering](https://aip.dev/160).
|
---|
137 | * @opt_param string orderBy Optional. The order to list results by. General
|
---|
138 | * `order_by` string syntax: ` () (,)` * `` allows value: `name` * `` ascending
|
---|
139 | * or descending order by ``. If this is left blank, `asc` is used Note that an
|
---|
140 | * empty `order_by` string results in default order, which is order by `name` in
|
---|
141 | * ascending order.
|
---|
142 | * @opt_param int pageSize Optional. The maximum number of items to return.
|
---|
143 | * @opt_param string pageToken Optional. The next_page_token value returned from
|
---|
144 | * a previous List request, if any.
|
---|
145 | * @return ListServicesResponse
|
---|
146 | * @throws \Google\Service\Exception
|
---|
147 | */
|
---|
148 | public function listProjectsLocationsNamespacesServices($parent, $optParams = [])
|
---|
149 | {
|
---|
150 | $params = ['parent' => $parent];
|
---|
151 | $params = array_merge($params, $optParams);
|
---|
152 | return $this->call('list', [$params], ListServicesResponse::class);
|
---|
153 | }
|
---|
154 | /**
|
---|
155 | * Updates a service. (services.patch)
|
---|
156 | *
|
---|
157 | * @param string $name Immutable. The resource name for the service in the
|
---|
158 | * format `projects/locations/namespaces/services`.
|
---|
159 | * @param Service $postBody
|
---|
160 | * @param array $optParams Optional parameters.
|
---|
161 | *
|
---|
162 | * @opt_param string updateMask Required. List of fields to be updated in this
|
---|
163 | * request.
|
---|
164 | * @return Service
|
---|
165 | * @throws \Google\Service\Exception
|
---|
166 | */
|
---|
167 | public function patch($name, Service $postBody, $optParams = [])
|
---|
168 | {
|
---|
169 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
170 | $params = array_merge($params, $optParams);
|
---|
171 | return $this->call('patch', [$params], Service::class);
|
---|
172 | }
|
---|
173 | /**
|
---|
174 | * Returns a service and its associated endpoints. Resolving a service is not
|
---|
175 | * considered an active developer method. (services.resolve)
|
---|
176 | *
|
---|
177 | * @param string $name Required. The name of the service to resolve.
|
---|
178 | * @param ResolveServiceRequest $postBody
|
---|
179 | * @param array $optParams Optional parameters.
|
---|
180 | * @return ResolveServiceResponse
|
---|
181 | * @throws \Google\Service\Exception
|
---|
182 | */
|
---|
183 | public function resolve($name, ResolveServiceRequest $postBody, $optParams = [])
|
---|
184 | {
|
---|
185 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
186 | $params = array_merge($params, $optParams);
|
---|
187 | return $this->call('resolve', [$params], ResolveServiceResponse::class);
|
---|
188 | }
|
---|
189 | /**
|
---|
190 | * Sets the IAM Policy for a resource (namespace or service only).
|
---|
191 | * (services.setIamPolicy)
|
---|
192 | *
|
---|
193 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
194 | * specified. See [Resource
|
---|
195 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
196 | * appropriate value for this field.
|
---|
197 | * @param SetIamPolicyRequest $postBody
|
---|
198 | * @param array $optParams Optional parameters.
|
---|
199 | * @return Policy
|
---|
200 | * @throws \Google\Service\Exception
|
---|
201 | */
|
---|
202 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
203 | {
|
---|
204 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
205 | $params = array_merge($params, $optParams);
|
---|
206 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
207 | }
|
---|
208 | /**
|
---|
209 | * Tests IAM permissions for a resource (namespace or service only).
|
---|
210 | * (services.testIamPermissions)
|
---|
211 | *
|
---|
212 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
213 | * being requested. See [Resource
|
---|
214 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
215 | * appropriate value for this field.
|
---|
216 | * @param TestIamPermissionsRequest $postBody
|
---|
217 | * @param array $optParams Optional parameters.
|
---|
218 | * @return TestIamPermissionsResponse
|
---|
219 | * @throws \Google\Service\Exception
|
---|
220 | */
|
---|
221 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
222 | {
|
---|
223 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
224 | $params = array_merge($params, $optParams);
|
---|
225 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
226 | }
|
---|
227 | }
|
---|
228 |
|
---|
229 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
230 | class_alias(ProjectsLocationsNamespacesServices::class, 'Google_Service_ServiceDirectory_Resource_ProjectsLocationsNamespacesServices');
|
---|