[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\CertificateAuthorityService\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\CertificateAuthorityService\CertificateTemplate;
|
---|
| 21 | use Google\Service\CertificateAuthorityService\ListCertificateTemplatesResponse;
|
---|
| 22 | use Google\Service\CertificateAuthorityService\Operation;
|
---|
| 23 | use Google\Service\CertificateAuthorityService\Policy;
|
---|
| 24 | use Google\Service\CertificateAuthorityService\SetIamPolicyRequest;
|
---|
| 25 | use Google\Service\CertificateAuthorityService\TestIamPermissionsRequest;
|
---|
| 26 | use Google\Service\CertificateAuthorityService\TestIamPermissionsResponse;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "certificateTemplates" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $privatecaService = new Google\Service\CertificateAuthorityService(...);
|
---|
| 33 | * $certificateTemplates = $privatecaService->projects_locations_certificateTemplates;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class ProjectsLocationsCertificateTemplates extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Create a new CertificateTemplate in a given Project and Location.
|
---|
| 40 | * (certificateTemplates.create)
|
---|
| 41 | *
|
---|
| 42 | * @param string $parent Required. The resource name of the location associated
|
---|
| 43 | * with the CertificateTemplate, in the format `projects/locations`.
|
---|
| 44 | * @param CertificateTemplate $postBody
|
---|
| 45 | * @param array $optParams Optional parameters.
|
---|
| 46 | *
|
---|
| 47 | * @opt_param string certificateTemplateId Required. It must be unique within a
|
---|
| 48 | * location and match the regular expression `[a-zA-Z0-9_-]{1,63}`
|
---|
| 49 | * @opt_param string requestId Optional. An ID to identify requests. Specify a
|
---|
| 50 | * unique request ID so that if you must retry your request, the server will
|
---|
| 51 | * know to ignore the request if it has already been completed. The server will
|
---|
| 52 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
| 53 | * consider a situation where you make an initial request and the request times
|
---|
| 54 | * out. If you make the request again with the same request ID, the server can
|
---|
| 55 | * check if original operation with the same request ID was received, and if so,
|
---|
| 56 | * will ignore the second request. This prevents clients from accidentally
|
---|
| 57 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
| 58 | * exception that zero UUID is not supported
|
---|
| 59 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 60 | * @return Operation
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function create($parent, CertificateTemplate $postBody, $optParams = [])
|
---|
| 64 | {
|
---|
| 65 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 66 | $params = array_merge($params, $optParams);
|
---|
| 67 | return $this->call('create', [$params], Operation::class);
|
---|
| 68 | }
|
---|
| 69 | /**
|
---|
| 70 | * DeleteCertificateTemplate deletes a CertificateTemplate.
|
---|
| 71 | * (certificateTemplates.delete)
|
---|
| 72 | *
|
---|
| 73 | * @param string $name Required. The resource name for this CertificateTemplate
|
---|
| 74 | * in the format `projects/locations/certificateTemplates`.
|
---|
| 75 | * @param array $optParams Optional parameters.
|
---|
| 76 | *
|
---|
| 77 | * @opt_param string requestId Optional. An ID to identify requests. Specify a
|
---|
| 78 | * unique request ID so that if you must retry your request, the server will
|
---|
| 79 | * know to ignore the request if it has already been completed. The server will
|
---|
| 80 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
| 81 | * consider a situation where you make an initial request and the request times
|
---|
| 82 | * out. If you make the request again with the same request ID, the server can
|
---|
| 83 | * check if original operation with the same request ID was received, and if so,
|
---|
| 84 | * will ignore the second request. This prevents clients from accidentally
|
---|
| 85 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
| 86 | * exception that zero UUID is not supported
|
---|
| 87 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 88 | * @return Operation
|
---|
| 89 | * @throws \Google\Service\Exception
|
---|
| 90 | */
|
---|
| 91 | public function delete($name, $optParams = [])
|
---|
| 92 | {
|
---|
| 93 | $params = ['name' => $name];
|
---|
| 94 | $params = array_merge($params, $optParams);
|
---|
| 95 | return $this->call('delete', [$params], Operation::class);
|
---|
| 96 | }
|
---|
| 97 | /**
|
---|
| 98 | * Returns a CertificateTemplate. (certificateTemplates.get)
|
---|
| 99 | *
|
---|
| 100 | * @param string $name Required. The name of the CertificateTemplate to get.
|
---|
| 101 | * @param array $optParams Optional parameters.
|
---|
| 102 | * @return CertificateTemplate
|
---|
| 103 | * @throws \Google\Service\Exception
|
---|
| 104 | */
|
---|
| 105 | public function get($name, $optParams = [])
|
---|
| 106 | {
|
---|
| 107 | $params = ['name' => $name];
|
---|
| 108 | $params = array_merge($params, $optParams);
|
---|
| 109 | return $this->call('get', [$params], CertificateTemplate::class);
|
---|
| 110 | }
|
---|
| 111 | /**
|
---|
| 112 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 113 | * resource exists and does not have a policy set.
|
---|
| 114 | * (certificateTemplates.getIamPolicy)
|
---|
| 115 | *
|
---|
| 116 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 117 | * requested. See [Resource
|
---|
| 118 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 119 | * appropriate value for this field.
|
---|
| 120 | * @param array $optParams Optional parameters.
|
---|
| 121 | *
|
---|
| 122 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 123 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 124 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 125 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 126 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 127 | * unset. The policy in the response might use the policy version that you
|
---|
| 128 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 129 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 130 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 131 | * IAM policies, see the [IAM
|
---|
| 132 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 133 | * policies).
|
---|
| 134 | * @return Policy
|
---|
| 135 | * @throws \Google\Service\Exception
|
---|
| 136 | */
|
---|
| 137 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 138 | {
|
---|
| 139 | $params = ['resource' => $resource];
|
---|
| 140 | $params = array_merge($params, $optParams);
|
---|
| 141 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 142 | }
|
---|
| 143 | /**
|
---|
| 144 | * Lists CertificateTemplates.
|
---|
| 145 | * (certificateTemplates.listProjectsLocationsCertificateTemplates)
|
---|
| 146 | *
|
---|
| 147 | * @param string $parent Required. The resource name of the location associated
|
---|
| 148 | * with the CertificateTemplates, in the format `projects/locations`.
|
---|
| 149 | * @param array $optParams Optional parameters.
|
---|
| 150 | *
|
---|
| 151 | * @opt_param string filter Optional. Only include resources that match the
|
---|
| 152 | * filter in the response.
|
---|
| 153 | * @opt_param string orderBy Optional. Specify how the results should be sorted.
|
---|
| 154 | * @opt_param int pageSize Optional. Limit on the number of CertificateTemplates
|
---|
| 155 | * to include in the response. Further CertificateTemplates can subsequently be
|
---|
| 156 | * obtained by including the ListCertificateTemplatesResponse.next_page_token in
|
---|
| 157 | * a subsequent request. If unspecified, the server will pick an appropriate
|
---|
| 158 | * default.
|
---|
| 159 | * @opt_param string pageToken Optional. Pagination token, returned earlier via
|
---|
| 160 | * ListCertificateTemplatesResponse.next_page_token.
|
---|
| 161 | * @return ListCertificateTemplatesResponse
|
---|
| 162 | * @throws \Google\Service\Exception
|
---|
| 163 | */
|
---|
| 164 | public function listProjectsLocationsCertificateTemplates($parent, $optParams = [])
|
---|
| 165 | {
|
---|
| 166 | $params = ['parent' => $parent];
|
---|
| 167 | $params = array_merge($params, $optParams);
|
---|
| 168 | return $this->call('list', [$params], ListCertificateTemplatesResponse::class);
|
---|
| 169 | }
|
---|
| 170 | /**
|
---|
| 171 | * Update a CertificateTemplate. (certificateTemplates.patch)
|
---|
| 172 | *
|
---|
| 173 | * @param string $name Output only. The resource name for this
|
---|
| 174 | * CertificateTemplate in the format `projects/locations/certificateTemplates`.
|
---|
| 175 | * @param CertificateTemplate $postBody
|
---|
| 176 | * @param array $optParams Optional parameters.
|
---|
| 177 | *
|
---|
| 178 | * @opt_param string requestId Optional. An ID to identify requests. Specify a
|
---|
| 179 | * unique request ID so that if you must retry your request, the server will
|
---|
| 180 | * know to ignore the request if it has already been completed. The server will
|
---|
| 181 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
| 182 | * consider a situation where you make an initial request and the request times
|
---|
| 183 | * out. If you make the request again with the same request ID, the server can
|
---|
| 184 | * check if original operation with the same request ID was received, and if so,
|
---|
| 185 | * will ignore the second request. This prevents clients from accidentally
|
---|
| 186 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
| 187 | * exception that zero UUID is not supported
|
---|
| 188 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 189 | * @opt_param string updateMask Required. A list of fields to be updated in this
|
---|
| 190 | * request.
|
---|
| 191 | * @return Operation
|
---|
| 192 | * @throws \Google\Service\Exception
|
---|
| 193 | */
|
---|
| 194 | public function patch($name, CertificateTemplate $postBody, $optParams = [])
|
---|
| 195 | {
|
---|
| 196 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 197 | $params = array_merge($params, $optParams);
|
---|
| 198 | return $this->call('patch', [$params], Operation::class);
|
---|
| 199 | }
|
---|
| 200 | /**
|
---|
| 201 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 202 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 203 | * `PERMISSION_DENIED` errors. (certificateTemplates.setIamPolicy)
|
---|
| 204 | *
|
---|
| 205 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 206 | * specified. See [Resource
|
---|
| 207 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 208 | * appropriate value for this field.
|
---|
| 209 | * @param SetIamPolicyRequest $postBody
|
---|
| 210 | * @param array $optParams Optional parameters.
|
---|
| 211 | * @return Policy
|
---|
| 212 | * @throws \Google\Service\Exception
|
---|
| 213 | */
|
---|
| 214 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 215 | {
|
---|
| 216 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 217 | $params = array_merge($params, $optParams);
|
---|
| 218 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 219 | }
|
---|
| 220 | /**
|
---|
| 221 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 222 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 223 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 224 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 225 | * This operation may "fail open" without warning.
|
---|
| 226 | * (certificateTemplates.testIamPermissions)
|
---|
| 227 | *
|
---|
| 228 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 229 | * being requested. See [Resource
|
---|
| 230 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 231 | * appropriate value for this field.
|
---|
| 232 | * @param TestIamPermissionsRequest $postBody
|
---|
| 233 | * @param array $optParams Optional parameters.
|
---|
| 234 | * @return TestIamPermissionsResponse
|
---|
| 235 | * @throws \Google\Service\Exception
|
---|
| 236 | */
|
---|
| 237 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 238 | {
|
---|
| 239 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 240 | $params = array_merge($params, $optParams);
|
---|
| 241 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 242 | }
|
---|
| 243 | }
|
---|
| 244 |
|
---|
| 245 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 246 | class_alias(ProjectsLocationsCertificateTemplates::class, 'Google_Service_CertificateAuthorityService_Resource_ProjectsLocationsCertificateTemplates');
|
---|