diff --git a/lib/dnsimple/struct/record.rb b/lib/dnsimple/struct/record.rb index 2710544d..d652d10e 100644 --- a/lib/dnsimple/struct/record.rb +++ b/lib/dnsimple/struct/record.rb @@ -5,8 +5,8 @@ class Record < Base # @return [Fixnum] The record ID in DNSimple. attr_accessor :id - # @return [Fixnum] The associated domain ID. - attr_accessor :domain_id + # @return [String] The associated zone ID. + attr_accessor :zone_id # @return [Fixnum] The ID of the parent record, if this record is dependent on another record. attr_accessor :parent_id diff --git a/spec/dnsimple/client/zones_records_spec.rb b/spec/dnsimple/client/zones_records_spec.rb index 9853b701..ca41fbdf 100644 --- a/spec/dnsimple/client/zones_records_spec.rb +++ b/spec/dnsimple/client/zones_records_spec.rb @@ -124,7 +124,7 @@ before do stub_request(:get, %r[/v2/#{account_id}/zones/#{zone_id}/records/.+$]) - .to_return(read_http_fixture("getRecord/success.http")) + .to_return(read_http_fixture("getZoneRecord/success.http")) end it "builds the correct request" do @@ -141,7 +141,7 @@ result = response.data expect(result).to be_a(Dnsimple::Struct::Record) expect(result.id).to eq(64784) - expect(result.domain_id).to eq(5841) + expect(result.zone_id).to eq("example.com") expect(result.parent_id).to eq(nil) expect(result.type).to eq("A") expect(result.name).to eq("www") diff --git a/spec/fixtures.http/createZoneRecord/created.http b/spec/fixtures.http/createZoneRecord/created.http index 4f065c81..3ddfdf34 100644 --- a/spec/fixtures.http/createZoneRecord/created.http +++ b/spec/fixtures.http/createZoneRecord/created.http @@ -14,4 +14,4 @@ X-Request-Id: f96f5034-bf0c-4201-9564-493c162e3cb4 X-Runtime: 0.099095 Strict-Transport-Security: max-age=31536000 -{"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:45:13.653Z"}} \ No newline at end of file +{"data":{"id":64784,"zone_id":"example.com","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:45:13.653Z"}} \ No newline at end of file diff --git a/spec/fixtures.http/getRecord/success.http b/spec/fixtures.http/getZoneRecord/success.http similarity index 66% rename from spec/fixtures.http/getRecord/success.http rename to spec/fixtures.http/getZoneRecord/success.http index fd05ebd4..49c93474 100644 --- a/spec/fixtures.http/getRecord/success.http +++ b/spec/fixtures.http/getZoneRecord/success.http @@ -14,4 +14,4 @@ X-Request-Id: 69258cd7-c9e6-4681-aed6-cb5bbdfbb156 X-Runtime: 0.048748 Strict-Transport-Security: max-age=31536000 -{"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:45:13.653Z"}} \ No newline at end of file +{"data":{"id":64784,"zone_id":"example.com","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:45:13.653Z"}} \ No newline at end of file diff --git a/spec/fixtures.http/listZoneRecords/success.http b/spec/fixtures.http/listZoneRecords/success.http index 31fc420a..efb974fe 100644 --- a/spec/fixtures.http/listZoneRecords/success.http +++ b/spec/fixtures.http/listZoneRecords/success.http @@ -14,4 +14,4 @@ X-Request-Id: 9b361b57-43e2-47df-9f00-e7c252bc4d41 X-Runtime: 0.107990 Strict-Transport-Security: max-age=31536000 -{"data":[{"id":64779,"domain_id":5841,"parent_id":null,"name":"","content":"ns1.dnsimple.com admin.dnsimple.com 1452184205 86400 7200 604800 300","ttl":3600,"priority":null,"type":"SOA","system_record":true,"created_at":"2016-01-07T16:30:05.379Z","updated_at":"2016-01-07T16:30:05.379Z"},{"id":64780,"domain_id":5841,"parent_id":null,"name":"","content":"ns1.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.422Z","updated_at":"2016-01-07T16:30:05.422Z"},{"id":64781,"domain_id":5841,"parent_id":null,"name":"","content":"ns2.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.433Z","updated_at":"2016-01-07T16:30:05.433Z"},{"id":64782,"domain_id":5841,"parent_id":null,"name":"","content":"ns3.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.445Z","updated_at":"2016-01-07T16:30:05.445Z"},{"id":64783,"domain_id":5841,"parent_id":null,"name":"","content":"ns4.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.457Z","updated_at":"2016-01-07T16:30:05.457Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":5,"total_pages":1}} \ No newline at end of file +{"data":[{"id":64779,"zone_id":"example.com","parent_id":null,"name":"","content":"ns1.dnsimple.com admin.dnsimple.com 1452184205 86400 7200 604800 300","ttl":3600,"priority":null,"type":"SOA","system_record":true,"created_at":"2016-01-07T16:30:05.379Z","updated_at":"2016-01-07T16:30:05.379Z"},{"id":64780,"zone_id":"example.com","parent_id":null,"name":"","content":"ns1.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.422Z","updated_at":"2016-01-07T16:30:05.422Z"},{"id":64781,"zone_id":"example.com","parent_id":null,"name":"","content":"ns2.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.433Z","updated_at":"2016-01-07T16:30:05.433Z"},{"id":64782,"zone_id":"example.com","parent_id":null,"name":"","content":"ns3.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.445Z","updated_at":"2016-01-07T16:30:05.445Z"},{"id":64783,"zone_id":"example.com","parent_id":null,"name":"","content":"ns4.dnsimple.com","ttl":3600,"priority":null,"type":"NS","system_record":true,"created_at":"2016-01-07T16:30:05.457Z","updated_at":"2016-01-07T16:30:05.457Z"}],"pagination":{"current_page":1,"per_page":30,"total_entries":5,"total_pages":1}} \ No newline at end of file diff --git a/spec/fixtures.http/register/success.http b/spec/fixtures.http/register/success.http index 567e77ff..9405ec99 100644 --- a/spec/fixtures.http/register/success.http +++ b/spec/fixtures.http/register/success.http @@ -14,4 +14,4 @@ X-Request-Id: 8b378ee7-d8fa-4459-a1b0-a18bfd2354bb X-Runtime: 13.365767 Strict-Transport-Security: max-age=31536000 -{"data":{"id":1,"account_id":1010,"registrant_id":2,"name":"example.weppos","unicode_name":"example.weppos","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"}} \ No newline at end of file +{"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"}} \ No newline at end of file