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\GoogleCloudApigeeV1ArchiveDeployment;
21use Google\Service\Apigee\GoogleCloudApigeeV1GenerateDownloadUrlRequest;
22use Google\Service\Apigee\GoogleCloudApigeeV1GenerateDownloadUrlResponse;
23use Google\Service\Apigee\GoogleCloudApigeeV1GenerateUploadUrlRequest;
24use Google\Service\Apigee\GoogleCloudApigeeV1GenerateUploadUrlResponse;
25use Google\Service\Apigee\GoogleCloudApigeeV1ListArchiveDeploymentsResponse;
26use Google\Service\Apigee\GoogleLongrunningOperation;
27use Google\Service\Apigee\GoogleProtobufEmpty;
28
29/**
30 * The "archiveDeployments" collection of methods.
31 * Typical usage is:
32 *  <code>
33 *   $apigeeService = new Google\Service\Apigee(...);
34 *   $archiveDeployments = $apigeeService->archiveDeployments;
35 *  </code>
36 */
37class OrganizationsEnvironmentsArchiveDeployments extends \Google\Service\Resource
38{
39  /**
40   * Creates a new ArchiveDeployment. (archiveDeployments.create)
41   *
42   * @param string $parent Required. The Environment this Archive Deployment will
43   * be created in.
44   * @param GoogleCloudApigeeV1ArchiveDeployment $postBody
45   * @param array $optParams Optional parameters.
46   * @return GoogleLongrunningOperation
47   */
48  public function create($parent, GoogleCloudApigeeV1ArchiveDeployment $postBody, $optParams = [])
49  {
50    $params = ['parent' => $parent, 'postBody' => $postBody];
51    $params = array_merge($params, $optParams);
52    return $this->call('create', [$params], GoogleLongrunningOperation::class);
53  }
54  /**
55   * Deletes an archive deployment. (archiveDeployments.delete)
56   *
57   * @param string $name Required. Name of the Archive Deployment in the following
58   * format: `organizations/{org}/environments/{env}/archiveDeployments/{id}`.
59   * @param array $optParams Optional parameters.
60   * @return GoogleProtobufEmpty
61   */
62  public function delete($name, $optParams = [])
63  {
64    $params = ['name' => $name];
65    $params = array_merge($params, $optParams);
66    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
67  }
68  /**
69   * Generates a signed URL for downloading the original zip file used to create
70   * an Archive Deployment. The URL is only valid for a limited period and should
71   * be used within minutes after generation. Each call returns a new upload URL.
72   * (archiveDeployments.generateDownloadUrl)
73   *
74   * @param string $name Required. The name of the Archive Deployment you want to
75   * download.
76   * @param GoogleCloudApigeeV1GenerateDownloadUrlRequest $postBody
77   * @param array $optParams Optional parameters.
78   * @return GoogleCloudApigeeV1GenerateDownloadUrlResponse
79   */
80  public function generateDownloadUrl($name, GoogleCloudApigeeV1GenerateDownloadUrlRequest $postBody, $optParams = [])
81  {
82    $params = ['name' => $name, 'postBody' => $postBody];
83    $params = array_merge($params, $optParams);
84    return $this->call('generateDownloadUrl', [$params], GoogleCloudApigeeV1GenerateDownloadUrlResponse::class);
85  }
86  /**
87   * Generates a signed URL for uploading an Archive zip file to Google Cloud
88   * Storage. Once the upload is complete, the signed URL should be passed to
89   * CreateArchiveDeployment. When uploading to the generated signed URL, please
90   * follow these restrictions: * Source file type should be a zip file. * Source
91   * file size should not exceed 1GB limit. * No credentials should be attached -
92   * the signed URLs provide access to the target bucket using internal service
93   * identity; if credentials were attached, the identity from the credentials
94   * would be used, but that identity does not have permissions to upload files to
95   * the URL. When making a HTTP PUT request, these two headers need to be
96   * specified: * `content-type: application/zip` * `x-goog-content-length-range:
97   * 0,1073741824` And this header SHOULD NOT be specified: * `Authorization:
98   * Bearer YOUR_TOKEN` (archiveDeployments.generateUploadUrl)
99   *
100   * @param string $parent Required. The organization and environment to upload
101   * to.
102   * @param GoogleCloudApigeeV1GenerateUploadUrlRequest $postBody
103   * @param array $optParams Optional parameters.
104   * @return GoogleCloudApigeeV1GenerateUploadUrlResponse
105   */
106  public function generateUploadUrl($parent, GoogleCloudApigeeV1GenerateUploadUrlRequest $postBody, $optParams = [])
107  {
108    $params = ['parent' => $parent, 'postBody' => $postBody];
109    $params = array_merge($params, $optParams);
110    return $this->call('generateUploadUrl', [$params], GoogleCloudApigeeV1GenerateUploadUrlResponse::class);
111  }
112  /**
113   * Gets the specified ArchiveDeployment. (archiveDeployments.get)
114   *
115   * @param string $name Required. Name of the Archive Deployment in the following
116   * format: `organizations/{org}/environments/{env}/archiveDeployments/{id}`.
117   * @param array $optParams Optional parameters.
118   * @return GoogleCloudApigeeV1ArchiveDeployment
119   */
120  public function get($name, $optParams = [])
121  {
122    $params = ['name' => $name];
123    $params = array_merge($params, $optParams);
124    return $this->call('get', [$params], GoogleCloudApigeeV1ArchiveDeployment::class);
125  }
126  /**
127   * Lists the ArchiveDeployments in the specified Environment.
128   * (archiveDeployments.listOrganizationsEnvironmentsArchiveDeployments)
129   *
130   * @param string $parent Required. Name of the Environment for which to list
131   * Archive Deployments in the format: `organizations/{org}/environments/{env}`.
132   * @param array $optParams Optional parameters.
133   *
134   * @opt_param string filter Optional. An optional query used to return a subset
135   * of Archive Deployments using the semantics defined in
136   * https://google.aip.dev/160.
137   * @opt_param int pageSize Optional. Maximum number of Archive Deployments to
138   * return. If unspecified, at most 25 deployments will be returned.
139   * @opt_param string pageToken Optional. Page token, returned from a previous
140   * ListArchiveDeployments call, that you can use to retrieve the next page.
141   * @return GoogleCloudApigeeV1ListArchiveDeploymentsResponse
142   */
143  public function listOrganizationsEnvironmentsArchiveDeployments($parent, $optParams = [])
144  {
145    $params = ['parent' => $parent];
146    $params = array_merge($params, $optParams);
147    return $this->call('list', [$params], GoogleCloudApigeeV1ListArchiveDeploymentsResponse::class);
148  }
149  /**
150   * Updates an existing ArchiveDeployment. Labels can modified but most of the
151   * other fields are not modifiable. (archiveDeployments.patch)
152   *
153   * @param string $name Name of the Archive Deployment in the following format:
154   * `organizations/{org}/environments/{env}/archiveDeployments/{id}`.
155   * @param GoogleCloudApigeeV1ArchiveDeployment $postBody
156   * @param array $optParams Optional parameters.
157   *
158   * @opt_param string updateMask Required. The list of fields to be updated.
159   * @return GoogleCloudApigeeV1ArchiveDeployment
160   */
161  public function patch($name, GoogleCloudApigeeV1ArchiveDeployment $postBody, $optParams = [])
162  {
163    $params = ['name' => $name, 'postBody' => $postBody];
164    $params = array_merge($params, $optParams);
165    return $this->call('patch', [$params], GoogleCloudApigeeV1ArchiveDeployment::class);
166  }
167}
168
169// Adding a class alias for backwards compatibility with the previous class name.
170class_alias(OrganizationsEnvironmentsArchiveDeployments::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsArchiveDeployments');
171