dnsimple 2.0.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.markdown +5 -2
  3. data/dnsimple.gemspec +1 -1
  4. data/lib/dnsimple/client/certificates.rb +11 -11
  5. data/lib/dnsimple/client/clients.rb +4 -2
  6. data/lib/dnsimple/client/contacts.rb +19 -15
  7. data/lib/dnsimple/client/domains.rb +23 -19
  8. data/lib/dnsimple/client/{domains_autorenewals.rb → domains_autorenewal.rb} +7 -7
  9. data/lib/dnsimple/client/domains_forwards.rb +13 -12
  10. data/lib/dnsimple/client/domains_privacy.rb +6 -6
  11. data/lib/dnsimple/client/domains_records.rb +14 -13
  12. data/lib/dnsimple/client/domains_sharing.rb +10 -9
  13. data/lib/dnsimple/client/domains_zones.rb +3 -3
  14. data/lib/dnsimple/client/name_servers.rb +14 -14
  15. data/lib/dnsimple/client/registrar.rb +17 -15
  16. data/lib/dnsimple/client/services.rb +7 -6
  17. data/lib/dnsimple/client/services_domains.rb +12 -12
  18. data/lib/dnsimple/client/templates.rb +18 -30
  19. data/lib/dnsimple/client/templates_domains.rb +23 -0
  20. data/lib/dnsimple/client/templates_records.rb +15 -15
  21. data/lib/dnsimple/client/users.rb +7 -5
  22. data/lib/dnsimple/version.rb +1 -1
  23. data/spec/dnsimple/client/certificates_spec.rb +2 -2
  24. data/spec/dnsimple/client/contacts_spec.rb +22 -22
  25. data/spec/dnsimple/client/domains_autorenewals_spec.rb +4 -4
  26. data/spec/dnsimple/client/domains_forwards_spec.rb +8 -8
  27. data/spec/dnsimple/client/domains_privacy_spec.rb +4 -4
  28. data/spec/dnsimple/client/domains_records_spec.rb +11 -11
  29. data/spec/dnsimple/client/domains_sharing_spec.rb +6 -6
  30. data/spec/dnsimple/client/domains_spec.rb +15 -15
  31. data/spec/dnsimple/client/domains_zones_spec.rb +2 -2
  32. data/spec/dnsimple/client/name_servers_spec.rb +1 -1
  33. data/spec/dnsimple/client/registrar_spec.rb +9 -9
  34. data/spec/dnsimple/client/services_spec.rb +3 -3
  35. data/spec/dnsimple/client/templates_domains_spec.rb +38 -0
  36. data/spec/dnsimple/client/templates_records_spec.rb +10 -10
  37. data/spec/dnsimple/client/templates_spec.rb +21 -53
  38. data/spec/files/contacts/{get → contact}/success.http +0 -0
  39. data/spec/files/contacts/{list → contacts}/success.http +0 -0
  40. data/spec/files/contacts/{create → create_contact}/badrequest-missingcontact.http +0 -0
  41. data/spec/files/contacts/{create → create_contact}/badrequest-validationerror.http +0 -0
  42. data/spec/files/contacts/{create → create_contact}/created.http +0 -0
  43. data/spec/files/contacts/{delete → delete_contact}/success-204.http +0 -0
  44. data/spec/files/contacts/{delete → delete_contact}/success.http +0 -0
  45. data/spec/files/contacts/{notfound.http → notfound-contact.http} +0 -0
  46. data/spec/files/contacts/{update → update_contact}/success.http +0 -0
  47. data/spec/files/domains/{create → create_domain}/created.http +0 -0
  48. data/spec/files/{domains_forwards/create → domains/create_forward}/created.http +0 -0
  49. data/spec/files/{domains_sharing/create → domains/create_membership}/success.http +0 -0
  50. data/spec/files/{domains_records/create → domains/create_record}/created.http +0 -0
  51. data/spec/files/domains/{delete → delete_domain}/success-204.http +0 -0
  52. data/spec/files/domains/{delete → delete_domain}/success.http +0 -0
  53. data/spec/files/{domains_forwards/delete → domains/delete_forward}/success.http +0 -0
  54. data/spec/files/{domains_sharing/delete → domains/delete_membership}/success.http +0 -0
  55. data/spec/files/{domains_records/delete → domains/delete_record}/success-204.http +0 -0
  56. data/spec/files/{domains_records/delete → domains/delete_record}/success.http +0 -0
  57. data/spec/files/{domains_autorenewal/disable → domains/disable_auto_renewal}/success.http +0 -0
  58. data/spec/files/{domains_privacy/disable → domains/disable_whois_privacy}/success.http +0 -0
  59. data/spec/files/domains/{get → domain}/success.http +0 -0
  60. data/spec/files/domains/{list → domains}/success.http +0 -0
  61. data/spec/files/{domains_autorenewal/enable → domains/enable_auto_renewal}/success.http +0 -0
  62. data/spec/files/{domains_privacy/enable → domains/enable_whois_privacy}/success.http +0 -0
  63. data/spec/files/{domains_forwards/get → domains/forward}/success.http +0 -0
  64. data/spec/files/{domains_forwards/list → domains/forwards}/success.http +0 -0
  65. data/spec/files/{domains_sharing/list → domains/memberships}/success.http +0 -0
  66. data/spec/files/domains/{notfound.http → notfound-domain.http} +0 -0
  67. data/spec/files/{domains_forwards/notfound.http → domains/notfound-forward.http} +0 -0
  68. data/spec/files/{domains_sharing/notfound.http → domains/notfound-membership.http} +0 -0
  69. data/spec/files/{domains_records/get → domains/record}/success.http +0 -0
  70. data/spec/files/{domains_records/list → domains/records}/success.http +0 -0
  71. data/spec/files/{domains_records/update → domains/update_record}/success.http +0 -0
  72. data/spec/files/{domains_zones/get → domains/zone}/success.http +0 -0
  73. data/spec/files/nameservers/{list → name_servers}/success.http +0 -0
  74. data/spec/files/{registrar_extended_attributes/list → registrar/extended_attributes}/success.http +0 -0
  75. data/spec/files/{registrar_prices/list → registrar/prices}/success.http +0 -0
  76. data/spec/files/services/{notfound.http → notfound-service.http} +0 -0
  77. data/spec/files/services/{get → service}/success.http +0 -0
  78. data/spec/files/services/{list → services}/success.http +0 -0
  79. data/spec/files/subscriptions/{get → subscription}/success.http +0 -0
  80. data/spec/files/templates/{apply → apply_template}/success.http +0 -0
  81. data/spec/files/templates/{create → create_template}/created.http +0 -0
  82. data/spec/files/templates/{delete → delete_template}/success-204.http +0 -0
  83. data/spec/files/templates/{delete → delete_template}/success.http +0 -0
  84. data/spec/files/templates/{notfound.http → notfound-template.http} +0 -0
  85. data/spec/files/templates/{get → template}/success.http +0 -0
  86. data/spec/files/templates/{list → templates}/success.http +0 -0
  87. data/spec/files/templates/{update → update_template}/success.http +0 -0
  88. data/spec/files/templates_records/{create → create_record}/created.http +0 -0
  89. data/spec/files/templates_records/{delete → delete_record}/success-204.http +0 -0
  90. data/spec/files/templates_records/{delete → delete_record}/success.http +0 -0
  91. data/spec/files/templates_records/{notfound.http → notfound-template-record.http} +0 -0
  92. data/spec/files/templates_records/{get → record}/success.http +0 -0
  93. data/spec/files/templates_records/{list → records}/success.http +0 -0
  94. data/spec/files/templates_records/{update → update_record}/success.http +0 -0
  95. metadata +121 -130
  96. data/spec/files/domains_autorenewal/notfound-domain.http +0 -19
  97. data/spec/files/domains_forwards/notfound-domain.http +0 -19
  98. data/spec/files/domains_privacy/notfound-domain.http +0 -19
  99. data/spec/files/domains_records/notfound.http +0 -17
  100. data/spec/files/domains_sharing/notfound-domain.http +0 -19
  101. data/spec/files/domains_zones/notfound-domain.http +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 39d9b33d782af6a1b17cb008ac9008797b299b28
