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\GoogleCloudDialogflowCxV3DetectIntentRequest;
|
---|
21 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3DetectIntentResponse;
|
---|
22 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3FulfillIntentRequest;
|
---|
23 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3FulfillIntentResponse;
|
---|
24 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3MatchIntentRequest;
|
---|
25 | use Google\Service\Dialogflow\GoogleCloudDialogflowCxV3MatchIntentResponse;
|
---|
26 |
|
---|
27 | /**
|
---|
28 | * The "sessions" collection of methods.
|
---|
29 | * Typical usage is:
|
---|
30 | * <code>
|
---|
31 | * $dialogflowService = new Google\Service\Dialogflow(...);
|
---|
32 | * $sessions = $dialogflowService->projects_locations_agents_environments_sessions;
|
---|
33 | * </code>
|
---|
34 | */
|
---|
35 | class ProjectsLocationsAgentsEnvironmentsSessions extends \Google\Service\Resource
|
---|
36 | {
|
---|
37 | /**
|
---|
38 | * Processes a natural language query and returns structured, actionable data as
|
---|
39 | * a result. This method is not idempotent, because it may cause session entity
|
---|
40 | * types to be updated, which in turn might affect results of future queries.
|
---|
41 | * Note: Always use agent versions for production traffic. See [Versions and
|
---|
42 | * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).
|
---|
43 | * (sessions.detectIntent)
|
---|
44 | *
|
---|
45 | * @param string $session Required. The name of the session this query is sent
|
---|
46 | * to. Format: `projects//locations//agents//sessions/` or
|
---|
47 | * `projects//locations//agents//environments//sessions/`. If `Environment ID`
|
---|
48 | * is not specified, we assume default 'draft' environment. It's up to the API
|
---|
49 | * caller to choose an appropriate `Session ID`. It can be a random number or
|
---|
50 | * some type of session identifiers (preferably hashed). The length of the
|
---|
51 | * `Session ID` must not exceed 36 characters. For more information, see the
|
---|
52 | * [sessions
|
---|
53 | * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). Note:
|
---|
54 | * Always use agent versions for production traffic. See [Versions and
|
---|
55 | * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).
|
---|
56 | * @param GoogleCloudDialogflowCxV3DetectIntentRequest $postBody
|
---|
57 | * @param array $optParams Optional parameters.
|
---|
58 | * @return GoogleCloudDialogflowCxV3DetectIntentResponse
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function detectIntent($session, GoogleCloudDialogflowCxV3DetectIntentRequest $postBody, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['session' => $session, 'postBody' => $postBody];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('detectIntent', [$params], GoogleCloudDialogflowCxV3DetectIntentResponse::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Fulfills a matched intent returned by MatchIntent. Must be called after
|
---|
69 | * MatchIntent, with input from MatchIntentResponse. Otherwise, the behavior is
|
---|
70 | * undefined. (sessions.fulfillIntent)
|
---|
71 | *
|
---|
72 | * @param string $session Required. The name of the session this query is sent
|
---|
73 | * to. Format: `projects//locations//agents//sessions/` or
|
---|
74 | * `projects//locations//agents//environments//sessions/`. If `Environment ID`
|
---|
75 | * is not specified, we assume default 'draft' environment. It's up to the API
|
---|
76 | * caller to choose an appropriate `Session ID`. It can be a random number or
|
---|
77 | * some type of session identifiers (preferably hashed). The length of the
|
---|
78 | * `Session ID` must not exceed 36 characters. For more information, see the
|
---|
79 | * [sessions
|
---|
80 | * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session).
|
---|
81 | * @param GoogleCloudDialogflowCxV3FulfillIntentRequest $postBody
|
---|
82 | * @param array $optParams Optional parameters.
|
---|
83 | * @return GoogleCloudDialogflowCxV3FulfillIntentResponse
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function fulfillIntent($session, GoogleCloudDialogflowCxV3FulfillIntentRequest $postBody, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['session' => $session, 'postBody' => $postBody];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('fulfillIntent', [$params], GoogleCloudDialogflowCxV3FulfillIntentResponse::class);
|
---|
91 | }
|
---|
92 | /**
|
---|
93 | * Returns preliminary intent match results, doesn't change the session status.
|
---|
94 | * (sessions.matchIntent)
|
---|
95 | *
|
---|
96 | * @param string $session Required. The name of the session this query is sent
|
---|
97 | * to. Format: `projects//locations//agents//sessions/` or
|
---|
98 | * `projects//locations//agents//environments//sessions/`. If `Environment ID`
|
---|
99 | * is not specified, we assume default 'draft' environment. It's up to the API
|
---|
100 | * caller to choose an appropriate `Session ID`. It can be a random number or
|
---|
101 | * some type of session identifiers (preferably hashed). The length of the
|
---|
102 | * `Session ID` must not exceed 36 characters. For more information, see the
|
---|
103 | * [sessions
|
---|
104 | * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session).
|
---|
105 | * @param GoogleCloudDialogflowCxV3MatchIntentRequest $postBody
|
---|
106 | * @param array $optParams Optional parameters.
|
---|
107 | * @return GoogleCloudDialogflowCxV3MatchIntentResponse
|
---|
108 | * @throws \Google\Service\Exception
|
---|
109 | */
|
---|
110 | public function matchIntent($session, GoogleCloudDialogflowCxV3MatchIntentRequest $postBody, $optParams = [])
|
---|
111 | {
|
---|
112 | $params = ['session' => $session, 'postBody' => $postBody];
|
---|
113 | $params = array_merge($params, $optParams);
|
---|
114 | return $this->call('matchIntent', [$params], GoogleCloudDialogflowCxV3MatchIntentResponse::class);
|
---|
115 | }
|
---|
116 | /**
|
---|
117 | * Processes a natural language query and returns structured, actionable data as
|
---|
118 | * a result through server-side streaming. Server-side streaming allows
|
---|
119 | * Dialogflow to send [partial responses](https://cloud.google.com/dialogflow/cx
|
---|
120 | * /docs/concept/fulfillment#partial-response) earlier in a single request.
|
---|
121 | * (sessions.serverStreamingDetectIntent)
|
---|
122 | *
|
---|
123 | * @param string $session Required. The name of the session this query is sent
|
---|
124 | * to. Format: `projects//locations//agents//sessions/` or
|
---|
125 | * `projects//locations//agents//environments//sessions/`. If `Environment ID`
|
---|
126 | * is not specified, we assume default 'draft' environment. It's up to the API
|
---|
127 | * caller to choose an appropriate `Session ID`. It can be a random number or
|
---|
128 | * some type of session identifiers (preferably hashed). The length of the
|
---|
129 | * `Session ID` must not exceed 36 characters. For more information, see the
|
---|
130 | * [sessions
|
---|
131 | * guide](https://cloud.google.com/dialogflow/cx/docs/concept/session). Note:
|
---|
132 | * Always use agent versions for production traffic. See [Versions and
|
---|
133 | * environments](https://cloud.google.com/dialogflow/cx/docs/concept/version).
|
---|
134 | * @param GoogleCloudDialogflowCxV3DetectIntentRequest $postBody
|
---|
135 | * @param array $optParams Optional parameters.
|
---|
136 | * @return GoogleCloudDialogflowCxV3DetectIntentResponse
|
---|
137 | * @throws \Google\Service\Exception
|
---|
138 | */
|
---|
139 | public function serverStreamingDetectIntent($session, GoogleCloudDialogflowCxV3DetectIntentRequest $postBody, $optParams = [])
|
---|
140 | {
|
---|
141 | $params = ['session' => $session, 'postBody' => $postBody];
|
---|
142 | $params = array_merge($params, $optParams);
|
---|
143 | return $this->call('serverStreamingDetectIntent', [$params], GoogleCloudDialogflowCxV3DetectIntentResponse::class);
|
---|
144 | }
|
---|
145 | }
|
---|
146 |
|
---|
147 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
148 | class_alias(ProjectsLocationsAgentsEnvironmentsSessions::class, 'Google_Service_Dialogflow_Resource_ProjectsLocationsAgentsEnvironmentsSessions');
|
---|