Skip to content

Commit

Permalink
Merge pull request #34 from justwatch/feature/get-link-caption
Browse files Browse the repository at this point in the history
getLinkCaption
  • Loading branch information
martinbockt authored Sep 27, 2024
2 parents f4ca9db + 27bd0ac commit 0d9eff7
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions marketing/v19/adcreative.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,21 @@ func (ac AdCreative) GetLandingPageURL() string {
return ""
}

// GetLinkCaption returns the link caption page URL of the creative.
func (ac AdCreative) GetLinkCaption() string {
if ac.ObjectStorySpec == nil {
return ""
}

if ac.ObjectStorySpec.LinkData != nil {
return ac.ObjectStorySpec.LinkData.CallToAction.Value.LinkCaption
} else if ac.ObjectStorySpec.VideoData != nil && ac.ObjectStorySpec.VideoData.CallToAction != nil && ac.ObjectStorySpec.VideoData.CallToAction.Value != nil {
return ac.ObjectStorySpec.VideoData.CallToAction.Value.LinkCaption
}

return ""
}

// ObjectStorySpec contains the media of a creative.
type ObjectStorySpec struct {
PageID string `json:"page_id,omitempty"`
Expand Down

0 comments on commit 0d9eff7

Please sign in to comment.