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;
19
20use Google\Client;
21
22/**
23 * Service definition for FirebaseRules (v1).
24 *
25 * <p>
26 * Creates and manages rules that determine when a Firebase Rules-enabled
27 * service should permit a request.</p>
28 *
29 * <p>
30 * For more information about this service, see the API
31 * <a href="https://firebase.google.com/docs/storage/security" target="_blank">Documentation</a>
32 * </p>
33 *
34 * @author Google, Inc.
35 */
36class FirebaseRules extends \Google\Service
37{
38  /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
39  const CLOUD_PLATFORM =
40      "https://www.googleapis.com/auth/cloud-platform";
41  /** View and administer all your Firebase data and settings. */
42  const FIREBASE =
43      "https://www.googleapis.com/auth/firebase";
44  /** View all your Firebase data and settings. */
45  const FIREBASE_READONLY =
46      "https://www.googleapis.com/auth/firebase.readonly";
47
48  public $projects;
49  public $projects_releases;
50  public $projects_rulesets;
51
52  /**
53   * Constructs the internal representation of the FirebaseRules service.
54   *
55   * @param Client|array $clientOrConfig The client used to deliver requests, or a
56   *                                     config array to pass to a new Client instance.
57   * @param string $rootUrl The root URL used for requests to the service.
58   */
59  public function __construct($clientOrConfig = [], $rootUrl = null)
60  {
61    parent::__construct($clientOrConfig);
62    $this->rootUrl = $rootUrl ?: 'https://firebaserules.googleapis.com/';
63    $this->servicePath = '';
64    $this->batchPath = 'batch';
65    $this->version = 'v1';
66    $this->serviceName = 'firebaserules';
67
68    $this->projects = new FirebaseRules\Resource\Projects(
69        $this,
70        $this->serviceName,
71        'projects',
72        [
73          'methods' => [
74            'test' => [
75              'path' => 'v1/{+name}:test',
76              'httpMethod' => 'POST',
77              'parameters' => [
78                'name' => [
79                  'location' => 'path',
80                  'type' => 'string',
81                  'required' => true,
82                ],
83              ],
84            ],
85          ]
86        ]
87    );
88    $this->projects_releases = new FirebaseRules\Resource\ProjectsReleases(
89        $this,
90        $this->serviceName,
91        'releases',
92        [
93          'methods' => [
94            'create' => [
95              'path' => 'v1/{+name}/releases',
96              'httpMethod' => 'POST',
97              'parameters' => [
98                'name' => [
99                  'location' => 'path',
100                  'type' => 'string',
101                  'required' => true,
102                ],
103              ],
104            ],'delete' => [
105              'path' => 'v1/{+name}',
106              'httpMethod' => 'DELETE',
107              'parameters' => [
108                'name' => [
109                  'location' => 'path',
110                  'type' => 'string',
111                  'required' => true,
112                ],
113              ],
114            ],'get' => [
115              'path' => 'v1/{+name}',
116              'httpMethod' => 'GET',
117              'parameters' => [
118                'name' => [
119                  'location' => 'path',
120                  'type' => 'string',
121                  'required' => true,
122                ],
123              ],
124            ],'getExecutable' => [
125              'path' => 'v1/{+name}:getExecutable',
126              'httpMethod' => 'GET',
127              'parameters' => [
128                'name' => [
129                  'location' => 'path',
130                  'type' => 'string',
131                  'required' => true,
132                ],
133                'executableVersion' => [
134                  'location' => 'query',
135                  'type' => 'string',
136                ],
137              ],
138            ],'list' => [
139              'path' => 'v1/{+name}/releases',
140              'httpMethod' => 'GET',
141              'parameters' => [
142                'name' => [
143                  'location' => 'path',
144                  'type' => 'string',
145                  'required' => true,
146                ],
147                'filter' => [
148                  'location' => 'query',
149                  'type' => 'string',
150                ],
151                'pageSize' => [
152                  'location' => 'query',
153                  'type' => 'integer',
154                ],
155                'pageToken' => [
156                  'location' => 'query',
157                  'type' => 'string',
158                ],
159              ],
160            ],'patch' => [
161              'path' => 'v1/{+name}',
162              'httpMethod' => 'PATCH',
163              'parameters' => [
164                'name' => [
165                  'location' => 'path',
166                  'type' => 'string',
167                  'required' => true,
168                ],
169              ],
170            ],
171          ]
172        ]
173    );
174    $this->projects_rulesets = new FirebaseRules\Resource\ProjectsRulesets(
175        $this,
176        $this->serviceName,
177        'rulesets',
178        [
179          'methods' => [
180            'create' => [
181              'path' => 'v1/{+name}/rulesets',
182              'httpMethod' => 'POST',
183              'parameters' => [
184                'name' => [
185                  'location' => 'path',
186                  'type' => 'string',
187                  'required' => true,
188                ],
189              ],
190            ],'delete' => [
191              'path' => 'v1/{+name}',
192              'httpMethod' => 'DELETE',
193              'parameters' => [
194                'name' => [
195                  'location' => 'path',
196                  'type' => 'string',
197                  'required' => true,
198                ],
199              ],
200            ],'get' => [
201              'path' => 'v1/{+name}',
202              'httpMethod' => 'GET',
203              'parameters' => [
204                'name' => [
205                  'location' => 'path',
206                  'type' => 'string',
207                  'required' => true,
208                ],
209              ],
210            ],'list' => [
211              'path' => 'v1/{+name}/rulesets',
212              'httpMethod' => 'GET',
213              'parameters' => [
214                'name' => [
215                  'location' => 'path',
216                  'type' => 'string',
217                  'required' => true,
218                ],
219                'filter' => [
220                  'location' => 'query',
221                  'type' => 'string',
222                ],
223                'pageSize' => [
224                  'location' => 'query',
225                  'type' => 'integer',
226                ],
227                'pageToken' => [
228                  'location' => 'query',
229                  'type' => 'string',
230                ],
231              ],
232            ],
233          ]
234        ]
235    );
236  }
237}
238
239// Adding a class alias for backwards compatibility with the previous class name.
240class_alias(FirebaseRules::class, 'Google_Service_FirebaseRules');
241