9393
9494from pact ._util import strftime_to_simple_date_format
9595from pact .generate .generator import (
96- Generator ,
96+ AbstractGenerator ,
9797 GenericGenerator ,
9898)
9999
116116#
117117# <https://github.com/pact-foundation/pact-reference/blob/303073c/rust/pact_models/src/generators/mod.rs#L121>
118118__all__ = [
119- "Generator " ,
119+ "AbstractGenerator " ,
120120 "bool" ,
121121 "boolean" ,
122122 "date" ,
@@ -172,7 +172,7 @@ def int(
172172 * ,
173173 min : builtins .int | None = None ,
174174 max : builtins .int | None = None ,
175- ) -> Generator :
175+ ) -> AbstractGenerator :
176176 """
177177 Generate a random integer.
178178
@@ -198,7 +198,7 @@ def integer(
198198 * ,
199199 min : builtins .int | None = None ,
200200 max : builtins .int | None = None ,
201- ) -> Generator :
201+ ) -> AbstractGenerator :
202202 """
203203 Alias for [`generate.int`][pact.generate.int].
204204
@@ -215,7 +215,7 @@ def integer(
215215 return int (min = min , max = max )
216216
217217
218- def float (precision : builtins .int | None = None ) -> Generator :
218+ def float (precision : builtins .int | None = None ) -> AbstractGenerator :
219219 """
220220 Generate a random decimal number.
221221
@@ -235,7 +235,7 @@ def float(precision: builtins.int | None = None) -> Generator:
235235 return GenericGenerator ("RandomDecimal" , extra_fields = params )
236236
237237
238- def decimal (precision : builtins .int | None = None ) -> Generator :
238+ def decimal (precision : builtins .int | None = None ) -> AbstractGenerator :
239239 """
240240 Alias for [`generate.float`][pact.generate.float].
241241
@@ -249,7 +249,7 @@ def decimal(precision: builtins.int | None = None) -> Generator:
249249 return float (precision = precision )
250250
251251
252- def hex (digits : builtins .int | None = None ) -> Generator :
252+ def hex (digits : builtins .int | None = None ) -> AbstractGenerator :
253253 """
254254 Generate a random hexadecimal value.
255255
@@ -266,7 +266,7 @@ def hex(digits: builtins.int | None = None) -> Generator:
266266 return GenericGenerator ("RandomHexadecimal" , extra_fields = params )
267267
268268
269- def hexadecimal (digits : builtins .int | None = None ) -> Generator :
269+ def hexadecimal (digits : builtins .int | None = None ) -> AbstractGenerator :
270270 """
271271 Alias for [`generate.hex`][pact.generate.hex].
272272
@@ -280,7 +280,7 @@ def hexadecimal(digits: builtins.int | None = None) -> Generator:
280280 return hex (digits = digits )
281281
282282
283- def str (size : builtins .int | None = None ) -> Generator :
283+ def str (size : builtins .int | None = None ) -> AbstractGenerator :
284284 """
285285 Generate a random string.
286286
@@ -297,7 +297,7 @@ def str(size: builtins.int | None = None) -> Generator:
297297 return GenericGenerator ("RandomString" , extra_fields = params )
298298
299299
300- def string (size : builtins .int | None = None ) -> Generator :
300+ def string (size : builtins .int | None = None ) -> AbstractGenerator :
301301 """
302302 Alias for [`generate.str`][pact.generate.str].
303303
@@ -311,7 +311,7 @@ def string(size: builtins.int | None = None) -> Generator:
311311 return str (size = size )
312312
313313
314- def regex (regex : builtins .str ) -> Generator :
314+ def regex (regex : builtins .str ) -> AbstractGenerator :
315315 """
316316 Generate a string matching a regex pattern.
317317
@@ -336,7 +336,7 @@ def regex(regex: builtins.str) -> Generator:
336336
337337def uuid (
338338 format : _UUID_FORMAT_NAMES = "lowercase" ,
339- ) -> Generator :
339+ ) -> AbstractGenerator :
340340 """
341341 Generate a UUID.
342342
@@ -354,7 +354,7 @@ def date(
354354 format : builtins .str = "%Y-%m-%d" ,
355355 * ,
356356 disable_conversion : builtins .bool = False ,
357- ) -> Generator :
357+ ) -> AbstractGenerator :
358358 """
359359 Generate a date value.
360360
@@ -384,7 +384,7 @@ def time(
384384 format : builtins .str = "%H:%M:%S" ,
385385 * ,
386386 disable_conversion : builtins .bool = False ,
387- ) -> Generator :
387+ ) -> AbstractGenerator :
388388 """
389389 Generate a time value.
390390
@@ -413,7 +413,7 @@ def datetime(
413413 format : builtins .str ,
414414 * ,
415415 disable_conversion : builtins .bool = False ,
416- ) -> Generator :
416+ ) -> AbstractGenerator :
417417 """
418418 Generate a datetime value.
419419
@@ -444,7 +444,7 @@ def timestamp(
444444 format : builtins .str ,
445445 * ,
446446 disable_conversion : builtins .bool = False ,
447- ) -> Generator :
447+ ) -> AbstractGenerator :
448448 """
449449 Alias for [`generate.datetime`][pact.generate.datetime].
450450
@@ -454,7 +454,7 @@ def timestamp(
454454 return datetime (format = format , disable_conversion = disable_conversion )
455455
456456
457- def bool () -> Generator :
457+ def bool () -> AbstractGenerator :
458458 """
459459 Generate a random boolean value.
460460
@@ -464,7 +464,7 @@ def bool() -> Generator:
464464 return GenericGenerator ("RandomBoolean" )
465465
466466
467- def boolean () -> Generator :
467+ def boolean () -> AbstractGenerator :
468468 """
469469 Alias for [`generate.bool`][pact.generate.bool].
470470
@@ -474,7 +474,7 @@ def boolean() -> Generator:
474474 return bool ()
475475
476476
477- def provider_state (expression : builtins .str | None = None ) -> Generator :
477+ def provider_state (expression : builtins .str | None = None ) -> AbstractGenerator :
478478 """
479479 Generate a value from provider state context.
480480
@@ -494,7 +494,7 @@ def provider_state(expression: builtins.str | None = None) -> Generator:
494494def mock_server_url (
495495 regex : builtins .str | None = None ,
496496 example : builtins .str | None = None ,
497- ) -> Generator :
497+ ) -> AbstractGenerator :
498498 """
499499 Generate a mock server URL.
500500
0 commit comments