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\FinalizeDefaultLocationRequest; 21use Google\Service\FirebaseManagement\Operation; 22 23/** 24 * The "defaultLocation" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $firebaseService = new Google\Service\FirebaseManagement(...); 28 * $defaultLocation = $firebaseService->defaultLocation; 29 * </code> 30 */ 31class ProjectsDefaultLocation extends \Google\Service\Resource 32{ 33 /** 34 * Sets the default Google Cloud Platform (GCP) resource location for the 35 * specified FirebaseProject. This method creates an App Engine application with 36 * a [default Cloud Storage bucket](https://cloud.google.com/appengine/docs/stan 37 * dard/python/googlecloudstorageclient/setting-up-cloud- 38 * storage#activating_a_cloud_storage_bucket), located in the specified 39 * [`locationId`](#body.request_body.FIELDS.location_id). This location must be 40 * one of the available [GCP resource 41 * locations](https://firebase.google.com/docs/projects/locations). After the 42 * default GCP resource location is finalized, or if it was already set, it 43 * cannot be changed. The default GCP resource location for the specified 44 * `FirebaseProject` might already be set because either the underlying GCP 45 * `Project` already has an App Engine application or `FinalizeDefaultLocation` 46 * was previously called with a specified `locationId`. Any new calls to 47 * `FinalizeDefaultLocation` with a *different* specified `locationId` will 48 * return a 409 error. The result of this call is an 49 * [`Operation`](../../v1beta1/operations), which can be used to track the 50 * provisioning process. The 51 * [`response`](../../v1beta1/operations#Operation.FIELDS.response) type of the 52 * `Operation` is google.protobuf.Empty. The `Operation` can be polled by its 53 * `name` using GetOperation until `done` is true. When `done` is true, the 54 * `Operation` has either succeeded or failed. If the `Operation` has succeeded, 55 * its [`response`](../../v1beta1/operations#Operation.FIELDS.response) will be 56 * set to a google.protobuf.Empty; if the `Operation` has failed, its `error` 57 * will be set to a google.rpc.Status. The `Operation` is automatically deleted 58 * after completion, so there is no need to call DeleteOperation. All fields 59 * listed in the [request body](#request-body) are required. To call 60 * `FinalizeDefaultLocation`, a member must be an Owner of the Project. 61 * (defaultLocation.finalize) 62 * 63 * @param string $parent The resource name of the FirebaseProject for which the 64 * default GCP resource location will be set, in the format: 65 * projects/PROJECT_IDENTIFIER Refer to the `FirebaseProject` 66 * [`name`](../projects#FirebaseProject.FIELDS.name) field for details about 67 * PROJECT_IDENTIFIER values. 68 * @param FinalizeDefaultLocationRequest $postBody 69 * @param array $optParams Optional parameters. 70 * @return Operation 71 */ 72 public function finalize($parent, FinalizeDefaultLocationRequest $postBody, $optParams = []) 73 { 74 $params = ['parent' => $parent, 'postBody' => $postBody]; 75 $params = array_merge($params, $optParams); 76 return $this->call('finalize', [$params], Operation::class); 77 } 78} 79 80// Adding a class alias for backwards compatibility with the previous class name. 81class_alias(ProjectsDefaultLocation::class, 'Google_Service_FirebaseManagement_Resource_ProjectsDefaultLocation'); 82