Hi @Dionzzz,
Welcome to Google Cloud Community!
This error is caused by the main function in the Cloud Function code doesn't accept two arguments. To fix this, you need to modify the main function to accept two arguments:
def hello_pubsub(message, context)
If the result is the following error, remove any main calls without parameters or update the calls with two parameters, as appropriate.
Error message: hello_pubsub() missing 2 required positional arguments: 'data' and 'context'
Please refer to this documentation on TypeError shown while using a Cloud Function triggered by a Pub/Sub API.
You may also check the following Stack Overflow link as reference:
Hope this helps.
Do we just call the functions we wrote in the main function like "hello_pubsub" in my case?
For example: