@@ -11,8 +11,11 @@ def type_field(default: typing.Union[str, None] = None) -> typing.Any:
11
11
Helper function to generate the CloudEvent `type` field,
12
12
optionally with a default value.
13
13
14
- :param default: The default value of the field
15
- :return:
14
+ Args:
15
+ default: The default value of the field
16
+
17
+ Returns:
18
+ The pydantic field object
16
19
"""
17
20
field = pydantic .Field (
18
21
title = "Event Type" ,
@@ -33,8 +36,11 @@ def source_field(default: typing.Union[str, None] = None) -> typing.Any:
33
36
Helper function to generate the CloudEvent `source` field,
34
37
optionally with a default value.
35
38
36
- :param default: The default value of the field
37
- :return:
39
+ Args:
40
+ default: The default value of the field
41
+
42
+ Returns:
43
+ The pydantic field object
38
44
"""
39
45
field = pydantic .Field (
40
46
title = "Event Source" ,
@@ -71,9 +77,12 @@ def dataschema_field(
71
77
Helper function to generate the CloudEvent `dataschema` field,
72
78
pointing to the event schema url.
73
79
74
- :param base_url: The base URL for event dataschema
75
- :param event_name: The event_name value of the field
76
- :return:
80
+ Args:
81
+ base_url: The base URL for event dataschema
82
+ event_name: The event_name value of the field
83
+
84
+ Returns:
85
+ The pydantic field object
77
86
"""
78
87
content = f"{ base_url } /{ event_name or 'some_event' } "
79
88
schema = pydantic .Field (
@@ -114,8 +123,11 @@ def subject_field(default: typing.Union[str, None] = None) -> typing.Any:
114
123
Helper function to generate the CloudEvent `subject` field,
115
124
optionally with a default value.
116
125
117
- :param default: The default value of the field
118
- :return:
126
+ Args:
127
+ default: The default value of the field
128
+
129
+ Returns:
130
+ The pydantic field object
119
131
"""
120
132
field = pydantic .Field (
121
133
title = "Event Subject" ,
0 commit comments