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\GoogleCloudApigeeV1EnvironmentGroupAttachment;
21use Google\Service\Apigee\GoogleCloudApigeeV1ListEnvironmentGroupAttachmentsResponse;
22use Google\Service\Apigee\GoogleLongrunningOperation;
23
24/**
25 * The "attachments" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $apigeeService = new Google\Service\Apigee(...);
29 *   $attachments = $apigeeService->attachments;
30 *  </code>
31 */
32class OrganizationsEnvgroupsAttachments extends \Google\Service\Resource
33{
34  /**
35   * Creates a new attachment of an environment to an environment group.
36   * (attachments.create)
37   *
38   * @param string $parent Required. EnvironmentGroup under which to create the
39   * attachment in the following format:
40   * `organizations/{org}/envgroups/{envgroup}`.
41   * @param GoogleCloudApigeeV1EnvironmentGroupAttachment $postBody
42   * @param array $optParams Optional parameters.
43   * @return GoogleLongrunningOperation
44   */
45  public function create($parent, GoogleCloudApigeeV1EnvironmentGroupAttachment $postBody, $optParams = [])
46  {
47    $params = ['parent' => $parent, 'postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('create', [$params], GoogleLongrunningOperation::class);
50  }
51  /**
52   * Deletes an environment group attachment. (attachments.delete)
53   *
54   * @param string $name Required. Name of the environment group attachment to
55   * delete in the following format:
56   * `organizations/{org}/envgroups/{envgroup}/attachments/{attachment}`.
57   * @param array $optParams Optional parameters.
58   * @return GoogleLongrunningOperation
59   */
60  public function delete($name, $optParams = [])
61  {
62    $params = ['name' => $name];
63    $params = array_merge($params, $optParams);
64    return $this->call('delete', [$params], GoogleLongrunningOperation::class);
65  }
66  /**
67   * Gets an environment group attachment. (attachments.get)
68   *
69   * @param string $name Required. Name of the environment group attachment in the
70   * following format:
71   * `organizations/{org}/envgroups/{envgroup}/attachments/{attachment}`
72   * @param array $optParams Optional parameters.
73   * @return GoogleCloudApigeeV1EnvironmentGroupAttachment
74   */
75  public function get($name, $optParams = [])
76  {
77    $params = ['name' => $name];
78    $params = array_merge($params, $optParams);
79    return $this->call('get', [$params], GoogleCloudApigeeV1EnvironmentGroupAttachment::class);
80  }
81  /**
82   * Lists all attachments of an environment group.
83   * (attachments.listOrganizationsEnvgroupsAttachments)
84   *
85   * @param string $parent Required. Name of the environment group in the
86   * following format: `organizations/{org}/envgroups/{envgroup}`.
87   * @param array $optParams Optional parameters.
88   *
89   * @opt_param int pageSize Maximum number of environment group attachments to
90   * return. The page size defaults to 25.
91   * @opt_param string pageToken Page token, returned by a previous
92   * ListEnvironmentGroupAttachments call, that you can use to retrieve the next
93   * page.
94   * @return GoogleCloudApigeeV1ListEnvironmentGroupAttachmentsResponse
95   */
96  public function listOrganizationsEnvgroupsAttachments($parent, $optParams = [])
97  {
98    $params = ['parent' => $parent];
99    $params = array_merge($params, $optParams);
100    return $this->call('list', [$params], GoogleCloudApigeeV1ListEnvironmentGroupAttachmentsResponse::class);
101  }
102}
103
104// Adding a class alias for backwards compatibility with the previous class name.
105class_alias(OrganizationsEnvgroupsAttachments::class, 'Google_Service_Apigee_Resource_OrganizationsEnvgroupsAttachments');
106