@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
2222import "google/api/resource.proto" ;
2323import "google/cloud/dialogflow/cx/v3beta1/advanced_settings.proto" ;
2424import "google/cloud/dialogflow/cx/v3beta1/example.proto" ;
25+ import "google/cloud/dialogflow/cx/v3beta1/fulfillment.proto" ;
2526import "google/cloud/dialogflow/cx/v3beta1/generative_settings.proto" ;
2627import "google/cloud/dialogflow/cx/v3beta1/parameter_definition.proto" ;
2728import "google/protobuf/empty.proto" ;
@@ -314,6 +315,10 @@ message Playbook {
314315 // Optional. Playbook level Settings for speech to text detection.
315316 AdvancedSettings.SpeechSettings speech_settings = 20
316317 [(google.api.field_behavior ) = OPTIONAL ];
318+
319+ // Optional. A list of registered handlers to execute based on the specified
320+ // triggers.
321+ repeated Handler handlers = 16 [(google.api.field_behavior ) = OPTIONAL ];
317322}
318323
319324// The request message for
@@ -422,3 +427,47 @@ message DeletePlaybookVersionRequest {
422427 }
423428 ];
424429}
430+
431+ // Handler can be used to define custom logic to be executed based on the
432+ // user-specified triggers.
433+ message Handler {
434+ // A handler that is triggered by the specified
435+ // [event][google.cloud.dialogflow.cx.v3beta1.Handler.EventHandler.event].
436+ message EventHandler {
437+ // Required. The name of the event that triggers this handler.
438+ string event = 1 [(google.api.field_behavior ) = REQUIRED ];
439+
440+ // Optional. The condition that must be satisfied to trigger this handler.
441+ string condition = 3 [(google.api.field_behavior ) = OPTIONAL ];
442+
443+ // Required. The fulfillment to call when the event occurs.
444+ Fulfillment fulfillment = 2 [(google.api.field_behavior ) = REQUIRED ];
445+ }
446+
447+ // A handler that is triggered on the specific
448+ // [lifecycle_stage][google.cloud.dialogflow.cx.v3beta1.Handler.LifecycleHandler.lifecycle_stage]
449+ // of the playbook execution.
450+ message LifecycleHandler {
451+ // Required. The name of the lifecycle stage that triggers this handler.
452+ // Supported values:
453+ // * `playbook-start`
454+ // * `pre-action-selection`
455+ // * `pre-action-execution`
456+ string lifecycle_stage = 1 [(google.api.field_behavior ) = REQUIRED ];
457+
458+ // Optional. The condition that must be satisfied to trigger this handler.
459+ string condition = 2 [(google.api.field_behavior ) = OPTIONAL ];
460+
461+ // Required. The fulfillment to call when this handler is triggered.
462+ Fulfillment fulfillment = 3 [(google.api.field_behavior ) = REQUIRED ];
463+ }
464+
465+ // Specifies the type of handler to invoke.
466+ oneof handler {
467+ // A handler triggered by event.
468+ EventHandler event_handler = 1 ;
469+
470+ // A handler triggered during specific lifecycle of the playbook execution.
471+ LifecycleHandler lifecycle_handler = 3 ;
472+ }
473+ }
0 commit comments