{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/48512466","id":48512466,"diff_hunk":"@@ -0,0 +1,375 @@\n+/**\n+ * Copyright 2015 The AMP HTML Authors. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *      http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS-IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+import {Layout} from '../../../src/layout';\n+import {assertHttpsUrl} from '../../../src/url';\n+import {assert} from '../../../src/asserts';\n+import {cidFor} from '../../../src/cid';\n+import {getService} from '../../../src/service';\n+import {isExperimentOn} from '../../../src/experiments';\n+import {onDocumentReady} from '../../../src/document-state';\n+import {viewerFor} from '../../../src/viewer';\n+import {xhrFor} from '../../../src/xhr';\n+\n+\n+/** @const */\n+const EXPERIMENT = 'mustache';\n+\n+/** @const */\n+const TAG = 'AmpUserNotification';\n+\n+/**\n+ * @export\n+ * @typedef {{\n+ *   elementId: string,\n+ *   ampUserId: string\n+ * }}\n+ */\n+let PostRequestMetadataDef;\n+\n+/**\n+ * @export\n+ * @typedef {{\n+ *   showNotification: boolean\n+ * }}\n+ */\n+let PostResponseMetadataDef;\n+\n+/**\n+ * @typedef {{\n+ *   promise: !Promise,\n+ *   resolve: function(*)\n+ * }}\n+ */\n+let UserNotificationDeferDef;\n+\n+\n+/**\n+ * Defines underlying API for Notification components.\n+ * @interface\n+ */\n+class NotificationInterface {\n+\n+  /**\n+   * Promise that is resolved with a boolean on whether this Notification\n+   * should be shown or not.\n+   * @return {!Promise<boolean>}\n+   */\n+  shouldShow() {}\n+\n+  /**\n+   * Turns the Notification Component visible.\n+   * @return {!Promise}\n+   */\n+  show() {}\n+}\n+\n+/**\n+ * Component class that handles a simple notification.\n+ * @implements {NotificationInterface}\n+ */\n+export class AmpUserNotification extends AMP.BaseElement {\n+\n+  /**\n+   * @private\n+   */\n+  isExperimentOn_() {\n+    return isExperimentOn(this.win_, EXPERIMENT);\n+  }\n+\n+  /** @override */\n+  buildCallback() {\n+\n+    /** @private @const {!Window} */\n+    this.win_ = this.getWin();\n+\n+    /** @private @const {!UserNotificationManager} */\n+    this.userNotificationManager_ = getUserNotificationManager_(this.win_);\n+\n+    this.elementId_ = assert(this.element.id, 'amp-user-notification should ' +\n+        'have an id.');\n+\n+    /** @private {?string} */\n+    this.ampUserId_ = null;\n+\n+    assert(this.element.hasAttribute('data-show-if-href'),\n+        `\"amp-user-notification\" (${this.elementId_}) ` +\n+        'should have \"data-show-if-href\" attribute.');\n+    /** @private @const {string} */\n+    this.showIfHref_ = assertHttpsUrl(\n+        this.element.getAttribute('data-show-if-href'), this.element);\n+\n+    assert(this.element.hasAttribute('data-dismiss-href'),\n+        `\"amp-user-notification\" (${this.elementId_}) ` +\n+        'should have \"data-dismiss-href\" attribute.');\n+    /** @private @const {string} */\n+    this.dismissHref_ = assertHttpsUrl(\n+        this.element.getAttribute('data-dismiss-href'), this.element);\n+\n+    /** @private {?function(boolean)} */\n+    this.dialogResolve_ = null;\n+\n+    /** @private {?Promise} */\n+    this.dialogPromise_ = null;\n+\n+    if (this.isExperimentOn_()) {\n+      this.userNotificationManager_\n+          .registerUserNotification(this.elementId_, this);\n+\n+      this.registerAction('dismiss', this.dismiss.bind(this));\n+    }\n+  }\n+\n+  /**\n+   * Executes a `POST` request to the url given on the `data-show-if-href`\n+   * attribute.\n+   * @param {string} ampUserId\n+   * @return {!Promise<!PostResponseMetadataDef>}\n+   * @private\n+   */\n+  postShowEndpoint_(ampUserId) {\n+    // TODO(erwinm, https://github.com/ampproject/amphtml/issues/1228)\n+    // Determine wether this should be a POST with json body\n+    // or a GET with data on the query params.\n+    this.ampUserId_ = ampUserId;\n+    const getReq = {\n+      method: 'POST',\n+      credentials: 'include',\n+      /** @type {PostRequestMetadataDef} */\n+      body: {\n+        'elementId': this.elementId_,\n+        'ampUserId': ampUserId\n+      }\n+    };\n+\n+    return xhrFor(this.win_).fetchJson(this.showIfHref_, getReq);\n+  }\n+\n+  /**\n+   * Creates an POST to the specified `data-dismiss-href` url.\n+   * @private\n+   * @return {!Promise}\n+   */\n+  postDismissEnpoint_() {\n+    return xhrFor(this.win_).fetchJson(this.dismissHref_, {\n+      method: 'POST',\n+      credentials: 'include',\n+      body: {\n+        'elementId': this.elementId_,\n+        'ampUserId': this.ampUserId_\n+      }\n+    });\n+  }\n+\n+  /**\n+   * Success handler for `postShowEndpoint_`.\n+   * @param {!PostResponseMetadataDef}\n+   * @return {!Promise<boolean>}\n+   * @private\n+   */\n+  onPostShowEndpointSuccess_(data) {\n+    assert(typeof data['showNotification'] == 'boolean', '`showNotification` ' +\n+        'should be a boolean. Got \"%s\" which is of type %s.',\n+        data['showNotification'], typeof data['showNotification']);\n+\n+    if (!data['showNotification']) {\n+      // If no notification needs to be shown, resolve the `dialogPromise_`\n+      // right away with false.\n+      this.dialogResolve_();\n+    }\n+    return Promise.resolve(data['showNotification']);\n+  }\n+\n+  /**\n+   * Get async cid service.\n+   * @return {!Promise}\n+   * @private\n+   */\n+  getAsyncCid_() {\n+    this.dialogPromise_ = new Promise((resolve, reject) => {\n+      this.dialogResolve_ = resolve;\n+    });\n+    return cidFor(this.win_).then(cid => {\n+      // `amp-user-notification` is our cid scope, while we give it a resolved\n+      // promise for the 2nd argument so that the 3rd argument (the\n+      // persistentConsent) is the one used to resolve getting\n+      // the external CID.\n+      // The dialogPromise_ is never rejected,\n+      // the user only really has 1 option to accept/dismiss (to resolve)\n+      // the notification or have the nagging notification sitting there\n+      // (to never resolve).\n+      return cid.get('amp-user-notification',\n+          Promise.resolve(), this.dialogPromise_);\n+    });\n+  }\n+\n+  /** @override */\n+  shouldShow() {\n+    return this.getAsyncCid_()\n+        .then(this.postShowEndpoint_.bind(this))\n+        .then(this.onPostShowEndpointSuccess_.bind(this));\n+  }\n+\n+  /** @override */\n+  show() {\n+    this.element.style.display = '';\n+    this.element.classList.add('amp-active');\n+    return this.dialogPromise_;\n+  }\n+\n+  /**\n+   * Hides the current user notification and invokes the `dialogResolve_`\n+   * method. Removes the `.amp-active` class from the element.\n+   */\n+  dismiss() {\n+    this.element.classList.remove('amp-active');\n+    this.element.classList.add('amp-hidden');\n+    this.dialogResolve_();\n+    this.postDismissEnpoint_();\n+  }\n+}\n+\n+\n+/**\n+ * UserNotificationManager handles `amp-user-notification`\n+ * queuing and registration, as well as exposing the components\n+ * dismiss promise.\n+ */\n+export class UserNotificationManager {\n+\n+  constructor(window) {\n+    this.win_ = window;\n+\n+    /** @private @const {!Object<!UserNotificationDeferDef>} */\n+    this.deferRegistry_ = Object.create(null);\n+\n+    /** @private @const {!Viewer} */\n+    this.viewer_ = viewerFor(this.win_);\n+\n+    /** @private @const {?function(*)} */\n+    this.documentReadyResolve_ = null;\n+\n+    let documentReadyPromise_ = new Promise((resolve) => {\n+      this.documentReadyResolve_ = resolve;\n+    });\n+\n+    // TODO(erwinm, https://github.com/ampproject/amphtml/issues/1226)\n+    // Add `whenDocumentReady` function in document-state\n+    // that returns a promise.\n+    onDocumentReady(this.win_.document, this.documentReadyResolve_);\n+\n+    /** @private {!Promise} */\n+    this.nextInQueue_ = this.viewer_.whenVisible().then(() => {\n+      // we block on both viewer visible and when dom ready.\n+      return documentReadyPromise_;\n+    });\n+  }\n+\n+  /**\n+   * Retrieve a promise associated to an `amp-user-notification` component\n+   * that is resolved when user agrees to the terms.\n+   * @param {string} id\n+   * @return {!Promise<string>}\n+   */\n+  get(id) {\n+    return this.getElementDeferById_(id).promise;\n+  }\n+\n+  /**\n+   * Register an instance of `amp-user-notification`.\n+   * @param {string} id\n+   * @param {!UserNotification} userNotification\n+   * @package\n+   */\n+  registerUserNotification(id, userNotification) {\n+    const deferred = this.getElementDeferById_(id);\n+\n+    // Compose the registered notifications into a promise queue\n+    // that blocks until one notification is dismissed.\n+    this.nextInQueue_ = this.nextInQueue_\n+        .then(() => {\n+          if (this.win_.document.getElementById(id) != null) {","path":"extensions/amp-user-notification/0.1/amp-user-notification.js","position":null,"original_position":304,"commit_id":"26b0eb3cba4d83c306a81afbba9d36b5ba88d2a4","original_commit_id":"d11cf4a2b20d4c8a49c01d4eda1db1af51e40202","user":{"login":"dvoytenko","id":726049,"avatar_url":"https://avatars.githubusercontent.com/u/726049?v=3","gravatar_id":"","url":"https://api.github.com/users/dvoytenko","html_url":"https://github.com/dvoytenko","followers_url":"https://api.github.com/users/dvoytenko/followers","following_url":"https://api.github.com/users/dvoytenko/following{/other_user}","gists_url":"https://api.github.com/users/dvoytenko/gists{/gist_id}","starred_url":"https://api.github.com/users/dvoytenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dvoytenko/subscriptions","organizations_url":"https://api.github.com/users/dvoytenko/orgs","repos_url":"https://api.github.com/users/dvoytenko/repos","events_url":"https://api.github.com/users/dvoytenko/events{/privacy}","received_events_url":"https://api.github.com/users/dvoytenko/received_events","type":"User","site_admin":false},"body":"I think it's good, except for two things:\r\n\r\n1. It should be `== null` above. Right?\r\n2. Does it make sense to still try with `shouldShow`? I think we can just skip this instance and go straight to the next one. E.g. in this if we can return `Promise.reject` or something like that.","created_at":"2015-12-28T23:17:05Z","updated_at":"2015-12-28T23:17:05Z","html_url":"https://github.com/ampproject/amphtml/pull/1178#discussion_r48512466","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/1178","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/48512466"},"html":{"href":"https://github.com/ampproject/amphtml/pull/1178#discussion_r48512466"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1178"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/1178","id":53926257,"html_url":"https://github.com/ampproject/amphtml/pull/1178","diff_url":"https://github.com/ampproject/amphtml/pull/1178.diff","patch_url":"https://github.com/ampproject/amphtml/pull/1178.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/1178","number":1178,"state":"open","locked":false,"title":"feature(amp-user-notification): add amp-user-notification element.","user":{"login":"erwinmombay","id":354746,"avatar_url":"https://avatars.githubusercontent.com/u/354746?v=3","gravatar_id":"","url":"https://api.github.com/users/erwinmombay","html_url":"https://github.com/erwinmombay","followers_url":"https://api.github.com/users/erwinmombay/followers","following_url":"https://api.github.com/users/erwinmombay/following{/other_user}","gists_url":"https://api.github.com/users/erwinmombay/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinmombay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinmombay/subscriptions","organizations_url":"https://api.github.com/users/erwinmombay/orgs","repos_url":"https://api.github.com/users/erwinmombay/repos","events_url":"https://api.github.com/users/erwinmombay/events{/privacy}","received_events_url":"https://api.github.com/users/erwinmombay/received_events","type":"User","site_admin":false},"body":"Closes https://github.com/ampproject/amphtml/issues/902\r\n\r\ncouple of tasks i need to complete, writing down just so i dont forget.\r\n\r\n- [ ] add tag to validator\r\n- [ ] create nicer demo with transition to the next notification\r\n- [ ] finish style section\r\n- [x] document the notification queuing","created_at":"2015-12-17T02:10:13Z","updated_at":"2015-12-28T23:17:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9314726336564ff221c36fe21c316ceb874b9245","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/1178/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/1178/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/1178/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/26b0eb3cba4d83c306a81afbba9d36b5ba88d2a4","head":{"label":"erwinmombay:amp-notify","ref":"amp-notify","sha":"26b0eb3cba4d83c306a81afbba9d36b5ba88d2a4","user":{"login":"erwinmombay","id":354746,"avatar_url":"https://avatars.githubusercontent.com/u/354746?v=3","gravatar_id":"","url":"https://api.github.com/users/erwinmombay","html_url":"https://github.com/erwinmombay","followers_url":"https://api.github.com/users/erwinmombay/followers","following_url":"https://api.github.com/users/erwinmombay/following{/other_user}","gists_url":"https://api.github.com/users/erwinmombay/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinmombay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinmombay/subscriptions","organizations_url":"https://api.github.com/users/erwinmombay/orgs","repos_url":"https://api.github.com/users/erwinmombay/repos","events_url":"https://api.github.com/users/erwinmombay/events{/privacy}","received_events_url":"https://api.github.com/users/erwinmombay/received_events","type":"User","site_admin":false},"repo":{"id":43843790,"name":"amphtml","full_name":"erwinmombay/amphtml","owner":{"login":"erwinmombay","id":354746,"avatar_url":"https://avatars.githubusercontent.com/u/354746?v=3","gravatar_id":"","url":"https://api.github.com/users/erwinmombay","html_url":"https://github.com/erwinmombay","followers_url":"https://api.github.com/users/erwinmombay/followers","following_url":"https://api.github.com/users/erwinmombay/following{/other_user}","gists_url":"https://api.github.com/users/erwinmombay/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinmombay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinmombay/subscriptions","organizations_url":"https://api.github.com/users/erwinmombay/orgs","repos_url":"https://api.github.com/users/erwinmombay/repos","events_url":"https://api.github.com/users/erwinmombay/events{/privacy}","received_events_url":"https://api.github.com/users/erwinmombay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/erwinmombay/amphtml","description":"","fork":true,"url":"https://api.github.com/repos/erwinmombay/amphtml","forks_url":"https://api.github.com/repos/erwinmombay/amphtml/forks","keys_url":"https://api.github.com/repos/erwinmombay/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erwinmombay/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erwinmombay/amphtml/teams","hooks_url":"https://api.github.com/repos/erwinmombay/amphtml/hooks","issue_events_url":"https://api.github.com/repos/erwinmombay/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/erwinmombay/amphtml/events","assignees_url":"https://api.github.com/repos/erwinmombay/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/erwinmombay/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/erwinmombay/amphtml/tags","blobs_url":"https://api.github.com/repos/erwinmombay/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erwinmombay/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erwinmombay/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/erwinmombay/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erwinmombay/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/erwinmombay/amphtml/languages","stargazers_url":"https://api.github.com/repos/erwinmombay/amphtml/stargazers","contributors_url":"https://api.github.com/repos/erwinmombay/amphtml/contributors","subscribers_url":"https://api.github.com/repos/erwinmombay/amphtml/subscribers","subscription_url":"https://api.github.com/repos/erwinmombay/amphtml/subscription","commits_url":"https://api.github.com/repos/erwinmombay/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/erwinmombay/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/erwinmombay/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/erwinmombay/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/erwinmombay/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/erwinmombay/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erwinmombay/amphtml/merges","archive_url":"https://api.github.com/repos/erwinmombay/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erwinmombay/amphtml/downloads","issues_url":"https://api.github.com/repos/erwinmombay/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/erwinmombay/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/erwinmombay/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/erwinmombay/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erwinmombay/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/erwinmombay/amphtml/releases{/id}","created_at":"2015-10-07T20:45:56Z","updated_at":"2015-10-07T20:45:57Z","pushed_at":"2015-12-28T23:17:00Z","git_url":"git://github.com/erwinmombay/amphtml.git","ssh_url":"git@github.com:erwinmombay/amphtml.git","clone_url":"https://github.com/erwinmombay/amphtml.git","svn_url":"https://github.com/erwinmombay/amphtml","homepage":"","size":19934,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ampproject:master","ref":"master","sha":"b6222364a00dcc3b588864234e398e53a114ef7b","user":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","created_at":"2015-09-01T22:10:53Z","updated_at":"2015-12-28T21:32:03Z","pushed_at":"2015-12-28T23:17:01Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://ampproject.org","size":21800,"stargazers_count":5136,"watchers_count":5136,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":500,"mirror_url":null,"open_issues_count":191,"forks":500,"open_issues":191,"watchers":5136,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1178"},"html":{"href":"https://github.com/ampproject/amphtml/pull/1178"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/1178"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/1178/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1178/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1178/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/26b0eb3cba4d83c306a81afbba9d36b5ba88d2a4"}}}}