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\Dialogflow\Resource; 19 20use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3Experiment; 21use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3ListExperimentsResponse; 22use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3StartExperimentRequest; 23use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3StopExperimentRequest; 24use Google\Service\Dialogflow\GoogleProtobufEmpty; 25 26/** 27 * The "experiments" collection of methods. 28 * Typical usage is: 29 * <code> 30 * $dialogflowService = new Google\Service\Dialogflow(...); 31 * $experiments = $dialogflowService->experiments; 32 * </code> 33 */ 34class ProjectsLocationsAgentsEnvironmentsExperiments extends \Google\Service\Resource 35{ 36 /** 37 * Creates an Experiment in the specified Environment. (experiments.create) 38 * 39 * @param string $parent Required. The Agent to create an Environment for. 40 * Format: `projects//locations//agents//environments/`. 41 * @param GoogleCloudDialogflowCxV3Experiment $postBody 42 * @param array $optParams Optional parameters. 43 * @return GoogleCloudDialogflowCxV3Experiment 44 */ 45 public function create($parent, GoogleCloudDialogflowCxV3Experiment $postBody, $optParams = []) 46 { 47 $params = ['parent' => $parent, 'postBody' => $postBody]; 48 $params = array_merge($params, $optParams); 49 return $this->call('create', [$params], GoogleCloudDialogflowCxV3Experiment::class); 50 } 51 /** 52 * Deletes the specified Experiment. (experiments.delete) 53 * 54 * @param string $name Required. The name of the Environment to delete. Format: 55 * `projects//locations//agents//environments//experiments/`. 56 * @param array $optParams Optional parameters. 57 * @return GoogleProtobufEmpty 58 */ 59 public function delete($name, $optParams = []) 60 { 61 $params = ['name' => $name]; 62 $params = array_merge($params, $optParams); 63 return $this->call('delete', [$params], GoogleProtobufEmpty::class); 64 } 65 /** 66 * Retrieves the specified Experiment. (experiments.get) 67 * 68 * @param string $name Required. The name of the Environment. Format: 69 * `projects//locations//agents//environments//experiments/`. 70 * @param array $optParams Optional parameters. 71 * @return GoogleCloudDialogflowCxV3Experiment 72 */ 73 public function get($name, $optParams = []) 74 { 75 $params = ['name' => $name]; 76 $params = array_merge($params, $optParams); 77 return $this->call('get', [$params], GoogleCloudDialogflowCxV3Experiment::class); 78 } 79 /** 80 * Returns the list of all experiments in the specified Environment. 81 * (experiments.listProjectsLocationsAgentsEnvironmentsExperiments) 82 * 83 * @param string $parent Required. The Environment to list all environments for. 84 * Format: `projects//locations//agents//environments/`. 85 * @param array $optParams Optional parameters. 86 * 87 * @opt_param int pageSize The maximum number of items to return in a single 88 * page. By default 20 and at most 100. 89 * @opt_param string pageToken The next_page_token value returned from a 90 * previous list request. 91 * @return GoogleCloudDialogflowCxV3ListExperimentsResponse 92 */ 93 public function listProjectsLocationsAgentsEnvironmentsExperiments($parent, $optParams = []) 94 { 95 $params = ['parent' => $parent]; 96 $params = array_merge($params, $optParams); 97 return $this->call('list', [$params], GoogleCloudDialogflowCxV3ListExperimentsResponse::class); 98 } 99 /** 100 * Updates the specified Experiment. (experiments.patch) 101 * 102 * @param string $name The name of the experiment. Format: 103 * projects//locations//agents//environments//experiments/.. 104 * @param GoogleCloudDialogflowCxV3Experiment $postBody 105 * @param array $optParams Optional parameters. 106 * 107 * @opt_param string updateMask Required. The mask to control which fields get 108 * updated. 109 * @return GoogleCloudDialogflowCxV3Experiment 110 */ 111 public function patch($name, GoogleCloudDialogflowCxV3Experiment $postBody, $optParams = []) 112 { 113 $params = ['name' => $name, 'postBody' => $postBody]; 114 $params = array_merge($params, $optParams); 115 return $this->call('patch', [$params], GoogleCloudDialogflowCxV3Experiment::class); 116 } 117 /** 118 * Starts the specified Experiment. This rpc only changes the state of 119 * experiment from PENDING to RUNNING. (experiments.start) 120 * 121 * @param string $name Required. Resource name of the experiment to start. 122 * Format: `projects//locations//agents//environments//experiments/`. 123 * @param GoogleCloudDialogflowCxV3StartExperimentRequest $postBody 124 * @param array $optParams Optional parameters. 125 * @return GoogleCloudDialogflowCxV3Experiment 126 */ 127 public function start($name, GoogleCloudDialogflowCxV3StartExperimentRequest $postBody, $optParams = []) 128 { 129 $params = ['name' => $name, 'postBody' => $postBody]; 130 $params = array_merge($params, $optParams); 131 return $this->call('start', [$params], GoogleCloudDialogflowCxV3Experiment::class); 132 } 133 /** 134 * Stops the specified Experiment. This rpc only changes the state of experiment 135 * from RUNNING to DONE. (experiments.stop) 136 * 137 * @param string $name Required. Resource name of the experiment to stop. 138 * Format: `projects//locations//agents//environments//experiments/`. 139 * @param GoogleCloudDialogflowCxV3StopExperimentRequest $postBody 140 * @param array $optParams Optional parameters. 141 * @return GoogleCloudDialogflowCxV3Experiment 142 */ 143 public function stop($name, GoogleCloudDialogflowCxV3StopExperimentRequest $postBody, $optParams = []) 144 { 145 $params = ['name' => $name, 'postBody' => $postBody]; 146 $params = array_merge($params, $optParams); 147 return $this->call('stop', [$params], GoogleCloudDialogflowCxV3Experiment::class); 148 } 149} 150 151// Adding a class alias for backwards compatibility with the previous class name. 152class_alias(ProjectsLocationsAgentsEnvironmentsExperiments::class, 'Google_Service_Dialogflow_Resource_ProjectsLocationsAgentsEnvironmentsExperiments'); 153