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