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\CertificateAuthorityService\Resource;
19
20use Google\Service\CertificateAuthorityService\CertificateRevocationList;
21use Google\Service\CertificateAuthorityService\ListCertificateRevocationListsResponse;
22use Google\Service\CertificateAuthorityService\Operation;
23use Google\Service\CertificateAuthorityService\Policy;
24use Google\Service\CertificateAuthorityService\SetIamPolicyRequest;
25use Google\Service\CertificateAuthorityService\TestIamPermissionsRequest;
26use Google\Service\CertificateAuthorityService\TestIamPermissionsResponse;
27
28/**
29 * The "certificateRevocationLists" collection of methods.
30 * Typical usage is:
31 *  <code>
32 *   $privatecaService = new Google\Service\CertificateAuthorityService(...);
33 *   $certificateRevocationLists = $privatecaService->certificateRevocationLists;
34 *  </code>
35 */
36class ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationLists extends \Google\Service\Resource
37{
38  /**
39   * Returns a CertificateRevocationList. (certificateRevocationLists.get)
40   *
41   * @param string $name Required. The name of the CertificateRevocationList to
42   * get.
43   * @param array $optParams Optional parameters.
44   * @return CertificateRevocationList
45   */
46  public function get($name, $optParams = [])
47  {
48    $params = ['name' => $name];
49    $params = array_merge($params, $optParams);
50    return $this->call('get', [$params], CertificateRevocationList::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.
55   * (certificateRevocationLists.getIamPolicy)
56   *
57   * @param string $resource REQUIRED: The resource for which the policy is being
58   * requested. See the operation documentation for the appropriate value for this
59   * field.
60   * @param array $optParams Optional parameters.
61   *
62   * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
63   * version that will be used to format the policy. Valid values are 0, 1, and 3.
64   * Requests specifying an invalid value will be rejected. Requests for policies
65   * with any conditional role bindings must specify version 3. Policies with no
66   * conditional role bindings may specify any valid value or leave the field
67   * unset. The policy in the response might use the policy version that you
68   * specified, or it might use a lower policy version. For example, if you
69   * specify version 3, but the policy has no conditional role bindings, the
70   * response uses version 1. To learn which resources support conditions in their
71   * IAM policies, see the [IAM
72   * documentation](https://cloud.google.com/iam/help/conditions/resource-
73   * policies).
74   * @return Policy
75   */
76  public function getIamPolicy($resource, $optParams = [])
77  {
78    $params = ['resource' => $resource];
79    $params = array_merge($params, $optParams);
80    return $this->call('getIamPolicy', [$params], Policy::class);
81  }
82  /**
83   * Lists CertificateRevocationLists. (certificateRevocationLists.listProjectsLoc
84   * ationsCaPoolsCertificateAuthoritiesCertificateRevocationLists)
85   *
86   * @param string $parent Required. The resource name of the location associated
87   * with the CertificateRevocationLists, in the format
88   * `projects/locations/caPools/certificateAuthorities`.
89   * @param array $optParams Optional parameters.
90   *
91   * @opt_param string filter Optional. Only include resources that match the
92   * filter in the response.
93   * @opt_param string orderBy Optional. Specify how the results should be sorted.
94   * @opt_param int pageSize Optional. Limit on the number of
95   * CertificateRevocationLists to include in the response. Further
96   * CertificateRevocationLists can subsequently be obtained by including the
97   * ListCertificateRevocationListsResponse.next_page_token in a subsequent
98   * request. If unspecified, the server will pick an appropriate default.
99   * @opt_param string pageToken Optional. Pagination token, returned earlier via
100   * ListCertificateRevocationListsResponse.next_page_token.
101   * @return ListCertificateRevocationListsResponse
102   */
103  public function listProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationLists($parent, $optParams = [])
104  {
105    $params = ['parent' => $parent];
106    $params = array_merge($params, $optParams);
107    return $this->call('list', [$params], ListCertificateRevocationListsResponse::class);
108  }
109  /**
110   * Update a CertificateRevocationList. (certificateRevocationLists.patch)
111   *
112   * @param string $name Output only. The resource name for this
113   * CertificateRevocationList in the format
114   * `projects/locations/caPoolscertificateAuthorities/
115   * certificateRevocationLists`.
116   * @param CertificateRevocationList $postBody
117   * @param array $optParams Optional parameters.
118   *
119   * @opt_param string requestId Optional. An ID to identify requests. Specify a
120   * unique request ID so that if you must retry your request, the server will
121   * know to ignore the request if it has already been completed. The server will
122   * guarantee that for at least 60 minutes since the first request. For example,
123   * consider a situation where you make an initial request and t he request times
124   * out. If you make the request again with the same request ID, the server can
125   * check if original operation with the same request ID was received, and if so,
126   * will ignore the second request. This prevents clients from accidentally
127   * creating duplicate commitments. The request ID must be a valid UUID with the
128   * exception that zero UUID is not supported
129   * (00000000-0000-0000-0000-000000000000).
130   * @opt_param string updateMask Required. A list of fields to be updated in this
131   * request.
132   * @return Operation
133   */
134  public function patch($name, CertificateRevocationList $postBody, $optParams = [])
135  {
136    $params = ['name' => $name, 'postBody' => $postBody];
137    $params = array_merge($params, $optParams);
138    return $this->call('patch', [$params], Operation::class);
139  }
140  /**
141   * Sets the access control policy on the specified resource. Replaces any
142   * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
143   * `PERMISSION_DENIED` errors. (certificateRevocationLists.setIamPolicy)
144   *
145   * @param string $resource REQUIRED: The resource for which the policy is being
146   * specified. See the operation documentation for the appropriate value for this
147   * field.
148   * @param SetIamPolicyRequest $postBody
149   * @param array $optParams Optional parameters.
150   * @return Policy
151   */
152  public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
153  {
154    $params = ['resource' => $resource, 'postBody' => $postBody];
155    $params = array_merge($params, $optParams);
156    return $this->call('setIamPolicy', [$params], Policy::class);
157  }
158  /**
159   * Returns permissions that a caller has on the specified resource. If the
160   * resource does not exist, this will return an empty set of permissions, not a
161   * `NOT_FOUND` error. Note: This operation is designed to be used for building
162   * permission-aware UIs and command-line tools, not for authorization checking.
163   * This operation may "fail open" without warning.
164   * (certificateRevocationLists.testIamPermissions)
165   *
166   * @param string $resource REQUIRED: The resource for which the policy detail is
167   * being requested. See the operation documentation for the appropriate value
168   * for this field.
169   * @param TestIamPermissionsRequest $postBody
170   * @param array $optParams Optional parameters.
171   * @return TestIamPermissionsResponse
172   */
173  public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
174  {
175    $params = ['resource' => $resource, 'postBody' => $postBody];
176    $params = array_merge($params, $optParams);
177    return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
178  }
179}
180
181// Adding a class alias for backwards compatibility with the previous class name.
182class_alias(ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationLists::class, 'Google_Service_CertificateAuthorityService_Resource_ProjectsLocationsCaPoolsCertificateAuthoritiesCertificateRevocationLists');
183