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 BinaryAuthorization (v1).
24 *
25 * <p>
26 * The management interface for Binary Authorization, a service that provides
27 * policy-based deployment validation and control for images deployed to Google
28 * Kubernetes Engine (GKE), Anthos Service Mesh, Anthos Clusters, and Cloud Run.</p>
29 *
30 * <p>
31 * For more information about this service, see the API
32 * <a href="https://cloud.google.com/binary-authorization/" target="_blank">Documentation</a>
33 * </p>
34 *
35 * @author Google, Inc.
36 */
37class BinaryAuthorization 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
43  public $projects;
44  public $projects_attestors;
45  public $projects_policy;
46  public $systempolicy;
47
48  /**
49   * Constructs the internal representation of the BinaryAuthorization 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://binaryauthorization.googleapis.com/';
59    $this->servicePath = '';
60    $this->batchPath = 'batch';
61    $this->version = 'v1';
62    $this->serviceName = 'binaryauthorization';
63
64    $this->projects = new BinaryAuthorization\Resource\Projects(
65        $this,
66        $this->serviceName,
67        'projects',
68        [
69          'methods' => [
70            'getPolicy' => [
71              'path' => 'v1/{+name}',
72              'httpMethod' => 'GET',
73              'parameters' => [
74                'name' => [
75                  'location' => 'path',
76                  'type' => 'string',
77                  'required' => true,
78                ],
79              ],
80            ],'updatePolicy' => [
81              'path' => 'v1/{+name}',
82              'httpMethod' => 'PUT',
83              'parameters' => [
84                'name' => [
85                  'location' => 'path',
86                  'type' => 'string',
87                  'required' => true,
88                ],
89              ],
90            ],
91          ]
92        ]
93    );
94    $this->projects_attestors = new BinaryAuthorization\Resource\ProjectsAttestors(
95        $this,
96        $this->serviceName,
97        'attestors',
98        [
99          'methods' => [
100            'create' => [
101              'path' => 'v1/{+parent}/attestors',
102              'httpMethod' => 'POST',
103              'parameters' => [
104                'parent' => [
105                  'location' => 'path',
106                  'type' => 'string',
107                  'required' => true,
108                ],
109                'attestorId' => [
110                  'location' => 'query',
111                  'type' => 'string',
112                ],
113              ],
114            ],'delete' => [
115              'path' => 'v1/{+name}',
116              'httpMethod' => 'DELETE',
117              'parameters' => [
118                'name' => [
119                  'location' => 'path',
120                  'type' => 'string',
121                  'required' => true,
122                ],
123              ],
124            ],'get' => [
125              'path' => 'v1/{+name}',
126              'httpMethod' => 'GET',
127              'parameters' => [
128                'name' => [
129                  'location' => 'path',
130                  'type' => 'string',
131                  'required' => true,
132                ],
133              ],
134            ],'getIamPolicy' => [
135              'path' => 'v1/{+resource}:getIamPolicy',
136              'httpMethod' => 'GET',
137              'parameters' => [
138                'resource' => [
139                  'location' => 'path',
140                  'type' => 'string',
141                  'required' => true,
142                ],
143                'options.requestedPolicyVersion' => [
144                  'location' => 'query',
145                  'type' => 'integer',
146                ],
147              ],
148            ],'list' => [
149              'path' => 'v1/{+parent}/attestors',
150              'httpMethod' => 'GET',
151              'parameters' => [
152                'parent' => [
153                  'location' => 'path',
154                  'type' => 'string',
155                  'required' => true,
156                ],
157                'pageSize' => [
158                  'location' => 'query',
159                  'type' => 'integer',
160                ],
161                'pageToken' => [
162                  'location' => 'query',
163                  'type' => 'string',
164                ],
165              ],
166            ],'setIamPolicy' => [
167              'path' => 'v1/{+resource}:setIamPolicy',
168              'httpMethod' => 'POST',
169              'parameters' => [
170                'resource' => [
171                  'location' => 'path',
172                  'type' => 'string',
173                  'required' => true,
174                ],
175              ],
176            ],'testIamPermissions' => [
177              'path' => 'v1/{+resource}:testIamPermissions',
178              'httpMethod' => 'POST',
179              'parameters' => [
180                'resource' => [
181                  'location' => 'path',
182                  'type' => 'string',
183                  'required' => true,
184                ],
185              ],
186            ],'update' => [
187              'path' => 'v1/{+name}',
188              'httpMethod' => 'PUT',
189              'parameters' => [
190                'name' => [
191                  'location' => 'path',
192                  'type' => 'string',
193                  'required' => true,
194                ],
195              ],
196            ],'validateAttestationOccurrence' => [
197              'path' => 'v1/{+attestor}:validateAttestationOccurrence',
198              'httpMethod' => 'POST',
199              'parameters' => [
200                'attestor' => [
201                  'location' => 'path',
202                  'type' => 'string',
203                  'required' => true,
204                ],
205              ],
206            ],
207          ]
208        ]
209    );
210    $this->projects_policy = new BinaryAuthorization\Resource\ProjectsPolicy(
211        $this,
212        $this->serviceName,
213        'policy',
214        [
215          'methods' => [
216            'getIamPolicy' => [
217              'path' => 'v1/{+resource}:getIamPolicy',
218              'httpMethod' => 'GET',
219              'parameters' => [
220                'resource' => [
221                  'location' => 'path',
222                  'type' => 'string',
223                  'required' => true,
224                ],
225                'options.requestedPolicyVersion' => [
226                  'location' => 'query',
227                  'type' => 'integer',
228                ],
229              ],
230            ],'setIamPolicy' => [
231              'path' => 'v1/{+resource}:setIamPolicy',
232              'httpMethod' => 'POST',
233              'parameters' => [
234                'resource' => [
235                  'location' => 'path',
236                  'type' => 'string',
237                  'required' => true,
238                ],
239              ],
240            ],'testIamPermissions' => [
241              'path' => 'v1/{+resource}:testIamPermissions',
242              'httpMethod' => 'POST',
243              'parameters' => [
244                'resource' => [
245                  'location' => 'path',
246                  'type' => 'string',
247                  'required' => true,
248                ],
249              ],
250            ],
251          ]
252        ]
253    );
254    $this->systempolicy = new BinaryAuthorization\Resource\Systempolicy(
255        $this,
256        $this->serviceName,
257        'systempolicy',
258        [
259          'methods' => [
260            'getPolicy' => [
261              'path' => 'v1/{+name}',
262              'httpMethod' => 'GET',
263              'parameters' => [
264                'name' => [
265                  'location' => 'path',
266                  'type' => 'string',
267                  'required' => true,
268                ],
269              ],
270            ],
271          ]
272        ]
273    );
274  }
275}
276
277// Adding a class alias for backwards compatibility with the previous class name.
278class_alias(BinaryAuthorization::class, 'Google_Service_BinaryAuthorization');
279