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\CloudHealthcare\Resource;
19
20use Google\Service\CloudHealthcare\ArchiveUserDataMappingRequest;
21use Google\Service\CloudHealthcare\ArchiveUserDataMappingResponse;
22use Google\Service\CloudHealthcare\HealthcareEmpty;
23use Google\Service\CloudHealthcare\ListUserDataMappingsResponse;
24use Google\Service\CloudHealthcare\UserDataMapping;
25
26/**
27 * The "userDataMappings" collection of methods.
28 * Typical usage is:
29 *  <code>
30 *   $healthcareService = new Google\Service\CloudHealthcare(...);
31 *   $userDataMappings = $healthcareService->userDataMappings;
32 *  </code>
33 */
34class ProjectsLocationsDatasetsConsentStoresUserDataMappings extends \Google\Service\Resource
35{
36  /**
37   * Archives the specified User data mapping. (userDataMappings.archive)
38   *
39   * @param string $name Required. The resource name of the User data mapping to
40   * archive.
41   * @param ArchiveUserDataMappingRequest $postBody
42   * @param array $optParams Optional parameters.
43   * @return ArchiveUserDataMappingResponse
44   */
45  public function archive($name, ArchiveUserDataMappingRequest $postBody, $optParams = [])
46  {
47    $params = ['name' => $name, 'postBody' => $postBody];
48    $params = array_merge($params, $optParams);
49    return $this->call('archive', [$params], ArchiveUserDataMappingResponse::class);
50  }
51  /**
52   * Creates a new User data mapping in the parent consent store.
53   * (userDataMappings.create)
54   *
55   * @param string $parent Required. Name of the consent store.
56   * @param UserDataMapping $postBody
57   * @param array $optParams Optional parameters.
58   * @return UserDataMapping
59   */
60  public function create($parent, UserDataMapping $postBody, $optParams = [])
61  {
62    $params = ['parent' => $parent, 'postBody' => $postBody];
63    $params = array_merge($params, $optParams);
64    return $this->call('create', [$params], UserDataMapping::class);
65  }
66  /**
67   * Deletes the specified User data mapping. (userDataMappings.delete)
68   *
69   * @param string $name Required. The resource name of the User data mapping to
70   * delete.
71   * @param array $optParams Optional parameters.
72   * @return HealthcareEmpty
73   */
74  public function delete($name, $optParams = [])
75  {
76    $params = ['name' => $name];
77    $params = array_merge($params, $optParams);
78    return $this->call('delete', [$params], HealthcareEmpty::class);
79  }
80  /**
81   * Gets the specified User data mapping. (userDataMappings.get)
82   *
83   * @param string $name Required. The resource name of the User data mapping to
84   * retrieve.
85   * @param array $optParams Optional parameters.
86   * @return UserDataMapping
87   */
88  public function get($name, $optParams = [])
89  {
90    $params = ['name' => $name];
91    $params = array_merge($params, $optParams);
92    return $this->call('get', [$params], UserDataMapping::class);
93  }
94  /**
95   * Lists the User data mappings in the specified consent store.
96   * (userDataMappings.listProjectsLocationsDatasetsConsentStoresUserDataMappings)
97   *
98   * @param string $parent Required. Name of the consent store to retrieve User
99   * data mappings from.
100   * @param array $optParams Optional parameters.
101   *
102   * @opt_param string filter Optional. Restricts the User data mappings returned
103   * to those matching a filter. The following syntax is available: * A string
104   * field value can be written as text inside quotation marks, for example
105   * `"query text"`. The only valid relational operation for text fields is
106   * equality (`=`), where text is searched within the field, rather than having
107   * the field be equal to the text. For example, `"Comment = great"` returns
108   * messages with `great` in the comment field. * A number field value can be
109   * written as an integer, a decimal, or an exponential. The valid relational
110   * operators for number fields are the equality operator (`=`), along with the
111   * less than/greater than operators (`<`, `<=`, `>`, `>=`). Note that there is
112   * no inequality (`!=`) operator. You can prepend the `NOT` operator to an
113   * expression to negate it. * A date field value must be written in `yyyy-mm-dd`
114   * form. Fields with date and time use the RFC3339 time format. Leading zeros
115   * are required for one-digit months and days. The valid relational operators
116   * for date fields are the equality operator (`=`) , along with the less
117   * than/greater than operators (`<`, `<=`, `>`, `>=`). Note that there is no
118   * inequality (`!=`) operator. You can prepend the `NOT` operator to an
119   * expression to negate it. * Multiple field query expressions can be combined
120   * in one query by adding `AND` or `OR` operators between the expressions. If a
121   * boolean operator appears within a quoted string, it is not treated as
122   * special, it's just another part of the character string to be matched. You
123   * can prepend the `NOT` operator to an expression to negate it. The fields
124   * available for filtering are: - data_id - user_id. For example,
125   * `filter=user_id=\"user123\"`. - archived - archive_time
126   * @opt_param int pageSize Optional. Limit on the number of User data mappings
127   * to return in a single response. If not specified, 100 is used. May not be
128   * larger than 1000.
129   * @opt_param string pageToken Optional. Token to retrieve the next page of
130   * results, or empty to get the first page.
131   * @return ListUserDataMappingsResponse
132   */
133  public function listProjectsLocationsDatasetsConsentStoresUserDataMappings($parent, $optParams = [])
134  {
135    $params = ['parent' => $parent];
136    $params = array_merge($params, $optParams);
137    return $this->call('list', [$params], ListUserDataMappingsResponse::class);
138  }
139  /**
140   * Updates the specified User data mapping. (userDataMappings.patch)
141   *
142   * @param string $name Resource name of the User data mapping, of the form `proj
143   * ects/{project_id}/locations/{location_id}/datasets/{dataset_id}/consentStores
144   * /{consent_store_id}/userDataMappings/{user_data_mapping_id}`.
145   * @param UserDataMapping $postBody
146   * @param array $optParams Optional parameters.
147   *
148   * @opt_param string updateMask Required. The update mask that applies to the
149   * resource. For the `FieldMask` definition, see https://developers.google.com
150   * /protocol-buffers/docs/reference/google.protobuf#fieldmask. Only the
151   * `data_id`, `user_id` and `resource_attributes` fields can be updated.
152   * @return UserDataMapping
153   */
154  public function patch($name, UserDataMapping $postBody, $optParams = [])
155  {
156    $params = ['name' => $name, 'postBody' => $postBody];
157    $params = array_merge($params, $optParams);
158    return $this->call('patch', [$params], UserDataMapping::class);
159  }
160}
161
162// Adding a class alias for backwards compatibility with the previous class name.
163class_alias(ProjectsLocationsDatasetsConsentStoresUserDataMappings::class, 'Google_Service_CloudHealthcare_Resource_ProjectsLocationsDatasetsConsentStoresUserDataMappings');
164