[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\ToolResults\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\ToolResults\Execution;
|
---|
| 21 | use Google\Service\ToolResults\ListExecutionsResponse;
|
---|
| 22 |
|
---|
| 23 | /**
|
---|
| 24 | * The "executions" collection of methods.
|
---|
| 25 | * Typical usage is:
|
---|
| 26 | * <code>
|
---|
| 27 | * $toolresultsService = new Google\Service\ToolResults(...);
|
---|
| 28 | * $executions = $toolresultsService->projects_histories_executions;
|
---|
| 29 | * </code>
|
---|
| 30 | */
|
---|
| 31 | class ProjectsHistoriesExecutions extends \Google\Service\Resource
|
---|
| 32 | {
|
---|
| 33 | /**
|
---|
| 34 | * Creates an Execution. The returned Execution will have the id set. May return
|
---|
| 35 | * any of the following canonical error codes: - PERMISSION_DENIED - if the user
|
---|
| 36 | * is not authorized to write to project - INVALID_ARGUMENT - if the request is
|
---|
| 37 | * malformed - NOT_FOUND - if the containing History does not exist
|
---|
| 38 | * (executions.create)
|
---|
| 39 | *
|
---|
| 40 | * @param string $projectId A Project id. Required.
|
---|
| 41 | * @param string $historyId A History id. Required.
|
---|
| 42 | * @param Execution $postBody
|
---|
| 43 | * @param array $optParams Optional parameters.
|
---|
| 44 | *
|
---|
| 45 | * @opt_param string requestId A unique request ID for server to detect
|
---|
| 46 | * duplicated requests. For example, a UUID. Optional, but strongly recommended.
|
---|
| 47 | * @return Execution
|
---|
| 48 | * @throws \Google\Service\Exception
|
---|
| 49 | */
|
---|
| 50 | public function create($projectId, $historyId, Execution $postBody, $optParams = [])
|
---|
| 51 | {
|
---|
| 52 | $params = ['projectId' => $projectId, 'historyId' => $historyId, 'postBody' => $postBody];
|
---|
| 53 | $params = array_merge($params, $optParams);
|
---|
| 54 | return $this->call('create', [$params], Execution::class);
|
---|
| 55 | }
|
---|
| 56 | /**
|
---|
| 57 | * Gets an Execution. May return any of the following canonical error codes: -
|
---|
| 58 | * PERMISSION_DENIED - if the user is not authorized to write to project -
|
---|
| 59 | * INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the Execution
|
---|
| 60 | * does not exist (executions.get)
|
---|
| 61 | *
|
---|
| 62 | * @param string $projectId A Project id. Required.
|
---|
| 63 | * @param string $historyId A History id. Required.
|
---|
| 64 | * @param string $executionId An Execution id. Required.
|
---|
| 65 | * @param array $optParams Optional parameters.
|
---|
| 66 | * @return Execution
|
---|
| 67 | * @throws \Google\Service\Exception
|
---|
| 68 | */
|
---|
| 69 | public function get($projectId, $historyId, $executionId, $optParams = [])
|
---|
| 70 | {
|
---|
| 71 | $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId];
|
---|
| 72 | $params = array_merge($params, $optParams);
|
---|
| 73 | return $this->call('get', [$params], Execution::class);
|
---|
| 74 | }
|
---|
| 75 | /**
|
---|
| 76 | * Lists Executions for a given History. The executions are sorted by
|
---|
| 77 | * creation_time in descending order. The execution_id key will be used to order
|
---|
| 78 | * the executions with the same creation_time. May return any of the following
|
---|
| 79 | * canonical error codes: - PERMISSION_DENIED - if the user is not authorized to
|
---|
| 80 | * read project - INVALID_ARGUMENT - if the request is malformed - NOT_FOUND -
|
---|
| 81 | * if the containing History does not exist
|
---|
| 82 | * (executions.listProjectsHistoriesExecutions)
|
---|
| 83 | *
|
---|
| 84 | * @param string $projectId A Project id. Required.
|
---|
| 85 | * @param string $historyId A History id. Required.
|
---|
| 86 | * @param array $optParams Optional parameters.
|
---|
| 87 | *
|
---|
| 88 | * @opt_param int pageSize The maximum number of Executions to fetch. Default
|
---|
| 89 | * value: 25. The server will use this default if the field is not set or has a
|
---|
| 90 | * value of 0. Optional.
|
---|
| 91 | * @opt_param string pageToken A continuation token to resume the query at the
|
---|
| 92 | * next item. Optional.
|
---|
| 93 | * @return ListExecutionsResponse
|
---|
| 94 | * @throws \Google\Service\Exception
|
---|
| 95 | */
|
---|
| 96 | public function listProjectsHistoriesExecutions($projectId, $historyId, $optParams = [])
|
---|
| 97 | {
|
---|
| 98 | $params = ['projectId' => $projectId, 'historyId' => $historyId];
|
---|
| 99 | $params = array_merge($params, $optParams);
|
---|
| 100 | return $this->call('list', [$params], ListExecutionsResponse::class);
|
---|
| 101 | }
|
---|
| 102 | /**
|
---|
| 103 | * Updates an existing Execution with the supplied partial entity. May return
|
---|
| 104 | * any of the following canonical error codes: - PERMISSION_DENIED - if the user
|
---|
| 105 | * is not authorized to write to project - INVALID_ARGUMENT - if the request is
|
---|
| 106 | * malformed - FAILED_PRECONDITION - if the requested state transition is
|
---|
| 107 | * illegal - NOT_FOUND - if the containing History does not exist
|
---|
| 108 | * (executions.patch)
|
---|
| 109 | *
|
---|
| 110 | * @param string $projectId A Project id. Required.
|
---|
| 111 | * @param string $historyId Required.
|
---|
| 112 | * @param string $executionId Required.
|
---|
| 113 | * @param Execution $postBody
|
---|
| 114 | * @param array $optParams Optional parameters.
|
---|
| 115 | *
|
---|
| 116 | * @opt_param string requestId A unique request ID for server to detect
|
---|
| 117 | * duplicated requests. For example, a UUID. Optional, but strongly recommended.
|
---|
| 118 | * @return Execution
|
---|
| 119 | * @throws \Google\Service\Exception
|
---|
| 120 | */
|
---|
| 121 | public function patch($projectId, $historyId, $executionId, Execution $postBody, $optParams = [])
|
---|
| 122 | {
|
---|
| 123 | $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId, 'postBody' => $postBody];
|
---|
| 124 | $params = array_merge($params, $optParams);
|
---|
| 125 | return $this->call('patch', [$params], Execution::class);
|
---|
| 126 | }
|
---|
| 127 | }
|
---|
| 128 |
|
---|
| 129 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 130 | class_alias(ProjectsHistoriesExecutions::class, 'Google_Service_ToolResults_Resource_ProjectsHistoriesExecutions');
|
---|