| 1 | package pushbulletscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/ |
| 2 | |
| 3 | import ( |
| 4 | "regexpscip-go gomod github.com/golang/go/src . regexp/" |
| 5 | ) |
| 6 | |
| 7 | type PushRequestscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest# struct { |
| 8 | Typescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#Type. string `json:"type"` |
| 9 | Titlescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#Title. string `json:"title"` |
| 10 | Bodyscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#Body. string `json:"body"` |
| 11 | |
| 12 | Emailscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#Email. string `json:"email"` |
| 13 | ChannelTagscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#ChannelTag. string `json:"channel_tag"` |
| 14 | DeviceIdenscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#DeviceIden. string `json:"device_iden"` |
| 15 | } |
| 16 | |
| 17 | type PushResponsescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse# struct { |
| 18 | Activescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#Active. bool `json:"active"` |
| 19 | Bodyscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#Body. string `json:"body"` |
| 20 | Createdscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#Created. float64 `json:"created"` |
| 21 | Directionscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#Direction. string `json:"direction"` |
| 22 | Dismissedscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#Dismissed. bool `json:"dismissed"` |
| 23 | Idenscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#Iden. string `json:"iden"` |
| 24 | Modifiedscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#Modified. float64 `json:"modified"` |
| 25 | ReceiverEmailscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#ReceiverEmail. string `json:"receiver_email"` |
| 26 | ReceiverEmailNormalizedscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#ReceiverEmailNormalized. string `json:"receiver_email_normalized"` |
| 27 | ReceiverIdenscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#ReceiverIden. string `json:"receiver_iden"` |
| 28 | SenderEmailscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#SenderEmail. string `json:"sender_email"` |
| 29 | SenderEmailNormalizedscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#SenderEmailNormalized. string `json:"sender_email_normalized"` |
| 30 | SenderIdenscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#SenderIden. string `json:"sender_iden"` |
| 31 | SenderNamescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#SenderName. string `json:"sender_name"` |
| 32 | Titlescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#Title. string `json:"title"` |
| 33 | Typescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushResponse#Type. string `json:"type"` |
| 34 | } |
| 35 | |
| 36 | type ResponseErrorscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/ResponseError# struct { |
| 37 | ErrorDatascip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/ResponseError#ErrorData. struct { |
| 38 | Catscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/ResponseError#$anon_19c79bbdc47ab917#Cat. string `json:"cat"` |
| 39 | Messagescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/ResponseError#$anon_19c79bbdc47ab917#Message. string `json:"message"` |
| 40 | Typescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/ResponseError#$anon_19c79bbdc47ab917#Type. string `json:"type"` |
| 41 | } `json:"error"` |
| 42 | } |
| 43 | |
| 44 | var emailPatternscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/emailPattern. = regexpscip-go gomod github.com/golang/go/src . regexp/.MustCompilescip-go gomod github.com/golang/go/src . regexp/MustCompile().(`.*@.*\..*`) |
| 45 | |
| 46 | func (err *ResponseErrorscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/ResponseError#) Errorscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/ResponseError#Error().() string { |
| 47 | return err.ErrorDatascip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/ResponseError#ErrorData..Messagescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/ResponseError#$anon_19c79bbdc47ab917#Message. |
| 48 | } |
| 49 | |
| 50 | // NewNotePush creates a new push request. |
| 51 | // |
| 52 | //nolint:exhaustruct_v5 // PushRequest targeting fields (Email, ChannelTag, DeviceIden) are set by SetTarget method |
| 53 | func NewNotePushscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/NewNotePush().(message, title string) *PushRequestscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest# { |
| 54 | return &PushRequestscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#{ |
| 55 | Typescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#Type.: "note", |
| 56 | Titlescip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#Title.: title, |
| 57 | Bodyscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#Body.: message, |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | func (p *PushRequestscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#) SetTargetscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#SetTarget().(target string) { |
| 62 | if emailPatternscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/emailPattern..MatchStringscip-go gomod github.com/golang/go/src . regexp/Regexp#MatchString().(target) { |
| 63 | p.Emailscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#Email. = target |
| 64 | |
| 65 | return |
| 66 | } |
| 67 | |
| 68 | if target != "" && string(target[0]) == "#" { |
| 69 | p.ChannelTagscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#ChannelTag. = target[1:] |
| 70 | |
| 71 | return |
| 72 | } |
| 73 | |
| 74 | p.DeviceIdenscip-go gomod github.com/nicholas-fedor/shoutrrr . `github.com/nicholas-fedor/shoutrrr/pkg/services/push/pushbullet`/PushRequest#DeviceIden. = target |
| 75 | } |