4
- data.tar.gz: c04fb52908ce4bfe2ca7ac005a099c09d7e7d3ab
3
+ metadata.gz: 0b14f9c45f6173fc08744a1732a9a8ad9ae158ca
4
+ data.tar.gz: c0e2383549ab9ab518563926243ccf98af981848
5
5
  SHA512:
6
- metadata.gz: a3e28ab4eadcffc6f883e2d3b9661e6ae82dabcf46fc6863fe0b0ce5c6f64bc38f01e3b57042691b6c6c59584518bb025bc019c7620d178d59948ff7cb965cd3
7
- data.tar.gz: 95482c599561709d19941656fec554c4a76d4172d65d3578b40c0773141a33885f066161c65f6cef687fd900d624ee609d50d27c2d7c3bf1d66ab9c063af4253
6
+ metadata.gz: 79a95261aca54349137b962fd1312862bb70c5caf746b734ad731e4100f95ef68235cf3c9f081013e495bf32e958b45c7b32e8cd2cdd898d2f795cf83d83283a
7
+ data.tar.gz: 034abea2f3296583a85d1a063076894c3a2521925159d631d98ad847623de00f08d6cd3cec79bf65ce8c1eeaa698ee04cc57dbe9e51eb42a5e93b45e0ff753b3
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
- #### 2.0.0.alpha
3
+ #### 2.1.0
4
+
5
+ - NEW: Add the ability to set headers and pass extra connection params in each API method (GH-64)
6
+
7
+ #### 2.0.0
4
8
 
