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\Execution;
21use Google\Service\AIPlatformNotebooks\ListExecutionsResponse;
22use Google\Service\AIPlatformNotebooks\Operation;
23
24/**
25 * The "executions" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $notebooksService = new Google\Service\AIPlatformNotebooks(...);
29 *   $executions = $notebooksService->executions;
30 *  </code>
31 */
32class ProjectsLocationsExecutions extends \Google\Service\Resource
33{
34  /**
35   * Creates a new Execution in a given project and location. (executions.create)
36   *
37   * @param string $parent Required. Format:
38   * `parent=projects/{project_id}/locations/{location}`
39   * @param Execution $postBody
40   * @param array $optParams Optional parameters.
41   *
42   * @opt_param string executionId Required. User-defined unique ID of this
43   * execution.
44   * @return Operation
45   */
46  public function create($parent, Execution $postBody, $optParams = [])
47  {
48    $params = ['parent' => $parent, 'postBody' => $postBody];
49    $params = array_merge($params, $optParams);
50    return $this->call('create', [$params], Operation::class);
51  }
52  /**
53   * Deletes execution (executions.delete)
54   *
55   * @param string $name Required. Format:
56   * `projects/{project_id}/locations/{location}/executions/{execution_id}`
57   * @param array $optParams Optional parameters.
58   * @return Operation
59   */
60  public function delete($name, $optParams = [])
61  {
62    $params = ['name' => $name];
63    $params = array_merge($params, $optParams);
64    return $this->call('delete', [$params], Operation::class);
65  }
66  /**
67   * Gets details of executions (executions.get)
68   *
69   * @param string $name Required. Format:
70   * `projects/{project_id}/locations/{location}/executions/{execution_id}`
71   * @param array $optParams Optional parameters.
72   * @return Execution
73   */
74  public function get($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('get', [$params], Execution::class);
79  }
80  /**
81   * Lists executions in a given project and location
82   * (executions.listProjectsLocationsExecutions)
83   *
84   * @param string $parent Required. Format:
85   * `parent=projects/{project_id}/locations/{location}`
86   * @param array $optParams Optional parameters.
87   *
88   * @opt_param string filter Filter applied to resulting executions. Currently
89   * only supports filtering executions by a specified schedule_id. Format:
90   * `schedule_id=`
91   * @opt_param string orderBy Sort by field.
92   * @opt_param int pageSize Maximum return size of the list call.
93   * @opt_param string pageToken A previous returned page token that can be used
94   * to continue listing from the last result.
95   * @return ListExecutionsResponse
96   */
97  public function listProjectsLocationsExecutions($parent, $optParams = [])
98  {
99    $params = ['parent' => $parent];
100    $params = array_merge($params, $optParams);
101    return $this->call('list', [$params], ListExecutionsResponse::class);
102  }
103}
104
105// Adding a class alias for backwards compatibility with the previous class name.
106class_alias(ProjectsLocationsExecutions::class, 'Google_Service_AIPlatformNotebooks_Resource_ProjectsLocationsExecutions');
107