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\SQLAdmin\Resource;
19
20use Google\Service\SQLAdmin\Operation;
21use Google\Service\SQLAdmin\OperationsListResponse;
22
23/**
24 * The "operations" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $sqladminService = new Google\Service\SQLAdmin(...);
28 *   $operations = $sqladminService->operations;
29 *  </code>
30 */
31class Operations extends \Google\Service\Resource
32{
33  /**
34   * Retrieves an instance operation that has been performed on an instance.
35   * (operations.get)
36   *
37   * @param string $project Project ID of the project that contains the instance.
38   * @param string $operation Instance operation ID.
39   * @param array $optParams Optional parameters.
40   * @return Operation
41   */
42  public function get($project, $operation, $optParams = [])
43  {
44    $params = ['project' => $project, 'operation' => $operation];
45    $params = array_merge($params, $optParams);
46    return $this->call('get', [$params], Operation::class);
47  }
48  /**
49   * Lists all instance operations that have been performed on the given Cloud SQL
50   * instance in the reverse chronological order of the start time.
51   * (operations.listOperations)
52   *
53   * @param string $project Project ID of the project that contains the instance.
54   * @param array $optParams Optional parameters.
55   *
56   * @opt_param string instance Cloud SQL instance ID. This does not include the
57   * project ID.
58   * @opt_param string maxResults Maximum number of operations per response.
59   * @opt_param string pageToken A previously-returned page token representing
60   * part of the larger set of results to view.
61   * @return OperationsListResponse
62   */
63  public function listOperations($project, $optParams = [])
64  {
65    $params = ['project' => $project];
66    $params = array_merge($params, $optParams);
67    return $this->call('list', [$params], OperationsListResponse::class);
68  }
69}
70
71// Adding a class alias for backwards compatibility with the previous class name.
72class_alias(Operations::class, 'Google_Service_SQLAdmin_Resource_Operations');
73