diff --git a/fastly/resource.go b/fastly/resource.go index 6b4be7711..ab2e2c109 100644 --- a/fastly/resource.go +++ b/fastly/resource.go @@ -26,7 +26,7 @@ type Resource struct { // ServiceID is an alphanumeric string identifying the service. ServiceID string `mapstructure:"service_id" json:"service_id"` // ServiceVersion is an integer identifying a service version. - ServiceVersion string `mapstructure:"version" json:"version"` + ServiceVersion int `mapstructure:"version" json:"version"` // UpdatedAt is the date and time in ISO 8601 format. UpdatedAt *time.Time `mapstructure:"updated_at" json:"updated_at"` } diff --git a/fastly/resource_test.go b/fastly/resource_test.go index f30624c29..6922bc01b 100644 --- a/fastly/resource_test.go +++ b/fastly/resource_test.go @@ -262,7 +262,7 @@ func TestResourceJSONRoundtrip(t *testing.T) { ResourceID: "the-resource-id", ResourceType: "the-resource-type", ServiceID: "the-service-id", - ServiceVersion: "the-service-version", + ServiceVersion: 1, UpdatedAt: &now, }