[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\CloudTasks\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\CloudTasks\CmekConfig;
|
---|
| 21 | use Google\Service\CloudTasks\ListLocationsResponse;
|
---|
| 22 | use Google\Service\CloudTasks\Location;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "locations" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $cloudtasksService = new Google\Service\CloudTasks(...);
|
---|
| 29 | * $locations = $cloudtasksService->projects_locations;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocations extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Gets information about a location. (locations.get)
|
---|
| 36 | *
|
---|
| 37 | * @param string $name Resource name for the location.
|
---|
| 38 | * @param array $optParams Optional parameters.
|
---|
| 39 | * @return Location
|
---|
| 40 | * @throws \Google\Service\Exception
|
---|
| 41 | */
|
---|
| 42 | public function get($name, $optParams = [])
|
---|
| 43 | {
|
---|
| 44 | $params = ['name' => $name];
|
---|
| 45 | $params = array_merge($params, $optParams);
|
---|
| 46 | return $this->call('get', [$params], Location::class);
|
---|
| 47 | }
|
---|
| 48 | /**
|
---|
| 49 | * Gets the CMEK config. Gets the Customer Managed Encryption Key configured
|
---|
| 50 | * with the Cloud Tasks lcoation. By default there is no kms_key configured.
|
---|
| 51 | * (locations.getCmekConfig)
|
---|
| 52 | *
|
---|
| 53 | * @param string $name Required. The config. For example:
|
---|
| 54 | * projects/PROJECT_ID/locations/LOCATION_ID/CmekConfig`
|
---|
| 55 | * @param array $optParams Optional parameters.
|
---|
| 56 | * @return CmekConfig
|
---|
| 57 | * @throws \Google\Service\Exception
|
---|
| 58 | */
|
---|
| 59 | public function getCmekConfig($name, $optParams = [])
|
---|
| 60 | {
|
---|
| 61 | $params = ['name' => $name];
|
---|
| 62 | $params = array_merge($params, $optParams);
|
---|
| 63 | return $this->call('getCmekConfig', [$params], CmekConfig::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 | * Creates or Updates a CMEK config. Updates the Customer Managed Encryption Key
|
---|
| 91 | * assotiated with the Cloud Tasks location (Creates if the key does not already
|
---|
| 92 | * exist). All new tasks created in the location will be encrypted at-rest with
|
---|
| 93 | * the KMS-key provided in the config. (locations.updateCmekConfig)
|
---|
| 94 | *
|
---|
| 95 | * @param string $name Output only. The config resource name which includes the
|
---|
| 96 | * project and location and must end in 'cmekConfig', in the format
|
---|
| 97 | * projects/PROJECT_ID/locations/LOCATION_ID/cmekConfig`
|
---|
| 98 | * @param CmekConfig $postBody
|
---|
| 99 | * @param array $optParams Optional parameters.
|
---|
| 100 | *
|
---|
| 101 | * @opt_param string updateMask List of fields to be updated in this request.
|
---|
| 102 | * @return CmekConfig
|
---|
| 103 | * @throws \Google\Service\Exception
|
---|
| 104 | */
|
---|
| 105 | public function updateCmekConfig($name, CmekConfig $postBody, $optParams = [])
|
---|
| 106 | {
|
---|
| 107 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 108 | $params = array_merge($params, $optParams);
|
---|
| 109 | return $this->call('updateCmekConfig', [$params], CmekConfig::class);
|
---|
| 110 | }
|
---|
| 111 | }
|
---|
| 112 |
|
---|
| 113 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 114 | class_alias(ProjectsLocations::class, 'Google_Service_CloudTasks_Resource_ProjectsLocations');
|
---|