[e3d4e0a] | 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\GoogleCloudApigeeV1Attributes;
|
---|
| 21 | use Google\Service\Apigee\GoogleCloudApigeeV1Developer;
|
---|
| 22 | use Google\Service\Apigee\GoogleCloudApigeeV1DeveloperBalance;
|
---|
| 23 | use Google\Service\Apigee\GoogleCloudApigeeV1DeveloperMonetizationConfig;
|
---|
| 24 | use Google\Service\Apigee\GoogleCloudApigeeV1ListOfDevelopersResponse;
|
---|
| 25 | use Google\Service\Apigee\GoogleProtobufEmpty;
|
---|
| 26 |
|
---|
| 27 | /**
|
---|
| 28 | * The "developers" collection of methods.
|
---|
| 29 | * Typical usage is:
|
---|
| 30 | * <code>
|
---|
| 31 | * $apigeeService = new Google\Service\Apigee(...);
|
---|
| 32 | * $developers = $apigeeService->organizations_developers;
|
---|
| 33 | * </code>
|
---|
| 34 | */
|
---|
| 35 | class OrganizationsDevelopers extends \Google\Service\Resource
|
---|
| 36 | {
|
---|
| 37 | /**
|
---|
| 38 | * Updates developer attributes. This API replaces the existing attributes with
|
---|
| 39 | * those specified in the request. Add new attributes, and include or exclude
|
---|
| 40 | * any existing attributes that you want to retain or remove, respectively. The
|
---|
| 41 | * custom attribute limit is 18. **Note**: OAuth access tokens and Key
|
---|
| 42 | * Management Service (KMS) entities (apps, developers, and API products) are
|
---|
| 43 | * cached for 180 seconds (default). Any custom attributes associated with these
|
---|
| 44 | * entities are cached for at least 180 seconds after the entity is accessed at
|
---|
| 45 | * runtime. Therefore, an `ExpiresIn` element on the OAuthV2 policy won't be
|
---|
| 46 | * able to expire an access token in less than 180 seconds.
|
---|
| 47 | * (developers.attributes)
|
---|
| 48 | *
|
---|
| 49 | * @param string $parent Required. Email address of the developer for which
|
---|
| 50 | * attributes are being updated. Use the following structure in your request:
|
---|
| 51 | * `organizations/{org}/developers/{developer_email}`
|
---|
| 52 | * @param GoogleCloudApigeeV1Attributes $postBody
|
---|
| 53 | * @param array $optParams Optional parameters.
|
---|
| 54 | * @return GoogleCloudApigeeV1Attributes
|
---|
| 55 | * @throws \Google\Service\Exception
|
---|
| 56 | */
|
---|
| 57 | public function attributes($parent, GoogleCloudApigeeV1Attributes $postBody, $optParams = [])
|
---|
| 58 | {
|
---|
| 59 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 60 | $params = array_merge($params, $optParams);
|
---|
| 61 | return $this->call('attributes', [$params], GoogleCloudApigeeV1Attributes::class);
|
---|
| 62 | }
|
---|
| 63 | /**
|
---|
| 64 | * Creates a developer. Once created, the developer can register an app and
|
---|
| 65 | * obtain an API key. At creation time, a developer is set as `active`. To
|
---|
| 66 | * change the developer status, use the SetDeveloperStatus API.
|
---|
| 67 | * (developers.create)
|
---|
| 68 | *
|
---|
| 69 | * @param string $parent Required. Name of the Apigee organization in which the
|
---|
| 70 | * developer is created. Use the following structure in your request:
|
---|
| 71 | * `organizations/{org}`.
|
---|
| 72 | * @param GoogleCloudApigeeV1Developer $postBody
|
---|
| 73 | * @param array $optParams Optional parameters.
|
---|
| 74 | * @return GoogleCloudApigeeV1Developer
|
---|
| 75 | * @throws \Google\Service\Exception
|
---|
| 76 | */
|
---|
| 77 | public function create($parent, GoogleCloudApigeeV1Developer $postBody, $optParams = [])
|
---|
| 78 | {
|
---|
| 79 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 80 | $params = array_merge($params, $optParams);
|
---|
| 81 | return $this->call('create', [$params], GoogleCloudApigeeV1Developer::class);
|
---|
| 82 | }
|
---|
| 83 | /**
|
---|
| 84 | * Deletes a developer. All apps and API keys associated with the developer are
|
---|
| 85 | * also removed. **Warning**: This API will permanently delete the developer and
|
---|
| 86 | * related artifacts. To avoid permanently deleting developers and their
|
---|
| 87 | * artifacts, set the developer status to `inactive` using the
|
---|
| 88 | * SetDeveloperStatus API. **Note**: The delete operation is asynchronous. The
|
---|
| 89 | * developer app is deleted immediately, but its associated resources, such as
|
---|
| 90 | * apps and API keys, may take anywhere from a few seconds to a few minutes to
|
---|
| 91 | * be deleted. (developers.delete)
|
---|
| 92 | *
|
---|
| 93 | * @param string $name Required. Email address of the developer. Use the
|
---|
| 94 | * following structure in your request:
|
---|
| 95 | * `organizations/{org}/developers/{developer_email}`
|
---|
| 96 | * @param array $optParams Optional parameters.
|
---|
| 97 | * @return GoogleCloudApigeeV1Developer
|
---|
| 98 | * @throws \Google\Service\Exception
|
---|
| 99 | */
|
---|
| 100 | public function delete($name, $optParams = [])
|
---|
| 101 | {
|
---|
| 102 | $params = ['name' => $name];
|
---|
| 103 | $params = array_merge($params, $optParams);
|
---|
| 104 | return $this->call('delete', [$params], GoogleCloudApigeeV1Developer::class);
|
---|
| 105 | }
|
---|
| 106 | /**
|
---|
| 107 | * Returns the developer details, including the developer's name, email address,
|
---|
| 108 | * apps, and other information. **Note**: The response includes only the first
|
---|
| 109 | * 100 developer apps. (developers.get)
|
---|
| 110 | *
|
---|
| 111 | * @param string $name Required. Email address of the developer. Use the
|
---|
| 112 | * following structure in your request:
|
---|
| 113 | * `organizations/{org}/developers/{developer_email}`
|
---|
| 114 | * @param array $optParams Optional parameters.
|
---|
| 115 | *
|
---|
| 116 | * @opt_param string action Status of the developer. Valid values are `active`
|
---|
| 117 | * or `inactive`.
|
---|
| 118 | * @return GoogleCloudApigeeV1Developer
|
---|
| 119 | * @throws \Google\Service\Exception
|
---|
| 120 | */
|
---|
| 121 | public function get($name, $optParams = [])
|
---|
| 122 | {
|
---|
| 123 | $params = ['name' => $name];
|
---|
| 124 | $params = array_merge($params, $optParams);
|
---|
| 125 | return $this->call('get', [$params], GoogleCloudApigeeV1Developer::class);
|
---|
| 126 | }
|
---|
| 127 | /**
|
---|
| 128 | * Gets the account balance for the developer. (developers.getBalance)
|
---|
| 129 | *
|
---|
| 130 | * @param string $name Required. Account balance for the developer. Use the
|
---|
| 131 | * following structure in your request:
|
---|
| 132 | * `organizations/{org}/developers/{developer}/balance`
|
---|
| 133 | * @param array $optParams Optional parameters.
|
---|
| 134 | * @return GoogleCloudApigeeV1DeveloperBalance
|
---|
| 135 | * @throws \Google\Service\Exception
|
---|
| 136 | */
|
---|
| 137 | public function getBalance($name, $optParams = [])
|
---|
| 138 | {
|
---|
| 139 | $params = ['name' => $name];
|
---|
| 140 | $params = array_merge($params, $optParams);
|
---|
| 141 | return $this->call('getBalance', [$params], GoogleCloudApigeeV1DeveloperBalance::class);
|
---|
| 142 | }
|
---|
| 143 | /**
|
---|
| 144 | * Gets the monetization configuration for the developer.
|
---|
| 145 | * (developers.getMonetizationConfig)
|
---|
| 146 | *
|
---|
| 147 | * @param string $name Required. Monetization configuration for the developer.
|
---|
| 148 | * Use the following structure in your request:
|
---|
| 149 | * `organizations/{org}/developers/{developer}/monetizationConfig`
|
---|
| 150 | * @param array $optParams Optional parameters.
|
---|
| 151 | * @return GoogleCloudApigeeV1DeveloperMonetizationConfig
|
---|
| 152 | * @throws \Google\Service\Exception
|
---|
| 153 | */
|
---|
| 154 | public function getMonetizationConfig($name, $optParams = [])
|
---|
| 155 | {
|
---|
| 156 | $params = ['name' => $name];
|
---|
| 157 | $params = array_merge($params, $optParams);
|
---|
| 158 | return $this->call('getMonetizationConfig', [$params], GoogleCloudApigeeV1DeveloperMonetizationConfig::class);
|
---|
| 159 | }
|
---|
| 160 | /**
|
---|
| 161 | * Lists all developers in an organization by email address. By default, the
|
---|
| 162 | * response does not include company developers. Set the `includeCompany` query
|
---|
| 163 | * parameter to `true` to include company developers. **Note**: A maximum of
|
---|
| 164 | * 1000 developers are returned in the response. You paginate the list of
|
---|
| 165 | * developers returned using the `startKey` and `count` query parameters.
|
---|
| 166 | * (developers.listOrganizationsDevelopers)
|
---|
| 167 | *
|
---|
| 168 | * @param string $parent Required. Name of the Apigee organization. Use the
|
---|
| 169 | * following structure in your request: `organizations/{org}`.
|
---|
| 170 | * @param array $optParams Optional parameters.
|
---|
| 171 | *
|
---|
| 172 | * @opt_param string app Optional. List only Developers that are associated with
|
---|
| 173 | * the app. Note that start_key, count are not applicable for this filter
|
---|
| 174 | * criteria.
|
---|
| 175 | * @opt_param string count Optional. Number of developers to return in the API
|
---|
| 176 | * call. Use with the `startKey` parameter to provide more targeted filtering.
|
---|
| 177 | * The limit is 1000.
|
---|
| 178 | * @opt_param bool expand Specifies whether to expand the results. Set to `true`
|
---|
| 179 | * to expand the results. This query parameter is not valid if you use the
|
---|
| 180 | * `count` or `startKey` query parameters.
|
---|
| 181 | * @opt_param string ids Optional. List of IDs to include, separated by commas.
|
---|
| 182 | * @opt_param bool includeCompany Flag that specifies whether to include company
|
---|
| 183 | * details in the response.
|
---|
| 184 | * @opt_param string startKey **Note**: Must be used in conjunction with the
|
---|
| 185 | * `count` parameter. Email address of the developer from which to start
|
---|
| 186 | * displaying the list of developers. For example, if the an unfiltered list
|
---|
| 187 | * returns: ``` westley@example.com fezzik@example.com buttercup@example.com ```
|
---|
| 188 | * and your `startKey` is `fezzik@example.com`, the list returned will be ```
|
---|
| 189 | * fezzik@example.com buttercup@example.com ```
|
---|
| 190 | * @return GoogleCloudApigeeV1ListOfDevelopersResponse
|
---|
| 191 | * @throws \Google\Service\Exception
|
---|
| 192 | */
|
---|
| 193 | public function listOrganizationsDevelopers($parent, $optParams = [])
|
---|
| 194 | {
|
---|
| 195 | $params = ['parent' => $parent];
|
---|
| 196 | $params = array_merge($params, $optParams);
|
---|
| 197 | return $this->call('list', [$params], GoogleCloudApigeeV1ListOfDevelopersResponse::class);
|
---|
| 198 | }
|
---|
| 199 | /**
|
---|
| 200 | * Sets the status of a developer. A developer is `active` by default. If you
|
---|
| 201 | * set a developer's status to `inactive`, the API keys assigned to the
|
---|
| 202 | * developer apps are no longer valid even though the API keys are set to
|
---|
| 203 | * `approved`. Inactive developers can still sign in to the developer portal and
|
---|
| 204 | * create apps; however, any new API keys generated during app creation won't
|
---|
| 205 | * work. To set the status of a developer, set the `action` query parameter to
|
---|
| 206 | * `active` or `inactive`, and the `Content-Type` header to `application/octet-
|
---|
| 207 | * stream`. If successful, the API call returns the following HTTP status code:
|
---|
| 208 | * `204 No Content` (developers.setDeveloperStatus)
|
---|
| 209 | *
|
---|
| 210 | * @param string $name Required. Name of the developer. Use the following
|
---|
| 211 | * structure in your request: `organizations/{org}/developers/{developer_id}`
|
---|
| 212 | * @param array $optParams Optional parameters.
|
---|
| 213 | *
|
---|
| 214 | * @opt_param string action Status of the developer. Valid values are `active`
|
---|
| 215 | * and `inactive`.
|
---|
| 216 | * @return GoogleProtobufEmpty
|
---|
| 217 | * @throws \Google\Service\Exception
|
---|
| 218 | */
|
---|
| 219 | public function setDeveloperStatus($name, $optParams = [])
|
---|
| 220 | {
|
---|
| 221 | $params = ['name' => $name];
|
---|
| 222 | $params = array_merge($params, $optParams);
|
---|
| 223 | return $this->call('setDeveloperStatus', [$params], GoogleProtobufEmpty::class);
|
---|
| 224 | }
|
---|
| 225 | /**
|
---|
| 226 | * Updates a developer. This API replaces the existing developer details with
|
---|
| 227 | * those specified in the request. Include or exclude any existing details that
|
---|
| 228 | * you want to retain or delete, respectively. The custom attribute limit is 18.
|
---|
| 229 | * **Note**: OAuth access tokens and Key Management Service (KMS) entities
|
---|
| 230 | * (apps, developers, and API products) are cached for 180 seconds (current
|
---|
| 231 | * default). Any custom attributes associated with these entities are cached for
|
---|
| 232 | * at least 180 seconds after the entity is accessed at runtime. Therefore, an
|
---|
| 233 | * `ExpiresIn` element on the OAuthV2 policy won't be able to expire an access
|
---|
| 234 | * token in less than 180 seconds. (developers.update)
|
---|
| 235 | *
|
---|
| 236 | * @param string $name Required. Email address of the developer. Use the
|
---|
| 237 | * following structure in your request:
|
---|
| 238 | * `organizations/{org}/developers/{developer_email}`
|
---|
| 239 | * @param GoogleCloudApigeeV1Developer $postBody
|
---|
| 240 | * @param array $optParams Optional parameters.
|
---|
| 241 | * @return GoogleCloudApigeeV1Developer
|
---|
| 242 | * @throws \Google\Service\Exception
|
---|
| 243 | */
|
---|
| 244 | public function update($name, GoogleCloudApigeeV1Developer $postBody, $optParams = [])
|
---|
| 245 | {
|
---|
| 246 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 247 | $params = array_merge($params, $optParams);
|
---|
| 248 | return $this->call('update', [$params], GoogleCloudApigeeV1Developer::class);
|
---|
| 249 | }
|
---|
| 250 | /**
|
---|
| 251 | * Updates the monetization configuration for the developer.
|
---|
| 252 | * (developers.updateMonetizationConfig)
|
---|
| 253 | *
|
---|
| 254 | * @param string $name Required. Monetization configuration for the developer.
|
---|
| 255 | * Use the following structure in your request:
|
---|
| 256 | * `organizations/{org}/developers/{developer}/monetizationConfig`
|
---|
| 257 | * @param GoogleCloudApigeeV1DeveloperMonetizationConfig $postBody
|
---|
| 258 | * @param array $optParams Optional parameters.
|
---|
| 259 | * @return GoogleCloudApigeeV1DeveloperMonetizationConfig
|
---|
| 260 | * @throws \Google\Service\Exception
|
---|
| 261 | */
|
---|
| 262 | public function updateMonetizationConfig($name, GoogleCloudApigeeV1DeveloperMonetizationConfig $postBody, $optParams = [])
|
---|
| 263 | {
|
---|
| 264 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 265 | $params = array_merge($params, $optParams);
|
---|
| 266 | return $this->call('updateMonetizationConfig', [$params], GoogleCloudApigeeV1DeveloperMonetizationConfig::class);
|
---|
| 267 | }
|
---|
| 268 | }
|
---|
| 269 |
|
---|
| 270 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 271 | class_alias(OrganizationsDevelopers::class, 'Google_Service_Apigee_Resource_OrganizationsDevelopers');
|
---|