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