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\BackupforGKE\Resource;
19
20use Google\Service\BackupforGKE\ListVolumeRestoresResponse;
21use Google\Service\BackupforGKE\Policy;
22use Google\Service\BackupforGKE\SetIamPolicyRequest;
23use Google\Service\BackupforGKE\TestIamPermissionsRequest;
24use Google\Service\BackupforGKE\TestIamPermissionsResponse;
25use Google\Service\BackupforGKE\VolumeRestore;
26
27/**
28 * The "volumeRestores" collection of methods.
29 * Typical usage is:
30 *  <code>
31 *   $gkebackupService = new Google\Service\BackupforGKE(...);
32 *   $volumeRestores = $gkebackupService->volumeRestores;
33 *  </code>
34 */
35class ProjectsLocationsRestorePlansRestoresVolumeRestores extends \Google\Service\Resource
36{
37  /**
38   * Retrieve the details of a single VolumeRestore. (volumeRestores.get)
39   *
40   * @param string $name Required. Full name of the VolumeRestore resource.
41   * Format: projects/{project}/locations/{location}/restorePlans/{restore_plan}/r
42   * estores/{restore}/volumeRestores/{volume_restore}
43   * @param array $optParams Optional parameters.
44   * @return VolumeRestore
45   */
46  public function get($name, $optParams = [])
47  {
48    $params = ['name' => $name];
49    $params = array_merge($params, $optParams);
50    return $this->call('get', [$params], VolumeRestore::class);
51  }
52  /**
53   * Gets the access control policy for a resource. Returns an empty policy if the
54   * resource exists and does not have a policy set. (volumeRestores.getIamPolicy)
55   *
56   * @param string $resource REQUIRED: The resource for which the policy is being
57   * requested. See the operation documentation for the appropriate value for this
58   * field.
59   * @param array $optParams Optional parameters.
60   *
61   * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
62   * version that will be used to format the policy. Valid values are 0, 1, and 3.
63   * Requests specifying an invalid value will be rejected. Requests for policies
64   * with any conditional role bindings must specify version 3. Policies with no
65   * conditional role bindings may specify any valid value or leave the field
66   * unset. The policy in the response might use the policy version that you
67   * specified, or it might use a lower policy version. For example, if you
68   * specify version 3, but the policy has no conditional role bindings, the
69   * response uses version 1. To learn which resources support conditions in their
70   * IAM policies, see the [IAM
71   * documentation](https://cloud.google.com/iam/help/conditions/resource-
72   * policies).
73   * @return Policy
74   */
75  public function getIamPolicy($resource, $optParams = [])
76  {
77    $params = ['resource' => $resource];
78    $params = array_merge($params, $optParams);
79    return $this->call('getIamPolicy', [$params], Policy::class);
80  }
81  /**
82   * Lists the VolumeRestores for a given Restore.
83   * (volumeRestores.listProjectsLocationsRestorePlansRestoresVolumeRestores)
84   *
85   * @param string $parent Required. The Restore that contains the VolumeRestores
86   * to list. Format: projects/{project}/locations/{location}/restorePlans/{restor
87   * e_plan}/restores/{restore}
88   * @param array $optParams Optional parameters.
89   *
90   * @opt_param string filter List filter.
91   * @opt_param string orderBy Sort results.
92   * @opt_param int pageSize The target number of results to return in a single
93   * response. If not specified, a default value will be chosen by the service.
94   * Note that the response may inclue a partial list and a caller should only
95   * rely on the response's next_page_token to determine if there are more
96   * instances left to be queried.
97   * @opt_param string pageToken The value of next_page_token received from a
98   * previous `ListVolumeRestores` call. Provide this to retrieve the subsequent
99   * page in a multi-page list of results. When paginating, all other parameters
100   * provided to `ListVolumeRestores` must match the call that provided the page
101   * token.
102   * @return ListVolumeRestoresResponse
103   */
104  public function listProjectsLocationsRestorePlansRestoresVolumeRestores($parent, $optParams = [])
105  {
106    $params = ['parent' => $parent];
107    $params = array_merge($params, $optParams);
108    return $this->call('list', [$params], ListVolumeRestoresResponse::class);
109  }
110  /**
111   * Sets the access control policy on the specified resource. Replaces any
112   * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
113   * `PERMISSION_DENIED` errors. (volumeRestores.setIamPolicy)
114   *
115   * @param string $resource REQUIRED: The resource for which the policy is being
116   * specified. See the operation documentation for the appropriate value for this
117   * field.
118   * @param SetIamPolicyRequest $postBody
119   * @param array $optParams Optional parameters.
120   * @return Policy
121   */
122  public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
123  {
124    $params = ['resource' => $resource, 'postBody' => $postBody];
125    $params = array_merge($params, $optParams);
126    return $this->call('setIamPolicy', [$params], Policy::class);
127  }
128  /**
129   * Returns permissions that a caller has on the specified resource. If the
130   * resource does not exist, this will return an empty set of permissions, not a
131   * `NOT_FOUND` error. Note: This operation is designed to be used for building
132   * permission-aware UIs and command-line tools, not for authorization checking.
133   * This operation may "fail open" without warning.
134   * (volumeRestores.testIamPermissions)
135   *
136   * @param string $resource REQUIRED: The resource for which the policy detail is
137   * being requested. See the operation documentation for the appropriate value
138   * for this field.
139   * @param TestIamPermissionsRequest $postBody
140   * @param array $optParams Optional parameters.
141   * @return TestIamPermissionsResponse
142   */
143  public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
144  {
145    $params = ['resource' => $resource, 'postBody' => $postBody];
146    $params = array_merge($params, $optParams);
147    return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
148  }
149}
150
151// Adding a class alias for backwards compatibility with the previous class name.
152class_alias(ProjectsLocationsRestorePlansRestoresVolumeRestores::class, 'Google_Service_BackupforGKE_Resource_ProjectsLocationsRestorePlansRestoresVolumeRestores');
153