5
9
  **2.0.0.alpha**
6
10
 
@@ -24,7 +28,6 @@
24
28
 
25
29
  - FIXED: Fixed a bug where API token environment variables were not properly detected (GH-59, GH-62). Thanks @oguzbilgic and @rupurt.
26
30
 
27
-
28
31
  #### Release 1.7.1
29
32
 
30
33
  - FIXED: Updated Certificate to match the serialized attributes (GH-53).
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = Dnsimple::VERSION
8
8
  s.authors = ['Anthony Eden', 'Simone Carletti']
9
9
  s.email = ['anthony.eden@dnsimple.com', 'simone.carletti@dnsimple.com']
10
- s.homepage = 'http://github.com/aetrion/dnsimple-ruby'
10
+ s.homepage = 'https://github.com/aetrion/dnsimple-ruby'
11
11
  s.summary = 'A Ruby client for the DNSimple API'
12
12
  s.description = 'A Ruby client for the DNSimple API.'
13
13
 
@@ -8,8 +8,8 @@ module Dnsimple
8
8
  #
9
9
  # @param [#to_s] domain The domain id or domain name.
10
10
  # @param [Hash] options
11
- #
12
11
  # @return [Array<Struct::Certificate>]
12
+ #
13
13
  # @raise [NotFoundError]
14
14
  # @raise [RequestError] When the request fails.
15
15
  def certificates(domain, options = {})
@@ -17,8 +17,8 @@ module Dnsimple
17
17
 
18
18
  response.map { |r| Struct::Certificate.new(r["certificate"]) }
19
19
  end
20
-
21
20
  alias :list :certificates
21
+ alias :list_certificates :certificates
22
22
 
23
23
  # Gets a certificate for a domain.
24
24
  #
@@ -26,12 +26,12 @@ module Dnsimple
26
26
  #
27
27
  # @param [#to_s] domain The domain id or domain name.
28
28
  # @param [Fixnum] certificate_id The certificate ID.
29
- #
30
29
  # @return [Struct::Certificate]
30
+ #
31
31
  # @raise [NotFoundError]
32
32
  # @raise [RequestError] When the request fails.
33
- def certificate(domain, certificate_id)
34
- response = client.get("v1/domains/#{domain}/certificates/#{certificate_id}")
33
+ def certificate(domain, certificate_id, options = {})
34
+ response = client.get("v1/domains/#{domain}/certificates/#{certificate_id}", options)
35
35
 
