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\Install; 21use Google\Service\AndroidEnterprise\InstallsListResponse; 22 23/** 24 * The "installs" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $androidenterpriseService = new Google\Service\AndroidEnterprise(...); 28 * $installs = $androidenterpriseService->installs; 29 * </code> 30 */ 31class Installs extends \Google\Service\Resource 32{ 33 /** 34 * Requests to remove an app from a device. A call to get or list will still 35 * show the app as installed on the device until it is actually removed. 36 * (installs.delete) 37 * 38 * @param string $enterpriseId The ID of the enterprise. 39 * @param string $userId The ID of the user. 40 * @param string $deviceId The Android ID of the device. 41 * @param string $installId The ID of the product represented by the install, 42 * e.g. "app:com.google.android.gm". 43 * @param array $optParams Optional parameters. 44 */ 45 public function delete($enterpriseId, $userId, $deviceId, $installId, $optParams = []) 46 { 47 $params = ['enterpriseId' => $enterpriseId, 'userId' => $userId, 'deviceId' => $deviceId, 'installId' => $installId]; 48 $params = array_merge($params, $optParams); 49 return $this->call('delete', [$params]); 50 } 51 /** 52 * Retrieves details of an installation of an app on a device. (installs.get) 53 * 54 * @param string $enterpriseId The ID of the enterprise. 55 * @param string $userId The ID of the user. 56 * @param string $deviceId The Android ID of the device. 57 * @param string $installId The ID of the product represented by the install, 58 * e.g. "app:com.google.android.gm". 59 * @param array $optParams Optional parameters. 60 * @return Install 61 */ 62 public function get($enterpriseId, $userId, $deviceId, $installId, $optParams = []) 63 { 64 $params = ['enterpriseId' => $enterpriseId, 'userId' => $userId, 'deviceId' => $deviceId, 'installId' => $installId]; 65 $params = array_merge($params, $optParams); 66 return $this->call('get', [$params], Install::class); 67 } 68 /** 69 * Retrieves the details of all apps installed on the specified device. 70 * (installs.listInstalls) 71 * 72 * @param string $enterpriseId The ID of the enterprise. 73 * @param string $userId The ID of the user. 74 * @param string $deviceId The Android ID of the device. 75 * @param array $optParams Optional parameters. 76 * @return InstallsListResponse 77 */ 78 public function listInstalls($enterpriseId, $userId, $deviceId, $optParams = []) 79 { 80 $params = ['enterpriseId' => $enterpriseId, 'userId' => $userId, 'deviceId' => $deviceId]; 81 $params = array_merge($params, $optParams); 82 return $this->call('list', [$params], InstallsListResponse::class); 83 } 84 /** 85 * Requests to install the latest version of an app to a device. If the app is 86 * already installed, then it is updated to the latest version if necessary. 87 * (installs.update) 88 * 89 * @param string $enterpriseId The ID of the enterprise. 90 * @param string $userId The ID of the user. 91 * @param string $deviceId The Android ID of the device. 92 * @param string $installId The ID of the product represented by the install, 93 * e.g. "app:com.google.android.gm". 94 * @param Install $postBody 95 * @param array $optParams Optional parameters. 96 * @return Install 97 */ 98 public function update($enterpriseId, $userId, $deviceId, $installId, Install $postBody, $optParams = []) 99 { 100 $params = ['enterpriseId' => $enterpriseId, 'userId' => $userId, 'deviceId' => $deviceId, 'installId' => $installId, 'postBody' => $postBody]; 101 $params = array_merge($params, $optParams); 102 return $this->call('update', [$params], Install::class); 103 } 104} 105 106// Adding a class alias for backwards compatibility with the previous class name. 107class_alias(Installs::class, 'Google_Service_AndroidEnterprise_Resource_Installs'); 108