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\Datastream\Resource;
19
20use Google\Service\Datastream\ListPrivateConnectionsResponse;
21use Google\Service\Datastream\Operation;
22use Google\Service\Datastream\PrivateConnection;
23
24/**
25 * The "privateConnections" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $datastreamService = new Google\Service\Datastream(...);
29 *   $privateConnections = $datastreamService->privateConnections;
30 *  </code>
31 */
32class ProjectsLocationsPrivateConnections extends \Google\Service\Resource
33{
34  /**
35   * Use this method to create a private connectivity configuration.
36   * (privateConnections.create)
37   *
38   * @param string $parent Required. The parent that owns the collection of
39   * PrivateConnections.
40   * @param PrivateConnection $postBody
41   * @param array $optParams Optional parameters.
42   *
43   * @opt_param string privateConnectionId Required. The private connectivity
44   * identifier.
45   * @opt_param string requestId Optional. A request ID to identify requests.
46   * Specify a unique request ID so that if you must retry your request, the
47   * server will know to ignore the request if it has already been completed. The
48   * server will guarantee that for at least 60 minutes since the first request.
49   * For example, consider a situation where you make an initial request and the
50   * request times out. If you make the request again with the same request ID,
51   * the server can check if original operation with the same request ID was
52   * received, and if so, will ignore the second request. This prevents clients
53   * from accidentally creating duplicate commitments. The request ID must be a
54   * valid UUID with the exception that zero UUID is not supported
55   * (00000000-0000-0000-0000-000000000000).
56   * @return Operation
57   */
58  public function create($parent, PrivateConnection $postBody, $optParams = [])
59  {
60    $params = ['parent' => $parent, 'postBody' => $postBody];
61    $params = array_merge($params, $optParams);
62    return $this->call('create', [$params], Operation::class);
63  }
64  /**
65   * Use this method to delete a private connectivity configuration.
66   * (privateConnections.delete)
67   *
68   * @param string $name Required. The name of the private connectivity
69   * configuration to delete.
70   * @param array $optParams Optional parameters.
71   *
72   * @opt_param bool force Optional. If set to true, any child routes that belong
73   * to this PrivateConnection will also be deleted.
74   * @opt_param string requestId Optional. A request ID to identify requests.
75   * Specify a unique request ID so that if you must retry your request, the
76   * server will know to ignore the request if it has already been completed. The
77   * server will guarantee that for at least 60 minutes after the first request.
78   * For example, consider a situation where you make an initial request and the
79   * request times out. If you make the request again with the same request ID,
80   * the server can check if original operation with the same request ID was
81   * received, and if so, will ignore the second request. This prevents clients
82   * from accidentally creating duplicate commitments. The request ID must be a
83   * valid UUID with the exception that zero UUID is not supported
84   * (00000000-0000-0000-0000-000000000000).
85   * @return Operation
86   */
87  public function delete($name, $optParams = [])
88  {
89    $params = ['name' => $name];
90    $params = array_merge($params, $optParams);
91    return $this->call('delete', [$params], Operation::class);
92  }
93  /**
94   * Use this method to get details about a private connectivity configuration.
95   * (privateConnections.get)
96   *
97   * @param string $name Required. The name of the private connectivity
98   * configuration to get.
99   * @param array $optParams Optional parameters.
100   * @return PrivateConnection
101   */
102  public function get($name, $optParams = [])
103  {
104    $params = ['name' => $name];
105    $params = array_merge($params, $optParams);
106    return $this->call('get', [$params], PrivateConnection::class);
107  }
108  /**
109   * Use this method to list private connectivity configurations in a project and
110   * location. (privateConnections.listProjectsLocationsPrivateConnections)
111   *
112   * @param string $parent Required. The parent that owns the collection of
113   * private connectivity configurations.
114   * @param array $optParams Optional parameters.
115   *
116   * @opt_param string filter Filter request.
117   * @opt_param string orderBy Order by fields for the result.
118   * @opt_param int pageSize Maximum number of private connectivity configurations
119   * to return. If unspecified, at most 50 private connectivity configurations
120   * that will be returned. The maximum value is 1000; values above 1000 will be
121   * coerced to 1000.
122   * @opt_param string pageToken Page token received from a previous
123   * `ListPrivateConnections` call. Provide this to retrieve the subsequent page.
124   * When paginating, all other parameters provided to `ListPrivateConnections`
125   * must match the call that provided the page token.
126   * @return ListPrivateConnectionsResponse
127   */
128  public function listProjectsLocationsPrivateConnections($parent, $optParams = [])
129  {
130    $params = ['parent' => $parent];
131    $params = array_merge($params, $optParams);
132    return $this->call('list', [$params], ListPrivateConnectionsResponse::class);
133  }
134}
135
136// Adding a class alias for backwards compatibility with the previous class name.
137class_alias(ProjectsLocationsPrivateConnections::class, 'Google_Service_Datastream_Resource_ProjectsLocationsPrivateConnections');
138