-
Notifications
You must be signed in to change notification settings - Fork 30
/
embeds_links.go
43 lines (37 loc) · 1.38 KB
/
embeds_links.go
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
33
34
35
36
37
38
39
40
41
42
43
package wire
import (
validation "github.com/go-ozzo/ozzo-validation/v4"
"gopkg.in/guregu/null.v4"
)
type EmbedLinkCreateRequestWire struct {
Url string `json:"url"`
ThemeColor null.String `json:"theme_color"`
OgTitle null.String `json:"og_title"`
OgSiteName null.String `json:"og_site_name"`
OgDescription null.String `json:"og_description"`
OgImage null.String `json:"og_image"`
OeType null.String `json:"oe_type"`
OeAuthorName null.String `json:"oe_author_name"`
OeAuthorUrl null.String `json:"oe_author_url"`
OeProviderName null.String `json:"oe_provider_name"`
OeProviderUrl null.String `json:"oe_provider_url"`
TwCard null.String `json:"tw_card"`
}
func (req EmbedLinkCreateRequestWire) Validate() error {
return validation.ValidateStruct(&req,
validation.Field(&req.Url, validation.Required),
)
}
type EmbedLinkCreateResponseDataWire struct {
ID string `json:"id"`
URL string `json:"url"`
}
type EmbedLinkCreateResponseWire APIResponse[EmbedLinkCreateResponseDataWire]
type EmbedLinkOEmbedResponseWire struct {
Type string `json:"type,omitempty"`
Title string `json:"title,omitempty"`
AuthorName string `json:"author_name,omitempty"`
AuthorUrl string `json:"author_url,omitempty"`
ProviderName string `json:"provider_name,omitempty"`
ProviderUrl string `json:"provider_url,omitempty"`
}