{"action":"created","comment":{"url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/comments/56664862","id":56664862,"diff_hunk":"@@ -0,0 +1,79 @@\n+module Nexpose\n+# Constants useful across the Nexpose module.\n+# Configuration structure for scheduled backups.\n+  class ScheduledBackup < APIObject\n+    require 'json'\n+    include JsonSerializer\n+\n+    # Whether or not this schedule is enabled.\n+    attr_accessor :enabled\n+    # Valid schedule types: daily, hourly, monthly-date, monthly-day, weekly.\n+    attr_accessor :schedule_type\n+    # The repeat interval based upon type.\n+    attr_accessor :schedule_interval\n+    # The earliest date to generate the report on (in ISO 8601 format).\n+    attr_accessor :schedule_start\n+    # The description of the backup\n+    attr_accessor :description\n+    # Whether the backup will be platform independent or not\n+    attr_accessor :platform_independent\n+    # Whether the backup should pause all local scans or wait for local scans to complete.\n+    attr_accessor :pause_local_scans\n+    # Cancellation window in minutes for scheduled DB maintenance.\n+    attr_accessor :cancellation_period\n+\n+    def initialize(start, enabled=true, type, interval, platform_independent, description, pause_local_scans, cancellation_period)\n+      @schedule_start = start\n+      @enabled = enabled\n+      @schedule_type = type\n+      @schedule_interval = interval.to_i\n+      @platform_independent = platform_independent\n+      @description = description\n+      @pause_local_scans = pause_local_scans\n+      @cancellation_period = cancellation_period.to_i\n+    end\n+\n+    def to_json\n+      JSON.generate(to_h)\n+    end\n+\n+    def save(nsc)\n+      params = to_json\n+      AJAX.post(nsc, '/api/2.1/schedule_backup/', params, AJAX::CONTENT_TYPE::JSON)\n+    end\n+\n+    def self.from_hash(hash)\n+      repeat_backup_hash = hash[:repeat_type]\n+      backup = new(hash[:start_date], hash[:enabled], repeat_backup_hash[:type], repeat_backup_hash[:interval], hash[:platform_independent], hash[:description], hash[:pause_local_scans], hash[:cancellation_period])","path":"lib/nexpose/scheduled_backup.rb","position":47,"original_position":47,"commit_id":"daa10132ecea49e5c5262371c63f47a4a4ac24e3","original_commit_id":"daa10132ecea49e5c5262371c63f47a4a4ac24e3","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Line is too long. [214/120]","created_at":"2016-03-18T14:35:33Z","updated_at":"2016-03-18T14:35:33Z","html_url":"https://github.com/rapid7/nexpose-client/pull/211#discussion_r56664862","pull_request_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/211","_links":{"self":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/comments/56664862"},"html":{"href":"https://github.com/rapid7/nexpose-client/pull/211#discussion_r56664862"},"pull_request":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/211"}}},"pull_request":{"url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/211","id":63382994,"html_url":"https://github.com/rapid7/nexpose-client/pull/211","diff_url":"https://github.com/rapid7/nexpose-client/pull/211.diff","patch_url":"https://github.com/rapid7/nexpose-client/pull/211.patch","issue_url":"https://api.github.com/repos/rapid7/nexpose-client/issues/211","number":211,"state":"open","locked":false,"title":"Scheduled Backup and Maintenance ","user":{"login":"dmurray-r7","id":8793746,"avatar_url":"https://avatars.githubusercontent.com/u/8793746?v=3","gravatar_id":"","url":"https://api.github.com/users/dmurray-r7","html_url":"https://github.com/dmurray-r7","followers_url":"https://api.github.com/users/dmurray-r7/followers","following_url":"https://api.github.com/users/dmurray-r7/following{/other_user}","gists_url":"https://api.github.com/users/dmurray-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/dmurray-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmurray-r7/subscriptions","organizations_url":"https://api.github.com/users/dmurray-r7/orgs","repos_url":"https://api.github.com/users/dmurray-r7/repos","events_url":"https://api.github.com/users/dmurray-r7/events{/privacy}","received_events_url":"https://api.github.com/users/dmurray-r7/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-18T14:35:27Z","updated_at":"2016-03-18T14:35:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"21cad6459dbfe938a8be070f3cf7ecf3c3057abf","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/211/commits","review_comments_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/211/comments","review_comment_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rapid7/nexpose-client/issues/211/comments","statuses_url":"https://api.github.com/repos/rapid7/nexpose-client/statuses/daa10132ecea49e5c5262371c63f47a4a4ac24e3","head":{"label":"gsayers-r7:master","ref":"master","sha":"daa10132ecea49e5c5262371c63f47a4a4ac24e3","user":{"login":"gsayers-r7","id":9006462,"avatar_url":"https://avatars.githubusercontent.com/u/9006462?v=3","gravatar_id":"","url":"https://api.github.com/users/gsayers-r7","html_url":"https://github.com/gsayers-r7","followers_url":"https://api.github.com/users/gsayers-r7/followers","following_url":"https://api.github.com/users/gsayers-r7/following{/other_user}","gists_url":"https://api.github.com/users/gsayers-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/gsayers-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsayers-r7/subscriptions","organizations_url":"https://api.github.com/users/gsayers-r7/orgs","repos_url":"https://api.github.com/users/gsayers-r7/repos","events_url":"https://api.github.com/users/gsayers-r7/events{/privacy}","received_events_url":"https://api.github.com/users/gsayers-r7/received_events","type":"User","site_admin":false},"repo":{"id":52017039,"name":"nexpose-client","full_name":"gsayers-r7/nexpose-client","owner":{"login":"gsayers-r7","id":9006462,"avatar_url":"https://avatars.githubusercontent.com/u/9006462?v=3","gravatar_id":"","url":"https://api.github.com/users/gsayers-r7","html_url":"https://github.com/gsayers-r7","followers_url":"https://api.github.com/users/gsayers-r7/followers","following_url":"https://api.github.com/users/gsayers-r7/following{/other_user}","gists_url":"https://api.github.com/users/gsayers-r7/gists{/gist_id}","starred_url":"https://api.github.com/users/gsayers-r7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsayers-r7/subscriptions","organizations_url":"https://api.github.com/users/gsayers-r7/orgs","repos_url":"https://api.github.com/users/gsayers-r7/repos","events_url":"https://api.github.com/users/gsayers-r7/events{/privacy}","received_events_url":"https://api.github.com/users/gsayers-r7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gsayers-r7/nexpose-client","description":"Rapid7 Nexpose API client library written in Ruby","fork":true,"url":"https://api.github.com/repos/gsayers-r7/nexpose-client","forks_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/forks","keys_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/teams","hooks_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/hooks","issue_events_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/issues/events{/number}","events_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/events","assignees_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/assignees{/user}","branches_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/branches{/branch}","tags_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/tags","blobs_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/statuses/{sha}","languages_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/languages","stargazers_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/stargazers","contributors_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/contributors","subscribers_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/subscribers","subscription_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/subscription","commits_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/contents/{+path}","compare_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/merges","archive_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/downloads","issues_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/issues{/number}","pulls_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/pulls{/number}","milestones_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/milestones{/number}","notifications_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/labels{/name}","releases_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/releases{/id}","deployments_url":"https://api.github.com/repos/gsayers-r7/nexpose-client/deployments","created_at":"2016-02-18T15:26:52Z","updated_at":"2016-02-18T15:26:53Z","pushed_at":"2016-03-18T12:31:36Z","git_url":"git://github.com/gsayers-r7/nexpose-client.git","ssh_url":"git@github.com:gsayers-r7/nexpose-client.git","clone_url":"https://github.com/gsayers-r7/nexpose-client.git","svn_url":"https://github.com/gsayers-r7/nexpose-client","homepage":"http://www.rapid7.com/","size":1103,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"rapid7:master","ref":"master","sha":"c7f976c58229b80057ea158ec48c2c603e7cf1c5","user":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"repo":{"id":2622467,"name":"nexpose-client","full_name":"rapid7/nexpose-client","owner":{"login":"rapid7","id":1013671,"avatar_url":"https://avatars.githubusercontent.com/u/1013671?v=3","gravatar_id":"","url":"https://api.github.com/users/rapid7","html_url":"https://github.com/rapid7","followers_url":"https://api.github.com/users/rapid7/followers","following_url":"https://api.github.com/users/rapid7/following{/other_user}","gists_url":"https://api.github.com/users/rapid7/gists{/gist_id}","starred_url":"https://api.github.com/users/rapid7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rapid7/subscriptions","organizations_url":"https://api.github.com/users/rapid7/orgs","repos_url":"https://api.github.com/users/rapid7/repos","events_url":"https://api.github.com/users/rapid7/events{/privacy}","received_events_url":"https://api.github.com/users/rapid7/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rapid7/nexpose-client","description":"Rapid7 Nexpose API client library written in Ruby","fork":false,"url":"https://api.github.com/repos/rapid7/nexpose-client","forks_url":"https://api.github.com/repos/rapid7/nexpose-client/forks","keys_url":"https://api.github.com/repos/rapid7/nexpose-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rapid7/nexpose-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rapid7/nexpose-client/teams","hooks_url":"https://api.github.com/repos/rapid7/nexpose-client/hooks","issue_events_url":"https://api.github.com/repos/rapid7/nexpose-client/issues/events{/number}","events_url":"https://api.github.com/repos/rapid7/nexpose-client/events","assignees_url":"https://api.github.com/repos/rapid7/nexpose-client/assignees{/user}","branches_url":"https://api.github.com/repos/rapid7/nexpose-client/branches{/branch}","tags_url":"https://api.github.com/repos/rapid7/nexpose-client/tags","blobs_url":"https://api.github.com/repos/rapid7/nexpose-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rapid7/nexpose-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rapid7/nexpose-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/rapid7/nexpose-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rapid7/nexpose-client/statuses/{sha}","languages_url":"https://api.github.com/repos/rapid7/nexpose-client/languages","stargazers_url":"https://api.github.com/repos/rapid7/nexpose-client/stargazers","contributors_url":"https://api.github.com/repos/rapid7/nexpose-client/contributors","subscribers_url":"https://api.github.com/repos/rapid7/nexpose-client/subscribers","subscription_url":"https://api.github.com/repos/rapid7/nexpose-client/subscription","commits_url":"https://api.github.com/repos/rapid7/nexpose-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/rapid7/nexpose-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/rapid7/nexpose-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/rapid7/nexpose-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/rapid7/nexpose-client/contents/{+path}","compare_url":"https://api.github.com/repos/rapid7/nexpose-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rapid7/nexpose-client/merges","archive_url":"https://api.github.com/repos/rapid7/nexpose-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rapid7/nexpose-client/downloads","issues_url":"https://api.github.com/repos/rapid7/nexpose-client/issues{/number}","pulls_url":"https://api.github.com/repos/rapid7/nexpose-client/pulls{/number}","milestones_url":"https://api.github.com/repos/rapid7/nexpose-client/milestones{/number}","notifications_url":"https://api.github.com/repos/rapid7/nexpose-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rapid7/nexpose-client/labels{/name}","releases_url":"https://api.github.com/repos/rapid7/nexpose-client/releases{/id}","deployments_url":"https://api.github.com/repos/rapid7/nexpose-client/deployments","created_at":"2011-10-21T19:04:49Z","updated_at":"2016-03-15T03:18:03Z","pushed_at":"2016-03-18T14:35:27Z","git_url":"git://github.com/rapid7/nexpose-client.git","ssh_url":"git@github.com:rapid7/nexpose-client.git","clone_url":"https://github.com/rapid7/nexpose-client.git","svn_url":"https://github.com/rapid7/nexpose-client","homepage":"http://www.rapid7.com/","size":1554,"stargazers_count":95,"watchers_count":95,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"open_issues_count":8,"forks":68,"open_issues":8,"watchers":95,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/211"},"html":{"href":"https://github.com/rapid7/nexpose-client/pull/211"},"issue":{"href":"https://api.github.com/repos/rapid7/nexpose-client/issues/211"},"comments":{"href":"https://api.github.com/repos/rapid7/nexpose-client/issues/211/comments"},"review_comments":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/211/comments"},"review_comment":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rapid7/nexpose-client/pulls/211/commits"},"statuses":{"href":"https://api.github.com/repos/rapid7/nexpose-client/statuses/daa10132ecea49e5c5262371c63f47a4a4ac24e3"}}}}