[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\Networkconnectivity\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Networkconnectivity\GoogleLongrunningOperation;
|
---|
| 21 | use Google\Service\Networkconnectivity\ListServiceConnectionTokensResponse;
|
---|
| 22 | use Google\Service\Networkconnectivity\ServiceConnectionToken;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "serviceConnectionTokens" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $networkconnectivityService = new Google\Service\Networkconnectivity(...);
|
---|
| 29 | * $serviceConnectionTokens = $networkconnectivityService->projects_locations_serviceConnectionTokens;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsServiceConnectionTokens extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a new ServiceConnectionToken in a given project and location.
|
---|
| 36 | * (serviceConnectionTokens.create)
|
---|
| 37 | *
|
---|
| 38 | * @param string $parent Required. The parent resource's name of the
|
---|
| 39 | * ServiceConnectionToken. ex. projects/123/locations/us-east1
|
---|
| 40 | * @param ServiceConnectionToken $postBody
|
---|
| 41 | * @param array $optParams Optional parameters.
|
---|
| 42 | *
|
---|
| 43 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 44 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 45 | * the server will know to ignore the request if it has already been completed.
|
---|
| 46 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 47 | * request. For example, consider a situation where you make an initial request
|
---|
| 48 | * and the request times out. If you make the request again with the same
|
---|
| 49 | * request ID, the server can check if original operation with the same request
|
---|
| 50 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 51 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 52 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 53 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 54 | * @opt_param string serviceConnectionTokenId Optional. Resource ID (i.e. 'foo'
|
---|
| 55 | * in '[...]/projects/p/locations/l/ServiceConnectionTokens/foo') See
|
---|
| 56 | * https://google.aip.dev/122#resource-id-segments Unique per location. If one
|
---|
| 57 | * is not provided, one will be generated.
|
---|
| 58 | * @return GoogleLongrunningOperation
|
---|
| 59 | * @throws \Google\Service\Exception
|
---|
| 60 | */
|
---|
| 61 | public function create($parent, ServiceConnectionToken $postBody, $optParams = [])
|
---|
| 62 | {
|
---|
| 63 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 64 | $params = array_merge($params, $optParams);
|
---|
| 65 | return $this->call('create', [$params], GoogleLongrunningOperation::class);
|
---|
| 66 | }
|
---|
| 67 | /**
|
---|
| 68 | * Deletes a single ServiceConnectionToken. (serviceConnectionTokens.delete)
|
---|
| 69 | *
|
---|
| 70 | * @param string $name Required. The name of the ServiceConnectionToken to
|
---|
| 71 | * delete.
|
---|
| 72 | * @param array $optParams Optional parameters.
|
---|
| 73 | *
|
---|
| 74 | * @opt_param string etag Optional. The etag is computed by the server, and may
|
---|
| 75 | * be sent on update and delete requests to ensure the client has an up-to-date
|
---|
| 76 | * value before proceeding.
|
---|
| 77 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 78 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 79 | * the server will know to ignore the request if it has already been completed.
|
---|
| 80 | * The server will guarantee that for at least 60 minutes after the first
|
---|
| 81 | * request. For example, consider a situation where you make an initial request
|
---|
| 82 | * and the request times out. If you make the request again with the same
|
---|
| 83 | * request ID, the server can check if original operation with the same request
|
---|
| 84 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 85 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 86 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 87 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 88 | * @return GoogleLongrunningOperation
|
---|
| 89 | * @throws \Google\Service\Exception
|
---|
| 90 | */
|
---|
| 91 | public function delete($name, $optParams = [])
|
---|
| 92 | {
|
---|
| 93 | $params = ['name' => $name];
|
---|
| 94 | $params = array_merge($params, $optParams);
|
---|
| 95 | return $this->call('delete', [$params], GoogleLongrunningOperation::class);
|
---|
| 96 | }
|
---|
| 97 | /**
|
---|
| 98 | * Gets details of a single ServiceConnectionToken.
|
---|
| 99 | * (serviceConnectionTokens.get)
|
---|
| 100 | *
|
---|
| 101 | * @param string $name Required. Name of the ServiceConnectionToken to get.
|
---|
| 102 | * @param array $optParams Optional parameters.
|
---|
| 103 | * @return ServiceConnectionToken
|
---|
| 104 | * @throws \Google\Service\Exception
|
---|
| 105 | */
|
---|
| 106 | public function get($name, $optParams = [])
|
---|
| 107 | {
|
---|
| 108 | $params = ['name' => $name];
|
---|
| 109 | $params = array_merge($params, $optParams);
|
---|
| 110 | return $this->call('get', [$params], ServiceConnectionToken::class);
|
---|
| 111 | }
|
---|
| 112 | /**
|
---|
| 113 | * Lists ServiceConnectionTokens in a given project and location.
|
---|
| 114 | * (serviceConnectionTokens.listProjectsLocationsServiceConnectionTokens)
|
---|
| 115 | *
|
---|
| 116 | * @param string $parent Required. The parent resource's name. ex.
|
---|
| 117 | * projects/123/locations/us-east1
|
---|
| 118 | * @param array $optParams Optional parameters.
|
---|
| 119 | *
|
---|
| 120 | * @opt_param string filter A filter expression that filters the results listed
|
---|
| 121 | * in the response.
|
---|
| 122 | * @opt_param string orderBy Sort the results by a certain order.
|
---|
| 123 | * @opt_param int pageSize The maximum number of results per page that should be
|
---|
| 124 | * returned.
|
---|
| 125 | * @opt_param string pageToken The page token.
|
---|
| 126 | * @return ListServiceConnectionTokensResponse
|
---|
| 127 | * @throws \Google\Service\Exception
|
---|
| 128 | */
|
---|
| 129 | public function listProjectsLocationsServiceConnectionTokens($parent, $optParams = [])
|
---|
| 130 | {
|
---|
| 131 | $params = ['parent' => $parent];
|
---|
| 132 | $params = array_merge($params, $optParams);
|
---|
| 133 | return $this->call('list', [$params], ListServiceConnectionTokensResponse::class);
|
---|
| 134 | }
|
---|
| 135 | }
|
---|
| 136 |
|
---|
| 137 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 138 | class_alias(ProjectsLocationsServiceConnectionTokens::class, 'Google_Service_Networkconnectivity_Resource_ProjectsLocationsServiceConnectionTokens');
|
---|