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\SASPortalTesting\Resource;
19
20use Google\Service\SASPortalTesting\SasPortalGetPolicyRequest;
21use Google\Service\SASPortalTesting\SasPortalPolicy;
22use Google\Service\SASPortalTesting\SasPortalSetPolicyRequest;
23use Google\Service\SASPortalTesting\SasPortalTestPermissionsRequest;
24use Google\Service\SASPortalTesting\SasPortalTestPermissionsResponse;
25
26/**
27 * The "policies" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $prod_tt_sasportalService = new Google\Service\SASPortalTesting(...);
31 *   $policies = $prod_tt_sasportalService->policies;
32 *  </code>
33 */
34class Policies extends \Google\Service\Resource
35{
36  /**
37   * Gets the access control policy for a resource. Returns an empty policy if the
38   * resource exists and does not have a policy set. (policies.get)
39   *
40   * @param SasPortalGetPolicyRequest $postBody
41   * @param array $optParams Optional parameters.
42   * @return SasPortalPolicy
43   */
44  public function get(SasPortalGetPolicyRequest $postBody, $optParams = [])
45  {
46    $params = ['postBody' => $postBody];
47    $params = array_merge($params, $optParams);
48    return $this->call('get', [$params], SasPortalPolicy::class);
49  }
50  /**
51   * Sets the access control policy on the specified resource. Replaces any
52   * existing policy. (policies.set)
53   *
54   * @param SasPortalSetPolicyRequest $postBody
55   * @param array $optParams Optional parameters.
56   * @return SasPortalPolicy
57   */
58  public function set(SasPortalSetPolicyRequest $postBody, $optParams = [])
59  {
60    $params = ['postBody' => $postBody];
61    $params = array_merge($params, $optParams);
62    return $this->call('set', [$params], SasPortalPolicy::class);
63  }
64  /**
65   * Returns permissions that a caller has on the specified resource.
66   * (policies.test)
67   *
68   * @param SasPortalTestPermissionsRequest $postBody
69   * @param array $optParams Optional parameters.
70   * @return SasPortalTestPermissionsResponse
71   */
72  public function test(SasPortalTestPermissionsRequest $postBody, $optParams = [])
73  {
74    $params = ['postBody' => $postBody];
75    $params = array_merge($params, $optParams);
76    return $this->call('test', [$params], SasPortalTestPermissionsResponse::class);
77  }
78}
79
80// Adding a class alias for backwards compatibility with the previous class name.
81class_alias(Policies::class, 'Google_Service_SASPortalTesting_Resource_Policies');
82