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\CloudIdentity\Resource;
19
20use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1ClientState;
21use Google\Service\CloudIdentity\GoogleAppsCloudidentityDevicesV1ListClientStatesResponse;
22use Google\Service\CloudIdentity\Operation;
23
24/**
25 * The "clientStates" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $cloudidentityService = new Google\Service\CloudIdentity(...);
29 *   $clientStates = $cloudidentityService->clientStates;
30 *  </code>
31 */
32class DevicesDeviceUsersClientStates extends \Google\Service\Resource
33{
34  /**
35   * Gets the client state for the device user (clientStates.get)
36   *
37   * @param string $name Required. [Resource
38   * name](https://cloud.google.com/apis/design/resource_names) of the ClientState
39   * in format:
40   * `devices/{device}/deviceUsers/{device_user}/clientStates/{partner}`, where
41   * `device` is the unique ID assigned to the Device, `device_user` is the unique
42   * ID assigned to the User and `partner` identifies the partner storing the
43   * data. To get the client state for devices belonging to your own organization,
44   * the `partnerId` is in the format: `customerId-*anystring*`. Where the
45   * `customerId` is your organization's customer ID and `anystring` is any
46   * suffix. This suffix is used in setting up Custom Access Levels in Context-
47   * Aware Access. You may use `my_customer` instead of the customer ID for
48   * devices managed by your own organization. You may specify `-` in place of the
49   * `{device}`, so the ClientState resource name can be:
50   * `devices/-/deviceUsers/{device_user_resource}/clientStates/{partner}`.
51   * @param array $optParams Optional parameters.
52   *
53   * @opt_param string customer Optional. [Resource
54   * name](https://cloud.google.com/apis/design/resource_names) of the customer.
55   * If you're using this API for your own organization, use
56   * `customers/my_customer` If you're using this API to manage another
57   * organization, use `customers/{customer}`, where customer is the customer to
58   * whom the device belongs.
59   * @return GoogleAppsCloudidentityDevicesV1ClientState
60   */
61  public function get($name, $optParams = [])
62  {
63    $params = ['name' => $name];
64    $params = array_merge($params, $optParams);
65    return $this->call('get', [$params], GoogleAppsCloudidentityDevicesV1ClientState::class);
66  }
67  /**
68   * Lists the client states for the given search query.
69   * (clientStates.listDevicesDeviceUsersClientStates)
70   *
71   * @param string $parent Required. To list all ClientStates, set this to
72   * "devices/-/deviceUsers/-". To list all ClientStates owned by a DeviceUser,
73   * set this to the resource name of the DeviceUser. Format:
74   * devices/{device}/deviceUsers/{deviceUser}
75   * @param array $optParams Optional parameters.
76   *
77   * @opt_param string customer Optional. [Resource
78   * name](https://cloud.google.com/apis/design/resource_names) of the customer.
79   * If you're using this API for your own organization, use
80   * `customers/my_customer` If you're using this API to manage another
81   * organization, use `customers/{customer}`, where customer is the customer to
82   * whom the device belongs.
83   * @opt_param string filter Optional. Additional restrictions when fetching list
84   * of client states.
85   * @opt_param string orderBy Optional. Order specification for client states in
86   * the response.
87   * @opt_param string pageToken Optional. A page token, received from a previous
88   * `ListClientStates` call. Provide this to retrieve the subsequent page. When
89   * paginating, all other parameters provided to `ListClientStates` must match
90   * the call that provided the page token.
91   * @return GoogleAppsCloudidentityDevicesV1ListClientStatesResponse
92   */
93  public function listDevicesDeviceUsersClientStates($parent, $optParams = [])
94  {
95    $params = ['parent' => $parent];
96    $params = array_merge($params, $optParams);
97    return $this->call('list', [$params], GoogleAppsCloudidentityDevicesV1ListClientStatesResponse::class);
98  }
99  /**
100   * Updates the client state for the device user **Note**: This method is
101   * available only to customers who have one of the following SKUs: Enterprise
102   * Standard, Enterprise Plus, Enterprise for Education, and Cloud Identity
103   * Premium (clientStates.patch)
104   *
105   * @param string $name Output only. [Resource
106   * name](https://cloud.google.com/apis/design/resource_names) of the ClientState
107   * in format:
108   * `devices/{device}/deviceUsers/{device_user}/clientState/{partner}`, where
109   * partner corresponds to the partner storing the data. For partners belonging
110   * to the "BeyondCorp Alliance", this is the partner ID specified to you by
111   * Google. For all other callers, this is a string of the form:
112   * `{customer}-suffix`, where `customer` is your customer ID. The *suffix* is
113   * any string the caller specifies. This string will be displayed verbatim in
114   * the administration console. This suffix is used in setting up Custom Access
115   * Levels in Context-Aware Access. Your organization's customer ID can be
116   * obtained from the URL: `GET
117   * https://www.googleapis.com/admin/directory/v1/customers/my_customer` The `id`
118   * field in the response contains the customer ID starting with the letter 'C'.
119   * The customer ID to be used in this API is the string after the letter 'C'
120   * (not including 'C')
121   * @param GoogleAppsCloudidentityDevicesV1ClientState $postBody
122   * @param array $optParams Optional parameters.
123   *
124   * @opt_param string customer Optional. [Resource
125   * name](https://cloud.google.com/apis/design/resource_names) of the customer.
126   * If you're using this API for your own organization, use
127   * `customers/my_customer` If you're using this API to manage another
128   * organization, use `customers/{customer}`, where customer is the customer to
129   * whom the device belongs.
130   * @opt_param string updateMask Optional. Comma-separated list of fully
131   * qualified names of fields to be updated. If not specified, all updatable
132   * fields in ClientState are updated.
133   * @return Operation
134   */
135  public function patch($name, GoogleAppsCloudidentityDevicesV1ClientState $postBody, $optParams = [])
136  {
137    $params = ['name' => $name, 'postBody' => $postBody];
138    $params = array_merge($params, $optParams);
139    return $this->call('patch', [$params], Operation::class);
140  }
141}
142
143// Adding a class alias for backwards compatibility with the previous class name.
144class_alias(DevicesDeviceUsersClientStates::class, 'Google_Service_CloudIdentity_Resource_DevicesDeviceUsersClientStates');
145