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\FirebaseManagement\Resource;
19
20use Google\Service\FirebaseManagement\AndroidApp;
21use Google\Service\FirebaseManagement\AndroidAppConfig;
22use Google\Service\FirebaseManagement\ListAndroidAppsResponse;
23use Google\Service\FirebaseManagement\Operation;
24
25/**
26 * The "androidApps" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $firebaseService = new Google\Service\FirebaseManagement(...);
30 *   $androidApps = $firebaseService->androidApps;
31 *  </code>
32 */
33class ProjectsAndroidApps extends \Google\Service\Resource
34{
35  /**
36   * Requests the creation of a new AndroidApp in the specified FirebaseProject.
37   * The result of this call is an `Operation` which can be used to track the
38   * provisioning process. The `Operation` is automatically deleted after
39   * completion, so there is no need to call `DeleteOperation`.
40   * (androidApps.create)
41   *
42   * @param string $parent The resource name of the parent FirebaseProject in
43   * which to create an AndroidApp, in the format:
44   * projects/PROJECT_IDENTIFIER/androidApps Refer to the `FirebaseProject`
45   * [`name`](../projects#FirebaseProject.FIELDS.name) field for details about
46   * PROJECT_IDENTIFIER values.
47   * @param AndroidApp $postBody
48   * @param array $optParams Optional parameters.
49   * @return Operation
50   */
51  public function create($parent, AndroidApp $postBody, $optParams = [])
52  {
53    $params = ['parent' => $parent, 'postBody' => $postBody];
54    $params = array_merge($params, $optParams);
55    return $this->call('create', [$params], Operation::class);
56  }
57  /**
58   * Gets the specified AndroidApp. (androidApps.get)
59   *
60   * @param string $name The resource name of the AndroidApp, in the format:
61   * projects/ PROJECT_IDENTIFIER/androidApps/APP_ID Since an APP_ID is a unique
62   * identifier, the Unique Resource from Sub-Collection access pattern may be
63   * used here, in the format: projects/-/androidApps/APP_ID Refer to the
64   * `AndroidApp` [`name`](../projects.androidApps#AndroidApp.FIELDS.name) field
65   * for details about PROJECT_IDENTIFIER and APP_ID values.
66   * @param array $optParams Optional parameters.
67   * @return AndroidApp
68   */
69  public function get($name, $optParams = [])
70  {
71    $params = ['name' => $name];
72    $params = array_merge($params, $optParams);
73    return $this->call('get', [$params], AndroidApp::class);
74  }
75  /**
76   * Gets the configuration artifact associated with the specified AndroidApp.
77   * (androidApps.getConfig)
78   *
79   * @param string $name The resource name of the AndroidApp configuration to
80   * download, in the format:
81   * projects/PROJECT_IDENTIFIER/androidApps/APP_ID/config Since an APP_ID is a
82   * unique identifier, the Unique Resource from Sub-Collection access pattern may
83   * be used here, in the format: projects/-/androidApps/APP_ID Refer to the
84   * `AndroidApp` [`name`](../projects.androidApps#AndroidApp.FIELDS.name) field
85   * for details about PROJECT_IDENTIFIER and APP_ID values.
86   * @param array $optParams Optional parameters.
87   * @return AndroidAppConfig
88   */
89  public function getConfig($name, $optParams = [])
90  {
91    $params = ['name' => $name];
92    $params = array_merge($params, $optParams);
93    return $this->call('getConfig', [$params], AndroidAppConfig::class);
94  }
95  /**
96   * Lists each AndroidApp associated with the specified FirebaseProject. The
97   * elements are returned in no particular order, but will be a consistent view
98   * of the Apps when additional requests are made with a `pageToken`.
99   * (androidApps.listProjectsAndroidApps)
100   *
101   * @param string $parent The resource name of the parent FirebaseProject for
102   * which to list each associated AndroidApp, in the format:
103   * projects/PROJECT_IDENTIFIER /androidApps Refer to the `FirebaseProject`
104   * [`name`](../projects#FirebaseProject.FIELDS.name) field for details about
105   * PROJECT_IDENTIFIER values.
106   * @param array $optParams Optional parameters.
107   *
108   * @opt_param int pageSize The maximum number of Apps to return in the response.
109   * The server may return fewer than this at its discretion. If no value is
110   * specified (or too large a value is specified), then the server will impose
111   * its own limit.
112   * @opt_param string pageToken Token returned from a previous call to
113   * `ListAndroidApps` indicating where in the set of Apps to resume listing.
114   * @return ListAndroidAppsResponse
115   */
116  public function listProjectsAndroidApps($parent, $optParams = [])
117  {
118    $params = ['parent' => $parent];
119    $params = array_merge($params, $optParams);
120    return $this->call('list', [$params], ListAndroidAppsResponse::class);
121  }
122  /**
123   * Updates the attributes of the specified AndroidApp. (androidApps.patch)
124   *
125   * @param string $name The resource name of the AndroidApp, in the format:
126   * projects/ PROJECT_IDENTIFIER/androidApps/APP_ID * PROJECT_IDENTIFIER: the
127   * parent Project's
128   * [`ProjectNumber`](../projects#FirebaseProject.FIELDS.project_number)
129   * ***(recommended)*** or its
130   * [`ProjectId`](../projects#FirebaseProject.FIELDS.project_id). Learn more
131   * about using project identifiers in Google's [AIP 2510
132   * standard](https://google.aip.dev/cloud/2510). Note that the value for
133   * PROJECT_IDENTIFIER in any response body will be the `ProjectId`. * APP_ID:
134   * the globally unique, Firebase-assigned identifier for the App (see
135   * [`appId`](../projects.androidApps#AndroidApp.FIELDS.app_id)).
136   * @param AndroidApp $postBody
137   * @param array $optParams Optional parameters.
138   *
139   * @opt_param string updateMask Specifies which fields to update. Note that the
140   * fields `name`, `app_id`, `project_id`, and `package_name` are all immutable.
141   * @return AndroidApp
142   */
143  public function patch($name, AndroidApp $postBody, $optParams = [])
144  {
145    $params = ['name' => $name, 'postBody' => $postBody];
146    $params = array_merge($params, $optParams);
147    return $this->call('patch', [$params], AndroidApp::class);
148  }
149}
150
151// Adding a class alias for backwards compatibility with the previous class name.
152class_alias(ProjectsAndroidApps::class, 'Google_Service_FirebaseManagement_Resource_ProjectsAndroidApps');
153