36
36
  Struct::Certificate.new(response["certificate"])
37
37
  end
@@ -54,8 +54,8 @@ module Dnsimple
54
54
  # @param [#to_s] domain The domain id or domain name.
55
55
  # @param [String] name The certificate name.
56
56
  # @param [Fixnum] contact_id The ID of the contact associated to the certificate.
57
- #
58
57
  # @return [Struct::Certificate]
58
+ #
59
59
  # @raise [NotFoundError]
60
60
  # @raise [RequestError] When the request fails.
61
61
  def purchase(domain, name, contact_id, options = {})
@@ -69,12 +69,12 @@ module Dnsimple
69
69
  #
70
70
  # @param [#to_s] domain The domain id or domain name.
71
71
  # @param [Fixnum] certificate_id The certificate ID.
72
- #
73
72
  # @return [Struct::Certificate]
73
+ #
74
74
  # @raise [NotFoundError]
75
75
  # @raise [RequestError] When the request fails.
76
- def configure(domain, certificate_id)
77
- response = client.put("v1/domains/#{domain}/certificates/#{certificate_id}/configure")
76
+ def configure(domain, certificate_id, options = {})
77
+ response = client.put("v1/domains/#{domain}/certificates/#{certificate_id}/configure", options)
78
78
 
79
79
  Struct::Certificate.new(response["certificate"])
80
80
  end
@@ -88,8 +88,8 @@ module Dnsimple
88
88
  # @return [Struct::Certificate]
89
89
  # @raise [NotFoundError]
90
90
  # @raise [RequestError] When the request fails.
91
- def submit(domain, certificate_id, email)
92
- options = { certificate: { approver_email: email }}
91
+ def submit(domain, certificate_id, email, options = {})
92
+ options = options.merge(certificate: { approver_email: email })
93
93
  response = client.put("v1/domains/#{domain}/certificates/#{certificate_id}/submit", options)
94
94
 
95
95
  Struct::Certificate.new(response["certificate"])
@@ -62,7 +62,7 @@ module Dnsimple
62
62
 
63
63
  require 'dnsimple/client/domains'
64
64
  require 'dnsimple/client/domains_records'
65
- require 'dnsimple/client/domains_autorenewals'
65
+ require 'dnsimple/client/domains_autorenewal'
66
66
  require 'dnsimple/client/domains_privacy'
67
67
  require 'dnsimple/client/domains_sharing'
68
68
  require 'dnsimple/client/domains_forwards'
@@ -71,7 +71,7 @@ module Dnsimple
71
71
  class DomainsService < ClientService
72
72
  include Client::Domains
73
73
  include Client::DomainsRecords
74
- include Client::DomainsAutorenewals
74
+ include Client::DomainsAutorenewal
75
75
  include Client::DomainsPrivacy
76
76
  include Client::DomainsSharing
77
77
  include Client::DomainsForwards
@@ -103,10 +103,12 @@ module Dnsimple
103
103
 
104
104
 
105
105
  require 'dnsimple/client/templates'
106
+ require 'dnsimple/client/templates_domains'
106
107
  require 'dnsimple/client/templates_records'
107
108
 
108
109
  class TemplatesService < ClientService
109
110
  include Client::Templates
111
+ include Client::TemplatesDomains
110
112
  include Client::TemplatesRecords
111
113
  end
112
114
 
@@ -7,42 +7,44 @@ module Dnsimple
7
7
  # @see http://developer.dnsimple.com/contacts/#list
8
8
  #
9
9
  # @return [Array<Struct::Contact>]
10
+ #
10
11
  # @raise [RequestError] When the request fails.
11
- def contacts
12
- response = client.get("v1/contacts")
12
+ def contacts(options = {})
13
+ response = client.get("v1/contacts", options)
13
14
 
14
15
  response.map { |r| Struct::Contact.new(r["contact"]) }
15
16
  end
16
-
17
17
  alias :list :contacts
18
+ alias :list_contacts :contacts
18
19
 
19
20
  # Creates a contact in the account.
20
21
  #
21
22
  # @see http://developer.dnsimple.com/contacts/#create
