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\BigQueryReservation\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\BigQueryReservation\BiReservation;
|
---|
21 | use Google\Service\BigQueryReservation\SearchAllAssignmentsResponse;
|
---|
22 | use Google\Service\BigQueryReservation\SearchAssignmentsResponse;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "locations" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $bigqueryreservationService = new Google\Service\BigQueryReservation(...);
|
---|
29 | * $locations = $bigqueryreservationService->projects_locations;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ProjectsLocations extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Retrieves a BI reservation. (locations.getBiReservation)
|
---|
36 | *
|
---|
37 | * @param string $name Required. Name of the requested reservation, for example:
|
---|
38 | * `projects/{project_id}/locations/{location_id}/biReservation`
|
---|
39 | * @param array $optParams Optional parameters.
|
---|
40 | * @return BiReservation
|
---|
41 | * @throws \Google\Service\Exception
|
---|
42 | */
|
---|
43 | public function getBiReservation($name, $optParams = [])
|
---|
44 | {
|
---|
45 | $params = ['name' => $name];
|
---|
46 | $params = array_merge($params, $optParams);
|
---|
47 | return $this->call('getBiReservation', [$params], BiReservation::class);
|
---|
48 | }
|
---|
49 | /**
|
---|
50 | * Looks up assignments for a specified resource for a particular region. If the
|
---|
51 | * request is about a project: 1. Assignments created on the project will be
|
---|
52 | * returned if they exist. 2. Otherwise assignments created on the closest
|
---|
53 | * ancestor will be returned. 3. Assignments for different JobTypes will all be
|
---|
54 | * returned. The same logic applies if the request is about a folder. If the
|
---|
55 | * request is about an organization, then assignments created on the
|
---|
56 | * organization will be returned (organization doesn't have ancestors).
|
---|
57 | * Comparing to ListAssignments, there are some behavior differences: 1.
|
---|
58 | * permission on the assignee will be verified in this API. 2. Hierarchy lookup
|
---|
59 | * (project->folder->organization) happens in this API. 3. Parent here is
|
---|
60 | * `projects/locations`, instead of `projects/locationsreservations`.
|
---|
61 | * (locations.searchAllAssignments)
|
---|
62 | *
|
---|
63 | * @param string $parent Required. The resource name with location (project name
|
---|
64 | * could be the wildcard '-'), e.g.: `projects/-/locations/US`.
|
---|
65 | * @param array $optParams Optional parameters.
|
---|
66 | *
|
---|
67 | * @opt_param int pageSize The maximum number of items to return per page.
|
---|
68 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
69 | * previous List request, if any.
|
---|
70 | * @opt_param string query Please specify resource name as assignee in the
|
---|
71 | * query. Examples: * `assignee=projects/myproject` * `assignee=folders/123` *
|
---|
72 | * `assignee=organizations/456`
|
---|
73 | * @return SearchAllAssignmentsResponse
|
---|
74 | * @throws \Google\Service\Exception
|
---|
75 | */
|
---|
76 | public function searchAllAssignments($parent, $optParams = [])
|
---|
77 | {
|
---|
78 | $params = ['parent' => $parent];
|
---|
79 | $params = array_merge($params, $optParams);
|
---|
80 | return $this->call('searchAllAssignments', [$params], SearchAllAssignmentsResponse::class);
|
---|
81 | }
|
---|
82 | /**
|
---|
83 | * Deprecated: Looks up assignments for a specified resource for a particular
|
---|
84 | * region. If the request is about a project: 1. Assignments created on the
|
---|
85 | * project will be returned if they exist. 2. Otherwise assignments created on
|
---|
86 | * the closest ancestor will be returned. 3. Assignments for different JobTypes
|
---|
87 | * will all be returned. The same logic applies if the request is about a
|
---|
88 | * folder. If the request is about an organization, then assignments created on
|
---|
89 | * the organization will be returned (organization doesn't have ancestors).
|
---|
90 | * Comparing to ListAssignments, there are some behavior differences: 1.
|
---|
91 | * permission on the assignee will be verified in this API. 2. Hierarchy lookup
|
---|
92 | * (project->folder->organization) happens in this API. 3. Parent here is
|
---|
93 | * `projects/locations`, instead of `projects/locationsreservations`. **Note**
|
---|
94 | * "-" cannot be used for projects nor locations. (locations.searchAssignments)
|
---|
95 | *
|
---|
96 | * @param string $parent Required. The resource name of the admin
|
---|
97 | * project(containing project and location), e.g.:
|
---|
98 | * `projects/myproject/locations/US`.
|
---|
99 | * @param array $optParams Optional parameters.
|
---|
100 | *
|
---|
101 | * @opt_param int pageSize The maximum number of items to return per page.
|
---|
102 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
103 | * previous List request, if any.
|
---|
104 | * @opt_param string query Please specify resource name as assignee in the
|
---|
105 | * query. Examples: * `assignee=projects/myproject` * `assignee=folders/123` *
|
---|
106 | * `assignee=organizations/456`
|
---|
107 | * @return SearchAssignmentsResponse
|
---|
108 | * @throws \Google\Service\Exception
|
---|
109 | */
|
---|
110 | public function searchAssignments($parent, $optParams = [])
|
---|
111 | {
|
---|
112 | $params = ['parent' => $parent];
|
---|
113 | $params = array_merge($params, $optParams);
|
---|
114 | return $this->call('searchAssignments', [$params], SearchAssignmentsResponse::class);
|
---|
115 | }
|
---|
116 | /**
|
---|
117 | * Updates a BI reservation. Only fields specified in the `field_mask` are
|
---|
118 | * updated. A singleton BI reservation always exists with default size 0. In
|
---|
119 | * order to reserve BI capacity it needs to be updated to an amount greater than
|
---|
120 | * 0. In order to release BI capacity reservation size must be set to 0.
|
---|
121 | * (locations.updateBiReservation)
|
---|
122 | *
|
---|
123 | * @param string $name The resource name of the singleton BI reservation.
|
---|
124 | * Reservation names have the form
|
---|
125 | * `projects/{project_id}/locations/{location_id}/biReservation`.
|
---|
126 | * @param BiReservation $postBody
|
---|
127 | * @param array $optParams Optional parameters.
|
---|
128 | *
|
---|
129 | * @opt_param string updateMask A list of fields to be updated in this request.
|
---|
130 | * @return BiReservation
|
---|
131 | * @throws \Google\Service\Exception
|
---|
132 | */
|
---|
133 | public function updateBiReservation($name, BiReservation $postBody, $optParams = [])
|
---|
134 | {
|
---|
135 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
136 | $params = array_merge($params, $optParams);
|
---|
137 | return $this->call('updateBiReservation', [$params], BiReservation::class);
|
---|
138 | }
|
---|
139 | }
|
---|
140 |
|
---|
141 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
142 | class_alias(ProjectsLocations::class, 'Google_Service_BigQueryReservation_Resource_ProjectsLocations');
|
---|