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\AIPlatformNotebooks\Resource;
19
20use Google\Service\AIPlatformNotebooks\Environment;
21use Google\Service\AIPlatformNotebooks\ListEnvironmentsResponse;
22use Google\Service\AIPlatformNotebooks\Operation;
23
24/**
25 * The "environments" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $notebooksService = new Google\Service\AIPlatformNotebooks(...);
29 *   $environments = $notebooksService->environments;
30 *  </code>
31 */
32class ProjectsLocationsEnvironments extends \Google\Service\Resource
33{
34  /**
35   * Creates a new Environment. (environments.create)
36   *
37   * @param string $parent Required. Format:
38   * `projects/{project_id}/locations/{location}`
39   * @param Environment $postBody
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param string environmentId Required. User-defined unique ID of this
43   * environment. The `environment_id` must be 1 to 63 characters long and contain
44   * only lowercase letters, numeric characters, and dashes. The first character
45   * must be a lowercase letter and the last character cannot be a dash.
46   * @return Operation
47   */
48  public function create($parent, Environment $postBody, $optParams = [])
49  {
50    $params = ['parent' => $parent, 'postBody' => $postBody];
51    $params = array_merge($params, $optParams);
52    return $this->call('create', [$params], Operation::class);
53  }
54  /**
55   * Deletes a single Environment. (environments.delete)
56   *
57   * @param string $name Required. Format:
58   * `projects/{project_id}/locations/{location}/environments/{environment_id}`
59   * @param array $optParams Optional parameters.
60   * @return Operation
61   */
62  public function delete($name, $optParams = [])
63  {
64    $params = ['name' => $name];
65    $params = array_merge($params, $optParams);
66    return $this->call('delete', [$params], Operation::class);
67  }
68  /**
69   * Gets details of a single Environment. (environments.get)
70   *
71   * @param string $name Required. Format:
72   * `projects/{project_id}/locations/{location}/environments/{environment_id}`
73   * @param array $optParams Optional parameters.
74   * @return Environment
75   */
76  public function get($name, $optParams = [])
77  {
78    $params = ['name' => $name];
79    $params = array_merge($params, $optParams);
80    return $this->call('get', [$params], Environment::class);
81  }
82  /**
83   * Lists environments in a project.
84   * (environments.listProjectsLocationsEnvironments)
85   *
86   * @param string $parent Required. Format:
87   * `projects/{project_id}/locations/{location}`
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param int pageSize Maximum return size of the list call.
91   * @opt_param string pageToken A previous returned page token that can be used
92   * to continue listing from the last result.
93   * @return ListEnvironmentsResponse
94   */
95  public function listProjectsLocationsEnvironments($parent, $optParams = [])
96  {
97    $params = ['parent' => $parent];
98    $params = array_merge($params, $optParams);
99    return $this->call('list', [$params], ListEnvironmentsResponse::class);
100  }
101}
102
103// Adding a class alias for backwards compatibility with the previous class name.
104class_alias(ProjectsLocationsEnvironments::class, 'Google_Service_AIPlatformNotebooks_Resource_ProjectsLocationsEnvironments');
105