[e3d4e0a] | 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\Bigquery\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Bigquery\GetIamPolicyRequest;
|
---|
| 21 | use Google\Service\Bigquery\ListRoutinesResponse;
|
---|
| 22 | use Google\Service\Bigquery\Policy;
|
---|
| 23 | use Google\Service\Bigquery\Routine;
|
---|
| 24 | use Google\Service\Bigquery\SetIamPolicyRequest;
|
---|
| 25 |
|
---|
| 26 | /**
|
---|
| 27 | * The "routines" collection of methods.
|
---|
| 28 | * Typical usage is:
|
---|
| 29 | * <code>
|
---|
| 30 | * $bigqueryService = new Google\Service\Bigquery(...);
|
---|
| 31 | * $routines = $bigqueryService->routines;
|
---|
| 32 | * </code>
|
---|
| 33 | */
|
---|
| 34 | class Routines extends \Google\Service\Resource
|
---|
| 35 | {
|
---|
| 36 | /**
|
---|
| 37 | * Deletes the routine specified by routineId from the dataset.
|
---|
| 38 | * (routines.delete)
|
---|
| 39 | *
|
---|
| 40 | * @param string $projectId Required. Project ID of the routine to delete
|
---|
| 41 | * @param string $datasetId Required. Dataset ID of the routine to delete
|
---|
| 42 | * @param string $routineId Required. Routine ID of the routine to delete
|
---|
| 43 | * @param array $optParams Optional parameters.
|
---|
| 44 | * @throws \Google\Service\Exception
|
---|
| 45 | */
|
---|
| 46 | public function delete($projectId, $datasetId, $routineId, $optParams = [])
|
---|
| 47 | {
|
---|
| 48 | $params = ['projectId' => $projectId, 'datasetId' => $datasetId, 'routineId' => $routineId];
|
---|
| 49 | $params = array_merge($params, $optParams);
|
---|
| 50 | return $this->call('delete', [$params]);
|
---|
| 51 | }
|
---|
| 52 | /**
|
---|
| 53 | * Gets the specified routine resource by routine ID. (routines.get)
|
---|
| 54 | *
|
---|
| 55 | * @param string $projectId Required. Project ID of the requested routine
|
---|
| 56 | * @param string $datasetId Required. Dataset ID of the requested routine
|
---|
| 57 | * @param string $routineId Required. Routine ID of the requested routine
|
---|
| 58 | * @param array $optParams Optional parameters.
|
---|
| 59 | *
|
---|
| 60 | * @opt_param string readMask If set, only the Routine fields in the field mask
|
---|
| 61 | * are returned in the response. If unset, all Routine fields are returned.
|
---|
| 62 | * @return Routine
|
---|
| 63 | * @throws \Google\Service\Exception
|
---|
| 64 | */
|
---|
| 65 | public function get($projectId, $datasetId, $routineId, $optParams = [])
|
---|
| 66 | {
|
---|
| 67 | $params = ['projectId' => $projectId, 'datasetId' => $datasetId, 'routineId' => $routineId];
|
---|
| 68 | $params = array_merge($params, $optParams);
|
---|
| 69 | return $this->call('get', [$params], Routine::class);
|
---|
| 70 | }
|
---|
| 71 | /**
|
---|
| 72 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 73 | * resource exists and does not have a policy set. (routines.getIamPolicy)
|
---|
| 74 | *
|
---|
| 75 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 76 | * requested. See [Resource
|
---|
| 77 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 78 | * appropriate value for this field.
|
---|
| 79 | * @param GetIamPolicyRequest $postBody
|
---|
| 80 | * @param array $optParams Optional parameters.
|
---|
| 81 | * @return Policy
|
---|
| 82 | * @throws \Google\Service\Exception
|
---|
| 83 | */
|
---|
| 84 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 85 | {
|
---|
| 86 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 87 | $params = array_merge($params, $optParams);
|
---|
| 88 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 89 | }
|
---|
| 90 | /**
|
---|
| 91 | * Creates a new routine in the dataset. (routines.insert)
|
---|
| 92 | *
|
---|
| 93 | * @param string $projectId Required. Project ID of the new routine
|
---|
| 94 | * @param string $datasetId Required. Dataset ID of the new routine
|
---|
| 95 | * @param Routine $postBody
|
---|
| 96 | * @param array $optParams Optional parameters.
|
---|
| 97 | * @return Routine
|
---|
| 98 | * @throws \Google\Service\Exception
|
---|
| 99 | */
|
---|
| 100 | public function insert($projectId, $datasetId, Routine $postBody, $optParams = [])
|
---|
| 101 | {
|
---|
| 102 | $params = ['projectId' => $projectId, 'datasetId' => $datasetId, 'postBody' => $postBody];
|
---|
| 103 | $params = array_merge($params, $optParams);
|
---|
| 104 | return $this->call('insert', [$params], Routine::class);
|
---|
| 105 | }
|
---|
| 106 | /**
|
---|
| 107 | * Lists all routines in the specified dataset. Requires the READER dataset
|
---|
| 108 | * role. (routines.listRoutines)
|
---|
| 109 | *
|
---|
| 110 | * @param string $projectId Required. Project ID of the routines to list
|
---|
| 111 | * @param string $datasetId Required. Dataset ID of the routines to list
|
---|
| 112 | * @param array $optParams Optional parameters.
|
---|
| 113 | *
|
---|
| 114 | * @opt_param string filter If set, then only the Routines matching this filter
|
---|
| 115 | * are returned. The supported format is `routineType:{RoutineType}`, where
|
---|
| 116 | * `{RoutineType}` is a RoutineType enum. For example:
|
---|
| 117 | * `routineType:SCALAR_FUNCTION`.
|
---|
| 118 | * @opt_param string maxResults The maximum number of results to return in a
|
---|
| 119 | * single response page. Leverage the page tokens to iterate through the entire
|
---|
| 120 | * collection.
|
---|
| 121 | * @opt_param string pageToken Page token, returned by a previous call, to
|
---|
| 122 | * request the next page of results
|
---|
| 123 | * @opt_param string readMask If set, then only the Routine fields in the field
|
---|
| 124 | * mask, as well as project_id, dataset_id and routine_id, are returned in the
|
---|
| 125 | * response. If unset, then the following Routine fields are returned: etag,
|
---|
| 126 | * project_id, dataset_id, routine_id, routine_type, creation_time,
|
---|
| 127 | * last_modified_time, and language.
|
---|
| 128 | * @return ListRoutinesResponse
|
---|
| 129 | * @throws \Google\Service\Exception
|
---|
| 130 | */
|
---|
| 131 | public function listRoutines($projectId, $datasetId, $optParams = [])
|
---|
| 132 | {
|
---|
| 133 | $params = ['projectId' => $projectId, 'datasetId' => $datasetId];
|
---|
| 134 | $params = array_merge($params, $optParams);
|
---|
| 135 | return $this->call('list', [$params], ListRoutinesResponse::class);
|
---|
| 136 | }
|
---|
| 137 | /**
|
---|
| 138 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 139 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 140 | * `PERMISSION_DENIED` errors. (routines.setIamPolicy)
|
---|
| 141 | *
|
---|
| 142 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 143 | * specified. See [Resource
|
---|
| 144 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 145 | * appropriate value for this field.
|
---|
| 146 | * @param SetIamPolicyRequest $postBody
|
---|
| 147 | * @param array $optParams Optional parameters.
|
---|
| 148 | * @return Policy
|
---|
| 149 | * @throws \Google\Service\Exception
|
---|
| 150 | */
|
---|
| 151 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 152 | {
|
---|
| 153 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 154 | $params = array_merge($params, $optParams);
|
---|
| 155 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 156 | }
|
---|
| 157 | /**
|
---|
| 158 | * Updates information in an existing routine. The update method replaces the
|
---|
| 159 | * entire Routine resource. (routines.update)
|
---|
| 160 | *
|
---|
| 161 | * @param string $projectId Required. Project ID of the routine to update
|
---|
| 162 | * @param string $datasetId Required. Dataset ID of the routine to update
|
---|
| 163 | * @param string $routineId Required. Routine ID of the routine to update
|
---|
| 164 | * @param Routine $postBody
|
---|
| 165 | * @param array $optParams Optional parameters.
|
---|
| 166 | * @return Routine
|
---|
| 167 | * @throws \Google\Service\Exception
|
---|
| 168 | */
|
---|
| 169 | public function update($projectId, $datasetId, $routineId, Routine $postBody, $optParams = [])
|
---|
| 170 | {
|
---|
| 171 | $params = ['projectId' => $projectId, 'datasetId' => $datasetId, 'routineId' => $routineId, 'postBody' => $postBody];
|
---|
| 172 | $params = array_merge($params, $optParams);
|
---|
| 173 | return $this->call('update', [$params], Routine::class);
|
---|
| 174 | }
|
---|
| 175 | }
|
---|
| 176 |
|
---|
| 177 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 178 | class_alias(Routines::class, 'Google_Service_Bigquery_Resource_Routines');
|
---|