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