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