{"action":"created","comment":{"url":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/comments/73003206","id":73003206,"diff_hunk":"@@ -0,0 +1,121 @@\n+//\n+//  BulkDocs.swift\n+//  SwiftCloudant\n+//\n+//  Created by Rhys Short on 27/07/2016.\n+//\n+//  Copyright (c) 2016 IBM Corp.\n+//\n+//  Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file\n+//  except in compliance with the License. You may obtain a copy of the License at\n+//    http://www.apache.org/licenses/LICENSE-2.0\n+//  Unless required by applicable law or agreed to in writing, software distributed under the\n+//  License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,\n+//  either express or implied. See the License for the specific language governing permissions\n+//  and limitations under the License.\n+//\n+\n+import Foundation\n+\n+/**\n+ An operation to create and update documents in bulk.\n+ \n+ Example usage:\n+ \n+ ```\n+ let documents = [[\"hello\":\"world\"], [\"foo\":\"bar\", \"_id\": \"foobar\", \"_rev\": \"1-revision\"]\n+ let bulkDocs = PutBulkDocsOperation(databaseName: \"exampleDB\", documents: documents) { response, httpInfo, error in \n+    guard let response = response, httpInfo = httpInfo, error == nil \n+    else {\n+        //handle the error\n+        return\n+    }\n+ \n+    //handle success.\n+ }\n+ \n+ ```\n+ */\n+public class PutBulkDocsOperation : CouchDatabaseOperation, JSONOperation {\n+    \n+    public typealias Json = [[String: AnyObject]]\n+\n+    public let databaseName: String\n+    \n+    public let completionHandler: ((response: [[String:AnyObject]]?, httpInfo:HTTPInfo?, error:Error?) -> Void)?\n+    \n+    /**\n+     The documents that make up this request.\n+    */\n+    public let documents: [[String:AnyObject]]\n+    \n+    /**\n+     If false, CouchDB will insert the documents exactly as they are sent. This option is normally \n+     used for replication with CouchDB.\n+    */\n+    public let newEdits: Bool?\n+    \n+    /**\n+    If true the commit mode for the request will be \"All or Nothing\" meaning that if one document\n+    fails to be created or updated, no documents will be commited to the database.\n+    */\n+    public let allOrNothing: Bool?\n+    \n+    /**\n+     Creates the operation\n+     \n+     - parameter databaseName: The name of the database where the documents should be created or updated.\n+     - parameter documents: The documents that should be saved to the server.\n+     - parameter newEdits: Should the server treate the request as new edits or save as is.\n+     - parameter allOrNothing: The commit mode for the database, if set to true, if one document fails\n+     to be inserted into the database, all other documents in the request will also not be inserted.\n+     - parameter comptionHandler: Optional handler to call when the operation completes.","path":"Source/BulkDocs.swift","position":72,"original_position":72,"commit_id":"27b845b50724cd3b23e884d49cb591d4af16a632","original_commit_id":"27b845b50724cd3b23e884d49cb591d4af16a632","user":{"login":"ricellis","id":10698320,"avatar_url":"https://avatars.githubusercontent.com/u/10698320?v=3","gravatar_id":"","url":"https://api.github.com/users/ricellis","html_url":"https://github.com/ricellis","followers_url":"https://api.github.com/users/ricellis/followers","following_url":"https://api.github.com/users/ricellis/following{/other_user}","gists_url":"https://api.github.com/users/ricellis/gists{/gist_id}","starred_url":"https://api.github.com/users/ricellis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ricellis/subscriptions","organizations_url":"https://api.github.com/users/ricellis/orgs","repos_url":"https://api.github.com/users/ricellis/repos","events_url":"https://api.github.com/users/ricellis/events{/privacy}","received_events_url":"https://api.github.com/users/ricellis/received_events","type":"User","site_admin":false},"body":"comption -> completion","created_at":"2016-08-01T15:55:57Z","updated_at":"2016-08-01T15:55:57Z","html_url":"https://github.com/cloudant/swift-cloudant/pull/113#discussion_r73003206","pull_request_url":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/113","_links":{"self":{"href":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/comments/73003206"},"html":{"href":"https://github.com/cloudant/swift-cloudant/pull/113#discussion_r73003206"},"pull_request":{"href":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/113"}}},"pull_request":{"url":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/113","id":79374146,"html_url":"https://github.com/cloudant/swift-cloudant/pull/113","diff_url":"https://github.com/cloudant/swift-cloudant/pull/113.diff","patch_url":"https://github.com/cloudant/swift-cloudant/pull/113.patch","issue_url":"https://api.github.com/repos/cloudant/swift-cloudant/issues/113","number":113,"state":"open","locked":false,"title":"Support `_bulk_docs`","user":{"login":"rhyshort","id":1616727,"avatar_url":"https://avatars.githubusercontent.com/u/1616727?v=3","gravatar_id":"","url":"https://api.github.com/users/rhyshort","html_url":"https://github.com/rhyshort","followers_url":"https://api.github.com/users/rhyshort/followers","following_url":"https://api.github.com/users/rhyshort/following{/other_user}","gists_url":"https://api.github.com/users/rhyshort/gists{/gist_id}","starred_url":"https://api.github.com/users/rhyshort/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhyshort/subscriptions","organizations_url":"https://api.github.com/users/rhyshort/orgs","repos_url":"https://api.github.com/users/rhyshort/repos","events_url":"https://api.github.com/users/rhyshort/events{/privacy}","received_events_url":"https://api.github.com/users/rhyshort/received_events","type":"User","site_admin":false},"body":"## What\r\n\r\nSupport `_bulk_docs`\r\n## How\r\n\r\nCreated `PutBulkDocsOperation` API.\r\n\r\n## Testing\r\n\r\nSeveral tests, mostly aimed at the data the operation produced , a single test which goes through the whole HTTP stack.\r\n\r\n## Issues\r\n\r\nResolves #88","created_at":"2016-07-29T15:03:54Z","updated_at":"2016-08-01T15:55:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77933d3866bc0d5d8b17cd63aee95dfe23f3c0bf","assignee":{"login":"emlaver","id":10552966,"avatar_url":"https://avatars.githubusercontent.com/u/10552966?v=3","gravatar_id":"","url":"https://api.github.com/users/emlaver","html_url":"https://github.com/emlaver","followers_url":"https://api.github.com/users/emlaver/followers","following_url":"https://api.github.com/users/emlaver/following{/other_user}","gists_url":"https://api.github.com/users/emlaver/gists{/gist_id}","starred_url":"https://api.github.com/users/emlaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emlaver/subscriptions","organizations_url":"https://api.github.com/users/emlaver/orgs","repos_url":"https://api.github.com/users/emlaver/repos","events_url":"https://api.github.com/users/emlaver/events{/privacy}","received_events_url":"https://api.github.com/users/emlaver/received_events","type":"User","site_admin":false},"assignees":[{"login":"emlaver","id":10552966,"avatar_url":"https://avatars.githubusercontent.com/u/10552966?v=3","gravatar_id":"","url":"https://api.github.com/users/emlaver","html_url":"https://github.com/emlaver","followers_url":"https://api.github.com/users/emlaver/followers","following_url":"https://api.github.com/users/emlaver/following{/other_user}","gists_url":"https://api.github.com/users/emlaver/gists{/gist_id}","starred_url":"https://api.github.com/users/emlaver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emlaver/subscriptions","organizations_url":"https://api.github.com/users/emlaver/orgs","repos_url":"https://api.github.com/users/emlaver/repos","events_url":"https://api.github.com/users/emlaver/events{/privacy}","received_events_url":"https://api.github.com/users/emlaver/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/113/commits","review_comments_url":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/113/comments","review_comment_url":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cloudant/swift-cloudant/issues/113/comments","statuses_url":"https://api.github.com/repos/cloudant/swift-cloudant/statuses/27b845b50724cd3b23e884d49cb591d4af16a632","head":{"label":"cloudant:88-bulk-docs","ref":"88-bulk-docs","sha":"27b845b50724cd3b23e884d49cb591d4af16a632","user":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"repo":{"id":55980905,"name":"swift-cloudant","full_name":"cloudant/swift-cloudant","owner":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudant/swift-cloudant","description":"A Swift Lang client for Cloudant and CouchDB","fork":false,"url":"https://api.github.com/repos/cloudant/swift-cloudant","forks_url":"https://api.github.com/repos/cloudant/swift-cloudant/forks","keys_url":"https://api.github.com/repos/cloudant/swift-cloudant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudant/swift-cloudant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudant/swift-cloudant/teams","hooks_url":"https://api.github.com/repos/cloudant/swift-cloudant/hooks","issue_events_url":"https://api.github.com/repos/cloudant/swift-cloudant/issues/events{/number}","events_url":"https://api.github.com/repos/cloudant/swift-cloudant/events","assignees_url":"https://api.github.com/repos/cloudant/swift-cloudant/assignees{/user}","branches_url":"https://api.github.com/repos/cloudant/swift-cloudant/branches{/branch}","tags_url":"https://api.github.com/repos/cloudant/swift-cloudant/tags","blobs_url":"https://api.github.com/repos/cloudant/swift-cloudant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudant/swift-cloudant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudant/swift-cloudant/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudant/swift-cloudant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudant/swift-cloudant/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudant/swift-cloudant/languages","stargazers_url":"https://api.github.com/repos/cloudant/swift-cloudant/stargazers","contributors_url":"https://api.github.com/repos/cloudant/swift-cloudant/contributors","subscribers_url":"https://api.github.com/repos/cloudant/swift-cloudant/subscribers","subscription_url":"https://api.github.com/repos/cloudant/swift-cloudant/subscription","commits_url":"https://api.github.com/repos/cloudant/swift-cloudant/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudant/swift-cloudant/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudant/swift-cloudant/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudant/swift-cloudant/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudant/swift-cloudant/contents/{+path}","compare_url":"https://api.github.com/repos/cloudant/swift-cloudant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudant/swift-cloudant/merges","archive_url":"https://api.github.com/repos/cloudant/swift-cloudant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudant/swift-cloudant/downloads","issues_url":"https://api.github.com/repos/cloudant/swift-cloudant/issues{/number}","pulls_url":"https://api.github.com/repos/cloudant/swift-cloudant/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudant/swift-cloudant/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudant/swift-cloudant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudant/swift-cloudant/labels{/name}","releases_url":"https://api.github.com/repos/cloudant/swift-cloudant/releases{/id}","deployments_url":"https://api.github.com/repos/cloudant/swift-cloudant/deployments","created_at":"2016-04-11T14:47:54Z","updated_at":"2016-07-21T09:43:04Z","pushed_at":"2016-08-01T09:04:33Z","git_url":"git://github.com/cloudant/swift-cloudant.git","ssh_url":"git@github.com:cloudant/swift-cloudant.git","clone_url":"https://github.com/cloudant/swift-cloudant.git","svn_url":"https://github.com/cloudant/swift-cloudant","homepage":null,"size":529,"stargazers_count":6,"watchers_count":6,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":23,"forks":1,"open_issues":23,"watchers":6,"default_branch":"master"}},"base":{"label":"cloudant:master","ref":"master","sha":"5093b96367c63152073e30229ba84eeb5cb26494","user":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"repo":{"id":55980905,"name":"swift-cloudant","full_name":"cloudant/swift-cloudant","owner":{"login":"cloudant","id":44642,"avatar_url":"https://avatars.githubusercontent.com/u/44642?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudant","html_url":"https://github.com/cloudant","followers_url":"https://api.github.com/users/cloudant/followers","following_url":"https://api.github.com/users/cloudant/following{/other_user}","gists_url":"https://api.github.com/users/cloudant/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudant/subscriptions","organizations_url":"https://api.github.com/users/cloudant/orgs","repos_url":"https://api.github.com/users/cloudant/repos","events_url":"https://api.github.com/users/cloudant/events{/privacy}","received_events_url":"https://api.github.com/users/cloudant/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cloudant/swift-cloudant","description":"A Swift Lang client for Cloudant and CouchDB","fork":false,"url":"https://api.github.com/repos/cloudant/swift-cloudant","forks_url":"https://api.github.com/repos/cloudant/swift-cloudant/forks","keys_url":"https://api.github.com/repos/cloudant/swift-cloudant/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudant/swift-cloudant/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudant/swift-cloudant/teams","hooks_url":"https://api.github.com/repos/cloudant/swift-cloudant/hooks","issue_events_url":"https://api.github.com/repos/cloudant/swift-cloudant/issues/events{/number}","events_url":"https://api.github.com/repos/cloudant/swift-cloudant/events","assignees_url":"https://api.github.com/repos/cloudant/swift-cloudant/assignees{/user}","branches_url":"https://api.github.com/repos/cloudant/swift-cloudant/branches{/branch}","tags_url":"https://api.github.com/repos/cloudant/swift-cloudant/tags","blobs_url":"https://api.github.com/repos/cloudant/swift-cloudant/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudant/swift-cloudant/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudant/swift-cloudant/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudant/swift-cloudant/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudant/swift-cloudant/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudant/swift-cloudant/languages","stargazers_url":"https://api.github.com/repos/cloudant/swift-cloudant/stargazers","contributors_url":"https://api.github.com/repos/cloudant/swift-cloudant/contributors","subscribers_url":"https://api.github.com/repos/cloudant/swift-cloudant/subscribers","subscription_url":"https://api.github.com/repos/cloudant/swift-cloudant/subscription","commits_url":"https://api.github.com/repos/cloudant/swift-cloudant/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudant/swift-cloudant/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudant/swift-cloudant/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudant/swift-cloudant/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudant/swift-cloudant/contents/{+path}","compare_url":"https://api.github.com/repos/cloudant/swift-cloudant/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudant/swift-cloudant/merges","archive_url":"https://api.github.com/repos/cloudant/swift-cloudant/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudant/swift-cloudant/downloads","issues_url":"https://api.github.com/repos/cloudant/swift-cloudant/issues{/number}","pulls_url":"https://api.github.com/repos/cloudant/swift-cloudant/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudant/swift-cloudant/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudant/swift-cloudant/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudant/swift-cloudant/labels{/name}","releases_url":"https://api.github.com/repos/cloudant/swift-cloudant/releases{/id}","deployments_url":"https://api.github.com/repos/cloudant/swift-cloudant/deployments","created_at":"2016-04-11T14:47:54Z","updated_at":"2016-07-21T09:43:04Z","pushed_at":"2016-08-01T09:04:33Z","git_url":"git://github.com/cloudant/swift-cloudant.git","ssh_url":"git@github.com:cloudant/swift-cloudant.git","clone_url":"https://github.com/cloudant/swift-cloudant.git","svn_url":"https://github.com/cloudant/swift-cloudant","homepage":null,"size":529,"stargazers_count":6,"watchers_count":6,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":23,"forks":1,"open_issues":23,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/113"},"html":{"href":"https://github.com/cloudant/swift-cloudant/pull/113"},"issue":{"href":"https://api.github.com/repos/cloudant/swift-cloudant/issues/113"},"comments":{"href":"https://api.github.com/repos/cloudant/swift-cloudant/issues/113/comments"},"review_comments":{"href":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/113/comments"},"review_comment":{"href":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cloudant/swift-cloudant/pulls/113/commits"},"statuses":{"href":"https://api.github.com/repos/cloudant/swift-cloudant/statuses/27b845b50724cd3b23e884d49cb591d4af16a632"}}}}
{"actor":{"display_login":"ricellis"}}