Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CDN structs and endpoint #330

Merged
merged 3 commits into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading