FirebaseRules.php 7.4 KB

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