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\Spanner\Resource;
19
20use Google\Service\Spanner\ListDatabaseOperationsResponse;
21
22/**
23 * The "databaseOperations" collection of methods.
24 * Typical usage is:
25 *  <code>
26 *   $spannerService = new Google\Service\Spanner(...);
27 *   $databaseOperations = $spannerService->databaseOperations;
28 *  </code>
29 */
30class ProjectsInstancesDatabaseOperations extends \Google\Service\Resource
31{
32  /**
33   * Lists database longrunning-operations. A database operation has a name of the
34   * form `projects//instances//databases//operations/`. The long-running
35   * operation metadata field type `metadata.type_url` describes the type of the
36   * metadata. Operations returned include those that have
37   * completed/failed/canceled within the last 7 days, and pending operations.
38   * (databaseOperations.listProjectsInstancesDatabaseOperations)
39   *
40   * @param string $parent Required. The instance of the database operations.
41   * Values are of the form `projects//instances/`.
42   * @param array $optParams Optional parameters.
43   *
44   * @opt_param string filter An expression that filters the list of returned
45   * operations. A filter expression consists of a field name, a comparison
46   * operator, and a value for filtering. The value must be a string, a number, or
47   * a boolean. The comparison operator must be one of: `<`, `>`, `<=`, `>=`,
48   * `!=`, `=`, or `:`. Colon `:` is the contains operator. Filter rules are not
49   * case sensitive. The following fields in the Operation are eligible for
50   * filtering: * `name` - The name of the long-running operation * `done` - False
51   * if the operation is in progress, else true. * `metadata.@type` - the type of
52   * metadata. For example, the type string for RestoreDatabaseMetadata is `type.g
53   * oogleapis.com/google.spanner.admin.database.v1.RestoreDatabaseMetadata`. *
54   * `metadata.` - any field in metadata.value. `metadata.@type` must be specified
55   * first, if filtering on metadata fields. * `error` - Error associated with the
56   * long-running operation. * `response.@type` - the type of response. *
57   * `response.` - any field in response.value. You can combine multiple
58   * expressions by enclosing each expression in parentheses. By default,
59   * expressions are combined with AND logic. However, you can specify AND, OR,
60   * and NOT logic explicitly. Here are a few examples: * `done:true` - The
61   * operation is complete. * `(metadata.@type=type.googleapis.com/google.spanner.
62   * admin.database.v1.RestoreDatabaseMetadata) AND` \
63   * `(metadata.source_type:BACKUP) AND` \
64   * `(metadata.backup_info.backup:backup_howl) AND` \
65   * `(metadata.name:restored_howl) AND` \ `(metadata.progress.start_time <
66   * \"2018-03-28T14:50:00Z\") AND` \ `(error:*)` - Return operations where: * The
67   * operation's metadata type is RestoreDatabaseMetadata. * The database is
68   * restored from a backup. * The backup name contains "backup_howl". * The
69   * restored database's name contains "restored_howl". * The operation started
70   * before 2018-03-28T14:50:00Z. * The operation resulted in an error.
71   * @opt_param int pageSize Number of operations to be returned in the response.
72   * If 0 or less, defaults to the server's maximum allowed page size.
73   * @opt_param string pageToken If non-empty, `page_token` should contain a
74   * next_page_token from a previous ListDatabaseOperationsResponse to the same
75   * `parent` and with the same `filter`.
76   * @return ListDatabaseOperationsResponse
77   */
78  public function listProjectsInstancesDatabaseOperations($parent, $optParams = [])
79  {
80    $params = ['parent' => $parent];
81    $params = array_merge($params, $optParams);
82    return $this->call('list', [$params], ListDatabaseOperationsResponse::class);
83  }
84}
85
86// Adding a class alias for backwards compatibility with the previous class name.
87class_alias(ProjectsInstancesDatabaseOperations::class, 'Google_Service_Spanner_Resource_ProjectsInstancesDatabaseOperations');
88