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\GoogleCloudApigeeV1InstanceAttachment;
21use Google\Service\Apigee\GoogleCloudApigeeV1ListInstanceAttachmentsResponse;
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 OrganizationsInstancesAttachments extends \Google\Service\Resource
33{
34  /**
35   * Creates a new attachment of an environment to an instance. **Note:** Not
36   * supported for Apigee hybrid. (attachments.create)
37   *
38   * @param string $parent Required. Name of the instance. Use the following
39   * structure in your request: `organizations/{org}/instances/{instance}`.
40   * @param GoogleCloudApigeeV1InstanceAttachment $postBody
41   * @param array $optParams Optional parameters.
42   * @return GoogleLongrunningOperation
43   */
44  public function create($parent, GoogleCloudApigeeV1InstanceAttachment $postBody, $optParams = [])
45  {
46    $params = ['parent' => $parent, 'postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('create', [$params], GoogleLongrunningOperation::class);
49  }
50  /**
51   * Deletes an attachment. **Note:** Not supported for Apigee hybrid.
52   * (attachments.delete)
53   *
54   * @param string $name Required. Name of the attachment. Use the following
55   * structure in your request:
56   * `organizations/{org}/instances/{instance}/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 attachment. **Note:** Not supported for Apigee hybrid.
68   * (attachments.get)
69   *
70   * @param string $name Required. Name of the attachment. Use the following
71   * structure in your request:
72   * `organizations/{org}/instances/{instance}/attachments/{attachment}`
73   * @param array $optParams Optional parameters.
74   * @return GoogleCloudApigeeV1InstanceAttachment
75   */
76  public function get($name, $optParams = [])
77  {
78    $params = ['name' => $name];
79    $params = array_merge($params, $optParams);
80    return $this->call('get', [$params], GoogleCloudApigeeV1InstanceAttachment::class);
81  }
82  /**
83   * Lists all attachments to an instance. **Note:** Not supported for Apigee
84   * hybrid. (attachments.listOrganizationsInstancesAttachments)
85   *
86   * @param string $parent Required. Name of the organization. Use the following
87   * structure in your request: `organizations/{org}/instances/{instance}`
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param int pageSize Maximum number of instance attachments to return.
91   * Defaults to 25.
92   * @opt_param string pageToken Page token, returned by a previous
93   * ListInstanceAttachments call, that you can use to retrieve the next page of
94   * content.
95   * @return GoogleCloudApigeeV1ListInstanceAttachmentsResponse
96   */
97  public function listOrganizationsInstancesAttachments($parent, $optParams = [])
98  {
99    $params = ['parent' => $parent];
100    $params = array_merge($params, $optParams);
101    return $this->call('list', [$params], GoogleCloudApigeeV1ListInstanceAttachmentsResponse::class);
102  }
103}
104
105// Adding a class alias for backwards compatibility with the previous class name.
106class_alias(OrganizationsInstancesAttachments::class, 'Google_Service_Apigee_Resource_OrganizationsInstancesAttachments');
107