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\AndroidEnterprise\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\AndroidEnterprise\Entitlement;
|
---|
21 | use Google\Service\AndroidEnterprise\EntitlementsListResponse;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "entitlements" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $androidenterpriseService = new Google\Service\AndroidEnterprise(...);
|
---|
28 | * $entitlements = $androidenterpriseService->entitlements;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class Entitlements extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Removes an entitlement to an app for a user. **Note:** This item has been
|
---|
35 | * deprecated. New integrations cannot use this method and can refer to our new
|
---|
36 | * recommendations. (entitlements.delete)
|
---|
37 | *
|
---|
38 | * @param string $enterpriseId The ID of the enterprise.
|
---|
39 | * @param string $userId The ID of the user.
|
---|
40 | * @param string $entitlementId The ID of the entitlement (a product ID), e.g.
|
---|
41 | * "app:com.google.android.gm".
|
---|
42 | * @param array $optParams Optional parameters.
|
---|
43 | * @throws \Google\Service\Exception
|
---|
44 | */
|
---|
45 | public function delete($enterpriseId, $userId, $entitlementId, $optParams = [])
|
---|
46 | {
|
---|
47 | $params = ['enterpriseId' => $enterpriseId, 'userId' => $userId, 'entitlementId' => $entitlementId];
|
---|
48 | $params = array_merge($params, $optParams);
|
---|
49 | return $this->call('delete', [$params]);
|
---|
50 | }
|
---|
51 | /**
|
---|
52 | * Retrieves details of an entitlement. **Note:** This item has been deprecated.
|
---|
53 | * New integrations cannot use this method and can refer to our new
|
---|
54 | * recommendations. (entitlements.get)
|
---|
55 | *
|
---|
56 | * @param string $enterpriseId The ID of the enterprise.
|
---|
57 | * @param string $userId The ID of the user.
|
---|
58 | * @param string $entitlementId The ID of the entitlement (a product ID), e.g.
|
---|
59 | * "app:com.google.android.gm".
|
---|
60 | * @param array $optParams Optional parameters.
|
---|
61 | * @return Entitlement
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function get($enterpriseId, $userId, $entitlementId, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['enterpriseId' => $enterpriseId, 'userId' => $userId, 'entitlementId' => $entitlementId];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('get', [$params], Entitlement::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Lists all entitlements for the specified user. Only the ID is set. **Note:**
|
---|
72 | * This item has been deprecated. New integrations cannot use this method and
|
---|
73 | * can refer to our new recommendations. (entitlements.listEntitlements)
|
---|
74 | *
|
---|
75 | * @param string $enterpriseId The ID of the enterprise.
|
---|
76 | * @param string $userId The ID of the user.
|
---|
77 | * @param array $optParams Optional parameters.
|
---|
78 | * @return EntitlementsListResponse
|
---|
79 | * @throws \Google\Service\Exception
|
---|
80 | */
|
---|
81 | public function listEntitlements($enterpriseId, $userId, $optParams = [])
|
---|
82 | {
|
---|
83 | $params = ['enterpriseId' => $enterpriseId, 'userId' => $userId];
|
---|
84 | $params = array_merge($params, $optParams);
|
---|
85 | return $this->call('list', [$params], EntitlementsListResponse::class);
|
---|
86 | }
|
---|
87 | /**
|
---|
88 | * Adds or updates an entitlement to an app for a user. **Note:** This item has
|
---|
89 | * been deprecated. New integrations cannot use this method and can refer to our
|
---|
90 | * new recommendations. (entitlements.update)
|
---|
91 | *
|
---|
92 | * @param string $enterpriseId The ID of the enterprise.
|
---|
93 | * @param string $userId The ID of the user.
|
---|
94 | * @param string $entitlementId The ID of the entitlement (a product ID), e.g.
|
---|
95 | * "app:com.google.android.gm".
|
---|
96 | * @param Entitlement $postBody
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | *
|
---|
99 | * @opt_param bool install Set to true to also install the product on all the
|
---|
100 | * user's devices where possible. Failure to install on one or more devices will
|
---|
101 | * not prevent this operation from returning successfully, as long as the
|
---|
102 | * entitlement was successfully assigned to the user.
|
---|
103 | * @return Entitlement
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function update($enterpriseId, $userId, $entitlementId, Entitlement $postBody, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['enterpriseId' => $enterpriseId, 'userId' => $userId, 'entitlementId' => $entitlementId, 'postBody' => $postBody];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('update', [$params], Entitlement::class);
|
---|
111 | }
|
---|
112 | }
|
---|
113 |
|
---|
114 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
115 | class_alias(Entitlements::class, 'Google_Service_AndroidEnterprise_Resource_Entitlements');
|
---|