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\GoogleApiHttpBody;
21use Google\Service\Apigee\GoogleCloudApigeeV1ApiProxy;
22use Google\Service\Apigee\GoogleCloudApigeeV1ApiProxyRevision;
23use 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->apis;
31 *  </code>
32 */
33class 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   */
67  public function create($parent, GoogleApiHttpBody $postBody, $optParams = [])
68  {
69    $params = ['parent' => $parent, 'postBody' => $postBody];
70    $params = array_merge($params, $optParams);
71    return $this->call('create', [$params], GoogleCloudApigeeV1ApiProxyRevision::class);
72  }
73  /**
74   * Deletes an API proxy and all associated endpoints, policies, resources, and
75   * revisions. The API proxy must be undeployed before you can delete it.
76   * (apis.delete)
77   *
78   * @param string $name Required. Name of the API proxy in the following format:
79   * `organizations/{org}/apis/{api}`
80   * @param array $optParams Optional parameters.
81   * @return GoogleCloudApigeeV1ApiProxy
82   */
83  public function delete($name, $optParams = [])
84  {
85    $params = ['name' => $name];
86    $params = array_merge($params, $optParams);
87    return $this->call('delete', [$params], GoogleCloudApigeeV1ApiProxy::class);
88  }
89  /**
90   * Gets an API proxy including a list of existing revisions. (apis.get)
91   *
92   * @param string $name Required. Name of the API proxy in the following format:
93   * `organizations/{org}/apis/{api}`
94   * @param array $optParams Optional parameters.
95   * @return GoogleCloudApigeeV1ApiProxy
96   */
97  public function get($name, $optParams = [])
98  {
99    $params = ['name' => $name];
100    $params = array_merge($params, $optParams);
101    return $this->call('get', [$params], GoogleCloudApigeeV1ApiProxy::class);
102  }
103  /**
104   * Lists the names of all API proxies in an organization. The names returned
105   * correspond to the names defined in the configuration files for each API
106   * proxy. (apis.listOrganizationsApis)
107   *
108   * @param string $parent Required. Name of the organization in the following
109   * format: `organizations/{org}`
110   * @param array $optParams Optional parameters.
111   *
112   * @opt_param bool includeMetaData Flag that specifies whether to include API
113   * proxy metadata in the response.
114   * @opt_param bool includeRevisions Flag that specifies whether to include a
115   * list of revisions in the response.
116   * @return GoogleCloudApigeeV1ListApiProxiesResponse
117   */
118  public function listOrganizationsApis($parent, $optParams = [])
119  {
120    $params = ['parent' => $parent];
121    $params = array_merge($params, $optParams);
122    return $this->call('list', [$params], GoogleCloudApigeeV1ListApiProxiesResponse::class);
123  }
124  /**
125   * Updates an existing API proxy. (apis.patch)
126   *
127   * @param string $name Required. API proxy to update in the following format:
128   * `organizations/{org}/apis/{api}`
129   * @param GoogleCloudApigeeV1ApiProxy $postBody
130   * @param array $optParams Optional parameters.
131   *
132   * @opt_param string updateMask Required. The list of fields to update.
133   * @return GoogleCloudApigeeV1ApiProxy
134   */
135  public function patch($name, GoogleCloudApigeeV1ApiProxy $postBody, $optParams = [])
136  {
137    $params = ['name' => $name, 'postBody' => $postBody];
138    $params = array_merge($params, $optParams);
139    return $this->call('patch', [$params], GoogleCloudApigeeV1ApiProxy::class);
140  }
141}
142
143// Adding a class alias for backwards compatibility with the previous class name.
144class_alias(OrganizationsApis::class, 'Google_Service_Apigee_Resource_OrganizationsApis');
145