Spaces:
Paused
Paused
ML Intern deploy
Deploy httpSMS gateway to Hugging Face Spaces (Docker SDK): nginx :7860 -> Go API :8000, Nuxt SPA, Android APK, bootstrap-mode entrypoint
83a59ca Download api/pkg/requests/discord_update_request.go from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 918 Bytes
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/requests/discord_update_request.go
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway/api/pkg/requests/discord_update_request.go
-
curl -L -o discord_update_request.go https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/requests/discord_update_request.go
918 Bytes
| package requests | |
| import ( | |
| "github.com/NdoleStudio/httpsms/pkg/entities" | |
| "github.com/NdoleStudio/httpsms/pkg/services" | |
| "github.com/google/uuid" | |
| ) | |
| // DiscordUpdate is the payload for updating an entities.Webhook | |
| type DiscordUpdate struct { | |
| DiscordStore | |
| DiscordID string `json:"discordID" swaggerignore:"true"` // used internally for validation | |
| } | |
| // Sanitize sets defaults to WebhookUpdate | |
| func (input *DiscordUpdate) Sanitize() DiscordUpdate { | |
| input.DiscordStore.Sanitize() | |
| return *input | |
| } | |
| // ToUpdateParams converts DiscordUpdate to services.DiscordUpdateParams | |
| func (input *DiscordUpdate) ToUpdateParams(user entities.AuthContext) *services.DiscordUpdateParams { | |
| return &services.DiscordUpdateParams{ | |
| UserID: user.ID, | |
| Name: input.Name, | |
| ServerID: input.ServerID, | |
| IncomingChannelID: input.IncomingChannelID, | |
| DiscordID: uuid.MustParse(input.DiscordID), | |
| } | |
| } | |