Skip to content

Commit 0d9eff7

Browse files
authored
Merge pull request #34 from justwatch/feature/get-link-caption
getLinkCaption
2 parents f4ca9db + 27bd0ac commit 0d9eff7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

marketing/v19/adcreative.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,6 +292,21 @@ func (ac AdCreative) GetLandingPageURL() string {
292292
return ""
293293
}
294294

295+
// GetLinkCaption returns the link caption page URL of the creative.
296+
func (ac AdCreative) GetLinkCaption() string {
297+
if ac.ObjectStorySpec == nil {
298+
return ""
299+
}
300+
301+
if ac.ObjectStorySpec.LinkData != nil {
302+
return ac.ObjectStorySpec.LinkData.CallToAction.Value.LinkCaption
303+
} else if ac.ObjectStorySpec.VideoData != nil && ac.ObjectStorySpec.VideoData.CallToAction != nil && ac.ObjectStorySpec.VideoData.CallToAction.Value != nil {
304+
return ac.ObjectStorySpec.VideoData.CallToAction.Value.LinkCaption
305+
}
306+
307+
return ""
308+
}
309+
295310
// ObjectStorySpec contains the media of a creative.
296311
type ObjectStorySpec struct {
297312
PageID string `json:"page_id,omitempty"`

0 commit comments

Comments
 (0)