{"action":"created","comment":{"url":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/comments/59885879","id":59885879,"diff_hunk":"@@ -0,0 +1,139 @@\n+module Dnsimple\n+  class Client\n+    module Templates\n+\n+      # Lists the templates in the account.\n+      #\n+      # @see https://developer.dnsimple.com/v2/templates/#list\n+      #\n+      # @example List the templates for account 1010:\n+      #   client.templates.list_templates(1010)\n+      #\n+      # @param  [Fixnum] account_id the account ID\n+      # @param  [Hash] options\n+      # @return [Dnsimple::PaginatedResponse<Dnsimple::Struct::Template>]\n+      #\n+      # @raise  [RequestError] When the request fails.\n+      def templates(account_id, options = {})\n+        endpoint = Client.versioned(\"/%s/templates\" % [account_id])\n+        response = client.get(endpoint, options)\n+\n+        Dnsimple::PaginatedResponse.new(response, response[\"data\"].map { |r| Struct::Template.new(r) })\n+      end\n+      alias list templates\n+      alias list_templates templates\n+\n+      # Lists ALL the templates in the account.\n+      #\n+      # This method is similar to {#templates}, but instead of returning the results of a specific page\n+      # it iterates all the pages and returns the entire collection.\n+      #\n+      # Please use this method carefully, as fetching the entire collection will increase the number of\n+      # requests you send to the API server and you may eventually risk to hit the throttle limit.\n+      #\n+      # @example List all the templates for account 1010:\n+      #   client.all_templates.list_templates(1010)\n+      #\n+      # @see https://developer.dnsimple.com/v2/templates/#list\n+      # @see #templates\n+      #\n+      # @param  [Fixnum] account_id the account ID\n+      # @param  [Hash] options\n+      # @return [Dnsimple::PaginatedResponse<Dnsimple::Struct::Template>]\n+      #\n+      # @raise  [RequestError] When the request fails.\n+      def all_templates(account_id, options = {})\n+        paginate(:templates, account_id, options)\n+      end\n+      alias all all_templates\n+\n+      # Creates a template in the account.\n+      #\n+      # @see https://developer.dnsimple.com/v2/templates/#create\n+      #\n+      # @example Creating a template:\n+      #   client.templates.create_template(1010, name: \"Pi\", short_name: \"pi\", description: \"Pi template\")\n+      #\n+      # @param  [Fixnum] account_id the account ID\n+      # @param  [Hash] attributes\n+      # @param  [Hash] options\n+      # @return [Dnsimple::Response<Dnsimple::Struct::Template>]\n+      #\n+      # @raise  [Dnsimple::RequestError]\n+      def create_template(account_id, attributes, options = {})\n+        endpoint = Client.versioned(\"/%s/templates\" % [account_id])\n+        response = client.post(endpoint, attributes, options)\n+\n+        Dnsimple::Response.new(response, Struct::Template.new(response[\"data\"]))\n+      end\n+      alias template create_template\n+\n+      # Gets the template with specified ID.\n+      #\n+      # @see https://developer.dnsimple.com/v2/templates/#get\n+      #\n+      # @example Get template 5401 in account 1010:\n+      #   client.templates.template(1010, 5401)\n+      #\n+      # @param  [Fixnum] account_id the account ID\n+      # @param  [Fixnum] template_id the template ID","path":"lib/dnsimple/client/templates.rb","position":79,"original_position":79,"commit_id":"07a62fbe1b3c344a617e85c1643a507c04ebfeb3","original_commit_id":"07a62fbe1b3c344a617e85c1643a507c04ebfeb3","user":{"login":"weppos","id":5387,"avatar_url":"https://avatars.githubusercontent.com/u/5387?v=3","gravatar_id":"","url":"https://api.github.com/users/weppos","html_url":"https://github.com/weppos","followers_url":"https://api.github.com/users/weppos/followers","following_url":"https://api.github.com/users/weppos/following{/other_user}","gists_url":"https://api.github.com/users/weppos/gists{/gist_id}","starred_url":"https://api.github.com/users/weppos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weppos/subscriptions","organizations_url":"https://api.github.com/users/weppos/orgs","repos_url":"https://api.github.com/users/weppos/repos","events_url":"https://api.github.com/users/weppos/events{/privacy}","received_events_url":"https://api.github.com/users/weppos/received_events","type":"User","site_admin":false},"body":"In fact, in the `delete` you used\r\n\r\n    [#to_s] template_id The template ID","created_at":"2016-04-15T14:48:54Z","updated_at":"2016-04-15T14:48:54Z","html_url":"https://github.com/aetrion/dnsimple-ruby/pull/99#discussion_r59885879","pull_request_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/99","_links":{"self":{"href":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/comments/59885879"},"html":{"href":"https://github.com/aetrion/dnsimple-ruby/pull/99#discussion_r59885879"},"pull_request":{"href":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/99"}}},"pull_request":{"url":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/99","id":66644346,"html_url":"https://github.com/aetrion/dnsimple-ruby/pull/99","diff_url":"https://github.com/aetrion/dnsimple-ruby/pull/99.diff","patch_url":"https://github.com/aetrion/dnsimple-ruby/pull/99.patch","issue_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/issues/99","number":99,"state":"open","locked":false,"title":"Implement template actions","user":{"login":"jacegu","id":381143,"avatar_url":"https://avatars.githubusercontent.com/u/381143?v=3","gravatar_id":"","url":"https://api.github.com/users/jacegu","html_url":"https://github.com/jacegu","followers_url":"https://api.github.com/users/jacegu/followers","following_url":"https://api.github.com/users/jacegu/following{/other_user}","gists_url":"https://api.github.com/users/jacegu/gists{/gist_id}","starred_url":"https://api.github.com/users/jacegu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacegu/subscriptions","organizations_url":"https://api.github.com/users/jacegu/orgs","repos_url":"https://api.github.com/users/jacegu/repos","events_url":"https://api.github.com/users/jacegu/events{/privacy}","received_events_url":"https://api.github.com/users/jacegu/received_events","type":"User","site_admin":false},"body":"Add supports for actions described in: https://developer.dnsimple.com/v2/templates","created_at":"2016-04-15T13:43:19Z","updated_at":"2016-04-15T14:48:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"966a516fd9f59077c7f74753cfb3849f5d07e0dc","assignee":{"login":"jacegu","id":381143,"avatar_url":"https://avatars.githubusercontent.com/u/381143?v=3","gravatar_id":"","url":"https://api.github.com/users/jacegu","html_url":"https://github.com/jacegu","followers_url":"https://api.github.com/users/jacegu/followers","following_url":"https://api.github.com/users/jacegu/following{/other_user}","gists_url":"https://api.github.com/users/jacegu/gists{/gist_id}","starred_url":"https://api.github.com/users/jacegu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacegu/subscriptions","organizations_url":"https://api.github.com/users/jacegu/orgs","repos_url":"https://api.github.com/users/jacegu/repos","events_url":"https://api.github.com/users/jacegu/events{/privacy}","received_events_url":"https://api.github.com/users/jacegu/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/99/commits","review_comments_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/99/comments","review_comment_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/issues/99/comments","statuses_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/statuses/07a62fbe1b3c344a617e85c1643a507c04ebfeb3","head":{"label":"aetrion:feature/templates","ref":"feature/templates","sha":"07a62fbe1b3c344a617e85c1643a507c04ebfeb3","user":{"login":"aetrion","id":323774,"avatar_url":"https://avatars.githubusercontent.com/u/323774?v=3","gravatar_id":"","url":"https://api.github.com/users/aetrion","html_url":"https://github.com/aetrion","followers_url":"https://api.github.com/users/aetrion/followers","following_url":"https://api.github.com/users/aetrion/following{/other_user}","gists_url":"https://api.github.com/users/aetrion/gists{/gist_id}","starred_url":"https://api.github.com/users/aetrion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aetrion/subscriptions","organizations_url":"https://api.github.com/users/aetrion/orgs","repos_url":"https://api.github.com/users/aetrion/repos","events_url":"https://api.github.com/users/aetrion/events{/privacy}","received_events_url":"https://api.github.com/users/aetrion/received_events","type":"Organization","site_admin":false},"repo":{"id":768077,"name":"dnsimple-ruby","full_name":"aetrion/dnsimple-ruby","owner":{"login":"aetrion","id":323774,"avatar_url":"https://avatars.githubusercontent.com/u/323774?v=3","gravatar_id":"","url":"https://api.github.com/users/aetrion","html_url":"https://github.com/aetrion","followers_url":"https://api.github.com/users/aetrion/followers","following_url":"https://api.github.com/users/aetrion/following{/other_user}","gists_url":"https://api.github.com/users/aetrion/gists{/gist_id}","starred_url":"https://api.github.com/users/aetrion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aetrion/subscriptions","organizations_url":"https://api.github.com/users/aetrion/orgs","repos_url":"https://api.github.com/users/aetrion/repos","events_url":"https://api.github.com/users/aetrion/events{/privacy}","received_events_url":"https://api.github.com/users/aetrion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aetrion/dnsimple-ruby","description":"The DNSimple API client for Ruby.","fork":false,"url":"https://api.github.com/repos/aetrion/dnsimple-ruby","forks_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/forks","keys_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/teams","hooks_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/hooks","issue_events_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/events","assignees_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/tags","blobs_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/languages","stargazers_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/stargazers","contributors_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/contributors","subscribers_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/subscribers","subscription_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/subscription","commits_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/merges","archive_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/downloads","issues_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/labels{/name}","releases_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/deployments","created_at":"2010-07-10T20:48:48Z","updated_at":"2016-03-21T21:44:46Z","pushed_at":"2016-04-15T14:24:07Z","git_url":"git://github.com/aetrion/dnsimple-ruby.git","ssh_url":"git@github.com:aetrion/dnsimple-ruby.git","clone_url":"https://github.com/aetrion/dnsimple-ruby.git","svn_url":"https://github.com/aetrion/dnsimple-ruby","homepage":"https://developer.dnsimple.com","size":1049,"stargazers_count":125,"watchers_count":125,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":5,"forks":43,"open_issues":5,"watchers":125,"default_branch":"master"}},"base":{"label":"aetrion:master","ref":"master","sha":"930ad2fcce9158e236e2b4c573dfd90df765cf09","user":{"login":"aetrion","id":323774,"avatar_url":"https://avatars.githubusercontent.com/u/323774?v=3","gravatar_id":"","url":"https://api.github.com/users/aetrion","html_url":"https://github.com/aetrion","followers_url":"https://api.github.com/users/aetrion/followers","following_url":"https://api.github.com/users/aetrion/following{/other_user}","gists_url":"https://api.github.com/users/aetrion/gists{/gist_id}","starred_url":"https://api.github.com/users/aetrion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aetrion/subscriptions","organizations_url":"https://api.github.com/users/aetrion/orgs","repos_url":"https://api.github.com/users/aetrion/repos","events_url":"https://api.github.com/users/aetrion/events{/privacy}","received_events_url":"https://api.github.com/users/aetrion/received_events","type":"Organization","site_admin":false},"repo":{"id":768077,"name":"dnsimple-ruby","full_name":"aetrion/dnsimple-ruby","owner":{"login":"aetrion","id":323774,"avatar_url":"https://avatars.githubusercontent.com/u/323774?v=3","gravatar_id":"","url":"https://api.github.com/users/aetrion","html_url":"https://github.com/aetrion","followers_url":"https://api.github.com/users/aetrion/followers","following_url":"https://api.github.com/users/aetrion/following{/other_user}","gists_url":"https://api.github.com/users/aetrion/gists{/gist_id}","starred_url":"https://api.github.com/users/aetrion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aetrion/subscriptions","organizations_url":"https://api.github.com/users/aetrion/orgs","repos_url":"https://api.github.com/users/aetrion/repos","events_url":"https://api.github.com/users/aetrion/events{/privacy}","received_events_url":"https://api.github.com/users/aetrion/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aetrion/dnsimple-ruby","description":"The DNSimple API client for Ruby.","fork":false,"url":"https://api.github.com/repos/aetrion/dnsimple-ruby","forks_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/forks","keys_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/teams","hooks_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/hooks","issue_events_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/issues/events{/number}","events_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/events","assignees_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/assignees{/user}","branches_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/branches{/branch}","tags_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/tags","blobs_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/git/refs{/sha}","trees_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/statuses/{sha}","languages_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/languages","stargazers_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/stargazers","contributors_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/contributors","subscribers_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/subscribers","subscription_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/subscription","commits_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/commits{/sha}","git_commits_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/git/commits{/sha}","comments_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/comments{/number}","issue_comment_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/issues/comments{/number}","contents_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/contents/{+path}","compare_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/merges","archive_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/downloads","issues_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/issues{/number}","pulls_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls{/number}","milestones_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/milestones{/number}","notifications_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/labels{/name}","releases_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/releases{/id}","deployments_url":"https://api.github.com/repos/aetrion/dnsimple-ruby/deployments","created_at":"2010-07-10T20:48:48Z","updated_at":"2016-03-21T21:44:46Z","pushed_at":"2016-04-15T14:24:07Z","git_url":"git://github.com/aetrion/dnsimple-ruby.git","ssh_url":"git@github.com:aetrion/dnsimple-ruby.git","clone_url":"https://github.com/aetrion/dnsimple-ruby.git","svn_url":"https://github.com/aetrion/dnsimple-ruby","homepage":"https://developer.dnsimple.com","size":1049,"stargazers_count":125,"watchers_count":125,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":43,"mirror_url":null,"open_issues_count":5,"forks":43,"open_issues":5,"watchers":125,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/99"},"html":{"href":"https://github.com/aetrion/dnsimple-ruby/pull/99"},"issue":{"href":"https://api.github.com/repos/aetrion/dnsimple-ruby/issues/99"},"comments":{"href":"https://api.github.com/repos/aetrion/dnsimple-ruby/issues/99/comments"},"review_comments":{"href":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/99/comments"},"review_comment":{"href":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aetrion/dnsimple-ruby/pulls/99/commits"},"statuses":{"href":"https://api.github.com/repos/aetrion/dnsimple-ruby/statuses/07a62fbe1b3c344a617e85c1643a507c04ebfeb3"}}}}