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\ToolResults\Resource;
19
20use Google\Service\ToolResults\ListTestCasesResponse;
21use Google\Service\ToolResults\TestCase;
22
23/**
24 * The "testCases" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $toolresultsService = new Google\Service\ToolResults(...);
28 *   $testCases = $toolresultsService->testCases;
29 *  </code>
30 */
31class ProjectsHistoriesExecutionsStepsTestCases extends \Google\Service\Resource
32{
33  /**
34   * Gets details of a Test Case for a Step. Experimental test cases API. Still in
35   * active development. May return any of the following canonical error codes: -
36   * PERMISSION_DENIED - if the user is not authorized to write to project -
37   * INVALID_ARGUMENT - if the request is malformed - NOT_FOUND - if the
38   * containing Test Case does not exist (testCases.get)
39   *
40   * @param string $projectId A Project id. Required.
41   * @param string $historyId A History id. Required.
42   * @param string $executionId A Execution id Required.
43   * @param string $stepId A Step id. Note: This step must include a
44   * TestExecutionStep. Required.
45   * @param string $testCaseId A Test Case id. Required.
46   * @param array $optParams Optional parameters.
47   * @return TestCase
48   */
49  public function get($projectId, $historyId, $executionId, $stepId, $testCaseId, $optParams = [])
50  {
51    $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId, 'stepId' => $stepId, 'testCaseId' => $testCaseId];
52    $params = array_merge($params, $optParams);
53    return $this->call('get', [$params], TestCase::class);
54  }
55  /**
56   * Lists Test Cases attached to a Step. Experimental test cases API. Still in
57   * active development. 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
60   * containing Step does not exist
61   * (testCases.listProjectsHistoriesExecutionsStepsTestCases)
62   *
63   * @param string $projectId A Project id. Required.
64   * @param string $historyId A History id. Required.
65   * @param string $executionId A Execution id Required.
66   * @param string $stepId A Step id. Note: This step must include a
67   * TestExecutionStep. Required.
68   * @param array $optParams Optional parameters.
69   *
70   * @opt_param int pageSize The maximum number of TestCases to fetch. Default
71   * value: 100. The server will use this default if the field is not set or has a
72   * value of 0. Optional.
73   * @opt_param string pageToken A continuation token to resume the query at the
74   * next item. Optional.
75   * @return ListTestCasesResponse
76   */
77  public function listProjectsHistoriesExecutionsStepsTestCases($projectId, $historyId, $executionId, $stepId, $optParams = [])
78  {
79    $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId, 'stepId' => $stepId];
80    $params = array_merge($params, $optParams);
81    return $this->call('list', [$params], ListTestCasesResponse::class);
82  }
83}
84
85// Adding a class alias for backwards compatibility with the previous class name.
86class_alias(ProjectsHistoriesExecutionsStepsTestCases::class, 'Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsStepsTestCases');
87