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 |
|
---|
18 | namespace Google\Service\DataPortability\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DataPortability\PortabilityArchiveState;
|
---|
21 | use Google\Service\DataPortability\RetryPortabilityArchiveRequest;
|
---|
22 | use Google\Service\DataPortability\RetryPortabilityArchiveResponse;
|
---|
23 |
|
---|
24 | /**
|
---|
25 | * The "archiveJobs" collection of methods.
|
---|
26 | * Typical usage is:
|
---|
27 | * <code>
|
---|
28 | * $dataportabilityService = new Google\Service\DataPortability(...);
|
---|
29 | * $archiveJobs = $dataportabilityService->archiveJobs;
|
---|
30 | * </code>
|
---|
31 | */
|
---|
32 | class ArchiveJobs extends \Google\Service\Resource
|
---|
33 | {
|
---|
34 | /**
|
---|
35 | * Retrieves the state of an Archive job for the Portability API.
|
---|
36 | * (archiveJobs.getPortabilityArchiveState)
|
---|
37 | *
|
---|
38 | * @param string $name Required. The archive job ID that is returned when you
|
---|
39 | * request the state of the job. The format is:
|
---|
40 | * archiveJobs/{archive_job}/portabilityArchiveState. archive_job is the job ID
|
---|
41 | * returned by the InitiatePortabilityArchiveResponse.
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | * @return PortabilityArchiveState
|
---|
44 | * @throws \Google\Service\Exception
|
---|
45 | */
|
---|
46 | public function getPortabilityArchiveState($name, $optParams = [])
|
---|
47 | {
|
---|
48 | $params = ['name' => $name];
|
---|
49 | $params = array_merge($params, $optParams);
|
---|
50 | return $this->call('getPortabilityArchiveState', [$params], PortabilityArchiveState::class);
|
---|
51 | }
|
---|
52 | /**
|
---|
53 | * Retries a failed Portability Archive job. (archiveJobs.retry)
|
---|
54 | *
|
---|
55 | * @param string $name Required. The Archive job ID you're retrying. This is
|
---|
56 | * returned by the InitiatePortabilityArchiveResponse. Retrying is only executed
|
---|
57 | * if the initial job failed.
|
---|
58 | * @param RetryPortabilityArchiveRequest $postBody
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | * @return RetryPortabilityArchiveResponse
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function retry($name, RetryPortabilityArchiveRequest $postBody, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('retry', [$params], RetryPortabilityArchiveResponse::class);
|
---|
68 | }
|
---|
69 | }
|
---|
70 |
|
---|
71 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
72 | class_alias(ArchiveJobs::class, 'Google_Service_DataPortability_Resource_ArchiveJobs');
|
---|