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
18namespace Google\Service\ServiceNetworking\Resource;
19
20use Google\Service\ServiceNetworking\ConsumerConfig;
21use Google\Service\ServiceNetworking\Operation;
22use Google\Service\ServiceNetworking\UpdateConsumerConfigRequest;
23
24/**
25 * The "networks" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $servicenetworkingService = new Google\Service\ServiceNetworking(...);
29 *   $networks = $servicenetworkingService->networks;
30 *  </code>
31 */
32class ServicesProjectsServicenetworkingGlobalNetworks extends \Google\Service\Resource
33{
34  /**
35   * Service producers use this method to get the configuration of their
36   * connection including the import/export of custom routes and subnetwork routes
37   * with public IP. (networks.get)
38   *
39   * @param string $name Required. Name of the consumer config to retrieve in the
40   * format: `services/{service}/projects/{project}/global/networks/{network}`.
41   * {service} is the peering service that is managing connectivity for the
42   * service producer's organization. For Google services that support this
43   * functionality, this value is `servicenetworking.googleapis.com`. {project} is
44   * a project number e.g. `12345` that contains the service consumer's VPC
45   * network. {network} is the name of the service consumer's VPC network.
46   * @param array $optParams Optional parameters.
47   * @return ConsumerConfig
48   */
49  public function get($name, $optParams = [])
50  {
51    $params = ['name' => $name];
52    $params = array_merge($params, $optParams);
53    return $this->call('get', [$params], ConsumerConfig::class);
54  }
55  /**
56   * Service producers use this method to update the configuration of their
57   * connection including the import/export of custom routes and subnetwork routes
58   * with public IP. (networks.updateConsumerConfig)
59   *
60   * @param string $parent Required. Parent resource identifying the connection
61   * for which the consumer config is being updated in the format:
62   * `services/{service}/projects/{project}/global/networks/{network}` {service}
63   * is the peering service that is managing connectivity for the service
64   * producer's organization. For Google services that support this functionality,
65   * this value is `servicenetworking.googleapis.com`. {project} is the number of
66   * the project that contains the service consumer's VPC network e.g. `12345`.
67   * {network} is the name of the service consumer's VPC network.
68   * @param UpdateConsumerConfigRequest $postBody
69   * @param array $optParams Optional parameters.
70   * @return Operation
71   */
72  public function updateConsumerConfig($parent, UpdateConsumerConfigRequest $postBody, $optParams = [])
73  {
74    $params = ['parent' => $parent, 'postBody' => $postBody];
75    $params = array_merge($params, $optParams);
76    return $this->call('updateConsumerConfig', [$params], Operation::class);
77  }
78}
79
80// Adding a class alias for backwards compatibility with the previous class name.
81class_alias(ServicesProjectsServicenetworkingGlobalNetworks::class, 'Google_Service_ServiceNetworking_Resource_ServicesProjectsServicenetworkingGlobalNetworks');
82