Skip to content

Commit

Permalink
update geo_restrictions to be a pointer in the response struct, just …
Browse files Browse the repository at this point in the history
…like in the request struct

noticed this while working on cloudflare/terraform-provider-cloudflare#2319 but this isn't a requirement for that.
  • Loading branch information
nickysemenza committed Mar 28, 2023
1 parent 0a69e78 commit c123331
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .changelog/1244.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
ssl: make `GeoRestrictions` a pointer inside of ZoneCustomSSL
```
26 changes: 13 additions & 13 deletions ssl.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ssl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit c123331

Please sign in to comment.