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\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Resource;
19
20use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Backup;
21use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\ListBackupsResponse;
22use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Operation;
23use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\Policy;
24use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\SetIamPolicyRequest;
25use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\TestIamPermissionsRequest;
26use Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI\TestIamPermissionsResponse;
27
28/**
29 * The "backups" collection of methods.
30 * Typical usage is:
31 *  <code>
32 *   $managedidentitiesService = new Google\Service\ManagedServiceforMicrosoftActiveDirectoryConsumerAPI(...);
33 *   $backups = $managedidentitiesService->backups;
34 *  </code>
35 */
36class ProjectsLocationsManagedidentitiesGlobalDomainsBackups extends \Google\Service\Resource
37{
38  /**
39   * Creates a Backup for a domain. (backups.create)
40   *
41   * @param string $parent Required. The domain resource name using the form:
42   * `projects/{project_id}/locations/global/domains/{domain_name}`
43   * @param Backup $postBody
44   * @param array $optParams Optional parameters.
45   *
46   * @opt_param string backupId Required. Backup Id, unique name to identify the
47   * backups with the following restrictions: * Must be lowercase letters,
48   * numbers, and hyphens * Must start with a letter. * Must contain between 1-63
49   * characters. * Must end with a number or a letter. * Must be unique within the
50   * domain.
51   * @return Operation
52   */
53  public function create($parent, Backup $postBody, $optParams = [])
54  {
55    $params = ['parent' => $parent, 'postBody' => $postBody];
56    $params = array_merge($params, $optParams);
57    return $this->call('create', [$params], Operation::class);
58  }
59  /**
60   * Deletes identified Backup. (backups.delete)
61   *
62   * @param string $name Required. The backup resource name using the form: `proje
63   * cts/{project_id}/locations/global/domains/{domain_name}/backups/{backup_id}`
64   * @param array $optParams Optional parameters.
65   * @return Operation
66   */
67  public function delete($name, $optParams = [])
68  {
69    $params = ['name' => $name];
70    $params = array_merge($params, $optParams);
71    return $this->call('delete', [$params], Operation::class);
72  }
73  /**
74   * Gets details of a single Backup. (backups.get)
75   *
76   * @param string $name Required. The backup resource name using the form: `proje
77   * cts/{project_id}/locations/global/domains/{domain_name}/backups/{backup_id}`
78   * @param array $optParams Optional parameters.
79   * @return Backup
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   * Gets the access control policy for a resource. Returns an empty policy if the
89   * resource exists and does not have a policy set. (backups.getIamPolicy)
90   *
91   * @param string $resource REQUIRED: The resource for which the policy is being
92   * requested. See the operation documentation for the appropriate value for this
93   * field.
94   * @param array $optParams Optional parameters.
95   *
96   * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
97   * version that will be used to format the policy. Valid values are 0, 1, and 3.
98   * Requests specifying an invalid value will be rejected. Requests for policies
99   * with any conditional role bindings must specify version 3. Policies with no
100   * conditional role bindings may specify any valid value or leave the field
101   * unset. The policy in the response might use the policy version that you
102   * specified, or it might use a lower policy version. For example, if you
103   * specify version 3, but the policy has no conditional role bindings, the
104   * response uses version 1. To learn which resources support conditions in their
105   * IAM policies, see the [IAM
106   * documentation](https://cloud.google.com/iam/help/conditions/resource-
107   * policies).
108   * @return Policy
109   */
110  public function getIamPolicy($resource, $optParams = [])
111  {
112    $params = ['resource' => $resource];
113    $params = array_merge($params, $optParams);
114    return $this->call('getIamPolicy', [$params], Policy::class);
115  }
116  /**
117   * Lists Backup in a given project.
118   * (backups.listProjectsLocationsManagedidentitiesGlobalDomainsBackups)
119   *
120   * @param string $parent Required. The domain resource name using the form:
121   * `projects/{project_id}/locations/global/domains/{domain_name}`
122   * @param array $optParams Optional parameters.
123   *
124   * @opt_param string filter Optional. Filter specifying constraints of a list
125   * operation.
126   * @opt_param string orderBy Optional. Specifies the ordering of results
127   * following syntax at
128   * https://cloud.google.com/apis/design/design_patterns#sorting_order.
129   * @opt_param int pageSize Optional. The maximum number of items to return. If
130   * not specified, a default value of 1000 will be used by the service.
131   * Regardless of the page_size value, the response may include a partial list
132   * and a caller should only rely on response's next_page_token to determine if
133   * there are more instances left to be queried.
134   * @opt_param string pageToken Optional. The `next_page_token` value returned
135   * from a previous List request, if any.
136   * @return ListBackupsResponse
137   */
138  public function listProjectsLocationsManagedidentitiesGlobalDomainsBackups($parent, $optParams = [])
139  {
140    $params = ['parent' => $parent];
141    $params = array_merge($params, $optParams);
142    return $this->call('list', [$params], ListBackupsResponse::class);
143  }
144  /**
145   * Updates the labels for specified Backup. (backups.patch)
146   *
147   * @param string $name Output only. The unique name of the Backup in the form of
148   * `projects/{project_id}/locations/global/domains/{domain_name}/backups/{name}`
149   * @param Backup $postBody
150   * @param array $optParams Optional parameters.
151   *
152   * @opt_param string updateMask Required. Mask of fields to update. At least one
153   * path must be supplied in this field. The elements of the repeated paths field
154   * may only include these fields from Backup: * `labels`
155   * @return Operation
156   */
157  public function patch($name, Backup $postBody, $optParams = [])
158  {
159    $params = ['name' => $name, 'postBody' => $postBody];
160    $params = array_merge($params, $optParams);
161    return $this->call('patch', [$params], Operation::class);
162  }
163  /**
164   * Sets the access control policy on the specified resource. Replaces any
165   * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
166   * `PERMISSION_DENIED` errors. (backups.setIamPolicy)
167   *
168   * @param string $resource REQUIRED: The resource for which the policy is being
169   * specified. See the operation documentation for the appropriate value for this
170   * field.
171   * @param SetIamPolicyRequest $postBody
172   * @param array $optParams Optional parameters.
173   * @return Policy
174   */
175  public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
176  {
177    $params = ['resource' => $resource, 'postBody' => $postBody];
178    $params = array_merge($params, $optParams);
179    return $this->call('setIamPolicy', [$params], Policy::class);
180  }
181  /**
182   * Returns permissions that a caller has on the specified resource. If the
183   * resource does not exist, this will return an empty set of permissions, not a
184   * `NOT_FOUND` error. Note: This operation is designed to be used for building
185   * permission-aware UIs and command-line tools, not for authorization checking.
186   * This operation may "fail open" without warning. (backups.testIamPermissions)
187   *
188   * @param string $resource REQUIRED: The resource for which the policy detail is
189   * being requested. See the operation documentation for the appropriate value
190   * for this field.
191   * @param TestIamPermissionsRequest $postBody
192   * @param array $optParams Optional parameters.
193   * @return TestIamPermissionsResponse
194   */
195  public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
196  {
197    $params = ['resource' => $resource, 'postBody' => $postBody];
198    $params = array_merge($params, $optParams);
199    return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
200  }
201}
202
203// Adding a class alias for backwards compatibility with the previous class name.
204class_alias(ProjectsLocationsManagedidentitiesGlobalDomainsBackups::class, 'Google_Service_ManagedServiceforMicrosoftActiveDirectoryConsumerAPI_Resource_ProjectsLocationsManagedidentitiesGlobalDomainsBackups');
205