[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\Backupdr\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Backupdr\Backup;
|
---|
| 21 | use Google\Service\Backupdr\ListBackupsResponse;
|
---|
| 22 | use Google\Service\Backupdr\Operation;
|
---|
| 23 | use Google\Service\Backupdr\RestoreBackupRequest;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "backups" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $backupdrService = new Google\Service\Backupdr(...);
|
---|
| 30 | * $backups = $backupdrService->projects_locations_backupVaults_dataSources_backups;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class ProjectsLocationsBackupVaultsDataSourcesBackups extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * Deletes a Backup. (backups.delete)
|
---|
| 37 | *
|
---|
| 38 | * @param string $name Required. Name of the resource.
|
---|
| 39 | * @param array $optParams Optional parameters.
|
---|
| 40 | *
|
---|
| 41 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 42 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 43 | * the server will know to ignore the request if it has already been completed.
|
---|
| 44 | * The server will guarantee that for at least 60 minutes after the first
|
---|
| 45 | * request. For example, consider a situation where you make an initial request
|
---|
| 46 | * and the request times out. If you make the request again with the same
|
---|
| 47 | * request ID, the server can check if original operation with the same request
|
---|
| 48 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 49 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 50 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 51 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 52 | * @return Operation
|
---|
| 53 | * @throws \Google\Service\Exception
|
---|
| 54 | */
|
---|
| 55 | public function delete($name, $optParams = [])
|
---|
| 56 | {
|
---|
| 57 | $params = ['name' => $name];
|
---|
| 58 | $params = array_merge($params, $optParams);
|
---|
| 59 | return $this->call('delete', [$params], Operation::class);
|
---|
| 60 | }
|
---|
| 61 | /**
|
---|
| 62 | * Gets details of a Backup. (backups.get)
|
---|
| 63 | *
|
---|
| 64 | * @param string $name Required. Name of the data source resource name, in the
|
---|
| 65 | * format 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}
|
---|
| 66 | * /dataSources/{datasource}/backups/{backup}'
|
---|
| 67 | * @param array $optParams Optional parameters.
|
---|
| 68 | *
|
---|
| 69 | * @opt_param string view Optional. Reserved for future use to provide a BASIC &
|
---|
| 70 | * FULL view of Backup resource.
|
---|
| 71 | * @return Backup
|
---|
| 72 | * @throws \Google\Service\Exception
|
---|
| 73 | */
|
---|
| 74 | public function get($name, $optParams = [])
|
---|
| 75 | {
|
---|
| 76 | $params = ['name' => $name];
|
---|
| 77 | $params = array_merge($params, $optParams);
|
---|
| 78 | return $this->call('get', [$params], Backup::class);
|
---|
| 79 | }
|
---|
| 80 | /**
|
---|
| 81 | * Lists Backups in a given project and location.
|
---|
| 82 | * (backups.listProjectsLocationsBackupVaultsDataSourcesBackups)
|
---|
| 83 | *
|
---|
| 84 | * @param string $parent Required. The project and location for which to
|
---|
| 85 | * retrieve backup information, in the format
|
---|
| 86 | * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR,
|
---|
| 87 | * locations map to Google Cloud regions, for example **us-central1**. To
|
---|
| 88 | * retrieve data sources for all locations, use "-" for the '{location}' value.
|
---|
| 89 | * @param array $optParams Optional parameters.
|
---|
| 90 | *
|
---|
| 91 | * @opt_param string filter Optional. Filtering results.
|
---|
| 92 | * @opt_param string orderBy Optional. Hint for how to order the results.
|
---|
| 93 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
| 94 | * fewer items than requested. If unspecified, server will pick an appropriate
|
---|
| 95 | * default.
|
---|
| 96 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
| 97 | * the server should return.
|
---|
| 98 | * @opt_param string view Optional. Reserved for future use to provide a BASIC &
|
---|
| 99 | * FULL view of Backup resource.
|
---|
| 100 | * @return ListBackupsResponse
|
---|
| 101 | * @throws \Google\Service\Exception
|
---|
| 102 | */
|
---|
| 103 | public function listProjectsLocationsBackupVaultsDataSourcesBackups($parent, $optParams = [])
|
---|
| 104 | {
|
---|
| 105 | $params = ['parent' => $parent];
|
---|
| 106 | $params = array_merge($params, $optParams);
|
---|
| 107 | return $this->call('list', [$params], ListBackupsResponse::class);
|
---|
| 108 | }
|
---|
| 109 | /**
|
---|
| 110 | * Updates the settings of a Backup. (backups.patch)
|
---|
| 111 | *
|
---|
| 112 | * @param string $name Output only. Identifier. Name of the backup to create. It
|
---|
| 113 | * must have the format`"projects//locations//backupVaults//dataSources/{datasou
|
---|
| 114 | * rce}/backups/{backup}"`. `{backup}` cannot be changed after creation. It must
|
---|
| 115 | * be between 3-63 characters long and must be unique within the datasource.
|
---|
| 116 | * @param Backup $postBody
|
---|
| 117 | * @param array $optParams Optional parameters.
|
---|
| 118 | *
|
---|
| 119 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 120 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 121 | * the server will know to ignore the request if it has already been completed.
|
---|
| 122 | * The server will guarantee that for at least 60 minutes since the first
|
---|
| 123 | * request. For example, consider a situation where you make an initial request
|
---|
| 124 | * and the request times out. If you make the request again with the same
|
---|
| 125 | * request ID, the server can check if original operation with the same request
|
---|
| 126 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
| 127 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
| 128 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
| 129 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 130 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
| 131 | * fields to be overwritten in the Backup resource by the update. The fields
|
---|
| 132 | * specified in the update_mask are relative to the resource, not the full
|
---|
| 133 | * request. A field will be overwritten if it is in the mask. If the user does
|
---|
| 134 | * not provide a mask then the request will fail.
|
---|
| 135 | * @return Operation
|
---|
| 136 | * @throws \Google\Service\Exception
|
---|
| 137 | */
|
---|
| 138 | public function patch($name, Backup $postBody, $optParams = [])
|
---|
| 139 | {
|
---|
| 140 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 141 | $params = array_merge($params, $optParams);
|
---|
| 142 | return $this->call('patch', [$params], Operation::class);
|
---|
| 143 | }
|
---|
| 144 | /**
|
---|
| 145 | * Restore from a Backup (backups.restore)
|
---|
| 146 | *
|
---|
| 147 | * @param string $name Required. The resource name of the Backup instance, in
|
---|
| 148 | * the format 'projects/locations/backupVaults/dataSources/backups/'.
|
---|
| 149 | * @param RestoreBackupRequest $postBody
|
---|
| 150 | * @param array $optParams Optional parameters.
|
---|
| 151 | * @return Operation
|
---|
| 152 | * @throws \Google\Service\Exception
|
---|
| 153 | */
|
---|
| 154 | public function restore($name, RestoreBackupRequest $postBody, $optParams = [])
|
---|
| 155 | {
|
---|
| 156 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 157 | $params = array_merge($params, $optParams);
|
---|
| 158 | return $this->call('restore', [$params], Operation::class);
|
---|
| 159 | }
|
---|
| 160 | }
|
---|
| 161 |
|
---|
| 162 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 163 | class_alias(ProjectsLocationsBackupVaultsDataSourcesBackups::class, 'Google_Service_Backupdr_Resource_ProjectsLocationsBackupVaultsDataSourcesBackups');
|
---|