diff --git a/configgtm-v1_3/asmap.go b/configgtm-v1_3/asmap.go index 3a6a77cd..40027ed8 100644 --- a/configgtm-v1_3/asmap.go +++ b/configgtm-v1_3/asmap.go @@ -14,15 +14,15 @@ import ( // AsAssignment represents a GTM asmap assignment structure type AsAssignment struct { DatacenterBase - AsNumbers []int64 `json:"asNumbers"` + AsNumbers []int64 `json:"asNumbers,omitempty"` } // AsMap represents a GTM AsMap type AsMap struct { DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"` - Assignments []*AsAssignment `json:"assignments"` + Assignments []*AsAssignment `json:"assignments,omitempty"` Name string `json:"name"` - Links []*Link `json:"links"` + Links []*Link `json:"links,omitempty"` } // NewAsMap creates a new asMap diff --git a/configgtm-v1_3/cidrmap.go b/configgtm-v1_3/cidrmap.go index 9182dfd3..23c999f0 100644 --- a/configgtm-v1_3/cidrmap.go +++ b/configgtm-v1_3/cidrmap.go @@ -14,15 +14,15 @@ import ( //CidrAssignment represents a GTM cidr assignment element type CidrAssignment struct { DatacenterBase - Blocks []string `json:"blocks"` + Blocks []string `json:"blocks,omitempty"` } // CidrMap represents a GTM cidrMap element type CidrMap struct { DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"` - Assignments []*CidrAssignment `json:"assignments"` + Assignments []*CidrAssignment `json:"assignments,omitempty"` Name string `json:"name"` - Links []*Link `json:"links"` + Links []*Link `json:"links,omitempty"` } // CidrMapList represents a GTM returned cidrmap list body diff --git a/configgtm-v1_3/common.go b/configgtm-v1_3/common.go index ef8383d5..c97a1664 100644 --- a/configgtm-v1_3/common.go +++ b/configgtm-v1_3/common.go @@ -43,12 +43,12 @@ func setVersionHeader(req *http.Request, version string) { // response Status is returned on Create, Update or Delete operations for all entity types type ResponseStatus struct { - ChangeId string `json:"changeId"` - Links *[]Link `json:"links"` - Message string `json:"message"` - PassingValidation bool `json:"passingValidation"` - PropagationStatus string `json:"propagationStatus"` - PropagationStatusDate string `json:"propagationStatusDate"` + ChangeId string `json:"changeId,omitempty"` + Links *[]Link `json:"links,omitempty"` + Message string `json:"message,omitempty"` + PassingValidation bool `json:"passingValidation,omitempty"` + PropagationStatus string `json:"propagationStatus,omitempty"` + PropagationStatusDate string `json:"propagationStatusDate,omitempty"` } // NewResponseStatus returns a new ResponseStatus struct @@ -108,9 +108,9 @@ type Link struct { // type LoadObject struct { - LoadObject string `json:"loadObject"` - LoadObjectPort int `json:"loadObjectPort"` - LoadServers []string `json:"loadServers"` + LoadObject string `json:"loadObject,omitempty"` + LoadObjectPort int `json:"loadObjectPort,omitempty"` + LoadServers []string `json:"loadServers,omitempty"` } // NewLoadObject returns a new LoadObject structure diff --git a/configgtm-v1_3/datacenter.go b/configgtm-v1_3/datacenter.go index 7552e0aa..2993d245 100644 --- a/configgtm-v1_3/datacenter.go +++ b/configgtm-v1_3/datacenter.go @@ -14,24 +14,24 @@ import ( // Datacenter represents a GTM datacenter type Datacenter struct { - City string `json:"city"` - CloneOf int `json:"cloneOf"` + City string `json:"city,omitempty"` + CloneOf int `json:"cloneOf,omitempty"` CloudServerTargeting bool `json:"cloudServerTargeting"` - Continent string `json:"continent"` - Country string `json:"country"` - DefaultLoadObject *LoadObject `json:"defaultLoadObject"` - Latitude float64 `json:"latitude"` - Links []*Link `json:"links"` - Longitude float64 `json:"longitude"` - Nickname string `json:"nickname"` - PingInterval int `json:"pingInterval"` - PingPacketSize int `json:"pingPacketSize"` - DatacenterId int `json:"datacenterId"` - ScorePenalty int `json:"scorePenalty"` - ServermonitorLivenessCount int `json:"servermonitorLivenessCount"` - ServermonitorLoadCount int `json:"servermonitorLoadCount"` - ServermonitorPool string `json:"servermonitorPool"` - StateOrProvince string `json:"stateOrProvince"` + Continent string `json:"continent,omitempty"` + Country string `json:"country,omitempty"` + DefaultLoadObject *LoadObject `json:"defaultLoadObject,omitempty"` + Latitude float64 `json:"latitude,omitempty"` + Links []*Link `json:"links,omitempty"` + Longitude float64 `json:"longitude,omitempty"` + Nickname string `json:"nickname,omitempty"` + PingInterval int `json:"pingInterval,omitempty"` + PingPacketSize int `json:"pingPacketSize,omitempty"` + DatacenterId int `json:"datacenterId,omitempty"` + ScorePenalty int `json:"scorePenalty,omitempty"` + ServermonitorLivenessCount int `json:"servermonitorLivenessCount,omitempty"` + ServermonitorLoadCount int `json:"servermonitorLoadCount,omitempty"` + ServermonitorPool string `json:"servermonitorPool,omitempty"` + StateOrProvince string `json:"stateOrProvince,omitempty"` Virtual bool `json:"virtual"` } diff --git a/configgtm-v1_3/domain.go b/configgtm-v1_3/domain.go index cf9ec679..638abbc3 100644 --- a/configgtm-v1_3/domain.go +++ b/configgtm-v1_3/domain.go @@ -16,44 +16,44 @@ import ( type Domain struct { Name string `json:"name"` Type string `json:"type"` - AsMaps []*AsMap `json:"asMaps"` - Resources []*Resource `json:"resources"` - DefaultUnreachableThreshold float32 `json:"defaultUnreachableThreshold"` - EmailNotificationList []string `json:"emailNotificationList"` - MinPingableRegionFraction float32 `json:"minPingableRegionFraction"` - DefaultTimeoutPenalty int `json:"defaultTimeoutPenalty"` - Datacenters []*Datacenter `json:"datacenters"` - ServermonitorLivenessCount int `json:"servermonitorLivenessCount"` - RoundRobinPrefix string `json:"roundRobinPrefix"` + AsMaps []*AsMap `json:"asMaps,omitempty"` + Resources []*Resource `json:"resources,omitempty"` + DefaultUnreachableThreshold float32 `json:"defaultUnreachableThreshold,omitempty"` + EmailNotificationList []string `json:"emailNotificationList,omitempty"` + MinPingableRegionFraction float32 `json:"minPingableRegionFraction,omitempty"` + DefaultTimeoutPenalty int `json:"defaultTimeoutPenalty,omitempty"` + Datacenters []*Datacenter `json:"datacenters,omitempty"` + ServermonitorLivenessCount int `json:"servermonitorLivenessCount,omitempty"` + RoundRobinPrefix string `json:"roundRobinPrefix,omitempty"` ServermonitorLoadCount int `json:"servermonitorLoadCount"` PingInterval int `json:"pingInterval"` - MaxTTL int64 `json:"maxTTL"` - LoadImbalancePercentage float64 `json:"loadImbalancePercentage"` - DefaultHealthMax int `json:"defaultHealthMax"` - LastModified string `json:"lastModified"` - Status *ResponseStatus `json:"status"` - MapUpdateInterval int `json:"mapUpdateInterval"` - MaxProperties int `json:"maxProperties"` - MaxResources int `json:"maxResources"` - DefaultSslClientPrivateKey string `json:"defaultSslClientPrivateKey"` - DefaultErrorPenalty int `json:"defaultErrorPenalty"` - Links []*Link `json:"links"` - Properties []*Property `json:"properties"` - MaxTestTimeout float64 `json:"maxTestTimeout"` + MaxTTL int64 `json:"maxTTL,omitempty"` + LoadImbalancePercentage float64 `json:"loadImbalancePercentage,omitempty"` + DefaultHealthMax float64 `json:"defaultHealthMax,omitempty"` + LastModified string `json:"lastModified,omitempty"` + Status *ResponseStatus `json:"status,omitempty"` + MapUpdateInterval int `json:"mapUpdateInterval,omitempty"` + MaxProperties int `json:"maxProperties,omitempty"` + MaxResources int `json:"maxResources,omitempty"` + DefaultSslClientPrivateKey string `json:"defaultSslClientPrivateKey,omitempty"` + DefaultErrorPenalty int `json:"defaultErrorPenalty,omitempty"` + Links []*Link `json:"links,omitempty"` + Properties []*Property `json:"properties,omitempty"` + MaxTestTimeout float64 `json:"maxTestTimeout,omitempty"` CnameCoalescingEnabled bool `json:"cnameCoalescingEnabled"` DefaultHealthMultiplier int `json:"defaultHealthMultiplier"` - ServermonitorPool string `json:"servermonitorPool"` + ServermonitorPool string `json:"servermonitorPool,omitempty"` LoadFeedback bool `json:"loadFeedback"` - MinTTL int64 `json:"minTTL"` - GeographicMaps []*GeoMap `json:"geographicMaps"` - CidrMaps []*CidrMap `json:"cidrMaps"` - DefaultMaxUnreachablePenalty int `json:"defaultMaxUnreachablePenalty"` - DefaultHealthThreshold int `json:"defaultHealthThreshold"` - LastModifiedBy string `json:"lastModifiedBy"` - ModificationComments string `json:"modificationComments"` - MinTestInterval int `json:"minTestInterval"` - PingPacketSize int `json:"pingPacketSize"` - DefaultSslClientCertificate string `json:"defaultSslClientCertificate"` + MinTTL int64 `json:"minTTL,omitempty"` + GeographicMaps []*GeoMap `json:"geographicMaps,omitempty"` + CidrMaps []*CidrMap `json:"cidrMaps,omitempty"` + DefaultMaxUnreachablePenalty int `json:"defaultMaxUnreachablePenalty,omitempty"` + DefaultHealthThreshold float64 `json:"defaultHealthThreshold,omitempty"` + LastModifiedBy string `json:"lastModifiedBy,omitempty"` + ModificationComments string `json:"modificationComments,omitempty"` + MinTestInterval int `json:"minTestInterval,omitempty"` + PingPacketSize int `json:"pingPacketSize,omitempty"` + DefaultSslClientCertificate string `json:"defaultSslClientCertificate,omitempty"` } type DomainsList struct { diff --git a/configgtm-v1_3/geomap.go b/configgtm-v1_3/geomap.go index b30dea26..30226f32 100644 --- a/configgtm-v1_3/geomap.go +++ b/configgtm-v1_3/geomap.go @@ -14,15 +14,15 @@ import ( // GeoAssigment represents a GTM geo assignment element type GeoAssignment struct { DatacenterBase - Countries []string `json:"countries"` + Countries []string `json:"countries,omitempty"` } // GeoMap represents a GTM GeoMap type GeoMap struct { DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"` - Assignments []*GeoAssignment `json:"assignments"` + Assignments []*GeoAssignment `json:"assignments,omitempty"` Name string `json:"name"` - Links []*Link `json:"links"` + Links []*Link `json:"links,omitempty"` } // GeoMapList represents the returned GTM GeoMap List body diff --git a/configgtm-v1_3/property.go b/configgtm-v1_3/property.go index 29666e67..4b61c9a4 100644 --- a/configgtm-v1_3/property.go +++ b/configgtm-v1_3/property.go @@ -15,42 +15,42 @@ import ( type TrafficTarget struct { DatacenterId int `json:"datacenterId"` Enabled bool `json:"enabled"` - Weight float64 `json:"weight"` - Servers []string `json:"servers"` - Name string `json:"name"` - HandoutCName string `json:"handoutCName"` + Weight float64 `json:"weight,omitempty"` + Servers []string `json:"servers,omitempty"` + Name string `json:"name,omitempty"` + HandoutCName string `json:"handoutCName,omitempty"` } // MxRecord struc type MxRecord struct { - Exchange string `json:"exchange"` - Preference int `json:"preference"` + Exchange string `json:"exchange,omitempty"` + Preference int `json:"preference,omitempty"` } type LivenessTest struct { Name string `json:"name"` - ErrorPenalty int `json:"errorPenalty"` + ErrorPenalty float64 `json:"errorPenalty"` PeerCertificateVerification bool `json:"peerCertificateVerification"` - TestInterval int `json:"testInterval"` - TestObject string `json:"testObject"` - Links []*Link `json:"links"` - RequestString string `json:"requestString"` - ResponseString string `json:"responseString"` + TestInterval int `json:"testInterval,omitempty"` + TestObject string `json:"testObject,omitempty"` + Links []*Link `json:"links,omitempty"` + RequestString string `json:"requestString,omitempty"` + ResponseString string `json:"responseString,omitempty"` HttpError3xx bool `json:"httpError3xx"` HttpError4xx bool `json:"httpError4xx"` HttpError5xx bool `json:"httpError5xx"` - TestObjectProtocol string `json:"testObjectProtocol"` - TestObjectPassword string `json:"testObjectPassword"` - TestObjectPort int `json:"testObjectPort"` - SslClientPrivateKey string `json:"sslClientPrivateKey"` - SslClientCertificate string `json:"sslClientCertificate"` + TestObjectProtocol string `json:"testObjectProtocol,omitempty"` + TestObjectPassword string `json:"testObjectPassword,omitempty"` + TestObjectPort int `json:"testObjectPort,omitempty"` + SslClientPrivateKey string `json:"sslClientPrivateKey,omitempty"` + SslClientCertificate string `json:"sslClientCertificate,omitempty"` DisableNonstandardPortWarning bool `json:"disableNonstandardPortWarning"` - HostHeader string `json:"hostHeader"` - TestObjectUsername string `json:"testObjectUsername"` - TestTimeout float32 `json:"testTimeout"` - TimeoutPenalty int `json:"timeoutPenalty"` - AnswerRequired bool `json:"answerRequired"` - ResourceType string `json:"resourceType"` + HostHeader string `json:"hostHeader,omitempty"` + TestObjectUsername string `json:"testObjectUsername,omitempty"` + TestTimeout float32 `json:"testTimeout,omitempty"` + TimeoutPenalty float64 `json:"timeoutPenalty,omitempty"` + AnswersRequired bool `json:"answersRequired"` + ResourceType string `json:"resourceType,omitempty"` RecursionRequested bool `json:"recursionRequested"` } @@ -59,36 +59,36 @@ type Property struct { Name string `json:"name"` Type string `json:"type"` Ipv6 bool `json:"ipv6"` - ScoreAggregationType string `json:"scoreAggregationType"` - StickinessBonusPercent int `json:"stickinessBonusPercentage"` - StickinessBonusConstant int `json:"stickinessBonusConstant"` - HealthThreshold int `json:"healthThreshold"` + ScoreAggregationType string `json:"scoreAggregationType,omitempty"` + StickinessBonusPercent int `json:"stickinessBonusPercentage,omitempty"` + StickinessBonusConstant int `json:"stickinessBonusConstant,omitempty"` + HealthThreshold float64 `json:"healthThreshold,omitempty"` UseComputedTargets bool `json:"useComputedTargets"` - BackupIp string `json:"backupIp"` + BackupIp string `json:"backupIp,omitempty"` BalanceByDownloadScore bool `json:"balanceByDownloadScore"` - StaticTTL int `json:"staticTTL"` - LastModified string `json:"lastModified"` - UnreachableThreshold int `json:"unreachableThreshold"` - HealthMultiplier int `json:"healthMultiplier"` - DynamicTTL int `json:"dynamicTTL"` - MaxUnreachablePenalty int `json:"maxUnreachablePenalty"` - MapName string `json:"mapName"` - HandoutLimit int `json:"handoutLimit"` - HandoutMode string `json:"handoutMode"` - FailoverDelay int `json:"failoverDelay"` - BackupCName string `json:"backupCName"` - FailbackDelay int `json:"failbackDelay"` - LoadImbalancePercentage float64 `json:"loadImbalancePercentage"` - HealthMax int `json:"healthMax"` + StaticTTL int `json:"staticTTL,omitempty"` + LastModified string `json:"lastModified,omitempty"` + UnreachableThreshold float64 `json:"unreachableThreshold,omitempty"` + HealthMultiplier float64 `json:"healthMultiplier,omitempty"` + DynamicTTL int `json:"dynamicTTL,omitempty"` + MaxUnreachablePenalty int `json:"maxUnreachablePenalty,omitempty"` + MapName string `json:"mapName,omitempty"` + HandoutLimit int `json:"handoutLimit,omitempty"` + HandoutMode string `json:"handoutMode,omitempty"` + FailoverDelay int `json:"failoverDelay,omitempty"` + BackupCName string `json:"backupCName,omitempty"` + FailbackDelay int `json:"failbackDelay,omitempty"` + LoadImbalancePercentage float64 `json:"loadImbalancePercentage,omitempty"` + HealthMax float64 `json:"healthMax,omitempty"` GhostDemandReporting bool `json:"ghostDemandReporting"` - Comments string `json:"comments"` - CName string `json:"cname"` - WeightedHashBitsForIPv4 int `json:"weightedHashBitsForIPv4"` - WeightedHashBitsForIPv6 int `json:"weightedHashBitsForIPv6"` - TrafficTargets []*TrafficTarget `json:"trafficTargets"` - MxRecords []*MxRecord `json:"mxRecords"` - Links []*Link `json:"links"` - LivenessTests []*LivenessTest `json:"livenessTests"` + Comments string `json:"comments,omitempty"` + CName string `json:"cname,omitempty"` + WeightedHashBitsForIPv4 int `json:"weightedHashBitsForIPv4,omitempty"` + WeightedHashBitsForIPv6 int `json:"weightedHashBitsForIPv6,omitempty"` + TrafficTargets []*TrafficTarget `json:"trafficTargets,omitempty"` + MxRecords []*MxRecord `json:"mxRecords,omitempty"` + Links []*Link `json:"links,omitempty"` + LivenessTests []*LivenessTest `json:"livenessTests,omitempty"` } type PropertyList struct { diff --git a/configgtm-v1_3/resource.go b/configgtm-v1_3/resource.go index cf76328a..7fc97953 100644 --- a/configgtm-v1_3/resource.go +++ b/configgtm-v1_3/resource.go @@ -21,19 +21,19 @@ type ResourceInstance struct { // Resource represents a GTM resource type Resource struct { Type string `json:"type"` - HostHeader string `json:"hostHeader"` - LeastSquaresDecay int `json:"leastSquaresDecay"` - Description string `json:"description"` - LeaderString string `json:"leaderString"` - ConstrainedProperty string `json:"constrainedProperty"` - ResourceInstances []*ResourceInstance `json:"resourceInstances"` - AggregationType string `json:"aggregationType"` - Links []*Link `json:"links"` - LoadImbalancePercentage float64 `json:"loadImbalancePercentage"` - UpperBound int `json:"upperBound"` + HostHeader string `json:"hostHeader,omitempty"` + LeastSquaresDecay float64 `json:"leastSquaresDecay,omitempty"` + Description string `json:"description,omitempty"` + LeaderString string `json:"leaderString,omitempty"` + ConstrainedProperty string `json:"constrainedProperty,omitempty"` + ResourceInstances []*ResourceInstance `json:"resourceInstances,omitempty"` + AggregationType string `json:"aggregationType,omitempty"` + Links []*Link `json:"links,omitempty"` + LoadImbalancePercentage float64 `json:"loadImbalancePercentage,omitempty"` + UpperBound int `json:"upperBound,omitempty"` Name string `json:"name"` - MaxUMultiplicativeIncrement float64 `json:"maxUMultiplicativeIncrement"` - DecayRate float64 `json:"decayRate"` + MaxUMultiplicativeIncrement float64 `json:"maxUMultiplicativeIncrement,omitempty"` + DecayRate float64 `json:"decayRate,omitempty"` } // ResourceList is the structure returned by List Resources diff --git a/configgtm-v1_4/asmap.go b/configgtm-v1_4/asmap.go index 9a3e6ea7..a7f38706 100644 --- a/configgtm-v1_4/asmap.go +++ b/configgtm-v1_4/asmap.go @@ -14,15 +14,15 @@ import ( // AsAssignment represents a GTM asmap assignment structure type AsAssignment struct { DatacenterBase - AsNumbers []int64 `json:"asNumbers"` + AsNumbers []int64 `json:"asNumbers,omitempty"` } // AsMap represents a GTM AsMap type AsMap struct { DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"` - Assignments []*AsAssignment `json:"assignments"` + Assignments []*AsAssignment `json:"assignments,omitempty"` Name string `json:"name"` - Links []*Link `json:"links"` + Links []*Link `json:"links,omitempty"` } // NewAsMap creates a new asMap diff --git a/configgtm-v1_4/cidrmap.go b/configgtm-v1_4/cidrmap.go index e81adafd..7be610dc 100644 --- a/configgtm-v1_4/cidrmap.go +++ b/configgtm-v1_4/cidrmap.go @@ -14,15 +14,15 @@ import ( //CidrAssignment represents a GTM cidr assignment element type CidrAssignment struct { DatacenterBase - Blocks []string `json:"blocks"` + Blocks []string `json:"blocks,omitempty"` } // CidrMap represents a GTM cidrMap element type CidrMap struct { DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"` - Assignments []*CidrAssignment `json:"assignments"` + Assignments []*CidrAssignment `json:"assignments,omitempty"` Name string `json:"name"` - Links []*Link `json:"links"` + Links []*Link `json:"links,omitempty"` } // CidrMapList represents a GTM returned cidrmap list body diff --git a/configgtm-v1_4/common.go b/configgtm-v1_4/common.go index 146dfbc0..b395abce 100644 --- a/configgtm-v1_4/common.go +++ b/configgtm-v1_4/common.go @@ -43,12 +43,12 @@ func setVersionHeader(req *http.Request, version string) { // response Status is returned on Create, Update or Delete operations for all entity types type ResponseStatus struct { - ChangeId string `json:"changeId"` - Links *[]Link `json:"links"` - Message string `json:"message"` - PassingValidation bool `json:"passingValidation"` - PropagationStatus string `json:"propagationStatus"` - PropagationStatusDate string `json:"propagationStatusDate"` + ChangeId string `json:"changeId,omitempty"` + Links *[]Link `json:"links,omitempty"` + Message string `json:"message,omitempty"` + PassingValidation bool `json:"passingValidation,omitempty"` + PropagationStatus string `json:"propagationStatus,omitempty"` + PropagationStatusDate string `json:"propagationStatusDate,omitempty"` } // NewResponseStatus returns a new ResponseStatus struct @@ -108,9 +108,9 @@ type Link struct { // type LoadObject struct { - LoadObject string `json:"loadObject"` - LoadObjectPort int `json:"loadObjectPort"` - LoadServers []string `json:"loadServers"` + LoadObject string `json:"loadObject,omitempty"` + LoadObjectPort int `json:"loadObjectPort,omitempty"` + LoadServers []string `json:"loadServers,omitempty"` } // NewLoadObject returns a new LoadObject structure @@ -119,7 +119,7 @@ func NewLoadObject() *LoadObject { } type DatacenterBase struct { - Nickname string `json:"nickname"` + Nickname string `json:"nickname,omitempty"` DatacenterId int `json:"datacenterId"` } diff --git a/configgtm-v1_4/datacenter.go b/configgtm-v1_4/datacenter.go index 72e5457c..c1359afb 100644 --- a/configgtm-v1_4/datacenter.go +++ b/configgtm-v1_4/datacenter.go @@ -14,25 +14,25 @@ import ( // Datacenter represents a GTM datacenter type Datacenter struct { - City string `json:"city"` - CloneOf int `json:"cloneOf"` + City string `json:"city,omitempty"` + CloneOf int `json:"cloneOf,omitempty"` CloudServerHostHeaderOverride bool `json:"cloudServerHostHeaderOverride"` CloudServerTargeting bool `json:"cloudServerTargeting"` - Continent string `json:"continent"` - Country string `json:"country"` - DefaultLoadObject *LoadObject `json:"defaultLoadObject"` - Latitude float64 `json:"latitude"` - Links []*Link `json:"links"` - Longitude float64 `json:"longitude"` - Nickname string `json:"nickname"` - PingInterval int `json:"pingInterval"` - PingPacketSize int `json:"pingPacketSize"` + Continent string `json:"continent,omitempty"` + Country string `json:"country,omitempty"` + DefaultLoadObject *LoadObject `json:"defaultLoadObject,omitempty"` + Latitude float64 `json:"latitude,omitempty"` + Links []*Link `json:"links,omitempty"` + Longitude float64 `json:"longitude,omitempty"` + Nickname string `json:"nickname,omitempty"` + PingInterval int `json:"pingInterval,omitempty"` + PingPacketSize int `json:"pingPacketSize,omitempty"` DatacenterId int `json:"datacenterId"` - ScorePenalty int `json:"scorePenalty"` - ServermonitorLivenessCount int `json:"servermonitorLivenessCount"` - ServermonitorLoadCount int `json:"servermonitorLoadCount"` - ServermonitorPool string `json:"servermonitorPool"` - StateOrProvince string `json:"stateOrProvince"` + ScorePenalty int `json:"scorePenalty,omitempty"` + ServermonitorLivenessCount int `json:"servermonitorLivenessCount,omitempty"` + ServermonitorLoadCount int `json:"servermonitorLoadCount,omitempty"` + ServermonitorPool string `json:"servermonitorPool,omitempty"` + StateOrProvince string `json:"stateOrProvince,omitempty"` Virtual bool `json:"virtual"` } diff --git a/configgtm-v1_4/domain.go b/configgtm-v1_4/domain.go index d5fc9376..85d214bc 100644 --- a/configgtm-v1_4/domain.go +++ b/configgtm-v1_4/domain.go @@ -18,44 +18,44 @@ import ( type Domain struct { Name string `json:"name"` Type string `json:"type"` - AsMaps []*AsMap `json:"asMaps"` - Resources []*Resource `json:"resources"` - DefaultUnreachableThreshold float32 `json:"defaultUnreachableThreshold"` - EmailNotificationList []string `json:"emailNotificationList"` - MinPingableRegionFraction float32 `json:"minPingableRegionFraction"` - DefaultTimeoutPenalty int `json:"defaultTimeoutPenalty"` - Datacenters []*Datacenter `json:"datacenters"` - ServermonitorLivenessCount int `json:"servermonitorLivenessCount"` - RoundRobinPrefix string `json:"roundRobinPrefix"` - ServermonitorLoadCount int `json:"servermonitorLoadCount"` - PingInterval int `json:"pingInterval"` - MaxTTL int64 `json:"maxTTL"` - LoadImbalancePercentage float64 `json:"loadImbalancePercentage"` - DefaultHealthMax int `json:"defaultHealthMax"` - LastModified string `json:"lastModified"` - Status *ResponseStatus `json:"status"` - MapUpdateInterval int `json:"mapUpdateInterval"` - MaxProperties int `json:"maxProperties"` - MaxResources int `json:"maxResources"` - DefaultSslClientPrivateKey string `json:"defaultSslClientPrivateKey"` - DefaultErrorPenalty int `json:"defaultErrorPenalty"` - Links []*Link `json:"links"` - Properties []*Property `json:"properties"` - MaxTestTimeout float64 `json:"maxTestTimeout"` + AsMaps []*AsMap `json:"asMaps,omitempty"` + Resources []*Resource `json:"resources,omitempty"` + DefaultUnreachableThreshold float32 `json:"defaultUnreachableThreshold,omitempty"` + EmailNotificationList []string `json:"emailNotificationList,omitempty"` + MinPingableRegionFraction float32 `json:"minPingableRegionFraction,omitempty"` + DefaultTimeoutPenalty int `json:"defaultTimeoutPenalty,omitempty"` + Datacenters []*Datacenter `json:"datacenters,omitempty"` + ServermonitorLivenessCount int `json:"servermonitorLivenessCount,omitempty"` + RoundRobinPrefix string `json:"roundRobinPrefix,omitempty"` + ServermonitorLoadCount int `json:"servermonitorLoadCount,omitempty"` + PingInterval int `json:"pingInterval,omitempty"` + MaxTTL int64 `json:"maxTTL,omitempty"` + LoadImbalancePercentage float64 `json:"loadImbalancePercentage,omitempty"` + DefaultHealthMax float64 `json:"defaultHealthMax,omitempty"` + LastModified string `json:"lastModified,omitempty"` + Status *ResponseStatus `json:"status,omitempty"` + MapUpdateInterval int `json:"mapUpdateInterval,omitempty"` + MaxProperties int `json:"maxProperties,omitempty"` + MaxResources int `json:"maxResources,omitempty"` + DefaultSslClientPrivateKey string `json:"defaultSslClientPrivateKey,omitempty"` + DefaultErrorPenalty int `json:"defaultErrorPenalty,omitempty"` + Links []*Link `json:"links,omitempty"` + Properties []*Property `json:"properties,omitempty"` + MaxTestTimeout float64 `json:"maxTestTimeout,omitempty"` CnameCoalescingEnabled bool `json:"cnameCoalescingEnabled"` - DefaultHealthMultiplier int `json:"defaultHealthMultiplier"` - ServermonitorPool string `json:"servermonitorPool"` + DefaultHealthMultiplier float64 `json:"defaultHealthMultiplier,omitempty"` + ServermonitorPool string `json:"servermonitorPool,omitempty"` LoadFeedback bool `json:"loadFeedback"` - MinTTL int64 `json:"minTTL"` - GeographicMaps []*GeoMap `json:"geographicMaps"` - CidrMaps []*CidrMap `json:"cidrMaps"` + MinTTL int64 `json:"minTTL,omitempty"` + GeographicMaps []*GeoMap `json:"geographicMaps,omitempty"` + CidrMaps []*CidrMap `json:"cidrMaps,omitempty"` DefaultMaxUnreachablePenalty int `json:"defaultMaxUnreachablePenalty"` - DefaultHealthThreshold int `json:"defaultHealthThreshold"` - LastModifiedBy string `json:"lastModifiedBy"` - ModificationComments string `json:"modificationComments"` - MinTestInterval int `json:"minTestInterval"` - PingPacketSize int `json:"pingPacketSize"` - DefaultSslClientCertificate string `json:"defaultSslClientCertificate"` + DefaultHealthThreshold float64 `json:"defaultHealthThreshold,omitempty"` + LastModifiedBy string `json:"lastModifiedBy,omitempty"` + ModificationComments string `json:"modificationComments,omitempty"` + MinTestInterval int `json:"minTestInterval,omitempty"` + PingPacketSize int `json:"pingPacketSize,omitempty"` + DefaultSslClientCertificate string `json:"defaultSslClientCertificate,omitempty"` EndUserMappingEnabled bool `json:"endUserMappingEnabled"` } @@ -265,7 +265,7 @@ func (domain *Domain) Create(queryArgs map[string]string) (*DomainResponse, erro // Update is a method applied to a domain object resulting in an update. func (domain *Domain) Update(queryArgs map[string]string) (*ResponseStatus, error) { - + // Any validation to do? req, err := client.NewJSONRequest( Config, diff --git a/configgtm-v1_4/geomap.go b/configgtm-v1_4/geomap.go index d336596f..d0f7d6cb 100644 --- a/configgtm-v1_4/geomap.go +++ b/configgtm-v1_4/geomap.go @@ -14,15 +14,15 @@ import ( // GeoAssigment represents a GTM geo assignment element type GeoAssignment struct { DatacenterBase - Countries []string `json:"countries"` + Countries []string `json:"countries,omitempty"` } // GeoMap represents a GTM GeoMap type GeoMap struct { DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"` - Assignments []*GeoAssignment `json:"assignments"` + Assignments []*GeoAssignment `json:"assignments,omitempty"` Name string `json:"name"` - Links []*Link `json:"links"` + Links []*Link `json:"links,omitempty"` } // GeoMapList represents the returned GTM GeoMap List body diff --git a/configgtm-v1_4/property.go b/configgtm-v1_4/property.go index 4c9cd75a..4a108826 100644 --- a/configgtm-v1_4/property.go +++ b/configgtm-v1_4/property.go @@ -15,10 +15,10 @@ import ( type TrafficTarget struct { DatacenterId int `json:"datacenterId"` Enabled bool `json:"enabled"` - Weight float64 `json:"weight"` - Servers []string `json:"servers"` - Name string `json:"name"` - HandoutCName string `json:"handoutCName"` + Weight float64 `json:"weight,omitempty"` + Servers []string `json:"servers,omitempty"` + Name string `json:"name,omitempty"` + HandoutCName string `json:"handoutCName,omitempty"` } // HttpHeader struc @@ -29,29 +29,29 @@ type HttpHeader struct { type LivenessTest struct { Name string `json:"name"` - ErrorPenalty int `json:"errorPenalty"` + ErrorPenalty float64 `json:"errorPenalty,omitempty"` PeerCertificateVerification bool `json:"peerCertificateVerification"` - TestInterval int `json:"testInterval"` - TestObject string `json:"testObject"` - Links []*Link `json:"links"` - RequestString string `json:"requestString"` - ResponseString string `json:"responseString"` + TestInterval int `json:"testInterval,omitempty"` + TestObject string `json:"testObject,omitempty"` + Links []*Link `json:"links,omitempty"` + RequestString string `json:"requestString,omitempty"` + ResponseString string `json:"responseString,omitempty"` HttpError3xx bool `json:"httpError3xx"` HttpError4xx bool `json:"httpError4xx"` HttpError5xx bool `json:"httpError5xx"` Disabled bool `json:"disabled"` - TestObjectProtocol string `json:"testObjectProtocol"` - TestObjectPassword string `json:"testObjectPassword"` - TestObjectPort int `json:"testObjectPort"` - SslClientPrivateKey string `json:"sslClientPrivateKey"` - SslClientCertificate string `json:"sslClientCertificate"` + TestObjectProtocol string `json:"testObjectProtocol,omitempty"` + TestObjectPassword string `json:"testObjectPassword,omitempty"` + TestObjectPort int `json:"testObjectPort,omitempty"` + SslClientPrivateKey string `json:"sslClientPrivateKey,omitempty"` + SslClientCertificate string `json:"sslClientCertificate,omitempty"` DisableNonstandardPortWarning bool `json:"disableNonstandardPortWarning"` - HttpHeaders []*HttpHeader `json:"httpHeaders,opmitempty"` - TestObjectUsername string `json:"testObjectUsername"` - TestTimeout float32 `json:"testTimeout"` - TimeoutPenalty int `json:"timeoutPenalty"` - AnswerRequired bool `json:"answerRequired"` - ResourceType string `json:"resourceType"` + HttpHeaders []*HttpHeader `json:"httpHeaders,omitempty"` + TestObjectUsername string `json:"testObjectUsername,omitempty"` + TestTimeout float32 `json:"testTimeout,omitempty"` + TimeoutPenalty float64 `json:"timeoutPenalty,omitempty"` + AnswersRequired bool `json:"answersRequired"` + ResourceType string `json:"resourceType,omitempty"` RecursionRequested bool `json:"recursionRequested"` } @@ -68,36 +68,36 @@ type Property struct { Type string `json:"type"` Ipv6 bool `json:"ipv6"` ScoreAggregationType string `json:"scoreAggregationType"` - StickinessBonusPercentage int `json:"stickinessBonusPercentage"` - StickinessBonusConstant int `json:"stickinessBonusConstant"` - HealthThreshold int `json:"healthThreshold"` + StickinessBonusPercentage int `json:"stickinessBonusPercentage,omitempty"` + StickinessBonusConstant int `json:"stickinessBonusConstant,omitempty"` + HealthThreshold float64 `json:"healthThreshold,omitempty"` UseComputedTargets bool `json:"useComputedTargets"` - BackupIp string `json:"backupIp"` + BackupIp string `json:"backupIp,omitempty"` BalanceByDownloadScore bool `json:"balanceByDownloadScore"` - StaticTTL int `json:"staticTTL"` - StaticRRSets []*StaticRRSet `json:"staticRRSets"` + StaticTTL int `json:"staticTTL,omitempty"` + StaticRRSets []*StaticRRSet `json:"staticRRSets,omitempty"` LastModified string `json:"lastModified"` - UnreachableThreshold int `json:"unreachableThreshold"` - MinLiveFraction float64 `json:"minLiveFraction"` - HealthMultiplier int `json:"healthMultiplier"` - DynamicTTL int `json:"dynamicTTL"` - MaxUnreachablePenalty int `json:"maxUnreachablePenalty"` - MapName string `json:"mapName"` + UnreachableThreshold float64 `json:"unreachableThreshold,omitempty"` + MinLiveFraction float64 `json:"minLiveFraction,omitempty"` + HealthMultiplier float64 `json:"healthMultiplier,omitempty"` + DynamicTTL int `json:"dynamicTTL,omitempty"` + MaxUnreachablePenalty int `json:"maxUnreachablePenalty,omitempty"` + MapName string `json:"mapName,omitempty"` HandoutLimit int `json:"handoutLimit"` HandoutMode string `json:"handoutMode"` - FailoverDelay int `json:"failoverDelay"` - BackupCName string `json:"backupCName"` - FailbackDelay int `json:"failbackDelay"` - LoadImbalancePercentage float64 `json:"loadImbalancePercentage"` - HealthMax int `json:"healthMax"` + FailoverDelay int `json:"failoverDelay,omitempty"` + BackupCName string `json:"backupCName,omitempty"` + FailbackDelay int `json:"failbackDelay,omitempty"` + LoadImbalancePercentage float64 `json:"loadImbalancePercentage,omitempty"` + HealthMax float64 `json:"healthMax,omitempty"` GhostDemandReporting bool `json:"ghostDemandReporting"` - Comments string `json:"comments"` - CName string `json:"cname"` - WeightedHashBitsForIPv4 int `json:"weightedHashBitsForIPv4"` - WeightedHashBitsForIPv6 int `json:"weightedHashBitsForIPv6"` - TrafficTargets []*TrafficTarget `json:"trafficTargets"` - Links []*Link `json:"links"` - LivenessTests []*LivenessTest `json:"livenessTests"` + Comments string `json:"comments,omitempty"` + CName string `json:"cname,omitempty"` + WeightedHashBitsForIPv4 int `json:"weightedHashBitsForIPv4,omitempty"` + WeightedHashBitsForIPv6 int `json:"weightedHashBitsForIPv6,omitempty"` + TrafficTargets []*TrafficTarget `json:"trafficTargets,omitempty"` + Links []*Link `json:"links,omitempty"` + LivenessTests []*LivenessTest `json:"livenessTests,omitempty"` } type PropertyList struct { diff --git a/configgtm-v1_4/resource.go b/configgtm-v1_4/resource.go index 860d408e..04e3e44f 100644 --- a/configgtm-v1_4/resource.go +++ b/configgtm-v1_4/resource.go @@ -20,19 +20,19 @@ type ResourceInstance struct { // Resource represents a GTM resource type Resource struct { Type string `json:"type"` - HostHeader string `json:"hostHeader"` - LeastSquaresDecay int `json:"leastSquaresDecay"` - Description string `json:"description"` - LeaderString string `json:"leaderString"` - ConstrainedProperty string `json:"constrainedProperty"` - ResourceInstances []*ResourceInstance `json:"resourceInstances"` - AggregationType string `json:"aggregationType"` - Links []*Link `json:"links"` - LoadImbalancePercentage float64 `json:"loadImbalancePercentage"` - UpperBound int `json:"upperBound"` + HostHeader string `json:"hostHeader,omitempty"` + LeastSquaresDecay float64 `json:"leastSquaresDecay,omitempty"` + Description string `json:"description,omitempty"` + LeaderString string `json:"leaderString,omitempty"` + ConstrainedProperty string `json:"constrainedProperty,omitempty"` + ResourceInstances []*ResourceInstance `json:"resourceInstances,omitempty"` + AggregationType string `json:"aggregationType,omitempty"` + Links []*Link `json:"links,omitempty"` + LoadImbalancePercentage float64 `json:"loadImbalancePercentage,omitempty"` + UpperBound int `json:"upperBound,omitempty"` Name string `json:"name"` - MaxUMultiplicativeIncrement float64 `json:"maxUMultiplicativeIncrement"` - DecayRate float64 `json:"decayRate"` + MaxUMultiplicativeIncrement float64 `json:"maxUMultiplicativeIncrement,omitempty"` + DecayRate float64 `json:"decayRate,omitempty"` } // ResourceList is the structure returned by List Resources