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\CancelCloneJobRequest;
21use Google\Service\VMMigrationService\CloneJob;
22use Google\Service\VMMigrationService\ListCloneJobsResponse;
23use Google\Service\VMMigrationService\Operation;
24
25/**
26 * The "cloneJobs" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $vmmigrationService = new Google\Service\VMMigrationService(...);
30 *   $cloneJobs = $vmmigrationService->cloneJobs;
31 *  </code>
32 */
33class ProjectsLocationsSourcesMigratingVmsCloneJobs extends \Google\Service\Resource
34{
35  /**
36   * Initiates the cancellation of a running clone job. (cloneJobs.cancel)
37   *
38   * @param string $name Required. The clone job id
39   * @param CancelCloneJobRequest $postBody
40   * @param array $optParams Optional parameters.
41   * @return Operation
42   */
43  public function cancel($name, CancelCloneJobRequest $postBody, $optParams = [])
44  {
45    $params = ['name' => $name, 'postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('cancel', [$params], Operation::class);
48  }
49  /**
50   * Initiates a Clone of a specific migrating VM. (cloneJobs.create)
51   *
52   * @param string $parent Required. The Clone's parent.
53   * @param CloneJob $postBody
54   * @param array $optParams Optional parameters.
55   *
56   * @opt_param string cloneJobId Required. The clone job identifier.
57   * @opt_param string requestId A request ID to identify requests. Specify a
58   * unique request ID so that if you must retry your request, the server will
59   * know to ignore the request if it has already been completed. The server will
60   * guarantee that for at least 60 minutes since the first request. For example,
61   * consider a situation where you make an initial request and t he request times
62   * out. If you make the request again with the same request ID, the server can
63   * check if original operation with the same request ID was received, and if so,
64   * will ignore the second request. This prevents clients from accidentally
65   * creating duplicate commitments. The request ID must be a valid UUID with the
66   * exception that zero UUID is not supported
67   * (00000000-0000-0000-0000-000000000000).
68   * @return Operation
69   */
70  public function create($parent, CloneJob $postBody, $optParams = [])
71  {
72    $params = ['parent' => $parent, 'postBody' => $postBody];
73    $params = array_merge($params, $optParams);
74    return $this->call('create', [$params], Operation::class);
75  }
76  /**
77   * Gets details of a single CloneJob. (cloneJobs.get)
78   *
79   * @param string $name Required. The name of the CloneJob.
80   * @param array $optParams Optional parameters.
81   * @return CloneJob
82   */
83  public function get($name, $optParams = [])
84  {
85    $params = ['name' => $name];
86    $params = array_merge($params, $optParams);
87    return $this->call('get', [$params], CloneJob::class);
88  }
89  /**
90   * Lists CloneJobs of a given migrating VM.
91   * (cloneJobs.listProjectsLocationsSourcesMigratingVmsCloneJobs)
92   *
93   * @param string $parent Required. The parent, which owns this collection of
94   * source VMs.
95   * @param array $optParams Optional parameters.
96   *
97   * @opt_param string filter Optional. The filter request.
98   * @opt_param string orderBy Optional. the order by fields for the result.
99   * @opt_param int pageSize Optional. The maximum number of clone jobs to return.
100   * The service may return fewer than this value. If unspecified, at most 500
101   * clone jobs will be returned. The maximum value is 1000; values above 1000
102   * will be coerced to 1000.
103   * @opt_param string pageToken Required. A page token, received from a previous
104   * `ListCloneJobs` call. Provide this to retrieve the subsequent page. When
105   * paginating, all other parameters provided to `ListCloneJobs` must match the
106   * call that provided the page token.
107   * @return ListCloneJobsResponse
108   */
109  public function listProjectsLocationsSourcesMigratingVmsCloneJobs($parent, $optParams = [])
110  {
111    $params = ['parent' => $parent];
112    $params = array_merge($params, $optParams);
113    return $this->call('list', [$params], ListCloneJobsResponse::class);
114  }
115}
116
117// Adding a class alias for backwards compatibility with the previous class name.
118class_alias(ProjectsLocationsSourcesMigratingVmsCloneJobs::class, 'Google_Service_VMMigrationService_Resource_ProjectsLocationsSourcesMigratingVmsCloneJobs');
119