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