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\ListSchedulesResponse;
21use Google\Service\AIPlatformNotebooks\Operation;
22use Google\Service\AIPlatformNotebooks\Schedule;
23use Google\Service\AIPlatformNotebooks\TriggerScheduleRequest;
24
25/**
26 * The "schedules" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $notebooksService = new Google\Service\AIPlatformNotebooks(...);
30 *   $schedules = $notebooksService->schedules;
31 *  </code>
32 */
33class ProjectsLocationsSchedules extends \Google\Service\Resource
34{
35  /**
36   * Creates a new Scheduled Notebook in a given project and location.
37   * (schedules.create)
38   *
39   * @param string $parent Required. Format:
40   * `parent=projects/{project_id}/locations/{location}`
41   * @param Schedule $postBody
42   * @param array $optParams Optional parameters.
43   *
44   * @opt_param string scheduleId Required. User-defined unique ID of this
45   * schedule.
46   * @return Operation
47   */
48  public function create($parent, Schedule $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 schedule and all underlying jobs (schedules.delete)
56   *
57   * @param string $name Required. Format:
58   * `projects/{project_id}/locations/{location}/schedules/{schedule_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 schedule (schedules.get)
70   *
71   * @param string $name Required. Format:
72   * `projects/{project_id}/locations/{location}/schedules/{schedule_id}`
73   * @param array $optParams Optional parameters.
74   * @return Schedule
75   */
76  public function get($name, $optParams = [])
77  {
78    $params = ['name' => $name];
79    $params = array_merge($params, $optParams);
80    return $this->call('get', [$params], Schedule::class);
81  }
82  /**
83   * Lists schedules in a given project and location.
84   * (schedules.listProjectsLocationsSchedules)
85   *
86   * @param string $parent Required. Format:
87   * `parent=projects/{project_id}/locations/{location}`
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param string filter Filter applied to resulting schedules.
91   * @opt_param string orderBy Field to order results by.
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 ListSchedulesResponse
96   */
97  public function listProjectsLocationsSchedules($parent, $optParams = [])
98  {
99    $params = ['parent' => $parent];
100    $params = array_merge($params, $optParams);
101    return $this->call('list', [$params], ListSchedulesResponse::class);
102  }
103  /**
104   * Triggers execution of an existing schedule. (schedules.trigger)
105   *
106   * @param string $name Required. Format:
107   * `parent=projects/{project_id}/locations/{location}/schedules/{schedule_id}`
108   * @param TriggerScheduleRequest $postBody
109   * @param array $optParams Optional parameters.
110   * @return Operation
111   */
112  public function trigger($name, TriggerScheduleRequest $postBody, $optParams = [])
113  {
114    $params = ['name' => $name, 'postBody' => $postBody];
115    $params = array_merge($params, $optParams);
116    return $this->call('trigger', [$params], Operation::class);
117  }
118}
119
120// Adding a class alias for backwards compatibility with the previous class name.
121class_alias(ProjectsLocationsSchedules::class, 'Google_Service_AIPlatformNotebooks_Resource_ProjectsLocationsSchedules');
122