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 CloudFunctions (v1). 24 * 25 * <p> 26 * Manages lightweight user-provided functions executed in response to events.</p> 27 * 28 * <p> 29 * For more information about this service, see the API 30 * <a href="https://cloud.google.com/functions" target="_blank">Documentation</a> 31 * </p> 32 * 33 * @author Google, Inc. 34 */ 35class CloudFunctions 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 41 public $operations; 42 public $projects_locations; 43 public $projects_locations_functions; 44 45 /** 46 * Constructs the internal representation of the CloudFunctions service. 47 * 48 * @param Client|array $clientOrConfig The client used to deliver requests, or a 49 * config array to pass to a new Client instance. 50 * @param string $rootUrl The root URL used for requests to the service. 51 */ 52 public function __construct($clientOrConfig = [], $rootUrl = null) 53 { 54 parent::__construct($clientOrConfig); 55 $this->rootUrl = $rootUrl ?: 'https://cloudfunctions.googleapis.com/'; 56 $this->servicePath = ''; 57 $this->batchPath = 'batch'; 58 $this->version = 'v1'; 59 $this->serviceName = 'cloudfunctions'; 60 61 $this->operations = new CloudFunctions\Resource\Operations( 62 $this, 63 $this->serviceName, 64 'operations', 65 [ 66 'methods' => [ 67 'get' => [ 68 'path' => 'v1/{+name}', 69 'httpMethod' => 'GET', 70 'parameters' => [ 71 'name' => [ 72 'location' => 'path', 73 'type' => 'string', 74 'required' => true, 75 ], 76 ], 77 ],'list' => [ 78 'path' => 'v1/operations', 79 'httpMethod' => 'GET', 80 'parameters' => [ 81 'filter' => [ 82 'location' => 'query', 83 'type' => 'string', 84 ], 85 'name' => [ 86 'location' => 'query', 87 'type' => 'string', 88 ], 89 'pageSize' => [ 90 'location' => 'query', 91 'type' => 'integer', 92 ], 93 'pageToken' => [ 94 'location' => 'query', 95 'type' => 'string', 96 ], 97 ], 98 ], 99 ] 100 ] 101 ); 102 $this->projects_locations = new CloudFunctions\Resource\ProjectsLocations( 103 $this, 104 $this->serviceName, 105 'locations', 106 [ 107 'methods' => [ 108 'list' => [ 109 'path' => 'v1/{+name}/locations', 110 'httpMethod' => 'GET', 111 'parameters' => [ 112 'name' => [ 113 'location' => 'path', 114 'type' => 'string', 115 'required' => true, 116 ], 117 'filter' => [ 118 'location' => 'query', 119 'type' => 'string', 120 ], 121 'pageSize' => [ 122 'location' => 'query', 123 'type' => 'integer', 124 ], 125 'pageToken' => [ 126 'location' => 'query', 127 'type' => 'string', 128 ], 129 ], 130 ], 131 ] 132 ] 133 ); 134 $this->projects_locations_functions = new CloudFunctions\Resource\ProjectsLocationsFunctions( 135 $this, 136 $this->serviceName, 137 'functions', 138 [ 139 'methods' => [ 140 'call' => [ 141 'path' => 'v1/{+name}:call', 142 'httpMethod' => 'POST', 143 'parameters' => [ 144 'name' => [ 145 'location' => 'path', 146 'type' => 'string', 147 'required' => true, 148 ], 149 ], 150 ],'create' => [ 151 'path' => 'v1/{+location}/functions', 152 'httpMethod' => 'POST', 153 'parameters' => [ 154 'location' => [ 155 'location' => 'path', 156 'type' => 'string', 157 'required' => true, 158 ], 159 ], 160 ],'delete' => [ 161 'path' => 'v1/{+name}', 162 'httpMethod' => 'DELETE', 163 'parameters' => [ 164 'name' => [ 165 'location' => 'path', 166 'type' => 'string', 167 'required' => true, 168 ], 169 ], 170 ],'generateDownloadUrl' => [ 171 'path' => 'v1/{+name}:generateDownloadUrl', 172 'httpMethod' => 'POST', 173 'parameters' => [ 174 'name' => [ 175 'location' => 'path', 176 'type' => 'string', 177 'required' => true, 178 ], 179 ], 180 ],'generateUploadUrl' => [ 181 'path' => 'v1/{+parent}/functions:generateUploadUrl', 182 'httpMethod' => 'POST', 183 'parameters' => [ 184 'parent' => [ 185 'location' => 'path', 186 'type' => 'string', 187 'required' => true, 188 ], 189 ], 190 ],'get' => [ 191 'path' => 'v1/{+name}', 192 'httpMethod' => 'GET', 193 'parameters' => [ 194 'name' => [ 195 'location' => 'path', 196 'type' => 'string', 197 'required' => true, 198 ], 199 ], 200 ],'getIamPolicy' => [ 201 'path' => 'v1/{+resource}:getIamPolicy', 202 'httpMethod' => 'GET', 203 'parameters' => [ 204 'resource' => [ 205 'location' => 'path', 206 'type' => 'string', 207 'required' => true, 208 ], 209 'options.requestedPolicyVersion' => [ 210 'location' => 'query', 211 'type' => 'integer', 212 ], 213 ], 214 ],'list' => [ 215 'path' => 'v1/{+parent}/functions', 216 'httpMethod' => 'GET', 217 'parameters' => [ 218 'parent' => [ 219 'location' => 'path', 220 'type' => 'string', 221 'required' => true, 222 ], 223 'pageSize' => [ 224 'location' => 'query', 225 'type' => 'integer', 226 ], 227 'pageToken' => [ 228 'location' => 'query', 229 'type' => 'string', 230 ], 231 ], 232 ],'patch' => [ 233 'path' => 'v1/{+name}', 234 'httpMethod' => 'PATCH', 235 'parameters' => [ 236 'name' => [ 237 'location' => 'path', 238 'type' => 'string', 239 'required' => true, 240 ], 241 'updateMask' => [ 242 'location' => 'query', 243 'type' => 'string', 244 ], 245 ], 246 ],'setIamPolicy' => [ 247 'path' => 'v1/{+resource}:setIamPolicy', 248 'httpMethod' => 'POST', 249 'parameters' => [ 250 'resource' => [ 251 'location' => 'path', 252 'type' => 'string', 253 'required' => true, 254 ], 255 ], 256 ],'testIamPermissions' => [ 257 'path' => 'v1/{+resource}:testIamPermissions', 258 'httpMethod' => 'POST', 259 'parameters' => [ 260 'resource' => [ 261 'location' => 'path', 262 'type' => 'string', 263 'required' => true, 264 ], 265 ], 266 ], 267 ] 268 ] 269 ); 270 } 271} 272 273// Adding a class alias for backwards compatibility with the previous class name. 274class_alias(CloudFunctions::class, 'Google_Service_CloudFunctions'); 275