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\GoogleCloudApigeeV1TargetServer;
21
22/**
23 * The "targetservers" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $apigeeService = new Google\Service\Apigee(...);
27 *   $targetservers = $apigeeService->targetservers;
28 *  </code>
29 */
30class OrganizationsEnvironmentsTargetservers extends \Google\Service\Resource
31{
32  /**
33   * Creates a TargetServer in the specified environment. (targetservers.create)
34   *
35   * @param string $parent Required. The parent environment name under which the
36   * TargetServer will be created. Must be of the form
37   * `organizations/{org}/environments/{env}`.
38   * @param GoogleCloudApigeeV1TargetServer $postBody
39   * @param array $optParams Optional parameters.
40   *
41   * @opt_param string name Optional. The ID to give the TargetServer. This will
42   * overwrite the value in TargetServer.
43   * @return GoogleCloudApigeeV1TargetServer
44   */
45  public function create($parent, GoogleCloudApigeeV1TargetServer $postBody, $optParams = [])
46  {
47    $params = ['parent' => $parent, 'postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('create', [$params], GoogleCloudApigeeV1TargetServer::class);
50  }
51  /**
52   * Deletes a TargetServer from an environment. Returns the deleted TargetServer
53   * resource. (targetservers.delete)
54   *
55   * @param string $name Required. The name of the TargetServer to delete. Must be
56   * of the form
57   * `organizations/{org}/environments/{env}/targetservers/{target_server_id}`.
58   * @param array $optParams Optional parameters.
59   * @return GoogleCloudApigeeV1TargetServer
60   */
61  public function delete($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('delete', [$params], GoogleCloudApigeeV1TargetServer::class);
66  }
67  /**
68   * Gets a TargetServer resource. (targetservers.get)
69   *
70   * @param string $name Required. The name of the TargetServer to get. Must be of
71   * the form
72   * `organizations/{org}/environments/{env}/targetservers/{target_server_id}`.
73   * @param array $optParams Optional parameters.
74   * @return GoogleCloudApigeeV1TargetServer
75   */
76  public function get($name, $optParams = [])
77  {
78    $params = ['name' => $name];
79    $params = array_merge($params, $optParams);
80    return $this->call('get', [$params], GoogleCloudApigeeV1TargetServer::class);
81  }
82  /**
83   * Updates an existing TargetServer. Note that this operation has PUT semantics;
84   * it will replace the entirety of the existing TargetServer with the resource
85   * in the request body. (targetservers.update)
86   *
87   * @param string $name Required. The name of the TargetServer to replace. Must
88   * be of the form
89   * `organizations/{org}/environments/{env}/targetservers/{target_server_id}`.
90   * @param GoogleCloudApigeeV1TargetServer $postBody
91   * @param array $optParams Optional parameters.
92   * @return GoogleCloudApigeeV1TargetServer
93   */
94  public function update($name, GoogleCloudApigeeV1TargetServer $postBody, $optParams = [])
95  {
96    $params = ['name' => $name, 'postBody' => $postBody];
97    $params = array_merge($params, $optParams);
98    return $this->call('update', [$params], GoogleCloudApigeeV1TargetServer::class);
99  }
100}
101
102// Adding a class alias for backwards compatibility with the previous class name.
103class_alias(OrganizationsEnvironmentsTargetservers::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsTargetservers');
104