{"action":"created","comment":{"url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/comments/63824652","id":63824652,"diff_hunk":"@@ -0,0 +1,534 @@\n+//\n+//  GatewayAPI.swift\n+//  ThingIFSDK\n+//\n+//  Copyright (c) 2016 Kii. All rights reserved.\n+//\n+\n+import Foundation\n+\n+public class GatewayAPI: NSObject, NSCoding {\n+\n+    private static let SHARED_NSUSERDEFAULT_KEY_INSTANCE = \"GatewayAPI_INSTANCE\"\n+    private static func getSharedNSDefaultKey(tag : String?) -> String{\n+        return SHARED_NSUSERDEFAULT_KEY_INSTANCE + (tag == nil ? \"\" : \"_\\(tag)\")\n+    }\n+\n+    public let tag: String?\n+    public let app: App\n+    public let gatewayAddress: NSURL\n+\n+    private var accessToken: String?\n+\n+    let operationQueue = OperationQueue()\n+\n+    // MARK: - Implements NSCoding protocol\n+    public func encodeWithCoder(aCoder: NSCoder)\n+    {\n+        aCoder.encodeObject(self.tag, forKey: \"tag\")\n+        aCoder.encodeObject(self.app, forKey: \"app\")\n+        aCoder.encodeObject(self.gatewayAddress, forKey: \"gatewayAddress\")\n+        aCoder.encodeObject(self.accessToken, forKey: \"accessToken\")\n+    }\n+\n+    public required init(coder aDecoder: NSCoder)\n+    {\n+        self.tag = aDecoder.decodeObjectForKey(\"tag\") as? String\n+        self.app = aDecoder.decodeObjectForKey(\"app\") as! App\n+        self.gatewayAddress = aDecoder.decodeObjectForKey(\"gatewayAddress\") as! NSURL\n+        self.accessToken = aDecoder.decodeObjectForKey(\"accessToken\") as? String\n+    }\n+\n+    init(app: App, gatewayAddress: NSURL, tag: String? = nil)\n+    {\n+        self.tag = tag\n+        self.app = app\n+        self.gatewayAddress = gatewayAddress\n+    }\n+\n+    // MARK: API methods\n+\n+    /** Login to the Gateway.\n+     Local authentication for the Gateway access.\n+     Required prior to call other APIs access to the gateway.\n+\n+     - Parameter username: Username of the Gateway.\n+     - Parameter password: Password of the Gateway.\n+     - Parameter completionHandler: A closure to be executed once finished. The closure takes 1 argument: an instance of ThingIFError when failed.\n+     */\n+    public func login(\n+        username: String,\n+        password: String,\n+        completionHandler: (ThingIFError?)-> Void\n+        )\n+    {\n+        if username.isEmpty || password.isEmpty {\n+            completionHandler(ThingIFError.UNSUPPORTED_ERROR)\n+            return\n+        }\n+\n+        let requestURL = \"\\(self.app.baseURL)/\\(self.app.siteName)/token\"\n+\n+        // generate header\n+        let credential = \"\\(self.app.appID):\\(self.app.appKey)\"\n+        let base64Str = credential.dataUsingEncoding(NSUTF8StringEncoding)?.base64EncodedDataWithOptions(NSDataBase64EncodingOptions.Encoding64CharacterLineLength)\n+        let requestHeaderDict:Dictionary<String, String> = [\n+            \"authorization\": \"Bearer \\(base64Str)\"\n+        ]\n+\n+        // genrate body\n+        let requestBodyDict = NSMutableDictionary(dictionary:\n+            [\n+                \"username\": username,\n+                \"password\": password\n+            ]\n+        )\n+\n+        do {\n+            let requestBodyData = try NSJSONSerialization.dataWithJSONObject(requestBodyDict, options: NSJSONWritingOptions(rawValue: 0))\n+            // do request\n+            let request = buildDefaultRequest(\n+                HTTPMethod.POST,\n+                urlString: requestURL,\n+                requestHeaderDict: requestHeaderDict,\n+                requestBodyData: requestBodyData,\n+                completionHandler: { (response, error) -> Void in\n+                    self.accessToken = response?[\"accessToken\"] as? String\n+                    self.saveInstance()\n+                    dispatch_async(dispatch_get_main_queue()) {\n+                        completionHandler(error)\n+                    }\n+                }\n+            )\n+            let operation = IoTRequestOperation(request: request)\n+            operationQueue.addOperation(operation)\n+        } catch(_) {\n+            kiiSevereLog(\"ThingIFError.JSON_PARSE_ERROR\")\n+            completionHandler(ThingIFError.JSON_PARSE_ERROR)\n+        }\n+    }\n+\n+    /** Let the Gateway Onboard.\n+\n+     - Parameter completionHandler: A closure to be executed once finished. The closure takes 2 arguments: 1st one is Gateway instance that has thingID asigned by Kii Cloud and 2nd one is an instance of ThingIFError when failed.\n+     */\n+    public func onboardGateway(\n+        completionHandler: (Gateway?, ThingIFError?)-> Void\n+        )\n+    {\n+        if self.isLoggedIn() == false {\n+            completionHandler(nil, ThingIFError.USER_IS_NOT_LOGGED_IN)\n+            return;\n+        }\n+\n+        let requestURL = \"\\(self.gatewayAddress.absoluteString)/\\(self.app.siteName)/apps/\\(self.app.appID)/gateway/onboarding\"\n+\n+        // generate header\n+        let requestHeaderDict:Dictionary<String, String> = [\n+            \"authorization\": \"Bearer \\(self.accessToken!)\"\n+        ]\n+\n+        // do request\n+        let request = buildDefaultRequest(\n+            HTTPMethod.POST,\n+            urlString: requestURL,\n+            requestHeaderDict: requestHeaderDict,\n+            requestBodyData: nil,\n+            completionHandler: { (response, error) -> Void in\n+                let gateway: Gateway?\n+                if response != nil {\n+                    let thingID = response?[\"thingID\"] as? String\n+                    // FIXME: Gateway should return the vendorThingID\n+                    gateway = Gateway(thingID: thingID!, vendorThingID: \"\")\n+                } else {\n+                    gateway = nil\n+                }\n+                dispatch_async(dispatch_get_main_queue()) {\n+                    completionHandler(gateway, error)\n+                }\n+            }\n+        )\n+        let operation = IoTRequestOperation(request: request)\n+        operationQueue.addOperation(operation)\n+    }\n+\n+    /** Get Gateway ID\n+\n+     - Parameter completionHandler: A closure to be executed once get id has finished. The closure takes 2 arguments: 1st one is Gateway ID and 2nd one is an instance of ThingIFError when failed.\n+     */\n+    public func getGatewayID(\n+        completionHandler: (String?, ThingIFError?)-> Void\n+        )\n+    {\n+        if self.isLoggedIn() == false {\n+            completionHandler(nil, ThingIFError.USER_IS_NOT_LOGGED_IN)\n+            return;\n+        }\n+\n+        let requestURL = \"\\(self.gatewayAddress.absoluteString)/\\(self.app.siteName)/apps/\\(self.app.appID)/gateway/id\"\n+\n+        // generate header\n+        let requestHeaderDict:Dictionary<String, String> = [\n+            \"authorization\": \"Bearer \\(self.accessToken!)\"\n+        ]\n+\n+        // do request\n+        let request = buildDefaultRequest(\n+            HTTPMethod.GET,\n+            urlString: requestURL,\n+            requestHeaderDict: requestHeaderDict,\n+            requestBodyData: nil,\n+            completionHandler: { (response, error) -> Void in\n+                let thingID = response?[\"thingID\"] as? String\n+                dispatch_async(dispatch_get_main_queue()) {\n+                    completionHandler(thingID, error)\n+                }\n+            }\n+        )\n+        let operation = IoTRequestOperation(request: request)\n+        operationQueue.addOperation(operation)\n+    }\n+\n+    /** List connected end nodes which has not been onboarded.\n+\n+     - Parameter completionHandler: A closure to be executed once get id has finished. The closure takes 2 arguments: 1st one is List of end nodes connected to the gateway but waiting for onboarding and 2nd one is an instance of ThingIFError when failed.\n+     */\n+    public func listPendingEndNodes(\n+        completionHandler: ([PendingEndNode]?, ThingIFError?)-> Void\n+        )\n+    {\n+        if self.isLoggedIn() == false {\n+            completionHandler(nil, ThingIFError.USER_IS_NOT_LOGGED_IN)\n+            return;\n+        }\n+\n+        let requestURL = \"\\(self.gatewayAddress.absoluteString)/\\(self.app.siteName)/apps/\\(self.app.appID)/gateway/end-nodes/pending\"\n+\n+        // generate header\n+        let requestHeaderDict:Dictionary<String, String> = [\n+            \"authorization\": \"Bearer \\(self.accessToken!)\"\n+        ]\n+\n+        // do request\n+        let request = buildDefaultRequest(\n+            HTTPMethod.GET,\n+            urlString: requestURL,\n+            requestHeaderDict: requestHeaderDict,\n+            requestBodyData: nil,\n+            completionHandler: { (response, error) -> Void in\n+                var endNodes = [PendingEndNode]()\n+                if response != nil {\n+                    if let endNodeArray = response![\"results\"] as? [NSDictionary] {\n+                        for endNode in endNodeArray {\n+                            endNodes.append(PendingEndNode(json: endNode as! Dictionary<String, AnyObject>))\n+                        }\n+                    }\n+                }\n+                dispatch_async(dispatch_get_main_queue()) {\n+                    if error != nil {\n+                        completionHandler(nil, error)\n+                    } else {\n+                        completionHandler(endNodes, nil)\n+                    }\n+                }\n+            }\n+        )\n+        let operation = IoTRequestOperation(request: request)\n+        operationQueue.addOperation(operation)\n+    }\n+\n+    /** Notify Onboarding completion\n+     Call this api when the End Node onboarding is done.\n+     After the call succeeded, End Node will be fully connected to Kii Cloud through the Gateway.\n+\n+     - Parameter endNode: Onboarded EndNode\n+     - Parameter completionHandler: A closure to be executed once finished. The closure takes 1 argument: an instance of ThingIFError when failed.\n+     */\n+    public func notifyOnboardingCompletion(\n+        endNode: EndNode,\n+        completionHandler: (ThingIFError?)-> Void\n+        )\n+    {\n+        if self.isLoggedIn() == false {\n+            completionHandler(ThingIFError.USER_IS_NOT_LOGGED_IN)\n+            return;\n+        }\n+\n+        if endNode.thingID.isEmpty || endNode.vendorThingID.isEmpty {\n+            completionHandler(ThingIFError.UNSUPPORTED_ERROR)\n+            return;\n+        }\n+\n+        let requestURL = \"\\(self.gatewayAddress.absoluteString)/\\(self.app.siteName)/apps/\\(self.app.appID)/gateway/end-nodes/VENDOR_THING_ID:\\(endNode.vendorThingID)\"\n+\n+        // generate header\n+        let requestHeaderDict:Dictionary<String, String> = [\n+            \"authorization\": \"Bearer \\(self.accessToken!)\"\n+        ]\n+\n+        // genrate body\n+        let requestBodyDict = NSMutableDictionary(dictionary:\n+            [\n+                \"thingID\": endNode.thingID\n+            ]\n+        )\n+\n+        do {\n+            let requestBodyData = try NSJSONSerialization.dataWithJSONObject(requestBodyDict, options: NSJSONWritingOptions(rawValue: 0))\n+            // do request\n+            let request = buildDefaultRequest(\n+                HTTPMethod.PUT,\n+                urlString: requestURL,\n+                requestHeaderDict: requestHeaderDict,\n+                requestBodyData: requestBodyData,\n+                completionHandler: { (response, error) -> Void in\n+                    dispatch_async(dispatch_get_main_queue()) {\n+                        completionHandler(error)\n+                    }\n+                }\n+            )\n+            let operation = IoTRequestOperation(request: request)\n+            operationQueue.addOperation(operation)\n+        } catch(_) {\n+            kiiSevereLog(\"ThingIFError.JSON_PARSE_ERROR\")\n+            completionHandler(ThingIFError.JSON_PARSE_ERROR)\n+        }\n+    }\n+\n+    /** Restore the Gateway.\n+     This API can be used only for the Gateway App.\n+\n+     - Parameter completionHandler: A closure to be executed once finished. The closure takes 1 argument: an instance of ThingIFError when failed.\n+     */\n+    public func restore(\n+        completionHandler: (ThingIFError?)-> Void\n+        )\n+    {\n+        if self.isLoggedIn() == false {\n+            completionHandler(ThingIFError.USER_IS_NOT_LOGGED_IN)\n+            return;\n+        }\n+\n+        let requestURL = \"\\(self.gatewayAddress.absoluteString)/gateway-app/gateway/restore\"\n+\n+        // generate header\n+        let requestHeaderDict:Dictionary<String, String> = [\n+            \"authorization\": \"Bearer \\(self.accessToken!)\"\n+        ]\n+\n+        // do request\n+        let request = buildDefaultRequest(\n+            HTTPMethod.POST,\n+            urlString: requestURL,\n+            requestHeaderDict: requestHeaderDict,\n+            requestBodyData: nil,\n+            completionHandler: { (response, error) -> Void in\n+                dispatch_async(dispatch_get_main_queue()) {\n+                    completionHandler(error)\n+                }\n+            }\n+        )\n+        let operation = IoTRequestOperation(request: request)\n+        operationQueue.addOperation(operation)\n+    }\n+\n+    /** Replace end-node by new vendorThingID for end node thingID.\n+\n+     - Parameter endNodeThingID: ID of the end-node assigned by Kii Cloud.\n+     - Parameter endNodeVendorThingID: ID of the end-node assigned by End Node vendor.\n+     - Parameter completionHandler: A closure to be executed once finished. The closure takes 1 argument: an instance of ThingIFError when failed.\n+     */\n+    public func replaceEndNode(\n+        endNodeThingID: String,\n+        endNodeVendorThingID: String,\n+        completionHandler: (ThingIFError?)-> Void\n+        )\n+    {\n+        if self.isLoggedIn() == false {\n+            completionHandler(ThingIFError.USER_IS_NOT_LOGGED_IN)\n+            return;\n+        }\n+\n+        if endNodeThingID.isEmpty || endNodeVendorThingID.isEmpty {\n+            completionHandler(ThingIFError.UNSUPPORTED_ERROR)\n+            return;\n+        }\n+\n+        let requestURL = \"\\(self.gatewayAddress.absoluteString)/\\(self.app.siteName)/apps/\\(self.app.appID)/gateway/end-nodes/THING_ID:\\(endNodeThingID)\"\n+\n+        // generate header\n+        let requestHeaderDict:Dictionary<String, String> = [\n+            \"authorization\": \"Bearer \\(self.accessToken!)\",\n+            \"Content-Type\": \"application/json\"\n+        ]\n+\n+        // genrate body\n+        let requestBodyDict = NSMutableDictionary(dictionary:\n+            [\n+                \"vendorThingID\": endNodeVendorThingID\n+            ]\n+        )\n+\n+        do {\n+            let requestBodyData = try NSJSONSerialization.dataWithJSONObject(requestBodyDict, options: NSJSONWritingOptions(rawValue: 0))\n+            // do request\n+            let request = buildDefaultRequest(\n+                HTTPMethod.PUT,\n+                urlString: requestURL,\n+                requestHeaderDict: requestHeaderDict,\n+                requestBodyData: requestBodyData,\n+                completionHandler: { (response, error) -> Void in\n+                    dispatch_async(dispatch_get_main_queue()) {\n+                        completionHandler(error)\n+                    }\n+                }\n+            )\n+            let operation = IoTRequestOperation(request: request)\n+            operationQueue.addOperation(operation)\n+        } catch(_) {\n+            kiiSevereLog(\"ThingIFError.JSON_PARSE_ERROR\")\n+            completionHandler(ThingIFError.JSON_PARSE_ERROR)\n+        }\n+    }\n+\n+    /** Get information of the Gateway.\n+     When the end user replaces the Gateway, Gateway App/End Node App need to obtain the new Gateway’s vendorThingID.\n+\n+     - Parameter completionHandler: A closure to be executed once get id has finished. The closure takes 2 arguments: 1st one is information of the Gateway and 2nd one is an instance of ThingIFError when failed.\n+     */\n+    public func getGatewayInformation(\n+        completionHandler: (GatewayInformation?, ThingIFError?)-> Void\n+        )\n+    {\n+        if self.isLoggedIn() == false {\n+            completionHandler(nil, ThingIFError.USER_IS_NOT_LOGGED_IN)\n+            return;\n+        }\n+\n+        let requestURL = \"\\(self.gatewayAddress.absoluteString)/gateway-info\"\n+\n+        // generate header\n+        let requestHeaderDict:Dictionary<String, String> = [\n+            \"authorization\": \"Bearer \\(self.accessToken!)\"\n+        ]\n+\n+        // do request\n+        let request = buildDefaultRequest(\n+            HTTPMethod.GET,\n+            urlString: requestURL,\n+            requestHeaderDict: requestHeaderDict,\n+            requestBodyData: nil,\n+            completionHandler: { (response, error) -> Void in\n+                let id = response?[\"vendorThingID\"] as? String\n+                dispatch_async(dispatch_get_main_queue()) {\n+                    if id == nil {\n+                        completionHandler(nil, error)\n+                    } else {\n+                        completionHandler(GatewayInformation(vendorThingID: id!), error)\n+                    }\n+                }\n+            }\n+        )\n+        let operation = IoTRequestOperation(request: request)\n+        operationQueue.addOperation(operation)\n+    }\n+\n+    /** Check if user is logged in to the Gateway.\n+\n+     - Returns: true if user is logged in, false otherwise.\n+     */\n+    public func isLoggedIn() -> Bool\n+    {\n+        return !(self.accessToken?.isEmpty ?? true)\n+    }\n+\n+    /** Get Access Token\n+\n+     - Returns: Access token\n+     */\n+    public func getAccessToken() -> String?\n+    {\n+        return self.accessToken\n+    }\n+\n+    func setAccessToken(token: String?)","path":"ThingIFSDK/ThingIFSDK/Gateway/GatewayAPI.swift","position":454,"original_position":454,"commit_id":"312b66fa269f075e72813b0578d18b5f905362a3","original_commit_id":"312b66fa269f075e72813b0578d18b5f905362a3","user":{"login":"naoki-akimoto","id":1961578,"avatar_url":"https://avatars.githubusercontent.com/u/1961578?v=3","gravatar_id":"","url":"https://api.github.com/users/naoki-akimoto","html_url":"https://github.com/naoki-akimoto","followers_url":"https://api.github.com/users/naoki-akimoto/followers","following_url":"https://api.github.com/users/naoki-akimoto/following{/other_user}","gists_url":"https://api.github.com/users/naoki-akimoto/gists{/gist_id}","starred_url":"https://api.github.com/users/naoki-akimoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naoki-akimoto/subscriptions","organizations_url":"https://api.github.com/users/naoki-akimoto/orgs","repos_url":"https://api.github.com/users/naoki-akimoto/repos","events_url":"https://api.github.com/users/naoki-akimoto/events{/privacy}","received_events_url":"https://api.github.com/users/naoki-akimoto/received_events","type":"User","site_admin":false},"body":"コードとして書いてみましたができませんでした。","created_at":"2016-05-19T05:35:08Z","updated_at":"2016-05-19T05:35:08Z","html_url":"https://github.com/KiiPlatform/thing-if-iOSSDK/pull/111#discussion_r63824652","pull_request_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/111","_links":{"self":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/comments/63824652"},"html":{"href":"https://github.com/KiiPlatform/thing-if-iOSSDK/pull/111#discussion_r63824652"},"pull_request":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/111","id":66972050,"html_url":"https://github.com/KiiPlatform/thing-if-iOSSDK/pull/111","diff_url":"https://github.com/KiiPlatform/thing-if-iOSSDK/pull/111.diff","patch_url":"https://github.com/KiiPlatform/thing-if-iOSSDK/pull/111.patch","issue_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/issues/111","number":111,"state":"open","locked":false,"title":"Designing new API for gateway.","user":{"login":"naoki-akimoto","id":1961578,"avatar_url":"https://avatars.githubusercontent.com/u/1961578?v=3","gravatar_id":"","url":"https://api.github.com/users/naoki-akimoto","html_url":"https://github.com/naoki-akimoto","followers_url":"https://api.github.com/users/naoki-akimoto/followers","following_url":"https://api.github.com/users/naoki-akimoto/following{/other_user}","gists_url":"https://api.github.com/users/naoki-akimoto/gists{/gist_id}","starred_url":"https://api.github.com/users/naoki-akimoto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naoki-akimoto/subscriptions","organizations_url":"https://api.github.com/users/naoki-akimoto/orgs","repos_url":"https://api.github.com/users/naoki-akimoto/repos","events_url":"https://api.github.com/users/naoki-akimoto/events{/privacy}","received_events_url":"https://api.github.com/users/naoki-akimoto/received_events","type":"User","site_admin":false},"body":"Gateway APIの定義とドキュメントコメントを追加しました。\r\n\r\nIssue: #110 ","created_at":"2016-04-19T07:32:13Z","updated_at":"2016-05-19T05:35:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"31a9739cfc974c3410d85cbb00ec51600ad8801a","assignee":{"login":"nfukuzaki","id":1865615,"avatar_url":"https://avatars.githubusercontent.com/u/1865615?v=3","gravatar_id":"","url":"https://api.github.com/users/nfukuzaki","html_url":"https://github.com/nfukuzaki","followers_url":"https://api.github.com/users/nfukuzaki/followers","following_url":"https://api.github.com/users/nfukuzaki/following{/other_user}","gists_url":"https://api.github.com/users/nfukuzaki/gists{/gist_id}","starred_url":"https://api.github.com/users/nfukuzaki/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfukuzaki/subscriptions","organizations_url":"https://api.github.com/users/nfukuzaki/orgs","repos_url":"https://api.github.com/users/nfukuzaki/repos","events_url":"https://api.github.com/users/nfukuzaki/events{/privacy}","received_events_url":"https://api.github.com/users/nfukuzaki/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/111/commits","review_comments_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/111/comments","review_comment_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/issues/111/comments","statuses_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/statuses/312b66fa269f075e72813b0578d18b5f905362a3","head":{"label":"KiiPlatform:add_gateway_apis","ref":"add_gateway_apis","sha":"312b66fa269f075e72813b0578d18b5f905362a3","user":{"login":"KiiPlatform","id":3078752,"avatar_url":"https://avatars.githubusercontent.com/u/3078752?v=3","gravatar_id":"","url":"https://api.github.com/users/KiiPlatform","html_url":"https://github.com/KiiPlatform","followers_url":"https://api.github.com/users/KiiPlatform/followers","following_url":"https://api.github.com/users/KiiPlatform/following{/other_user}","gists_url":"https://api.github.com/users/KiiPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/KiiPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiiPlatform/subscriptions","organizations_url":"https://api.github.com/users/KiiPlatform/orgs","repos_url":"https://api.github.com/users/KiiPlatform/repos","events_url":"https://api.github.com/users/KiiPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/KiiPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":40101539,"name":"thing-if-iOSSDK","full_name":"KiiPlatform/thing-if-iOSSDK","owner":{"login":"KiiPlatform","id":3078752,"avatar_url":"https://avatars.githubusercontent.com/u/3078752?v=3","gravatar_id":"","url":"https://api.github.com/users/KiiPlatform","html_url":"https://github.com/KiiPlatform","followers_url":"https://api.github.com/users/KiiPlatform/followers","following_url":"https://api.github.com/users/KiiPlatform/following{/other_user}","gists_url":"https://api.github.com/users/KiiPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/KiiPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiiPlatform/subscriptions","organizations_url":"https://api.github.com/users/KiiPlatform/orgs","repos_url":"https://api.github.com/users/KiiPlatform/repos","events_url":"https://api.github.com/users/KiiPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/KiiPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KiiPlatform/thing-if-iOSSDK","description":"","fork":false,"url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK","forks_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/forks","keys_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/teams","hooks_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/hooks","issue_events_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/issues/events{/number}","events_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/events","assignees_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/assignees{/user}","branches_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/branches{/branch}","tags_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/tags","blobs_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/statuses/{sha}","languages_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/languages","stargazers_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/stargazers","contributors_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/contributors","subscribers_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/subscribers","subscription_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/subscription","commits_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/contents/{+path}","compare_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/merges","archive_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/downloads","issues_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/issues{/number}","pulls_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls{/number}","milestones_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/milestones{/number}","notifications_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/labels{/name}","releases_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/releases{/id}","deployments_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/deployments","created_at":"2015-08-03T02:37:23Z","updated_at":"2016-05-10T07:24:38Z","pushed_at":"2016-05-19T04:21:51Z","git_url":"git://github.com/KiiPlatform/thing-if-iOSSDK.git","ssh_url":"git@github.com:KiiPlatform/thing-if-iOSSDK.git","clone_url":"https://github.com/KiiPlatform/thing-if-iOSSDK.git","svn_url":"https://github.com/KiiPlatform/thing-if-iOSSDK","homepage":null,"size":4981,"stargazers_count":2,"watchers_count":2,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":2,"default_branch":"master"}},"base":{"label":"KiiPlatform:develop","ref":"develop","sha":"946dbf9a47a7d024ee12997c02c878ef4d14cb85","user":{"login":"KiiPlatform","id":3078752,"avatar_url":"https://avatars.githubusercontent.com/u/3078752?v=3","gravatar_id":"","url":"https://api.github.com/users/KiiPlatform","html_url":"https://github.com/KiiPlatform","followers_url":"https://api.github.com/users/KiiPlatform/followers","following_url":"https://api.github.com/users/KiiPlatform/following{/other_user}","gists_url":"https://api.github.com/users/KiiPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/KiiPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiiPlatform/subscriptions","organizations_url":"https://api.github.com/users/KiiPlatform/orgs","repos_url":"https://api.github.com/users/KiiPlatform/repos","events_url":"https://api.github.com/users/KiiPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/KiiPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":40101539,"name":"thing-if-iOSSDK","full_name":"KiiPlatform/thing-if-iOSSDK","owner":{"login":"KiiPlatform","id":3078752,"avatar_url":"https://avatars.githubusercontent.com/u/3078752?v=3","gravatar_id":"","url":"https://api.github.com/users/KiiPlatform","html_url":"https://github.com/KiiPlatform","followers_url":"https://api.github.com/users/KiiPlatform/followers","following_url":"https://api.github.com/users/KiiPlatform/following{/other_user}","gists_url":"https://api.github.com/users/KiiPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/KiiPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KiiPlatform/subscriptions","organizations_url":"https://api.github.com/users/KiiPlatform/orgs","repos_url":"https://api.github.com/users/KiiPlatform/repos","events_url":"https://api.github.com/users/KiiPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/KiiPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KiiPlatform/thing-if-iOSSDK","description":"","fork":false,"url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK","forks_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/forks","keys_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/teams","hooks_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/hooks","issue_events_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/issues/events{/number}","events_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/events","assignees_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/assignees{/user}","branches_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/branches{/branch}","tags_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/tags","blobs_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/git/refs{/sha}","trees_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/statuses/{sha}","languages_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/languages","stargazers_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/stargazers","contributors_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/contributors","subscribers_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/subscribers","subscription_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/subscription","commits_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/commits{/sha}","git_commits_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/git/commits{/sha}","comments_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/comments{/number}","issue_comment_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/issues/comments{/number}","contents_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/contents/{+path}","compare_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/merges","archive_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/downloads","issues_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/issues{/number}","pulls_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls{/number}","milestones_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/milestones{/number}","notifications_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/labels{/name}","releases_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/releases{/id}","deployments_url":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/deployments","created_at":"2015-08-03T02:37:23Z","updated_at":"2016-05-10T07:24:38Z","pushed_at":"2016-05-19T04:21:51Z","git_url":"git://github.com/KiiPlatform/thing-if-iOSSDK.git","ssh_url":"git@github.com:KiiPlatform/thing-if-iOSSDK.git","clone_url":"https://github.com/KiiPlatform/thing-if-iOSSDK.git","svn_url":"https://github.com/KiiPlatform/thing-if-iOSSDK","homepage":null,"size":4981,"stargazers_count":2,"watchers_count":2,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":5,"forks":10,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/111"},"html":{"href":"https://github.com/KiiPlatform/thing-if-iOSSDK/pull/111"},"issue":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/issues/111"},"comments":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/KiiPlatform/thing-if-iOSSDK/statuses/312b66fa269f075e72813b0578d18b5f905362a3"}}}}