22
23
  #
23
24
  # @param [Hash] attributes
24
- #
25
25
  # @return [Struct::Contact]
26
+ #
26
27
  # @raise [RequestError] When the request fails.
27
- def create(attributes = {})
28
+ def create_contact(attributes = {}, options = {})
28
29
  Extra.validate_mandatory_attributes(attributes, [:first_name, :last_name, :address1, :city, :state_province, :postal_code, :country, :phone, :email_address])
29
- options = { contact: attributes }
30
+ options = options.merge(contact: attributes)
30
31
  response = client.post("v1/contacts", options)
31
32
 
32
33
  Struct::Contact.new(response["contact"])
33
34
  end
35
+ alias :create :create_contact
34
36
 
35
37
  # Gets a contact from the account.
36
38
  #
37
39
  # @see http://developer.dnsimple.com/contacts/#get
38
40
  #
39
41
  # @param [Fixnum] contact The contact id.
40
- #
41
42
  # @return [Struct::Contact]
43
+ #
42
44
  # @raise [NotFoundError]
43
45
  # @raise [RequestError] When the request fails.
44
- def contact(contact)
45
- response = client.get("v1/contacts/#{contact}")
46
+ def contact(contact, options = {})
47
+ response = client.get("v1/contacts/#{contact}", options)
46
48
 
47
49
  Struct::Contact.new(response["contact"])
48
50
  end
@@ -53,16 +55,17 @@ module Dnsimple
53
55
  #
54
56
  # @param [Fixnum] contact The contact id.
55
57
  # @param [Hash] attributes
56
- #
57
58
  # @return [Struct::Contact]
59
+ #
58
60
  # @raise [NotFoundError]
59
61
  # @raise [RequestError] When the request fails.
60
- def update(contact, attributes = {})
61
- options = { contact: attributes }
62
+ def update_contact(contact, attributes = {}, options = {})
63
+ options = options.merge(contact: attributes)
62
64
  response = client.put("v1/contacts/#{contact}", options)
63
65
 
64
66
  Struct::Contact.new(response["contact"])
65
67
  end
68
+ alias :update :update_contact
66
69
 
67
70
  # Deletes a contact from the account.
68
71
  #
@@ -71,13 +74,14 @@ module Dnsimple
71
74
  # @see http://developer.dnsimple.com/contacts/#delete
72
75
  #
73
76
  # @param [Fixnum] contact The contact id.
74
- #
75
77
  # @return [void]
78
+ #
76
79
  # @raise [NotFoundError]
77
80
  # @raise [RequestError] When the request fails.
78
- def delete(contact)
79
- client.delete("v1/contacts/#{contact}")
81
+ def delete_contact(contact, options = {})
82
+ client.delete("v1/contacts/#{contact}", options)
80
83
  end
84
+ alias :delete :delete_contact
81
85
 
82
86
  end
83
87
  end
@@ -6,43 +6,46 @@ module Dnsimple
6
6
  #
7
7
  # @see http://developer.dnsimple.com/domains/#list
8
8
  #
9
+ # @param [Hash] options the filtering and sorting option
9
10
  # @return [Array<Struct::Domain>]
11
+ #
10
12
  # @raise [RequestError] When the request fails.
11
13
  def domains(options = {})
12
14
  response = client.get("v1/domains", options)
13
15
 
14
16
  response.map { |r| Struct::Domain.new(r["domain"]) }
15
17
  end
16
-
17
18
  alias :list :domains
19
+ alias :list_domains :domains
18
20
 
19
- # Gets a domain from the account.
20
- #
21
- # @see http://developer.dnsimple.com/domains/#get
21
+ # Creates a domain in the account.
22
22
  #
23
- # @param [#to_s] domain The domain id or domain name.
23
+ # @see http://developer.dnsimple.com/domains/#create
24
24
  #
25
+ # @param [Hash] attributes
25
26
  # @return [Struct::Domain]
26
- # @raise [NotFoundError]
27
+ #
27
28
  # @raise [RequestError] When the request fails.
