forked from GoogleCloudPlatform/dfcx-scrapi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpages.py
745 lines (620 loc) · 26.1 KB
/
pages.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
"""A set of builder methods to create CX proto resource objects"""
# Copyright 2023 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import logging
from dataclasses import dataclass
from typing import List, Union
from google.cloud.dialogflowcx_v3beta1.types import Page
from google.cloud.dialogflowcx_v3beta1.types import Form
from google.cloud.dialogflowcx_v3beta1.types import Fulfillment
from google.cloud.dialogflowcx_v3beta1.types import TransitionRoute
from google.cloud.dialogflowcx_v3beta1.types import EventHandler
from dfcx_scrapi.builders.builders_common import BuildersCommon
from dfcx_scrapi.builders.routes import TransitionRouteBuilder
from dfcx_scrapi.builders.routes import EventHandlerBuilder
from dfcx_scrapi.builders.fulfillments import FulfillmentBuilder
# logging config
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)-8s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
)
class PageBuilder(BuildersCommon):
"""Base Class for CX Page builder."""
_proto_type = Page
_proto_type_str = "Page"
def __str__(self) -> str:
"""String representation of the proto_obj."""
self._check_proto_obj_attr_exist()
return (
f"Basic Information:\n{'='*25}\n{self._show_basic_info()}"
f"\n\n\nParameters:\n{'='*25}\n{self._show_parameters()}"
f"\n\n\nTransitionRoutes:\n{'='*25}"
f"\n{self._show_transition_routes()}"
f"\n\n\nEventHandlers:\n{'='*25}\n{self._show_event_handlers()}"
f"\n\n\nTransitoinRouteGroups:\n{'='*25}"
f"\n{self._show_transition_route_groups()}")
def _show_basic_info(self) -> str:
"""String representation for the basic information of proto_obj."""
self._check_proto_obj_attr_exist()
entry_fulfillment_str = str(
FulfillmentBuilder(self.proto_obj.entry_fulfillment)
)
return (
f"display_name: {self.proto_obj.display_name}"
f"\nentry_fulfillment:\n\n{entry_fulfillment_str}"
)
def _show_parameters(self) -> str:
"""String representation for the parameters of proto_obj."""
self._check_proto_obj_attr_exist()
return "\n".join([
(
f"display_name: {param.display_name}"
f"\n\tentity_type: {param.entity_type}"
f"\n\trequired: {param.required}"
f"\n\tis_list: {param.is_list}"
f"\n\treadct: {param.redact}"
f"\n\tdefault_value: {param.default_value}"
)
for param in self.proto_obj.form.parameters
])
def _show_transition_routes(self) -> str:
"""String representation for the transition routes of proto_obj."""
self._check_proto_obj_attr_exist()
return "\n".join([
f"TransitionRoute {i+1}:\n{str(TransitionRouteBuilder(tr))}"
f"\n{'*'*20}\n"
for i, tr in enumerate(self.proto_obj.transition_routes)
])
def _show_event_handlers(self) -> str:
"""String representation for the event handlers of proto_obj."""
self._check_proto_obj_attr_exist()
return "\n".join([
f"EventHandler {i+1}:\n{str(EventHandlerBuilder(eh))}\n{'*'*20}\n"
for i, eh in enumerate(self.proto_obj.event_handlers)
])
def _show_transition_route_groups(self) -> str:
"""String representation for the transition route groups of proto_obj"""
self._check_proto_obj_attr_exist()
return "\n".join([
f"TransitionRouteGroup {i+1}: {trg_id}"
for i, trg_id in enumerate(self.proto_obj.transition_route_groups)
])
def show_page_info(
self, mode: str = "whole"
) -> None:
"""Show the proto_obj information.
Args:
mode (str):
Specifies what part of the page to show.
Options:
['basic', 'whole', 'parameters',
'routes' or 'transition routes',
'route groups' or 'transition route groups',
'events' or 'event handlers'
]
"""
self._check_proto_obj_attr_exist()
if mode == "basic":
print(self._show_basic_info())
elif mode == "parameters":
print(self._show_parameters())
elif mode in ["routes", "transition routes"]:
print(self._show_transition_routes())
elif mode in ["route groups", "transition route groups"]:
print(self._show_transition_route_groups())
elif mode in ["events", "event handlers"]:
print(self._show_event_handlers())
elif mode == "whole":
print(self)
else:
raise ValueError(
"mode should be in"
"['basic', 'whole', 'parameters',"
" 'routes', 'transition routes',"
" 'route groups', 'transition route groups',"
" 'events', 'event handlers']"
)
def show_stats(self) -> None:
"""Provide some stats about the Page."""
self._check_proto_obj_attr_exist()
stats_instance = PageStats(self.proto_obj)
stats_instance.generate_stats()
def create_new_proto_obj(
self,
display_name: str,
entry_fulfillment: Fulfillment = None,
overwrite: bool = False
) -> Page:
"""Create a new Page.
Args:
display_name (str):
Required. The human-readable name of the
page, unique within the flow.
entry_fulfillment (Fulfillment):
The fulfillment to call when the session is entering the page.
overwrite (bool)
Overwrite the new proto_obj if proto_obj already contains a Page.
Returns:
A Page object stored in proto_obj.
"""
# Types error checking
if not (display_name and isinstance(display_name, str)):
raise ValueError("`display_name` should be a nonempty string.")
if (entry_fulfillment and
not isinstance(entry_fulfillment, Fulfillment)):
raise ValueError(
"The type of `entry_fulfillment` should be a Fulfillment."
)
# `overwrite` parameter error checking
if self.proto_obj and not overwrite:
raise UserWarning(
"proto_obj already contains a Page."
" If you wish to overwrite it, pass `overwrite` as True."
)
# Create the Page
if overwrite or not self.proto_obj:
if not entry_fulfillment:
entry_fulfillment = Fulfillment()
self.proto_obj = Page(
display_name=display_name,
entry_fulfillment=entry_fulfillment
)
return self.proto_obj
def add_parameter(
self,
display_name: str,
entity_type: str,
initial_prompt_fulfillment: Fulfillment,
required: bool = True,
default_value: str = None,
is_list: bool = False,
redact: bool = False,
reprompt_event_handlers: Union[EventHandler, List[EventHandler]] = None
) -> Page:
"""Add a parameter to collect from the user.
Args:
display_name (str):
Required. The human-readable name of the
parameter, unique within the form.
entity_type (str):
Required. The entity type of the parameter. Format:
``projects/-/locations/-/agents/-/
entityTypes/<System Entity Type ID>``
for system entity types (for example,
``projects/-/locations/-/agents/-/entityTypes/sys.date``),
or
``projects/<Project ID>/locations/<Location ID>/
agents/<Agent ID>/entityTypes/<Entity Type ID>``
for developer entity types.
initial_prompt_fulfillment (Fulfillment):
Required. The fulfillment to provide the initial prompt that
the agent can present to the user in order to fill the parameter.
required (bool):
Indicates whether the parameter is required.
Optional parameters will not trigger prompts;
however, they are filled if the user specifies
them. Required parameters must be filled before
form filling concludes.
default_value (str):
The default value of an optional parameter.
If the parameter is required, the default value
will be ignored.
is_list (bool):
Indicates whether the parameter represents a
list of values.
redact (bool):
Indicates whether the parameter content should be redacted
in log. If redaction is enabled, the parameter content will
be replaced by parameter name during logging.
reprompt_event_handlers (EventHandler | List[EventHandler]):
The handlers for parameter-level events, used to provide reprompt
for the parameter or transition to a different page/flow.
The supported events are:
- ``sys.no-match-<N>``, where N can be from 1 to 6
- ``sys.no-match-default``
- ``sys.no-input-<N>``, where N can be from 1 to 6
- ``sys.no-input-default``
- ``sys.invalid-parameter``
``initial_prompt_fulfillment`` provides the first prompt for
the parameter.
If the event handler for the corresponding event can't be found on
the parameter, ``initial_prompt_fulfillment`` will be re-prompted.
Returns:
A Page object stored in proto_obj.
"""
self._check_proto_obj_attr_exist()
# Types error checking
if not (display_name and isinstance(display_name, str)):
raise ValueError("`display_name` should be a nonempty string.")
if not (entity_type and isinstance(entity_type, str)):
raise ValueError("`entity_type` should be a valid entity type id.")
if not (initial_prompt_fulfillment and
isinstance(initial_prompt_fulfillment, Fulfillment)):
raise ValueError(
"`initial_prompt_fulfillment` should be a Fulfillment."
)
if not(
isinstance(required, bool) and
isinstance(is_list, bool) and
isinstance(redact, bool)
):
raise ValueError(
"`is_list`, `required`, and `redact` should be bool."
)
if reprompt_event_handlers:
self._is_type_or_list_of_types(
reprompt_event_handlers, EventHandler, "reprompt_event_handlers"
)
if not isinstance(reprompt_event_handlers, list):
reprompt_event_handlers = [reprompt_event_handlers]
if required:
the_param = Form.Parameter(
display_name=display_name,
required=required,
entity_type=entity_type,
is_list=is_list,
redact=redact
)
else:
if not isinstance(default_value, str):
raise ValueError("`default_value` should be a string.")
the_param = Form.Parameter(
display_name=display_name,
required=required,
entity_type=entity_type,
is_list=is_list,
redact=redact,
default_value=default_value
)
the_param.fill_behavior = Form.Parameter.FillBehavior(
initial_prompt_fulfillment=initial_prompt_fulfillment,
reprompt_event_handlers=reprompt_event_handlers
)
self.proto_obj.form.parameters.append(the_param)
return self.proto_obj
def add_transition_route(
self,
transition_routes: Union[TransitionRoute, List[TransitionRoute]]
) -> Page:
"""Add single or multiple TransitionRoutes to the Page.
Args:
transition_routes (TransitionRoute | List[TransitionRoute]):
A single or list of TransitionRoutes to add
to the Page existing in proto_obj.
Returns:
A Page object stored in proto_obj.
"""
self._check_proto_obj_attr_exist()
# Type/Error checking
self._is_type_or_list_of_types(
transition_routes, TransitionRoute, "transition_routes"
)
if not isinstance(transition_routes, list):
transition_routes = [transition_routes]
self.proto_obj.transition_routes.extend(transition_routes)
return self.proto_obj
def add_event_handler(
self,
event_handlers: Union[EventHandler, List[EventHandler]]
) -> Page:
"""Add single or multiple EventHandlers to the Page.
Args:
event_handlers (EventHandler | List[EventHandler]):
A single or list of EventHandler to add
to the Page existing in proto_obj.
Returns:
A Page object stored in proto_obj.
"""
self._check_proto_obj_attr_exist()
# Type/Error checking
self._is_type_or_list_of_types(
event_handlers, EventHandler, "event_handlers"
)
if not isinstance(event_handlers, list):
event_handlers = [event_handlers]
self.proto_obj.event_handlers.extend(event_handlers)
return self.proto_obj
def add_transition_route_group(
self,
transition_route_groups: Union[str, List[str]]
) -> Page:
"""Add single or multiple TransitionRouteGroups to the Page.
Args:
transition_route_groups (str | List[str]):
A single or list of TransitionRouteGroup's id to add
to the Page existing in proto_obj. Format:
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/
flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>``.
Returns:
A Page object stored in proto_obj.
"""
self._check_proto_obj_attr_exist()
# Type/Error checking
self._is_type_or_list_of_types(
transition_route_groups, str, "transition_route_groups"
)
if not isinstance(transition_route_groups, list):
transition_route_groups = [transition_route_groups]
self.proto_obj.transition_route_groups.extend(transition_route_groups)
return self.proto_obj
def remove_parameter(
self,
display_name: Union[str, List[str]]
) -> Page:
"""Remove single or multiple parameters from the Page.
Args:
display_name (str | List[str]):
A string or a list of strings corresponding to
the name of the parameter(s).
Returns:
A Page object stored in proto_obj.
"""
self._check_proto_obj_attr_exist()
# Types error checking
if not display_name:
raise ValueError("`display_name` should not be empty.")
self._is_type_or_list_of_types(display_name, str, "display_name")
if not isinstance(display_name, list):
display_name = [display_name]
new_params = [
param
for param in self.proto_obj.form.parameters
if param.display_name not in display_name
]
self.proto_obj.form.parameters = new_params
return self.proto_obj
def remove_transition_route(
self,
transition_route: TransitionRoute = None,
intent: str = None,
condition: str = None
) -> Page:
"""Remove a transition route from the Page.
At least one of the `transition_route`, `intent`, or `condition` should
be specfied.
Args:
transition_route (TransitionRoute):
The TransitionRoute to remove from the Page.
intent (str):
TransitionRoute's intent that should be removed from the Page.
condition (str):
TransitionRoute's condition that should be removed from the Page.
Returns:
A Page object stored in proto_obj.
"""
self._check_proto_obj_attr_exist()
new_routes = []
for tr in self.proto_obj.transition_routes:
if self._match_transition_route(
transition_route=tr, target_route=transition_route,
intent=intent, condition=condition
):
continue
new_routes.append(tr)
self.proto_obj.transition_routes = new_routes
return self.proto_obj
def remove_event_handler(
self,
event_handlers: Union[EventHandler, List[EventHandler]] = None,
event_names: Union[str, List[str]] = None
) -> Page:
"""Remove single or multiple EventHandlers from the Page.
Args:
event_handlers (EventHandler | List[EventHandler]):
A single or list of EventHandler to remove
from the Page existing in proto_obj.
Only one of the `event_handlers` and
`event_names` should be specified.
event_names (str | List[str]):
A single or list of EventHandler's event names corresponding to the
EventHandler to remove from the Page existing in proto_obj.
Only one of the `event_handlers` and
`event_names` should be specified.
Returns:
A Page object stored in proto_obj.
"""
self._check_proto_obj_attr_exist()
if event_handlers and event_names:
raise UserWarning(
"Only one of the `event_handlers` and "
"`event_names` should be specified."
)
if event_handlers:
new_ehs = self._find_unmatched_event_handlers(event_handlers)
elif event_names:
new_ehs = self._find_unmatched_event_handlers_by_name(event_names)
else:
raise UserWarning(
"At least one of the `event_handlers` and "
"`event_names` should be specified."
)
self.proto_obj.event_handlers = new_ehs
return self.proto_obj
def remove_transition_route_group(
self,
transition_route_groups: Union[str, List[str]]
) -> Page:
"""Remove single or multiple TransitionRouteGroups from the Page.
Args:
transition_route_groups (str | List[str]):
A single or list of TransitionRouteGroup's id to remove
from the Page existing in proto_obj. Format:
``projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/
flows/<Flow ID>/transitionRouteGroups/<TransitionRouteGroup ID>``.
Returns:
A Page object stored in proto_obj.
"""
self._check_proto_obj_attr_exist()
# Type error checking
self._is_type_or_list_of_types(
transition_route_groups, str, "transition_route_groups"
)
if not isinstance(transition_route_groups, list):
transition_route_groups = [transition_route_groups]
new_trgs = [
trg
for trg in self.proto_obj.transition_route_groups
if trg not in transition_route_groups
]
self.proto_obj.transition_route_groups = new_trgs
return self.proto_obj
@dataclass
class PageStats():
"""A class for tracking the stats of CX Page object."""
page_proto_obj: Page
# Entry Fulfillment
has_entry_fulfill: bool = False
# Parameters
parameters_count: int = 0
parameters_with_event_handler_count: int = 0
parameters_with_webhook_fulfill_count: int = 0
parameters_ratio: int = 0
# Transition Routes
transition_routes_count: int = 0
routes_with_fulfill_count: int = 0
routes_with_webhook_fulfill_count: int = 0
intent_routes_count: int = 0
cond_routes_count: int = 0
intent_and_cond_routes_count: int = 0
# Event Handlers
event_handlers_count: int = 0
events_with_fulfill_count: int = 0
events_with_webhook_fulfill_count: int = 0
# Transition Route Groups
transition_route_groups_count: int = 0
def calc_transition_route_stats(self):
"""Calculating TransitionRoute related stats."""
self.transition_routes_count = len(
self.page_proto_obj.transition_routes
)
for tr in self.page_proto_obj.transition_routes:
if tr.trigger_fulfillment:
self.routes_with_fulfill_count += 1
fb = FulfillmentBuilder(tr.trigger_fulfillment)
if fb.has_webhook():
self.routes_with_webhook_fulfill_count += 1
if tr.intent and tr.condition:
self.intent_and_cond_routes_count += 1
elif tr.intent and not tr.condition:
self.intent_routes_count += 1
elif not tr.intent and tr.condition:
self.cond_routes_count += 1
def create_transition_route_str(self) -> str:
"""String representation of TransitionRoutes stats."""
transition_routes_str = (
f"# of Transition Routes: {self.transition_routes_count}"
)
routes_with_fulfill_str = (
f"# of routes with fulfillment: {self.routes_with_fulfill_count}"
)
routes_with_webhook_fulfill_str = (
"# of routes uses webhook for fulfillment:"
f" {self.routes_with_webhook_fulfill_count}"
)
intent_routes_str = f"# of intent routes: {self.intent_routes_count}"
cond_routes_str = f"# of condition routes: {self.cond_routes_count}"
intent_and_cond_routes_str = (
"# of intent and condition routes:"
f" {self.intent_and_cond_routes_count}"
)
return (
f"{transition_routes_str}\n\t{intent_routes_str}"
f"\n\t{cond_routes_str}\n\t{intent_and_cond_routes_str}"
f"\n\t{routes_with_fulfill_str}"
f"\n\t{routes_with_webhook_fulfill_str}"
)
def calc_event_handler_stats(self):
"""Calculating EventHandler related stats."""
self.event_handlers_count = len(self.page_proto_obj.event_handlers)
for eh in self.page_proto_obj.event_handlers:
fb = FulfillmentBuilder(eh.trigger_fulfillment)
if fb.has_webhook():
self.events_with_webhook_fulfill_count += 1
if eh.trigger_fulfillment:
self.events_with_fulfill_count += 1
def create_event_handler_str(self) -> str:
"""String representation of EventHandlers stats."""
event_handlers_str = f"# of Event Handlers: {self.event_handlers_count}"
events_with_fulfill_str = (
"# of Event Handlers with fulfillment:"
f" {self.events_with_fulfill_count}"
)
events_with_webhook_fulfill_str = (
"# of Event Handlers uses webhook for fulfillment:"
f" {self.events_with_webhook_fulfill_count}"
)
return (
f"{event_handlers_str}\n\t{events_with_fulfill_str}"
f"\n\t{events_with_webhook_fulfill_str}"
)
def calc_parameter_stats(self):
"""Calculating Parameter related stats."""
self.parameters_count = len(self.page_proto_obj.form.parameters)
for param in self.page_proto_obj.form.parameters:
fb = FulfillmentBuilder(
param.fill_behavior.initial_prompt_fulfillment
)
if fb.has_webhook():
self.parameters_with_webhook_fulfill_count += 1
if param.fill_behavior.reprompt_event_handlers:
self.parameters_with_event_handler_count += 1
if self.parameters_count != 0:
self.parameters_ratio = (
self.parameters_with_event_handler_count/self.parameters_count
)
def create_parameter_str(self) -> str:
"""String representation of Page's parameters stats."""
parameters_str = f"# of Parameters: {self.parameters_count}"
parameters_with_event_handler_str = (
"# of Parameters with Event Handlers:"
f" {self.parameters_with_event_handler_count}"
f" (Ratio: {self.parameters_ratio})"
)
parameters_with_webhook_fulfill_str = (
"# of Parameters uses webhook for fulfillment:"
f" {self.parameters_with_webhook_fulfill_count}"
)
return (
f"{parameters_str}\n\t{parameters_with_event_handler_str}"
f"\n\t{parameters_with_webhook_fulfill_str}"
)
def create_entry_fulfillment_str(self) -> str:
"""String representation for Page's Entry Fulfillment."""
self.has_entry_fulfill = bool(self.page_proto_obj.entry_fulfillment)
return f"Has entry fulfillment: {self.has_entry_fulfill}"
def create_transition_route_group_str(self) -> str:
"""String representation of TransitionRouteGroup stats."""
self.transition_route_groups_count = len(
self.page_proto_obj.transition_route_groups
)
return (
"# of Transition Route Groups:"
f" {self.transition_route_groups_count}"
)
def generate_stats(self):
"""Generate stats for the Page."""
self.calc_parameter_stats()
self.calc_transition_route_stats()
self.calc_event_handler_stats()
has_entry_fulfill_str = self.create_entry_fulfillment_str()
params_stats_str = self.create_parameter_str()
routes_stats_str = self.create_transition_route_str()
events_stats_str = self.create_event_handler_str()
route_groups_stats_str = self.create_transition_route_group_str()
out = (
f"{has_entry_fulfill_str}\n{params_stats_str}\n{routes_stats_str}"
f"\n{events_stats_str}\n{route_groups_stats_str}"
)
print(out)