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\BatchCreatePerfSamplesRequest;
21use Google\Service\ToolResults\BatchCreatePerfSamplesResponse;
22use Google\Service\ToolResults\ListPerfSamplesResponse;
23
24/**
25 * The "samples" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $toolresultsService = new Google\Service\ToolResults(...);
29 *   $samples = $toolresultsService->samples;
30 *  </code>
31 */
32class ProjectsHistoriesExecutionsStepsPerfSampleSeriesSamples extends \Google\Service\Resource
33{
34  /**
35   * Creates a batch of PerfSamples - a client can submit multiple batches of Perf
36   * Samples through repeated calls to this method in order to split up a large
37   * request payload - duplicates and existing timestamp entries will be ignored.
38   * - the batch operation may partially succeed - the set of elements
39   * successfully inserted is returned in the response (omits items which already
40   * existed in the database). May return any of the following canonical error
41   * codes: - NOT_FOUND - The containing PerfSampleSeries does not exist
42   * (samples.batchCreate)
43   *
44   * @param string $projectId The cloud project
45   * @param string $historyId A tool results history ID.
46   * @param string $executionId A tool results execution ID.
47   * @param string $stepId A tool results step ID.
48   * @param string $sampleSeriesId A sample series id
49   * @param BatchCreatePerfSamplesRequest $postBody
50   * @param array $optParams Optional parameters.
51   * @return BatchCreatePerfSamplesResponse
52   */
53  public function batchCreate($projectId, $historyId, $executionId, $stepId, $sampleSeriesId, BatchCreatePerfSamplesRequest $postBody, $optParams = [])
54  {
55    $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId, 'stepId' => $stepId, 'sampleSeriesId' => $sampleSeriesId, 'postBody' => $postBody];
56    $params = array_merge($params, $optParams);
57    return $this->call('batchCreate', [$params], BatchCreatePerfSamplesResponse::class);
58  }
59  /**
60   * Lists the Performance Samples of a given Sample Series - The list results are
61   * sorted by timestamps ascending - The default page size is 500 samples; and
62   * maximum size allowed 5000 - The response token indicates the last returned
63   * PerfSample timestamp - When the results size exceeds the page size, submit a
64   * subsequent request including the page token to return the rest of the samples
65   * up to the page limit May return any of the following canonical error codes: -
66   * OUT_OF_RANGE - The specified request page_token is out of valid range -
67   * NOT_FOUND - The containing PerfSampleSeries does not exist
68   * (samples.listProjectsHistoriesExecutionsStepsPerfSampleSeriesSamples)
69   *
70   * @param string $projectId The cloud project
71   * @param string $historyId A tool results history ID.
72   * @param string $executionId A tool results execution ID.
73   * @param string $stepId A tool results step ID.
74   * @param string $sampleSeriesId A sample series id
75   * @param array $optParams Optional parameters.
76   *
77   * @opt_param int pageSize The default page size is 500 samples, and the maximum
78   * size is 5000. If the page_size is greater than 5000, the effective page size
79   * will be 5000
80   * @opt_param string pageToken Optional, the next_page_token returned in the
81   * previous response
82   * @return ListPerfSamplesResponse
83   */
84  public function listProjectsHistoriesExecutionsStepsPerfSampleSeriesSamples($projectId, $historyId, $executionId, $stepId, $sampleSeriesId, $optParams = [])
85  {
86    $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId, 'stepId' => $stepId, 'sampleSeriesId' => $sampleSeriesId];
87    $params = array_merge($params, $optParams);
88    return $this->call('list', [$params], ListPerfSamplesResponse::class);
89  }
90}
91
92// Adding a class alias for backwards compatibility with the previous class name.
93class_alias(ProjectsHistoriesExecutionsStepsPerfSampleSeriesSamples::class, 'Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsStepsPerfSampleSeriesSamples');
94