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\ListScreenshotClustersResponse; 21use Google\Service\ToolResults\ScreenshotCluster; 22 23/** 24 * The "clusters" collection of methods. 25 * Typical usage is: 26 * <code> 27 * $toolresultsService = new Google\Service\ToolResults(...); 28 * $clusters = $toolresultsService->clusters; 29 * </code> 30 */ 31class ProjectsHistoriesExecutionsClusters extends \Google\Service\Resource 32{ 33 /** 34 * Retrieves a single screenshot cluster by its ID (clusters.get) 35 * 36 * @param string $projectId A Project id. Required. 37 * @param string $historyId A History id. Required. 38 * @param string $executionId An Execution id. Required. 39 * @param string $clusterId A Cluster id Required. 40 * @param array $optParams Optional parameters. 41 * @return ScreenshotCluster 42 */ 43 public function get($projectId, $historyId, $executionId, $clusterId, $optParams = []) 44 { 45 $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId, 'clusterId' => $clusterId]; 46 $params = array_merge($params, $optParams); 47 return $this->call('get', [$params], ScreenshotCluster::class); 48 } 49 /** 50 * Lists Screenshot Clusters Returns the list of screenshot clusters 51 * corresponding to an execution. Screenshot clusters are created after the 52 * execution is finished. Clusters are created from a set of screenshots. 53 * Between any two screenshots, a matching score is calculated based off their 54 * metadata that determines how similar they are. Screenshots are placed in the 55 * cluster that has screens which have the highest matching scores. 56 * (clusters.listProjectsHistoriesExecutionsClusters) 57 * 58 * @param string $projectId A Project id. Required. 59 * @param string $historyId A History id. Required. 60 * @param string $executionId An Execution id. Required. 61 * @param array $optParams Optional parameters. 62 * @return ListScreenshotClustersResponse 63 */ 64 public function listProjectsHistoriesExecutionsClusters($projectId, $historyId, $executionId, $optParams = []) 65 { 66 $params = ['projectId' => $projectId, 'historyId' => $historyId, 'executionId' => $executionId]; 67 $params = array_merge($params, $optParams); 68 return $this->call('list', [$params], ListScreenshotClustersResponse::class); 69 } 70} 71 72// Adding a class alias for backwards compatibility with the previous class name. 73class_alias(ProjectsHistoriesExecutionsClusters::class, 'Google_Service_ToolResults_Resource_ProjectsHistoriesExecutionsClusters'); 74