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\Baremetalsolution\Resource; 19 20use Google\Service\Baremetalsolution\BaremetalsolutionEmpty; 21use Google\Service\Baremetalsolution\ListVolumeSnapshotsResponse; 22use Google\Service\Baremetalsolution\Operation; 23use Google\Service\Baremetalsolution\RestoreVolumeSnapshotRequest; 24use Google\Service\Baremetalsolution\VolumeSnapshot; 25 26/** 27 * The "snapshots" collection of methods. 28 * Typical usage is: 29 * <code> 30 * $baremetalsolutionService = new Google\Service\Baremetalsolution(...); 31 * $snapshots = $baremetalsolutionService->snapshots; 32 * </code> 33 */ 34class ProjectsLocationsVolumesSnapshots extends \Google\Service\Resource 35{ 36 /** 37 * Create a storage volume snapshot in a containing volume. (snapshots.create) 38 * 39 * @param string $parent Required. The volume to snapshot. 40 * @param VolumeSnapshot $postBody 41 * @param array $optParams Optional parameters. 42 * @return VolumeSnapshot 43 */ 44 public function create($parent, VolumeSnapshot $postBody, $optParams = []) 45 { 46 $params = ['parent' => $parent, 'postBody' => $postBody]; 47 $params = array_merge($params, $optParams); 48 return $this->call('create', [$params], VolumeSnapshot::class); 49 } 50 /** 51 * Deletes a storage volume snapshot for a given volume. (snapshots.delete) 52 * 53 * @param string $name Required. The name of the snapshot to delete. 54 * @param array $optParams Optional parameters. 55 * @return BaremetalsolutionEmpty 56 */ 57 public function delete($name, $optParams = []) 58 { 59 $params = ['name' => $name]; 60 $params = array_merge($params, $optParams); 61 return $this->call('delete', [$params], BaremetalsolutionEmpty::class); 62 } 63 /** 64 * Get details of a single storage volume snapshot. (snapshots.get) 65 * 66 * @param string $name Required. Name of the resource. 67 * @param array $optParams Optional parameters. 68 * @return VolumeSnapshot 69 */ 70 public function get($name, $optParams = []) 71 { 72 $params = ['name' => $name]; 73 $params = array_merge($params, $optParams); 74 return $this->call('get', [$params], VolumeSnapshot::class); 75 } 76 /** 77 * List storage volume snapshots for given storage volume. 78 * (snapshots.listProjectsLocationsVolumesSnapshots) 79 * 80 * @param string $parent Required. Parent value for ListVolumesRequest. 81 * @param array $optParams Optional parameters. 82 * 83 * @opt_param int pageSize Requested page size. The server might return fewer 84 * items than requested. If unspecified, server will pick an appropriate 85 * default. 86 * @opt_param string pageToken A token identifying a page of results from the 87 * server. 88 * @return ListVolumeSnapshotsResponse 89 */ 90 public function listProjectsLocationsVolumesSnapshots($parent, $optParams = []) 91 { 92 $params = ['parent' => $parent]; 93 $params = array_merge($params, $optParams); 94 return $this->call('list', [$params], ListVolumeSnapshotsResponse::class); 95 } 96 /** 97 * Restore a storage volume snapshot to its containing volume. 98 * (snapshots.restoreVolumeSnapshot) 99 * 100 * @param string $volumeSnapshot Required. Name of the resource. 101 * @param RestoreVolumeSnapshotRequest $postBody 102 * @param array $optParams Optional parameters. 103 * @return Operation 104 */ 105 public function restoreVolumeSnapshot($volumeSnapshot, RestoreVolumeSnapshotRequest $postBody, $optParams = []) 106 { 107 $params = ['volumeSnapshot' => $volumeSnapshot, 'postBody' => $postBody]; 108 $params = array_merge($params, $optParams); 109 return $this->call('restoreVolumeSnapshot', [$params], Operation::class); 110 } 111} 112 113// Adding a class alias for backwards compatibility with the previous class name. 114class_alias(ProjectsLocationsVolumesSnapshots::class, 'Google_Service_Baremetalsolution_Resource_ProjectsLocationsVolumesSnapshots'); 115