[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\ActivateConsentRequest;
|
---|
| 21 | use Google\Service\CloudHealthcare\Consent;
|
---|
| 22 | use Google\Service\CloudHealthcare\HealthcareEmpty;
|
---|
| 23 | use Google\Service\CloudHealthcare\ListConsentRevisionsResponse;
|
---|
| 24 | use Google\Service\CloudHealthcare\ListConsentsResponse;
|
---|
| 25 | use Google\Service\CloudHealthcare\RejectConsentRequest;
|
---|
| 26 | use Google\Service\CloudHealthcare\RevokeConsentRequest;
|
---|
| 27 |
|
---|
| 28 | /**
|
---|
| 29 | * The "consents" collection of methods.
|
---|
| 30 | * Typical usage is:
|
---|
| 31 | * <code>
|
---|
| 32 | * $healthcareService = new Google\Service\CloudHealthcare(...);
|
---|
| 33 | * $consents = $healthcareService->projects_locations_datasets_consentStores_consents;
|
---|
| 34 | * </code>
|
---|
| 35 | */
|
---|
| 36 | class ProjectsLocationsDatasetsConsentStoresConsents extends \Google\Service\Resource
|
---|
| 37 | {
|
---|
| 38 | /**
|
---|
| 39 | * Activates the latest revision of the specified Consent by committing a new
|
---|
| 40 | * revision with `state` updated to `ACTIVE`. If the latest revision of the
|
---|
| 41 | * specified Consent is in the `ACTIVE` state, no new revision is committed. A
|
---|
| 42 | * FAILED_PRECONDITION error occurs if the latest revision of the specified
|
---|
| 43 | * Consent is in the `REJECTED` or `REVOKED` state. (consents.activate)
|
---|
| 44 | *
|
---|
| 45 | * @param string $name Required. The resource name of the Consent to activate,
|
---|
| 46 | * of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_
|
---|
| 47 | * id}/consentStores/{consent_store_id}/consents/{consent_id}`. An
|
---|
| 48 | * INVALID_ARGUMENT error occurs if `revision_id` is specified in the name.
|
---|
| 49 | * @param ActivateConsentRequest $postBody
|
---|
| 50 | * @param array $optParams Optional parameters.
|
---|
| 51 | * @return Consent
|
---|
| 52 | * @throws \Google\Service\Exception
|
---|
| 53 | */
|
---|
| 54 | public function activate($name, ActivateConsentRequest $postBody, $optParams = [])
|
---|
| 55 | {
|
---|
| 56 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 57 | $params = array_merge($params, $optParams);
|
---|
| 58 | return $this->call('activate', [$params], Consent::class);
|
---|
| 59 | }
|
---|
| 60 | /**
|
---|
| 61 | * Creates a new Consent in the parent consent store. (consents.create)
|
---|
| 62 | *
|
---|
| 63 | * @param string $parent Required. Name of the consent store.
|
---|
| 64 | * @param Consent $postBody
|
---|
| 65 | * @param array $optParams Optional parameters.
|
---|
| 66 | * @return Consent
|
---|
| 67 | * @throws \Google\Service\Exception
|
---|
| 68 | */
|
---|
| 69 | public function create($parent, Consent $postBody, $optParams = [])
|
---|
| 70 | {
|
---|
| 71 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 72 | $params = array_merge($params, $optParams);
|
---|
| 73 | return $this->call('create', [$params], Consent::class);
|
---|
| 74 | }
|
---|
| 75 | /**
|
---|
| 76 | * Deletes the Consent and its revisions. To keep a record of the Consent but
|
---|
| 77 | * mark it inactive, see [RevokeConsent]. To delete a revision of a Consent, see
|
---|
| 78 | * [DeleteConsentRevision]. This operation does not delete the related Consent
|
---|
| 79 | * artifact. (consents.delete)
|
---|
| 80 | *
|
---|
| 81 | * @param string $name Required. The resource name of the Consent to delete, of
|
---|
| 82 | * the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}
|
---|
| 83 | * /consentStores/{consent_store_id}/consents/{consent_id}`. An INVALID_ARGUMENT
|
---|
| 84 | * error occurs if `revision_id` is specified in the name.
|
---|
| 85 | * @param array $optParams Optional parameters.
|
---|
| 86 | * @return HealthcareEmpty
|
---|
| 87 | * @throws \Google\Service\Exception
|
---|
| 88 | */
|
---|
| 89 | public function delete($name, $optParams = [])
|
---|
| 90 | {
|
---|
| 91 | $params = ['name' => $name];
|
---|
| 92 | $params = array_merge($params, $optParams);
|
---|
| 93 | return $this->call('delete', [$params], HealthcareEmpty::class);
|
---|
| 94 | }
|
---|
| 95 | /**
|
---|
| 96 | * Deletes the specified revision of a Consent. An INVALID_ARGUMENT error occurs
|
---|
| 97 | * if the specified revision is the latest revision. (consents.deleteRevision)
|
---|
| 98 | *
|
---|
| 99 | * @param string $name Required. The resource name of the Consent revision to
|
---|
| 100 | * delete, of the form `projects/{project_id}/locations/{location_id}/datasets/{
|
---|
| 101 | * dataset_id}/consentStores/{consent_store_id}/consents/{consent_id}@{revision_
|
---|
| 102 | * id}`. An INVALID_ARGUMENT error occurs if `revision_id` is not specified in
|
---|
| 103 | * the name.
|
---|
| 104 | * @param array $optParams Optional parameters.
|
---|
| 105 | * @return HealthcareEmpty
|
---|
| 106 | * @throws \Google\Service\Exception
|
---|
| 107 | */
|
---|
| 108 | public function deleteRevision($name, $optParams = [])
|
---|
| 109 | {
|
---|
| 110 | $params = ['name' => $name];
|
---|
| 111 | $params = array_merge($params, $optParams);
|
---|
| 112 | return $this->call('deleteRevision', [$params], HealthcareEmpty::class);
|
---|
| 113 | }
|
---|
| 114 | /**
|
---|
| 115 | * Gets the specified revision of a Consent, or the latest revision if
|
---|
| 116 | * `revision_id` is not specified in the resource name. (consents.get)
|
---|
| 117 | *
|
---|
| 118 | * @param string $name Required. The resource name of the Consent to retrieve,
|
---|
| 119 | * of the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_
|
---|
| 120 | * id}/consentStores/{consent_store_id}/consents/{consent_id}`. In order to
|
---|
| 121 | * retrieve a previous revision of the Consent, also provide the revision ID: `p
|
---|
| 122 | * rojects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentSto
|
---|
| 123 | * res/{consent_store_id}/consents/{consent_id}@{revision_id}`
|
---|
| 124 | * @param array $optParams Optional parameters.
|
---|
| 125 | * @return Consent
|
---|
| 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], Consent::class);
|
---|
| 133 | }
|
---|
| 134 | /**
|
---|
| 135 | * Lists the Consent in the given consent store, returning each Consent's latest
|
---|
| 136 | * revision. (consents.listProjectsLocationsDatasetsConsentStoresConsents)
|
---|
| 137 | *
|
---|
| 138 | * @param string $parent Required. Name of the consent store to retrieve
|
---|
| 139 | * Consents from.
|
---|
| 140 | * @param array $optParams Optional parameters.
|
---|
| 141 | *
|
---|
| 142 | * @opt_param string filter Optional. Restricts the Consents returned to those
|
---|
| 143 | * matching a filter. The following syntax is available: * A string field value
|
---|
| 144 | * can be written as text inside quotation marks, for example `"query text"`.
|
---|
| 145 | * The only valid relational operation for text fields is equality (`=`), where
|
---|
| 146 | * text is searched within the field, rather than having the field be equal to
|
---|
| 147 | * the text. For example, `"Comment = great"` returns messages with `great` in
|
---|
| 148 | * the comment field. * A number field value can be written as an integer, a
|
---|
| 149 | * decimal, or an exponential. The valid relational operators for number fields
|
---|
| 150 | * are the equality operator (`=`), along with the less than/greater than
|
---|
| 151 | * operators (`<`, `<=`, `>`, `>=`). Note that there is no inequality (`!=`)
|
---|
| 152 | * operator. You can prepend the `NOT` operator to an expression to negate it. *
|
---|
| 153 | * A date field value must be written in `yyyy-mm-dd` form. Fields with date and
|
---|
| 154 | * time use the RFC3339 time format. Leading zeros are required for one-digit
|
---|
| 155 | * months and days. The valid relational operators for date fields are the
|
---|
| 156 | * equality operator (`=`) , along with the less than/greater than operators
|
---|
| 157 | * (`<`, `<=`, `>`, `>=`). Note that there is no inequality (`!=`) operator. You
|
---|
| 158 | * can prepend the `NOT` operator to an expression to negate it. * Multiple
|
---|
| 159 | * field query expressions can be combined in one query by adding `AND` or `OR`
|
---|
| 160 | * operators between the expressions. If a boolean operator appears within a
|
---|
| 161 | * quoted string, it is not treated as special, it's just another part of the
|
---|
| 162 | * character string to be matched. You can prepend the `NOT` operator to an
|
---|
| 163 | * expression to negate it. The fields available for filtering are: - user_id.
|
---|
| 164 | * For example, `filter='user_id="user123"'`. - consent_artifact - state -
|
---|
| 165 | * revision_create_time - metadata. For example,
|
---|
| 166 | * `filter=Metadata(\"testkey\")=\"value\"` or
|
---|
| 167 | * `filter=HasMetadata(\"testkey\")`.
|
---|
| 168 | * @opt_param int pageSize Optional. Limit on the number of Consents to return
|
---|
| 169 | * in a single response. If not specified, 100 is used. May not be larger than
|
---|
| 170 | * 1000.
|
---|
| 171 | * @opt_param string pageToken Optional. The next_page_token value returned from
|
---|
| 172 | * the previous List request, if any.
|
---|
| 173 | * @return ListConsentsResponse
|
---|
| 174 | * @throws \Google\Service\Exception
|
---|
| 175 | */
|
---|
| 176 | public function listProjectsLocationsDatasetsConsentStoresConsents($parent, $optParams = [])
|
---|
| 177 | {
|
---|
| 178 | $params = ['parent' => $parent];
|
---|
| 179 | $params = array_merge($params, $optParams);
|
---|
| 180 | return $this->call('list', [$params], ListConsentsResponse::class);
|
---|
| 181 | }
|
---|
| 182 | /**
|
---|
| 183 | * Lists the revisions of the specified Consent in reverse chronological order.
|
---|
| 184 | * (consents.listRevisions)
|
---|
| 185 | *
|
---|
| 186 | * @param string $name Required. The resource name of the Consent to retrieve
|
---|
| 187 | * revisions for.
|
---|
| 188 | * @param array $optParams Optional parameters.
|
---|
| 189 | *
|
---|
| 190 | * @opt_param string filter Optional. Restricts the revisions returned to those
|
---|
| 191 | * matching a filter. The following syntax is available: * A string field value
|
---|
| 192 | * can be written as text inside quotation marks, for example `"query text"`.
|
---|
| 193 | * The only valid relational operation for text fields is equality (`=`), where
|
---|
| 194 | * text is searched within the field, rather than having the field be equal to
|
---|
| 195 | * the text. For example, `"Comment = great"` returns messages with `great` in
|
---|
| 196 | * the comment field. * A number field value can be written as an integer, a
|
---|
| 197 | * decimal, or an exponential. The valid relational operators for number fields
|
---|
| 198 | * are the equality operator (`=`), along with the less than/greater than
|
---|
| 199 | * operators (`<`, `<=`, `>`, `>=`). Note that there is no inequality (`!=`)
|
---|
| 200 | * operator. You can prepend the `NOT` operator to an expression to negate it. *
|
---|
| 201 | * A date field value must be written in `yyyy-mm-dd` form. Fields with date and
|
---|
| 202 | * time use the RFC3339 time format. Leading zeros are required for one-digit
|
---|
| 203 | * months and days. The valid relational operators for date fields are the
|
---|
| 204 | * equality operator (`=`) , along with the less than/greater than operators
|
---|
| 205 | * (`<`, `<=`, `>`, `>=`). Note that there is no inequality (`!=`) operator. You
|
---|
| 206 | * can prepend the `NOT` operator to an expression to negate it. * Multiple
|
---|
| 207 | * field query expressions can be combined in one query by adding `AND` or `OR`
|
---|
| 208 | * operators between the expressions. If a boolean operator appears within a
|
---|
| 209 | * quoted string, it is not treated as special, it's just another part of the
|
---|
| 210 | * character string to be matched. You can prepend the `NOT` operator to an
|
---|
| 211 | * expression to negate it. Fields available for filtering are: - user_id. For
|
---|
| 212 | * example, `filter='user_id="user123"'`. - consent_artifact - state -
|
---|
| 213 | * revision_create_time - metadata. For example,
|
---|
| 214 | * `filter=Metadata(\"testkey\")=\"value\"` or
|
---|
| 215 | * `filter=HasMetadata(\"testkey\")`.
|
---|
| 216 | * @opt_param int pageSize Optional. Limit on the number of revisions to return
|
---|
| 217 | * in a single response. If not specified, 100 is used. May not be larger than
|
---|
| 218 | * 1000.
|
---|
| 219 | * @opt_param string pageToken Optional. Token to retrieve the next page of
|
---|
| 220 | * results or empty if there are no more results in the list.
|
---|
| 221 | * @return ListConsentRevisionsResponse
|
---|
| 222 | * @throws \Google\Service\Exception
|
---|
| 223 | */
|
---|
| 224 | public function listRevisions($name, $optParams = [])
|
---|
| 225 | {
|
---|
| 226 | $params = ['name' => $name];
|
---|
| 227 | $params = array_merge($params, $optParams);
|
---|
| 228 | return $this->call('listRevisions', [$params], ListConsentRevisionsResponse::class);
|
---|
| 229 | }
|
---|
| 230 | /**
|
---|
| 231 | * Updates the latest revision of the specified Consent by committing a new
|
---|
| 232 | * revision with the changes. A FAILED_PRECONDITION error occurs if the latest
|
---|
| 233 | * revision of the specified Consent is in the `REJECTED` or `REVOKED` state.
|
---|
| 234 | * (consents.patch)
|
---|
| 235 | *
|
---|
| 236 | * @param string $name Identifier. Resource name of the Consent, of the form `pr
|
---|
| 237 | * ojects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStor
|
---|
| 238 | * es/{consent_store_id}/consents/{consent_id}`. Cannot be changed after
|
---|
| 239 | * creation.
|
---|
| 240 | * @param Consent $postBody
|
---|
| 241 | * @param array $optParams Optional parameters.
|
---|
| 242 | *
|
---|
| 243 | * @opt_param string updateMask Required. The update mask to apply to the
|
---|
| 244 | * resource. For the `FieldMask` definition, see
|
---|
| 245 | * https://developers.google.com/protocol-
|
---|
| 246 | * buffers/docs/reference/google.protobuf#fieldmask. Only the `user_id`,
|
---|
| 247 | * `policies`, `consent_artifact`, and `metadata` fields can be updated.
|
---|
| 248 | * @return Consent
|
---|
| 249 | * @throws \Google\Service\Exception
|
---|
| 250 | */
|
---|
| 251 | public function patch($name, Consent $postBody, $optParams = [])
|
---|
| 252 | {
|
---|
| 253 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 254 | $params = array_merge($params, $optParams);
|
---|
| 255 | return $this->call('patch', [$params], Consent::class);
|
---|
| 256 | }
|
---|
| 257 | /**
|
---|
| 258 | * Rejects the latest revision of the specified Consent by committing a new
|
---|
| 259 | * revision with `state` updated to `REJECTED`. If the latest revision of the
|
---|
| 260 | * specified Consent is in the `REJECTED` state, no new revision is committed. A
|
---|
| 261 | * FAILED_PRECONDITION error occurs if the latest revision of the specified
|
---|
| 262 | * Consent is in the `ACTIVE` or `REVOKED` state. (consents.reject)
|
---|
| 263 | *
|
---|
| 264 | * @param string $name Required. The resource name of the Consent to reject, of
|
---|
| 265 | * the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}
|
---|
| 266 | * /consentStores/{consent_store_id}/consents/{consent_id}`. An INVALID_ARGUMENT
|
---|
| 267 | * error occurs if `revision_id` is specified in the name.
|
---|
| 268 | * @param RejectConsentRequest $postBody
|
---|
| 269 | * @param array $optParams Optional parameters.
|
---|
| 270 | * @return Consent
|
---|
| 271 | * @throws \Google\Service\Exception
|
---|
| 272 | */
|
---|
| 273 | public function reject($name, RejectConsentRequest $postBody, $optParams = [])
|
---|
| 274 | {
|
---|
| 275 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 276 | $params = array_merge($params, $optParams);
|
---|
| 277 | return $this->call('reject', [$params], Consent::class);
|
---|
| 278 | }
|
---|
| 279 | /**
|
---|
| 280 | * Revokes the latest revision of the specified Consent by committing a new
|
---|
| 281 | * revision with `state` updated to `REVOKED`. If the latest revision of the
|
---|
| 282 | * specified Consent is in the `REVOKED` state, no new revision is committed. A
|
---|
| 283 | * FAILED_PRECONDITION error occurs if the latest revision of the given consent
|
---|
| 284 | * is in `DRAFT` or `REJECTED` state. (consents.revoke)
|
---|
| 285 | *
|
---|
| 286 | * @param string $name Required. The resource name of the Consent to revoke, of
|
---|
| 287 | * the form `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}
|
---|
| 288 | * /consentStores/{consent_store_id}/consents/{consent_id}`. An INVALID_ARGUMENT
|
---|
| 289 | * error occurs if `revision_id` is specified in the name.
|
---|
| 290 | * @param RevokeConsentRequest $postBody
|
---|
| 291 | * @param array $optParams Optional parameters.
|
---|
| 292 | * @return Consent
|
---|
| 293 | * @throws \Google\Service\Exception
|
---|
| 294 | */
|
---|
| 295 | public function revoke($name, RevokeConsentRequest $postBody, $optParams = [])
|
---|
| 296 | {
|
---|
| 297 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 298 | $params = array_merge($params, $optParams);
|
---|
| 299 | return $this->call('revoke', [$params], Consent::class);
|
---|
| 300 | }
|
---|
| 301 | }
|
---|
| 302 |
|
---|
| 303 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 304 | class_alias(ProjectsLocationsDatasetsConsentStoresConsents::class, 'Google_Service_CloudHealthcare_Resource_ProjectsLocationsDatasetsConsentStoresConsents');
|
---|