[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\CloudHealthcare\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\CloudHealthcare\CheckDataAccessRequest;
|
---|
| 21 | use Google\Service\CloudHealthcare\CheckDataAccessResponse;
|
---|
| 22 | use Google\Service\CloudHealthcare\ConsentStore;
|
---|
| 23 | use Google\Service\CloudHealthcare\EvaluateUserConsentsRequest;
|
---|
| 24 | use Google\Service\CloudHealthcare\EvaluateUserConsentsResponse;
|
---|
| 25 | use Google\Service\CloudHealthcare\HealthcareEmpty;
|
---|
| 26 | use Google\Service\CloudHealthcare\ListConsentStoresResponse;
|
---|
| 27 | use Google\Service\CloudHealthcare\Operation;
|
---|
| 28 | use Google\Service\CloudHealthcare\Policy;
|
---|
| 29 | use Google\Service\CloudHealthcare\QueryAccessibleDataRequest;
|
---|
| 30 | use Google\Service\CloudHealthcare\SetIamPolicyRequest;
|
---|
| 31 | use Google\Service\CloudHealthcare\TestIamPermissionsRequest;
|
---|
| 32 | use Google\Service\CloudHealthcare\TestIamPermissionsResponse;
|
---|
| 33 |
|
---|
| 34 | /**
|
---|
| 35 | * The "consentStores" collection of methods.
|
---|
| 36 | * Typical usage is:
|
---|
| 37 | * <code>
|
---|
| 38 | * $healthcareService = new Google\Service\CloudHealthcare(...);
|
---|
| 39 | * $consentStores = $healthcareService->projects_locations_datasets_consentStores;
|
---|
| 40 | * </code>
|
---|
| 41 | */
|
---|
| 42 | class ProjectsLocationsDatasetsConsentStores extends \Google\Service\Resource
|
---|
| 43 | {
|
---|
| 44 | /**
|
---|
| 45 | * Checks if a particular data_id of a User data mapping in the specified
|
---|
| 46 | * consent store is consented for the specified use.
|
---|
| 47 | * (consentStores.checkDataAccess)
|
---|
| 48 | *
|
---|
| 49 | * @param string $consentStore Required. Name of the consent store where the
|
---|
| 50 | * requested data_id is stored, of the form `projects/{project_id}/locations/{lo
|
---|
| 51 | * cation_id}/datasets/{dataset_id}/consentStores/{consent_store_id}`.
|
---|
| 52 | * @param CheckDataAccessRequest $postBody
|
---|
| 53 | * @param array $optParams Optional parameters.
|
---|
| 54 | * @return CheckDataAccessResponse
|
---|
| 55 | * @throws \Google\Service\Exception
|
---|
| 56 | */
|
---|
| 57 | public function checkDataAccess($consentStore, CheckDataAccessRequest $postBody, $optParams = [])
|
---|
| 58 | {
|
---|
| 59 | $params = ['consentStore' => $consentStore, 'postBody' => $postBody];
|
---|
| 60 | $params = array_merge($params, $optParams);
|
---|
| 61 | return $this->call('checkDataAccess', [$params], CheckDataAccessResponse::class);
|
---|
| 62 | }
|
---|
| 63 | /**
|
---|
| 64 | * Creates a new consent store in the parent dataset. Attempting to create a
|
---|
| 65 | * consent store with the same ID as an existing store fails with an
|
---|
| 66 | * ALREADY_EXISTS error. (consentStores.create)
|
---|
| 67 | *
|
---|
| 68 | * @param string $parent Required. The name of the dataset this consent store
|
---|
| 69 | * belongs to.
|
---|
| 70 | * @param ConsentStore $postBody
|
---|
| 71 | * @param array $optParams Optional parameters.
|
---|
| 72 | *
|
---|
| 73 | * @opt_param string consentStoreId Required. The ID of the consent store to
|
---|
| 74 | * create. The string must match the following regex:
|
---|
| 75 | * `[\p{L}\p{N}_\-\.]{1,256}`. Cannot be changed after creation.
|
---|
| 76 | * @return ConsentStore
|
---|
| 77 | * @throws \Google\Service\Exception
|
---|
| 78 | */
|
---|
| 79 | public function create($parent, ConsentStore $postBody, $optParams = [])
|
---|
| 80 | {
|
---|
| 81 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 82 | $params = array_merge($params, $optParams);
|
---|
| 83 | return $this->call('create', [$params], ConsentStore::class);
|
---|
| 84 | }
|
---|
| 85 | /**
|
---|
| 86 | * Deletes the specified consent store and removes all the consent store's data.
|
---|
| 87 | * (consentStores.delete)
|
---|
| 88 | *
|
---|
| 89 | * @param string $name Required. The resource name of the consent store to
|
---|
| 90 | * delete.
|
---|
| 91 | * @param array $optParams Optional parameters.
|
---|
| 92 | * @return HealthcareEmpty
|
---|
| 93 | * @throws \Google\Service\Exception
|
---|
| 94 | */
|
---|
| 95 | public function delete($name, $optParams = [])
|
---|
| 96 | {
|
---|
| 97 | $params = ['name' => $name];
|
---|
| 98 | $params = array_merge($params, $optParams);
|
---|
| 99 | return $this->call('delete', [$params], HealthcareEmpty::class);
|
---|
| 100 | }
|
---|
| 101 | /**
|
---|
| 102 | * Evaluates the user's Consents for all matching User data mappings. Note: User
|
---|
| 103 | * data mappings are indexed asynchronously, which can cause a slight delay
|
---|
| 104 | * between the time mappings are created or updated and when they are included
|
---|
| 105 | * in EvaluateUserConsents results. (consentStores.evaluateUserConsents)
|
---|
| 106 | *
|
---|
| 107 | * @param string $consentStore Required. Name of the consent store to retrieve
|
---|
| 108 | * User data mappings from.
|
---|
| 109 | * @param EvaluateUserConsentsRequest $postBody
|
---|
| 110 | * @param array $optParams Optional parameters.
|
---|
| 111 | * @return EvaluateUserConsentsResponse
|
---|
| 112 | * @throws \Google\Service\Exception
|
---|
| 113 | */
|
---|
| 114 | public function evaluateUserConsents($consentStore, EvaluateUserConsentsRequest $postBody, $optParams = [])
|
---|
| 115 | {
|
---|
| 116 | $params = ['consentStore' => $consentStore, 'postBody' => $postBody];
|
---|
| 117 | $params = array_merge($params, $optParams);
|
---|
| 118 | return $this->call('evaluateUserConsents', [$params], EvaluateUserConsentsResponse::class);
|
---|
| 119 | }
|
---|
| 120 | /**
|
---|
| 121 | * Gets the specified consent store. (consentStores.get)
|
---|
| 122 | *
|
---|
| 123 | * @param string $name Required. The resource name of the consent store to get.
|
---|
| 124 | * @param array $optParams Optional parameters.
|
---|
| 125 | * @return ConsentStore
|
---|
| 126 | * @throws \Google\Service\Exception
|
---|
| 127 | */
|
---|
| 128 | public function get($name, $optParams = [])
|
---|
| 129 | {
|
---|
| 130 | $params = ['name' => $name];
|
---|
| 131 | $params = array_merge($params, $optParams);
|
---|
| 132 | return $this->call('get', [$params], ConsentStore::class);
|
---|
| 133 | }
|
---|
| 134 | /**
|
---|
| 135 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 136 | * resource exists and does not have a policy set. (consentStores.getIamPolicy)
|
---|
| 137 | *
|
---|
| 138 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 139 | * requested. See [Resource
|
---|
| 140 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 141 | * appropriate value for this field.
|
---|
| 142 | * @param array $optParams Optional parameters.
|
---|
| 143 | *
|
---|
| 144 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 145 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 146 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 147 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 148 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 149 | * unset. The policy in the response might use the policy version that you
|
---|
| 150 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 151 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 152 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 153 | * IAM policies, see the [IAM
|
---|
| 154 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 155 | * policies).
|
---|
| 156 | * @return Policy
|
---|
| 157 | * @throws \Google\Service\Exception
|
---|
| 158 | */
|
---|
| 159 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 160 | {
|
---|
| 161 | $params = ['resource' => $resource];
|
---|
| 162 | $params = array_merge($params, $optParams);
|
---|
| 163 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 164 | }
|
---|
| 165 | /**
|
---|
| 166 | * Lists the consent stores in the specified dataset.
|
---|
| 167 | * (consentStores.listProjectsLocationsDatasetsConsentStores)
|
---|
| 168 | *
|
---|
| 169 | * @param string $parent Required. Name of the dataset.
|
---|
| 170 | * @param array $optParams Optional parameters.
|
---|
| 171 | *
|
---|
| 172 | * @opt_param string filter Optional. Restricts the stores returned to those
|
---|
| 173 | * matching a filter. Only filtering on labels is supported. For example,
|
---|
| 174 | * `filter=labels.key=value`.
|
---|
| 175 | * @opt_param int pageSize Optional. Limit on the number of consent stores to
|
---|
| 176 | * return in a single response. If not specified, 100 is used. May not be larger
|
---|
| 177 | * than 1000.
|
---|
| 178 | * @opt_param string pageToken Optional. Token to retrieve the next page of
|
---|
| 179 | * results, or empty to get the first page.
|
---|
| 180 | * @return ListConsentStoresResponse
|
---|
| 181 | * @throws \Google\Service\Exception
|
---|
| 182 | */
|
---|
| 183 | public function listProjectsLocationsDatasetsConsentStores($parent, $optParams = [])
|
---|
| 184 | {
|
---|
| 185 | $params = ['parent' => $parent];
|
---|
| 186 | $params = array_merge($params, $optParams);
|
---|
| 187 | return $this->call('list', [$params], ListConsentStoresResponse::class);
|
---|
| 188 | }
|
---|
| 189 | /**
|
---|
| 190 | * Updates the specified consent store. (consentStores.patch)
|
---|
| 191 | *
|
---|
| 192 | * @param string $name Identifier. Resource name of the consent store, of the
|
---|
| 193 | * form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/con
|
---|
| 194 | * sentStores/{consent_store_id}`. Cannot be changed after creation.
|
---|
| 195 | * @param ConsentStore $postBody
|
---|
| 196 | * @param array $optParams Optional parameters.
|
---|
| 197 | *
|
---|
| 198 | * @opt_param string updateMask Required. The update mask that applies to the
|
---|
| 199 | * resource. For the `FieldMask` definition, see
|
---|
| 200 | * https://developers.google.com/protocol-
|
---|
| 201 | * buffers/docs/reference/google.protobuf#fieldmask. Only the `labels`,
|
---|
| 202 | * `default_consent_ttl`, and `enable_consent_create_on_update` fields are
|
---|
| 203 | * allowed to be updated.
|
---|
| 204 | * @return ConsentStore
|
---|
| 205 | * @throws \Google\Service\Exception
|
---|
| 206 | */
|
---|
| 207 | public function patch($name, ConsentStore $postBody, $optParams = [])
|
---|
| 208 | {
|
---|
| 209 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 210 | $params = array_merge($params, $optParams);
|
---|
| 211 | return $this->call('patch', [$params], ConsentStore::class);
|
---|
| 212 | }
|
---|
| 213 | /**
|
---|
| 214 | * Queries all data_ids that are consented for a specified use in the given
|
---|
| 215 | * consent store and writes them to a specified destination. The returned
|
---|
| 216 | * Operation includes a progress counter for the number of User data mappings
|
---|
| 217 | * processed. If the request is successful, a detailed response is returned of
|
---|
| 218 | * type QueryAccessibleDataResponse, contained in the response field when the
|
---|
| 219 | * operation finishes. The metadata field type is OperationMetadata. Errors are
|
---|
| 220 | * logged to Cloud Logging (see [Viewing error logs in Cloud
|
---|
| 221 | * Logging](https://cloud.google.com/healthcare/docs/how-tos/logging)). For
|
---|
| 222 | * example, the following sample log entry shows a `failed to evaluate consent
|
---|
| 223 | * policy` error that occurred during a QueryAccessibleData call to consent
|
---|
| 224 | * store `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/co
|
---|
| 225 | * nsentStores/{consent_store_id}`. ```json jsonPayload: { @type: "type.googleap
|
---|
| 226 | * is.com/google.cloud.healthcare.logging.QueryAccessibleDataLogEntry" error: {
|
---|
| 227 | * code: 9 message: "failed to evaluate consent policy" } resourceName: "project
|
---|
| 228 | * s/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores/{c
|
---|
| 229 | * onsent_store_id}/consents/{consent_id}" } logName: "projects/{project_id}/log
|
---|
| 230 | * s/healthcare.googleapis.com%2Fquery_accessible_data" operation: { id: "projec
|
---|
| 231 | * ts/{project_id}/locations/{location_id}/datasets/{dataset_id}/operations/{ope
|
---|
| 232 | * ration_id}" producer: "healthcare.googleapis.com/QueryAccessibleData" }
|
---|
| 233 | * receiveTimestamp: "TIMESTAMP" resource: { labels: { consent_store_id:
|
---|
| 234 | * "{consent_store_id}" dataset_id: "{dataset_id}" location: "{location_id}"
|
---|
| 235 | * project_id: "{project_id}" } type: "healthcare_consent_store" } severity:
|
---|
| 236 | * "ERROR" timestamp: "TIMESTAMP" ``` (consentStores.queryAccessibleData)
|
---|
| 237 | *
|
---|
| 238 | * @param string $consentStore Required. Name of the consent store to retrieve
|
---|
| 239 | * User data mappings from.
|
---|
| 240 | * @param QueryAccessibleDataRequest $postBody
|
---|
| 241 | * @param array $optParams Optional parameters.
|
---|
| 242 | * @return Operation
|
---|
| 243 | * @throws \Google\Service\Exception
|
---|
| 244 | */
|
---|
| 245 | public function queryAccessibleData($consentStore, QueryAccessibleDataRequest $postBody, $optParams = [])
|
---|
| 246 | {
|
---|
| 247 | $params = ['consentStore' => $consentStore, 'postBody' => $postBody];
|
---|
| 248 | $params = array_merge($params, $optParams);
|
---|
| 249 | return $this->call('queryAccessibleData', [$params], Operation::class);
|
---|
| 250 | }
|
---|
| 251 | /**
|
---|
| 252 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 253 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 254 | * `PERMISSION_DENIED` errors. (consentStores.setIamPolicy)
|
---|
| 255 | *
|
---|
| 256 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 257 | * specified. See [Resource
|
---|
| 258 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 259 | * appropriate value for this field.
|
---|
| 260 | * @param SetIamPolicyRequest $postBody
|
---|
| 261 | * @param array $optParams Optional parameters.
|
---|
| 262 | * @return Policy
|
---|
| 263 | * @throws \Google\Service\Exception
|
---|
| 264 | */
|
---|
| 265 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 266 | {
|
---|
| 267 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 268 | $params = array_merge($params, $optParams);
|
---|
| 269 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 270 | }
|
---|
| 271 | /**
|
---|
| 272 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 273 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 274 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 275 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 276 | * This operation may "fail open" without warning.
|
---|
| 277 | * (consentStores.testIamPermissions)
|
---|
| 278 | *
|
---|
| 279 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 280 | * being requested. See [Resource
|
---|
| 281 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 282 | * appropriate value for this field.
|
---|
| 283 | * @param TestIamPermissionsRequest $postBody
|
---|
| 284 | * @param array $optParams Optional parameters.
|
---|
| 285 | * @return TestIamPermissionsResponse
|
---|
| 286 | * @throws \Google\Service\Exception
|
---|
| 287 | */
|
---|
| 288 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 289 | {
|
---|
| 290 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 291 | $params = array_merge($params, $optParams);
|
---|
| 292 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 293 | }
|
---|
| 294 | }
|
---|
| 295 |
|
---|
| 296 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 297 | class_alias(ProjectsLocationsDatasetsConsentStores::class, 'Google_Service_CloudHealthcare_Resource_ProjectsLocationsDatasetsConsentStores');
|
---|