source: vendor/google/apiclient-services/src/Apigee/Resource/OrganizationsDevelopersAppsKeys.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 9 days ago

Upload project files

  • Property mode set to 100644
File size: 7.1 KB
Line 
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;
21
22/**
23 * The "keys" collection of methods.
24 * Typical usage is:
25 * <code>
26 * $apigeeService = new Google\Service\Apigee(...);
27 * $keys = $apigeeService->organizations_developers_apps_keys;
28 * </code>
29 */
30class OrganizationsDevelopersAppsKeys extends \Google\Service\Resource
31{
32 /**
33 * Creates a custom consumer key and secret for a developer app. This is
34 * particularly useful if you want to migrate existing consumer keys and secrets
35 * to Apigee from another system. Consumer keys and secrets can contain letters,
36 * numbers, underscores, and hyphens. No other special characters are allowed.
37 * To avoid service disruptions, a consumer key and secret should not exceed 2
38 * KBs each. **Note**: When creating the consumer key and secret, an association
39 * to API products will not be made. Therefore, you should not specify the
40 * associated API products in your request. Instead, use the
41 * UpdateDeveloperAppKey API to make the association after the consumer key and
42 * secret are created. If a consumer key and secret already exist, you can keep
43 * them or delete them using the DeleteDeveloperAppKey API. **Note**: All keys
44 * start out with status=approved, even if status=revoked is passed when the key
45 * is created. To revoke a key, use the UpdateDeveloperAppKey API. (keys.create)
46 *
47 * @param string $parent Parent of the developer app key. Use the following
48 * structure in your request:
49 * 'organizations/{org}/developers/{developerEmail}/apps/{appName}'
50 * @param GoogleCloudApigeeV1DeveloperAppKey $postBody
51 * @param array $optParams Optional parameters.
52 * @return GoogleCloudApigeeV1DeveloperAppKey
53 * @throws \Google\Service\Exception
54 */
55 public function create($parent, GoogleCloudApigeeV1DeveloperAppKey $postBody, $optParams = [])
56 {
57 $params = ['parent' => $parent, 'postBody' => $postBody];
58 $params = array_merge($params, $optParams);
59 return $this->call('create', [$params], GoogleCloudApigeeV1DeveloperAppKey::class);
60 }
61 /**
62 * Deletes an app's consumer key and removes all API products associated with
63 * the app. After the consumer key is deleted, it cannot be used to access any
64 * APIs. **Note**: After you delete a consumer key, you may want to: 1. Create a
65 * new consumer key and secret for the developer app using the
66 * CreateDeveloperAppKey API, and subsequently add an API product to the key
67 * using the UpdateDeveloperAppKey API. 2. Delete the developer app, if it is no
68 * longer required. (keys.delete)
69 *
70 * @param string $name Name of the developer app key. Use the following
71 * structure in your request:
72 * `organizations/{org}/developers/{developer_email}/apps/{app}/keys/{key}`
73 * @param array $optParams Optional parameters.
74 * @return GoogleCloudApigeeV1DeveloperAppKey
75 * @throws \Google\Service\Exception
76 */
77 public function delete($name, $optParams = [])
78 {
79 $params = ['name' => $name];
80 $params = array_merge($params, $optParams);
81 return $this->call('delete', [$params], GoogleCloudApigeeV1DeveloperAppKey::class);
82 }
83 /**
84 * Gets details for a consumer key for a developer app, including the key and
85 * secret value, associated API products, and other information. (keys.get)
86 *
87 * @param string $name Name of the developer app key. Use the following
88 * structure in your request:
89 * `organizations/{org}/developers/{developer_email}/apps/{app}/keys/{key}`
90 * @param array $optParams Optional parameters.
91 * @return GoogleCloudApigeeV1DeveloperAppKey
92 * @throws \Google\Service\Exception
93 */
94 public function get($name, $optParams = [])
95 {
96 $params = ['name' => $name];
97 $params = array_merge($params, $optParams);
98 return $this->call('get', [$params], GoogleCloudApigeeV1DeveloperAppKey::class);
99 }
100 /**
101 * Updates the scope of an app. This API replaces the existing scopes with those
102 * specified in the request. Include or exclude any existing scopes that you
103 * want to retain or delete, respectively. The specified scopes must already be
104 * defined for the API products associated with the app. This API sets the
105 * `scopes` element under the `apiProducts` element in the attributes of the
106 * app. (keys.replaceDeveloperAppKey)
107 *
108 * @param string $name Name of the developer app key. Use the following
109 * structure in your request:
110 * `organizations/{org}/developers/{developer_email}/apps/{app}/keys/{key}`
111 * @param GoogleCloudApigeeV1DeveloperAppKey $postBody
112 * @param array $optParams Optional parameters.
113 * @return GoogleCloudApigeeV1DeveloperAppKey
114 * @throws \Google\Service\Exception
115 */
116 public function replaceDeveloperAppKey($name, GoogleCloudApigeeV1DeveloperAppKey $postBody, $optParams = [])
117 {
118 $params = ['name' => $name, 'postBody' => $postBody];
119 $params = array_merge($params, $optParams);
120 return $this->call('replaceDeveloperAppKey', [$params], GoogleCloudApigeeV1DeveloperAppKey::class);
121 }
122 /**
123 * Adds an API product to a developer app key, enabling the app that holds the
124 * key to access the API resources bundled in the API product. In addition, you
125 * can add attributes to a developer app key. This API replaces the existing
126 * attributes with those specified in the request. Include or exclude any
127 * existing attributes that you want to retain or delete, respectively. You can
128 * use the same key to access all API products associated with the app.
129 * (keys.updateDeveloperAppKey)
130 *
131 * @param string $name Name of the developer app key. Use the following
132 * structure in your request:
133 * `organizations/{org}/developers/{developer_email}/apps/{app}/keys/{key}`
134 * @param GoogleCloudApigeeV1DeveloperAppKey $postBody
135 * @param array $optParams Optional parameters.
136 *
137 * @opt_param string action Approve or revoke the consumer key by setting this
138 * value to `approve` or `revoke`, respectively. The `Content-Type` header must
139 * be set to `application/octet-stream`.
140 * @return GoogleCloudApigeeV1DeveloperAppKey
141 * @throws \Google\Service\Exception
142 */
143 public function updateDeveloperAppKey($name, GoogleCloudApigeeV1DeveloperAppKey $postBody, $optParams = [])
144 {
145 $params = ['name' => $name, 'postBody' => $postBody];
146 $params = array_merge($params, $optParams);
147 return $this->call('updateDeveloperAppKey', [$params], GoogleCloudApigeeV1DeveloperAppKey::class);
148 }
149}
150
151// Adding a class alias for backwards compatibility with the previous class name.
152class_alias(OrganizationsDevelopersAppsKeys::class, 'Google_Service_Apigee_Resource_OrganizationsDevelopersAppsKeys');
Note: See TracBrowser for help on using the repository browser.