[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\Testing\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Testing\CancelDeviceSessionRequest;
|
---|
| 21 | use Google\Service\Testing\DeviceSession;
|
---|
| 22 | use Google\Service\Testing\ListDeviceSessionsResponse;
|
---|
| 23 | use Google\Service\Testing\TestingEmpty;
|
---|
| 24 |
|
---|
| 25 | /**
|
---|
| 26 | * The "deviceSessions" collection of methods.
|
---|
| 27 | * Typical usage is:
|
---|
| 28 | * <code>
|
---|
| 29 | * $testingService = new Google\Service\Testing(...);
|
---|
| 30 | * $deviceSessions = $testingService->projects_deviceSessions;
|
---|
| 31 | * </code>
|
---|
| 32 | */
|
---|
| 33 | class ProjectsDeviceSessions extends \Google\Service\Resource
|
---|
| 34 | {
|
---|
| 35 | /**
|
---|
| 36 | * POST /v1/projects/{project_id}/deviceSessions/{device_session_id}:cancel
|
---|
| 37 | * Changes the DeviceSession to state FINISHED and terminates all connections.
|
---|
| 38 | * Canceled sessions are not deleted and can be retrieved or listed by the user
|
---|
| 39 | * until they expire based on the 28 day deletion policy.
|
---|
| 40 | * (deviceSessions.cancel)
|
---|
| 41 | *
|
---|
| 42 | * @param string $name Required. Name of the DeviceSession, e.g.
|
---|
| 43 | * "projects/{project_id}/deviceSessions/{session_id}"
|
---|
| 44 | * @param CancelDeviceSessionRequest $postBody
|
---|
| 45 | * @param array $optParams Optional parameters.
|
---|
| 46 | * @return TestingEmpty
|
---|
| 47 | * @throws \Google\Service\Exception
|
---|
| 48 | */
|
---|
| 49 | public function cancel($name, CancelDeviceSessionRequest $postBody, $optParams = [])
|
---|
| 50 | {
|
---|
| 51 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 52 | $params = array_merge($params, $optParams);
|
---|
| 53 | return $this->call('cancel', [$params], TestingEmpty::class);
|
---|
| 54 | }
|
---|
| 55 | /**
|
---|
| 56 | * POST /v1/projects/{project_id}/deviceSessions (deviceSessions.create)
|
---|
| 57 | *
|
---|
| 58 | * @param string $parent Required. The Compute Engine project under which this
|
---|
| 59 | * device will be allocated. "projects/{project_id}"
|
---|
| 60 | * @param DeviceSession $postBody
|
---|
| 61 | * @param array $optParams Optional parameters.
|
---|
| 62 | * @return DeviceSession
|
---|
| 63 | * @throws \Google\Service\Exception
|
---|
| 64 | */
|
---|
| 65 | public function create($parent, DeviceSession $postBody, $optParams = [])
|
---|
| 66 | {
|
---|
| 67 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 68 | $params = array_merge($params, $optParams);
|
---|
| 69 | return $this->call('create', [$params], DeviceSession::class);
|
---|
| 70 | }
|
---|
| 71 | /**
|
---|
| 72 | * GET /v1/projects/{project_id}/deviceSessions/{device_session_id} Return a
|
---|
| 73 | * DeviceSession, which documents the allocation status and whether the device
|
---|
| 74 | * is allocated. Clients making requests from this API must poll
|
---|
| 75 | * GetDeviceSession. (deviceSessions.get)
|
---|
| 76 | *
|
---|
| 77 | * @param string $name Required. Name of the DeviceSession, e.g.
|
---|
| 78 | * "projects/{project_id}/deviceSessions/{session_id}"
|
---|
| 79 | * @param array $optParams Optional parameters.
|
---|
| 80 | * @return DeviceSession
|
---|
| 81 | * @throws \Google\Service\Exception
|
---|
| 82 | */
|
---|
| 83 | public function get($name, $optParams = [])
|
---|
| 84 | {
|
---|
| 85 | $params = ['name' => $name];
|
---|
| 86 | $params = array_merge($params, $optParams);
|
---|
| 87 | return $this->call('get', [$params], DeviceSession::class);
|
---|
| 88 | }
|
---|
| 89 | /**
|
---|
| 90 | * GET /v1/projects/{project_id}/deviceSessions Lists device Sessions owned by
|
---|
| 91 | * the project user. (deviceSessions.listProjectsDeviceSessions)
|
---|
| 92 | *
|
---|
| 93 | * @param string $parent Required. The name of the parent to request, e.g.
|
---|
| 94 | * "projects/{project_id}"
|
---|
| 95 | * @param array $optParams Optional parameters.
|
---|
| 96 | *
|
---|
| 97 | * @opt_param string filter Optional. If specified, responses will be filtered
|
---|
| 98 | * by the given filter. Allowed fields are: session_state.
|
---|
| 99 | * @opt_param int pageSize Optional. The maximum number of DeviceSessions to
|
---|
| 100 | * return.
|
---|
| 101 | * @opt_param string pageToken Optional. A continuation token for paging.
|
---|
| 102 | * @return ListDeviceSessionsResponse
|
---|
| 103 | * @throws \Google\Service\Exception
|
---|
| 104 | */
|
---|
| 105 | public function listProjectsDeviceSessions($parent, $optParams = [])
|
---|
| 106 | {
|
---|
| 107 | $params = ['parent' => $parent];
|
---|
| 108 | $params = array_merge($params, $optParams);
|
---|
| 109 | return $this->call('list', [$params], ListDeviceSessionsResponse::class);
|
---|
| 110 | }
|
---|
| 111 | /**
|
---|
| 112 | * PATCH
|
---|
| 113 | * /v1/projects/{projectId}/deviceSessions/deviceSessionId}:updateDeviceSession
|
---|
| 114 | * Updates the current device session to the fields described by the
|
---|
| 115 | * update_mask. (deviceSessions.patch)
|
---|
| 116 | *
|
---|
| 117 | * @param string $name Optional. Name of the DeviceSession, e.g.
|
---|
| 118 | * "projects/{project_id}/deviceSessions/{session_id}"
|
---|
| 119 | * @param DeviceSession $postBody
|
---|
| 120 | * @param array $optParams Optional parameters.
|
---|
| 121 | *
|
---|
| 122 | * @opt_param string updateMask Required. The list of fields to update.
|
---|
| 123 | * @return DeviceSession
|
---|
| 124 | * @throws \Google\Service\Exception
|
---|
| 125 | */
|
---|
| 126 | public function patch($name, DeviceSession $postBody, $optParams = [])
|
---|
| 127 | {
|
---|
| 128 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 129 | $params = array_merge($params, $optParams);
|
---|
| 130 | return $this->call('patch', [$params], DeviceSession::class);
|
---|
| 131 | }
|
---|
| 132 | }
|
---|
| 133 |
|
---|
| 134 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 135 | class_alias(ProjectsDeviceSessions::class, 'Google_Service_Testing_Resource_ProjectsDeviceSessions');
|
---|