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