diff --git a/.changelog/1244.txt b/.changelog/1244.txt new file mode 100644 index 00000000000..fa7858c06ff --- /dev/null +++ b/.changelog/1244.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +ssl: make `GeoRestrictions` a pointer inside of ZoneCustomSSL +``` \ No newline at end of file diff --git a/ssl.go b/ssl.go index 125ab02ac8b..178e98c6caf 100644 --- a/ssl.go +++ b/ssl.go @@ -10,19 +10,19 @@ import ( // ZoneCustomSSL represents custom SSL certificate metadata. type ZoneCustomSSL struct { - ID string `json:"id"` - Hosts []string `json:"hosts"` - Issuer string `json:"issuer"` - Signature string `json:"signature"` - Status string `json:"status"` - BundleMethod string `json:"bundle_method"` - GeoRestrictions ZoneCustomSSLGeoRestrictions `json:"geo_restrictions"` - ZoneID string `json:"zone_id"` - UploadedOn time.Time `json:"uploaded_on"` - ModifiedOn time.Time `json:"modified_on"` - ExpiresOn time.Time `json:"expires_on"` - Priority int `json:"priority"` - KeylessServer KeylessSSL `json:"keyless_server"` + ID string `json:"id"` + Hosts []string `json:"hosts"` + Issuer string `json:"issuer"` + Signature string `json:"signature"` + Status string `json:"status"` + BundleMethod string `json:"bundle_method"` + GeoRestrictions *ZoneCustomSSLGeoRestrictions `json:"geo_restrictions,omitempty"` + ZoneID string `json:"zone_id"` + UploadedOn time.Time `json:"uploaded_on"` + ModifiedOn time.Time `json:"modified_on"` + ExpiresOn time.Time `json:"expires_on"` + Priority int `json:"priority"` + KeylessServer KeylessSSL `json:"keyless_server"` } // ZoneCustomSSLGeoRestrictions represents the parameter to create or update diff --git a/ssl_test.go b/ssl_test.go index 78dd51022fc..ea43e63cfeb 100644 --- a/ssl_test.go +++ b/ssl_test.go @@ -64,7 +64,7 @@ func TestCreateSSL(t *testing.T) { Signature: "SHA256WithRSA", Status: "active", BundleMethod: "ubiquitous", - GeoRestrictions: ZoneCustomSSLGeoRestrictions{Label: "us"}, + GeoRestrictions: &ZoneCustomSSLGeoRestrictions{Label: "us"}, ZoneID: "023e105f4ecef8ad9ca31a8372d0c353", UploadedOn: uploadedOn, ModifiedOn: modifiedOn, @@ -266,7 +266,7 @@ func TestUpdateSSL(t *testing.T) { Signature: "SHA256WithRSA", Status: "active", BundleMethod: "ubiquitous", - GeoRestrictions: ZoneCustomSSLGeoRestrictions{Label: "us"}, + GeoRestrictions: &ZoneCustomSSLGeoRestrictions{Label: "us"}, ZoneID: "023e105f4ecef8ad9ca31a8372d0c353", UploadedOn: uploadedOn, ModifiedOn: modifiedOn,