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\GoogleApiHttpBody;
|
---|
21 | use Google\Service\Apigee\GoogleCloudApigeeV1ApiProxy;
|
---|
22 | use Google\Service\Apigee\GoogleCloudApigeeV1ApiProxyRevision;
|
---|
23 | use Google\Service\Apigee\GoogleCloudApigeeV1ListApiProxiesResponse;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "apis" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $apigeeService = new Google\Service\Apigee(...);
|
---|
30 | * $apis = $apigeeService->organizations_apis;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class OrganizationsApis extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Creates an API proxy. The API proxy created will not be accessible at runtime
|
---|
37 | * until it is deployed to an environment. Create a new API proxy by setting the
|
---|
38 | * `name` query parameter to the name of the API proxy. Import an API proxy
|
---|
39 | * configuration bundle stored in zip format on your local machine to your
|
---|
40 | * organization by doing the following: * Set the `name` query parameter to the
|
---|
41 | * name of the API proxy. * Set the `action` query parameter to `import`. * Set
|
---|
42 | * the `Content-Type` header to `multipart/form-data`. * Pass as a file the name
|
---|
43 | * of API proxy configuration bundle stored in zip format on your local machine
|
---|
44 | * using the `file` form field. **Note**: To validate the API proxy
|
---|
45 | * configuration bundle only without importing it, set the `action` query
|
---|
46 | * parameter to `validate`. When importing an API proxy configuration bundle, if
|
---|
47 | * the API proxy does not exist, it will be created. If the API proxy exists,
|
---|
48 | * then a new revision is created. Invalid API proxy configurations are
|
---|
49 | * rejected, and a list of validation errors is returned to the client.
|
---|
50 | * (apis.create)
|
---|
51 | *
|
---|
52 | * @param string $parent Required. Name of the organization in the following
|
---|
53 | * format: `organizations/{org}`
|
---|
54 | * @param GoogleApiHttpBody $postBody
|
---|
55 | * @param array $optParams Optional parameters.
|
---|
56 | *
|
---|
57 | * @opt_param string action Action to perform when importing an API proxy
|
---|
58 | * configuration bundle. Set this parameter to one of the following values: *
|
---|
59 | * `import` to import the API proxy configuration bundle. * `validate` to
|
---|
60 | * validate the API proxy configuration bundle without importing it.
|
---|
61 | * @opt_param string name Name of the API proxy. Restrict the characters used
|
---|
62 | * to: A-Za-z0-9._-
|
---|
63 | * @opt_param bool validate Ignored. All uploads are validated regardless of the
|
---|
64 | * value of this field. Maintained for compatibility with Apigee Edge API.
|
---|
65 | * @return GoogleCloudApigeeV1ApiProxyRevision
|
---|
66 | * @throws \Google\Service\Exception
|
---|
67 | */
|
---|
68 | public function create($parent, GoogleApiHttpBody $postBody, $optParams = [])
|
---|
69 | {
|
---|
70 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
71 | $params = array_merge($params, $optParams);
|
---|
72 | return $this->call('create', [$params], GoogleCloudApigeeV1ApiProxyRevision::class);
|
---|
73 | }
|
---|
74 | /**
|
---|
75 | * Deletes an API proxy and all associated endpoints, policies, resources, and
|
---|
76 | * revisions. The API proxy must be undeployed before you can delete it.
|
---|
77 | * (apis.delete)
|
---|
78 | *
|
---|
79 | * @param string $name Required. Name of the API proxy in the following format:
|
---|
80 | * `organizations/{org}/apis/{api}`
|
---|
81 | * @param array $optParams Optional parameters.
|
---|
82 | * @return GoogleCloudApigeeV1ApiProxy
|
---|
83 | * @throws \Google\Service\Exception
|
---|
84 | */
|
---|
85 | public function delete($name, $optParams = [])
|
---|
86 | {
|
---|
87 | $params = ['name' => $name];
|
---|
88 | $params = array_merge($params, $optParams);
|
---|
89 | return $this->call('delete', [$params], GoogleCloudApigeeV1ApiProxy::class);
|
---|
90 | }
|
---|
91 | /**
|
---|
92 | * Gets an API proxy including a list of existing revisions. (apis.get)
|
---|
93 | *
|
---|
94 | * @param string $name Required. Name of the API proxy in the following format:
|
---|
95 | * `organizations/{org}/apis/{api}`
|
---|
96 | * @param array $optParams Optional parameters.
|
---|
97 | * @return GoogleCloudApigeeV1ApiProxy
|
---|
98 | * @throws \Google\Service\Exception
|
---|
99 | */
|
---|
100 | public function get($name, $optParams = [])
|
---|
101 | {
|
---|
102 | $params = ['name' => $name];
|
---|
103 | $params = array_merge($params, $optParams);
|
---|
104 | return $this->call('get', [$params], GoogleCloudApigeeV1ApiProxy::class);
|
---|
105 | }
|
---|
106 | /**
|
---|
107 | * Lists the names of all API proxies in an organization. The names returned
|
---|
108 | * correspond to the names defined in the configuration files for each API
|
---|
109 | * proxy. (apis.listOrganizationsApis)
|
---|
110 | *
|
---|
111 | * @param string $parent Required. Name of the organization in the following
|
---|
112 | * format: `organizations/{org}`
|
---|
113 | * @param array $optParams Optional parameters.
|
---|
114 | *
|
---|
115 | * @opt_param bool includeMetaData Flag that specifies whether to include API
|
---|
116 | * proxy metadata in the response.
|
---|
117 | * @opt_param bool includeRevisions Flag that specifies whether to include a
|
---|
118 | * list of revisions in the response.
|
---|
119 | * @return GoogleCloudApigeeV1ListApiProxiesResponse
|
---|
120 | * @throws \Google\Service\Exception
|
---|
121 | */
|
---|
122 | public function listOrganizationsApis($parent, $optParams = [])
|
---|
123 | {
|
---|
124 | $params = ['parent' => $parent];
|
---|
125 | $params = array_merge($params, $optParams);
|
---|
126 | return $this->call('list', [$params], GoogleCloudApigeeV1ListApiProxiesResponse::class);
|
---|
127 | }
|
---|
128 | /**
|
---|
129 | * Updates an existing API proxy. (apis.patch)
|
---|
130 | *
|
---|
131 | * @param string $name Required. API proxy to update in the following format:
|
---|
132 | * `organizations/{org}/apis/{api}`
|
---|
133 | * @param GoogleCloudApigeeV1ApiProxy $postBody
|
---|
134 | * @param array $optParams Optional parameters.
|
---|
135 | *
|
---|
136 | * @opt_param string updateMask Required. The list of fields to update.
|
---|
137 | * @return GoogleCloudApigeeV1ApiProxy
|
---|
138 | * @throws \Google\Service\Exception
|
---|
139 | */
|
---|
140 | public function patch($name, GoogleCloudApigeeV1ApiProxy $postBody, $optParams = [])
|
---|
141 | {
|
---|
142 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
143 | $params = array_merge($params, $optParams);
|
---|
144 | return $this->call('patch', [$params], GoogleCloudApigeeV1ApiProxy::class);
|
---|
145 | }
|
---|
146 | }
|
---|
147 |
|
---|
148 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
149 | class_alias(OrganizationsApis::class, 'Google_Service_Apigee_Resource_OrganizationsApis');
|
---|