{"action":"created","comment":{"url":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/comments/240392638","pull_request_review_id":183414270,"id":240392638,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MDM5MjYzOA==","diff_hunk":"@@ -0,0 +1,84 @@\n+defmodule Stripe.SubscriptionItem.Usage do\n+  @moduledoc \"\"\"\n+  Work with Stripe usage record objects.\n+\n+  Stripe API reference: https://stripe.com/docs/api/usage_records\n+  \"\"\"\n+\n+  use Stripe.Entity\n+  import Stripe.Request\n+\n+  @type t :: %__MODULE__{\n+          id: Stripe.id(),\n+          object: String.t(),\n+          livemode: boolean,\n+          quantity: non_neg_integer,\n+          subscription_item: Stripe.id() | Stripe.SubscriptionItem.t() | nil,\n+          timestamp: Stripe.timestamp() | nil\n+        }\n+\n+  defstruct [\n+    :id,\n+    :object,\n+    :livemode,\n+    :quantity,\n+    :subscription_item,\n+    :timestamp\n+  ]\n+\n+  @plural_endpoint \"subscription_items\"\n+\n+  @doc \"\"\"\n+  Creates a usage record for a specified subscription item and date, and fills it with a quantity.\n+  \"\"\"\n+  @spec create(params, Stripe.options()) :: {:ok, t} | {:error, Stripe.Error.t()}\n+        when params: %{\n+                :quantity => float,\n+                :subscription_item => Stripe.id() | Stripe.SubscriptionItem.t(),\n+                :timestamp => Stripe.timestamp() | non_neg_integer,\n+                optional(:action) => String.t()\n+             } \n+  def create(params, opts \\\\ []) do\n+    url = \n+    params \n+    |> Map.pop(:subscription_item)\n+    |> build_url\n+\n+    new_request(opts)\n+    |> put_endpoint(url)\n+    |> put_method(:post)\n+    |> put_params(params)\n+    |> make_request()\n+  end\n+\n+  @doc \"\"\"\n+  List all subscription item period summaries\n+  \"\"\"\n+  @spec list(params, Stripe.options) :: {:ok, Stripe.List.t(t)} | {:error, Stripe.Error.t()}\n+        when params: %{\n+          :subscription_item => Stripe.id() | Stripe.SubscriptionItem.t(),\n+          optional(:ending_before) => t | Stripe.id(),\n+          optional(:limit) => 1..100,\n+          optional(:starting_after) => t | Stripe.id()\n+        } \n+  def list(params, opts \\\\ []) do\n+    url = \n+    params \n+    |> Map.pop(:subscription_item)","path":"lib/stripe/subscriptions/usage.ex","position":67,"original_position":67,"commit_id":"f4c69e59bef32988058870e71f2d56b720b6ba3f","original_commit_id":"f4c69e59bef32988058870e71f2d56b720b6ba3f","user":{"login":"wess","id":176163,"node_id":"MDQ6VXNlcjE3NjE2Mw==","avatar_url":"https://avatars2.githubusercontent.com/u/176163?v=4","gravatar_id":"","url":"https://api.github.com/users/wess","html_url":"https://github.com/wess","followers_url":"https://api.github.com/users/wess/followers","following_url":"https://api.github.com/users/wess/following{/other_user}","gists_url":"https://api.github.com/users/wess/gists{/gist_id}","starred_url":"https://api.github.com/users/wess/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wess/subscriptions","organizations_url":"https://api.github.com/users/wess/orgs","repos_url":"https://api.github.com/users/wess/repos","events_url":"https://api.github.com/users/wess/events{/privacy}","received_events_url":"https://api.github.com/users/wess/received_events","type":"User","site_admin":false},"body":"Also going to update the create for this as well","created_at":"2018-12-10T21:46:30Z","updated_at":"2018-12-10T21:46:31Z","html_url":"https://github.com/code-corps/stripity_stripe/pull/433#discussion_r240392638","pull_request_url":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/433","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/comments/240392638"},"html":{"href":"https://github.com/code-corps/stripity_stripe/pull/433#discussion_r240392638"},"pull_request":{"href":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/433"}},"in_reply_to_id":239584186},"pull_request":{"url":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/433","id":236635351,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2NjM1MzUx","html_url":"https://github.com/code-corps/stripity_stripe/pull/433","diff_url":"https://github.com/code-corps/stripity_stripe/pull/433.diff","patch_url":"https://github.com/code-corps/stripity_stripe/pull/433.patch","issue_url":"https://api.github.com/repos/code-corps/stripity_stripe/issues/433","number":433,"state":"open","locked":false,"title":"Typo for retrieving invoice items + Adds handler for Usage endpoint","user":{"login":"eecaro","id":29066020,"node_id":"MDQ6VXNlcjI5MDY2MDIw","avatar_url":"https://avatars0.githubusercontent.com/u/29066020?v=4","gravatar_id":"","url":"https://api.github.com/users/eecaro","html_url":"https://github.com/eecaro","followers_url":"https://api.github.com/users/eecaro/followers","following_url":"https://api.github.com/users/eecaro/following{/other_user}","gists_url":"https://api.github.com/users/eecaro/gists{/gist_id}","starred_url":"https://api.github.com/users/eecaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eecaro/subscriptions","organizations_url":"https://api.github.com/users/eecaro/orgs","repos_url":"https://api.github.com/users/eecaro/repos","events_url":"https://api.github.com/users/eecaro/events{/privacy}","received_events_url":"https://api.github.com/users/eecaro/received_events","type":"User","site_admin":false},"body":"https://stripe.com/docs/api/usage_records\r\nhttps://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.yaml","created_at":"2018-12-06T18:55:08Z","updated_at":"2018-12-10T21:46:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a84583e34917d3ff80b3466f2db6c7e74bed37cf","assignee":{"login":"eecaro","id":29066020,"node_id":"MDQ6VXNlcjI5MDY2MDIw","avatar_url":"https://avatars0.githubusercontent.com/u/29066020?v=4","gravatar_id":"","url":"https://api.github.com/users/eecaro","html_url":"https://github.com/eecaro","followers_url":"https://api.github.com/users/eecaro/followers","following_url":"https://api.github.com/users/eecaro/following{/other_user}","gists_url":"https://api.github.com/users/eecaro/gists{/gist_id}","starred_url":"https://api.github.com/users/eecaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eecaro/subscriptions","organizations_url":"https://api.github.com/users/eecaro/orgs","repos_url":"https://api.github.com/users/eecaro/repos","events_url":"https://api.github.com/users/eecaro/events{/privacy}","received_events_url":"https://api.github.com/users/eecaro/received_events","type":"User","site_admin":false},"assignees":[{"login":"eecaro","id":29066020,"node_id":"MDQ6VXNlcjI5MDY2MDIw","avatar_url":"https://avatars0.githubusercontent.com/u/29066020?v=4","gravatar_id":"","url":"https://api.github.com/users/eecaro","html_url":"https://github.com/eecaro","followers_url":"https://api.github.com/users/eecaro/followers","following_url":"https://api.github.com/users/eecaro/following{/other_user}","gists_url":"https://api.github.com/users/eecaro/gists{/gist_id}","starred_url":"https://api.github.com/users/eecaro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eecaro/subscriptions","organizations_url":"https://api.github.com/users/eecaro/orgs","repos_url":"https://api.github.com/users/eecaro/repos","events_url":"https://api.github.com/users/eecaro/events{/privacy}","received_events_url":"https://api.github.com/users/eecaro/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":486085358,"node_id":"MDU6TGFiZWw0ODYwODUzNTg=","url":"https://api.github.com/repos/code-corps/stripity_stripe/labels/2.0","name":"2.0","color":"c5def5","default":false},{"id":268202776,"node_id":"MDU6TGFiZWwyNjgyMDI3NzY=","url":"https://api.github.com/repos/code-corps/stripity_stripe/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"milestone":null,"commits_url":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/433/commits","review_comments_url":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/433/comments","review_comment_url":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-corps/stripity_stripe/issues/433/comments","statuses_url":"https://api.github.com/repos/code-corps/stripity_stripe/statuses/f4c69e59bef32988058870e71f2d56b720b6ba3f","head":{"label":"MetisMachine:webhooks","ref":"webhooks","sha":"f4c69e59bef32988058870e71f2d56b720b6ba3f","user":{"login":"MetisMachine","id":24527907,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NTI3OTA3","avatar_url":"https://avatars1.githubusercontent.com/u/24527907?v=4","gravatar_id":"","url":"https://api.github.com/users/MetisMachine","html_url":"https://github.com/MetisMachine","followers_url":"https://api.github.com/users/MetisMachine/followers","following_url":"https://api.github.com/users/MetisMachine/following{/other_user}","gists_url":"https://api.github.com/users/MetisMachine/gists{/gist_id}","starred_url":"https://api.github.com/users/MetisMachine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MetisMachine/subscriptions","organizations_url":"https://api.github.com/users/MetisMachine/orgs","repos_url":"https://api.github.com/users/MetisMachine/repos","events_url":"https://api.github.com/users/MetisMachine/events{/privacy}","received_events_url":"https://api.github.com/users/MetisMachine/received_events","type":"Organization","site_admin":false},"repo":{"id":160404486,"node_id":"MDEwOlJlcG9zaXRvcnkxNjA0MDQ0ODY=","name":"stripity_stripe","full_name":"MetisMachine/stripity_stripe","private":false,"owner":{"login":"MetisMachine","id":24527907,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI0NTI3OTA3","avatar_url":"https://avatars1.githubusercontent.com/u/24527907?v=4","gravatar_id":"","url":"https://api.github.com/users/MetisMachine","html_url":"https://github.com/MetisMachine","followers_url":"https://api.github.com/users/MetisMachine/followers","following_url":"https://api.github.com/users/MetisMachine/following{/other_user}","gists_url":"https://api.github.com/users/MetisMachine/gists{/gist_id}","starred_url":"https://api.github.com/users/MetisMachine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MetisMachine/subscriptions","organizations_url":"https://api.github.com/users/MetisMachine/orgs","repos_url":"https://api.github.com/users/MetisMachine/repos","events_url":"https://api.github.com/users/MetisMachine/events{/privacy}","received_events_url":"https://api.github.com/users/MetisMachine/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/MetisMachine/stripity_stripe","description":"An Elixir Library for Stripe","fork":true,"url":"https://api.github.com/repos/MetisMachine/stripity_stripe","forks_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/forks","keys_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/teams","hooks_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/hooks","issue_events_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/issues/events{/number}","events_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/events","assignees_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/assignees{/user}","branches_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/branches{/branch}","tags_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/tags","blobs_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/git/refs{/sha}","trees_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/statuses/{sha}","languages_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/languages","stargazers_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/stargazers","contributors_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/contributors","subscribers_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/subscribers","subscription_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/subscription","commits_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/commits{/sha}","git_commits_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/git/commits{/sha}","comments_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/comments{/number}","issue_comment_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/issues/comments{/number}","contents_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/contents/{+path}","compare_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/merges","archive_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/downloads","issues_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/issues{/number}","pulls_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/pulls{/number}","milestones_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/milestones{/number}","notifications_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/labels{/name}","releases_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/releases{/id}","deployments_url":"https://api.github.com/repos/MetisMachine/stripity_stripe/deployments","created_at":"2018-12-04T18:54:40Z","updated_at":"2018-12-04T22:25:35Z","pushed_at":"2018-12-06T18:49:32Z","git_url":"git://github.com/MetisMachine/stripity_stripe.git","ssh_url":"git@github.com:MetisMachine/stripity_stripe.git","clone_url":"https://github.com/MetisMachine/stripity_stripe.git","svn_url":"https://github.com/MetisMachine/stripity_stripe","homepage":null,"size":948,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"code-corps:master","ref":"master","sha":"8dd64413b061a9ffabd5c98801d9217825609493","user":{"login":"code-corps","id":12991115,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTkxMTE1","avatar_url":"https://avatars0.githubusercontent.com/u/12991115?v=4","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"repo":{"id":43581088,"node_id":"MDEwOlJlcG9zaXRvcnk0MzU4MTA4OA==","name":"stripity_stripe","full_name":"code-corps/stripity_stripe","private":false,"owner":{"login":"code-corps","id":12991115,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyOTkxMTE1","avatar_url":"https://avatars0.githubusercontent.com/u/12991115?v=4","gravatar_id":"","url":"https://api.github.com/users/code-corps","html_url":"https://github.com/code-corps","followers_url":"https://api.github.com/users/code-corps/followers","following_url":"https://api.github.com/users/code-corps/following{/other_user}","gists_url":"https://api.github.com/users/code-corps/gists{/gist_id}","starred_url":"https://api.github.com/users/code-corps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-corps/subscriptions","organizations_url":"https://api.github.com/users/code-corps/orgs","repos_url":"https://api.github.com/users/code-corps/repos","events_url":"https://api.github.com/users/code-corps/events{/privacy}","received_events_url":"https://api.github.com/users/code-corps/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/code-corps/stripity_stripe","description":"An Elixir Library for Stripe","fork":false,"url":"https://api.github.com/repos/code-corps/stripity_stripe","forks_url":"https://api.github.com/repos/code-corps/stripity_stripe/forks","keys_url":"https://api.github.com/repos/code-corps/stripity_stripe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-corps/stripity_stripe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-corps/stripity_stripe/teams","hooks_url":"https://api.github.com/repos/code-corps/stripity_stripe/hooks","issue_events_url":"https://api.github.com/repos/code-corps/stripity_stripe/issues/events{/number}","events_url":"https://api.github.com/repos/code-corps/stripity_stripe/events","assignees_url":"https://api.github.com/repos/code-corps/stripity_stripe/assignees{/user}","branches_url":"https://api.github.com/repos/code-corps/stripity_stripe/branches{/branch}","tags_url":"https://api.github.com/repos/code-corps/stripity_stripe/tags","blobs_url":"https://api.github.com/repos/code-corps/stripity_stripe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-corps/stripity_stripe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-corps/stripity_stripe/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-corps/stripity_stripe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-corps/stripity_stripe/statuses/{sha}","languages_url":"https://api.github.com/repos/code-corps/stripity_stripe/languages","stargazers_url":"https://api.github.com/repos/code-corps/stripity_stripe/stargazers","contributors_url":"https://api.github.com/repos/code-corps/stripity_stripe/contributors","subscribers_url":"https://api.github.com/repos/code-corps/stripity_stripe/subscribers","subscription_url":"https://api.github.com/repos/code-corps/stripity_stripe/subscription","commits_url":"https://api.github.com/repos/code-corps/stripity_stripe/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-corps/stripity_stripe/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-corps/stripity_stripe/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-corps/stripity_stripe/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-corps/stripity_stripe/contents/{+path}","compare_url":"https://api.github.com/repos/code-corps/stripity_stripe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-corps/stripity_stripe/merges","archive_url":"https://api.github.com/repos/code-corps/stripity_stripe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-corps/stripity_stripe/downloads","issues_url":"https://api.github.com/repos/code-corps/stripity_stripe/issues{/number}","pulls_url":"https://api.github.com/repos/code-corps/stripity_stripe/pulls{/number}","milestones_url":"https://api.github.com/repos/code-corps/stripity_stripe/milestones{/number}","notifications_url":"https://api.github.com/repos/code-corps/stripity_stripe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-corps/stripity_stripe/labels{/name}","releases_url":"https://api.github.com/repos/code-corps/stripity_stripe/releases{/id}","deployments_url":"https://api.github.com/repos/code-corps/stripity_stripe/deployments","created_at":"2015-10-02T23:32:01Z","updated_at":"2018-12-09T03:52:26Z","pushed_at":"2018-12-07T19:21:59Z","git_url":"git://github.com/code-corps/stripity_stripe.git","ssh_url":"git@github.com:code-corps/stripity_stripe.git","clone_url":"https://github.com/code-corps/stripity_stripe.git","svn_url":"https://github.com/code-corps/stripity_stripe","homepage":null,"size":953,"stargazers_count":371,"watchers_count":371,"language":"Elixir","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":123,"mirror_url":null,"archived":false,"open_issues_count":43,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":123,"open_issues":43,"watchers":371,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/433"},"html":{"href":"https://github.com/code-corps/stripity_stripe/pull/433"},"issue":{"href":"https://api.github.com/repos/code-corps/stripity_stripe/issues/433"},"comments":{"href":"https://api.github.com/repos/code-corps/stripity_stripe/issues/433/comments"},"review_comments":{"href":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/433/comments"},"review_comment":{"href":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-corps/stripity_stripe/pulls/433/commits"},"statuses":{"href":"https://api.github.com/repos/code-corps/stripity_stripe/statuses/f4c69e59bef32988058870e71f2d56b720b6ba3f"}},"author_association":"NONE"}}
{"actor":{"display_login":"wess"}}