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\GoogleApiHttpBody;
21use Google\Service\Apigee\GoogleCloudApigeeV1ListEnvironmentResourcesResponse;
22use Google\Service\Apigee\GoogleCloudApigeeV1ResourceFile;
23
24/**
25 * The "resourcefiles" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $apigeeService = new Google\Service\Apigee(...);
29 *   $resourcefiles = $apigeeService->resourcefiles;
30 *  </code>
31 */
32class OrganizationsEnvironmentsResourcefiles extends \Google\Service\Resource
33{
34  /**
35   * Creates a resource file. Specify the `Content-Type` as `application/octet-
36   * stream` or `multipart/form-data`. For more information about resource files,
37   * see [Resource files](https://cloud.google.com/apigee/docs/api-
38   * platform/develop/resource-files). (resourcefiles.create)
39   *
40   * @param string $parent Required. Name of the environment in which to create
41   * the resource file in the following format:
42   * `organizations/{org}/environments/{env}`.
43   * @param GoogleApiHttpBody $postBody
44   * @param array $optParams Optional parameters.
45   *
46   * @opt_param string name Required. Name of the resource file. Must match the
47   * regular expression: [a-zA-Z0-9:/\\!@#$%^&{}\[\]()+\-=,.~'` ]{1,255}
48   * @opt_param string type Required. Resource file type. {{ resource_file_type }}
49   * @return GoogleCloudApigeeV1ResourceFile
50   */
51  public function create($parent, GoogleApiHttpBody $postBody, $optParams = [])
52  {
53    $params = ['parent' => $parent, 'postBody' => $postBody];
54    $params = array_merge($params, $optParams);
55    return $this->call('create', [$params], GoogleCloudApigeeV1ResourceFile::class);
56  }
57  /**
58   * Deletes a resource file. For more information about resource files, see
59   * [Resource files](https://cloud.google.com/apigee/docs/api-platform/develop
60   * /resource-files). (resourcefiles.delete)
61   *
62   * @param string $parent Required. Name of the environment in the following
63   * format: `organizations/{org}/environments/{env}`.
64   * @param string $type Required. Resource file type. {{ resource_file_type }}
65   * @param string $name Required. ID of the resource file to delete. Must match
66   * the regular expression: [a-zA-Z0-9:/\\!@#$%^&{}\[\]()+\-=,.~'` ]{1,255}
67   * @param array $optParams Optional parameters.
68   * @return GoogleCloudApigeeV1ResourceFile
69   */
70  public function delete($parent, $type, $name, $optParams = [])
71  {
72    $params = ['parent' => $parent, 'type' => $type, 'name' => $name];
73    $params = array_merge($params, $optParams);
74    return $this->call('delete', [$params], GoogleCloudApigeeV1ResourceFile::class);
75  }
76  /**
77   * Gets the contents of a resource file. For more information about resource
78   * files, see [Resource files](https://cloud.google.com/apigee/docs/api-
79   * platform/develop/resource-files). (resourcefiles.get)
80   *
81   * @param string $parent Required. Name of the environment in the following
82   * format: `organizations/{org}/environments/{env}`.
83   * @param string $type Required. Resource file type. {{ resource_file_type }}
84   * @param string $name Required. ID of the resource file. Must match the regular
85   * expression: [a-zA-Z0-9:/\\!@#$%^&{}\[\]()+\-=,.~'` ]{1,255}
86   * @param array $optParams Optional parameters.
87   * @return GoogleApiHttpBody
88   */
89  public function get($parent, $type, $name, $optParams = [])
90  {
91    $params = ['parent' => $parent, 'type' => $type, 'name' => $name];
92    $params = array_merge($params, $optParams);
93    return $this->call('get', [$params], GoogleApiHttpBody::class);
94  }
95  /**
96   * Lists all resource files, optionally filtering by type. For more information
97   * about resource files, see [Resource
98   * files](https://cloud.google.com/apigee/docs/api-platform/develop/resource-
99   * files). (resourcefiles.listOrganizationsEnvironmentsResourcefiles)
100   *
101   * @param string $parent Required. Name of the environment in which to list
102   * resource files in the following format:
103   * `organizations/{org}/environments/{env}`.
104   * @param array $optParams Optional parameters.
105   *
106   * @opt_param string type Optional. Type of resource files to list. {{
107   * resource_file_type }}
108   * @return GoogleCloudApigeeV1ListEnvironmentResourcesResponse
109   */
110  public function listOrganizationsEnvironmentsResourcefiles($parent, $optParams = [])
111  {
112    $params = ['parent' => $parent];
113    $params = array_merge($params, $optParams);
114    return $this->call('list', [$params], GoogleCloudApigeeV1ListEnvironmentResourcesResponse::class);
115  }
116  /**
117   * Lists all resource files, optionally filtering by type. For more information
118   * about resource files, see [Resource
119   * files](https://cloud.google.com/apigee/docs/api-platform/develop/resource-
120   * files). (resourcefiles.listEnvironmentResources)
121   *
122   * @param string $parent Required. Name of the environment in which to list
123   * resource files in the following format:
124   * `organizations/{org}/environments/{env}`.
125   * @param string $type Optional. Type of resource files to list. {{
126   * resource_file_type }}
127   * @param array $optParams Optional parameters.
128   * @return GoogleCloudApigeeV1ListEnvironmentResourcesResponse
129   */
130  public function listEnvironmentResources($parent, $type, $optParams = [])
131  {
132    $params = ['parent' => $parent, 'type' => $type];
133    $params = array_merge($params, $optParams);
134    return $this->call('listEnvironmentResources', [$params], GoogleCloudApigeeV1ListEnvironmentResourcesResponse::class);
135  }
136  /**
137   * Updates a resource file. Specify the `Content-Type` as `application/octet-
138   * stream` or `multipart/form-data`. For more information about resource files,
139   * see [Resource files](https://cloud.google.com/apigee/docs/api-
140   * platform/develop/resource-files). (resourcefiles.update)
141   *
142   * @param string $parent Required. Name of the environment in the following
143   * format: `organizations/{org}/environments/{env}`.
144   * @param string $type Required. Resource file type. {{ resource_file_type }}
145   * @param string $name Required. ID of the resource file to update. Must match
146   * the regular expression: [a-zA-Z0-9:/\\!@#$%^&{}\[\]()+\-=,.~'` ]{1,255}
147   * @param GoogleApiHttpBody $postBody
148   * @param array $optParams Optional parameters.
149   * @return GoogleCloudApigeeV1ResourceFile
150   */
151  public function update($parent, $type, $name, GoogleApiHttpBody $postBody, $optParams = [])
152  {
153    $params = ['parent' => $parent, 'type' => $type, 'name' => $name, 'postBody' => $postBody];
154    $params = array_merge($params, $optParams);
155    return $this->call('update', [$params], GoogleCloudApigeeV1ResourceFile::class);
156  }
157}
158
159// Adding a class alias for backwards compatibility with the previous class name.
160class_alias(OrganizationsEnvironmentsResourcefiles::class, 'Google_Service_Apigee_Resource_OrganizationsEnvironmentsResourcefiles');
161