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\AndroidProvisioningPartner\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\AndroidProvisioningPartner\AndroiddeviceprovisioningEmpty;
|
---|
21 | use Google\Service\AndroidProvisioningPartner\ClaimDeviceRequest;
|
---|
22 | use Google\Service\AndroidProvisioningPartner\ClaimDeviceResponse;
|
---|
23 | use Google\Service\AndroidProvisioningPartner\ClaimDevicesRequest;
|
---|
24 | use Google\Service\AndroidProvisioningPartner\Device;
|
---|
25 | use Google\Service\AndroidProvisioningPartner\DeviceMetadata;
|
---|
26 | use Google\Service\AndroidProvisioningPartner\FindDevicesByDeviceIdentifierRequest;
|
---|
27 | use Google\Service\AndroidProvisioningPartner\FindDevicesByDeviceIdentifierResponse;
|
---|
28 | use Google\Service\AndroidProvisioningPartner\FindDevicesByOwnerRequest;
|
---|
29 | use Google\Service\AndroidProvisioningPartner\FindDevicesByOwnerResponse;
|
---|
30 | use Google\Service\AndroidProvisioningPartner\GetDeviceSimLockStateRequest;
|
---|
31 | use Google\Service\AndroidProvisioningPartner\GetDeviceSimLockStateResponse;
|
---|
32 | use Google\Service\AndroidProvisioningPartner\Operation;
|
---|
33 | use Google\Service\AndroidProvisioningPartner\UnclaimDeviceRequest;
|
---|
34 | use Google\Service\AndroidProvisioningPartner\UnclaimDevicesRequest;
|
---|
35 | use Google\Service\AndroidProvisioningPartner\UpdateDeviceMetadataInBatchRequest;
|
---|
36 | use Google\Service\AndroidProvisioningPartner\UpdateDeviceMetadataRequest;
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * The "devices" collection of methods.
|
---|
40 | * Typical usage is:
|
---|
41 | * <code>
|
---|
42 | * $androiddeviceprovisioningService = new Google\Service\AndroidProvisioningPartner(...);
|
---|
43 | * $devices = $androiddeviceprovisioningService->partners_devices;
|
---|
44 | * </code>
|
---|
45 | */
|
---|
46 | class PartnersDevices extends \Google\Service\Resource
|
---|
47 | {
|
---|
48 | /**
|
---|
49 | * Claims a device for a customer and adds it to zero-touch enrollment. If the
|
---|
50 | * device is already claimed by another customer, the call returns an error.
|
---|
51 | * (devices.claim)
|
---|
52 | *
|
---|
53 | * @param string $partnerId Required. The ID of the reseller partner.
|
---|
54 | * @param ClaimDeviceRequest $postBody
|
---|
55 | * @param array $optParams Optional parameters.
|
---|
56 | * @return ClaimDeviceResponse
|
---|
57 | * @throws \Google\Service\Exception
|
---|
58 | */
|
---|
59 | public function claim($partnerId, ClaimDeviceRequest $postBody, $optParams = [])
|
---|
60 | {
|
---|
61 | $params = ['partnerId' => $partnerId, 'postBody' => $postBody];
|
---|
62 | $params = array_merge($params, $optParams);
|
---|
63 | return $this->call('claim', [$params], ClaimDeviceResponse::class);
|
---|
64 | }
|
---|
65 | /**
|
---|
66 | * Claims a batch of devices for a customer asynchronously. Adds the devices to
|
---|
67 | * zero-touch enrollment. To learn more, read [Long‑running batch
|
---|
68 | * operations](/zero-touch/guides/how-it-works#operations). (devices.claimAsync)
|
---|
69 | *
|
---|
70 | * @param string $partnerId Required. The ID of the reseller partner.
|
---|
71 | * @param ClaimDevicesRequest $postBody
|
---|
72 | * @param array $optParams Optional parameters.
|
---|
73 | * @return Operation
|
---|
74 | * @throws \Google\Service\Exception
|
---|
75 | */
|
---|
76 | public function claimAsync($partnerId, ClaimDevicesRequest $postBody, $optParams = [])
|
---|
77 | {
|
---|
78 | $params = ['partnerId' => $partnerId, 'postBody' => $postBody];
|
---|
79 | $params = array_merge($params, $optParams);
|
---|
80 | return $this->call('claimAsync', [$params], Operation::class);
|
---|
81 | }
|
---|
82 | /**
|
---|
83 | * Finds devices by hardware identifiers, such as IMEI.
|
---|
84 | * (devices.findByIdentifier)
|
---|
85 | *
|
---|
86 | * @param string $partnerId Required. The ID of the reseller partner.
|
---|
87 | * @param FindDevicesByDeviceIdentifierRequest $postBody
|
---|
88 | * @param array $optParams Optional parameters.
|
---|
89 | * @return FindDevicesByDeviceIdentifierResponse
|
---|
90 | * @throws \Google\Service\Exception
|
---|
91 | */
|
---|
92 | public function findByIdentifier($partnerId, FindDevicesByDeviceIdentifierRequest $postBody, $optParams = [])
|
---|
93 | {
|
---|
94 | $params = ['partnerId' => $partnerId, 'postBody' => $postBody];
|
---|
95 | $params = array_merge($params, $optParams);
|
---|
96 | return $this->call('findByIdentifier', [$params], FindDevicesByDeviceIdentifierResponse::class);
|
---|
97 | }
|
---|
98 | /**
|
---|
99 | * Finds devices claimed for customers. The results only contain devices
|
---|
100 | * registered to the reseller that's identified by the `partnerId` argument. The
|
---|
101 | * customer's devices purchased from other resellers don't appear in the
|
---|
102 | * results. (devices.findByOwner)
|
---|
103 | *
|
---|
104 | * @param string $partnerId Required. The ID of the reseller partner.
|
---|
105 | * @param FindDevicesByOwnerRequest $postBody
|
---|
106 | * @param array $optParams Optional parameters.
|
---|
107 | * @return FindDevicesByOwnerResponse
|
---|
108 | * @throws \Google\Service\Exception
|
---|
109 | */
|
---|
110 | public function findByOwner($partnerId, FindDevicesByOwnerRequest $postBody, $optParams = [])
|
---|
111 | {
|
---|
112 | $params = ['partnerId' => $partnerId, 'postBody' => $postBody];
|
---|
113 | $params = array_merge($params, $optParams);
|
---|
114 | return $this->call('findByOwner', [$params], FindDevicesByOwnerResponse::class);
|
---|
115 | }
|
---|
116 | /**
|
---|
117 | * Gets a device. (devices.get)
|
---|
118 | *
|
---|
119 | * @param string $name Required. The device API resource name in the format
|
---|
120 | * `partners/[PARTNER_ID]/devices/[DEVICE_ID]`.
|
---|
121 | * @param array $optParams Optional parameters.
|
---|
122 | * @return Device
|
---|
123 | * @throws \Google\Service\Exception
|
---|
124 | */
|
---|
125 | public function get($name, $optParams = [])
|
---|
126 | {
|
---|
127 | $params = ['name' => $name];
|
---|
128 | $params = array_merge($params, $optParams);
|
---|
129 | return $this->call('get', [$params], Device::class);
|
---|
130 | }
|
---|
131 | /**
|
---|
132 | * Gets a device's SIM lock state. (devices.getSimLockState)
|
---|
133 | *
|
---|
134 | * @param string $partnerId Required. The ID of the partner.
|
---|
135 | * @param GetDeviceSimLockStateRequest $postBody
|
---|
136 | * @param array $optParams Optional parameters.
|
---|
137 | * @return GetDeviceSimLockStateResponse
|
---|
138 | * @throws \Google\Service\Exception
|
---|
139 | */
|
---|
140 | public function getSimLockState($partnerId, GetDeviceSimLockStateRequest $postBody, $optParams = [])
|
---|
141 | {
|
---|
142 | $params = ['partnerId' => $partnerId, 'postBody' => $postBody];
|
---|
143 | $params = array_merge($params, $optParams);
|
---|
144 | return $this->call('getSimLockState', [$params], GetDeviceSimLockStateResponse::class);
|
---|
145 | }
|
---|
146 | /**
|
---|
147 | * Updates reseller metadata associated with the device. Android devices only.
|
---|
148 | * (devices.metadata)
|
---|
149 | *
|
---|
150 | * @param string $metadataOwnerId Required. The owner of the newly set metadata.
|
---|
151 | * Set this to the partner ID.
|
---|
152 | * @param string $deviceId Required. The ID of the device.
|
---|
153 | * @param UpdateDeviceMetadataRequest $postBody
|
---|
154 | * @param array $optParams Optional parameters.
|
---|
155 | * @return DeviceMetadata
|
---|
156 | * @throws \Google\Service\Exception
|
---|
157 | */
|
---|
158 | public function metadata($metadataOwnerId, $deviceId, UpdateDeviceMetadataRequest $postBody, $optParams = [])
|
---|
159 | {
|
---|
160 | $params = ['metadataOwnerId' => $metadataOwnerId, 'deviceId' => $deviceId, 'postBody' => $postBody];
|
---|
161 | $params = array_merge($params, $optParams);
|
---|
162 | return $this->call('metadata', [$params], DeviceMetadata::class);
|
---|
163 | }
|
---|
164 | /**
|
---|
165 | * Unclaims a device from a customer and removes it from zero-touch enrollment.
|
---|
166 | * (devices.unclaim)
|
---|
167 | *
|
---|
168 | * @param string $partnerId Required. The ID of the reseller partner.
|
---|
169 | * @param UnclaimDeviceRequest $postBody
|
---|
170 | * @param array $optParams Optional parameters.
|
---|
171 | * @return AndroiddeviceprovisioningEmpty
|
---|
172 | * @throws \Google\Service\Exception
|
---|
173 | */
|
---|
174 | public function unclaim($partnerId, UnclaimDeviceRequest $postBody, $optParams = [])
|
---|
175 | {
|
---|
176 | $params = ['partnerId' => $partnerId, 'postBody' => $postBody];
|
---|
177 | $params = array_merge($params, $optParams);
|
---|
178 | return $this->call('unclaim', [$params], AndroiddeviceprovisioningEmpty::class);
|
---|
179 | }
|
---|
180 | /**
|
---|
181 | * Unclaims a batch of devices for a customer asynchronously. Removes the
|
---|
182 | * devices from zero-touch enrollment. To learn more, read [Long‑running batch
|
---|
183 | * operations](/zero-touch/guides/how-it-works#operations).
|
---|
184 | * (devices.unclaimAsync)
|
---|
185 | *
|
---|
186 | * @param string $partnerId Required. The reseller partner ID.
|
---|
187 | * @param UnclaimDevicesRequest $postBody
|
---|
188 | * @param array $optParams Optional parameters.
|
---|
189 | * @return Operation
|
---|
190 | * @throws \Google\Service\Exception
|
---|
191 | */
|
---|
192 | public function unclaimAsync($partnerId, UnclaimDevicesRequest $postBody, $optParams = [])
|
---|
193 | {
|
---|
194 | $params = ['partnerId' => $partnerId, 'postBody' => $postBody];
|
---|
195 | $params = array_merge($params, $optParams);
|
---|
196 | return $this->call('unclaimAsync', [$params], Operation::class);
|
---|
197 | }
|
---|
198 | /**
|
---|
199 | * Updates the reseller metadata attached to a batch of devices. This method
|
---|
200 | * updates devices asynchronously and returns an `Operation` that can be used to
|
---|
201 | * track progress. Read [Long‑running batch operations](/zero-touch/guides/how-
|
---|
202 | * it-works#operations). Android Devices only. (devices.updateMetadataAsync)
|
---|
203 | *
|
---|
204 | * @param string $partnerId Required. The reseller partner ID.
|
---|
205 | * @param UpdateDeviceMetadataInBatchRequest $postBody
|
---|
206 | * @param array $optParams Optional parameters.
|
---|
207 | * @return Operation
|
---|
208 | * @throws \Google\Service\Exception
|
---|
209 | */
|
---|
210 | public function updateMetadataAsync($partnerId, UpdateDeviceMetadataInBatchRequest $postBody, $optParams = [])
|
---|
211 | {
|
---|
212 | $params = ['partnerId' => $partnerId, 'postBody' => $postBody];
|
---|
213 | $params = array_merge($params, $optParams);
|
---|
214 | return $this->call('updateMetadataAsync', [$params], Operation::class);
|
---|
215 | }
|
---|
216 | }
|
---|
217 |
|
---|
218 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
219 | class_alias(PartnersDevices::class, 'Google_Service_AndroidProvisioningPartner_Resource_PartnersDevices');
|
---|