Skip to content

Commit

Permalink
Fix CDN structs and file endpoint URL(#330)
Browse files Browse the repository at this point in the history
* Make update requests bools into pointers

* Remove omit on CDN struct

* Fix path used for CDN file endpoint
  • Loading branch information
optik-aper authored Oct 8, 2024
1 parent 6305d72 commit a130e28
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions cdn.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ type CDNZone struct {
DateCreated string `json:"date_created"`
Status string `json:"status"`
Label string `json:"label"`
OriginScheme string `json:"origin_scheme,omitempty"`
OriginDomain string `json:"origin_domain,omitempty"`
VanityDomain string `json:"vanity_domain,omitempty"`
SSLCert string `json:"ssl_cert,omitempty"`
SSLCertKey string `json:"ssl_cert_key,omitempty"`
OriginScheme string `json:"origin_scheme"`
OriginDomain string `json:"origin_domain"`
VanityDomain string `json:"vanity_domain"`
SSLCert string `json:"ssl_cert"`
SSLCertKey string `json:"ssl_cert_key"`
CDNURL string `json:"cdn_url"`
CacheSize int `json:"cache_size"`
Requests int `json:"requests"`
BytesIn int `json:"in_bytes"`
BytesOut int `json:"out_bytes"`
PacketsPerSec int `json:"packets_per_sec"`
DatePurged string `json:"last_purge,omitempty"`
DatePurged string `json:"last_purge"`
CORS bool `json:"cors"`
GZIP bool `json:"gzip"`
BlockAI bool `json:"block_ai"`
Expand All @@ -68,10 +68,10 @@ type CDNZoneReq struct {
VanityDomain string `json:"vanity_domain,omitempty"`
SSLCert string `json:"ssl_cert,omitempty"`
SSLCertKey string `json:"ssl_cert_key,omitempty"`
CORS bool `json:"cors"`
GZIP bool `json:"gzip"`
BlockAI bool `json:"block_ai"`
BlockBadBots bool `json:"block_bad_bots"`
CORS *bool `json:"cors,omitempty"`
GZIP *bool `json:"gzip,omitempty"`
BlockAI *bool `json:"block_ai,omitempty"`
BlockBadBots *bool `json:"block_bad_bots,omitempty"`
Regions []string `json:"regions,omitempty"`
}

Expand Down Expand Up @@ -339,7 +339,7 @@ func (c *CDNServiceHandler) CreatePushZoneFileEndpoint(ctx context.Context, zone
// ListPushZoneFiles will retrieve all CDN push zone file data that have been
// uploaded
func (c *CDNServiceHandler) ListPushZoneFiles(ctx context.Context, zoneID string) (*CDNZoneFileData, *http.Response, error) {
cdnPushFilesPath := fmt.Sprintf("%s/%s", cdnPushPath, zoneID)
cdnPushFilesPath := fmt.Sprintf("%s/%s/files", cdnPushPath, zoneID)
req, err := c.client.NewRequest(ctx, http.MethodGet, cdnPushFilesPath, nil)
if err != nil {
return nil, nil, err
Expand Down

0 comments on commit a130e28

Please sign in to comment.