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