28
- def domain(domain)
29
- response = client.get("v1/domains/#{domain}")
29
+ def create_domain(attributes = {}, options = {})
30
+ Extra.validate_mandatory_attributes(attributes, [:name])
31
+ options = options.merge({ domain: attributes })
32
+ response = client.post("v1/domains", options)
30
33
 
31
34
  Struct::Domain.new(response["domain"])
32
35
  end
36
+ alias :create :create_domain
33
37
 
34
- # Creates a domain in the account.
35
- #
36
- # @see http://developer.dnsimple.com/domains/#create
38
+ # Gets a domain from the account.
37
39
  #
38
- # @param [Hash] attributes
40
+ # @see http://developer.dnsimple.com/domains/#get
39
41
  #
42
+ # @param [#to_s] domain The domain id or domain name.
40
43
  # @return [Struct::Domain]
44
+ #
45
+ # @raise [NotFoundError]
41
46
  # @raise [RequestError] When the request fails.
42
- def create(attributes = {})
43
- Extra.validate_mandatory_attributes(attributes, [:name])
44
- options = { domain: attributes }
45
- response = client.post("v1/domains", options)
47
+ def domain(domain, options = {})
48
+ response = client.get("v1/domains/#{domain}", options)
46
49
 
47
50
  Struct::Domain.new(response["domain"])
48
51
  end
@@ -54,13 +57,14 @@ module Dnsimple
54
57
  # @see http://developer.dnsimple.com/domains/#delete
55
58
  #
56
59
  # @param [#to_s] domain The domain id or domain name.
57
- #
58
60
  # @return [void]
61
+ #
59
62
  # @raise [NotFoundError]
60
63
  # @raise [RequestError] When the request fails.
61
- def delete(domain)
62
- client.delete("v1/domains/#{domain}")
64
+ def delete_domain(domain, options = {})
65
+ client.delete("v1/domains/#{domain}", options)
63
66
  end
67
+ alias :delete :delete_domain
64
68
 
65
69
  end
66
70
  end
@@ -1,17 +1,17 @@
1
1
  module Dnsimple
2
2
  class Client
3
- module DomainsAutorenewals
3
+ module DomainsAutorenewal
4
4
 
5
5
  # Enables auto-renewal for a domain.
6
6
  #
7
7
  # @see http://developer.dnsimple.com/domains/autorenewal/#enable
8
8
  #
9
9
  # @param [#to_s] domain The domain id or domain name.
10
- #
11
10
  # @return [Struct::Domain]
11
+ #
12
12
  # @raise [RequestError] When the request fails.
13
- def enable_auto_renewal(domain)
14
- response = client.post("v1/domains/#{domain}/auto_renewal")
13
+ def enable_auto_renewal(domain, options = {})
14
+ response = client.post("v1/domains/#{domain}/auto_renewal", options)
15
15
 
16
16
  Struct::Domain.new(response["domain"])
17
17
  end
@@ -21,11 +21,11 @@ module Dnsimple
21
21
  # @see http://developer.dnsimple.com/domains/autorenewal/#disable
22
22
  #
23
23
  # @param [#to_s] domain The domain id or domain name.
24
- #
25
24
  # @return [Struct::Domain]
25
+ #
26
26
  # @raise [RequestError] When the request fails.
27
- def disable_auto_renewal(domain)
28
- response = client.delete("v1/domains/#{domain}/auto_renewal")
27
+ def disable_auto_renewal(domain, options = {})
28
+ response = client.delete("v1/domains/#{domain}/auto_renewal", options)
29
29
 
30
30
  Struct::Domain.new(response["domain"])
31
31
  end
@@ -7,15 +7,16 @@ module Dnsimple
7
7
  # @see http://developer.dnsimple.com/domains/forwards/#list
8
8
  #
9
9
  # @param [#to_s] domain The domain id or domain name.
10
- #
11
10
  # @return [Array<Struct::EmailForward>]
11
+ #
12
12
  # @raise [NotFoundError]
13
13
  # @raise [RequestError] When the request fails.
14
- def email_forwards(domain)
15
- response = client.get("v1/domains/#{domain}/email_forwards")
14
+ def email_forwards(domain, options = {})
15
+ response = client.get("v1/domains/#{domain}/email_forwards", options)
16
16
 
