| 1 | package Google::Cloud::Dialogflow::Cx::V3beta1; | ||
| 2 | |||
| 3 | 1 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 1 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 0 | ▶ | use Google::gRPC::Client; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 7 | use Google::Cloud::REST::Client; | ||
| 8 | use Google::Auth; | ||
| 9 | use Carp qw(croak); | ||
| 10 | |||
| 11 | use Protobuf; | ||
| 12 | use Google::Api::Common; | ||
| 13 | use Google::Cloud::Dialogflow::Cx::V3beta1::BigqueryExport; | ||
| 14 | use Google::Cloud::Dialogflow::Cx::V3beta1::ValidationMessage; | ||
| 15 | use Google::Cloud::Dialogflow::Cx::V3beta1::ImportStrategy; | ||
| 16 | use Google::Cloud::Dialogflow::Cx::V3beta1::CodeBlock; | ||
| 17 | use Google::Cloud::Dialogflow::Cx::V3beta1::Inline; | ||
| 18 | use Google::Cloud::Dialogflow::Cx::V3beta1::AudioConfig; | ||
| 19 | use Google::Cloud::Dialogflow::Cx::V3beta1::SafetySettings; | ||
| 20 | use Google::Cloud::Dialogflow::Cx::V3beta1::DataStoreConnection; | ||
| 21 | use Google::Cloud::Dialogflow::Cx::V3beta1::ParameterDefinition; | ||
| 22 | use Google::Cloud::Dialogflow::Cx::V3beta1::Gcs; | ||
| 23 | use Google::Cloud::Dialogflow::Cx::V3beta1::ToolCall; | ||
| 24 | use Google::Cloud::Dialogflow::Cx::V3beta1::Experiment; | ||
| 25 | use Google::Cloud::Dialogflow::Cx::V3beta1::SecuritySettings; | ||
| 26 | use Google::Cloud::Dialogflow::Cx::V3beta1::Changelog; | ||
| 27 | use Google::Cloud::Dialogflow::Cx::V3beta1::Deployment; | ||
| 28 | use Google::Cloud::Dialogflow::Cx::V3beta1::EntityType; | ||
| 29 | use Google::Cloud::Dialogflow::Cx::V3beta1::Intent; | ||
| 30 | use Google::Cloud::Dialogflow::Cx::V3beta1::GenerativeSettings; | ||
| 31 | use Google::Cloud::Dialogflow::Cx::V3beta1::Trace; | ||
| 32 | use Google::Cloud::Dialogflow::Cx::V3beta1::Tool; | ||
| 33 | use Google::Cloud::Dialogflow::Cx::V3beta1::AdvancedSettings; | ||
| 34 | use Google::Cloud::Dialogflow::Cx::V3beta1::ResponseMessage; | ||
| 35 | use Google::Cloud::Dialogflow::Cx::V3beta1::SessionEntityType; | ||
| 36 | use Google::Cloud::Dialogflow::Cx::V3beta1::Generator; | ||
| 37 | use Google::Cloud::Dialogflow::Cx::V3beta1::Example; | ||
| 38 | use Google::Cloud::Dialogflow::Cx::V3beta1::Webhook; | ||
| 39 | use Google::Cloud::Dialogflow::Cx::V3beta1::Fulfillment; | ||
| 40 | use Google::Cloud::Dialogflow::Cx::V3beta1::Playbook; | ||
| 41 | use Google::Cloud::Dialogflow::Cx::V3beta1::Page; | ||
| 42 | use Google::Cloud::Dialogflow::Cx::V3beta1::TransitionRouteGroup; | ||
| 43 | use Google::Cloud::Dialogflow::Cx::V3beta1::Flow; | ||
| 44 | use Google::Cloud::Dialogflow::Cx::V3beta1::Agent; | ||
| 45 | use Google::Cloud::Dialogflow::Cx::V3beta1::Version; | ||
| 46 | use Google::Cloud::Dialogflow::Cx::V3beta1::Session; | ||
| 47 | use Google::Cloud::Dialogflow::Cx::V3beta1::TestCase; | ||
| 48 | use Google::Cloud::Dialogflow::Cx::V3beta1::Environment; | ||
| 49 | use Google::Cloud::Dialogflow::Cx::V3beta1::ConversationHistory; | ||
| 50 | |||
| 51 | our $VERSION = '0.06'; | ||
| 52 | |||
| 53 | has credentials => ( is => 'ro', required => 0 ); | ||
| 54 | has transport => ( is => 'rw' ); | ||
| 55 | |||
| 56 | sub BUILD { | ||
| 57 | my ($self) = @_; | ||
| 58 | |||
| 59 | my $auth = $self->credentials; | ||
| 60 | if (!defined $auth) { | ||
| 61 | $auth = Google::Auth->default(); | ||
| 62 | } elsif (!eval { $auth->can('get_token') }) { | ||
| 63 | croak 'Invalid credentials object: must implement get_token()'; | ||
| 64 | } | ||
| 65 | my $token = $auth->get_token(); | ||
| 66 | |||
| 67 | my $target = 'dialogflow.googleapis.com:443'; | ||
| 68 | my $t = $self->transport || 'grpc'; | ||
| 69 | |||
| 70 | if (ref($t) && eval { $t->can('call') }) { | ||
| 71 | # Already a transport object | ||
| 72 | } elsif (lc($t) eq 'rest') { | ||
| 73 | my $client = Google::Cloud::REST::Client->new( | ||
| 74 | target => $target, | ||
| 75 | auth_token => $token, | ||
| 76 | ); | ||
| 77 | $self->transport($client); | ||
| 78 | } else { | ||
| 79 | my $client = Google::gRPC::Client->new( | ||
| 80 | target => $target, | ||
| 81 | auth_token => $token, | ||
| 82 | ); | ||
| 83 | $self->transport($client); | ||
| 84 | } | ||
| 85 | } | ||
| 86 | |||
| 87 | sub list_agents { | ||
| 88 | my ($self, %params) = @_; | ||
| 89 | |||
| 90 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Agent::ListAgentsRequest'; | ||
| 91 | my $request = eval { $request_class->new(\%params) }; | ||
| 92 | my $new_err = $@; | ||
| 93 | if (!$request) { | ||
| 94 | $request = eval { $request_class->new(%params) }; | ||
| 95 | $new_err ||= $@; | ||
| 96 | } | ||
| 97 | if (!$request) { | ||
| 98 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 99 | } | ||
| 100 | |||
| 101 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Agent::ListAgentsResponse'; | ||
| 102 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 103 | return $self->transport->call({ | ||
| 104 | http_method => 'POST', | ||
| 105 | path => '/google.cloud.dialogflow.cx.v3beta1.Agents/ListAgents', | ||
| 106 | request => $request, | ||
| 107 | response_class => $response_class, | ||
| 108 | }); | ||
| 109 | } | ||
| 110 | |||
| 111 | my $response = $self->transport->call({ | ||
| 112 | service => 'google.cloud.dialogflow.cx.v3beta1.Agents', | ||
| 113 | method => 'ListAgents', | ||
| 114 | request => $request, | ||
| 115 | response_class => $response_class, | ||
| 116 | }); | ||
| 117 | |||
| 118 | return $response; | ||
| 119 | } | ||
| 120 | |||
| 121 | sub get_generative_settings { | ||
| 122 | my ($self, %params) = @_; | ||
| 123 | |||
| 124 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Agent::GetGenerativeSettingsRequest'; | ||
| 125 | my $request = eval { $request_class->new(\%params) }; | ||
| 126 | my $new_err = $@; | ||
| 127 | if (!$request) { | ||
| 128 | $request = eval { $request_class->new(%params) }; | ||
| 129 | $new_err ||= $@; | ||
| 130 | } | ||
| 131 | if (!$request) { | ||
| 132 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 133 | } | ||
| 134 | |||
| 135 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::GenerativeSettings::GenerativeSettings'; | ||
| 136 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 137 | return $self->transport->call({ | ||
| 138 | http_method => 'POST', | ||
| 139 | path => '/google.cloud.dialogflow.cx.v3beta1.Agents/GetGenerativeSettings', | ||
| 140 | request => $request, | ||
| 141 | response_class => $response_class, | ||
| 142 | }); | ||
| 143 | } | ||
| 144 | |||
| 145 | my $response = $self->transport->call({ | ||
| 146 | service => 'google.cloud.dialogflow.cx.v3beta1.Agents', | ||
| 147 | method => 'GetGenerativeSettings', | ||
| 148 | request => $request, | ||
| 149 | response_class => $response_class, | ||
| 150 | }); | ||
| 151 | |||
| 152 | return $response; | ||
| 153 | } | ||
| 154 | |||
| 155 | sub list_changelogs { | ||
| 156 | my ($self, %params) = @_; | ||
| 157 | |||
| 158 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Changelog::ListChangelogsRequest'; | ||
| 159 | my $request = eval { $request_class->new(\%params) }; | ||
| 160 | my $new_err = $@; | ||
| 161 | if (!$request) { | ||
| 162 | $request = eval { $request_class->new(%params) }; | ||
| 163 | $new_err ||= $@; | ||
| 164 | } | ||
| 165 | if (!$request) { | ||
| 166 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 167 | } | ||
| 168 | |||
| 169 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Changelog::ListChangelogsResponse'; | ||
| 170 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 171 | return $self->transport->call({ | ||
| 172 | http_method => 'POST', | ||
| 173 | path => '/google.cloud.dialogflow.cx.v3beta1.Changelogs/ListChangelogs', | ||
| 174 | request => $request, | ||
| 175 | response_class => $response_class, | ||
| 176 | }); | ||
| 177 | } | ||
| 178 | |||
| 179 | my $response = $self->transport->call({ | ||
| 180 | service => 'google.cloud.dialogflow.cx.v3beta1.Changelogs', | ||
| 181 | method => 'ListChangelogs', | ||
| 182 | request => $request, | ||
| 183 | response_class => $response_class, | ||
| 184 | }); | ||
| 185 | |||
| 186 | return $response; | ||
| 187 | } | ||
| 188 | |||
| 189 | sub list_conversations { | ||
| 190 | my ($self, %params) = @_; | ||
| 191 | |||
| 192 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::ConversationHistory::ListConversationsRequest'; | ||
| 193 | my $request = eval { $request_class->new(\%params) }; | ||
| 194 | my $new_err = $@; | ||
| 195 | if (!$request) { | ||
| 196 | $request = eval { $request_class->new(%params) }; | ||
| 197 | $new_err ||= $@; | ||
| 198 | } | ||
| 199 | if (!$request) { | ||
| 200 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 201 | } | ||
| 202 | |||
| 203 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::ConversationHistory::ListConversationsResponse'; | ||
| 204 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 205 | return $self->transport->call({ | ||
| 206 | http_method => 'POST', | ||
| 207 | path => '/google.cloud.dialogflow.cx.v3beta1.ConversationHistory/ListConversations', | ||
| 208 | request => $request, | ||
| 209 | response_class => $response_class, | ||
| 210 | }); | ||
| 211 | } | ||
| 212 | |||
| 213 | my $response = $self->transport->call({ | ||
| 214 | service => 'google.cloud.dialogflow.cx.v3beta1.ConversationHistory', | ||
| 215 | method => 'ListConversations', | ||
| 216 | request => $request, | ||
| 217 | response_class => $response_class, | ||
| 218 | }); | ||
| 219 | |||
| 220 | return $response; | ||
| 221 | } | ||
| 222 | |||
| 223 | sub list_deployments { | ||
| 224 | my ($self, %params) = @_; | ||
| 225 | |||
| 226 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Deployment::ListDeploymentsRequest'; | ||
| 227 | my $request = eval { $request_class->new(\%params) }; | ||
| 228 | my $new_err = $@; | ||
| 229 | if (!$request) { | ||
| 230 | $request = eval { $request_class->new(%params) }; | ||
| 231 | $new_err ||= $@; | ||
| 232 | } | ||
| 233 | if (!$request) { | ||
| 234 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 235 | } | ||
| 236 | |||
| 237 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Deployment::ListDeploymentsResponse'; | ||
| 238 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 239 | return $self->transport->call({ | ||
| 240 | http_method => 'POST', | ||
| 241 | path => '/google.cloud.dialogflow.cx.v3beta1.Deployments/ListDeployments', | ||
| 242 | request => $request, | ||
| 243 | response_class => $response_class, | ||
| 244 | }); | ||
| 245 | } | ||
| 246 | |||
| 247 | my $response = $self->transport->call({ | ||
| 248 | service => 'google.cloud.dialogflow.cx.v3beta1.Deployments', | ||
| 249 | method => 'ListDeployments', | ||
| 250 | request => $request, | ||
| 251 | response_class => $response_class, | ||
| 252 | }); | ||
| 253 | |||
| 254 | return $response; | ||
| 255 | } | ||
| 256 | |||
| 257 | sub get_entity_type { | ||
| 258 | my ($self, %params) = @_; | ||
| 259 | |||
| 260 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::EntityType::GetEntityTypeRequest'; | ||
| 261 | my $request = eval { $request_class->new(\%params) }; | ||
| 262 | my $new_err = $@; | ||
| 263 | if (!$request) { | ||
| 264 | $request = eval { $request_class->new(%params) }; | ||
| 265 | $new_err ||= $@; | ||
| 266 | } | ||
| 267 | if (!$request) { | ||
| 268 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 269 | } | ||
| 270 | |||
| 271 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::EntityType::EntityType'; | ||
| 272 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 273 | return $self->transport->call({ | ||
| 274 | http_method => 'POST', | ||
| 275 | path => '/google.cloud.dialogflow.cx.v3beta1.EntityTypes/GetEntityType', | ||
| 276 | request => $request, | ||
| 277 | response_class => $response_class, | ||
| 278 | }); | ||
| 279 | } | ||
| 280 | |||
| 281 | my $response = $self->transport->call({ | ||
| 282 | service => 'google.cloud.dialogflow.cx.v3beta1.EntityTypes', | ||
| 283 | method => 'GetEntityType', | ||
| 284 | request => $request, | ||
| 285 | response_class => $response_class, | ||
| 286 | }); | ||
| 287 | |||
| 288 | return $response; | ||
| 289 | } | ||
| 290 | |||
| 291 | sub list_environments { | ||
| 292 | my ($self, %params) = @_; | ||
| 293 | |||
| 294 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Environment::ListEnvironmentsRequest'; | ||
| 295 | my $request = eval { $request_class->new(\%params) }; | ||
| 296 | my $new_err = $@; | ||
| 297 | if (!$request) { | ||
| 298 | $request = eval { $request_class->new(%params) }; | ||
| 299 | $new_err ||= $@; | ||
| 300 | } | ||
| 301 | if (!$request) { | ||
| 302 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 303 | } | ||
| 304 | |||
| 305 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Environment::ListEnvironmentsResponse'; | ||
| 306 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 307 | return $self->transport->call({ | ||
| 308 | http_method => 'POST', | ||
| 309 | path => '/google.cloud.dialogflow.cx.v3beta1.Environments/ListEnvironments', | ||
| 310 | request => $request, | ||
| 311 | response_class => $response_class, | ||
| 312 | }); | ||
| 313 | } | ||
| 314 | |||
| 315 | my $response = $self->transport->call({ | ||
| 316 | service => 'google.cloud.dialogflow.cx.v3beta1.Environments', | ||
| 317 | method => 'ListEnvironments', | ||
| 318 | request => $request, | ||
| 319 | response_class => $response_class, | ||
| 320 | }); | ||
| 321 | |||
| 322 | return $response; | ||
| 323 | } | ||
| 324 | |||
| 325 | sub create_example { | ||
| 326 | my ($self, %params) = @_; | ||
| 327 | |||
| 328 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Example::CreateExampleRequest'; | ||
| 329 | my $request = eval { $request_class->new(\%params) }; | ||
| 330 | my $new_err = $@; | ||
| 331 | if (!$request) { | ||
| 332 | $request = eval { $request_class->new(%params) }; | ||
| 333 | $new_err ||= $@; | ||
| 334 | } | ||
| 335 | if (!$request) { | ||
| 336 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 337 | } | ||
| 338 | |||
| 339 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Example::Example'; | ||
| 340 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 341 | return $self->transport->call({ | ||
| 342 | http_method => 'POST', | ||
| 343 | path => '/google.cloud.dialogflow.cx.v3beta1.Examples/CreateExample', | ||
| 344 | request => $request, | ||
| 345 | response_class => $response_class, | ||
| 346 | }); | ||
| 347 | } | ||
| 348 | |||
| 349 | my $response = $self->transport->call({ | ||
| 350 | service => 'google.cloud.dialogflow.cx.v3beta1.Examples', | ||
| 351 | method => 'CreateExample', | ||
| 352 | request => $request, | ||
| 353 | response_class => $response_class, | ||
| 354 | }); | ||
| 355 | |||
| 356 | return $response; | ||
| 357 | } | ||
| 358 | |||
| 359 | sub list_experiments { | ||
| 360 | my ($self, %params) = @_; | ||
| 361 | |||
| 362 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Experiment::ListExperimentsRequest'; | ||
| 363 | my $request = eval { $request_class->new(\%params) }; | ||
| 364 | my $new_err = $@; | ||
| 365 | if (!$request) { | ||
| 366 | $request = eval { $request_class->new(%params) }; | ||
| 367 | $new_err ||= $@; | ||
| 368 | } | ||
| 369 | if (!$request) { | ||
| 370 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 371 | } | ||
| 372 | |||
| 373 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Experiment::ListExperimentsResponse'; | ||
| 374 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 375 | return $self->transport->call({ | ||
| 376 | http_method => 'POST', | ||
| 377 | path => '/google.cloud.dialogflow.cx.v3beta1.Experiments/ListExperiments', | ||
| 378 | request => $request, | ||
| 379 | response_class => $response_class, | ||
| 380 | }); | ||
| 381 | } | ||
| 382 | |||
| 383 | my $response = $self->transport->call({ | ||
| 384 | service => 'google.cloud.dialogflow.cx.v3beta1.Experiments', | ||
| 385 | method => 'ListExperiments', | ||
| 386 | request => $request, | ||
| 387 | response_class => $response_class, | ||
| 388 | }); | ||
| 389 | |||
| 390 | return $response; | ||
| 391 | } | ||
| 392 | |||
| 393 | sub create_flow { | ||
| 394 | my ($self, %params) = @_; | ||
| 395 | |||
| 396 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Flow::CreateFlowRequest'; | ||
| 397 | my $request = eval { $request_class->new(\%params) }; | ||
| 398 | my $new_err = $@; | ||
| 399 | if (!$request) { | ||
| 400 | $request = eval { $request_class->new(%params) }; | ||
| 401 | $new_err ||= $@; | ||
| 402 | } | ||
| 403 | if (!$request) { | ||
| 404 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 405 | } | ||
| 406 | |||
| 407 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Flow::Flow'; | ||
| 408 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 409 | return $self->transport->call({ | ||
| 410 | http_method => 'POST', | ||
| 411 | path => '/google.cloud.dialogflow.cx.v3beta1.Flows/CreateFlow', | ||
| 412 | request => $request, | ||
| 413 | response_class => $response_class, | ||
| 414 | }); | ||
| 415 | } | ||
| 416 | |||
| 417 | my $response = $self->transport->call({ | ||
| 418 | service => 'google.cloud.dialogflow.cx.v3beta1.Flows', | ||
| 419 | method => 'CreateFlow', | ||
| 420 | request => $request, | ||
| 421 | response_class => $response_class, | ||
| 422 | }); | ||
| 423 | |||
| 424 | return $response; | ||
| 425 | } | ||
| 426 | |||
| 427 | sub list_generators { | ||
| 428 | my ($self, %params) = @_; | ||
| 429 | |||
| 430 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Generator::ListGeneratorsRequest'; | ||
| 431 | my $request = eval { $request_class->new(\%params) }; | ||
| 432 | my $new_err = $@; | ||
| 433 | if (!$request) { | ||
| 434 | $request = eval { $request_class->new(%params) }; | ||
| 435 | $new_err ||= $@; | ||
| 436 | } | ||
| 437 | if (!$request) { | ||
| 438 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 439 | } | ||
| 440 | |||
| 441 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Generator::ListGeneratorsResponse'; | ||
| 442 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 443 | return $self->transport->call({ | ||
| 444 | http_method => 'POST', | ||
| 445 | path => '/google.cloud.dialogflow.cx.v3beta1.Generators/ListGenerators', | ||
| 446 | request => $request, | ||
| 447 | response_class => $response_class, | ||
| 448 | }); | ||
| 449 | } | ||
| 450 | |||
| 451 | my $response = $self->transport->call({ | ||
| 452 | service => 'google.cloud.dialogflow.cx.v3beta1.Generators', | ||
| 453 | method => 'ListGenerators', | ||
| 454 | request => $request, | ||
| 455 | response_class => $response_class, | ||
| 456 | }); | ||
| 457 | |||
| 458 | return $response; | ||
| 459 | } | ||
| 460 | |||
| 461 | sub list_intents { | ||
| 462 | my ($self, %params) = @_; | ||
| 463 | |||
| 464 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Intent::ListIntentsRequest'; | ||
| 465 | my $request = eval { $request_class->new(\%params) }; | ||
| 466 | my $new_err = $@; | ||
| 467 | if (!$request) { | ||
| 468 | $request = eval { $request_class->new(%params) }; | ||
| 469 | $new_err ||= $@; | ||
| 470 | } | ||
| 471 | if (!$request) { | ||
| 472 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 473 | } | ||
| 474 | |||
| 475 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Intent::ListIntentsResponse'; | ||
| 476 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 477 | return $self->transport->call({ | ||
| 478 | http_method => 'POST', | ||
| 479 | path => '/google.cloud.dialogflow.cx.v3beta1.Intents/ListIntents', | ||
| 480 | request => $request, | ||
| 481 | response_class => $response_class, | ||
| 482 | }); | ||
| 483 | } | ||
| 484 | |||
| 485 | my $response = $self->transport->call({ | ||
| 486 | service => 'google.cloud.dialogflow.cx.v3beta1.Intents', | ||
| 487 | method => 'ListIntents', | ||
| 488 | request => $request, | ||
| 489 | response_class => $response_class, | ||
| 490 | }); | ||
| 491 | |||
| 492 | return $response; | ||
| 493 | } | ||
| 494 | |||
| 495 | sub list_pages { | ||
| 496 | my ($self, %params) = @_; | ||
| 497 | |||
| 498 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Page::ListPagesRequest'; | ||
| 499 | my $request = eval { $request_class->new(\%params) }; | ||
| 500 | my $new_err = $@; | ||
| 501 | if (!$request) { | ||
| 502 | $request = eval { $request_class->new(%params) }; | ||
| 503 | $new_err ||= $@; | ||
| 504 | } | ||
| 505 | if (!$request) { | ||
| 506 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 507 | } | ||
| 508 | |||
| 509 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Page::ListPagesResponse'; | ||
| 510 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 511 | return $self->transport->call({ | ||
| 512 | http_method => 'POST', | ||
| 513 | path => '/google.cloud.dialogflow.cx.v3beta1.Pages/ListPages', | ||
| 514 | request => $request, | ||
| 515 | response_class => $response_class, | ||
| 516 | }); | ||
| 517 | } | ||
| 518 | |||
| 519 | my $response = $self->transport->call({ | ||
| 520 | service => 'google.cloud.dialogflow.cx.v3beta1.Pages', | ||
| 521 | method => 'ListPages', | ||
| 522 | request => $request, | ||
| 523 | response_class => $response_class, | ||
| 524 | }); | ||
| 525 | |||
| 526 | return $response; | ||
| 527 | } | ||
| 528 | |||
| 529 | sub create_playbook { | ||
| 530 | my ($self, %params) = @_; | ||
| 531 | |||
| 532 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Playbook::CreatePlaybookRequest'; | ||
| 533 | my $request = eval { $request_class->new(\%params) }; | ||
| 534 | my $new_err = $@; | ||
| 535 | if (!$request) { | ||
| 536 | $request = eval { $request_class->new(%params) }; | ||
| 537 | $new_err ||= $@; | ||
| 538 | } | ||
| 539 | if (!$request) { | ||
| 540 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 541 | } | ||
| 542 | |||
| 543 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Playbook::Playbook'; | ||
| 544 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 545 | return $self->transport->call({ | ||
| 546 | http_method => 'POST', | ||
| 547 | path => '/google.cloud.dialogflow.cx.v3beta1.Playbooks/CreatePlaybook', | ||
| 548 | request => $request, | ||
| 549 | response_class => $response_class, | ||
| 550 | }); | ||
| 551 | } | ||
| 552 | |||
| 553 | my $response = $self->transport->call({ | ||
| 554 | service => 'google.cloud.dialogflow.cx.v3beta1.Playbooks', | ||
| 555 | method => 'CreatePlaybook', | ||
| 556 | request => $request, | ||
| 557 | response_class => $response_class, | ||
| 558 | }); | ||
| 559 | |||
| 560 | return $response; | ||
| 561 | } | ||
| 562 | |||
| 563 | sub create_security_settings { | ||
| 564 | my ($self, %params) = @_; | ||
| 565 | |||
| 566 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::SecuritySettings::CreateSecuritySettingsRequest'; | ||
| 567 | my $request = eval { $request_class->new(\%params) }; | ||
| 568 | my $new_err = $@; | ||
| 569 | if (!$request) { | ||
| 570 | $request = eval { $request_class->new(%params) }; | ||
| 571 | $new_err ||= $@; | ||
| 572 | } | ||
| 573 | if (!$request) { | ||
| 574 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 575 | } | ||
| 576 | |||
| 577 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::SecuritySettings::SecuritySettings'; | ||
| 578 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 579 | return $self->transport->call({ | ||
| 580 | http_method => 'POST', | ||
| 581 | path => '/google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService/CreateSecuritySettings', | ||
| 582 | request => $request, | ||
| 583 | response_class => $response_class, | ||
| 584 | }); | ||
| 585 | } | ||
| 586 | |||
| 587 | my $response = $self->transport->call({ | ||
| 588 | service => 'google.cloud.dialogflow.cx.v3beta1.SecuritySettingsService', | ||
| 589 | method => 'CreateSecuritySettings', | ||
| 590 | request => $request, | ||
| 591 | response_class => $response_class, | ||
| 592 | }); | ||
| 593 | |||
| 594 | return $response; | ||
| 595 | } | ||
| 596 | |||
| 597 | sub detect_intent { | ||
| 598 | my ($self, %params) = @_; | ||
| 599 | |||
| 600 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Session::DetectIntentRequest'; | ||
| 601 | my $request = eval { $request_class->new(\%params) }; | ||
| 602 | my $new_err = $@; | ||
| 603 | if (!$request) { | ||
| 604 | $request = eval { $request_class->new(%params) }; | ||
| 605 | $new_err ||= $@; | ||
| 606 | } | ||
| 607 | if (!$request) { | ||
| 608 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 609 | } | ||
| 610 | |||
| 611 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Session::DetectIntentResponse'; | ||
| 612 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 613 | return $self->transport->call({ | ||
| 614 | http_method => 'POST', | ||
| 615 | path => '/google.cloud.dialogflow.cx.v3beta1.Sessions/DetectIntent', | ||
| 616 | request => $request, | ||
| 617 | response_class => $response_class, | ||
| 618 | }); | ||
| 619 | } | ||
| 620 | |||
| 621 | my $response = $self->transport->call({ | ||
| 622 | service => 'google.cloud.dialogflow.cx.v3beta1.Sessions', | ||
| 623 | method => 'DetectIntent', | ||
| 624 | request => $request, | ||
| 625 | response_class => $response_class, | ||
| 626 | }); | ||
| 627 | |||
| 628 | return $response; | ||
| 629 | } | ||
| 630 | |||
| 631 | sub list_session_entity_types { | ||
| 632 | my ($self, %params) = @_; | ||
| 633 | |||
| 634 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::SessionEntityType::ListSessionEntityTypesRequest'; | ||
| 635 | my $request = eval { $request_class->new(\%params) }; | ||
| 636 | my $new_err = $@; | ||
| 637 | if (!$request) { | ||
| 638 | $request = eval { $request_class->new(%params) }; | ||
| 639 | $new_err ||= $@; | ||
| 640 | } | ||
| 641 | if (!$request) { | ||
| 642 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 643 | } | ||
| 644 | |||
| 645 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::SessionEntityType::ListSessionEntityTypesResponse'; | ||
| 646 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 647 | return $self->transport->call({ | ||
| 648 | http_method => 'POST', | ||
| 649 | path => '/google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes/ListSessionEntityTypes', | ||
| 650 | request => $request, | ||
| 651 | response_class => $response_class, | ||
| 652 | }); | ||
| 653 | } | ||
| 654 | |||
| 655 | my $response = $self->transport->call({ | ||
| 656 | service => 'google.cloud.dialogflow.cx.v3beta1.SessionEntityTypes', | ||
| 657 | method => 'ListSessionEntityTypes', | ||
| 658 | request => $request, | ||
| 659 | response_class => $response_class, | ||
| 660 | }); | ||
| 661 | |||
| 662 | return $response; | ||
| 663 | } | ||
| 664 | |||
| 665 | sub list_test_cases { | ||
| 666 | my ($self, %params) = @_; | ||
| 667 | |||
| 668 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::TestCase::ListTestCasesRequest'; | ||
| 669 | my $request = eval { $request_class->new(\%params) }; | ||
| 670 | my $new_err = $@; | ||
| 671 | if (!$request) { | ||
| 672 | $request = eval { $request_class->new(%params) }; | ||
| 673 | $new_err ||= $@; | ||
| 674 | } | ||
| 675 | if (!$request) { | ||
| 676 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 677 | } | ||
| 678 | |||
| 679 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::TestCase::ListTestCasesResponse'; | ||
| 680 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 681 | return $self->transport->call({ | ||
| 682 | http_method => 'POST', | ||
| 683 | path => '/google.cloud.dialogflow.cx.v3beta1.TestCases/ListTestCases', | ||
| 684 | request => $request, | ||
| 685 | response_class => $response_class, | ||
| 686 | }); | ||
| 687 | } | ||
| 688 | |||
| 689 | my $response = $self->transport->call({ | ||
| 690 | service => 'google.cloud.dialogflow.cx.v3beta1.TestCases', | ||
| 691 | method => 'ListTestCases', | ||
| 692 | request => $request, | ||
| 693 | response_class => $response_class, | ||
| 694 | }); | ||
| 695 | |||
| 696 | return $response; | ||
| 697 | } | ||
| 698 | |||
| 699 | sub create_tool { | ||
| 700 | my ($self, %params) = @_; | ||
| 701 | |||
| 702 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Tool::CreateToolRequest'; | ||
| 703 | my $request = eval { $request_class->new(\%params) }; | ||
| 704 | my $new_err = $@; | ||
| 705 | if (!$request) { | ||
| 706 | $request = eval { $request_class->new(%params) }; | ||
| 707 | $new_err ||= $@; | ||
| 708 | } | ||
| 709 | if (!$request) { | ||
| 710 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 711 | } | ||
| 712 | |||
| 713 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Tool::Tool'; | ||
| 714 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 715 | return $self->transport->call({ | ||
| 716 | http_method => 'POST', | ||
| 717 | path => '/google.cloud.dialogflow.cx.v3beta1.Tools/CreateTool', | ||
| 718 | request => $request, | ||
| 719 | response_class => $response_class, | ||
| 720 | }); | ||
| 721 | } | ||
| 722 | |||
| 723 | my $response = $self->transport->call({ | ||
| 724 | service => 'google.cloud.dialogflow.cx.v3beta1.Tools', | ||
| 725 | method => 'CreateTool', | ||
| 726 | request => $request, | ||
| 727 | response_class => $response_class, | ||
| 728 | }); | ||
| 729 | |||
| 730 | return $response; | ||
| 731 | } | ||
| 732 | |||
| 733 | sub list_transition_route_groups { | ||
| 734 | my ($self, %params) = @_; | ||
| 735 | |||
| 736 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::TransitionRouteGroup::ListTransitionRouteGroupsRequest'; | ||
| 737 | my $request = eval { $request_class->new(\%params) }; | ||
| 738 | my $new_err = $@; | ||
| 739 | if (!$request) { | ||
| 740 | $request = eval { $request_class->new(%params) }; | ||
| 741 | $new_err ||= $@; | ||
| 742 | } | ||
| 743 | if (!$request) { | ||
| 744 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 745 | } | ||
| 746 | |||
| 747 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::TransitionRouteGroup::ListTransitionRouteGroupsResponse'; | ||
| 748 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 749 | return $self->transport->call({ | ||
| 750 | http_method => 'POST', | ||
| 751 | path => '/google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups/ListTransitionRouteGroups', | ||
| 752 | request => $request, | ||
| 753 | response_class => $response_class, | ||
| 754 | }); | ||
| 755 | } | ||
| 756 | |||
| 757 | my $response = $self->transport->call({ | ||
| 758 | service => 'google.cloud.dialogflow.cx.v3beta1.TransitionRouteGroups', | ||
| 759 | method => 'ListTransitionRouteGroups', | ||
| 760 | request => $request, | ||
| 761 | response_class => $response_class, | ||
| 762 | }); | ||
| 763 | |||
| 764 | return $response; | ||
| 765 | } | ||
| 766 | |||
| 767 | sub list_versions { | ||
| 768 | my ($self, %params) = @_; | ||
| 769 | |||
| 770 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Version::ListVersionsRequest'; | ||
| 771 | my $request = eval { $request_class->new(\%params) }; | ||
| 772 | my $new_err = $@; | ||
| 773 | if (!$request) { | ||
| 774 | $request = eval { $request_class->new(%params) }; | ||
| 775 | $new_err ||= $@; | ||
| 776 | } | ||
| 777 | if (!$request) { | ||
| 778 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 779 | } | ||
| 780 | |||
| 781 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Version::ListVersionsResponse'; | ||
| 782 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 783 | return $self->transport->call({ | ||
| 784 | http_method => 'POST', | ||
| 785 | path => '/google.cloud.dialogflow.cx.v3beta1.Versions/ListVersions', | ||
| 786 | request => $request, | ||
| 787 | response_class => $response_class, | ||
| 788 | }); | ||
| 789 | } | ||
| 790 | |||
| 791 | my $response = $self->transport->call({ | ||
| 792 | service => 'google.cloud.dialogflow.cx.v3beta1.Versions', | ||
| 793 | method => 'ListVersions', | ||
| 794 | request => $request, | ||
| 795 | response_class => $response_class, | ||
| 796 | }); | ||
| 797 | |||
| 798 | return $response; | ||
| 799 | } | ||
| 800 | |||
| 801 | sub list_webhooks { | ||
| 802 | my ($self, %params) = @_; | ||
| 803 | |||
| 804 | my $request_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Webhook::ListWebhooksRequest'; | ||
| 805 | my $request = eval { $request_class->new(\%params) }; | ||
| 806 | my $new_err = $@; | ||
| 807 | if (!$request) { | ||
| 808 | $request = eval { $request_class->new(%params) }; | ||
| 809 | $new_err ||= $@; | ||
| 810 | } | ||
| 811 | if (!$request) { | ||
| 812 | croak 'Failed to construct ' . $request_class . ': ' . ($new_err || 'unknown error'); | ||
| 813 | } | ||
| 814 | |||
| 815 | my $response_class = 'Google::Cloud::Dialogflow::Cx::V3beta1::Webhook::ListWebhooksResponse'; | ||
| 816 | if (eval { $self->transport->isa('Google::Cloud::REST::Client') }) { | ||
| 817 | return $self->transport->call({ | ||
| 818 | http_method => 'POST', | ||
| 819 | path => '/google.cloud.dialogflow.cx.v3beta1.Webhooks/ListWebhooks', | ||
| 820 | request => $request, | ||
| 821 | response_class => $response_class, | ||
| 822 | }); | ||
| 823 | } | ||
| 824 | |||
| 825 | my $response = $self->transport->call({ | ||
| 826 | service => 'google.cloud.dialogflow.cx.v3beta1.Webhooks', | ||
| 827 | method => 'ListWebhooks', | ||
| 828 | request => $request, | ||
| 829 | response_class => $response_class, | ||
| 830 | }); | ||
| 831 | |||
| 832 | return $response; | ||
| 833 | } | ||
| 834 | 1; # End of Google::Cloud::Dialogflow::Cx::V3beta1 | ||
| 835 | |||
| 836 | __END__ | ||