CloudSourceRepositories.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  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 CloudSourceRepositories (v1).
  21. *
  22. * <p>
  23. * Accesses source code repositories hosted by Google.</p>
  24. *
  25. * <p>
  26. * For more information about this service, see the API
  27. * <a href="https://cloud.google.com/source-repositories/docs/apis" target="_blank">Documentation</a>
  28. * </p>
  29. *
  30. * @author Google, Inc.
  31. */
  32. class CloudSourceRepositories extends \Google\Service
  33. {
  34. /** See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.. */
  35. const CLOUD_PLATFORM =
  36. "https://www.googleapis.com/auth/cloud-platform";
  37. /** Manage your source code repositories. */
  38. const SOURCE_FULL_CONTROL =
  39. "https://www.googleapis.com/auth/source.full_control";
  40. /** View the contents of your source code repositories. */
  41. const SOURCE_READ_ONLY =
  42. "https://www.googleapis.com/auth/source.read_only";
  43. /** Manage the contents of your source code repositories. */
  44. const SOURCE_READ_WRITE =
  45. "https://www.googleapis.com/auth/source.read_write";
  46. public $projects;
  47. public $projects_repos;
  48. /**
  49. * Constructs the internal representation of the CloudSourceRepositories
  50. * service.
  51. *
  52. * @param Client|array $clientOrConfig The client used to deliver requests, or a
  53. * config array to pass to a new Client instance.
  54. * @param string $rootUrl The root URL used for requests to the service.
  55. */
  56. public function __construct($clientOrConfig = [], $rootUrl = null)
  57. {
  58. parent::__construct($clientOrConfig);
  59. $this->rootUrl = $rootUrl ?: 'https://sourcerepo.googleapis.com/';
  60. $this->servicePath = '';
  61. $this->batchPath = 'batch';
  62. $this->version = 'v1';
  63. $this->serviceName = 'sourcerepo';
  64. $this->projects = new CloudSourceRepositories\Resource\Projects(
  65. $this,
  66. $this->serviceName,
  67. 'projects',
  68. [
  69. 'methods' => [
  70. 'getConfig' => [
  71. 'path' => 'v1/{+name}/config',
  72. 'httpMethod' => 'GET',
  73. 'parameters' => [
  74. 'name' => [
  75. 'location' => 'path',
  76. 'type' => 'string',
  77. 'required' => true,
  78. ],
  79. ],
  80. ],'updateConfig' => [
  81. 'path' => 'v1/{+name}/config',
  82. 'httpMethod' => 'PATCH',
  83. 'parameters' => [
  84. 'name' => [
  85. 'location' => 'path',
  86. 'type' => 'string',
  87. 'required' => true,
  88. ],
  89. ],
  90. ],
  91. ]
  92. ]
  93. );
  94. $this->projects_repos = new CloudSourceRepositories\Resource\ProjectsRepos(
  95. $this,
  96. $this->serviceName,
  97. 'repos',
  98. [
  99. 'methods' => [
  100. 'create' => [
  101. 'path' => 'v1/{+parent}/repos',
  102. 'httpMethod' => 'POST',
  103. 'parameters' => [
  104. 'parent' => [
  105. 'location' => 'path',
  106. 'type' => 'string',
  107. 'required' => true,
  108. ],
  109. ],
  110. ],'delete' => [
  111. 'path' => 'v1/{+name}',
  112. 'httpMethod' => 'DELETE',
  113. 'parameters' => [
  114. 'name' => [
  115. 'location' => 'path',
  116. 'type' => 'string',
  117. 'required' => true,
  118. ],
  119. ],
  120. ],'get' => [
  121. 'path' => 'v1/{+name}',
  122. 'httpMethod' => 'GET',
  123. 'parameters' => [
  124. 'name' => [
  125. 'location' => 'path',
  126. 'type' => 'string',
  127. 'required' => true,
  128. ],
  129. ],
  130. ],'getIamPolicy' => [
  131. 'path' => 'v1/{+resource}:getIamPolicy',
  132. 'httpMethod' => 'GET',
  133. 'parameters' => [
  134. 'resource' => [
  135. 'location' => 'path',
  136. 'type' => 'string',
  137. 'required' => true,
  138. ],
  139. 'options.requestedPolicyVersion' => [
  140. 'location' => 'query',
  141. 'type' => 'integer',
  142. ],
  143. ],
  144. ],'list' => [
  145. 'path' => 'v1/{+name}/repos',
  146. 'httpMethod' => 'GET',
  147. 'parameters' => [
  148. 'name' => [
  149. 'location' => 'path',
  150. 'type' => 'string',
  151. 'required' => true,
  152. ],
  153. 'pageSize' => [
  154. 'location' => 'query',
  155. 'type' => 'integer',
  156. ],
  157. 'pageToken' => [
  158. 'location' => 'query',
  159. 'type' => 'string',
  160. ],
  161. ],
  162. ],'patch' => [
  163. 'path' => 'v1/{+name}',
  164. 'httpMethod' => 'PATCH',
  165. 'parameters' => [
  166. 'name' => [
  167. 'location' => 'path',
  168. 'type' => 'string',
  169. 'required' => true,
  170. ],
  171. ],
  172. ],'setIamPolicy' => [
  173. 'path' => 'v1/{+resource}:setIamPolicy',
  174. 'httpMethod' => 'POST',
  175. 'parameters' => [
  176. 'resource' => [
  177. 'location' => 'path',
  178. 'type' => 'string',
  179. 'required' => true,
  180. ],
  181. ],
  182. ],'sync' => [
  183. 'path' => 'v1/{+name}:sync',
  184. 'httpMethod' => 'POST',
  185. 'parameters' => [
  186. 'name' => [
  187. 'location' => 'path',
  188. 'type' => 'string',
  189. 'required' => true,
  190. ],
  191. ],
  192. ],'testIamPermissions' => [
  193. 'path' => 'v1/{+resource}:testIamPermissions',
  194. 'httpMethod' => 'POST',
  195. 'parameters' => [
  196. 'resource' => [
  197. 'location' => 'path',
  198. 'type' => 'string',
  199. 'required' => true,
  200. ],
  201. ],
  202. ],
  203. ]
  204. ]
  205. );
  206. }
  207. }
  208. // Adding a class alias for backwards compatibility with the previous class name.
  209. class_alias(CloudSourceRepositories::class, 'Google_Service_CloudSourceRepositories');