From f5e9bad02ef95125e1bc5d5bc4c15b115e1e9624 Mon Sep 17 00:00:00 2001 From: Joseph Anthony Pasquale Holsten Date: Mon, 7 Nov 2016 09:44:02 -0800 Subject: [PATCH] IPAddrRange: rename from IPAddrDTO --- CHANGELOG.md | 1 + directional_pool.go | 10 +++++----- directional_pools_test.go | 4 ++-- rrset.go | 6 +++--- udnssdk_test.go | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2557a32..4dbf916 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] ### Changed +- IPAddrRange: rename from IPAddrDTO - Client.NewRequest: shallow-copy BaseURL to avoid retaining modifications ## [1.3.0] - 2017-02-28 diff --git a/directional_pool.go b/directional_pool.go index 85569ee..50b8ef0 100644 --- a/directional_pool.go +++ b/directional_pool.go @@ -27,8 +27,8 @@ type AccountLevelGeoDirectionalGroupDTO struct { Codes []string `json:"codes"` } -// IPAddrDTO wraps an IP address range or CIDR block -type IPAddrDTO struct { +// IPAddrRange wraps an IP address range or CIDR block +type IPAddrRange struct { Start string `json:"start,omitempty" terraform:"start"` End string `json:"end,omitempty" terraform:"end"` CIDR string `json:"cidr,omitempty" terraform:"cidr"` @@ -37,9 +37,9 @@ type IPAddrDTO struct { // AccountLevelIPDirectionalGroupDTO wraps an account-level, IP directional-group response type AccountLevelIPDirectionalGroupDTO struct { - Name string `json:"name"` - Description string `json:"description"` - IPs []IPAddrDTO `json:"ips"` + Name string `json:"name"` + Description string `json:"description"` + IPs []IPAddrRange `json:"ips"` } // DirectionalPoolListDTO wraps a list of account-level directional-groups response from a index request diff --git a/directional_pools_test.go b/directional_pools_test.go index db01b57..02aca72 100644 --- a/directional_pools_test.go +++ b/directional_pools_test.go @@ -378,8 +378,8 @@ func Test_IPDirectionalPoolsService_Find(t *testing.T) { want := AccountLevelIPDirectionalGroupDTO{ Name: "unicorn", Description: "unicorn: a service of rainbows", - IPs: []IPAddrDTO{ - IPAddrDTO{Address: "1.2.3.4"}, + IPs: []IPAddrRange{ + IPAddrRange{Address: "1.2.3.4"}, }, } ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/rrset.go b/rrset.go index 1bc1a0b..68823f6 100644 --- a/rrset.go +++ b/rrset.go @@ -166,9 +166,9 @@ type DPRDataInfo struct { // IPInfo wraps the ipInfo object of a DPRDataInfo type IPInfo struct { - Name string `json:"name" terraform:"name"` - IsAccountLevel bool `json:"isAccountLevel,omitempty" terraform:"is_account_level"` - Ips []IPAddrDTO `json:"ips,omitempty" terraform:"-"` + Name string `json:"name" terraform:"name"` + IsAccountLevel bool `json:"isAccountLevel,omitempty" terraform:"is_account_level"` + Ips []IPAddrRange `json:"ips,omitempty" terraform:"-"` } // GeoInfo wraps the geoInfo object of a DPRDataInfo diff --git a/udnssdk_test.go b/udnssdk_test.go index 205dad3..420b173 100644 --- a/udnssdk_test.go +++ b/udnssdk_test.go @@ -25,8 +25,8 @@ var ( testIPDPoolName = "testipdpool" testIPDPoolAddress = "127.0.0.1" testIPDPoolDescr = "A Test IP Directional Pool Group" - testIPAddrDTO = IPAddrDTO{Address: "127.0.0.1"} - testIPDPool = AccountLevelIPDirectionalGroupDTO{Name: "testippool", Description: "An IP Test Pool", IPs: []IPAddrDTO{IPAddrDTO{Address: "127.0.0.1"}}} + testIPAddrDTO = IPAddrRange{Address: "127.0.0.1"} + testIPDPool = AccountLevelIPDirectionalGroupDTO{Name: "testippool", Description: "An IP Test Pool", IPs: []IPAddrRange{IPAddrRange{Address: "127.0.0.1"}}} testGeoDPool = AccountLevelGeoDirectionalGroupDTO{Name: "testgeopool", Description: "A test geo pool", Codes: []string{"US, UK"}} testGeoDPoolName = "testgeodpool" testGeoDPoolDescr = "A Test Geo Directional Pool Group"