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\SystemApksListResponse;
21use Google\Service\AndroidPublisher\Variant;
22
23/**
24 * The "variants" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $androidpublisherService = new Google\Service\AndroidPublisher(...);
28 *   $variants = $androidpublisherService->variants;
29 *  </code>
30 */
31class SystemapksVariants extends \Google\Service\Resource
32{
33  /**
34   * Creates an APK which is suitable for inclusion in a system image from an
35   * already uploaded Android App Bundle. (variants.create)
36   *
37   * @param string $packageName Package name of the app.
38   * @param string $versionCode The version code of the App Bundle.
39   * @param Variant $postBody
40   * @param array $optParams Optional parameters.
41   * @return Variant
42   */
43  public function create($packageName, $versionCode, Variant $postBody, $optParams = [])
44  {
45    $params = ['packageName' => $packageName, 'versionCode' => $versionCode, 'postBody' => $postBody];
46    $params = array_merge($params, $optParams);
47    return $this->call('create', [$params], Variant::class);
48  }
49  /**
50   * Downloads a previously created system APK which is suitable for inclusion in
51   * a system image. (variants.download)
52   *
53   * @param string $packageName Package name of the app.
54   * @param string $versionCode The version code of the App Bundle.
55   * @param string $variantId The ID of a previously created system APK variant.
56   * @param array $optParams Optional parameters.
57   */
58  public function download($packageName, $versionCode, $variantId, $optParams = [])
59  {
60    $params = ['packageName' => $packageName, 'versionCode' => $versionCode, 'variantId' => $variantId];
61    $params = array_merge($params, $optParams);
62    return $this->call('download', [$params]);
63  }
64  /**
65   * Returns a previously created system APK variant. (variants.get)
66   *
67   * @param string $packageName Package name of the app.
68   * @param string $versionCode The version code of the App Bundle.
69   * @param string $variantId The ID of a previously created system APK variant.
70   * @param array $optParams Optional parameters.
71   * @return Variant
72   */
73  public function get($packageName, $versionCode, $variantId, $optParams = [])
74  {
75    $params = ['packageName' => $packageName, 'versionCode' => $versionCode, 'variantId' => $variantId];
76    $params = array_merge($params, $optParams);
77    return $this->call('get', [$params], Variant::class);
78  }
79  /**
80   * Returns the list of previously created system APK variants.
81   * (variants.listSystemapksVariants)
82   *
83   * @param string $packageName Package name of the app.
84   * @param string $versionCode The version code of the App Bundle.
85   * @param array $optParams Optional parameters.
86   * @return SystemApksListResponse
87   */
88  public function listSystemapksVariants($packageName, $versionCode, $optParams = [])
89  {
90    $params = ['packageName' => $packageName, 'versionCode' => $versionCode];
91    $params = array_merge($params, $optParams);
92    return $this->call('list', [$params], SystemApksListResponse::class);
93  }
94}
95
96// Adding a class alias for backwards compatibility with the previous class name.
97class_alias(SystemapksVariants::class, 'Google_Service_AndroidPublisher_Resource_SystemapksVariants');
98