[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\ServiceNetworking\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\ServiceNetworking\Connection;
|
---|
| 21 | use Google\Service\ServiceNetworking\DeleteConnectionRequest;
|
---|
| 22 | use Google\Service\ServiceNetworking\ListConnectionsResponse;
|
---|
| 23 | use Google\Service\ServiceNetworking\Operation;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "connections" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $servicenetworkingService = new Google\Service\ServiceNetworking(...);
|
---|
| 30 | * $connections = $servicenetworkingService->services_connections;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class ServicesConnections extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Creates a private connection that establishes a VPC Network Peering
|
---|
| 37 | * connection to a VPC network in the service producer's organization. The
|
---|
| 38 | * administrator of the service consumer's VPC network invokes this method. The
|
---|
| 39 | * administrator must assign one or more allocated IP ranges for provisioning
|
---|
| 40 | * subnetworks in the service producer's VPC network. This connection is used
|
---|
| 41 | * for all supported services in the service producer's organization, so it only
|
---|
| 42 | * needs to be invoked once. (connections.create)
|
---|
| 43 | *
|
---|
| 44 | * @param string $parent The service that is managing peering connectivity for a
|
---|
| 45 | * service producer's organization. For Google services that support this
|
---|
| 46 | * functionality, this value is `services/servicenetworking.googleapis.com`.
|
---|
| 47 | * @param Connection $postBody
|
---|
| 48 | * @param array $optParams Optional parameters.
|
---|
| 49 | * @return Operation
|
---|
| 50 | * @throws \Google\Service\Exception
|
---|
| 51 | */
|
---|
| 52 | public function create($parent, Connection $postBody, $optParams = [])
|
---|
| 53 | {
|
---|
| 54 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 55 | $params = array_merge($params, $optParams);
|
---|
| 56 | return $this->call('create', [$params], Operation::class);
|
---|
| 57 | }
|
---|
| 58 | /**
|
---|
| 59 | * Deletes a private service access connection. (connections.deleteConnection)
|
---|
| 60 | *
|
---|
| 61 | * @param string $name Required. The private service connection that connects to
|
---|
| 62 | * a service producer organization. The name includes both the private service
|
---|
| 63 | * name and the VPC network peering name in the format of
|
---|
| 64 | * `services/{peering_service_name}/connections/{vpc_peering_name}`. For Google
|
---|
| 65 | * services that support this functionality, this is
|
---|
| 66 | * `services/servicenetworking.googleapis.com/connections/servicenetworking-
|
---|
| 67 | * googleapis-com`.
|
---|
| 68 | * @param DeleteConnectionRequest $postBody
|
---|
| 69 | * @param array $optParams Optional parameters.
|
---|
| 70 | * @return Operation
|
---|
| 71 | * @throws \Google\Service\Exception
|
---|
| 72 | */
|
---|
| 73 | public function deleteConnection($name, DeleteConnectionRequest $postBody, $optParams = [])
|
---|
| 74 | {
|
---|
| 75 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 76 | $params = array_merge($params, $optParams);
|
---|
| 77 | return $this->call('deleteConnection', [$params], Operation::class);
|
---|
| 78 | }
|
---|
| 79 | /**
|
---|
| 80 | * List the private connections that are configured in a service consumer's VPC
|
---|
| 81 | * network. (connections.listServicesConnections)
|
---|
| 82 | *
|
---|
| 83 | * @param string $parent The service that is managing peering connectivity for a
|
---|
| 84 | * service producer's organization. For Google services that support this
|
---|
| 85 | * functionality, this value is `services/servicenetworking.googleapis.com`. If
|
---|
| 86 | * you specify `services/-` as the parameter value, all configured peering
|
---|
| 87 | * services are listed.
|
---|
| 88 | * @param array $optParams Optional parameters.
|
---|
| 89 | *
|
---|
| 90 | * @opt_param string network The name of service consumer's VPC network that's
|
---|
| 91 | * connected with service producer network through a private connection. The
|
---|
| 92 | * network name must be in the following format:
|
---|
| 93 | * `projects/{project}/global/networks/{network}`. {project} is a project
|
---|
| 94 | * number, such as in `12345` that includes the VPC service consumer's VPC
|
---|
| 95 | * network. {network} is the name of the service consumer's VPC network.
|
---|
| 96 | * @return ListConnectionsResponse
|
---|
| 97 | * @throws \Google\Service\Exception
|
---|
| 98 | */
|
---|
| 99 | public function listServicesConnections($parent, $optParams = [])
|
---|
| 100 | {
|
---|
| 101 | $params = ['parent' => $parent];
|
---|
| 102 | $params = array_merge($params, $optParams);
|
---|
| 103 | return $this->call('list', [$params], ListConnectionsResponse::class);
|
---|
| 104 | }
|
---|
| 105 | /**
|
---|
| 106 | * Updates the allocated ranges that are assigned to a connection.
|
---|
| 107 | * (connections.patch)
|
---|
| 108 | *
|
---|
| 109 | * @param string $name The private service connection that connects to a service
|
---|
| 110 | * producer organization. The name includes both the private service name and
|
---|
| 111 | * the VPC network peering name in the format of
|
---|
| 112 | * `services/{peering_service_name}/connections/{vpc_peering_name}`. For Google
|
---|
| 113 | * services that support this functionality, this is
|
---|
| 114 | * `services/servicenetworking.googleapis.com/connections/servicenetworking-
|
---|
| 115 | * googleapis-com`.
|
---|
| 116 | * @param Connection $postBody
|
---|
| 117 | * @param array $optParams Optional parameters.
|
---|
| 118 | *
|
---|
| 119 | * @opt_param bool force If a previously defined allocated range is removed,
|
---|
| 120 | * force flag must be set to true.
|
---|
| 121 | * @opt_param string updateMask The update mask. If this is omitted, it defaults
|
---|
| 122 | * to "*". You can only update the listed peering ranges.
|
---|
| 123 | * @return Operation
|
---|
| 124 | * @throws \Google\Service\Exception
|
---|
| 125 | */
|
---|
| 126 | public function patch($name, Connection $postBody, $optParams = [])
|
---|
| 127 | {
|
---|
| 128 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 129 | $params = array_merge($params, $optParams);
|
---|
| 130 | return $this->call('patch', [$params], Operation::class);
|
---|
| 131 | }
|
---|
| 132 | }
|
---|
| 133 |
|
---|
| 134 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 135 | class_alias(ServicesConnections::class, 'Google_Service_ServiceNetworking_Resource_ServicesConnections');
|
---|