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\GKEHub\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\GKEHub\Fleet;
|
---|
21 | use Google\Service\GKEHub\ListFleetsResponse;
|
---|
22 | use Google\Service\GKEHub\Operation;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "fleets" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $gkehubService = new Google\Service\GKEHub(...);
|
---|
29 | * $fleets = $gkehubService->projects_locations_fleets;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocationsFleets extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Creates a fleet. (fleets.create)
|
---|
36 | *
|
---|
37 | * @param string $parent Required. The parent (project and location) where the
|
---|
38 | * Fleet will be created. Specified in the format `projects/locations`.
|
---|
39 | * @param Fleet $postBody
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | * @return Operation
|
---|
42 | * @throws \Google\Service\Exception
|
---|
43 | */
|
---|
44 | public function create($parent, Fleet $postBody, $optParams = [])
|
---|
45 | {
|
---|
46 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
47 | $params = array_merge($params, $optParams);
|
---|
48 | return $this->call('create', [$params], Operation::class);
|
---|
49 | }
|
---|
50 | /**
|
---|
51 | * Removes a Fleet. There must be no memberships remaining in the Fleet.
|
---|
52 | * (fleets.delete)
|
---|
53 | *
|
---|
54 | * @param string $name Required. The Fleet resource name in the format
|
---|
55 | * `projects/locations/fleets`.
|
---|
56 | * @param array $optParams Optional parameters.
|
---|
57 | * @return Operation
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function delete($name, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['name' => $name];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('delete', [$params], Operation::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Returns the details of a fleet. (fleets.get)
|
---|
68 | *
|
---|
69 | * @param string $name Required. The Fleet resource name in the format
|
---|
70 | * `projects/locations/fleets`.
|
---|
71 | * @param array $optParams Optional parameters.
|
---|
72 | * @return Fleet
|
---|
73 | * @throws \Google\Service\Exception
|
---|
74 | */
|
---|
75 | public function get($name, $optParams = [])
|
---|
76 | {
|
---|
77 | $params = ['name' => $name];
|
---|
78 | $params = array_merge($params, $optParams);
|
---|
79 | return $this->call('get', [$params], Fleet::class);
|
---|
80 | }
|
---|
81 | /**
|
---|
82 | * Returns all fleets within an organization or a project that the caller has
|
---|
83 | * access to. (fleets.listProjectsLocationsFleets)
|
---|
84 | *
|
---|
85 | * @param string $parent Required. The organization or project to list for
|
---|
86 | * Fleets under, in the format `organizations/locations` or
|
---|
87 | * `projects/locations`.
|
---|
88 | * @param array $optParams Optional parameters.
|
---|
89 | *
|
---|
90 | * @opt_param int pageSize Optional. The maximum number of fleets to return. The
|
---|
91 | * service may return fewer than this value. If unspecified, at most 200 fleets
|
---|
92 | * will be returned. The maximum value is 1000; values above 1000 will be
|
---|
93 | * coerced to 1000.
|
---|
94 | * @opt_param string pageToken Optional. A page token, received from a previous
|
---|
95 | * `ListFleets` call. Provide this to retrieve the subsequent page. When
|
---|
96 | * paginating, all other parameters provided to `ListFleets` must match the call
|
---|
97 | * that provided the page token.
|
---|
98 | * @return ListFleetsResponse
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function listProjectsLocationsFleets($parent, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['parent' => $parent];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('list', [$params], ListFleetsResponse::class);
|
---|
106 | }
|
---|
107 | /**
|
---|
108 | * Updates a fleet. (fleets.patch)
|
---|
109 | *
|
---|
110 | * @param string $name Output only. The full, unique resource name of this fleet
|
---|
111 | * in the format of `projects/{project}/locations/{location}/fleets/{fleet}`.
|
---|
112 | * Each Google Cloud project can have at most one fleet resource, named
|
---|
113 | * "default".
|
---|
114 | * @param Fleet $postBody
|
---|
115 | * @param array $optParams Optional parameters.
|
---|
116 | *
|
---|
117 | * @opt_param string updateMask Required. The fields to be updated;
|
---|
118 | * @return Operation
|
---|
119 | * @throws \Google\Service\Exception
|
---|
120 | */
|
---|
121 | public function patch($name, Fleet $postBody, $optParams = [])
|
---|
122 | {
|
---|
123 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
124 | $params = array_merge($params, $optParams);
|
---|
125 | return $this->call('patch', [$params], Operation::class);
|
---|
126 | }
|
---|
127 | }
|
---|
128 |
|
---|
129 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
130 | class_alias(ProjectsLocationsFleets::class, 'Google_Service_GKEHub_Resource_ProjectsLocationsFleets');
|
---|