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\GoogleCloudDialogflowCxV3ListTransitionRouteGroupsResponse;
21use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3TransitionRouteGroup;
22use Google\Service\Dialogflow\GoogleProtobufEmpty;
23
24/**
25 * The "transitionRouteGroups" collection of methods.
26 * Typical usage is:
27 *  <code>
28 *   $dialogflowService = new Google\Service\Dialogflow(...);
29 *   $transitionRouteGroups = $dialogflowService->transitionRouteGroups;
30 *  </code>
31 */
32class ProjectsLocationsAgentsFlowsTransitionRouteGroups extends \Google\Service\Resource
33{
34  /**
35   * Creates an TransitionRouteGroup in the specified flow. Note: You should
36   * always train a flow prior to sending it queries. See the [training
37   * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
38   * (transitionRouteGroups.create)
39   *
40   * @param string $parent Required. The flow to create an TransitionRouteGroup
41   * for. Format: `projects//locations//agents//flows/`.
42   * @param GoogleCloudDialogflowCxV3TransitionRouteGroup $postBody
43   * @param array $optParams Optional parameters.
44   *
45   * @opt_param string languageCode The language of the following fields in
46   * `TransitionRouteGroup`: *
47   * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` * `Tran
48   * sitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` If
49   * not specified, the agent's default language is used. [Many
50   * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
51   * are supported. Note: languages must be enabled in the agent before they can
52   * be used.
53   * @return GoogleCloudDialogflowCxV3TransitionRouteGroup
54   */
55  public function create($parent, GoogleCloudDialogflowCxV3TransitionRouteGroup $postBody, $optParams = [])
56  {
57    $params = ['parent' => $parent, 'postBody' => $postBody];
58    $params = array_merge($params, $optParams);
59    return $this->call('create', [$params], GoogleCloudDialogflowCxV3TransitionRouteGroup::class);
60  }
61  /**
62   * Deletes the specified TransitionRouteGroup. Note: You should always train a
63   * flow prior to sending it queries. See the [training
64   * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
65   * (transitionRouteGroups.delete)
66   *
67   * @param string $name Required. The name of the TransitionRouteGroup to delete.
68   * Format: `projects//locations//agents//flows//transitionRouteGroups/`.
69   * @param array $optParams Optional parameters.
70   *
71   * @opt_param bool force This field has no effect for transition route group
72   * that no page is using. If the transition route group is referenced by any
73   * page: * If `force` is set to false, an error will be returned with message
74   * indicating pages that reference the transition route group. * If `force` is
75   * set to true, Dialogflow will remove the transition route group, as well as
76   * any reference to it.
77   * @return GoogleProtobufEmpty
78   */
79  public function delete($name, $optParams = [])
80  {
81    $params = ['name' => $name];
82    $params = array_merge($params, $optParams);
83    return $this->call('delete', [$params], GoogleProtobufEmpty::class);
84  }
85  /**
86   * Retrieves the specified TransitionRouteGroup. (transitionRouteGroups.get)
87   *
88   * @param string $name Required. The name of the TransitionRouteGroup. Format:
89   * `projects//locations//agents//flows//transitionRouteGroups/`.
90   * @param array $optParams Optional parameters.
91   *
92   * @opt_param string languageCode The language to retrieve the transition route
93   * group for. The following fields are language dependent: *
94   * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` * `Tran
95   * sitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` If
96   * not specified, the agent's default language is used. [Many
97   * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
98   * are supported. Note: languages must be enabled in the agent before they can
99   * be used.
100   * @return GoogleCloudDialogflowCxV3TransitionRouteGroup
101   */
102  public function get($name, $optParams = [])
103  {
104    $params = ['name' => $name];
105    $params = array_merge($params, $optParams);
106    return $this->call('get', [$params], GoogleCloudDialogflowCxV3TransitionRouteGroup::class);
107  }
108  /**
109   * Returns the list of all transition route groups in the specified flow.
110   * (transitionRouteGroups.listProjectsLocationsAgentsFlowsTransitionRouteGroups)
111   *
112   * @param string $parent Required. The flow to list all transition route groups
113   * for. Format: `projects//locations//agents//flows/`.
114   * @param array $optParams Optional parameters.
115   *
116   * @opt_param string languageCode The language to list transition route groups
117   * for. The following fields are language dependent: *
118   * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` * `Tran
119   * sitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` If
120   * not specified, the agent's default language is used. [Many
121   * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
122   * are supported. Note: languages must be enabled in the agent before they can
123   * be used.
124   * @opt_param int pageSize The maximum number of items to return in a single
125   * page. By default 100 and at most 1000.
126   * @opt_param string pageToken The next_page_token value returned from a
127   * previous list request.
128   * @return GoogleCloudDialogflowCxV3ListTransitionRouteGroupsResponse
129   */
130  public function listProjectsLocationsAgentsFlowsTransitionRouteGroups($parent, $optParams = [])
131  {
132    $params = ['parent' => $parent];
133    $params = array_merge($params, $optParams);
134    return $this->call('list', [$params], GoogleCloudDialogflowCxV3ListTransitionRouteGroupsResponse::class);
135  }
136  /**
137   * Updates the specified TransitionRouteGroup. Note: You should always train a
138   * flow prior to sending it queries. See the [training
139   * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
140   * (transitionRouteGroups.patch)
141   *
142   * @param string $name The unique identifier of the transition route group.
143   * TransitionRouteGroups.CreateTransitionRouteGroup populates the name
144   * automatically. Format:
145   * `projects//locations//agents//flows//transitionRouteGroups/`.
146   * @param GoogleCloudDialogflowCxV3TransitionRouteGroup $postBody
147   * @param array $optParams Optional parameters.
148   *
149   * @opt_param string languageCode The language of the following fields in
150   * `TransitionRouteGroup`: *
151   * `TransitionRouteGroup.transition_routes.trigger_fulfillment.messages` * `Tran
152   * sitionRouteGroup.transition_routes.trigger_fulfillment.conditional_cases` If
153   * not specified, the agent's default language is used. [Many
154   * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
155   * are supported. Note: languages must be enabled in the agent before they can
156   * be used.
157   * @opt_param string updateMask The mask to control which fields get updated.
158   * @return GoogleCloudDialogflowCxV3TransitionRouteGroup
159   */
160  public function patch($name, GoogleCloudDialogflowCxV3TransitionRouteGroup $postBody, $optParams = [])
161  {
162    $params = ['name' => $name, 'postBody' => $postBody];
163    $params = array_merge($params, $optParams);
164    return $this->call('patch', [$params], GoogleCloudDialogflowCxV3TransitionRouteGroup::class);
165  }
166}
167
168// Adding a class alias for backwards compatibility with the previous class name.
169class_alias(ProjectsLocationsAgentsFlowsTransitionRouteGroups::class, 'Google_Service_Dialogflow_Resource_ProjectsLocationsAgentsFlowsTransitionRouteGroups');
170