[e3d4e0a] | 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 |
|
---|
| 18 | namespace Google\Service\Dialogflow\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3ListPagesResponse;
|
---|
| 21 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3Page;
|
---|
| 22 | use Google\Service\Dialogflow\GoogleProtobufEmpty;
|
---|
| 23 |
|
---|
| 24 | /**
|
---|
| 25 | * The "pages" collection of methods.
|
---|
| 26 | * Typical usage is:
|
---|
| 27 | * <code>
|
---|
| 28 | * $dialogflowService = new Google\Service\Dialogflow(...);
|
---|
| 29 | * $pages = $dialogflowService->projects_locations_agents_flows_pages;
|
---|
| 30 | * </code>
|
---|
| 31 | */
|
---|
| 32 | class ProjectsLocationsAgentsFlowsPages extends \Google\Service\Resource
|
---|
| 33 | {
|
---|
| 34 | /**
|
---|
| 35 | * Creates a page in the specified flow. Note: You should always train a flow
|
---|
| 36 | * prior to sending it queries. See the [training
|
---|
| 37 | * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
|
---|
| 38 | * (pages.create)
|
---|
| 39 | *
|
---|
| 40 | * @param string $parent Required. The flow to create a page for. Format:
|
---|
| 41 | * `projects//locations//agents//flows/`.
|
---|
| 42 | * @param GoogleCloudDialogflowCxV3Page $postBody
|
---|
| 43 | * @param array $optParams Optional parameters.
|
---|
| 44 | *
|
---|
| 45 | * @opt_param string languageCode The language of the following fields in
|
---|
| 46 | * `page`: * `Page.entry_fulfillment.messages` *
|
---|
| 47 | * `Page.entry_fulfillment.conditional_cases` *
|
---|
| 48 | * `Page.event_handlers.trigger_fulfillment.messages` *
|
---|
| 49 | * `Page.event_handlers.trigger_fulfillment.conditional_cases` *
|
---|
| 50 | * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` * `P
|
---|
| 51 | * age.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_case
|
---|
| 52 | * s` * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` *
|
---|
| 53 | * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases
|
---|
| 54 | * ` * `Page.transition_routes.trigger_fulfillment.messages` *
|
---|
| 55 | * `Page.transition_routes.trigger_fulfillment.conditional_cases` If not
|
---|
| 56 | * specified, the agent's default language is used. [Many
|
---|
| 57 | * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
|
---|
| 58 | * are supported. Note: languages must be enabled in the agent before they can
|
---|
| 59 | * be used.
|
---|
| 60 | * @return GoogleCloudDialogflowCxV3Page
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function create($parent, GoogleCloudDialogflowCxV3Page $postBody, $optParams = [])
|
---|
| 64 | {
|
---|
| 65 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 66 | $params = array_merge($params, $optParams);
|
---|
| 67 | return $this->call('create', [$params], GoogleCloudDialogflowCxV3Page::class);
|
---|
| 68 | }
|
---|
| 69 | /**
|
---|
| 70 | * Deletes the specified page. Note: You should always train a flow prior to
|
---|
| 71 | * sending it queries. See the [training
|
---|
| 72 | * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
|
---|
| 73 | * (pages.delete)
|
---|
| 74 | *
|
---|
| 75 | * @param string $name Required. The name of the page to delete. Format:
|
---|
| 76 | * `projects//locations//agents//Flows//pages/`.
|
---|
| 77 | * @param array $optParams Optional parameters.
|
---|
| 78 | *
|
---|
| 79 | * @opt_param bool force This field has no effect for pages with no incoming
|
---|
| 80 | * transitions. For pages with incoming transitions: * If `force` is set to
|
---|
| 81 | * false, an error will be returned with message indicating the incoming
|
---|
| 82 | * transitions. * If `force` is set to true, Dialogflow will remove the page, as
|
---|
| 83 | * well as any transitions to the page (i.e. Target page in event handlers or
|
---|
| 84 | * Target page in transition routes that point to this page will be cleared).
|
---|
| 85 | * @return GoogleProtobufEmpty
|
---|
| 86 | * @throws \Google\Service\Exception
|
---|
| 87 | */
|
---|
| 88 | public function delete($name, $optParams = [])
|
---|
| 89 | {
|
---|
| 90 | $params = ['name' => $name];
|
---|
| 91 | $params = array_merge($params, $optParams);
|
---|
| 92 | return $this->call('delete', [$params], GoogleProtobufEmpty::class);
|
---|
| 93 | }
|
---|
| 94 | /**
|
---|
| 95 | * Retrieves the specified page. (pages.get)
|
---|
| 96 | *
|
---|
| 97 | * @param string $name Required. The name of the page. Format:
|
---|
| 98 | * `projects//locations//agents//flows//pages/`.
|
---|
| 99 | * @param array $optParams Optional parameters.
|
---|
| 100 | *
|
---|
| 101 | * @opt_param string languageCode The language to retrieve the page for. The
|
---|
| 102 | * following fields are language dependent: * `Page.entry_fulfillment.messages`
|
---|
| 103 | * * `Page.entry_fulfillment.conditional_cases` *
|
---|
| 104 | * `Page.event_handlers.trigger_fulfillment.messages` *
|
---|
| 105 | * `Page.event_handlers.trigger_fulfillment.conditional_cases` *
|
---|
| 106 | * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` * `P
|
---|
| 107 | * age.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_case
|
---|
| 108 | * s` * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` *
|
---|
| 109 | * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases
|
---|
| 110 | * ` * `Page.transition_routes.trigger_fulfillment.messages` *
|
---|
| 111 | * `Page.transition_routes.trigger_fulfillment.conditional_cases` If not
|
---|
| 112 | * specified, the agent's default language is used. [Many
|
---|
| 113 | * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
|
---|
| 114 | * are supported. Note: languages must be enabled in the agent before they can
|
---|
| 115 | * be used.
|
---|
| 116 | * @return GoogleCloudDialogflowCxV3Page
|
---|
| 117 | * @throws \Google\Service\Exception
|
---|
| 118 | */
|
---|
| 119 | public function get($name, $optParams = [])
|
---|
| 120 | {
|
---|
| 121 | $params = ['name' => $name];
|
---|
| 122 | $params = array_merge($params, $optParams);
|
---|
| 123 | return $this->call('get', [$params], GoogleCloudDialogflowCxV3Page::class);
|
---|
| 124 | }
|
---|
| 125 | /**
|
---|
| 126 | * Returns the list of all pages in the specified flow.
|
---|
| 127 | * (pages.listProjectsLocationsAgentsFlowsPages)
|
---|
| 128 | *
|
---|
| 129 | * @param string $parent Required. The flow to list all pages for. Format:
|
---|
| 130 | * `projects//locations//agents//flows/`.
|
---|
| 131 | * @param array $optParams Optional parameters.
|
---|
| 132 | *
|
---|
| 133 | * @opt_param string languageCode The language to list pages for. The following
|
---|
| 134 | * fields are language dependent: * `Page.entry_fulfillment.messages` *
|
---|
| 135 | * `Page.entry_fulfillment.conditional_cases` *
|
---|
| 136 | * `Page.event_handlers.trigger_fulfillment.messages` *
|
---|
| 137 | * `Page.event_handlers.trigger_fulfillment.conditional_cases` *
|
---|
| 138 | * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` * `P
|
---|
| 139 | * age.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_case
|
---|
| 140 | * s` * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` *
|
---|
| 141 | * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases
|
---|
| 142 | * ` * `Page.transition_routes.trigger_fulfillment.messages` *
|
---|
| 143 | * `Page.transition_routes.trigger_fulfillment.conditional_cases` If not
|
---|
| 144 | * specified, the agent's default language is used. [Many
|
---|
| 145 | * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
|
---|
| 146 | * are supported. Note: languages must be enabled in the agent before they can
|
---|
| 147 | * be used.
|
---|
| 148 | * @opt_param int pageSize The maximum number of items to return in a single
|
---|
| 149 | * page. By default 100 and at most 1000.
|
---|
| 150 | * @opt_param string pageToken The next_page_token value returned from a
|
---|
| 151 | * previous list request.
|
---|
| 152 | * @return GoogleCloudDialogflowCxV3ListPagesResponse
|
---|
| 153 | * @throws \Google\Service\Exception
|
---|
| 154 | */
|
---|
| 155 | public function listProjectsLocationsAgentsFlowsPages($parent, $optParams = [])
|
---|
| 156 | {
|
---|
| 157 | $params = ['parent' => $parent];
|
---|
| 158 | $params = array_merge($params, $optParams);
|
---|
| 159 | return $this->call('list', [$params], GoogleCloudDialogflowCxV3ListPagesResponse::class);
|
---|
| 160 | }
|
---|
| 161 | /**
|
---|
| 162 | * Updates the specified page. Note: You should always train a flow prior to
|
---|
| 163 | * sending it queries. See the [training
|
---|
| 164 | * documentation](https://cloud.google.com/dialogflow/cx/docs/concept/training).
|
---|
| 165 | * (pages.patch)
|
---|
| 166 | *
|
---|
| 167 | * @param string $name The unique identifier of the page. Required for the
|
---|
| 168 | * Pages.UpdatePage method. Pages.CreatePage populates the name automatically.
|
---|
| 169 | * Format: `projects//locations//agents//flows//pages/`.
|
---|
| 170 | * @param GoogleCloudDialogflowCxV3Page $postBody
|
---|
| 171 | * @param array $optParams Optional parameters.
|
---|
| 172 | *
|
---|
| 173 | * @opt_param string languageCode The language of the following fields in
|
---|
| 174 | * `page`: * `Page.entry_fulfillment.messages` *
|
---|
| 175 | * `Page.entry_fulfillment.conditional_cases` *
|
---|
| 176 | * `Page.event_handlers.trigger_fulfillment.messages` *
|
---|
| 177 | * `Page.event_handlers.trigger_fulfillment.conditional_cases` *
|
---|
| 178 | * `Page.form.parameters.fill_behavior.initial_prompt_fulfillment.messages` * `P
|
---|
| 179 | * age.form.parameters.fill_behavior.initial_prompt_fulfillment.conditional_case
|
---|
| 180 | * s` * `Page.form.parameters.fill_behavior.reprompt_event_handlers.messages` *
|
---|
| 181 | * `Page.form.parameters.fill_behavior.reprompt_event_handlers.conditional_cases
|
---|
| 182 | * ` * `Page.transition_routes.trigger_fulfillment.messages` *
|
---|
| 183 | * `Page.transition_routes.trigger_fulfillment.conditional_cases` If not
|
---|
| 184 | * specified, the agent's default language is used. [Many
|
---|
| 185 | * languages](https://cloud.google.com/dialogflow/cx/docs/reference/language)
|
---|
| 186 | * are supported. Note: languages must be enabled in the agent before they can
|
---|
| 187 | * be used.
|
---|
| 188 | * @opt_param string updateMask The mask to control which fields get updated. If
|
---|
| 189 | * the mask is not present, all fields will be updated.
|
---|
| 190 | * @return GoogleCloudDialogflowCxV3Page
|
---|
| 191 | * @throws \Google\Service\Exception
|
---|
| 192 | */
|
---|
| 193 | public function patch($name, GoogleCloudDialogflowCxV3Page $postBody, $optParams = [])
|
---|
| 194 | {
|
---|
| 195 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 196 | $params = array_merge($params, $optParams);
|
---|
| 197 | return $this->call('patch', [$params], GoogleCloudDialogflowCxV3Page::class);
|
---|
| 198 | }
|
---|
| 199 | }
|
---|
| 200 |
|
---|
| 201 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 202 | class_alias(ProjectsLocationsAgentsFlowsPages::class, 'Google_Service_Dialogflow_Resource_ProjectsLocationsAgentsFlowsPages');
|
---|