-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement get webhook config endpoint
- Loading branch information
Showing
3 changed files
with
28 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package monta | ||
|
||
import ( | ||
"context" | ||
"net/url" | ||
) | ||
|
||
// GetWebhookConfigResponse is the response output from the [Client.GetWebhookConfig] method. | ||
type GetWebhookConfigResponse struct { | ||
// A HTTPS URL to send the webhook payload to when an event occurs. | ||
WebhookURL string `json:"webhookUrl"` | ||
// A cryptoghrapic secret used to sign the webhook payload. | ||
WebhookSecret string `json:"webhookSecret"` | ||
// A list of event types to subscribe to. Use of ["*"] means subscribe to all. | ||
EventTypes []*WebhookEventType `json:"eventTypes"` | ||
} | ||
|
||
// GetWebhookConfig to get your webhook config. | ||
func (c *clientImpl) GetWebhookConfig(ctx context.Context) (*GetWebhookConfigResponse, error) { | ||
path := "/v1/webhooks/config" | ||
query := url.Values{} | ||
return doGet[GetWebhookConfigResponse](ctx, c, path, query) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters