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\TPU\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\TPU\GenerateServiceIdentityRequest;
|
---|
21 | use Google\Service\TPU\GenerateServiceIdentityResponse;
|
---|
22 | use Google\Service\TPU\ListLocationsResponse;
|
---|
23 | use Google\Service\TPU\Location;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "locations" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $tpuService = new Google\Service\TPU(...);
|
---|
30 | * $locations = $tpuService->projects_locations;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocations extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Generates the Cloud TPU service identity for the project.
|
---|
37 | * (locations.generateServiceIdentity)
|
---|
38 | *
|
---|
39 | * @param string $parent Required. The parent resource name.
|
---|
40 | * @param GenerateServiceIdentityRequest $postBody
|
---|
41 | * @param array $optParams Optional parameters.
|
---|
42 | * @return GenerateServiceIdentityResponse
|
---|
43 | * @throws \Google\Service\Exception
|
---|
44 | */
|
---|
45 | public function generateServiceIdentity($parent, GenerateServiceIdentityRequest $postBody, $optParams = [])
|
---|
46 | {
|
---|
47 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
48 | $params = array_merge($params, $optParams);
|
---|
49 | return $this->call('generateServiceIdentity', [$params], GenerateServiceIdentityResponse::class);
|
---|
50 | }
|
---|
51 | /**
|
---|
52 | * Gets information about a location. (locations.get)
|
---|
53 | *
|
---|
54 | * @param string $name Resource name for the location.
|
---|
55 | * @param array $optParams Optional parameters.
|
---|
56 | * @return Location
|
---|
57 | * @throws \Google\Service\Exception
|
---|
58 | */
|
---|
59 | public function get($name, $optParams = [])
|
---|
60 | {
|
---|
61 | $params = ['name' => $name];
|
---|
62 | $params = array_merge($params, $optParams);
|
---|
63 | return $this->call('get', [$params], Location::class);
|
---|
64 | }
|
---|
65 | /**
|
---|
66 | * Lists information about the supported locations for this service.
|
---|
67 | * (locations.listProjectsLocations)
|
---|
68 | *
|
---|
69 | * @param string $name The resource that owns the locations collection, if
|
---|
70 | * applicable.
|
---|
71 | * @param array $optParams Optional parameters.
|
---|
72 | *
|
---|
73 | * @opt_param string filter A filter to narrow down results to a preferred
|
---|
74 | * subset. The filtering language accepts strings like `"displayName=tokyo"`,
|
---|
75 | * and is documented in more detail in [AIP-160](https://google.aip.dev/160).
|
---|
76 | * @opt_param int pageSize The maximum number of results to return. If not set,
|
---|
77 | * the service selects a default.
|
---|
78 | * @opt_param string pageToken A page token received from the `next_page_token`
|
---|
79 | * field in the response. Send that page token to receive the subsequent page.
|
---|
80 | * @return ListLocationsResponse
|
---|
81 | * @throws \Google\Service\Exception
|
---|
82 | */
|
---|
83 | public function listProjectsLocations($name, $optParams = [])
|
---|
84 | {
|
---|
85 | $params = ['name' => $name];
|
---|
86 | $params = array_merge($params, $optParams);
|
---|
87 | return $this->call('list', [$params], ListLocationsResponse::class);
|
---|
88 | }
|
---|
89 | }
|
---|
90 |
|
---|
91 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
92 | class_alias(ProjectsLocations::class, 'Google_Service_TPU_Resource_ProjectsLocations');
|
---|