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