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\GoogleCloudApigeeV1GetSyncAuthorizationRequest;
21use Google\Service\Apigee\GoogleCloudApigeeV1IngressConfig;
22use Google\Service\Apigee\GoogleCloudApigeeV1ListOrganizationsResponse;
23use Google\Service\Apigee\GoogleCloudApigeeV1Organization;
24use Google\Service\Apigee\GoogleCloudApigeeV1RuntimeConfig;
25use Google\Service\Apigee\GoogleCloudApigeeV1SetAddonsRequest;
26use Google\Service\Apigee\GoogleCloudApigeeV1SyncAuthorization;
27use Google\Service\Apigee\GoogleLongrunningOperation;
28
29/**
30 * The "organizations" collection of methods.
31 * Typical usage is:
32 *  <code>
33 *   $apigeeService = new Google\Service\Apigee(...);
34 *   $organizations = $apigeeService->organizations;
35 *  </code>
36 */
37class Organizations extends \Google\Service\Resource
38{
39  /**
40   * Creates an Apigee organization. See [Create an Apigee
41   * organization](https://cloud.google.com/apigee/docs/api-platform/get-started
42   * /create-org). (organizations.create)
43   *
44   * @param GoogleCloudApigeeV1Organization $postBody
45   * @param array $optParams Optional parameters.
46   *
47   * @opt_param string parent Required. Name of the GCP project in which to
48   * associate the Apigee organization. Pass the information as a query parameter
49   * using the following structure in your request: `projects/`
50   * @return GoogleLongrunningOperation
51   */
52  public function create(GoogleCloudApigeeV1Organization $postBody, $optParams = [])
53  {
54    $params = ['postBody' => $postBody];
55    $params = array_merge($params, $optParams);
56    return $this->call('create', [$params], GoogleLongrunningOperation::class);
57  }
58  /**
59   * Delete an Apigee organization. Only supported for SubscriptionType TRIAL.
60   * (organizations.delete)
61   *
62   * @param string $name Required. Name of the organization. Use the following
63   * structure in your request: `organizations/{org}`
64   * @param array $optParams Optional parameters.
65   * @return GoogleLongrunningOperation
66   */
67  public function delete($name, $optParams = [])
68  {
69    $params = ['name' => $name];
70    $params = array_merge($params, $optParams);
71    return $this->call('delete', [$params], GoogleLongrunningOperation::class);
72  }
73  /**
74   * Gets the profile for an Apigee organization. See [Understanding
75   * organizations](https://cloud.google.com/apigee/docs/api-platform/fundamentals
76   * /organization-structure). (organizations.get)
77   *
78   * @param string $name Required. Apigee organization name in the following
79   * format: `organizations/{org}`
80   * @param array $optParams Optional parameters.
81   * @return GoogleCloudApigeeV1Organization
82   */
83  public function get($name, $optParams = [])
84  {
85    $params = ['name' => $name];
86    $params = array_merge($params, $optParams);
87    return $this->call('get', [$params], GoogleCloudApigeeV1Organization::class);
88  }
89  /**
90   * Gets the deployed ingress configuration for an organization.
91   * (organizations.getDeployedIngressConfig)
92   *
93   * @param string $name Required. Name of the deployed configuration for the
94   * organization in the following format:
95   * 'organizations/{org}/deployedIngressConfig'.
96   * @param array $optParams Optional parameters.
97   *
98   * @opt_param string view When set to FULL, additional details about the
99   * specific deployments receiving traffic will be included in the IngressConfig
100   * response's RoutingRules.
101   * @return GoogleCloudApigeeV1IngressConfig
102   */
103  public function getDeployedIngressConfig($name, $optParams = [])
104  {
105    $params = ['name' => $name];
106    $params = array_merge($params, $optParams);
107    return $this->call('getDeployedIngressConfig', [$params], GoogleCloudApigeeV1IngressConfig::class);
108  }
109  /**
110   * Get runtime config for an organization. (organizations.getRuntimeConfig)
111   *
112   * @param string $name Required. Name of the runtime config for the organization
113   * in the following format: 'organizations/{org}/runtimeConfig'.
114   * @param array $optParams Optional parameters.
115   * @return GoogleCloudApigeeV1RuntimeConfig
116   */
117  public function getRuntimeConfig($name, $optParams = [])
118  {
119    $params = ['name' => $name];
120    $params = array_merge($params, $optParams);
121    return $this->call('getRuntimeConfig', [$params], GoogleCloudApigeeV1RuntimeConfig::class);
122  }
123  /**
124   * Lists the service accounts with the permissions required to allow the
125   * Synchronizer to download environment data from the control plane. An ETag is
126   * returned in the response to `getSyncAuthorization`. Pass that ETag when
127   * calling [setSyncAuthorization](setSyncAuthorization) to ensure that you are
128   * updating the correct version. If you don't pass the ETag in the call to
129   * `setSyncAuthorization`, then the existing authorization is overwritten
130   * indiscriminately. For more information, see [Configure the
131   * Synchronizer](https://cloud.google.com/apigee/docs/hybrid/latest
132   * /synchronizer-access). **Note**: Available to Apigee hybrid only.
133   * (organizations.getSyncAuthorization)
134   *
135   * @param string $name Required. Name of the Apigee organization. Use the
136   * following structure in your request: `organizations/{org}`
137   * @param GoogleCloudApigeeV1GetSyncAuthorizationRequest $postBody
138   * @param array $optParams Optional parameters.
139   * @return GoogleCloudApigeeV1SyncAuthorization
140   */
141  public function getSyncAuthorization($name, GoogleCloudApigeeV1GetSyncAuthorizationRequest $postBody, $optParams = [])
142  {
143    $params = ['name' => $name, 'postBody' => $postBody];
144    $params = array_merge($params, $optParams);
145    return $this->call('getSyncAuthorization', [$params], GoogleCloudApigeeV1SyncAuthorization::class);
146  }
147  /**
148   * Lists the Apigee organizations and associated GCP projects that you have
149   * permission to access. See [Understanding
150   * organizations](https://cloud.google.com/apigee/docs/api-platform/fundamentals
151   * /organization-structure). (organizations.listOrganizations)
152   *
153   * @param string $parent Required. Use the following structure in your request:
154   * `organizations`
155   * @param array $optParams Optional parameters.
156   * @return GoogleCloudApigeeV1ListOrganizationsResponse
157   */
158  public function listOrganizations($parent, $optParams = [])
159  {
160    $params = ['parent' => $parent];
161    $params = array_merge($params, $optParams);
162    return $this->call('list', [$params], GoogleCloudApigeeV1ListOrganizationsResponse::class);
163  }
164  /**
165   * Configures the add-ons for the Apigee organization. The existing add-on
166   * configuration will be fully replaced. (organizations.setAddons)
167   *
168   * @param string $org Required. Name of the organization. Use the following
169   * structure in your request: `organizations/{org}`
170   * @param GoogleCloudApigeeV1SetAddonsRequest $postBody
171   * @param array $optParams Optional parameters.
172   * @return GoogleLongrunningOperation
173   */
174  public function setAddons($org, GoogleCloudApigeeV1SetAddonsRequest $postBody, $optParams = [])
175  {
176    $params = ['org' => $org, 'postBody' => $postBody];
177    $params = array_merge($params, $optParams);
178    return $this->call('setAddons', [$params], GoogleLongrunningOperation::class);
179  }
180  /**
181   * Sets the permissions required to allow the Synchronizer to download
182   * environment data from the control plane. You must call this API to enable
183   * proper functioning of hybrid. Pass the ETag when calling
184   * `setSyncAuthorization` to ensure that you are updating the correct version.
185   * To get an ETag, call [getSyncAuthorization](getSyncAuthorization). If you
186   * don't pass the ETag in the call to `setSyncAuthorization`, then the existing
187   * authorization is overwritten indiscriminately. For more information, see
188   * [Configure the
189   * Synchronizer](https://cloud.google.com/apigee/docs/hybrid/latest
190   * /synchronizer-access). **Note**: Available to Apigee hybrid only.
191   * (organizations.setSyncAuthorization)
192   *
193   * @param string $name Required. Name of the Apigee organization. Use the
194   * following structure in your request: `organizations/{org}`
195   * @param GoogleCloudApigeeV1SyncAuthorization $postBody
196   * @param array $optParams Optional parameters.
197   * @return GoogleCloudApigeeV1SyncAuthorization
198   */
199  public function setSyncAuthorization($name, GoogleCloudApigeeV1SyncAuthorization $postBody, $optParams = [])
200  {
201    $params = ['name' => $name, 'postBody' => $postBody];
202    $params = array_merge($params, $optParams);
203    return $this->call('setSyncAuthorization', [$params], GoogleCloudApigeeV1SyncAuthorization::class);
204  }
205  /**
206   * Updates the properties for an Apigee organization. No other fields in the
207   * organization profile will be updated. (organizations.update)
208   *
209   * @param string $name Required. Apigee organization name in the following
210   * format: `organizations/{org}`
211   * @param GoogleCloudApigeeV1Organization $postBody
212   * @param array $optParams Optional parameters.
213   * @return GoogleCloudApigeeV1Organization
214   */
215  public function update($name, GoogleCloudApigeeV1Organization $postBody, $optParams = [])
216  {
217    $params = ['name' => $name, 'postBody' => $postBody];
218    $params = array_merge($params, $optParams);
219    return $this->call('update', [$params], GoogleCloudApigeeV1Organization::class);
220  }
221}
222
223// Adding a class alias for backwards compatibility with the previous class name.
224class_alias(Organizations::class, 'Google_Service_Apigee_Resource_Organizations');
225