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\Firebasestorage\Resource;
19
20use Google\Service\Firebasestorage\AddFirebaseRequest;
21use Google\Service\Firebasestorage\Bucket;
22use Google\Service\Firebasestorage\FirebasestorageEmpty;
23use Google\Service\Firebasestorage\ListBucketsResponse;
24use Google\Service\Firebasestorage\RemoveFirebaseRequest;
25
26/**
27 * The "buckets" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $firebasestorageService = new Google\Service\Firebasestorage(...);
31 *   $buckets = $firebasestorageService->buckets;
32 *  </code>
33 */
34class ProjectsBuckets extends \Google\Service\Resource
35{
36  /**
37   * Links a Google Cloud Storage bucket to a Firebase project.
38   * (buckets.addFirebase)
39   *
40   * @param string $bucket Required. Resource name of the bucket, mirrors the ID
41   * of the underlying Google Cloud Storage bucket,
42   * `projects/{project_number}/buckets/{bucket_id}`.
43   * @param AddFirebaseRequest $postBody
44   * @param array $optParams Optional parameters.
45   * @return Bucket
46   */
47  public function addFirebase($bucket, AddFirebaseRequest $postBody, $optParams = [])
48  {
49    $params = ['bucket' => $bucket, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('addFirebase', [$params], Bucket::class);
52  }
53  /**
54   * Gets a single linked storage bucket. (buckets.get)
55   *
56   * @param string $name Required. Resource name of the bucket, mirrors the ID of
57   * the underlying Google Cloud Storage bucket,
58   * `projects/{project_number}/buckets/{bucket_id}`.
59   * @param array $optParams Optional parameters.
60   * @return Bucket
61   */
62  public function get($name, $optParams = [])
63  {
64    $params = ['name' => $name];
65    $params = array_merge($params, $optParams);
66    return $this->call('get', [$params], Bucket::class);
67  }
68  /**
69   * Lists the linked storage buckets for a project. (buckets.listProjectsBuckets)
70   *
71   * @param string $parent Required. Resource name of the parent Firebase project,
72   * `projects/{project_number}`.
73   * @param array $optParams Optional parameters.
74   *
75   * @opt_param int pageSize The maximum number of buckets to return. If not set,
76   * the server will use a reasonable default.
77   * @opt_param string pageToken A page token, received from a previous
78   * `ListBuckets` call. Provide this to retrieve the subsequent page. When
79   * paginating, all other parameters provided to `ListBuckets` must match the
80   * call that provided the page token.
81   * @return ListBucketsResponse
82   */
83  public function listProjectsBuckets($parent, $optParams = [])
84  {
85    $params = ['parent' => $parent];
86    $params = array_merge($params, $optParams);
87    return $this->call('list', [$params], ListBucketsResponse::class);
88  }
89  /**
90   * Unlinks a linked Google Cloud Storage bucket from a Firebase project.
91   * (buckets.removeFirebase)
92   *
93   * @param string $bucket Required. Resource name of the bucket, mirrors the ID
94   * of the underlying Google Cloud Storage bucket,
95   * `projects/{project_number}/buckets/{bucket_id}`.
96   * @param RemoveFirebaseRequest $postBody
97   * @param array $optParams Optional parameters.
98   * @return FirebasestorageEmpty
99   */
100  public function removeFirebase($bucket, RemoveFirebaseRequest $postBody, $optParams = [])
101  {
102    $params = ['bucket' => $bucket, 'postBody' => $postBody];
103    $params = array_merge($params, $optParams);
104    return $this->call('removeFirebase', [$params], FirebasestorageEmpty::class);
105  }
106}
107
108// Adding a class alias for backwards compatibility with the previous class name.
109class_alias(ProjectsBuckets::class, 'Google_Service_Firebasestorage_Resource_ProjectsBuckets');
110