{"action":"created","comment":{"url":"https://api.github.com/repos/guardian/facia-scala-client/pulls/comments/28883224","id":28883224,"diff_hunk":"@@ -0,0 +1,119 @@\n+package com.gu.facia.api.utils\n+\n+import com.gu.contentapi.client.model.{Element, Tag, Content}\n+import com.gu.facia.api.models.{ImageReplace, ImageCutout, FaciaContent}\n+import org.joda.time.DateTime\n+\n+import scala.util.Try\n+\n+object FaciaContentImplicits {\n+\n+  implicit class FaciaContentImplicit(fc: FaciaContent) {\n+\n+    def maybeContent: Option[Content] = FaciaContentUtils.maybeContent(fc)\n+    def tags: List[com.gu.contentapi.client.model.Tag] = FaciaContentUtils.tags(fc)\n+    def webPublicationDateOption: Option[DateTime] = FaciaContentUtils.webPublicationDateOption(fc)\n+    def webPublicationDate: DateTime = FaciaContentUtils.webPublicationDate(fc)\n+\n+    def id: String = FaciaContentUtils.id(fc)\n+\n+    def embedType: Option[String] = FaciaContentUtils.embedType(fc)\n+    def embedCss: Option[String] = FaciaContentUtils.embedCss(fc)\n+    def embedUri: Option[String] = FaciaContentUtils.embedUri(fc)\n+\n+    def itemKicker: Option[ItemKicker] = FaciaContentUtils.itemKicker(fc)\n+\n+    def headlineOption: Option[String] = FaciaContentUtils.headlineOption(fc)\n+    def headline: String = FaciaContentUtils.headline(fc)\n+\n+    def standfirst: Option[String] = FaciaContentUtils.standfirst(fc)\n+\n+    def body(): Option[String] = FaciaContentUtils.body(fc)\n+\n+    def webUrl: Option[String] = FaciaContentUtils.webUrl(fc)\n+\n+    val DefaultSnapHref: String = \"/\"\n+    def href: Option[String] = FaciaContentUtils.href(fc)\n+\n+    def mediaType: Option[MediaType] = FaciaContentUtils.mediaType(fc)\n+\n+    def isLiveBlog: Boolean = FaciaContentUtils.isLiveBlog(fc)\n+\n+    def isLive: Boolean = FaciaContentUtils.isLive(fc)\n+\n+    def isPodcast: Boolean = FaciaContentUtils.isPodcast(fc)\n+\n+    def isMedia: Boolean = FaciaContentUtils.isMedia(fc)\n+\n+    def isEditorial: Boolean = FaciaContentUtils.isEditorial(fc)\n+\n+    def isComment: Boolean = FaciaContentUtils.isComment(fc)\n+\n+    def isAnalysis: Boolean = FaciaContentUtils.isAnalysis(fc)\n+\n+    def isReview: Boolean = FaciaContentUtils.isReview(fc)\n+\n+    def isLetters: Boolean = FaciaContentUtils.isLetters(fc)\n+\n+    def isFeature: Boolean = FaciaContentUtils.isFeature(fc)\n+\n+    def isCommentable = FaciaContentUtils.isCommentable(fc)\n+    def commentCloseDate = FaciaContentUtils.commentCloseDate(fc)\n+\n+    def maybeShortUrl = FaciaContentUtils.maybeShortUrl(fc)\n+    def shortUrl: String = FaciaContentUtils.shortUrl(fc)\n+    def shortUrlPath = FaciaContentUtils.shortUrlPath(fc)\n+    def discussionId = FaciaContentUtils.discussionId(fc)\n+    def isBoosted: Boolean = FaciaContentUtils.isBoosted(fc)\n+\n+    def showBoostedHeadline: Boolean = FaciaContentUtils.showBoostedHeadline(fc)\n+\n+    def showQuotedHeadline: Boolean = FaciaContentUtils.showQuotedHeadline(fc)\n+\n+    def showMainVideo: Boolean = FaciaContentUtils.showMainVideo(fc)\n+\n+    def imageHide: Boolean = FaciaContentUtils.imageHide(fc)\n+\n+    def sectionName: Option[String] = FaciaContentUtils.sectionName(fc)\n+\n+    def maybeSection: Option[String] = FaciaContentUtils.maybeSection(fc)\n+\n+    def section(fc: FaciaContent): String = FaciaContentUtils.section(fc)\n+\n+    def byline(fc: FaciaContent): Option[String] = FaciaContentUtils.byline(fc)\n+\n+    def showByline(fc: FaciaContent): Boolean = FaciaContentUtils.showByline(fc)\n+\n+    def keywords: Seq[Tag] = FaciaContentUtils.keywords(fc)\n+    def nonKeywordTags: Seq[Tag] = FaciaContentUtils.nonKeywordTags(fc)\n+    def contributors: Seq[Tag] = FaciaContentUtils.contributors(fc)\n+    def isContributorPage: Boolean = FaciaContentUtils.isContributorPage(fc)\n+    def series: Seq[Tag] = FaciaContentUtils.series(fc)\n+    def blogs: Seq[Tag] = FaciaContentUtils.blogs(fc)\n+    def tones: Seq[Tag] = FaciaContentUtils.tones(fc)\n+    def types: Seq[Tag] = FaciaContentUtils.types(fc)\n+    def isVideo = FaciaContentUtils.isVideo(fc)\n+    def isGallery = FaciaContentUtils.isGallery(fc)\n+    def isAudio = FaciaContentUtils.isAudio(fc)\n+    def isCartoon = FaciaContentUtils.isCartoon(fc)\n+    def isCrossword = FaciaContentUtils.isCrossword(fc)\n+\n+    def imageCutout: Option[ImageCutout] = FaciaContentUtils.imageCutout(fc)\n+\n+    def supporting: List[FaciaContent] = FaciaContentUtils.supporting(fc)\n+\n+    def starRating: Option[Int] = FaciaContentUtils.starRating(fc)\n+\n+    def trailText: Option[String] = FaciaContentUtils.trailText(fc)\n+\n+    def maybeWebTitle: Option[String] = FaciaContentUtils.maybeWebTitle(fc)\n+\n+    def webTitle: String = FaciaContentUtils.webTitle(fc)\n+\n+    def linkText = FaciaContentUtils.linkText(fc)\n+\n+    def imageReplace(fc: FaciaContent): Option[ImageReplace] = FaciaContentUtils.imageReplace(fc)","path":"fapi-client/src/main/scala/com/gu/facia/api/utils/FaciaContentImplicits.scala","position":115,"original_position":115,"commit_id":"71a3c897559b86b2f5e7de3fddf42c44406a32b7","original_commit_id":"71a3c897559b86b2f5e7de3fddf42c44406a32b7","user":{"login":"adamnfish","id":29761,"avatar_url":"https://avatars.githubusercontent.com/u/29761?v=3","gravatar_id":"","url":"https://api.github.com/users/adamnfish","html_url":"https://github.com/adamnfish","followers_url":"https://api.github.com/users/adamnfish/followers","following_url":"https://api.github.com/users/adamnfish/following{/other_user}","gists_url":"https://api.github.com/users/adamnfish/gists{/gist_id}","starred_url":"https://api.github.com/users/adamnfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamnfish/subscriptions","organizations_url":"https://api.github.com/users/adamnfish/orgs","repos_url":"https://api.github.com/users/adamnfish/repos","events_url":"https://api.github.com/users/adamnfish/events{/privacy}","received_events_url":"https://api.github.com/users/adamnfish/received_events","type":"User","site_admin":false},"body":"I don't think these should be taking `FaciaContent` as an arg?","created_at":"2015-04-22T15:24:27Z","updated_at":"2015-04-22T15:24:27Z","html_url":"https://github.com/guardian/facia-scala-client/pull/94#discussion_r28883224","pull_request_url":"https://api.github.com/repos/guardian/facia-scala-client/pulls/94","_links":{"self":{"href":"https://api.github.com/repos/guardian/facia-scala-client/pulls/comments/28883224"},"html":{"href":"https://github.com/guardian/facia-scala-client/pull/94#discussion_r28883224"},"pull_request":{"href":"https://api.github.com/repos/guardian/facia-scala-client/pulls/94"}}},"pull_request":{"url":"https://api.github.com/repos/guardian/facia-scala-client/pulls/94","id":33341268,"html_url":"https://github.com/guardian/facia-scala-client/pull/94","diff_url":"https://github.com/guardian/facia-scala-client/pull/94.diff","patch_url":"https://github.com/guardian/facia-scala-client/pull/94.patch","issue_url":"https://api.github.com/repos/guardian/facia-scala-client/issues/94","number":94,"state":"open","locked":false,"title":"Type helpers for Content and FaciaContent","user":{"login":"janua","id":445472,"avatar_url":"https://avatars.githubusercontent.com/u/445472?v=3","gravatar_id":"","url":"https://api.github.com/users/janua","html_url":"https://github.com/janua","followers_url":"https://api.github.com/users/janua/followers","following_url":"https://api.github.com/users/janua/following{/other_user}","gists_url":"https://api.github.com/users/janua/gists{/gist_id}","starred_url":"https://api.github.com/users/janua/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janua/subscriptions","organizations_url":"https://api.github.com/users/janua/orgs","repos_url":"https://api.github.com/users/janua/repos","events_url":"https://api.github.com/users/janua/events{/privacy}","received_events_url":"https://api.github.com/users/janua/received_events","type":"User","site_admin":false},"body":"This move and adds some helpers for the types `Content` and `FaciaContent`.\r\n\r\nI had been using a more comprehensive list of methods which used the `fold` from `FaciaContent` in `frontend` up until now, and I have just copied this over for use here.\r\n\r\nI have also added helpers for the type `Content`.\r\n\r\nThis paves the way for `CardStyle`.\r\n\r\n@robertberry @adamnfish @DiegoVazquezNanini ","created_at":"2015-04-15T10:26:26Z","updated_at":"2015-04-22T15:24:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"726478d8d2df572ff4d36a9df99cbf91871d012e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/guardian/facia-scala-client/pulls/94/commits","review_comments_url":"https://api.github.com/repos/guardian/facia-scala-client/pulls/94/comments","review_comment_url":"https://api.github.com/repos/guardian/facia-scala-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/guardian/facia-scala-client/issues/94/comments","statuses_url":"https://api.github.com/repos/guardian/facia-scala-client/statuses/71a3c897559b86b2f5e7de3fddf42c44406a32b7","head":{"label":"guardian:type-helpers","ref":"type-helpers","sha":"71a3c897559b86b2f5e7de3fddf42c44406a32b7","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":20723151,"name":"facia-scala-client","full_name":"guardian/facia-scala-client","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/facia-scala-client","description":"Low level client for the Facia JSON API","fork":false,"url":"https://api.github.com/repos/guardian/facia-scala-client","forks_url":"https://api.github.com/repos/guardian/facia-scala-client/forks","keys_url":"https://api.github.com/repos/guardian/facia-scala-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/facia-scala-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/facia-scala-client/teams","hooks_url":"https://api.github.com/repos/guardian/facia-scala-client/hooks","issue_events_url":"https://api.github.com/repos/guardian/facia-scala-client/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/facia-scala-client/events","assignees_url":"https://api.github.com/repos/guardian/facia-scala-client/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/facia-scala-client/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/facia-scala-client/tags","blobs_url":"https://api.github.com/repos/guardian/facia-scala-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/facia-scala-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/facia-scala-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/facia-scala-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/facia-scala-client/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/facia-scala-client/languages","stargazers_url":"https://api.github.com/repos/guardian/facia-scala-client/stargazers","contributors_url":"https://api.github.com/repos/guardian/facia-scala-client/contributors","subscribers_url":"https://api.github.com/repos/guardian/facia-scala-client/subscribers","subscription_url":"https://api.github.com/repos/guardian/facia-scala-client/subscription","commits_url":"https://api.github.com/repos/guardian/facia-scala-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/facia-scala-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/facia-scala-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/facia-scala-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/facia-scala-client/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/facia-scala-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/facia-scala-client/merges","archive_url":"https://api.github.com/repos/guardian/facia-scala-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/facia-scala-client/downloads","issues_url":"https://api.github.com/repos/guardian/facia-scala-client/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/facia-scala-client/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/facia-scala-client/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/facia-scala-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/facia-scala-client/labels{/name}","releases_url":"https://api.github.com/repos/guardian/facia-scala-client/releases{/id}","created_at":"2014-06-11T11:45:55Z","updated_at":"2015-04-15T10:44:54Z","pushed_at":"2015-04-22T13:35:33Z","git_url":"git://github.com/guardian/facia-scala-client.git","ssh_url":"git@github.com:guardian/facia-scala-client.git","clone_url":"https://github.com/guardian/facia-scala-client.git","svn_url":"https://github.com/guardian/facia-scala-client","homepage":null,"size":2408,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"guardian:master","ref":"master","sha":"ec7e9943cd8634b2909e1fc0d8939c547ded5220","user":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"repo":{"id":20723151,"name":"facia-scala-client","full_name":"guardian/facia-scala-client","owner":{"login":"guardian","id":164318,"avatar_url":"https://avatars.githubusercontent.com/u/164318?v=3","gravatar_id":"","url":"https://api.github.com/users/guardian","html_url":"https://github.com/guardian","followers_url":"https://api.github.com/users/guardian/followers","following_url":"https://api.github.com/users/guardian/following{/other_user}","gists_url":"https://api.github.com/users/guardian/gists{/gist_id}","starred_url":"https://api.github.com/users/guardian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guardian/subscriptions","organizations_url":"https://api.github.com/users/guardian/orgs","repos_url":"https://api.github.com/users/guardian/repos","events_url":"https://api.github.com/users/guardian/events{/privacy}","received_events_url":"https://api.github.com/users/guardian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/guardian/facia-scala-client","description":"Low level client for the Facia JSON API","fork":false,"url":"https://api.github.com/repos/guardian/facia-scala-client","forks_url":"https://api.github.com/repos/guardian/facia-scala-client/forks","keys_url":"https://api.github.com/repos/guardian/facia-scala-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guardian/facia-scala-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guardian/facia-scala-client/teams","hooks_url":"https://api.github.com/repos/guardian/facia-scala-client/hooks","issue_events_url":"https://api.github.com/repos/guardian/facia-scala-client/issues/events{/number}","events_url":"https://api.github.com/repos/guardian/facia-scala-client/events","assignees_url":"https://api.github.com/repos/guardian/facia-scala-client/assignees{/user}","branches_url":"https://api.github.com/repos/guardian/facia-scala-client/branches{/branch}","tags_url":"https://api.github.com/repos/guardian/facia-scala-client/tags","blobs_url":"https://api.github.com/repos/guardian/facia-scala-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guardian/facia-scala-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guardian/facia-scala-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/guardian/facia-scala-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guardian/facia-scala-client/statuses/{sha}","languages_url":"https://api.github.com/repos/guardian/facia-scala-client/languages","stargazers_url":"https://api.github.com/repos/guardian/facia-scala-client/stargazers","contributors_url":"https://api.github.com/repos/guardian/facia-scala-client/contributors","subscribers_url":"https://api.github.com/repos/guardian/facia-scala-client/subscribers","subscription_url":"https://api.github.com/repos/guardian/facia-scala-client/subscription","commits_url":"https://api.github.com/repos/guardian/facia-scala-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/guardian/facia-scala-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/guardian/facia-scala-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/guardian/facia-scala-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/guardian/facia-scala-client/contents/{+path}","compare_url":"https://api.github.com/repos/guardian/facia-scala-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guardian/facia-scala-client/merges","archive_url":"https://api.github.com/repos/guardian/facia-scala-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guardian/facia-scala-client/downloads","issues_url":"https://api.github.com/repos/guardian/facia-scala-client/issues{/number}","pulls_url":"https://api.github.com/repos/guardian/facia-scala-client/pulls{/number}","milestones_url":"https://api.github.com/repos/guardian/facia-scala-client/milestones{/number}","notifications_url":"https://api.github.com/repos/guardian/facia-scala-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guardian/facia-scala-client/labels{/name}","releases_url":"https://api.github.com/repos/guardian/facia-scala-client/releases{/id}","created_at":"2014-06-11T11:45:55Z","updated_at":"2015-04-15T10:44:54Z","pushed_at":"2015-04-22T13:35:33Z","git_url":"git://github.com/guardian/facia-scala-client.git","ssh_url":"git@github.com:guardian/facia-scala-client.git","clone_url":"https://github.com/guardian/facia-scala-client.git","svn_url":"https://github.com/guardian/facia-scala-client","homepage":null,"size":2408,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/guardian/facia-scala-client/pulls/94"},"html":{"href":"https://github.com/guardian/facia-scala-client/pull/94"},"issue":{"href":"https://api.github.com/repos/guardian/facia-scala-client/issues/94"},"comments":{"href":"https://api.github.com/repos/guardian/facia-scala-client/issues/94/comments"},"review_comments":{"href":"https://api.github.com/repos/guardian/facia-scala-client/pulls/94/comments"},"review_comment":{"href":"https://api.github.com/repos/guardian/facia-scala-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/guardian/facia-scala-client/pulls/94/commits"},"statuses":{"href":"https://api.github.com/repos/guardian/facia-scala-client/statuses/71a3c897559b86b2f5e7de3fddf42c44406a32b7"}}}}