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\VMMigrationService\Resource;
19
20use Google\Service\VMMigrationService\DatacenterConnector;
21use Google\Service\VMMigrationService\ListDatacenterConnectorsResponse;
22use Google\Service\VMMigrationService\Operation;
23use Google\Service\VMMigrationService\UpgradeApplianceRequest;
24
25/**
26 * The "datacenterConnectors" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $vmmigrationService = new Google\Service\VMMigrationService(...);
30 *   $datacenterConnectors = $vmmigrationService->datacenterConnectors;
31 *  </code>
32 */
33class ProjectsLocationsSourcesDatacenterConnectors extends \Google\Service\Resource
34{
35  /**
36   * Creates a new DatacenterConnector in a given Source.
37   * (datacenterConnectors.create)
38   *
39   * @param string $parent Required. The DatacenterConnector's parent. Required.
40   * The Source in where the new DatacenterConnector will be created. For example:
41   * `projects/my-project/locations/us-central1/sources/my-source`
42   * @param DatacenterConnector $postBody
43   * @param array $optParams Optional parameters.
44   *
45   * @opt_param string datacenterConnectorId Required. The datacenterConnector
46   * identifier.
47   * @opt_param string requestId A request ID to identify requests. Specify a
48   * unique request ID so that if you must retry your request, the server will
49   * know to ignore the request if it has already been completed. The server will
50   * guarantee that for at least 60 minutes since the first request. For example,
51   * consider a situation where you make an initial request and t he request times
52   * out. If you make the request again with the same request ID, the server can
53   * check if original operation with the same request ID was received, and if so,
54   * will ignore the second request. This prevents clients from accidentally
55   * creating duplicate commitments. The request ID must be a valid UUID with the
56   * exception that zero UUID is not supported
57   * (00000000-0000-0000-0000-000000000000).
58   * @return Operation
59   */
60  public function create($parent, DatacenterConnector $postBody, $optParams = [])
61  {
62    $params = ['parent' => $parent, 'postBody' => $postBody];
63    $params = array_merge($params, $optParams);
64    return $this->call('create', [$params], Operation::class);
65  }
66  /**
67   * Deletes a single DatacenterConnector. (datacenterConnectors.delete)
68   *
69   * @param string $name Required. The DatacenterConnector name.
70   * @param array $optParams Optional parameters.
71   *
72   * @opt_param string requestId A request ID to identify requests. Specify a
73   * unique request ID so that if you must retry your request, the server will
74   * know to ignore the request if it has already been completed. The server will
75   * guarantee that for at least 60 minutes after the first request. For example,
76   * consider a situation where you make an initial request and t he request times
77   * out. If you make the request again with the same request ID, the server can
78   * check if original operation with the same request ID was received, and if so,
79   * will ignore the second request. This prevents clients from accidentally
80   * creating duplicate commitments. The request ID must be a valid UUID with the
81   * exception that zero UUID is not supported
82   * (00000000-0000-0000-0000-000000000000).
83   * @return Operation
84   */
85  public function delete($name, $optParams = [])
86  {
87    $params = ['name' => $name];
88    $params = array_merge($params, $optParams);
89    return $this->call('delete', [$params], Operation::class);
90  }
91  /**
92   * Gets details of a single DatacenterConnector. (datacenterConnectors.get)
93   *
94   * @param string $name Required. The name of the DatacenterConnector.
95   * @param array $optParams Optional parameters.
96   * @return DatacenterConnector
97   */
98  public function get($name, $optParams = [])
99  {
100    $params = ['name' => $name];
101    $params = array_merge($params, $optParams);
102    return $this->call('get', [$params], DatacenterConnector::class);
103  }
104  /**
105   * Lists DatacenterConnectors in a given Source.
106   * (datacenterConnectors.listProjectsLocationsSourcesDatacenterConnectors)
107   *
108   * @param string $parent Required. The parent, which owns this collection of
109   * connectors.
110   * @param array $optParams Optional parameters.
111   *
112   * @opt_param string filter Optional. The filter request.
113   * @opt_param string orderBy Optional. the order by fields for the result.
114   * @opt_param int pageSize Optional. The maximum number of connectors to return.
115   * The service may return fewer than this value. If unspecified, at most 500
116   * sources will be returned. The maximum value is 1000; values above 1000 will
117   * be coerced to 1000.
118   * @opt_param string pageToken Required. A page token, received from a previous
119   * `ListDatacenterConnectors` call. Provide this to retrieve the subsequent
120   * page. When paginating, all other parameters provided to
121   * `ListDatacenterConnectors` must match the call that provided the page token.
122   * @return ListDatacenterConnectorsResponse
123   */
124  public function listProjectsLocationsSourcesDatacenterConnectors($parent, $optParams = [])
125  {
126    $params = ['parent' => $parent];
127    $params = array_merge($params, $optParams);
128    return $this->call('list', [$params], ListDatacenterConnectorsResponse::class);
129  }
130  /**
131   * Upgrades the appliance relate to this DatacenterConnector to the in-place
132   * updateable version. (datacenterConnectors.upgradeAppliance)
133   *
134   * @param string $datacenterConnector Required. The DatacenterConnector name.
135   * @param UpgradeApplianceRequest $postBody
136   * @param array $optParams Optional parameters.
137   * @return Operation
138   */
139  public function upgradeAppliance($datacenterConnector, UpgradeApplianceRequest $postBody, $optParams = [])
140  {
141    $params = ['datacenterConnector' => $datacenterConnector, 'postBody' => $postBody];
142    $params = array_merge($params, $optParams);
143    return $this->call('upgradeAppliance', [$params], Operation::class);
144  }
145}
146
147// Adding a class alias for backwards compatibility with the previous class name.
148class_alias(ProjectsLocationsSourcesDatacenterConnectors::class, 'Google_Service_VMMigrationService_Resource_ProjectsLocationsSourcesDatacenterConnectors');
149