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\ConsentArtifact;
21 use Google\Service\CloudHealthcare\HealthcareEmpty;
22 use Google\Service\CloudHealthcare\ListConsentArtifactsResponse;
23 
24 /**
25  * The "consentArtifacts" collection of methods.
26  * Typical usage is:
27  *  <code>
28  *   $healthcareService = new Google\Service\CloudHealthcare(...);
29  *   $consentArtifacts = $healthcareService->consentArtifacts;
30  *  </code>
31  */
32 class ProjectsLocationsDatasetsConsentStoresConsentArtifacts extends \Google\Service\Resource
33 {
34   /**
35    * Creates a new Consent artifact in the parent consent store.
36    * (consentArtifacts.create)
37    *
38    * @param string $parent Required. The name of the consent store this Consent
39    * artifact belongs to.
40    * @param ConsentArtifact $postBody
41    * @param array $optParams Optional parameters.
42    * @return ConsentArtifact
43    */
44   public function create($parent, ConsentArtifact $postBody, $optParams = [])
45   {
46     $params = ['parent' => $parent, 'postBody' => $postBody];
47     $params = array_merge($params, $optParams);
48     return $this->call('create', [$params], ConsentArtifact::class);
49   }
50   /**
51    * Deletes the specified Consent artifact. Fails if the artifact is referenced
52    * by the latest revision of any Consent. (consentArtifacts.delete)
53    *
54    * @param string $name Required. The resource name of the Consent artifact to
55    * delete. To preserve referential integrity, Consent artifacts referenced by
56    * the latest revision of a Consent cannot be deleted.
57    * @param array $optParams Optional parameters.
58    * @return HealthcareEmpty
59    */
60   public function delete($name, $optParams = [])
61   {
62     $params = ['name' => $name];
63     $params = array_merge($params, $optParams);
64     return $this->call('delete', [$params], HealthcareEmpty::class);
65   }
66   /**
67    * Gets the specified Consent artifact. (consentArtifacts.get)
68    *
69    * @param string $name Required. The resource name of the Consent artifact to
70    * retrieve.
71    * @param array $optParams Optional parameters.
72    * @return ConsentArtifact
73    */
74   public function get($name, $optParams = [])
75   {
76     $params = ['name' => $name];
77     $params = array_merge($params, $optParams);
78     return $this->call('get', [$params], ConsentArtifact::class);
79   }
80   /**
81    * Lists the Consent artifacts in the specified consent store.
82    * (consentArtifacts.listProjectsLocationsDatasetsConsentStoresConsentArtifacts)
83    *
84    * @param string $parent Required. Name of the consent store to retrieve consent
85    * artifacts from.
86    * @param array $optParams Optional parameters.
87    *
88    * @opt_param string filter Optional. Restricts the artifacts returned to those
89    * matching a filter. The following syntax is available: * A string field value
90    * can be written as text inside quotation marks, for example `"query text"`.
91    * The only valid relational operation for text fields is equality (`=`), where
92    * text is searched within the field, rather than having the field be equal to
93    * the text. For example, `"Comment = great"` returns messages with `great` in
94    * the comment field. * A number field value can be written as an integer, a
95    * decimal, or an exponential. The valid relational operators for number fields
96    * are the equality operator (`=`), along with the less than/greater than
97    * operators (`<`, `<=`, `>`, `>=`). Note that there is no inequality (`!=`)
98    * operator. You can prepend the `NOT` operator to an expression to negate it. *
99    * A date field value must be written in `yyyy-mm-dd` form. Fields with date and
100    * time use the RFC3339 time format. Leading zeros are required for one-digit
101    * months and days. The valid relational operators for date fields are the
102    * equality operator (`=`) , along with the less than/greater than operators
103    * (`<`, `<=`, `>`, `>=`). Note that there is no inequality (`!=`) operator. You
104    * can prepend the `NOT` operator to an expression to negate it. * Multiple
105    * field query expressions can be combined in one query by adding `AND` or `OR`
106    * operators between the expressions. If a boolean operator appears within a
107    * quoted string, it is not treated as special, it's just another part of the
108    * character string to be matched. You can prepend the `NOT` operator to an
109    * expression to negate it. The fields available for filtering are: - user_id.
110    * For example, `filter=user_id=\"user123\"`. - consent_content_version -
111    * metadata. For example, `filter=Metadata(\"testkey\")=\"value\"` or
112    * `filter=HasMetadata(\"testkey\")`.
113    * @opt_param int pageSize Optional. Limit on the number of consent artifacts to
114    * return in a single response. If not specified, 100 is used. May not be larger
115    * than 1000.
116    * @opt_param string pageToken Optional. The next_page_token value returned from
117    * the previous List request, if any.
118    * @return ListConsentArtifactsResponse
119    */
120   public function listProjectsLocationsDatasetsConsentStoresConsentArtifacts($parent, $optParams = [])
121   {
122     $params = ['parent' => $parent];
123     $params = array_merge($params, $optParams);
124     return $this->call('list', [$params], ListConsentArtifactsResponse::class);
125   }
126 }
127 
128 // Adding a class alias for backwards compatibility with the previous class name.
129 class_alias(ProjectsLocationsDatasetsConsentStoresConsentArtifacts::class, 'Google_Service_CloudHealthcare_Resource_ProjectsLocationsDatasetsConsentStoresConsentArtifacts');
130