Webhook Generators

Generator Loading

get_webhook_generator(model: Type[WebhookModel], **kwargs) Type[ModelFactory]

Returns a webhook generator for the given webhook model. Generators are wrappers around webhook models to create mock data.

The returned generator is cached and will be returned for any future calls for the same model.

Parameters:

model (Type[webhooks.WebhookModel]) – A webhook model. This must be the type and not an instantiated object.

Return type:

Type[ModelFactory]

_load_webhook_generators()

The following code runs when the file is imported. All webhook models discovered (that is, any class based from WebhookModel) will be processed to set up mock data generation for key fields. The returned generator is then loaded into the globals() so they can be referenced by other models that depend on them (ensuring the fields configured for mock data are intact).

Field Mocking

epoch() int

Returns epoch as an integer.

Return type:

int

serial_number() str

Returns a randomized string representing an Apple serial number.

Return type:

str

udid() str

Returns an upper-cased UUID.

Return type:

str