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\GoogleCloudApigeeV1DeveloperSubscription; 21use Google\Service\Apigee\GoogleCloudApigeeV1ExpireDeveloperSubscriptionRequest; 22use Google\Service\Apigee\GoogleCloudApigeeV1ListDeveloperSubscriptionsResponse; 23 24/** 25 * The "subscriptions" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $apigeeService = new Google\Service\Apigee(...); 29 * $subscriptions = $apigeeService->subscriptions; 30 * </code> 31 */ 32class OrganizationsDevelopersSubscriptions extends \Google\Service\Resource 33{ 34 /** 35 * Creates a subscription to an API product. (subscriptions.create) 36 * 37 * @param string $parent Required. Email address of the developer that is 38 * purchasing a subscription to the API product. Use the following structure in 39 * your request: `organizations/{org}/developers/{developer_email}` 40 * @param GoogleCloudApigeeV1DeveloperSubscription $postBody 41 * @param array $optParams Optional parameters. 42 * @return GoogleCloudApigeeV1DeveloperSubscription 43 */ 44 public function create($parent, GoogleCloudApigeeV1DeveloperSubscription $postBody, $optParams = []) 45 { 46 $params = ['parent' => $parent, 'postBody' => $postBody]; 47 $params = array_merge($params, $optParams); 48 return $this->call('create', [$params], GoogleCloudApigeeV1DeveloperSubscription::class); 49 } 50 /** 51 * Expires an API product subscription immediately. (subscriptions.expire) 52 * 53 * @param string $name Required. Name of the API product subscription. Use the 54 * following structure in your request: `organizations/{org}/developers/{develop 55 * er_email}/subscriptions/{subscription}` 56 * @param GoogleCloudApigeeV1ExpireDeveloperSubscriptionRequest $postBody 57 * @param array $optParams Optional parameters. 58 * @return GoogleCloudApigeeV1DeveloperSubscription 59 */ 60 public function expire($name, GoogleCloudApigeeV1ExpireDeveloperSubscriptionRequest $postBody, $optParams = []) 61 { 62 $params = ['name' => $name, 'postBody' => $postBody]; 63 $params = array_merge($params, $optParams); 64 return $this->call('expire', [$params], GoogleCloudApigeeV1DeveloperSubscription::class); 65 } 66 /** 67 * Gets details for an API product subscription. (subscriptions.get) 68 * 69 * @param string $name Required. Name of the API product subscription. Use the 70 * following structure in your request: `organizations/{org}/developers/{develop 71 * er_email}/subscriptions/{subscription}` 72 * @param array $optParams Optional parameters. 73 * @return GoogleCloudApigeeV1DeveloperSubscription 74 */ 75 public function get($name, $optParams = []) 76 { 77 $params = ['name' => $name]; 78 $params = array_merge($params, $optParams); 79 return $this->call('get', [$params], GoogleCloudApigeeV1DeveloperSubscription::class); 80 } 81 /** 82 * Lists all API product subscriptions for a developer. 83 * (subscriptions.listOrganizationsDevelopersSubscriptions) 84 * 85 * @param string $parent Required. Email address of the developer. Use the 86 * following structure in your request: 87 * `organizations/{org}/developers/{developer_email}` 88 * @param array $optParams Optional parameters. 89 * 90 * @opt_param int count Number of API product subscriptions to return in the API 91 * call. Use with `startKey` to provide more targeted filtering. Defaults to 92 * 100. The maximum limit is 1000. 93 * @opt_param string startKey Name of the API product subscription from which to 94 * start displaying the list of subscriptions. If omitted, the list starts from 95 * the first item. For example, to view the API product subscriptions from 96 * 51-150, set the value of `startKey` to the name of the 51st subscription and 97 * set the value of `count` to 100. 98 * @return GoogleCloudApigeeV1ListDeveloperSubscriptionsResponse 99 */ 100 public function listOrganizationsDevelopersSubscriptions($parent, $optParams = []) 101 { 102 $params = ['parent' => $parent]; 103 $params = array_merge($params, $optParams); 104 return $this->call('list', [$params], GoogleCloudApigeeV1ListDeveloperSubscriptionsResponse::class); 105 } 106} 107 108// Adding a class alias for backwards compatibility with the previous class name. 109class_alias(OrganizationsDevelopersSubscriptions::class, 'Google_Service_Apigee_Resource_OrganizationsDevelopersSubscriptions'); 110