Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/DeviceRun.php
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,22 @@ public function __construct($clientOrConfig = [], $rootUrl = null)
'sessions',
[
'methods' => [
'cancel' => [
'batchGet' => [
'path' => 'v1alpha/{+parent}/sessions:batchGet',
'httpMethod' => 'GET',
'parameters' => [
'parent' => [
'location' => 'path',
'type' => 'string',
'required' => true,
],
'names' => [
'location' => 'query',
'type' => 'string',
'repeated' => true,
],
],
],'cancel' => [
'path' => 'v1alpha/{+name}:cancel',
'httpMethod' => 'POST',
'parameters' => [
Expand Down
45 changes: 45 additions & 0 deletions src/DeviceRun/BatchGetSessionsResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php
/*
* Copyright 2014 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/

namespace Google\Service\DeviceRun;

class BatchGetSessionsResponse extends \Google\Collection
{
protected $collection_key = 'sessions';
protected $sessionsType = Session::class;
protected $sessionsDataType = 'array';

/**
* The requested sessions, in the same order as the `names` in the request.
*
* @param Session[] $sessions
*/
public function setSessions($sessions)
{
$this->sessions = $sessions;
}
/**
* @return Session[]
*/
public function getSessions()
{
return $this->sessions;
}
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(BatchGetSessionsResponse::class, 'Google_Service_DeviceRun_BatchGetSessionsResponse');
32 changes: 32 additions & 0 deletions src/DeviceRun/Resource/ProjectsLocationsSessions.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

namespace Google\Service\DeviceRun\Resource;

use Google\Service\DeviceRun\BatchGetSessionsResponse;
use Google\Service\DeviceRun\CancelSessionRequest;
use Google\Service\DeviceRun\CancelSessionResponse;
use Google\Service\DeviceRun\GoogleLongrunningOperation;
Expand All @@ -33,6 +34,37 @@
*/
class ProjectsLocationsSessions extends \Google\Service\Resource
{
/**
* Retrieves multiple automation sessions in a single batch request. Sessions
* are returned in the same order as the `names` in the request. If any of the
* requested sessions does not exist, the whole request fails with `NOT_FOUND`
* and no sessions are returned. When calling this method over HTTP/REST with a
* large number of `names`, the request URL may exceed the maximum URL length
* (about 16 KB) and be rejected. In that case, send a `POST` request to the
* same URL with the `X-HTTP-Method-Override: GET` header and pass the request
* parameters in a JSON (`application/json`) or form-encoded
* (`application/x-www-form-urlencoded`) body. See
* https://cloud.google.com/apis/docs/http#long_request_urls.
* (sessions.batchGet)
*
* @param string $parent Required. The parent resource shared by all sessions
* being retrieved. Format: `projects/{project}/locations/{location}`. The
* `parent` field in the `BatchGetSessionsRequest` message must match the
* `parent` of all `Session` resource names in `names`.
* @param array $optParams Optional parameters.
*
* @opt_param string names Required. The names of the sessions to retrieve. A
* maximum of 500 sessions can be retrieved in a batch. Format:
* `projects/{project}/locations/{location}/sessions/{session}`.
* @return BatchGetSessionsResponse
* @throws \Google\Service\Exception
*/
public function batchGet($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('batchGet', [$params], BatchGetSessionsResponse::class);
}
/**
* Cancels an in-progress automation session. This RPC returns immediately and
* cancellation proceeds asynchronously. If the session is already finished,
Expand Down
Loading