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\GoogleCloudApigeeV1Instance;
21use Google\Service\Apigee\GoogleCloudApigeeV1ListInstancesResponse;
22use Google\Service\Apigee\GoogleCloudApigeeV1ReportInstanceStatusRequest;
23use Google\Service\Apigee\GoogleCloudApigeeV1ReportInstanceStatusResponse;
24use Google\Service\Apigee\GoogleLongrunningOperation;
25
26/**
27 * The "instances" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $apigeeService = new Google\Service\Apigee(...);
31 *   $instances = $apigeeService->instances;
32 *  </code>
33 */
34class OrganizationsInstances extends \Google\Service\Resource
35{
36  /**
37   * Creates an Apigee runtime instance. The instance is accessible from the
38   * authorized network configured on the organization. **Note:** Not supported
39   * for Apigee hybrid. (instances.create)
40   *
41   * @param string $parent Required. Name of the organization. Use the following
42   * structure in your request: `organizations/{org}`.
43   * @param GoogleCloudApigeeV1Instance $postBody
44   * @param array $optParams Optional parameters.
45   * @return GoogleLongrunningOperation
46   */
47  public function create($parent, GoogleCloudApigeeV1Instance $postBody, $optParams = [])
48  {
49    $params = ['parent' => $parent, 'postBody' => $postBody];
50    $params = array_merge($params, $optParams);
51    return $this->call('create', [$params], GoogleLongrunningOperation::class);
52  }
53  /**
54   * Deletes an Apigee runtime instance. The instance stops serving requests and
55   * the runtime data is deleted. **Note:** Not supported for Apigee hybrid.
56   * (instances.delete)
57   *
58   * @param string $name Required. Name of the instance. Use the following
59   * structure in your request: `organizations/{org}/instances/{instance}`.
60   * @param array $optParams Optional parameters.
61   * @return GoogleLongrunningOperation
62   */
63  public function delete($name, $optParams = [])
64  {
65    $params = ['name' => $name];
66    $params = array_merge($params, $optParams);
67    return $this->call('delete', [$params], GoogleLongrunningOperation::class);
68  }
69  /**
70   * Gets the details for an Apigee runtime instance. **Note:** Not supported for
71   * Apigee hybrid. (instances.get)
72   *
73   * @param string $name Required. Name of the instance. Use the following
74   * structure in your request: `organizations/{org}/instances/{instance}`.
75   * @param array $optParams Optional parameters.
76   * @return GoogleCloudApigeeV1Instance
77   */
78  public function get($name, $optParams = [])
79  {
80    $params = ['name' => $name];
81    $params = array_merge($params, $optParams);
82    return $this->call('get', [$params], GoogleCloudApigeeV1Instance::class);
83  }
84  /**
85   * Lists all Apigee runtime instances for the organization. **Note:** Not
86   * supported for Apigee hybrid. (instances.listOrganizationsInstances)
87   *
88   * @param string $parent Required. Name of the organization. Use the following
89   * structure in your request: `organizations/{org}`.
90   * @param array $optParams Optional parameters.
91   *
92   * @opt_param int pageSize Maximum number of instances to return. Defaults to
93   * 25.
94   * @opt_param string pageToken Page token, returned from a previous
95   * ListInstances call, that you can use to retrieve the next page of content.
96   * @return GoogleCloudApigeeV1ListInstancesResponse
97   */
98  public function listOrganizationsInstances($parent, $optParams = [])
99  {
100    $params = ['parent' => $parent];
101    $params = array_merge($params, $optParams);
102    return $this->call('list', [$params], GoogleCloudApigeeV1ListInstancesResponse::class);
103  }
104  /**
105   * Updates an Apigee runtime instance. You can update the fields described in
106   * NodeConfig. No other fields will be updated. **Note:** Not supported for
107   * Apigee hybrid. (instances.patch)
108   *
109   * @param string $name Required. Name of the instance. Use the following
110   * structure in your request: `organizations/{org}/instances/{instance}`.
111   * @param GoogleCloudApigeeV1Instance $postBody
112   * @param array $optParams Optional parameters.
113   *
114   * @opt_param string updateMask List of fields to be updated.
115   * @return GoogleLongrunningOperation
116   */
117  public function patch($name, GoogleCloudApigeeV1Instance $postBody, $optParams = [])
118  {
119    $params = ['name' => $name, 'postBody' => $postBody];
120    $params = array_merge($params, $optParams);
121    return $this->call('patch', [$params], GoogleLongrunningOperation::class);
122  }
123  /**
124   * Reports the latest status for a runtime instance. (instances.reportStatus)
125   *
126   * @param string $instance The name of the instance reporting this status. For
127   * SaaS the request will be rejected if no instance exists under this name.
128   * Format is organizations/{org}/instances/{instance}
129   * @param GoogleCloudApigeeV1ReportInstanceStatusRequest $postBody
130   * @param array $optParams Optional parameters.
131   * @return GoogleCloudApigeeV1ReportInstanceStatusResponse
132   */
133  public function reportStatus($instance, GoogleCloudApigeeV1ReportInstanceStatusRequest $postBody, $optParams = [])
134  {
135    $params = ['instance' => $instance, 'postBody' => $postBody];
136    $params = array_merge($params, $optParams);
137    return $this->call('reportStatus', [$params], GoogleCloudApigeeV1ReportInstanceStatusResponse::class);
138  }
139}
140
141// Adding a class alias for backwards compatibility with the previous class name.
142class_alias(OrganizationsInstances::class, 'Google_Service_Apigee_Resource_OrganizationsInstances');
143