17
17
  response.map { |r| Struct::EmailForward.new(r["email_forward"]) }
18
18
  end
19
+ alias :list_email_forwards :email_forwards
19
20
 
20
21
  # Creates an email forward for a domain.
21
22
  #
@@ -23,13 +24,13 @@ module Dnsimple
23
24
  #
24
25
  # @param [#to_s] domain The domain id or domain name.
25
26
  # @param [Hash] attributes
26
- #
27
27
  # @return [Struct::EmailForward]
28
+ #
28
29
  # @raise [NotFoundError]
29
30
  # @raise [RequestError] When the request fails.
30
- def create_email_forward(domain, attributes = {})
31
+ def create_email_forward(domain, attributes = {}, options = {})
31
32
  Extra.validate_mandatory_attributes(attributes, [:from, :to])
32
- options = { email_forward: attributes }
33
+ options = options.merge({ email_forward: attributes })
33
34
  response = client.post("v1/domains/#{domain}/email_forwards", options)
34
35
 
35
36
  Struct::EmailForward.new(response["email_forward"])
@@ -41,12 +42,12 @@ module Dnsimple
41
42
  #
42
43
  # @param [#to_s] domain The domain id or domain name.
43
44
  # @param [Fixnum] forward The forward id.
44
- #
45
45
  # @return [Struct::EmailForward]
46
+ #
46
47
  # @raise [NotFoundError]
47
48
  # @raise [RequestError] When the request fails.
48
- def email_forward(domain, forward)
49
- response = client.get("v1/domains/#{domain}/email_forwards/#{forward}")
49
+ def email_forward(domain, forward, options = {})
50
+ response = client.get("v1/domains/#{domain}/email_forwards/#{forward}", options)
50
51
 
51
52
  Struct::EmailForward.new(response["email_forward"])
52
53
  end
@@ -57,12 +58,12 @@ module Dnsimple
57
58
  #
58
59
  # @param [#to_s] domain The domain id or domain name.
59
60
  # @param [Fixnum] forward The forward id.
60
- #
61
61
  # @return [void]
62
+ #
62
63
  # @raise [NotFoundError]
63
64
  # @raise [RequestError] When the request fails.
64
- def delete_email_forward(domain, forward)
65
- client.delete("v1/domains/#{domain}/email_forwards/#{forward}")
65
+ def delete_email_forward(domain, forward, options = {})
66
+ client.delete("v1/domains/#{domain}/email_forwards/#{forward}", options)
66
67
  end
67
68
 
68
69
  end
@@ -7,11 +7,11 @@ module Dnsimple
7
7
  # @see http://developer.dnsimple.com/domains/privacy/#enable
8
8
  #
9
9
  # @param [#to_s] domain The domain id or domain name.
10
- #
11
10
  # @return [Struct::WhoisPrivacy]
11
+ #
12
12
  # @raise [RequestError] When the request fails.
13
- def enable_whois_privacy(domain)
14
- response = client.post("v1/domains/#{domain}/whois_privacy")
13
+ def enable_whois_privacy(domain, options = {})
14
+ response = client.post("v1/domains/#{domain}/whois_privacy", options)
15
15
 
16
16
  Struct::WhoisPrivacy.new(response["whois_privacy"])
17
17
  end
@@ -21,11 +21,11 @@ module Dnsimple
21
21
  # @see http://developer.dnsimple.com/domains/privacy/#disable
22
22
  #
23
23
  # @param [#to_s] domain The domain id or domain name.
24
- #
25
24
  # @return [Struct::WhoisPrivacy]
25
+ #
26
26
  # @raise [RequestError] When the request fails.
27
- def disable_whois_privacy(domain)
28
- response = client.delete("v1/domains/#{domain}/whois_privacy")
27
+ def disable_whois_privacy(domain, options = {})
28
+ response = client.delete("v1/domains/#{domain}/whois_privacy", options)
29
29
 
30
30
  Struct::WhoisPrivacy.new(response["whois_privacy"])
31
31
  end