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\AndroidManagement\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\AndroidManagement\ListMigrationTokensResponse;
|
---|
21 | use Google\Service\AndroidManagement\MigrationToken;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "migrationTokens" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $androidmanagementService = new Google\Service\AndroidManagement(...);
|
---|
28 | * $migrationTokens = $androidmanagementService->enterprises_migrationTokens;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class EnterprisesMigrationTokens extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Creates a migration token, to migrate an existing device from being managed
|
---|
35 | * by the EMM's Device Policy Controller (DPC) to being managed by the Android
|
---|
36 | * Management API. See the guide
|
---|
37 | * (https://developers.google.com/android/management/dpc-migration) for more
|
---|
38 | * details. (migrationTokens.create)
|
---|
39 | *
|
---|
40 | * @param string $parent Required. The enterprise in which this migration token
|
---|
41 | * is created. This must be the same enterprise which already manages the device
|
---|
42 | * in the Play EMM API. Format: enterprises/{enterprise}
|
---|
43 | * @param MigrationToken $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | * @return MigrationToken
|
---|
46 | * @throws \Google\Service\Exception
|
---|
47 | */
|
---|
48 | public function create($parent, MigrationToken $postBody, $optParams = [])
|
---|
49 | {
|
---|
50 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
51 | $params = array_merge($params, $optParams);
|
---|
52 | return $this->call('create', [$params], MigrationToken::class);
|
---|
53 | }
|
---|
54 | /**
|
---|
55 | * Gets a migration token. (migrationTokens.get)
|
---|
56 | *
|
---|
57 | * @param string $name Required. The name of the migration token to retrieve.
|
---|
58 | * Format: enterprises/{enterprise}/migrationTokens/{migration_token}
|
---|
59 | * @param array $optParams Optional parameters.
|
---|
60 | * @return MigrationToken
|
---|
61 | * @throws \Google\Service\Exception
|
---|
62 | */
|
---|
63 | public function get($name, $optParams = [])
|
---|
64 | {
|
---|
65 | $params = ['name' => $name];
|
---|
66 | $params = array_merge($params, $optParams);
|
---|
67 | return $this->call('get', [$params], MigrationToken::class);
|
---|
68 | }
|
---|
69 | /**
|
---|
70 | * Lists migration tokens. (migrationTokens.listEnterprisesMigrationTokens)
|
---|
71 | *
|
---|
72 | * @param string $parent Required. The enterprise which the migration tokens
|
---|
73 | * belong to. Format: enterprises/{enterprise}
|
---|
74 | * @param array $optParams Optional parameters.
|
---|
75 | *
|
---|
76 | * @opt_param int pageSize The maximum number of migration tokens to return.
|
---|
77 | * Fewer migration tokens may be returned. If unspecified, at most 100 migration
|
---|
78 | * tokens will be returned. The maximum value is 100; values above 100 will be
|
---|
79 | * coerced to 100.
|
---|
80 | * @opt_param string pageToken A page token, received from a previous
|
---|
81 | * ListMigrationTokens call. Provide this to retrieve the subsequent page.When
|
---|
82 | * paginating, all other parameters provided to ListMigrationTokens must match
|
---|
83 | * the call that provided the page token.
|
---|
84 | * @return ListMigrationTokensResponse
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function listEnterprisesMigrationTokens($parent, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['parent' => $parent];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('list', [$params], ListMigrationTokensResponse::class);
|
---|
92 | }
|
---|
93 | }
|
---|
94 |
|
---|
95 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
96 | class_alias(EnterprisesMigrationTokens::class, 'Google_Service_AndroidManagement_Resource_EnterprisesMigrationTokens');
|
---|