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\AndroidPublisher\Resource;
19
20use Google\Service\AndroidPublisher\Apk;
21use Google\Service\AndroidPublisher\ApksAddExternallyHostedRequest;
22use Google\Service\AndroidPublisher\ApksAddExternallyHostedResponse;
23use Google\Service\AndroidPublisher\ApksListResponse;
24
25/**
26 * The "apks" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $androidpublisherService = new Google\Service\AndroidPublisher(...);
30 *   $apks = $androidpublisherService->apks;
31 *  </code>
32 */
33class EditsApks extends \Google\Service\Resource
34{
35  /**
36   * Creates a new APK without uploading the APK itself to Google Play, instead
37   * hosting the APK at a specified URL. This function is only available to
38   * organizations using Managed Play whose application is configured to restrict
39   * distribution to the organizations. (apks.addexternallyhosted)
40   *
41   * @param string $packageName Package name of the app.
42   * @param string $editId Identifier of the edit.
43   * @param ApksAddExternallyHostedRequest $postBody
44   * @param array $optParams Optional parameters.
45   * @return ApksAddExternallyHostedResponse
46   */
47  public function addexternallyhosted($packageName, $editId, ApksAddExternallyHostedRequest $postBody, $optParams = [])
48  {
49    $params = ['packageName' => $packageName, 'editId' => $editId, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('addexternallyhosted', [$params], ApksAddExternallyHostedResponse::class);
52  }
53  /**
54   * Lists all current APKs of the app and edit. (apks.listEditsApks)
55   *
56   * @param string $packageName Package name of the app.
57   * @param string $editId Identifier of the edit.
58   * @param array $optParams Optional parameters.
59   * @return ApksListResponse
60   */
61  public function listEditsApks($packageName, $editId, $optParams = [])
62  {
63    $params = ['packageName' => $packageName, 'editId' => $editId];
64    $params = array_merge($params, $optParams);
65    return $this->call('list', [$params], ApksListResponse::class);
66  }
67  /**
68   * Uploads an APK and adds to the current edit. (apks.upload)
69   *
70   * @param string $packageName Package name of the app.
71   * @param string $editId Identifier of the edit.
72   * @param array $optParams Optional parameters.
73   * @return Apk
74   */
75  public function upload($packageName, $editId, $optParams = [])
76  {
77    $params = ['packageName' => $packageName, 'editId' => $editId];
78    $params = array_merge($params, $optParams);
79    return $this->call('upload', [$params], Apk::class);
80  }
81}
82
83// Adding a class alias for backwards compatibility with the previous class name.
84class_alias(EditsApks::class, 'Google_Service_AndroidPublisher_Resource_EditsApks');
85