{"action":"created","comment":{"url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/comments/59810825","id":59810825,"diff_hunk":"@@ -0,0 +1,208 @@\n+# Copyright 2015-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\"). You may not\n+# use this file except in compliance with the License. A copy of the License is\n+# located at\n+#\n+#     http://aws.amazon.com/apache2.0/\n+#\n+# or in the \"license\" file accompanying this file. This file is distributed on\n+# an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n+# or implied. See the License for the specific language governing permissions\n+# and limitations under the License.\n+\n+module Aws\n+  module Record\n+    class BatchWriter < Batch\n+      include Enumerable\n+\n+      # Writer states\n+      PENDING_STATE = 'PENDING'.freeze\n+      SUCCESSFUL_SEND_STATE = 'SUCCESSFUL'.freeze\n+      ERROR_SEND_STATE = 'ERROR'.freeze\n+\n+      # DynamoDb item request limit\n+      ITEM_REQUEST_LIMIT = 25\n+\n+      # Read the state of the BatchWriter\n+      attr_reader :state\n+\n+      def initialize(model, client, items = [])\n+        super(model, client, items)\n+        @state = PENDING_STATE\n+        @errors = []\n+      end\n+\n+      # This method calls\n+      # {http://docs.aws.amazon.com/sdkforruby/api/Aws/DynamoDB/Client.html#batch_write_item-instance_method Aws::DynamoDB::Client#batch_write_item}},\n+      # on the items stored in this BatchWriter. Note that this method does\n+      # not support delete_request, only put_request and that only items\n+      # of the same class can be written using this method. The following\n+      # failure scenarios are prevented before being sent to DynamoDB:\n+      #\n+      #   - One or more tables specified in the BatchWriteItem request does not\n+      #      exist.\n+      #   - You try to perform multiple operations on the same item in the same\n+      #      BatchWriteItem request. For example, you cannot put and delete the\n+      #      same item in the same BatchWriteItem request.\n+      #   - There are more than 25 requests in the batch.\n+      #   - Primary key attributes specified on an item in the request do not\n+      #      match those in the corresponding table's primary key schema.\n+      #\n+      # This method will not prevent the following failure scenarios and will\n+      # need to be handled separately:\n+      #\n+      #   - Any individual item in a batch exceeds 400 KB.\n+      #   - The total request size exceeds 16 MB.\n+      #\n+      # If any items are not successfully submitted, a RuntimeError is raised\n+      # and the BatchWriter can be inspected to see what the errors were.\n+      # A call to #errors will return an array of response objects that contain\n+      # the errors. See the documentation for Response at\n+      # http://docs.aws.amazon.com/sdkforruby/api/Seahorse/Client/Response.html\n+      #\n+      # @param [Hash] opts options to pass on to the client call to\n+      #   +#batch_item_write+. See the documentation above in the AWS SDK for\n+      #   Ruby V2.\n+      # @opts retry_count the number of retries to attempt on failed write\n+      # @raise RuntimeError if unsuccessful in submitting all items\n+      def save!(opts = {})\n+        raise \"can't submit if writer in #{@state} state.\" unless pending?\n+        validate_items\n+        retry_items = send_chunks(opts)\n+        responses = retry_failed_requests(retry_items, opts)\n+        analyze_result(responses)\n+      rescue RuntimeError => e\n+        capture_validation_error(e)\n+        raise e\n+      end\n+\n+      # Perform the save! function but capture the error that is raised on\n+      # unsuccessful save.\n+      def save(opts = {})\n+        save!(opts)\n+        true\n+      rescue RuntimeError\n+        false\n+      end\n+\n+      def error?\n+        @state == ERROR_SEND_STATE\n+      end\n+\n+      # Get a hash of the responses that didn't work along with their\n+      # unprocessed items. Mimics ActiveRecord design.\n+      def errors\n+        @errors.map do |err|\n+          {\n+            error: err.error,\n+            data: err.data,\n+            unprocesssed_items: err.unprocessed_items\n+          }\n+        end\n+      end\n+\n+      def pending?\n+        @state == PENDING_STATE\n+      end\n+\n+      def unprocessed_items\n+        @errors.map(&:unprocessed_items)\n+      end\n+\n+      def valid?\n+        @state == SUCCESSFUL_SEND_STATE\n+      end\n+\n+      private\n+      def alert_errors(responses)\n+        @errors += responses.reject(&:successful?)\n+        @state = ERROR_SEND_STATE\n+        raise Errors::SubmissionError\n+      end\n+\n+      def analyze_result(responses)\n+        alert_errors(responses) if failures?(responses)\n+        @state = SUCCESSFUL_SEND_STATE\n+      end\n+\n+      def batch_write(item_requests_array, opts)\n+        @client.batch_write_item(\n+          formatted_request(item_requests_array, opts)\n+        )\n+      end\n+\n+      def batch_write_items(item_requests_array, opts)\n+        response = batch_write(item_requests_array, opts)\n+        if response.successful?\n+          response.unprocessed_items[@model.table_name] || []\n+        else\n+          item_requests_array\n+        end\n+      end\n+\n+      def capture_validation_error(e)\n+        @state = ERROR_SEND_STATE\n+        error = Struct.new(:error, :data, :unprocessed_items)\n+        @errors << error.new(e.class, e, @items)\n+      end\n+\n+      def failures?(responses)\n+        responses.any? do |response|\n+          !response.successful? || response.unprocessed_items.empty?\n+        end\n+      end\n+\n+      def formatted_request(item_requests_array, opts)\n+        {\n+          request_items: {\n+            @model.table_name => item_requests_array\n+          }\n+        }.merge(opts)\n+      end\n+\n+      def request_item(item)\n+        {\n+          put_request: {\n+            item: item.build_item_for_save\n+          }\n+        }\n+      end\n+\n+      def retry_failed_requests(item_requests_array, opts)\n+        responses = []\n+        item_requests_array.each_slice(ITEM_REQUEST_LIMIT) do |items|\n+          responses << retry_chunk(items, opts)\n+        end\n+        responses\n+      end\n+\n+      def retry_chunk(item_requests_array, opts)\n+        response = nil\n+        (0..4).each do |i|\n+          sleep i**2","path":"lib/aws-record/record/batch_writer.rb","position":183,"original_position":183,"commit_id":"3b4619bf24b71f93ac130d6b0c29bc29d11314cd","original_commit_id":"3b4619bf24b71f93ac130d6b0c29bc29d11314cd","user":{"login":"DarqueBox","id":6520233,"avatar_url":"https://avatars.githubusercontent.com/u/6520233?v=3","gravatar_id":"","url":"https://api.github.com/users/DarqueBox","html_url":"https://github.com/DarqueBox","followers_url":"https://api.github.com/users/DarqueBox/followers","following_url":"https://api.github.com/users/DarqueBox/following{/other_user}","gists_url":"https://api.github.com/users/DarqueBox/gists{/gist_id}","starred_url":"https://api.github.com/users/DarqueBox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DarqueBox/subscriptions","organizations_url":"https://api.github.com/users/DarqueBox/orgs","repos_url":"https://api.github.com/users/DarqueBox/repos","events_url":"https://api.github.com/users/DarqueBox/events{/privacy}","received_events_url":"https://api.github.com/users/DarqueBox/received_events","type":"User","site_admin":false},"body":"Maybe sleep in after trying all of the failed requests?","created_at":"2016-04-14T23:57:17Z","updated_at":"2016-04-14T23:57:17Z","html_url":"https://github.com/awslabs/aws-sdk-ruby-record/pull/10#discussion_r59810825","pull_request_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/comments/59810825"},"html":{"href":"https://github.com/awslabs/aws-sdk-ruby-record/pull/10#discussion_r59810825"},"pull_request":{"href":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/10","id":66378326,"html_url":"https://github.com/awslabs/aws-sdk-ruby-record/pull/10","diff_url":"https://github.com/awslabs/aws-sdk-ruby-record/pull/10.diff","patch_url":"https://github.com/awslabs/aws-sdk-ruby-record/pull/10.patch","issue_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/issues/10","number":10,"state":"open","locked":false,"title":"Batch write item","user":{"login":"derigible","id":8007114,"avatar_url":"https://avatars.githubusercontent.com/u/8007114?v=3","gravatar_id":"","url":"https://api.github.com/users/derigible","html_url":"https://github.com/derigible","followers_url":"https://api.github.com/users/derigible/followers","following_url":"https://api.github.com/users/derigible/following{/other_user}","gists_url":"https://api.github.com/users/derigible/gists{/gist_id}","starred_url":"https://api.github.com/users/derigible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derigible/subscriptions","organizations_url":"https://api.github.com/users/derigible/orgs","repos_url":"https://api.github.com/users/derigible/repos","events_url":"https://api.github.com/users/derigible/events{/privacy}","received_events_url":"https://api.github.com/users/derigible/received_events","type":"User","site_admin":false},"body":"This is just an idea for implementing batch_write_item on a record, and so specs and several other aspects of the code are not written. It pairs down some of the functionality of batch_write_item to help with ease of use and validation of records before submit. Our team will need the functionality of batch_write_item on a single record type, so it would be nice to have something like this.","created_at":"2016-04-13T19:34:49Z","updated_at":"2016-04-14T23:57:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8cd886a99bbe5f39ab39b906987cc9a5bc197214","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/10/commits","review_comments_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/10/comments","review_comment_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/issues/10/comments","statuses_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/statuses/3b4619bf24b71f93ac130d6b0c29bc29d11314cd","head":{"label":"derigible:batch_write_item","ref":"batch_write_item","sha":"3b4619bf24b71f93ac130d6b0c29bc29d11314cd","user":{"login":"derigible","id":8007114,"avatar_url":"https://avatars.githubusercontent.com/u/8007114?v=3","gravatar_id":"","url":"https://api.github.com/users/derigible","html_url":"https://github.com/derigible","followers_url":"https://api.github.com/users/derigible/followers","following_url":"https://api.github.com/users/derigible/following{/other_user}","gists_url":"https://api.github.com/users/derigible/gists{/gist_id}","starred_url":"https://api.github.com/users/derigible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derigible/subscriptions","organizations_url":"https://api.github.com/users/derigible/orgs","repos_url":"https://api.github.com/users/derigible/repos","events_url":"https://api.github.com/users/derigible/events{/privacy}","received_events_url":"https://api.github.com/users/derigible/received_events","type":"User","site_admin":false},"repo":{"id":56093079,"name":"aws-sdk-ruby-record","full_name":"derigible/aws-sdk-ruby-record","owner":{"login":"derigible","id":8007114,"avatar_url":"https://avatars.githubusercontent.com/u/8007114?v=3","gravatar_id":"","url":"https://api.github.com/users/derigible","html_url":"https://github.com/derigible","followers_url":"https://api.github.com/users/derigible/followers","following_url":"https://api.github.com/users/derigible/following{/other_user}","gists_url":"https://api.github.com/users/derigible/gists{/gist_id}","starred_url":"https://api.github.com/users/derigible/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derigible/subscriptions","organizations_url":"https://api.github.com/users/derigible/orgs","repos_url":"https://api.github.com/users/derigible/repos","events_url":"https://api.github.com/users/derigible/events{/privacy}","received_events_url":"https://api.github.com/users/derigible/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/derigible/aws-sdk-ruby-record","description":"Official repository for the aws-record gem, an abstraction for Amazon DynamoDB.","fork":true,"url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record","forks_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/forks","keys_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/keys{/key_id}","collaborators_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/teams","hooks_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/hooks","issue_events_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/issues/events{/number}","events_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/events","assignees_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/assignees{/user}","branches_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/branches{/branch}","tags_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/tags","blobs_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/git/refs{/sha}","trees_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/git/trees{/sha}","statuses_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/statuses/{sha}","languages_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/languages","stargazers_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/stargazers","contributors_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/contributors","subscribers_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/subscribers","subscription_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/subscription","commits_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/commits{/sha}","git_commits_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/git/commits{/sha}","comments_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/comments{/number}","issue_comment_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/issues/comments{/number}","contents_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/contents/{+path}","compare_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/compare/{base}...{head}","merges_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/merges","archive_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/downloads","issues_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/issues{/number}","pulls_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/pulls{/number}","milestones_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/milestones{/number}","notifications_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/labels{/name}","releases_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/releases{/id}","deployments_url":"https://api.github.com/repos/derigible/aws-sdk-ruby-record/deployments","created_at":"2016-04-12T19:50:08Z","updated_at":"2016-04-12T19:50:09Z","pushed_at":"2016-04-14T21:45:21Z","git_url":"git://github.com/derigible/aws-sdk-ruby-record.git","ssh_url":"git@github.com:derigible/aws-sdk-ruby-record.git","clone_url":"https://github.com/derigible/aws-sdk-ruby-record.git","svn_url":"https://github.com/derigible/aws-sdk-ruby-record","homepage":null,"size":143,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"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":"awslabs:master","ref":"master","sha":"ed566fcf8188441cf7bd387b06187a2f3e29c949","user":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"repo":{"id":38135511,"name":"aws-sdk-ruby-record","full_name":"awslabs/aws-sdk-ruby-record","owner":{"login":"awslabs","id":3299148,"avatar_url":"https://avatars.githubusercontent.com/u/3299148?v=3","gravatar_id":"","url":"https://api.github.com/users/awslabs","html_url":"https://github.com/awslabs","followers_url":"https://api.github.com/users/awslabs/followers","following_url":"https://api.github.com/users/awslabs/following{/other_user}","gists_url":"https://api.github.com/users/awslabs/gists{/gist_id}","starred_url":"https://api.github.com/users/awslabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awslabs/subscriptions","organizations_url":"https://api.github.com/users/awslabs/orgs","repos_url":"https://api.github.com/users/awslabs/repos","events_url":"https://api.github.com/users/awslabs/events{/privacy}","received_events_url":"https://api.github.com/users/awslabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awslabs/aws-sdk-ruby-record","description":"Official repository for the aws-record gem, an abstraction for Amazon DynamoDB.","fork":false,"url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record","forks_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/forks","keys_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/teams","hooks_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/hooks","issue_events_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/issues/events{/number}","events_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/events","assignees_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/assignees{/user}","branches_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/branches{/branch}","tags_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/tags","blobs_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/git/refs{/sha}","trees_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/statuses/{sha}","languages_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/languages","stargazers_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/stargazers","contributors_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/contributors","subscribers_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/subscribers","subscription_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/subscription","commits_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/commits{/sha}","git_commits_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/git/commits{/sha}","comments_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/comments{/number}","issue_comment_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/issues/comments{/number}","contents_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/contents/{+path}","compare_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/merges","archive_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/downloads","issues_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/issues{/number}","pulls_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls{/number}","milestones_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/milestones{/number}","notifications_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/labels{/name}","releases_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/releases{/id}","deployments_url":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/deployments","created_at":"2015-06-26T21:47:23Z","updated_at":"2016-04-13T21:04:43Z","pushed_at":"2016-04-14T21:45:21Z","git_url":"git://github.com/awslabs/aws-sdk-ruby-record.git","ssh_url":"git@github.com:awslabs/aws-sdk-ruby-record.git","clone_url":"https://github.com/awslabs/aws-sdk-ruby-record.git","svn_url":"https://github.com/awslabs/aws-sdk-ruby-record","homepage":null,"size":144,"stargazers_count":16,"watchers_count":16,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":4,"forks":6,"open_issues":4,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/10"},"html":{"href":"https://github.com/awslabs/aws-sdk-ruby-record/pull/10"},"issue":{"href":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/issues/10"},"comments":{"href":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/awslabs/aws-sdk-ruby-record/statuses/3b4619bf24b71f93ac130d6b0c29bc29d11314cd"}}}}