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\Apigee\Resource;
19
20use Google\Service\Apigee\GoogleCloudApigeeV1ActivateNatAddressRequest;
21use Google\Service\Apigee\GoogleCloudApigeeV1ListNatAddressesResponse;
22use Google\Service\Apigee\GoogleCloudApigeeV1NatAddress;
23use Google\Service\Apigee\GoogleLongrunningOperation;
24
25/**
26 * The "natAddresses" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $apigeeService = new Google\Service\Apigee(...);
30 *   $natAddresses = $apigeeService->natAddresses;
31 *  </code>
32 */
33class OrganizationsInstancesNatAddresses extends \Google\Service\Resource
34{
35  /**
36   * Activates the NAT address. The Apigee instance can now use this for Internet
37   * egress traffic. **Note:** Not supported for Apigee hybrid.
38   * (natAddresses.activate)
39   *
40   * @param string $name Required. Name of the nat address. Use the following
41   * structure in your request:
42   * `organizations/{org}/instances/{instances}/natAddresses/{nataddress}``
43   * @param GoogleCloudApigeeV1ActivateNatAddressRequest $postBody
44   * @param array $optParams Optional parameters.
45   * @return GoogleLongrunningOperation
46   */
47  public function activate($name, GoogleCloudApigeeV1ActivateNatAddressRequest $postBody, $optParams = [])
48  {
49    $params = ['name' => $name, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('activate', [$params], GoogleLongrunningOperation::class);
52  }
53  /**
54   * Creates a NAT address. The address is created in the RESERVED state and a
55   * static external IP address will be provisioned. At this time, the instance
56   * will not use this IP address for Internet egress traffic. The address can be
57   * activated for use once any required firewall IP whitelisting has been
58   * completed. **Note:** Not supported for Apigee hybrid. (natAddresses.create)
59   *
60   * @param string $parent Required. Name of the instance. Use the following
61   * structure in your request: `organizations/{org}/instances/{instance}`
62   * @param GoogleCloudApigeeV1NatAddress $postBody
63   * @param array $optParams Optional parameters.
64   * @return GoogleLongrunningOperation
65   */
66  public function create($parent, GoogleCloudApigeeV1NatAddress $postBody, $optParams = [])
67  {
68    $params = ['parent' => $parent, 'postBody' => $postBody];
69    $params = array_merge($params, $optParams);
70    return $this->call('create', [$params], GoogleLongrunningOperation::class);
71  }
72  /**
73   * Deletes the NAT address. Connections that are actively using the address are
74   * drained before it is removed. **Note:** Not supported for Apigee hybrid.
75   * (natAddresses.delete)
76   *
77   * @param string $name Required. Name of the nat address. Use the following
78   * structure in your request:
79   * `organizations/{org}/instances/{instances}/natAddresses/{nataddress}``
80   * @param array $optParams Optional parameters.
81   * @return GoogleLongrunningOperation
82   */
83  public function delete($name, $optParams = [])
84  {
85    $params = ['name' => $name];
86    $params = array_merge($params, $optParams);
87    return $this->call('delete', [$params], GoogleLongrunningOperation::class);
88  }
89  /**
90   * Gets the details of a NAT address. **Note:** Not supported for Apigee hybrid.
91   * (natAddresses.get)
92   *
93   * @param string $name Required. Name of the nat address. Use the following
94   * structure in your request:
95   * `organizations/{org}/instances/{instances}/natAddresses/{nataddress}`
96   * @param array $optParams Optional parameters.
97   * @return GoogleCloudApigeeV1NatAddress
98   */
99  public function get($name, $optParams = [])
100  {
101    $params = ['name' => $name];
102    $params = array_merge($params, $optParams);
103    return $this->call('get', [$params], GoogleCloudApigeeV1NatAddress::class);
104  }
105  /**
106   * Lists the NAT addresses for an Apigee instance. **Note:** Not supported for
107   * Apigee hybrid. (natAddresses.listOrganizationsInstancesNatAddresses)
108   *
109   * @param string $parent Required. Name of the instance. Use the following
110   * structure in your request: `organizations/{org}/instances/{instance}`
111   * @param array $optParams Optional parameters.
112   *
113   * @opt_param int pageSize Maximum number of natAddresses to return. Defaults to
114   * 25.
115   * @opt_param string pageToken Page token, returned from a previous
116   * ListNatAddresses call, that you can use to retrieve the next page of content.
117   * @return GoogleCloudApigeeV1ListNatAddressesResponse
118   */
119  public function listOrganizationsInstancesNatAddresses($parent, $optParams = [])
120  {
121    $params = ['parent' => $parent];
122    $params = array_merge($params, $optParams);
123    return $this->call('list', [$params], GoogleCloudApigeeV1ListNatAddressesResponse::class);
124  }
125}
126
127// Adding a class alias for backwards compatibility with the previous class name.
128class_alias(OrganizationsInstancesNatAddresses::class, 'Google_Service_Apigee_Resource_OrganizationsInstancesNatAddresses');
129