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\ListPerfSampleSeriesResponse;
21use Google\Service\ToolResults\PerfSampleSeries;
22
23/**
24 * The "perfSampleSeries" collection of methods.
25 * Typical usage is:
26 *  <code>
27 *   $toolresultsService = new Google\Service\ToolResults(...);
28 *   $perfSampleSeries = $toolresultsService->perfSampleSeries;
29 *  </code>
30 */
31class ProjectsHistoriesExecutionsStepsPerfSampleSeries extends \Google\Service\Resource
32{
33  /**
34   * Creates a PerfSampleSeries. May return any of the following error code(s): -
35   * ALREADY_EXISTS - PerfMetricSummary already exists for the given Step -
36   * NOT_FOUND - The containing Step does not exist (perfSampleSeries.create)
37   *
38   * @param string $projectId The cloud project
39   * @param string $historyId A tool results history ID.
40   * @param string $executionId A tool results execution ID.
41   * @param string $stepId A tool results step ID.
42   * @param PerfSampleSeries $postBody
43   * @param array $optParams Optional parameters.
44   * @return PerfSampleSeries
45   */
46  public function create($projectId, $historyId, $executionId, $stepId, PerfSampleSeries $postBody, $optParams = [])
47  {
48    $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId, 'stepId' => $stepId, 'postBody' => $postBody];
49    $params = array_merge($params, $optParams);
50    return $this->call('create', [$params], PerfSampleSeries::class);
51  }
52  /**
53   * Gets a PerfSampleSeries. May return any of the following error code(s): -
54   * NOT_FOUND - The specified PerfSampleSeries does not exist
55   * (perfSampleSeries.get)
56   *
57   * @param string $projectId The cloud project
58   * @param string $historyId A tool results history ID.
59   * @param string $executionId A tool results execution ID.
60   * @param string $stepId A tool results step ID.
61   * @param string $sampleSeriesId A sample series id
62   * @param array $optParams Optional parameters.
63   * @return PerfSampleSeries
64   */
65  public function get($projectId, $historyId, $executionId, $stepId, $sampleSeriesId, $optParams = [])
66  {
67    $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId, 'stepId' => $stepId, 'sampleSeriesId' => $sampleSeriesId];
68    $params = array_merge($params, $optParams);
69    return $this->call('get', [$params], PerfSampleSeries::class);
70  }
71  /**
72   * Lists PerfSampleSeries for a given Step. The request provides an optional
73   * filter which specifies one or more PerfMetricsType to include in the result;
74   * if none returns all. The resulting PerfSampleSeries are sorted by ids. May
75   * return any of the following canonical error codes: - NOT_FOUND - The
76   * containing Step does not exist
77   * (perfSampleSeries.listProjectsHistoriesExecutionsStepsPerfSampleSeries)
78   *
79   * @param string $projectId The cloud project
80   * @param string $historyId A tool results history ID.
81   * @param string $executionId A tool results execution ID.
82   * @param string $stepId A tool results step ID.
83   * @param array $optParams Optional parameters.
84   *
85   * @opt_param string filter Specify one or more PerfMetricType values such as
86   * CPU to filter the result
87   * @return ListPerfSampleSeriesResponse
88   */
89  public function listProjectsHistoriesExecutionsStepsPerfSampleSeries($projectId, $historyId, $executionId, $stepId, $optParams = [])
90  {
91    $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId, 'stepId' => $stepId];
92    $params = array_merge($params, $optParams);
93    return $this->call('list', [$params], ListPerfSampleSeriesResponse::class);
94  }
95}
96
97// Adding a class alias for backwards compatibility with the previous class name.
98class_alias(ProjectsHistoriesExecutionsStepsPerfSampleSeries::class, 'Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsStepsPerfSampleSeries');
99