Spaces:
Paused
Paused
File size: 919 Bytes
83a59ca | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | package requests
import (
"github.com/NdoleStudio/httpsms/pkg/entities"
"github.com/NdoleStudio/httpsms/pkg/services"
"github.com/google/uuid"
)
// WebhookUpdate is the payload for updating an entities.Webhook
type WebhookUpdate struct {
WebhookStore
WebhookID string `json:"webhookID" swaggerignore:"true"` // used internally for validation
}
// Sanitize sets defaults to WebhookUpdate
func (input *WebhookUpdate) Sanitize() WebhookUpdate {
input.WebhookStore.Sanitize()
return *input
}
// ToUpdateParams converts WebhookUpdate to services.WebhookUpdateParams
func (input *WebhookUpdate) ToUpdateParams(user entities.AuthContext) *services.WebhookUpdateParams {
return &services.WebhookUpdateParams{
UserID: user.ID,
WebhookID: uuid.MustParse(input.WebhookID),
SigningKey: input.SigningKey,
URL: input.URL,
PhoneNumbers: input.PhoneNumbers,
Events: input.Events,
}
}
|