// EmitValidationCallback send callback to given callbackURL
EmitValidationCallback send callback to given callbackURL
// EmitValidationCallback send callback to given callbackURL
func (callback *CallbackPayload) EmitValidationCallback(callbackURL string) error {
	if callbackURL == "" {
		return fmt.Errorf("callbackURL is not set")
	}
	payload, err := json.Marshal(callback)
	if err != nil {
		return err
	}
	resp, err := retryablehttp.Post(callbackURL, "application/json", bytes.NewBuffer(payload))
	if err != nil {
		return err
	}
	if c := resp.StatusCode; c < http.StatusOK || http.StatusBadRequest <= c {
		return fmt.Errorf("failed to send callback. status code: %d", c)
	}
	return nil
}
func ( callback * CallbackPayload ) EmitValidationCallback ( callbackURL string ) error { if callbackURL == " " { return fmt . Errorf ( " " ) } payload , err := json . Marshal ( callback ) if err != nil { return err } resp , err := retryablehttp . Post ( callbackURL , " " , bytes . NewBuffer ( payload ) ) if err != nil { return err } if c := resp . StatusCode ; c < http . StatusOK || http . StatusBadRequest <= c { return fmt . Errorf ( " " , c ) } return nil }
EmitValidationCallback send callback to given callbackURL
EmitValidationCallback send callback to given callbackURL