[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\CloudFilestore\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\CloudFilestore\Backup;
|
---|
| 21 | use Google\Service\CloudFilestore\ListBackupsResponse;
|
---|
| 22 | use Google\Service\CloudFilestore\Operation;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "backups" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $fileService = new Google\Service\CloudFilestore(...);
|
---|
| 29 | * $backups = $fileService->projects_locations_backups;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsBackups extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a backup. (backups.create)
|
---|
| 36 | *
|
---|
| 37 | * @param string $parent Required. The backup's project and location, in the
|
---|
| 38 | * format `projects/{project_number}/locations/{location}`. In Filestore, backup
|
---|
| 39 | * locations map to Google Cloud regions, for example **us-west1**.
|
---|
| 40 | * @param Backup $postBody
|
---|
| 41 | * @param array $optParams Optional parameters.
|
---|
| 42 | *
|
---|
| 43 | * @opt_param string backupId Required. The ID to use for the backup. The ID
|
---|
| 44 | * must be unique within the specified project and location. This value must
|
---|
| 45 | * start with a lowercase letter followed by up to 62 lowercase letters,
|
---|
| 46 | * numbers, or hyphens, and cannot end with a hyphen. Values that do not match
|
---|
| 47 | * this pattern will trigger an INVALID_ARGUMENT error.
|
---|
| 48 | * @return Operation
|
---|
| 49 | * @throws \Google\Service\Exception
|
---|
| 50 | */
|
---|
| 51 | public function create($parent, Backup $postBody, $optParams = [])
|
---|
| 52 | {
|
---|
| 53 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 54 | $params = array_merge($params, $optParams);
|
---|
| 55 | return $this->call('create', [$params], Operation::class);
|
---|
| 56 | }
|
---|
| 57 | /**
|
---|
| 58 | * Deletes a backup. (backups.delete)
|
---|
| 59 | *
|
---|
| 60 | * @param string $name Required. The backup resource name, in the format
|
---|
| 61 | * `projects/{project_number}/locations/{location}/backups/{backup_id}`
|
---|
| 62 | * @param array $optParams Optional parameters.
|
---|
| 63 | * @return Operation
|
---|
| 64 | * @throws \Google\Service\Exception
|
---|
| 65 | */
|
---|
| 66 | public function delete($name, $optParams = [])
|
---|
| 67 | {
|
---|
| 68 | $params = ['name' => $name];
|
---|
| 69 | $params = array_merge($params, $optParams);
|
---|
| 70 | return $this->call('delete', [$params], Operation::class);
|
---|
| 71 | }
|
---|
| 72 | /**
|
---|
| 73 | * Gets the details of a specific backup. (backups.get)
|
---|
| 74 | *
|
---|
| 75 | * @param string $name Required. The backup resource name, in the format
|
---|
| 76 | * `projects/{project_number}/locations/{location}/backups/{backup_id}`.
|
---|
| 77 | * @param array $optParams Optional parameters.
|
---|
| 78 | * @return Backup
|
---|
| 79 | * @throws \Google\Service\Exception
|
---|
| 80 | */
|
---|
| 81 | public function get($name, $optParams = [])
|
---|
| 82 | {
|
---|
| 83 | $params = ['name' => $name];
|
---|
| 84 | $params = array_merge($params, $optParams);
|
---|
| 85 | return $this->call('get', [$params], Backup::class);
|
---|
| 86 | }
|
---|
| 87 | /**
|
---|
| 88 | * Lists all backups in a project for either a specified location or for all
|
---|
| 89 | * locations. (backups.listProjectsLocationsBackups)
|
---|
| 90 | *
|
---|
| 91 | * @param string $parent Required. The project and location for which to
|
---|
| 92 | * retrieve backup information, in the format
|
---|
| 93 | * `projects/{project_number}/locations/{location}`. In Filestore, backup
|
---|
| 94 | * locations map to Google Cloud regions, for example **us-west1**. To retrieve
|
---|
| 95 | * backup information for all locations, use "-" for the `{location}` value.
|
---|
| 96 | * @param array $optParams Optional parameters.
|
---|
| 97 | *
|
---|
| 98 | * @opt_param string filter List filter.
|
---|
| 99 | * @opt_param string orderBy Sort results. Supported values are "name", "name
|
---|
| 100 | * desc" or "" (unsorted).
|
---|
| 101 | * @opt_param int pageSize The maximum number of items to return.
|
---|
| 102 | * @opt_param string pageToken The next_page_token value to use if there are
|
---|
| 103 | * additional results to retrieve for this list request.
|
---|
| 104 | * @return ListBackupsResponse
|
---|
| 105 | * @throws \Google\Service\Exception
|
---|
| 106 | */
|
---|
| 107 | public function listProjectsLocationsBackups($parent, $optParams = [])
|
---|
| 108 | {
|
---|
| 109 | $params = ['parent' => $parent];
|
---|
| 110 | $params = array_merge($params, $optParams);
|
---|
| 111 | return $this->call('list', [$params], ListBackupsResponse::class);
|
---|
| 112 | }
|
---|
| 113 | /**
|
---|
| 114 | * Updates the settings of a specific backup. (backups.patch)
|
---|
| 115 | *
|
---|
| 116 | * @param string $name Output only. The resource name of the backup, in the
|
---|
| 117 | * format
|
---|
| 118 | * `projects/{project_number}/locations/{location_id}/backups/{backup_id}`.
|
---|
| 119 | * @param Backup $postBody
|
---|
| 120 | * @param array $optParams Optional parameters.
|
---|
| 121 | *
|
---|
| 122 | * @opt_param string updateMask Required. Mask of fields to update. At least one
|
---|
| 123 | * path must be supplied in this field.
|
---|
| 124 | * @return Operation
|
---|
| 125 | * @throws \Google\Service\Exception
|
---|
| 126 | */
|
---|
| 127 | public function patch($name, Backup $postBody, $optParams = [])
|
---|
| 128 | {
|
---|
| 129 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 130 | $params = array_merge($params, $optParams);
|
---|
| 131 | return $this->call('patch', [$params], Operation::class);
|
---|
| 132 | }
|
---|
| 133 | }
|
---|
| 134 |
|
---|
| 135 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 136 | class_alias(ProjectsLocationsBackups::class, 'Google_Service_CloudFilestore_Resource_ProjectsLocationsBackups');
|
---|