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\CloudLifeSciences\Resource;
19
20use Google\Service\CloudLifeSciences\CancelOperationRequest;
21use Google\Service\CloudLifeSciences\LifesciencesEmpty;
22use Google\Service\CloudLifeSciences\ListOperationsResponse;
23use Google\Service\CloudLifeSciences\Operation;
24
25/**
26 * The "operations" collection of methods.
27 * Typical usage is:
28 *  <code>
29 *   $lifesciencesService = new Google\Service\CloudLifeSciences(...);
30 *   $operations = $lifesciencesService->operations;
31 *  </code>
32 */
33class ProjectsLocationsOperations extends \Google\Service\Resource
34{
35  /**
36   * Starts asynchronous cancellation on a long-running operation. The server
37   * makes a best effort to cancel the operation, but success is not guaranteed.
38   * Clients may use Operations.GetOperation or Operations.ListOperations to check
39   * whether the cancellation succeeded or the operation completed despite
40   * cancellation. Authorization requires the following [Google
41   * IAM](https://cloud.google.com/iam) permission: *
42   * `lifesciences.operations.cancel` (operations.cancel)
43   *
44   * @param string $name The name of the operation resource to be cancelled.
45   * @param CancelOperationRequest $postBody
46   * @param array $optParams Optional parameters.
47   * @return LifesciencesEmpty
48   */
49  public function cancel($name, CancelOperationRequest $postBody, $optParams = [])
50  {
51    $params = ['name' => $name, 'postBody' => $postBody];
52    $params = array_merge($params, $optParams);
53    return $this->call('cancel', [$params], LifesciencesEmpty::class);
54  }
55  /**
56   * Gets the latest state of a long-running operation. Clients can use this
57   * method to poll the operation result at intervals as recommended by the API
58   * service. Authorization requires the following [Google
59   * IAM](https://cloud.google.com/iam) permission: *
60   * `lifesciences.operations.get` (operations.get)
61   *
62   * @param string $name The name of the operation resource.
63   * @param array $optParams Optional parameters.
64   * @return Operation
65   */
66  public function get($name, $optParams = [])
67  {
68    $params = ['name' => $name];
69    $params = array_merge($params, $optParams);
70    return $this->call('get', [$params], Operation::class);
71  }
72  /**
73   * Lists operations that match the specified filter in the request.
74   * Authorization requires the following [Google
75   * IAM](https://cloud.google.com/iam) permission: *
76   * `lifesciences.operations.list` (operations.listProjectsLocationsOperations)
77   *
78   * @param string $name The name of the operation's parent resource.
79   * @param array $optParams Optional parameters.
80   *
81   * @opt_param string filter A string for filtering Operations. The following
82   * filter fields are supported: * createTime: The time this job was created *
83   * events: The set of event (names) that have occurred while running the
84   * pipeline. The : operator can be used to determine if a particular event has
85   * occurred. * error: If the pipeline is running, this value is NULL. Once the
86   * pipeline finishes, the value is the standard Google error code. * labels.key
87   * or labels."key with space" where key is a label key. * done: If the pipeline
88   * is running, this value is false. Once the pipeline finishes, the value is
89   * true.
90   * @opt_param int pageSize The maximum number of results to return. The maximum
91   * value is 256.
92   * @opt_param string pageToken The standard list page token.
93   * @return ListOperationsResponse
94   */
95  public function listProjectsLocationsOperations($name, $optParams = [])
96  {
97    $params = ['name' => $name];
98    $params = array_merge($params, $optParams);
99    return $this->call('list', [$params], ListOperationsResponse::class);
100  }
101}
102
103// Adding a class alias for backwards compatibility with the previous class name.
104class_alias(ProjectsLocationsOperations::class, 'Google_Service_CloudLifeSciences_Resource_ProjectsLocationsOperations');
105