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/message_call_missed_request.go from red-kit/httpsms-gateway: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/requests/message_call_missed_request.go
- Command line
-
hf download hf://spaces/red-kit/httpsms-gateway/api/pkg/requests/message_call_missed_request.go
-
curl -L -o message_call_missed_request.go https://huggingface.co/spaces/red-kit/httpsms-gateway/resolve/main/api/pkg/requests/message_call_missed_request.go
1.26 kB
| package requests | |
| import ( | |
| "time" | |
| "github.com/NdoleStudio/httpsms/pkg/entities" | |
| "github.com/nyaruka/phonenumbers" | |
| "github.com/NdoleStudio/httpsms/pkg/services" | |
| ) | |
| // MessageCallMissed is the payload for sending and missed call event | |
| type MessageCallMissed struct { | |
| request | |
| From string `json:"from" example:"+18005550199"` | |
| To string `json:"to" example:"+18005550100"` | |
| SIM string `json:"sim" example:"SIM1"` | |
| Timestamp time.Time `json:"timestamp" example:"2022-06-05T14:26:09.527976+03:00"` | |
| } | |
| // Sanitize sets defaults to MessageReceive | |
| func (input *MessageCallMissed) Sanitize() MessageCallMissed { | |
| input.To = input.sanitizeAddress(input.To) | |
| input.From = input.sanitizeContact(input.To, input.From) | |
| input.SIM = input.sanitizeSIM(input.SIM) | |
| return *input | |
| } | |
| // ToCallMissedParams converts MessageCallMissed to services.MessageSendParams | |
| func (input *MessageCallMissed) ToCallMissedParams(userID entities.UserID, source string) *services.MissedCallParams { | |
| to, _ := phonenumbers.Parse(input.To, phonenumbers.UNKNOWN_REGION) | |
| return &services.MissedCallParams{ | |
| Source: source, | |
| Owner: to, | |
| Timestamp: input.Timestamp, | |
| SIM: entities.SIM(input.SIM), | |
| UserID: userID, | |
| Contact: input.From, | |
| } | |
| } | |