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 ApiKeysService (v2). 24 * 25 * <p> 26 * Manages the API keys associated with developer projects.</p> 27 * 28 * <p> 29 * For more information about this service, see the API 30 * <a href="https://cloud.google.com/api-keys/docs" target="_blank">Documentation</a> 31 * </p> 32 * 33 * @author Google, Inc. 34 */ 35class ApiKeysService 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 /** View your data across Google Cloud services and see the email address of your Google Account. */ 41 const CLOUD_PLATFORM_READ_ONLY = 42 "https://www.googleapis.com/auth/cloud-platform.read-only"; 43 44 public $keys; 45 public $operations; 46 public $projects_locations_keys; 47 48 /** 49 * Constructs the internal representation of the ApiKeysService 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://apikeys.googleapis.com/'; 59 $this->servicePath = ''; 60 $this->batchPath = 'batch'; 61 $this->version = 'v2'; 62 $this->serviceName = 'apikeys'; 63 64 $this->keys = new ApiKeysService\Resource\Keys( 65 $this, 66 $this->serviceName, 67 'keys', 68 [ 69 'methods' => [ 70 'lookupKey' => [ 71 'path' => 'v2/keys:lookupKey', 72 'httpMethod' => 'GET', 73 'parameters' => [ 74 'keyString' => [ 75 'location' => 'query', 76 'type' => 'string', 77 ], 78 ], 79 ], 80 ] 81 ] 82 ); 83 $this->operations = new ApiKeysService\Resource\Operations( 84 $this, 85 $this->serviceName, 86 'operations', 87 [ 88 'methods' => [ 89 'get' => [ 90 'path' => 'v2/{+name}', 91 'httpMethod' => 'GET', 92 'parameters' => [ 93 'name' => [ 94 'location' => 'path', 95 'type' => 'string', 96 'required' => true, 97 ], 98 ], 99 ], 100 ] 101 ] 102 ); 103 $this->projects_locations_keys = new ApiKeysService\Resource\ProjectsLocationsKeys( 104 $this, 105 $this->serviceName, 106 'keys', 107 [ 108 'methods' => [ 109 'create' => [ 110 'path' => 'v2/{+parent}/keys', 111 'httpMethod' => 'POST', 112 'parameters' => [ 113 'parent' => [ 114 'location' => 'path', 115 'type' => 'string', 116 'required' => true, 117 ], 118 'keyId' => [ 119 'location' => 'query', 120 'type' => 'string', 121 ], 122 ], 123 ],'delete' => [ 124 'path' => 'v2/{+name}', 125 'httpMethod' => 'DELETE', 126 'parameters' => [ 127 'name' => [ 128 'location' => 'path', 129 'type' => 'string', 130 'required' => true, 131 ], 132 'etag' => [ 133 'location' => 'query', 134 'type' => 'string', 135 ], 136 ], 137 ],'get' => [ 138 'path' => 'v2/{+name}', 139 'httpMethod' => 'GET', 140 'parameters' => [ 141 'name' => [ 142 'location' => 'path', 143 'type' => 'string', 144 'required' => true, 145 ], 146 ], 147 ],'getKeyString' => [ 148 'path' => 'v2/{+name}/keyString', 149 'httpMethod' => 'GET', 150 'parameters' => [ 151 'name' => [ 152 'location' => 'path', 153 'type' => 'string', 154 'required' => true, 155 ], 156 ], 157 ],'list' => [ 158 'path' => 'v2/{+parent}/keys', 159 'httpMethod' => 'GET', 160 'parameters' => [ 161 'parent' => [ 162 'location' => 'path', 163 'type' => 'string', 164 'required' => true, 165 ], 166 'pageSize' => [ 167 'location' => 'query', 168 'type' => 'integer', 169 ], 170 'pageToken' => [ 171 'location' => 'query', 172 'type' => 'string', 173 ], 174 'showDeleted' => [ 175 'location' => 'query', 176 'type' => 'boolean', 177 ], 178 ], 179 ],'patch' => [ 180 'path' => 'v2/{+name}', 181 'httpMethod' => 'PATCH', 182 'parameters' => [ 183 'name' => [ 184 'location' => 'path', 185 'type' => 'string', 186 'required' => true, 187 ], 188 'updateMask' => [ 189 'location' => 'query', 190 'type' => 'string', 191 ], 192 ], 193 ],'undelete' => [ 194 'path' => 'v2/{+name}:undelete', 195 'httpMethod' => 'POST', 196 'parameters' => [ 197 'name' => [ 198 'location' => 'path', 199 'type' => 'string', 200 'required' => true, 201 ], 202 ], 203 ], 204 ] 205 ] 206 ); 207 } 208} 209 210// Adding a class alias for backwards compatibility with the previous class name. 211class_alias(ApiKeysService::class, 'Google_Service_ApiKeysService'); 212