{"action":"created","comment":{"url":"https://api.github.com/repos/yola/sitewit/pulls/comments/27036735","id":27036735,"diff_hunk":"@@ -0,0 +1,65 @@\n+import json\n+\n+from sitewit.services import SitewitService\n+\n+\n+class User(object):\n+    def __init__(self, name, email, token=None):\n+        self.name = name\n+        self.email = email\n+        self.token = token\n+\n+\n+class Account(object):\n+    _sitewitservice = None\n+    DEFAULT_TIME_ZONE = 'Pacific Standard Time'\n+\n+    def __init__(self, account_data, user_data=None):\n+        self.id = account_data.get('accountNumber')\n+        self.token = account_data.get('token')\n+        self.status = account_data.get('status')\n+        self.url = account_data.get('url')\n+        self.time_zone = account_data.get('timeZone', self.DEFAULT_TIME_ZONE)\n+        self.site_id = account_data.get('clientId')\n+        self.password = account_data.get('password')\n+        self.currency = account_data.get('currency')\n+        self.country_code = account_data.get('country')\n+\n+        if user_data is not None:\n+            self.user = User(user_data['name'], user_data['email'],\n+                             user_data['token'])\n+\n+    @classmethod\n+    def get_service(cls):\n+        if cls._sitewitservice is None:\n+            cls._sitewitservice = SitewitService()\n+        return cls._sitewitservice\n+\n+    @classmethod\n+    def create(cls, user, site, url, password, user_token=None):\n+        \"\"\" Create SiteWit account for site.\n+        user: yousers.models.User instance;\n+        site: yosites.models.Site instance;\n+\n+        Returns:\n+            Instance of Account class.\n+        \"\"\"\n+        result = cls.get_service().create_account(\n+            site.id, url, user.name, user.email, password,\n+            cls.DEFAULT_TIME_ZONE, user.currency, user.location,","path":"sitewit/models.py","position":49,"original_position":49,"commit_id":"7aec7d0abfff6e252094547a95245e446ff7021b","original_commit_id":"7aec7d0abfff6e252094547a95245e446ff7021b","user":{"login":"RayeN","id":712948,"avatar_url":"https://avatars.githubusercontent.com/u/712948?v=3","gravatar_id":"","url":"https://api.github.com/users/RayeN","html_url":"https://github.com/RayeN","followers_url":"https://api.github.com/users/RayeN/followers","following_url":"https://api.github.com/users/RayeN/following{/other_user}","gists_url":"https://api.github.com/users/RayeN/gists{/gist_id}","starred_url":"https://api.github.com/users/RayeN/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RayeN/subscriptions","organizations_url":"https://api.github.com/users/RayeN/orgs","repos_url":"https://api.github.com/users/RayeN/repos","events_url":"https://api.github.com/users/RayeN/events{/privacy}","received_events_url":"https://api.github.com/users/RayeN/received_events","type":"User","site_admin":false},"body":"right, I wouldn't update time_zone as well.","created_at":"2015-03-24T15:09:34Z","updated_at":"2015-03-24T15:09:34Z","html_url":"https://github.com/yola/sitewit/pull/3#discussion_r27036735","pull_request_url":"https://api.github.com/repos/yola/sitewit/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/yola/sitewit/pulls/comments/27036735"},"html":{"href":"https://github.com/yola/sitewit/pull/3#discussion_r27036735"},"pull_request":{"href":"https://api.github.com/repos/yola/sitewit/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/yola/sitewit/pulls/3","id":31730236,"html_url":"https://github.com/yola/sitewit/pull/3","diff_url":"https://github.com/yola/sitewit/pull/3.diff","patch_url":"https://github.com/yola/sitewit/pull/3.patch","issue_url":"https://api.github.com/repos/yola/sitewit/issues/3","number":3,"state":"open","locked":false,"title":"Initial commit of SiteWit RESTful API client.","user":{"login":"ekoval","id":954264,"avatar_url":"https://avatars.githubusercontent.com/u/954264?v=3","gravatar_id":"","url":"https://api.github.com/users/ekoval","html_url":"https://github.com/ekoval","followers_url":"https://api.github.com/users/ekoval/followers","following_url":"https://api.github.com/users/ekoval/following{/other_user}","gists_url":"https://api.github.com/users/ekoval/gists{/gist_id}","starred_url":"https://api.github.com/users/ekoval/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ekoval/subscriptions","organizations_url":"https://api.github.com/users/ekoval/orgs","repos_url":"https://api.github.com/users/ekoval/repos","events_url":"https://api.github.com/users/ekoval/events{/privacy}","received_events_url":"https://api.github.com/users/ekoval/received_events","type":"User","site_admin":false},"body":"Initial commit of SiteWit RESTful API client. It is published so early to get early feedback regarding approach.","created_at":"2015-03-23T13:12:04Z","updated_at":"2015-03-24T15:09:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b7bf624541145287ef9e27059ea07a33dbc95fc9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yola/sitewit/pulls/3/commits","review_comments_url":"https://api.github.com/repos/yola/sitewit/pulls/3/comments","review_comment_url":"https://api.github.com/repos/yola/sitewit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yola/sitewit/issues/3/comments","statuses_url":"https://api.github.com/repos/yola/sitewit/statuses/7aec7d0abfff6e252094547a95245e446ff7021b","head":{"label":"yola:create-rest-api-client","ref":"create-rest-api-client","sha":"7aec7d0abfff6e252094547a95245e446ff7021b","user":{"login":"yola","id":861497,"avatar_url":"https://avatars.githubusercontent.com/u/861497?v=3","gravatar_id":"","url":"https://api.github.com/users/yola","html_url":"https://github.com/yola","followers_url":"https://api.github.com/users/yola/followers","following_url":"https://api.github.com/users/yola/following{/other_user}","gists_url":"https://api.github.com/users/yola/gists{/gist_id}","starred_url":"https://api.github.com/users/yola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yola/subscriptions","organizations_url":"https://api.github.com/users/yola/orgs","repos_url":"https://api.github.com/users/yola/repos","events_url":"https://api.github.com/users/yola/events{/privacy}","received_events_url":"https://api.github.com/users/yola/received_events","type":"Organization","site_admin":false},"repo":{"id":15058701,"name":"sitewit","full_name":"yola/sitewit","owner":{"login":"yola","id":861497,"avatar_url":"https://avatars.githubusercontent.com/u/861497?v=3","gravatar_id":"","url":"https://api.github.com/users/yola","html_url":"https://github.com/yola","followers_url":"https://api.github.com/users/yola/followers","following_url":"https://api.github.com/users/yola/following{/other_user}","gists_url":"https://api.github.com/users/yola/gists{/gist_id}","starred_url":"https://api.github.com/users/yola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yola/subscriptions","organizations_url":"https://api.github.com/users/yola/orgs","repos_url":"https://api.github.com/users/yola/repos","events_url":"https://api.github.com/users/yola/events{/privacy}","received_events_url":"https://api.github.com/users/yola/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yola/sitewit","description":"SiteWit Python client","fork":false,"url":"https://api.github.com/repos/yola/sitewit","forks_url":"https://api.github.com/repos/yola/sitewit/forks","keys_url":"https://api.github.com/repos/yola/sitewit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yola/sitewit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yola/sitewit/teams","hooks_url":"https://api.github.com/repos/yola/sitewit/hooks","issue_events_url":"https://api.github.com/repos/yola/sitewit/issues/events{/number}","events_url":"https://api.github.com/repos/yola/sitewit/events","assignees_url":"https://api.github.com/repos/yola/sitewit/assignees{/user}","branches_url":"https://api.github.com/repos/yola/sitewit/branches{/branch}","tags_url":"https://api.github.com/repos/yola/sitewit/tags","blobs_url":"https://api.github.com/repos/yola/sitewit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yola/sitewit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yola/sitewit/git/refs{/sha}","trees_url":"https://api.github.com/repos/yola/sitewit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yola/sitewit/statuses/{sha}","languages_url":"https://api.github.com/repos/yola/sitewit/languages","stargazers_url":"https://api.github.com/repos/yola/sitewit/stargazers","contributors_url":"https://api.github.com/repos/yola/sitewit/contributors","subscribers_url":"https://api.github.com/repos/yola/sitewit/subscribers","subscription_url":"https://api.github.com/repos/yola/sitewit/subscription","commits_url":"https://api.github.com/repos/yola/sitewit/commits{/sha}","git_commits_url":"https://api.github.com/repos/yola/sitewit/git/commits{/sha}","comments_url":"https://api.github.com/repos/yola/sitewit/comments{/number}","issue_comment_url":"https://api.github.com/repos/yola/sitewit/issues/comments{/number}","contents_url":"https://api.github.com/repos/yola/sitewit/contents/{+path}","compare_url":"https://api.github.com/repos/yola/sitewit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yola/sitewit/merges","archive_url":"https://api.github.com/repos/yola/sitewit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yola/sitewit/downloads","issues_url":"https://api.github.com/repos/yola/sitewit/issues{/number}","pulls_url":"https://api.github.com/repos/yola/sitewit/pulls{/number}","milestones_url":"https://api.github.com/repos/yola/sitewit/milestones{/number}","notifications_url":"https://api.github.com/repos/yola/sitewit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yola/sitewit/labels{/name}","releases_url":"https://api.github.com/repos/yola/sitewit/releases{/id}","created_at":"2013-12-09T20:50:03Z","updated_at":"2014-07-16T19:45:02Z","pushed_at":"2015-03-24T14:13:56Z","git_url":"git://github.com/yola/sitewit.git","ssh_url":"git@github.com:yola/sitewit.git","clone_url":"https://github.com/yola/sitewit.git","svn_url":"https://github.com/yola/sitewit","homepage":null,"size":200,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"yola:master","ref":"master","sha":"6de6a3675954ae38435ed21ec1d999f62180fd0b","user":{"login":"yola","id":861497,"avatar_url":"https://avatars.githubusercontent.com/u/861497?v=3","gravatar_id":"","url":"https://api.github.com/users/yola","html_url":"https://github.com/yola","followers_url":"https://api.github.com/users/yola/followers","following_url":"https://api.github.com/users/yola/following{/other_user}","gists_url":"https://api.github.com/users/yola/gists{/gist_id}","starred_url":"https://api.github.com/users/yola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yola/subscriptions","organizations_url":"https://api.github.com/users/yola/orgs","repos_url":"https://api.github.com/users/yola/repos","events_url":"https://api.github.com/users/yola/events{/privacy}","received_events_url":"https://api.github.com/users/yola/received_events","type":"Organization","site_admin":false},"repo":{"id":15058701,"name":"sitewit","full_name":"yola/sitewit","owner":{"login":"yola","id":861497,"avatar_url":"https://avatars.githubusercontent.com/u/861497?v=3","gravatar_id":"","url":"https://api.github.com/users/yola","html_url":"https://github.com/yola","followers_url":"https://api.github.com/users/yola/followers","following_url":"https://api.github.com/users/yola/following{/other_user}","gists_url":"https://api.github.com/users/yola/gists{/gist_id}","starred_url":"https://api.github.com/users/yola/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yola/subscriptions","organizations_url":"https://api.github.com/users/yola/orgs","repos_url":"https://api.github.com/users/yola/repos","events_url":"https://api.github.com/users/yola/events{/privacy}","received_events_url":"https://api.github.com/users/yola/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/yola/sitewit","description":"SiteWit Python client","fork":false,"url":"https://api.github.com/repos/yola/sitewit","forks_url":"https://api.github.com/repos/yola/sitewit/forks","keys_url":"https://api.github.com/repos/yola/sitewit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yola/sitewit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yola/sitewit/teams","hooks_url":"https://api.github.com/repos/yola/sitewit/hooks","issue_events_url":"https://api.github.com/repos/yola/sitewit/issues/events{/number}","events_url":"https://api.github.com/repos/yola/sitewit/events","assignees_url":"https://api.github.com/repos/yola/sitewit/assignees{/user}","branches_url":"https://api.github.com/repos/yola/sitewit/branches{/branch}","tags_url":"https://api.github.com/repos/yola/sitewit/tags","blobs_url":"https://api.github.com/repos/yola/sitewit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yola/sitewit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yola/sitewit/git/refs{/sha}","trees_url":"https://api.github.com/repos/yola/sitewit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yola/sitewit/statuses/{sha}","languages_url":"https://api.github.com/repos/yola/sitewit/languages","stargazers_url":"https://api.github.com/repos/yola/sitewit/stargazers","contributors_url":"https://api.github.com/repos/yola/sitewit/contributors","subscribers_url":"https://api.github.com/repos/yola/sitewit/subscribers","subscription_url":"https://api.github.com/repos/yola/sitewit/subscription","commits_url":"https://api.github.com/repos/yola/sitewit/commits{/sha}","git_commits_url":"https://api.github.com/repos/yola/sitewit/git/commits{/sha}","comments_url":"https://api.github.com/repos/yola/sitewit/comments{/number}","issue_comment_url":"https://api.github.com/repos/yola/sitewit/issues/comments{/number}","contents_url":"https://api.github.com/repos/yola/sitewit/contents/{+path}","compare_url":"https://api.github.com/repos/yola/sitewit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yola/sitewit/merges","archive_url":"https://api.github.com/repos/yola/sitewit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yola/sitewit/downloads","issues_url":"https://api.github.com/repos/yola/sitewit/issues{/number}","pulls_url":"https://api.github.com/repos/yola/sitewit/pulls{/number}","milestones_url":"https://api.github.com/repos/yola/sitewit/milestones{/number}","notifications_url":"https://api.github.com/repos/yola/sitewit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yola/sitewit/labels{/name}","releases_url":"https://api.github.com/repos/yola/sitewit/releases{/id}","created_at":"2013-12-09T20:50:03Z","updated_at":"2014-07-16T19:45:02Z","pushed_at":"2015-03-24T14:13:56Z","git_url":"git://github.com/yola/sitewit.git","ssh_url":"git@github.com:yola/sitewit.git","clone_url":"https://github.com/yola/sitewit.git","svn_url":"https://github.com/yola/sitewit","homepage":null,"size":200,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yola/sitewit/pulls/3"},"html":{"href":"https://github.com/yola/sitewit/pull/3"},"issue":{"href":"https://api.github.com/repos/yola/sitewit/issues/3"},"comments":{"href":"https://api.github.com/repos/yola/sitewit/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/yola/sitewit/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/yola/sitewit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yola/sitewit/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/yola/sitewit/statuses/7aec7d0abfff6e252094547a95245e446ff7021b"}}}}