dnsimple 2.2.0 → 3.0.0.pre.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (244) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +3 -1
  4. data/CHANGELOG.md +13 -2
  5. data/CONTRIBUTING.md +35 -0
  6. data/Gemfile +2 -0
  7. data/LICENSE.txt +1 -1
  8. data/README.md +30 -82
  9. data/dnsimple.gemspec +2 -1
  10. data/lib/dnsimple.rb +0 -2
  11. data/lib/dnsimple/client.rb +64 -64
  12. data/lib/dnsimple/client/clients.rb +82 -58
  13. data/lib/dnsimple/client/contacts.rb +74 -37
  14. data/lib/dnsimple/client/domains.rb +82 -28
  15. data/lib/dnsimple/client/domains_email_forwards.rb +107 -0
  16. data/lib/dnsimple/client/identity.rb +38 -0
  17. data/lib/dnsimple/client/oauth.rb +42 -0
  18. data/lib/dnsimple/client/registrar.rb +64 -72
  19. data/lib/dnsimple/client/registrar_auto_renewal.rb +41 -0
  20. data/lib/dnsimple/client/registrar_whois_privacy.rb +74 -0
  21. data/lib/dnsimple/client/tlds.rb +88 -0
  22. data/lib/dnsimple/client/webhooks.rb +82 -0
  23. data/lib/dnsimple/client/zones.rb +68 -0
  24. data/lib/dnsimple/client/zones_records.rb +127 -0
  25. data/lib/dnsimple/default.rb +10 -17
  26. data/lib/dnsimple/error.rb +5 -8
  27. data/lib/dnsimple/extra.rb +1 -1
  28. data/lib/dnsimple/response.rb +80 -0
  29. data/lib/dnsimple/struct.rb +13 -14
  30. data/lib/dnsimple/struct/account.rb +13 -0
  31. data/lib/dnsimple/struct/contact.rb +6 -3
  32. data/lib/dnsimple/struct/domain.rb +10 -10
  33. data/lib/dnsimple/struct/domain_check.rb +16 -0
  34. data/lib/dnsimple/struct/email_forward.rb +11 -1
  35. data/lib/dnsimple/struct/oauth_token.rb +19 -0
  36. data/lib/dnsimple/struct/record.rb +25 -7
  37. data/lib/dnsimple/struct/tld.rb +22 -0
  38. data/lib/dnsimple/struct/user.rb +3 -7
  39. data/lib/dnsimple/struct/webhook.rb +13 -0
  40. data/lib/dnsimple/struct/whois_privacy.rb +8 -5
  41. data/lib/dnsimple/struct/zone.rb +25 -0
  42. data/lib/dnsimple/version.rb +1 -1
  43. data/spec/dnsimple/client/client_service_spec.rb +37 -0
  44. data/spec/dnsimple/client/contacts_spec.rb +108 -78
  45. data/spec/dnsimple/client/domains_email_forwards_spec.rb +190 -0
  46. data/spec/dnsimple/client/domains_spec.rb +121 -58
  47. data/spec/dnsimple/client/identity_spec.rb +56 -0
  48. data/spec/dnsimple/client/oauth_spec.rb +48 -0
  49. data/spec/dnsimple/client/registrar_auto_renewal_spec.rb +80 -0
  50. data/spec/dnsimple/client/registrar_spec.rb +109 -122
  51. data/spec/dnsimple/client/registrar_whois_privacy_spec.rb +119 -0
  52. data/spec/dnsimple/client/tlds_spec.rb +139 -0
  53. data/spec/dnsimple/client/webhooks_spec.rb +142 -0
  54. data/spec/dnsimple/client/zones_records_spec.rb +277 -0
  55. data/spec/dnsimple/client/zones_spec.rb +109 -0
  56. data/spec/dnsimple/client_spec.rb +34 -46
  57. data/spec/dnsimple/extra_spec.rb +22 -0
  58. data/spec/{files → fixtures.http}/badgateway.http +14 -14
  59. data/spec/fixtures.http/checkDomain/success.http +17 -0
  60. data/spec/fixtures.http/createContact/created.http +17 -0
  61. data/spec/fixtures.http/createDomain/created.http +16 -0
  62. data/spec/fixtures.http/createEmailForward/created.http +17 -0
  63. data/spec/fixtures.http/createWebhook/created.http +17 -0
  64. data/spec/fixtures.http/createZoneRecord/created.http +17 -0
  65. data/spec/fixtures.http/deleteContact/success.http +13 -0
  66. data/spec/fixtures.http/deleteDomain/success.http +13 -0
  67. data/spec/fixtures.http/deleteEmailForward/success.http +12 -0
  68. data/spec/fixtures.http/deleteWebhook/success.http +13 -0
  69. data/spec/fixtures.http/deleteZoneRecord/success.http +13 -0
  70. data/spec/fixtures.http/disableAutoRenewal/success.http +12 -0
  71. data/spec/fixtures.http/disableWhoisPrivacy/success.http +17 -0
  72. data/spec/fixtures.http/enableAutoRenewal/success.http +12 -0
  73. data/spec/fixtures.http/enableWhoisPrivacy/created.http +17 -0
  74. data/spec/fixtures.http/enableWhoisPrivacy/success.http +17 -0
  75. data/spec/fixtures.http/getContact/success.http +17 -0
  76. data/spec/fixtures.http/getDomain/success.http +16 -0
  77. data/spec/fixtures.http/getEmailForward/success.http +17 -0
  78. data/spec/fixtures.http/getTld/success.http +17 -0
  79. data/spec/fixtures.http/getTldExtendedAttributes/success-noattributes.http +17 -0
  80. data/spec/fixtures.http/getTldExtendedAttributes/success.http +17 -0
  81. data/spec/fixtures.http/getWebhook/success.http +17 -0
  82. data/spec/fixtures.http/getWhoisPrivacy/success.http +17 -0
  83. data/spec/fixtures.http/getZone/success.http +17 -0
  84. data/spec/fixtures.http/getZoneRecord/success.http +17 -0
  85. data/spec/fixtures.http/listContacts/success.http +17 -0
  86. data/spec/fixtures.http/listDomains/success.http +16 -0
  87. data/spec/fixtures.http/listEmailForwards/success.http +17 -0
  88. data/spec/fixtures.http/listTlds/success.http +17 -0
  89. data/spec/fixtures.http/listWebhooks/success.http +17 -0
  90. data/spec/fixtures.http/listZoneRecords/success.http +17 -0
  91. data/spec/fixtures.http/listZones/success.http +17 -0
  92. data/spec/fixtures.http/notfound-contact.http +12 -0
  93. data/spec/fixtures.http/notfound-domain.http +12 -0
  94. data/spec/fixtures.http/notfound-emailforward.http +12 -0
  95. data/spec/fixtures.http/notfound-record.http +12 -0
  96. data/spec/fixtures.http/notfound-webhook.http +12 -0
  97. data/spec/fixtures.http/notfound-zone.http +12 -0
  98. data/spec/fixtures.http/oauthAccessToken/success.http +17 -0
  99. data/spec/fixtures.http/pages-1of3.http +16 -0
  100. data/spec/fixtures.http/pages-2of3.http +16 -0
  101. data/spec/fixtures.http/pages-3of3.http +16 -0
  102. data/spec/fixtures.http/registerDomain/success.http +17 -0
  103. data/spec/fixtures.http/renewDomain/error-tooearly.http +15 -0
  104. data/spec/fixtures.http/renewDomain/success.http +17 -0
  105. data/spec/fixtures.http/resetDomainToken/success.http +17 -0
  106. data/spec/fixtures.http/response.http +16 -0
  107. data/spec/fixtures.http/transferDomain/error-indnsimple.http +15 -0
  108. data/spec/fixtures.http/transferDomain/error-missing-authcode.http +15 -0
  109. data/spec/fixtures.http/transferDomain/success.http +17 -0
  110. data/spec/fixtures.http/transferDomainOut/success.http +13 -0
  111. data/spec/fixtures.http/updateContact/success.http +17 -0
  112. data/spec/fixtures.http/updateZoneRecord/success.http +17 -0
  113. data/spec/fixtures.http/whoami/success.http +16 -0
  114. data/spec/fixtures.http/whoami/success_account.http +16 -0
  115. data/spec/fixtures.http/whoami/success_user.http +16 -0
  116. data/spec/spec_helper.rb +0 -6
  117. data/spec/support/helpers.rb +4 -4
  118. metadata +161 -238
  119. data/lib/dnsimple/client/certificates.rb +0 -100
  120. data/lib/dnsimple/client/domains_autorenewal.rb +0 -35
  121. data/lib/dnsimple/client/domains_forwards.rb +0 -71
  122. data/lib/dnsimple/client/domains_privacy.rb +0 -35
  123. data/lib/dnsimple/client/domains_records.rb +0 -90
  124. data/lib/dnsimple/client/domains_sharing.rb +0 -54
  125. data/lib/dnsimple/client/domains_zones.rb +0 -22
  126. data/lib/dnsimple/client/name_servers.rb +0 -71
  127. data/lib/dnsimple/client/services.rb +0 -37
  128. data/lib/dnsimple/client/services_domains.rb +0 -68
  129. data/lib/dnsimple/client/templates.rb +0 -88
  130. data/lib/dnsimple/client/templates_domains.rb +0 -23
  131. data/lib/dnsimple/client/templates_records.rb +0 -88
  132. data/lib/dnsimple/client/users.rb +0 -39
  133. data/lib/dnsimple/client/vanity_name_servers.rb +0 -39
  134. data/lib/dnsimple/compatibility.rb +0 -46
  135. data/lib/dnsimple/struct/certificate.rb +0 -56
  136. data/lib/dnsimple/struct/membership.rb +0 -22
  137. data/lib/dnsimple/struct/price.rb +0 -16
  138. data/lib/dnsimple/struct/service.rb +0 -19
  139. data/lib/dnsimple/struct/template.rb +0 -19
  140. data/lib/dnsimple/struct/template_record.rb +0 -24
  141. data/lib/dnsimple/struct/transfer_order.rb +0 -10
  142. data/spec/dnsimple/client/certificates_spec.rb +0 -196
  143. data/spec/dnsimple/client/domains_autorenewals_spec.rb +0 -72
  144. data/spec/dnsimple/client/domains_forwards_spec.rb +0 -146
  145. data/spec/dnsimple/client/domains_privacy_spec.rb +0 -74
  146. data/spec/dnsimple/client/domains_records_spec.rb +0 -191
  147. data/spec/dnsimple/client/domains_sharing_spec.rb +0 -109
  148. data/spec/dnsimple/client/domains_zones_spec.rb +0 -40
  149. data/spec/dnsimple/client/name_servers_spec.rb +0 -131
  150. data/spec/dnsimple/client/services_domains_spec.rb +0 -101
  151. data/spec/dnsimple/client/services_spec.rb +0 -69
  152. data/spec/dnsimple/client/templates_domains_spec.rb +0 -38
  153. data/spec/dnsimple/client/templates_records_spec.rb +0 -180
  154. data/spec/dnsimple/client/templates_spec.rb +0 -166
  155. data/spec/dnsimple/client/users_spec.rb +0 -70
  156. data/spec/dnsimple/client/vanity_name_servers_spec.rb +0 -61
  157. data/spec/dnsimple/compatibility_spec.rb +0 -57
  158. data/spec/files/2fa/error-badtoken.http +0 -22
  159. data/spec/files/2fa/error-required.http +0 -23
  160. data/spec/files/2fa/exchange-token.http +0 -22
  161. data/spec/files/certificates/configure/success.http +0 -19
  162. data/spec/files/certificates/get/success.http +0 -19
  163. data/spec/files/certificates/list/success.http +0 -19
  164. data/spec/files/certificates/notfound.http +0 -19
  165. data/spec/files/certificates/purchase/success.http +0 -19
  166. data/spec/files/certificates/submit/success.http +0 -19
  167. data/spec/files/contacts/contact/success.http +0 -19
  168. data/spec/files/contacts/contacts/success.http +0 -23
  169. data/spec/files/contacts/create_contact/badrequest-missingcontact.http +0 -19
  170. data/spec/files/contacts/create_contact/badrequest-validationerror.http +0 -19
  171. data/spec/files/contacts/create_contact/created.http +0 -22
  172. data/spec/files/contacts/delete_contact/success-204.http +0 -18
  173. data/spec/files/contacts/delete_contact/success.http +0 -19
  174. data/spec/files/contacts/notfound-contact.http +0 -19
  175. data/spec/files/contacts/update_contact/success.http +0 -21
  176. data/spec/files/domains/create_domain/created.http +0 -21
  177. data/spec/files/domains/create_forward/created.http +0 -22
  178. data/spec/files/domains/create_membership/success.http +0 -21
  179. data/spec/files/domains/create_record/created.http +0 -21
  180. data/spec/files/domains/delete_domain/success-204.http +0 -18
  181. data/spec/files/domains/delete_domain/success.http +0 -19
  182. data/spec/files/domains/delete_forward/success.http +0 -17
  183. data/spec/files/domains/delete_membership/success.http +0 -17
  184. data/spec/files/domains/delete_record/success-204.http +0 -18
  185. data/spec/files/domains/delete_record/success.http +0 -19
  186. data/spec/files/domains/disable_auto_renewal/success.http +0 -21
  187. data/spec/files/domains/disable_whois_privacy/success.http +0 -21
  188. data/spec/files/domains/domain/success.http +0 -21
  189. data/spec/files/domains/domains/success.http +0 -21
  190. data/spec/files/domains/enable_auto_renewal/success.http +0 -21
  191. data/spec/files/domains/enable_whois_privacy/success.http +0 -22
  192. data/spec/files/domains/forward/success.http +0 -21
  193. data/spec/files/domains/forwards/success.http +0 -21
  194. data/spec/files/domains/memberships/success.http +0 -21
  195. data/spec/files/domains/notfound-domain.http +0 -19
  196. data/spec/files/domains/notfound-forward.http +0 -19
  197. data/spec/files/domains/notfound-membership.http +0 -19
  198. data/spec/files/domains/record/success.http +0 -19
  199. data/spec/files/domains/records/success.http +0 -19
  200. data/spec/files/domains/update_record/success.http +0 -21
  201. data/spec/files/domains/zone/success.http +0 -21
  202. data/spec/files/nameservers/change/success.http +0 -23
  203. data/spec/files/nameservers/deregister/success.http +0 -17
  204. data/spec/files/nameservers/name_servers/success.http +0 -23
  205. data/spec/files/nameservers/notfound-domain.http +0 -19
  206. data/spec/files/nameservers/register/badrequest-valueerror.http +0 -19
  207. data/spec/files/nameservers/register/success.http +0 -21
  208. data/spec/files/nameservers/vanity_name_servers/disabled.http +0 -23
  209. data/spec/files/nameservers/vanity_name_servers/enabled.http +0 -23
  210. data/spec/files/registrar/check/available.http +0 -19
  211. data/spec/files/registrar/check/registered.http +0 -21
  212. data/spec/files/registrar/extended_attributes/success.http +0 -21
  213. data/spec/files/registrar/prices/success.http +0 -21
  214. data/spec/files/registrar/register/badrequest-missingdomain.http +0 -19
  215. data/spec/files/registrar/register/badrequest-missingregistrant.http +0 -19
  216. data/spec/files/registrar/register/success.http +0 -21
  217. data/spec/files/registrar/renew/badrequest-missingrenewal.http +0 -19
  218. data/spec/files/registrar/renew/badrequest-unable.http +0 -19
  219. data/spec/files/registrar/renew/success.http +0 -21
  220. data/spec/files/registrar/transfer/success.http +0 -21
  221. data/spec/files/services/applied/success.http +0 -21
  222. data/spec/files/services/apply/success.http +0 -21
  223. data/spec/files/services/available/success.http +0 -21
  224. data/spec/files/services/notfound-service.http +0 -19
  225. data/spec/files/services/service/success.http +0 -21
  226. data/spec/files/services/services/success.http +0 -21
  227. data/spec/files/services/unapply/success.http +0 -21
  228. data/spec/files/subscriptions/subscription/success.http +0 -21
  229. data/spec/files/templates/apply_template/success.http +0 -21
  230. data/spec/files/templates/create_template/created.http +0 -22
  231. data/spec/files/templates/delete_template/success-204.http +0 -21
  232. data/spec/files/templates/delete_template/success.http +0 -21
  233. data/spec/files/templates/notfound-template.http +0 -19
  234. data/spec/files/templates/template/success.http +0 -21
  235. data/spec/files/templates/templates/success.http +0 -21
  236. data/spec/files/templates/update_template/success.http +0 -21
  237. data/spec/files/templates_records/create_record/created.http +0 -22
  238. data/spec/files/templates_records/delete_record/success-204.http +0 -19
  239. data/spec/files/templates_records/delete_record/success.http +0 -21
  240. data/spec/files/templates_records/notfound-template-record.http +0 -19
  241. data/spec/files/templates_records/record/success.http +0 -21
  242. data/spec/files/templates_records/records/success.http +0 -21
  243. data/spec/files/templates_records/update_record/success.http +0 -21
  244. data/spec/files/users/user/success.http +0 -21
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Fri, 22 Jan 2016 16:54:24 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 200 OK
8
+ X-RateLimit-Limit: 4000
9
+ X-RateLimit-Remaining: 3994
10
+ X-RateLimit-Reset: 1453484045
11
+ ETag: W/"485e03204e1853519bd637be743f2b25"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: 01be9fa5-3a00-4d51-a927-f17587cb67ec
14
+ X-Runtime: 0.037083
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"data":[{"id":1,"account_id":1010,"name":"example-alpha.com","reverse":false,"created_at":"2015-04-23T07:40:03.045Z","updated_at":"2015-04-23T07:40:03.051Z"},{"id":2,"account_id":1010,"name":"example-beta.com","reverse":true,"created_at":"2015-04-23T07:40:03.061Z","updated_at":"2015-04-23T07:40:03.067Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":2,"total_pages":1}}
@@ -0,0 +1,12 @@
1
+ HTTP/1.1 404 Not Found
2
+ Server: nginx
3
+ Date: Tue, 19 Jan 2016 21:04:48 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 404 Not Found
8
+ Cache-Control: no-cache
9
+ X-Request-Id: a57d4e23-3155-477e-8469-e897b27c03e5
10
+ X-Runtime: 0.014159
11
+
12
+ {"message":"Contact `0` not found"}
@@ -0,0 +1,12 @@
1
+ HTTP/1.1 404 Not Found
2
+ Server: nginx
3
+ Date: Wed, 16 Dec 2015 22:07:20 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Strict-Transport-Security: max-age=31536000
8
+ Cache-Control: no-cache
9
+ X-Request-Id: bc587ea7-bcd5-4c10-a940-a9b4c8339824
10
+ X-Runtime: 0.059966
11
+
12
+ {"message":"Domain `0` not found"}
@@ -0,0 +1,12 @@
1
+ HTTP/1.1 404 Not Found
2
+ Server: nginx
3
+ Date: Thu, 04 Feb 2016 14:44:56 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 404 Not Found
8
+ Cache-Control: no-cache
9
+ X-Request-Id: 50eea494-cc14-4db0-bc11-306aa525bbfd
10
+ X-Runtime: 0.028036
11
+
12
+ {"message":"Email forward `0` not found"}
@@ -0,0 +1,12 @@
1
+ HTTP/1.1 404 Not Found
2
+ Server: nginx
3
+ Date: Fri, 22 Jan 2016 16:46:07 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 404 Not Found
8
+ Cache-Control: no-cache
9
+ X-Request-Id: 35af0fd2-d020-4f70-861e-b6a42a190bf6
10
+ X-Runtime: 0.018847
11
+
12
+ {"message":"Record `0` not found"}
@@ -0,0 +1,12 @@
1
+ HTTP/1.1 404 Not Found
2
+ Server: nginx
3
+ Date: Thu, 03 Mar 2016 11:55:29 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 404 Not Found
8
+ Cache-Control: no-cache
9
+ X-Request-Id: 4f154fa2-3ce9-4bdd-88a3-42ccc8dbc087
10
+ X-Runtime: 0.012159
11
+
12
+ {"message":"Webhook `0` not found"}
@@ -0,0 +1,12 @@
1
+ HTTP/1.1 404 Not Found
2
+ Server: nginx
3
+ Date: Fri, 22 Jan 2016 16:46:02 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 404 Not Found
8
+ Cache-Control: no-cache
9
+ X-Request-Id: 9c19bef5-6902-421c-9f91-dec3bae26102
10
+ X-Runtime: 0.014705
11
+
12
+ {"message":"Zone `0` not found"}
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Mon, 08 Feb 2016 21:24:19 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 200 OK
8
+ X-RateLimit-Limit: 30
9
+ X-RateLimit-Remaining: 29
10
+ X-RateLimit-Reset: 1454970259
11
+ ETag: W/"def417b4ade951f8148bb6a4fa3fcf5a"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: e8c544cf-fcc3-4762-a200-60c0320a2575
14
+ X-Runtime: 0.105600
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"access_token":"zKQ7OLqF5N1gylcJweA9WodA000BUNJD","token_type":"Bearer","scope":null,"account_id":1}
@@ -0,0 +1,16 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Wed, 16 Dec 2015 13:36:11 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ X-RateLimit-Limit: 4000
8
+ X-RateLimit-Remaining: 3997
9
+ X-RateLimit-Reset: 1450272970
10
+ ETag: W/"2679531e6cce6cd326f255255d7a0005"
11
+ Cache-Control: max-age=0, private, must-revalidate
12
+ X-Request-Id: a87f1b44-150a-4ed0-b7da-9301fa1465b0
13
+ X-Runtime: 0.093714
14
+ Strict-Transport-Security: max-age=31536000
15
+
16
+ {"data":[{"id":1},{"id":2}],"pagination":{"current_page":1,"per_page":2,"total_entries":5,"total_pages":3}}
@@ -0,0 +1,16 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Wed, 16 Dec 2015 13:36:11 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ X-RateLimit-Limit: 4000
8
+ X-RateLimit-Remaining: 3997
9
+ X-RateLimit-Reset: 1450272970
10
+ ETag: W/"2679531e6cce6cd326f255255d7a0005"
11
+ Cache-Control: max-age=0, private, must-revalidate
12
+ X-Request-Id: a87f1b44-150a-4ed0-b7da-9301fa1465b0
13
+ X-Runtime: 0.093714
14
+ Strict-Transport-Security: max-age=31536000
15
+
16
+ {"data":[{"id":3},{"id":4}],"pagination":{"current_page":2,"per_page":2,"total_entries":5,"total_pages":3}}
@@ -0,0 +1,16 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Wed, 16 Dec 2015 13:36:11 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ X-RateLimit-Limit: 4000
8
+ X-RateLimit-Remaining: 3997
9
+ X-RateLimit-Reset: 1450272970
10
+ ETag: W/"2679531e6cce6cd326f255255d7a0005"
11
+ Cache-Control: max-age=0, private, must-revalidate
12
+ X-Request-Id: a87f1b44-150a-4ed0-b7da-9301fa1465b0
13
+ X-Runtime: 0.093714
14
+ Strict-Transport-Security: max-age=31536000
15
+
16
+ {"data":[{"id":5}],"pagination":{"current_page":3,"per_page":2,"total_entries":5,"total_pages":3}}
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 201 Created
2
+ Server: nginx
3
+ Date: Sat, 16 Jan 2016 16:09:02 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 201 Created
8
+ X-RateLimit-Limit: 4000
9
+ X-RateLimit-Remaining: 3965
10
+ X-RateLimit-Reset: 1452960541
11
+ ETag: W/"e034ef9fb32487cf4dc034050ba846c5"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: 8b378ee7-d8fa-4459-a1b0-a18bfd2354bb
14
+ X-Runtime: 13.365767
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"data":{"id":1,"account_id":1010,"registrant_id":2,"name":"example.com","unicode_name":"example.com","token":"cc8h1jP8bDLw5rXycL16k8BivcGiT6K9","state":"registered","auto_renew":false,"private_whois":false,"expires_on":"2017-01-16","created_at":"2016-01-16T16:08:50.649Z","updated_at":"2016-01-16T16:09:01.161Z"}}
@@ -0,0 +1,15 @@
1
+ HTTP/1.1 400 Bad Request
2
+ Server: nginx
3
+ Date: Mon, 15 Feb 2016 15:06:35 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 400 Bad Request
8
+ X-RateLimit-Limit: 4000
9
+ X-RateLimit-Remaining: 3998
10
+ X-RateLimit-Reset: 1455552316
11
+ Cache-Control: no-cache
12
+ X-Request-Id: 0c1507d3-4c03-4ba3-b2bd-b0cabf021ed8
13
+ X-Runtime: 0.256476
14
+
15
+ {"message":"example.com may not be renewed at this time","errors":{}}
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 201 Created
2
+ Server: nginx
3
+ Date: Mon, 15 Feb 2016 15:19:24 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 201 Created
8
+ X-RateLimit-Limit: 4000
9
+ X-RateLimit-Remaining: 3996
10
+ X-RateLimit-Reset: 1455552316
11
+ ETag: W/"3ee240b342a641fbc69f9c35fa77b53f"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: f888665c-8fcc-4ff1-a954-8ce7d7e19af6
14
+ X-Runtime: 3.506408
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"data":{"id":1,"account_id":1010,"registrant_id":2,"name":"example.com","unicode_name":"example.com","token":"domain-token","state":"registered","auto_renew":false,"private_whois":false,"expires_on":"2018-01-16","created_at":"2016-01-16T16:08:50.649Z","updated_at":"2016-02-15T15:19:24.689Z"}}
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 201 Created
2
+ Server: nginx
3
+ Date: Thu, 04 Feb 2016 10:13:19 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 201 Created
8
+ X-RateLimit-Limit: 4000
9
+ X-RateLimit-Remaining: 3999
10
+ X-RateLimit-Reset: 1454584399
11
+ ETag: W/"834381fd3fd0896e344e3fad9e77ab97"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: bf1b3976-2edd-4ea6-b606-1d60eaa0403d
14
+ X-Runtime: 0.075404
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"data":{"id":1,"account_id":1010,"registrant_id":null,"name":"example-alpha.com","unicode_name":"example-alpha.com","token":"domain-token","state":"hosted","auto_renew":false,"private_whois":false,"expires_on":null,"created_at":"2014-12-06T15:56:55.573Z","updated_at":"2015-12-09T00:20:56.056Z"}}
@@ -0,0 +1,16 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Fri, 18 Dec 2015 15:19:37 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ X-RateLimit-Limit: 4000
8
+ X-RateLimit-Remaining: 3991
9
+ X-RateLimit-Reset: 1450451976
10
+ ETag: W/"5ea6326bc1a8e83e5c156c564f2559f0"
11
+ Cache-Control: max-age=0, private, must-revalidate
12
+ X-Request-Id: 15a7f3a5-7ee5-4e36-ac5a-8c21c2e1fffd
13
+ X-Runtime: 0.141588
14
+ Strict-Transport-Security: max-age=31536000
15
+
16
+ {"data":{"user":null,"account":null}}
@@ -0,0 +1,15 @@
1
+ HTTP/1.1 400 Bad Request
2
+ Server: nginx
3
+ Date: Sun, 21 Feb 2016 13:11:54 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 400 Bad Request
8
+ X-RateLimit-Limit: 4000
9
+ X-RateLimit-Remaining: 3996
10
+ X-RateLimit-Reset: 1456063541
11
+ Cache-Control: no-cache
12
+ X-Request-Id: 15d2e302-e835-4dda-9652-03d8962280ae
13
+ X-Runtime: 0.994068
14
+
15
+ {"message":"The domain google.com is already in DNSimple and cannot be added"}
@@ -0,0 +1,15 @@
1
+ HTTP/1.1 400 Bad Request
2
+ Server: nginx
3
+ Date: Sun, 21 Feb 2016 13:11:11 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 400 Bad Request
8
+ X-RateLimit-Limit: 4000
9
+ X-RateLimit-Remaining: 3997
10
+ X-RateLimit-Reset: 1456063540
11
+ Cache-Control: no-cache
12
+ X-Request-Id: d7a0eb63-77eb-4488-bc55-c129ed8fe192
13
+ X-Runtime: 11.912567
14
+
15
+ {"message":"Validation failed","errors":{"base":["You must provide an authorization code for the domain"]}}
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 201 Created
2
+ Server: nginx
3
+ Date: Sun, 21 Feb 2016 13:32:02 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 201 Created
8
+ X-RateLimit-Limit: 4000
9
+ X-RateLimit-Remaining: 3992
10
+ X-RateLimit-Reset: 1456063540
11
+ ETag: W/"68e1aa1046c3f33f2ad796befc2b9f5b"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: c3401f82-d570-4998-a614-245f3a7677ba
14
+ X-Runtime: 15.045124
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"data":{"id":1,"account_id":1010,"registrant_id":10,"name":"example.com","unicode_name":"example.com","token":"domain-token","state":"hosted","auto_renew":false,"private_whois":false,"expires_on":null,"created_at":"2016-02-21T13:31:58.745Z","updated_at":"2016-02-21T13:31:58.745Z"}}
@@ -0,0 +1,13 @@
1
+ HTTP/1.1 204 No Content
2
+ Server: nginx
3
+ Date: Sun, 21 Feb 2016 13:40:35 GMT
4
+ Connection: keep-alive
5
+ Status: 204 No Content
6
+ X-RateLimit-Limit: 4000
7
+ X-RateLimit-Remaining: 3990
8
+ X-RateLimit-Reset: 1456063540
9
+ Cache-Control: no-cache
10
+ X-Request-Id: 9af6ab78-7ea8-4675-89f0-14d124fc7ca2
11
+ X-Runtime: 3.038699
12
+ Strict-Transport-Security: max-age=31536000
13
+
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Tue, 19 Jan 2016 21:28:13 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 200 OK
8
+ X-RateLimit-Limit: 4000
9
+ X-RateLimit-Remaining: 3995
10
+ X-RateLimit-Reset: 1453239045
11
+ ETag: W/"4a798ad8f083076b23d3eed622eefc2d"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: c0e1e24f-d22d-4832-a30e-2f4ffc40b029
14
+ X-Runtime: 0.053262
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"data":{"id":1,"account_id":1010,"label":"Default","first_name":"First","last_name":"User","job_title":"CEO","organization_name":"Awesome Company","email_address":"first@example.com","phone":"+18001234567","fax":"+18011234567","address1":"Italian Street, 10","address2":"","city":"Roma","state_province":"RM","postal_code":"00100","country":"IT","created_at":"2016-01-19T20:50:26.066Z","updated_at":"2016-01-19T20:50:26.066Z"}}
@@ -0,0 +1,17 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Thu, 07 Jan 2016 17:54:46 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ Status: 200 OK
8
+ X-RateLimit-Limit: 4000
9
+ X-RateLimit-Remaining: 3988
10
+ X-RateLimit-Reset: 1452189285
11
+ ETag: W/"e870cbe9707d7c1acd0bdb3e4b756cf9"
12
+ Cache-Control: max-age=0, private, must-revalidate
13
+ X-Request-Id: f320b46c-a7cd-41fe-a061-f38b7a92391f
14
+ X-Runtime: 0.103506
15
+ Strict-Transport-Security: max-age=31536000
16
+
17
+ {"data":{"id":64784,"domain_id":5841,"parent_id":null,"name":"www","content":"127.0.0.1","ttl":600,"priority":null,"type":"A","system_record":false,"created_at":"2016-01-07T17:45:13.653Z","updated_at":"2016-01-07T17:54:46.722Z"}}
@@ -0,0 +1,16 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Fri, 18 Dec 2015 15:19:37 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ X-RateLimit-Limit: 4000
8
+ X-RateLimit-Remaining: 3991
9
+ X-RateLimit-Reset: 1450451976
10
+ ETag: W/"5ea6326bc1a8e83e5c156c564f2559f0"
11
+ Cache-Control: max-age=0, private, must-revalidate
12
+ X-Request-Id: 15a7f3a5-7ee5-4e36-ac5a-8c21c2e1fffd
13
+ X-Runtime: 0.141588
14
+ Strict-Transport-Security: max-age=31536000
15
+
16
+ {"data":{"user":null,"account":{"id":1,"email":"example-account@example.com"}}}
@@ -0,0 +1,16 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Fri, 18 Dec 2015 15:19:37 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ X-RateLimit-Limit: 4000
8
+ X-RateLimit-Remaining: 3991
9
+ X-RateLimit-Reset: 1450451976
10
+ ETag: W/"5ea6326bc1a8e83e5c156c564f2559f0"
11
+ Cache-Control: max-age=0, private, must-revalidate
12
+ X-Request-Id: 15a7f3a5-7ee5-4e36-ac5a-8c21c2e1fffd
13
+ X-Runtime: 0.141588
14
+ Strict-Transport-Security: max-age=31536000
15
+
16
+ {"data":{"user":null,"account":{"id":1,"email":"example-account@example.com"}}}
@@ -0,0 +1,16 @@
1
+ HTTP/1.1 200 OK
2
+ Server: nginx
3
+ Date: Fri, 18 Dec 2015 15:19:37 GMT
4
+ Content-Type: application/json; charset=utf-8
5
+ Transfer-Encoding: chunked
6
+ Connection: keep-alive
7
+ X-RateLimit-Limit: 4000
8
+ X-RateLimit-Remaining: 3991
9
+ X-RateLimit-Reset: 1450451976
10
+ ETag: W/"5ea6326bc1a8e83e5c156c564f2559f0"
11
+ Cache-Control: max-age=0, private, must-revalidate
12
+ X-Request-Id: 15a7f3a5-7ee5-4e36-ac5a-8c21c2e1fffd
13
+ X-Runtime: 0.141588
14
+ Strict-Transport-Security: max-age=31536000
15
+
16
+ {"data":{"user":{"id":1,"email":"example-user@example.com"},"account":null}}
data/spec/spec_helper.rb CHANGED
@@ -12,12 +12,6 @@ unless defined?(SPEC_ROOT)
12
12
  SPEC_ROOT = File.expand_path("../", __FILE__)
13
13
  end
14
14
 
15
- CONFIG = { 'username' => 'username', 'password' => 'password', 'base_uri' => 'https://api.sandbox.dnsimple.com/', 'host' => 'api.sandbox.dnsimple.com' }
16
- Dnsimple::Client.base_uri = CONFIG['base_uri']
17
- Dnsimple::Client.username = CONFIG['username']
18
- Dnsimple::Client.password = CONFIG['password']
19
-
20
-
21
15
  RSpec.configure do |c|
22
16
  # Silent the puts call in the commands
23
17
  # c.before do
@@ -1,11 +1,11 @@
1
1
  module RSpecSupportHelpers
2
2
 
3
- def fixture(*names)
4
- File.join(SPEC_ROOT, "files", *names)
3
+ def http_fixture(*names)
4
+ File.join(SPEC_ROOT, "fixtures.http", *names)
5
5
  end
6
6
 
7
- def read_fixture(*names)
8
- File.read(fixture(*names))
7
+ def read_http_fixture(*names)
8
+ File.read(http_fixture(*names))
9
9
  end
10
10
 
11
11
  end