How to define a function for Google PubSub Webhook events?

Hi guys,

From Where to call & define function that will be called and receive data when Google PubSub Webhook event fires( for example Order create ) ?

Thanks in advance :slightly_smiling_face: