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\GoogleCloudApigeeV1DeveloperAppKey; 21use Google\Service\Apigee\GoogleProtobufEmpty; 22 23/** 24 * The "apiproducts" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $apigeeService = new Google\Service\Apigee(...); 28 * $apiproducts = $apigeeService->apiproducts; 29 * </code> 30 */ 31class OrganizationsDevelopersAppsKeysApiproducts extends \Google\Service\Resource 32{ 33 /** 34 * Removes an API product from an app's consumer key. After the API product is 35 * removed, the app cannot access the API resources defined in that API product. 36 * **Note**: The consumer key is not removed, only its association with the API 37 * product. (apiproducts.delete) 38 * 39 * @param string $name Name of the API product in the developer app key in the 40 * following format: `organizations/{org}/developers/{developer_email}/apps/{app 41 * }/keys/{key}/apiproducts/{apiproduct}` 42 * @param array $optParams Optional parameters. 43 * @return GoogleCloudApigeeV1DeveloperAppKey 44 */ 45 public function delete($name, $optParams = []) 46 { 47 $params = ['name' => $name]; 48 $params = array_merge($params, $optParams); 49 return $this->call('delete', [$params], GoogleCloudApigeeV1DeveloperAppKey::class); 50 } 51 /** 52 * Approves or revokes the consumer key for an API product. After a consumer key 53 * is approved, the app can use it to access APIs. A consumer key that is 54 * revoked or pending cannot be used to access an API. Any access tokens 55 * associated with a revoked consumer key will remain active. However, Apigee 56 * checks the status of the consumer key and if set to `revoked` will not allow 57 * access to the API. (apiproducts.updateDeveloperAppKeyApiProduct) 58 * 59 * @param string $name Name of the API product in the developer app key in the 60 * following format: `organizations/{org}/developers/{developer_email}/apps/{app 61 * }/keys/{key}/apiproducts/{apiproduct}` 62 * @param array $optParams Optional parameters. 63 * 64 * @opt_param string action Approve or revoke the consumer key by setting this 65 * value to `approve` or `revoke`, respectively. 66 * @return GoogleProtobufEmpty 67 */ 68 public function updateDeveloperAppKeyApiProduct($name, $optParams = []) 69 { 70 $params = ['name' => $name]; 71 $params = array_merge($params, $optParams); 72 return $this->call('updateDeveloperAppKeyApiProduct', [$params], GoogleProtobufEmpty::class); 73 } 74} 75 76// Adding a class alias for backwards compatibility with the previous class name. 77class_alias(OrganizationsDevelopersAppsKeysApiproducts::class, 'Google_Service_Apigee_Resource_OrganizationsDevelopersAppsKeysApiproducts'); 78