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 | namespace Google\Service\Apigee\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Apigee\GoogleApiHttpBody;
|
---|
21 | use Google\Service\Apigee\GoogleCloudApigeeV1ApiProxyRevision;
|
---|
22 |
|
---|
23 | /**
|
---|
24 | * The "revisions" collection of methods.
|
---|
25 | * Typical usage is:
|
---|
26 | * <code>
|
---|
27 | * $apigeeService = new Google\Service\Apigee(...);
|
---|
28 | * $revisions = $apigeeService->organizations_apis_revisions;
|
---|
29 | * </code>
|
---|
30 | */
|
---|
31 | class OrganizationsApisRevisions extends \Google\Service\Resource
|
---|
32 | {
|
---|
33 | /**
|
---|
34 | * Deletes an API proxy revision and all policies, resources, endpoints, and
|
---|
35 | * revisions associated with it. The API proxy revision must be undeployed
|
---|
36 | * before you can delete it. (revisions.delete)
|
---|
37 | *
|
---|
38 | * @param string $name Required. API proxy revision in the following format:
|
---|
39 | * `organizations/{org}/apis/{api}/revisions/{rev}`
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | * @return GoogleCloudApigeeV1ApiProxyRevision
|
---|
42 | * @throws \Google\Service\Exception
|
---|
43 | */
|
---|
44 | public function delete($name, $optParams = [])
|
---|
45 | {
|
---|
46 | $params = ['name' => $name];
|
---|
47 | $params = array_merge($params, $optParams);
|
---|
48 | return $this->call('delete', [$params], GoogleCloudApigeeV1ApiProxyRevision::class);
|
---|
49 | }
|
---|
50 | /**
|
---|
51 | * Gets an API proxy revision. To download the API proxy configuration bundle
|
---|
52 | * for the specified revision as a zip file, set the `format` query parameter to
|
---|
53 | * `bundle`. If you are using curl, specify `-o filename.zip` to save the output
|
---|
54 | * to a file; otherwise, it displays to `stdout`. Then, develop the API proxy
|
---|
55 | * configuration locally and upload the updated API proxy configuration
|
---|
56 | * revision, as described in [updateApiProxyRevision](updateApiProxyRevision).
|
---|
57 | * (revisions.get)
|
---|
58 | *
|
---|
59 | * @param string $name Required. API proxy revision in the following format:
|
---|
60 | * `organizations/{org}/apis/{api}/revisions/{rev}`
|
---|
61 | * @param array $optParams Optional parameters.
|
---|
62 | *
|
---|
63 | * @opt_param string format Format used when downloading the API proxy
|
---|
64 | * configuration revision. Set to `bundle` to download the API proxy
|
---|
65 | * configuration revision as a zip file.
|
---|
66 | * @return GoogleApiHttpBody
|
---|
67 | * @throws \Google\Service\Exception
|
---|
68 | */
|
---|
69 | public function get($name, $optParams = [])
|
---|
70 | {
|
---|
71 | $params = ['name' => $name];
|
---|
72 | $params = array_merge($params, $optParams);
|
---|
73 | return $this->call('get', [$params], GoogleApiHttpBody::class);
|
---|
74 | }
|
---|
75 | /**
|
---|
76 | * Updates an existing API proxy revision by uploading the API proxy
|
---|
77 | * configuration bundle as a zip file from your local machine. You can update
|
---|
78 | * only API proxy revisions that have never been deployed. After deployment, an
|
---|
79 | * API proxy revision becomes immutable, even if it is undeployed. Set the
|
---|
80 | * `Content-Type` header to either `multipart/form-data` or `application/octet-
|
---|
81 | * stream`. (revisions.updateApiProxyRevision)
|
---|
82 | *
|
---|
83 | * @param string $name Required. API proxy revision to update in the following
|
---|
84 | * format: `organizations/{org}/apis/{api}/revisions/{rev}`
|
---|
85 | * @param GoogleApiHttpBody $postBody
|
---|
86 | * @param array $optParams Optional parameters.
|
---|
87 | *
|
---|
88 | * @opt_param bool validate Ignored. All uploads are validated regardless of the
|
---|
89 | * value of this field. Maintained for compatibility with Apigee Edge API.
|
---|
90 | * @return GoogleCloudApigeeV1ApiProxyRevision
|
---|
91 | * @throws \Google\Service\Exception
|
---|
92 | */
|
---|
93 | public function updateApiProxyRevision($name, GoogleApiHttpBody $postBody, $optParams = [])
|
---|
94 | {
|
---|
95 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
96 | $params = array_merge($params, $optParams);
|
---|
97 | return $this->call('updateApiProxyRevision', [$params], GoogleCloudApigeeV1ApiProxyRevision::class);
|
---|
98 | }
|
---|
99 | }
|
---|
100 |
|
---|
101 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
102 | class_alias(OrganizationsApisRevisions::class, 'Google_Service_Apigee_Resource_OrganizationsApisRevisions');
|
---|