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\DataTransfer\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\DataTransfer\DataTransfer;
|
---|
21 | use Google\Service\DataTransfer\DataTransfersListResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "transfers" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $adminService = new Google\Service\DataTransfer(...);
|
---|
28 | * $transfers = $adminService->transfers;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class Transfers extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Retrieves a data transfer request by its resource ID. (transfers.get)
|
---|
35 | *
|
---|
36 | * @param string $dataTransferId ID of the resource to be retrieved. This is
|
---|
37 | * returned in the response from the insert method.
|
---|
38 | * @param array $optParams Optional parameters.
|
---|
39 | * @return DataTransfer
|
---|
40 | * @throws \Google\Service\Exception
|
---|
41 | */
|
---|
42 | public function get($dataTransferId, $optParams = [])
|
---|
43 | {
|
---|
44 | $params = ['dataTransferId' => $dataTransferId];
|
---|
45 | $params = array_merge($params, $optParams);
|
---|
46 | return $this->call('get', [$params], DataTransfer::class);
|
---|
47 | }
|
---|
48 | /**
|
---|
49 | * Inserts a data transfer request. See the [Transfer parameters](/admin-
|
---|
50 | * sdk/data-transfer/v1/parameters) reference for specific application
|
---|
51 | * requirements. (transfers.insert)
|
---|
52 | *
|
---|
53 | * @param DataTransfer $postBody
|
---|
54 | * @param array $optParams Optional parameters.
|
---|
55 | * @return DataTransfer
|
---|
56 | * @throws \Google\Service\Exception
|
---|
57 | */
|
---|
58 | public function insert(DataTransfer $postBody, $optParams = [])
|
---|
59 | {
|
---|
60 | $params = ['postBody' => $postBody];
|
---|
61 | $params = array_merge($params, $optParams);
|
---|
62 | return $this->call('insert', [$params], DataTransfer::class);
|
---|
63 | }
|
---|
64 | /**
|
---|
65 | * Lists the transfers for a customer by source user, destination user, or
|
---|
66 | * status. (transfers.listTransfers)
|
---|
67 | *
|
---|
68 | * @param array $optParams Optional parameters.
|
---|
69 | *
|
---|
70 | * @opt_param string customerId Immutable ID of the Google Workspace account.
|
---|
71 | * @opt_param int maxResults Maximum number of results to return. Default is
|
---|
72 | * 100.
|
---|
73 | * @opt_param string newOwnerUserId Destination user's profile ID.
|
---|
74 | * @opt_param string oldOwnerUserId Source user's profile ID.
|
---|
75 | * @opt_param string pageToken Token to specify the next page in the list.
|
---|
76 | * @opt_param string status Status of the transfer.
|
---|
77 | * @return DataTransfersListResponse
|
---|
78 | * @throws \Google\Service\Exception
|
---|
79 | */
|
---|
80 | public function listTransfers($optParams = [])
|
---|
81 | {
|
---|
82 | $params = [];
|
---|
83 | $params = array_merge($params, $optParams);
|
---|
84 | return $this->call('list', [$params], DataTransfersListResponse::class);
|
---|
85 | }
|
---|
86 | }
|
---|
87 |
|
---|
88 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
89 | class_alias(Transfers::class, 'Google_Service_DataTransfer_Resource_Transfers');
|
---|