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\DeviceTierConfig;
21use Google\Service\AndroidPublisher\ListDeviceTierConfigsResponse;
22
23/**
24 * The "deviceTierConfigs" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $androidpublisherService = new Google\Service\AndroidPublisher(...);
28 *   $deviceTierConfigs = $androidpublisherService->deviceTierConfigs;
29 *  </code>
30 */
31class ApplicationsDeviceTierConfigs extends \Google\Service\Resource
32{
33  /**
34   * Creates a new device tier config for an app. (deviceTierConfigs.create)
35   *
36   * @param string $packageName Package name of the app.
37   * @param DeviceTierConfig $postBody
38   * @param array $optParams Optional parameters.
39   *
40   * @opt_param bool allowUnknownDevices Whether the service should accept device
41   * IDs that are unknown to Play's device catalog.
42   * @return DeviceTierConfig
43   */
44  public function create($packageName, DeviceTierConfig $postBody, $optParams = [])
45  {
46    $params = ['packageName' => $packageName, 'postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('create', [$params], DeviceTierConfig::class);
49  }
50  /**
51   * Returns a particular device tier config. (deviceTierConfigs.get)
52   *
53   * @param string $packageName Package name of the app.
54   * @param string $deviceTierConfigId Required. Id of an existing device tier
55   * config.
56   * @param array $optParams Optional parameters.
57   * @return DeviceTierConfig
58   */
59  public function get($packageName, $deviceTierConfigId, $optParams = [])
60  {
61    $params = ['packageName' => $packageName, 'deviceTierConfigId' => $deviceTierConfigId];
62    $params = array_merge($params, $optParams);
63    return $this->call('get', [$params], DeviceTierConfig::class);
64  }
65  /**
66   * Returns created device tier configs, ordered by descending creation time.
67   * (deviceTierConfigs.listApplicationsDeviceTierConfigs)
68   *
69   * @param string $packageName Package name of the app.
70   * @param array $optParams Optional parameters.
71   *
72   * @opt_param int pageSize The maximum number of device tier configs to return.
73   * The service may return fewer than this value. If unspecified, at most 10
74   * device tier configs will be returned. The maximum value for this field is
75   * 100; values above 100 will be coerced to 100. Device tier configs will be
76   * ordered by descending creation time.
77   * @opt_param string pageToken A page token, received from a previous
78   * `ListDeviceTierConfigs` call. Provide this to retrieve the subsequent page.
79   * @return ListDeviceTierConfigsResponse
80   */
81  public function listApplicationsDeviceTierConfigs($packageName, $optParams = [])
82  {
83    $params = ['packageName' => $packageName];
84    $params = array_merge($params, $optParams);
85    return $this->call('list', [$params], ListDeviceTierConfigsResponse::class);
86  }
87}
88
89// Adding a class alias for backwards compatibility with the previous class name.
90class_alias(ApplicationsDeviceTierConfigs::class, 'Google_Service_AndroidPublisher_Resource_ApplicationsDeviceTierConfigs');
91