dnsimple 2.0.0.alpha2 → 2.0.0.alpha3
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.
- checksums.yaml +4 -4
- data/CHANGELOG.markdown +6 -2
- data/README.markdown +32 -30
- data/dnsimple.gemspec +1 -2
- data/lib/dnsimple.rb +2 -13
- data/lib/dnsimple/client.rb +164 -53
- data/lib/dnsimple/client/certificates_service.rb +98 -0
- data/lib/dnsimple/client/client_service.rb +8 -0
- data/lib/dnsimple/client/contacts_service.rb +82 -0
- data/lib/dnsimple/client/domains_service.rb +333 -0
- data/lib/dnsimple/client/name_servers_service.rb +69 -0
- data/lib/dnsimple/client/registrars_service.rb +105 -0
- data/lib/dnsimple/client/services_service.rb +95 -0
- data/lib/dnsimple/client/templates_service.rb +180 -0
- data/lib/dnsimple/client/users_service.rb +37 -0
- data/lib/dnsimple/compatibility.rb +46 -0
- data/lib/dnsimple/default.rb +86 -0
- data/lib/dnsimple/error.rb +7 -11
- data/lib/dnsimple/extra.rb +54 -0
- data/lib/dnsimple/struct.rb +29 -0
- data/lib/dnsimple/struct/certificate.rb +56 -0
- data/lib/dnsimple/struct/contact.rb +61 -0
- data/lib/dnsimple/struct/domain.rb +40 -0
- data/lib/dnsimple/struct/email_forward.rb +14 -0
- data/lib/dnsimple/struct/extended_attribute.rb +39 -0
- data/lib/dnsimple/struct/membership.rb +22 -0
- data/lib/dnsimple/struct/price.rb +16 -0
- data/lib/dnsimple/struct/record.rb +22 -0
- data/lib/dnsimple/struct/service.rb +19 -0
- data/lib/dnsimple/struct/template.rb +19 -0
- data/lib/dnsimple/struct/template_record.rb +24 -0
- data/lib/dnsimple/struct/transfer_order.rb +10 -0
- data/lib/dnsimple/struct/user.rb +17 -0
- data/lib/dnsimple/struct/whois_privacy.rb +19 -0
- data/lib/dnsimple/version.rb +1 -1
- data/spec/dnsimple/client/certificates_service_spec.rb +196 -0
- data/spec/dnsimple/client/contacts_service_spec.rb +179 -0
- data/spec/dnsimple/client/domains_service_spec.rb +662 -0
- data/spec/dnsimple/client/name_servers_service_spec.rb +131 -0
- data/spec/dnsimple/client/registrars_service_spec.rb +160 -0
- data/spec/dnsimple/client/services_service_spec.rb +162 -0
- data/spec/dnsimple/client/templates_service_spec.rb +371 -0
- data/spec/dnsimple/client/users_service_spec.rb +70 -0
- data/spec/dnsimple/client_spec.rb +108 -99
- data/spec/dnsimple/compatibility_spec.rb +57 -0
- data/spec/files/2fa/exchange-token.http +8 -11
- data/spec/files/badgateway.http +14 -0
- data/spec/files/certificates/configure/success.http +19 -0
- data/spec/files/certificates/index/success.http +1 -1
- data/spec/files/certificates/notfound.http +19 -0
- data/spec/files/certificates/purchase/success.http +19 -0
- data/spec/files/certificates/show/success.http +1 -1
- data/spec/files/certificates/submit/success.http +19 -0
- data/spec/files/contacts/create/badrequest-missingcontact.http +19 -0
- data/spec/files/contacts/create/badrequest-validationerror.http +19 -0
- data/spec/files/contacts/create/created.http +22 -0
- data/spec/files/contacts/delete/success-204.http +18 -0
- data/spec/files/{extended_attributes/com.http → contacts/delete/success.http} +5 -5
- data/spec/files/{domains/auto_renewal_enable → contacts/index}/success.http +6 -6
- data/spec/files/contacts/notfound.http +19 -0
- data/spec/files/contacts/update/success.http +21 -0
- data/spec/files/domains/create/created.http +21 -0
- data/spec/files/domains/index/success.http +11 -9
- data/spec/files/domains/notfound.http +11 -9
- data/spec/files/domains/show/success.http +12 -10
- data/spec/files/domains_autorenewal/disable/success.http +21 -0
- data/spec/files/domains_autorenewal/enable/success.http +21 -0
- data/spec/files/domains_autorenewal/notfound-domain.http +19 -0
- data/spec/files/domains_forwards/create/created.http +22 -0
- data/spec/files/domains_forwards/delete/success.http +17 -0
- data/spec/files/domains_forwards/get/success.http +21 -0
- data/spec/files/domains_forwards/list/success.http +21 -0
- data/spec/files/domains_forwards/notfound-domain.http +19 -0
- data/spec/files/domains_forwards/notfound.http +19 -0
- data/spec/files/domains_records/create/created.http +21 -0
- data/spec/files/domains_records/delete/success-204.http +18 -0
- data/spec/files/{contacts/show/notfound.http → domains_records/delete/success.http} +9 -7
- data/spec/files/{records → domains_records}/index/success.http +0 -0
- data/spec/files/{records/show → domains_records}/notfound.http +1 -1
- data/spec/files/{records → domains_records}/show/success.http +0 -0
- data/spec/files/domains_records/update/success.http +21 -0
- data/spec/files/domains_sharing/create/success.http +21 -0
- data/spec/files/domains_sharing/delete/success.http +17 -0
- data/spec/files/domains_sharing/list/success.http +21 -0
- data/spec/files/domains_sharing/notfound-domain.http +19 -0
- data/spec/files/domains_sharing/notfound.http +19 -0
- data/spec/files/domains_whois_privacy/disable/success.http +21 -0
- data/spec/files/domains_whois_privacy/enable/success.http +22 -0
- data/spec/files/domains_zones/get/success.http +21 -0
- data/spec/files/domains_zones/notfound-domain.http +19 -0
- data/spec/files/{domains/auto_renewal_disable/notfound.http → nameservers/change/success.http} +23 -21
- data/spec/files/nameservers/deregister/success.http +17 -0
- data/spec/files/{domains/auto_renewal_enable/notfound.http → nameservers/list/success.http} +23 -21
- data/spec/files/nameservers/notfound-domain.http +19 -0
- data/spec/files/nameservers/register/badrequest-valueerror.http +19 -0
- data/spec/files/nameservers/register/success.http +21 -0
- data/spec/files/registrars/check/available.http +19 -0
- data/spec/files/registrars/check/registered.http +21 -0
- data/spec/files/registrars/register/badrequest-missingdomain.http +19 -0
- data/spec/files/registrars/register/badrequest-missingregistrant.http +19 -0
- data/spec/files/registrars/register/success.http +21 -0
- data/spec/files/registrars/renew/badrequest-missingrenewal.http +19 -0
- data/spec/files/registrars/renew/badrequest-unable.http +19 -0
- data/spec/files/registrars/renew/success.http +21 -0
- data/spec/files/registrars/transfer/success.http +21 -0
- data/spec/files/registrars_extended_attributes/list/success.http +21 -0
- data/spec/files/registrars_prices/list/success.http +21 -0
- data/spec/files/services/applied/success.http +21 -0
- data/spec/files/services/apply/success.http +21 -0
- data/spec/files/services/available/success.http +21 -0
- data/spec/files/services/index/success.http +21 -0
- data/spec/files/services/notfound.http +19 -0
- data/spec/files/services/show/success.http +21 -0
- data/spec/files/services/unapply/success.http +21 -0
- data/spec/files/subscription/show/success.http +21 -0
- data/spec/files/templates/apply/success.http +21 -0
- data/spec/files/templates/create/created.http +22 -0
- data/spec/files/templates/delete/success-204.http +21 -0
- data/spec/files/templates/delete/success.http +21 -0
- data/spec/files/templates/index/success.http +21 -0
- data/spec/files/templates/notfound.http +19 -0
- data/spec/files/templates/show/success.http +12 -10
- data/spec/files/templates/update/success.http +21 -0
- data/spec/files/templates_records/create/created.http +22 -0
- data/spec/files/templates_records/delete/success-204.http +19 -0
- data/spec/files/templates_records/delete/success.http +21 -0
- data/spec/files/templates_records/index/success.http +21 -0
- data/spec/files/templates_records/notfound.http +19 -0
- data/spec/files/templates_records/show/success.http +21 -0
- data/spec/files/templates_records/update/success.http +21 -0
- data/spec/files/users/user/success.http +21 -0
- data/spec/spec_helper.rb +0 -2
- metadata +206 -73
- data/lib/dnsimple/base.rb +0 -10
- data/lib/dnsimple/certificate.rb +0 -143
- data/lib/dnsimple/contact.rb +0 -157
- data/lib/dnsimple/domain.rb +0 -252
- data/lib/dnsimple/extended_attribute.rb +0 -52
- data/lib/dnsimple/record.rb +0 -94
- data/lib/dnsimple/service.rb +0 -42
- data/lib/dnsimple/template.rb +0 -65
- data/lib/dnsimple/template_record.rb +0 -80
- data/lib/dnsimple/transfer_order.rb +0 -34
- data/lib/dnsimple/user.rb +0 -50
- data/spec/dnsimple/certificate_spec.rb +0 -59
- data/spec/dnsimple/contact_spec.rb +0 -45
- data/spec/dnsimple/domain_spec.rb +0 -241
- data/spec/dnsimple/extended_attributes_spec.rb +0 -54
- data/spec/dnsimple/record_spec.rb +0 -51
- data/spec/dnsimple/template_spec.rb +0 -31
- data/spec/dnsimple/user_spec.rb +0 -70
- data/spec/files/account/user/success.http +0 -19
- data/spec/files/certificates/show/notfound.http +0 -17
- data/spec/files/domains/auto_renewal_disable/success.http +0 -23
- data/spec/files/domains/create/success.http +0 -19
- data/spec/files/extended_attributes/ca.http +0 -19
- data/spec/files/extended_attributes/success.http +0 -19
- data/spec/files/templates/show/notfound.http +0 -17
@@ -0,0 +1,86 @@
|
|
1
|
+
module Dnsimple
|
2
|
+
|
3
|
+
# Default configuration options for {Client}
|
4
|
+
module Default
|
5
|
+
|
6
|
+
# Default API endpoint
|
7
|
+
API_ENDPOINT = "https://api.dnsimple.com/".freeze
|
8
|
+
|
9
|
+
# Default User Agent header
|
10
|
+
USER_AGENT = "dnsimple-ruby/#{VERSION}".freeze
|
11
|
+
|
12
|
+
class << self
|
13
|
+
|
14
|
+
# List of configurable keys for {Client}
|
15
|
+
# @return [Array] of option keys
|
16
|
+
def keys
|
17
|
+
@keys ||= [
|
18
|
+
:api_endpoint,
|
19
|
+
:username,
|
20
|
+
:password,
|
21
|
+
:exchange_token,
|
22
|
+
:api_token,
|
23
|
+
:domain_api_token,
|
24
|
+
:user_agent,
|
25
|
+
:proxy,
|
26
|
+
]
|
27
|
+
end
|
28
|
+
|
29
|
+
# Configuration options
|
30
|
+
# @return [Hash]
|
31
|
+
def options
|
32
|
+
Hash[keys.map { |key| [key, send(key)]}]
|
33
|
+
end
|
34
|
+
|
35
|
+
# Default API endpoint from ENV or {API_ENDPOINT}
|
36
|
+
# @return [String]
|
37
|
+
def api_endpoint
|
38
|
+
ENV['DNSIMPLE_API_ENDPOINT'] || API_ENDPOINT
|
39
|
+
end
|
40
|
+
|
41
|
+
# Default DNSimple username for Basic Auth from ENV
|
42
|
+
# @return [String]
|
43
|
+
def username
|
44
|
+
ENV['DNSIMPLE_USERNAME']
|
45
|
+
end
|
46
|
+
|
47
|
+
# Default DNSimple password for Basic Auth from ENV
|
48
|
+
# @return [String]
|
49
|
+
def password
|
50
|
+
ENV['DNSIMPLE_PASSWORD']
|
51
|
+
end
|
52
|
+
|
53
|
+
# Default DNSimple Exchange Token for Basic Auth from ENV
|
54
|
+
# @return [String]
|
55
|
+
def exchange_token
|
56
|
+
ENV['DNSIMPLE_API_EXCHANGE_TOKEN']
|
57
|
+
end
|
58
|
+
|
59
|
+
# Default DNSimple API Token for Token Auth from ENV
|
60
|
+
# @return [String]
|
61
|
+
def domain_api_token
|
62
|
+
ENV['DNSIMPLE_API_TOKEN']
|
63
|
+
end
|
64
|
+
|
65
|
+
# Default DNSimple Domain API Token for Token Auth from ENV
|
66
|
+
# @return [String]
|
67
|
+
def api_token
|
68
|
+
ENV['DNSIMPLE_API_DOMAIN_TOKEN']
|
69
|
+
end
|
70
|
+
|
71
|
+
# Default User-Agent header string from ENV or {USER_AGENT}
|
72
|
+
# @return [String]
|
73
|
+
def user_agent
|
74
|
+
ENV['DNSIMPLE_USER_AGENT'] || USER_AGENT
|
75
|
+
end
|
76
|
+
|
77
|
+
# Default Proxy address:port from ENV
|
78
|
+
# @return [String]
|
79
|
+
def proxy
|
80
|
+
ENV['DNSIMPLE_PROXY']
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
end
|
data/lib/dnsimple/error.rb
CHANGED
@@ -3,20 +3,16 @@ module Dnsimple
|
|
3
3
|
class Error < StandardError
|
4
4
|
end
|
5
5
|
|
6
|
-
class
|
7
|
-
|
8
|
-
|
9
|
-
class RecordNotFound < Error
|
10
|
-
end
|
6
|
+
class RequestError < Error
|
7
|
+
attr_reader :response
|
11
8
|
|
12
|
-
|
13
|
-
|
9
|
+
def initialize(response)
|
10
|
+
@response = response
|
11
|
+
super("#{response.code}")
|
12
|
+
end
|
14
13
|
end
|
15
14
|
|
16
|
-
class
|
17
|
-
def initialize(description, response)
|
18
|
-
super("#{description}: #{response["error"]}")
|
19
|
-
end
|
15
|
+
class RecordNotFound < RequestError
|
20
16
|
end
|
21
17
|
|
22
18
|
class AuthenticationError < Error
|
@@ -0,0 +1,54 @@
|
|
1
|
+
module Dnsimple
|
2
|
+
module Extra
|
3
|
+
|
4
|
+
# Returns a new hash with +self+ and +other+ merged recursively.
|
5
|
+
#
|
6
|
+
# h1 = { a: true, b: { c: [1, 2, 3] } }
|
7
|
+
# h2 = { a: false, b: { x: [3, 4, 5] } }
|
8
|
+
#
|
9
|
+
# h1.deep_merge(h2) #=> { a: false, b: { c: [1, 2, 3], x: [3, 4, 5] } }
|
10
|
+
#
|
11
|
+
# Like with Hash#merge in the standard library, a block can be provided
|
12
|
+
# to merge values:
|
13
|
+
#
|
14
|
+
# h1 = { a: 100, b: 200, c: { c1: 100 } }
|
15
|
+
# h2 = { b: 250, c: { c1: 200 } }
|
16
|
+
# h1.deep_merge(h2) { |key, this_val, other_val| this_val + other_val }
|
17
|
+
# # => { a: 100, b: 450, c: { c1: 300 } }
|
18
|
+
def self.deep_merge(this, other, &block)
|
19
|
+
deep_merge!(this.dup, other, &block)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Same as +deep_merge+, but modifies +self+.
|
23
|
+
def self.deep_merge!(this, other, &block)
|
24
|
+
other.each_pair do |current_key, other_value|
|
25
|
+
this_value = this[current_key]
|
26
|
+
|
27
|
+
this[current_key] = if this_value.is_a?(Hash) && other_value.is_a?(Hash)
|
28
|
+
deep_merge(this_value, other_value, &block)
|
29
|
+
else
|
30
|
+
if block_given? && key?(current_key)
|
31
|
+
block.call(current_key, this_value, other_value)
|
32
|
+
else
|
33
|
+
other_value
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
this
|
39
|
+
end
|
40
|
+
|
41
|
+
# Validates the presence of mandatory attributes.
|
42
|
+
#
|
43
|
+
# @param [Hash] attributes
|
44
|
+
# @param [Array<Symbol>] required
|
45
|
+
# @return [void]
|
46
|
+
# @raise [ArgumentError]
|
47
|
+
def self.validate_mandatory_attributes(attributes, required)
|
48
|
+
required.each do |name|
|
49
|
+
attributes.key?(name) or raise(ArgumentError, ":#{name} is required")
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|
@@ -0,0 +1,29 @@
|
|
1
|
+
module Dnsimple
|
2
|
+
module Struct
|
3
|
+
|
4
|
+
class Base
|
5
|
+
def initialize(attributes = {})
|
6
|
+
attributes.each do |key, value|
|
7
|
+
m = "#{key}=".to_sym
|
8
|
+
self.send(m, value) if self.respond_to?(m)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
require 'dnsimple/struct/certificate'
|
17
|
+
require 'dnsimple/struct/contact'
|
18
|
+
require 'dnsimple/struct/domain'
|
19
|
+
require 'dnsimple/struct/email_forward'
|
20
|
+
require 'dnsimple/struct/extended_attribute'
|
21
|
+
require 'dnsimple/struct/membership'
|
22
|
+
require 'dnsimple/struct/price'
|
23
|
+
require 'dnsimple/struct/record'
|
24
|
+
require 'dnsimple/struct/service'
|
25
|
+
require 'dnsimple/struct/template'
|
26
|
+
require 'dnsimple/struct/template_record'
|
27
|
+
require 'dnsimple/struct/transfer_order'
|
28
|
+
require 'dnsimple/struct/user'
|
29
|
+
require 'dnsimple/struct/whois_privacy'
|
@@ -0,0 +1,56 @@
|
|
1
|
+
module Dnsimple
|
2
|
+
module Struct
|
3
|
+
|
4
|
+
class Certificate < Base
|
5
|
+
# @return [Fixnum] The certificate ID in DNSimple.
|
6
|
+
attr_accessor :id
|
7
|
+
|
8
|
+
# @return [Fixnum] The associated domain ID.
|
9
|
+
attr_accessor :domain_id
|
10
|
+
|
11
|
+
# The Fixnum associated contact ID.
|
12
|
+
attr_accessor :contact_id
|
13
|
+
|
14
|
+
# The String subdomain on the certificate.
|
15
|
+
attr_accessor :name
|
16
|
+
|
17
|
+
# The String state.
|
18
|
+
attr_accessor :state
|
19
|
+
|
20
|
+
# The String Certificate Signing Request.
|
21
|
+
attr_accessor :csr
|
22
|
+
|
23
|
+
# The String SSL certificate.
|
24
|
+
# It is set only if the order issued by the Certificate Authority.
|
25
|
+
attr_accessor :ssl_certificate
|
26
|
+
|
27
|
+
# The String private key.
|
28
|
+
# It is set only if DNSimple generated the Certificate Signing Request.
|
29
|
+
attr_accessor :private_key
|
30
|
+
|
31
|
+
# The String approver email address
|
32
|
+
# It is set only if the state is submitted.
|
33
|
+
attr_accessor :approver_email
|
34
|
+
|
35
|
+
# The Array of all emails that can be used to approve the certificate.
|
36
|
+
# It is set only if the state is configured.
|
37
|
+
attr_accessor :approver_emails
|
38
|
+
|
39
|
+
# @return [String] When the certificate was created in DNSimple.
|
40
|
+
attr_accessor :created_at
|
41
|
+
|
42
|
+
# @return [String] When the certificate was last updated in DNSimple.
|
43
|
+
attr_accessor :updated_at
|
44
|
+
|
45
|
+
# The Date the certificate was configured.
|
46
|
+
attr_accessor :configured_at
|
47
|
+
|
48
|
+
# The Date the certificate will expire.
|
49
|
+
attr_accessor :expires_on
|
50
|
+
|
51
|
+
# The associated Domain.
|
52
|
+
attr_accessor :domain
|
53
|
+
end
|
54
|
+
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,61 @@
|
|
1
|
+
module Dnsimple
|
2
|
+
module Struct
|
3
|
+
|
4
|
+
class Contact < Base
|
5
|
+
# @return [Fixnum] The contact ID in DNSimple.
|
6
|
+
attr_accessor :id
|
7
|
+
|
8
|
+
# @return [String] The label to represent the contact.
|
9
|
+
attr_accessor :label
|
10
|
+
|
11
|
+
# @return [String] The contact first name.
|
12
|
+
attr_accessor :first_name
|
13
|
+
|
14
|
+
# @return [String] The contact last name.
|
15
|
+
attr_accessor :last_name
|
16
|
+
|
17
|
+
# @return [String] The contact's job title.
|
18
|
+
attr_accessor :job_title
|
19
|
+
|
20
|
+
# @return [String] The name of the organization in which the contact works.
|
21
|
+
attr_accessor :organization_name
|
22
|
+
|
23
|
+
# @return [String] The contact street address.
|
24
|
+
attr_accessor :address1
|
25
|
+
|
26
|
+
# @return [String] Apartment or suite number.
|
27
|
+
attr_accessor :address2
|
28
|
+
|
29
|
+
# @return [String] The city name.
|
30
|
+
attr_accessor :city
|
31
|
+
|
32
|
+
# @return [String] The state or province name.
|
33
|
+
attr_accessor :state_province
|
34
|
+
|
35
|
+
# @return [String] The contact postal code.
|
36
|
+
attr_accessor :postal_code
|
37
|
+
|
38
|
+
# @return [String] The contact country (as a 2-character country code).
|
39
|
+
attr_accessor :country
|
40
|
+
|
41
|
+
# @return [String] The contact phone number.
|
42
|
+
attr_accessor :phone
|
43
|
+
|
44
|
+
# @return [String] The contact fax number (may be omitted).
|
45
|
+
attr_accessor :fax
|
46
|
+
|
47
|
+
# @return [String] The contact email address.
|
48
|
+
attr_accessor :email_address
|
49
|
+
|
50
|
+
# @return [String] When the contact was created in DNSimple.
|
51
|
+
attr_accessor :created_at
|
52
|
+
|
53
|
+
# @return [String] When the contact was last updated in DNSimple.
|
54
|
+
attr_accessor :updated_at
|
55
|
+
|
56
|
+
alias :email :email_address
|
57
|
+
alias :email= :email_address=
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Dnsimple
|
2
|
+
module Struct
|
3
|
+
|
4
|
+
class Domain < Base
|
5
|
+
# @return [Fixnum] The domain ID in DNSimple.
|
6
|
+
attr_accessor :id
|
7
|
+
|
8
|
+
# @return [Fixnum] The associated user ID.
|
9
|
+
attr_accessor :user_id
|
10
|
+
|
11
|
+
# @return [Fixnum] The associated registrant (contact) ID.
|
12
|
+
attr_accessor :registrant_id
|
13
|
+
|
14
|
+
# The String name.
|
15
|
+
attr_accessor :name
|
16
|
+
|
17
|
+
# The String state.
|
18
|
+
attr_accessor :state
|
19
|
+
|
20
|
+
# The String API token
|
21
|
+
attr_accessor :token
|
22
|
+
|
23
|
+
# Is the domain set to auto renew?
|
24
|
+
attr_accessor :auto_renew
|
25
|
+
|
26
|
+
# Is the whois information protected?
|
27
|
+
attr_accessor :whois_protected
|
28
|
+
|
29
|
+
# @return [String] The date the domain will expire.
|
30
|
+
attr_accessor :expires_on
|
31
|
+
|
32
|
+
# @return [String] When the domain was created in DNSimple.
|
33
|
+
attr_accessor :created_at
|
34
|
+
|
35
|
+
# @return [String] When the domain was last updated in DNSimple.
|
36
|
+
attr_accessor :updated_at
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
module Dnsimple
|
2
|
+
module Struct
|
3
|
+
|
4
|
+
class ExtendedAttribute < Base
|
5
|
+
|
6
|
+
class Option < Base
|
7
|
+
# The option name
|
8
|
+
attr_accessor :title
|
9
|
+
|
10
|
+
# The option value
|
11
|
+
attr_accessor :value
|
12
|
+
|
13
|
+
# A long description of the option
|
14
|
+
attr_accessor :description
|
15
|
+
end
|
16
|
+
|
17
|
+
# The extended attribute name
|
18
|
+
attr_accessor :name
|
19
|
+
|
20
|
+
# A description of the extended attribute
|
21
|
+
attr_accessor :description
|
22
|
+
|
23
|
+
# Boolean indicating if the extended attribute is required
|
24
|
+
attr_accessor :required
|
25
|
+
|
26
|
+
def options
|
27
|
+
@options ||= []
|
28
|
+
end
|
29
|
+
|
30
|
+
def options=(opts)
|
31
|
+
@options = opts.map do |opt|
|
32
|
+
ExtendedAttribute::Option.new(opt)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Dnsimple
|
2
|
+
module Struct
|
3
|
+
|
4
|
+
class Membership < Base
|
5
|
+
# @return [Fixnum] The membership ID in DNSimple.
|
6
|
+
attr_accessor :id
|
7
|
+
|
8
|
+
# @return [Fixnum] The associated domain ID.
|
9
|
+
attr_accessor :domain_id
|
10
|
+
|
11
|
+
# @return [Fixnum] The associated user ID.
|
12
|
+
attr_accessor :user_id
|
13
|
+
|
14
|
+
# @return [String] When the membership was created in DNSimple.
|
15
|
+
attr_accessor :created_at
|
16
|
+
|
17
|
+
# @return [String] When the membership was last updated in DNSimple.
|
18
|
+
attr_accessor :updated_at
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Dnsimple
|
2
|
+
module Struct
|
3
|
+
|
4
|
+
class Price < Base
|
5
|
+
attr_accessor :tld
|
6
|
+
attr_accessor :minimum_registration
|
7
|
+
attr_accessor :registration_price
|
8
|
+
attr_accessor :registration_enabled
|
9
|
+
attr_accessor :transfer_price
|
10
|
+
attr_accessor :transfer_enabled
|
11
|
+
attr_accessor :renewal_price
|
12
|
+
attr_accessor :renewal_enabled
|
13
|
+
end
|
14
|
+
|
15
|
+
end
|
16
|
+
end
|