cdn

package
v0.60.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alias added in v0.58.0

type Alias struct {
	// Alias ID.
	ID int64 `json:"id"`
	// Whether you have enabled the alias.
	//
	// Possible values:
	//
	// - `true` – The alias is enabled.
	// - `false` – The alias is paused and is not served.
	Active bool `json:"active"`
	// How the alias certificate is managed. Can be changed while the alias is served.
	//
	// Possible values:
	//
	// - `true` – A Let's Encrypt certificate is issued and renewed automatically.
	// - `false` – The certificate referenced by `ssl_id`, if any, was added by you.
	Automated bool `json:"automated"`
	// Domain validation method used to issue the Let's Encrypt certificate for the
	// alias.
	//
	// Possible values:
	//
	//   - `dns_01` – Validation via a CNAME record for
	//     `_acme-challenge.<alias hostname>`, shown in
	//     `ssl_provisioning.acme_delegation`.
	//   - `http_01` – Validation via an HTTP request to the alias hostname. The alias
	//     hostname must point to your CDN CNAME, shown in
	//     `ssl_provisioning.http_validation`. The request is served with the settings of
	//     the alias's CDN resource, so they must not block or redirect
	//     `/.well-known/acme-challenge/`.
	//
	// Any of "dns_01", "http_01".
	ChallengeType AliasChallengeType `json:"challenge_type" api:"nullable"`
	// Alias hostname. Cannot be changed after creation.
	Cname string `json:"cname"`
	// Date and time when the alias was created (ISO 8601/RFC 3339 format, UTC).
	Created string `json:"created"`
	// Whether the alias is enabled by the system. Follows the state of the CDN
	// resource.
	//
	// Possible values:
	//
	// - `true` – The alias can be served.
	// - `false` – The alias is not served because its CDN resource is not active.
	Enabled bool `json:"enabled"`
	// ID of the CDN resource whose settings the alias is served with. Cannot be
	// changed after creation.
	ResourceID int64 `json:"resource_id"`
	// ID of the SSL certificate served for the alias.
	SslID int64 `json:"ssl_id" api:"nullable"`
	// Outcome of the certificate we manage for the alias.
	//
	// Possible values:
	//
	//   - `pending` – A certificate attempt is in progress, or was stopped by pausing
	//     the alias and starts again after it is resumed.
	//   - `issued` – The latest attempt succeeded.
	//   - `failed` – The latest attempt ended without a certificate.
	//   - `null` – No certificate is managed for the alias: the alias uses a certificate
	//     you provided, or is automated and has never opened an attempt.
	//
	// Any of "pending", "issued", "failed".
	SslStatus AliasSslStatus `json:"ssl_status" api:"nullable"`
	// Date and time when the served certificate expires (ISO 8601/RFC 3339 format,
	// UTC). `null` while no certificate is served.
	SslValidityNotAfter string `json:"ssl_validity_not_after" api:"nullable"`
	// Alias status.
	//
	// Possible values:
	//
	//   - `inactive` – The alias or its CDN resource is disabled; the alias is not
	//     served.
	//   - `pending` – The alias configuration has not reached the CDN yet.
	//   - `http_only` – The alias is served over HTTP only.
	//   - `active` – The alias is served over HTTP and HTTPS.
	//
	// Any of "inactive", "pending", "http_only", "active".
	Status AliasStatus `json:"status"`
	// Date and time when the alias was last changed (ISO 8601/RFC 3339 format, UTC).
	Updated string `json:"updated"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		Active              respjson.Field
		Automated           respjson.Field
		ChallengeType       respjson.Field
		Cname               respjson.Field
		Created             respjson.Field
		Enabled             respjson.Field
		ResourceID          respjson.Field
		SslID               respjson.Field
		SslStatus           respjson.Field
		SslValidityNotAfter respjson.Field
		Status              respjson.Field
		Updated             respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Alias) RawJSON added in v0.58.0

func (r Alias) RawJSON() string

Returns the unmodified JSON received from the API

func (*Alias) UnmarshalJSON added in v0.58.0

func (r *Alias) UnmarshalJSON(data []byte) error

type AliasAggregatedStats added in v0.58.0

type AliasAggregatedStats struct {
	// CDN resource ID for which statistics data is shown.
	Number1Example any `json:"1 (example)"`
	// Client ID for which statistics data is shown.
	Number12Example any `json:"12 (example)"`
	// Client IDs by which statistics data is grouped.
	Client any `json:"client"`
	// Statistics parameters.
	Metrics AliasAggregatedStatsMetrics `json:"metrics"`
	// Resources IDs by which statistics data is grouped.
	Resource any `json:"resource"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Number1Example  respjson.Field
		Number12Example respjson.Field
		Client          respjson.Field
		Metrics         respjson.Field
		Resource        respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AliasAggregatedStats) RawJSON added in v0.58.0

func (r AliasAggregatedStats) RawJSON() string

Returns the unmodified JSON received from the API

func (*AliasAggregatedStats) UnmarshalJSON added in v0.58.0

func (r *AliasAggregatedStats) UnmarshalJSON(data []byte) error

type AliasAggregatedStatsMetrics added in v0.58.0

type AliasAggregatedStatsMetrics struct {
	// Number of aliases in use.
	AliasUsage int64 `json:"alias_usage"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AliasUsage  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Statistics parameters.

func (AliasAggregatedStatsMetrics) RawJSON added in v0.58.0

func (r AliasAggregatedStatsMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*AliasAggregatedStatsMetrics) UnmarshalJSON added in v0.58.0

func (r *AliasAggregatedStatsMetrics) UnmarshalJSON(data []byte) error

type AliasCertificateStatus added in v0.58.0

type AliasCertificateStatus struct {
	// ID of the attempt to issue a Let's Encrypt certificate.
	ID int64 `json:"id"`
	// Defines whether the Let's Encrypt certificate issuing process is active.
	//
	// Possible values:
	//
	// - `true` – Issuing process is active.
	// - `false` – Issuing process is completed.
	Active bool `json:"active"`
	// Number of attempts to issue the Let's Encrypt certificate.
	AttemptsCount int64 `json:"attempts_count"`
	// The domain validation method this attempt uses.
	//
	// Possible values:
	//
	// - `dns_01` – Validation via a DNS record.
	// - `http_01` – Validation via an HTTP request.
	ChallengeType string `json:"challenge_type" api:"nullable"`
	// Domain validation challenges of the latest order placed with Let's Encrypt, one
	// per domain.
	Challenges []AliasCertificateStatusChallenge `json:"challenges"`
	// CNAME records to create so Let's Encrypt domain validation can complete for the
	// alias hostname. Empty when the attempt uses `http_01`.
	CnameRecords []AliasCertificateStatusCnameRecord `json:"cname_records"`
	// Date when the process of issuing a Let's Encrypt certificate was finished (ISO
	// 8601/RFC 3339 format, UTC).
	//
	// The field is `null` if the issuing process is not finished.
	Finished string `json:"finished" api:"nullable"`
	// Detailed information about last attempt to issue a Let's Encrypt certificate.
	//
	// The field is `null` until the first attempt of the issuing process has been
	// recorded.
	LatestStatus AliasCertificateStatusLatestStatus `json:"latest_status" api:"nullable"`
	// Time of the next scheduled attempt to issue the Let's Encrypt certificate (ISO
	// 8601/RFC 3339 format, UTC).
	NextAttemptTime string `json:"next_attempt_time" api:"nullable"`
	// Why this attempt was opened.
	//
	// Possible values:
	//
	// - `initial` – First attempt to issue a certificate.
	// - `renewal` – A scheduled renewal of an existing certificate.
	// - `manual` – Manually triggered, for example via a retry.
	// - `switch` – Switching from your own certificate to a Let's Encrypt certificate.
	// - `extend` – Extending the set of domains covered by the certificate.
	Reason string `json:"reason" api:"nullable"`
	// Domains this attempt requested a certificate for.
	RequestedDomains []string `json:"requested_domains" api:"nullable"`
	// Always `null` for an alias.
	Resource int64 `json:"resource" api:"nullable"`
	// Date when the process of issuing a Let's Encrypt certificate was started (ISO
	// 8601/RFC 3339 format, UTC).
	Started string `json:"started"`
	// Detailed information about attempts to issue a Let's Encrypt certificate.
	Statuses []AliasCertificateStatusStatus `json:"statuses"`
	// State of the domain validation for this attempt.
	//
	// Possible values:
	//
	// - `PENDING` – Validation has not started yet.
	// - `AWAITING_CNAME` – Waiting for the CNAME records below to be created.
	// - `VALIDATING` – Validation is in progress.
	// - `COMPLETED` – Validation succeeded.
	// - `FAILED` – Validation did not succeed.
	ValidationState string `json:"validation_state"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		Active           respjson.Field
		AttemptsCount    respjson.Field
		ChallengeType    respjson.Field
		Challenges       respjson.Field
		CnameRecords     respjson.Field
		Finished         respjson.Field
		LatestStatus     respjson.Field
		NextAttemptTime  respjson.Field
		Reason           respjson.Field
		RequestedDomains respjson.Field
		Resource         respjson.Field
		Started          respjson.Field
		Statuses         respjson.Field
		ValidationState  respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AliasCertificateStatus) RawJSON added in v0.58.0

func (r AliasCertificateStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*AliasCertificateStatus) UnmarshalJSON added in v0.58.0

func (r *AliasCertificateStatus) UnmarshalJSON(data []byte) error

type AliasCertificateStatusChallenge added in v0.60.0

type AliasCertificateStatusChallenge struct {
	// Domain validation method of the challenge.
	//
	// Possible values:
	//
	// - `dns_01` – Validation via a DNS record.
	// - `http_01` – Validation via an HTTP request.
	ChallengeType string `json:"challenge_type"`
	// Domain the challenge validates.
	Domain string `json:"domain"`
	// Why the challenge failed. Empty unless `state` is `invalid`.
	Error string `json:"error"`
	// State of the challenge.
	//
	// Possible values:
	//
	// - `pending` – The challenge has not been checked yet.
	// - `processing` – Let's Encrypt is validating the challenge.
	// - `valid` – The challenge passed.
	// - `invalid` – The challenge failed; see `error`.
	State string `json:"state"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChallengeType respjson.Field
		Domain        respjson.Field
		Error         respjson.Field
		State         respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AliasCertificateStatusChallenge) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*AliasCertificateStatusChallenge) UnmarshalJSON added in v0.60.0

func (r *AliasCertificateStatusChallenge) UnmarshalJSON(data []byte) error

type AliasCertificateStatusCnameRecord added in v0.58.0

type AliasCertificateStatusCnameRecord struct {
	// Hostname to create the CNAME record for.
	CnameName string `json:"cname_name"`
	// Value the CNAME record must point to.
	CnameTarget string `json:"cname_target"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CnameName   respjson.Field
		CnameTarget respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AliasCertificateStatusCnameRecord) RawJSON added in v0.58.0

Returns the unmodified JSON received from the API

func (*AliasCertificateStatusCnameRecord) UnmarshalJSON added in v0.58.0

func (r *AliasCertificateStatusCnameRecord) UnmarshalJSON(data []byte) error

type AliasCertificateStatusLatestStatus added in v0.60.0

type AliasCertificateStatusLatestStatus struct {
	// ID of the attempt to issue the Let's Encrypt certificate.
	ID int64 `json:"id"`
	// Date and time when the issuing attempt status was created (ISO 8601/RFC 3339
	// format, UTC).
	Created string `json:"created"`
	// Detailed description of the error that occurred when trying to issue a Let's
	// Encrypt certificate.
	Details string `json:"details"`
	// Brief description of the error that occurred when trying to issue a Let's
	// Encrypt certificate.
	Error string `json:"error"`
	// Date indicating when the certificate issuance limit will be lifted (ISO 8601/RFC
	// 3339 format, UTC).
	//
	// It is filled in only if error = RateLimited.
	RetryAfter string `json:"retry_after"`
	// Status of the attempt to issue the Let's Encrypt certificate.
	//
	// Possible values:
	//
	//   - `DONE` – Attempt is successful. Let's Encrypt certificate was issued.
	//   - `FAILED` – Attempt failed. Let's Encrypt certificate was not issued.
	//   - `CANCELLED` – Attempt is cancelled. Let's Encrypt certificate was not issued.
	//   - `FORBIDDEN` – Issuing of Let's Encrypt certificates is disabled for your
	//     account. Let's Encrypt certificate was not issued.
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		Details     respjson.Field
		Error       respjson.Field
		RetryAfter  respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detailed information about last attempt to issue a Let's Encrypt certificate.

The field is `null` until the first attempt of the issuing process has been recorded.

func (AliasCertificateStatusLatestStatus) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*AliasCertificateStatusLatestStatus) UnmarshalJSON added in v0.60.0

func (r *AliasCertificateStatusLatestStatus) UnmarshalJSON(data []byte) error

type AliasCertificateStatusStatus added in v0.60.0

type AliasCertificateStatusStatus struct {
	// ID of the attempt to issue the Let's Encrypt certificate.
	ID int64 `json:"id"`
	// Date and time when the issuing attempt status was created (ISO 8601/RFC 3339
	// format, UTC).
	Created string `json:"created"`
	// Detailed description of the error that occurred when trying to issue a Let's
	// Encrypt certificate.
	Details string `json:"details"`
	// Brief description of the error that occurred when trying to issue a Let's
	// Encrypt certificate.
	Error string `json:"error"`
	// Date indicating when the certificate issuance limit will be lifted (ISO 8601/RFC
	// 3339 format, UTC).
	//
	// It is filled in only if error = RateLimited.
	RetryAfter string `json:"retry_after"`
	// Status of the attempt to issue the Let's Encrypt certificate.
	//
	// Possible values:
	//
	//   - `DONE` – Attempt is successful. Let's Encrypt certificate was issued.
	//   - `FAILED` – Attempt failed. Let's Encrypt certificate was not issued.
	//   - `CANCELLED` – Attempt is cancelled. Let's Encrypt certificate was not issued.
	//   - `FORBIDDEN` – Issuing of Let's Encrypt certificates is disabled for your
	//     account. Let's Encrypt certificate was not issued.
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		Details     respjson.Field
		Error       respjson.Field
		RetryAfter  respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AliasCertificateStatusStatus) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*AliasCertificateStatusStatus) UnmarshalJSON added in v0.60.0

func (r *AliasCertificateStatusStatus) UnmarshalJSON(data []byte) error

type AliasChallengeType added in v0.60.0

type AliasChallengeType string

Domain validation method used to issue the Let's Encrypt certificate for the alias.

Possible values:

  • `dns_01` – Validation via a CNAME record for `_acme-challenge.<alias hostname>`, shown in `ssl_provisioning.acme_delegation`.
  • `http_01` – Validation via an HTTP request to the alias hostname. The alias hostname must point to your CDN CNAME, shown in `ssl_provisioning.http_validation`. The request is served with the settings of the alias's CDN resource, so they must not block or redirect `/.well-known/acme-challenge/`.
const (
	AliasChallengeTypeDNS01  AliasChallengeType = "dns_01"
	AliasChallengeTypeHTTP01 AliasChallengeType = "http_01"
)

type AliasDeleteMultipleParams added in v0.58.0

type AliasDeleteMultipleParams struct {
	// Hostnames of the aliases to delete.
	Cnames []string `json:"cnames,omitzero"`
	// IDs of the aliases to delete.
	IDs []int64 `json:"ids,omitzero"`
	// contains filtered or unexported fields
}

func (AliasDeleteMultipleParams) MarshalJSON added in v0.58.0

func (r AliasDeleteMultipleParams) MarshalJSON() (data []byte, err error)

func (*AliasDeleteMultipleParams) UnmarshalJSON added in v0.58.0

func (r *AliasDeleteMultipleParams) UnmarshalJSON(data []byte) error

type AliasDeleteMultipleResponse added in v0.58.0

type AliasDeleteMultipleResponse struct {
	// Requested IDs or hostnames that did not match an alias.
	NotFound []AliasDeleteMultipleResponseNotFoundUnion `json:"not_found"`
	// Aliases deleted by this request.
	Removed []AliasDeleteMultipleResponseRemoved `json:"removed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		NotFound    respjson.Field
		Removed     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AliasDeleteMultipleResponse) RawJSON added in v0.58.0

func (r AliasDeleteMultipleResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AliasDeleteMultipleResponse) UnmarshalJSON added in v0.58.0

func (r *AliasDeleteMultipleResponse) UnmarshalJSON(data []byte) error

type AliasDeleteMultipleResponseNotFoundUnion added in v0.58.0

type AliasDeleteMultipleResponseNotFoundUnion struct {
	// This field will be present if the value is a [int64] instead of an object.
	OfInt int64 `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	JSON     struct {
		OfInt    respjson.Field
		OfString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AliasDeleteMultipleResponseNotFoundUnion contains all possible properties and values from [int64], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfInt OfString]

func (AliasDeleteMultipleResponseNotFoundUnion) AsInt added in v0.58.0

func (AliasDeleteMultipleResponseNotFoundUnion) AsString added in v0.58.0

func (AliasDeleteMultipleResponseNotFoundUnion) RawJSON added in v0.58.0

Returns the unmodified JSON received from the API

func (*AliasDeleteMultipleResponseNotFoundUnion) UnmarshalJSON added in v0.58.0

func (r *AliasDeleteMultipleResponseNotFoundUnion) UnmarshalJSON(data []byte) error

type AliasDeleteMultipleResponseRemoved added in v0.58.0

type AliasDeleteMultipleResponseRemoved struct {
	ID    int64  `json:"id"`
	Cname string `json:"cname"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Cname       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AliasDeleteMultipleResponseRemoved) RawJSON added in v0.58.0

Returns the unmodified JSON received from the API

func (*AliasDeleteMultipleResponseRemoved) UnmarshalJSON added in v0.58.0

func (r *AliasDeleteMultipleResponseRemoved) UnmarshalJSON(data []byte) error

type AliasDetail added in v0.58.0

type AliasDetail struct {
	// DNS record needed for Let's Encrypt domain validation of the alias hostname. It
	// is `null` when `automated` is `false`, and when `challenge_type` is `dns_01`
	// until a delegation record has been prepared for the hostname.
	SslProvisioning AliasDetailSslProvisioning `json:"ssl_provisioning" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		SslProvisioning respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	Alias
}

func (AliasDetail) RawJSON added in v0.58.0

func (r AliasDetail) RawJSON() string

Returns the unmodified JSON received from the API

func (*AliasDetail) UnmarshalJSON added in v0.58.0

func (r *AliasDetail) UnmarshalJSON(data []byte) error

type AliasDetailSslProvisioning added in v0.58.0

type AliasDetailSslProvisioning struct {
	// CNAME record to create so validation can be completed for the hostname. Returned
	// when `challenge_type` is `dns_01`.
	AcmeDelegation AliasDetailSslProvisioningAcmeDelegation `json:"acme_delegation"`
	// CNAME record pointing the alias hostname to your CDN CNAME. Returned when
	// `challenge_type` is `http_01`; `null` until a CDN CNAME is assigned to your
	// account.
	HTTPValidation AliasDetailSslProvisioningHTTPValidation `json:"http_validation" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AcmeDelegation respjson.Field
		HTTPValidation respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

DNS record needed for Let's Encrypt domain validation of the alias hostname. It is `null` when `automated` is `false`, and when `challenge_type` is `dns_01` until a delegation record has been prepared for the hostname.

func (AliasDetailSslProvisioning) RawJSON added in v0.58.0

func (r AliasDetailSslProvisioning) RawJSON() string

Returns the unmodified JSON received from the API

func (*AliasDetailSslProvisioning) UnmarshalJSON added in v0.58.0

func (r *AliasDetailSslProvisioning) UnmarshalJSON(data []byte) error

type AliasDetailSslProvisioningAcmeDelegation added in v0.58.0

type AliasDetailSslProvisioningAcmeDelegation struct {
	// Hostname to create the CNAME record for.
	CnameName string `json:"cname_name"`
	// Value the CNAME record must point to.
	CnameTarget string `json:"cname_target"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CnameName   respjson.Field
		CnameTarget respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CNAME record to create so validation can be completed for the hostname. Returned when `challenge_type` is `dns_01`.

func (AliasDetailSslProvisioningAcmeDelegation) RawJSON added in v0.58.0

Returns the unmodified JSON received from the API

func (*AliasDetailSslProvisioningAcmeDelegation) UnmarshalJSON added in v0.58.0

func (r *AliasDetailSslProvisioningAcmeDelegation) UnmarshalJSON(data []byte) error

type AliasDetailSslProvisioningHTTPValidation added in v0.60.0

type AliasDetailSslProvisioningHTTPValidation struct {
	// Hostname to create the CNAME record for.
	CnameName string `json:"cname_name"`
	// Value the CNAME record must point to.
	CnameTarget string `json:"cname_target"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CnameName   respjson.Field
		CnameTarget respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CNAME record pointing the alias hostname to your CDN CNAME. Returned when `challenge_type` is `http_01`; `null` until a CDN CNAME is assigned to your account.

func (AliasDetailSslProvisioningHTTPValidation) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*AliasDetailSslProvisioningHTTPValidation) UnmarshalJSON added in v0.60.0

func (r *AliasDetailSslProvisioningHTTPValidation) UnmarshalJSON(data []byte) error

type AliasListParams added in v0.58.0

type AliasListParams struct {
	// How the alias certificate is managed.
	//
	// Possible values:
	//
	// - `true` – A Let's Encrypt certificate is issued and renewed automatically.
	// - `false` – The certificate was added by you.
	Automated param.Opt[bool] `query:"automated,omitzero" json:"-"`
	// Hostname substring, case-insensitive.
	Cname param.Opt[string] `query:"cname,omitzero" json:"-"`
	// Hostname suffix, case-insensitive.
	CnameEndswith param.Opt[string] `query:"cname_endswith,omitzero" json:"-"`
	// Hostname prefix, case-insensitive.
	CnameStartswith param.Opt[string] `query:"cname_startswith,omitzero" json:"-"`
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Field to sort by. Prefix with `-` for descending order.
	//
	// Possible values: `id`, `cname`, `status`, `created`, `updated`, `resource_id`.
	Ordering param.Opt[string] `query:"ordering,omitzero" json:"-"`
	// CDN resource ID. Only aliases of this CDN resource are returned.
	ResourceID param.Opt[int64] `query:"resource_id,omitzero" json:"-"`
	// Comma-separated list of CDN resource IDs.
	ResourceIDIn param.Opt[string] `query:"resource_id__in,omitzero" json:"-"`
	// Search by alias ID or hostname.
	Search param.Opt[string] `query:"search,omitzero" json:"-"`
	// SSL certificate ID. Only aliases linked to this certificate are returned.
	SslID param.Opt[int64] `query:"ssl_id,omitzero" json:"-"`
	// Comma-separated list of certificate outcomes.
	SslStatusIn param.Opt[string] `query:"ssl_status__in,omitzero" json:"-"`
	// Only aliases whose served certificate expires at or after this date and time
	// (ISO 8601/RFC 3339 format, UTC).
	SslValidityNotAfterGte param.Opt[string] `query:"ssl_validity_not_after_gte,omitzero" json:"-"`
	// Only aliases whose served certificate expires at or before this date and time
	// (ISO 8601/RFC 3339 format, UTC).
	SslValidityNotAfterLte param.Opt[string] `query:"ssl_validity_not_after_lte,omitzero" json:"-"`
	// Comma-separated list of alias statuses.
	StatusIn param.Opt[string] `query:"status__in,omitzero" json:"-"`
	// Outcome of the certificate we manage for the alias.
	//
	// Possible values:
	//
	//   - `pending` – A certificate attempt is in progress, or was stopped by pausing
	//     the alias and starts again after it is resumed.
	//   - `issued` – The latest attempt succeeded.
	//   - `failed` – The latest attempt ended without a certificate.
	//   - `null` – No certificate is managed for the alias: the alias uses a certificate
	//     you provided, or is automated and has never opened an attempt.
	//
	// Any of "pending", "issued", "failed".
	SslStatus AliasListParamsSslStatus `query:"ssl_status,omitzero" json:"-"`
	// Alias status.
	//
	// Possible values:
	//
	//   - `inactive` – The alias or its CDN resource is disabled; the alias is not
	//     served.
	//   - `pending` – The alias configuration has not reached the CDN yet.
	//   - `http_only` – The alias is served over HTTP only.
	//   - `active` – The alias is served over HTTP and HTTPS.
	//
	// Any of "inactive", "pending", "http_only", "active".
	Status AliasListParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AliasListParams) URLQuery added in v0.58.0

func (r AliasListParams) URLQuery() (v url.Values, err error)

URLQuery serializes AliasListParams's query parameters as `url.Values`.

type AliasListParamsSslStatus added in v0.58.0

type AliasListParamsSslStatus string

Outcome of the certificate we manage for the alias.

Possible values:

  • `pending` – A certificate attempt is in progress, or was stopped by pausing the alias and starts again after it is resumed.
  • `issued` – The latest attempt succeeded.
  • `failed` – The latest attempt ended without a certificate.
  • `null` – No certificate is managed for the alias: the alias uses a certificate you provided, or is automated and has never opened an attempt.
const (
	AliasListParamsSslStatusPending AliasListParamsSslStatus = "pending"
	AliasListParamsSslStatusIssued  AliasListParamsSslStatus = "issued"
	AliasListParamsSslStatusFailed  AliasListParamsSslStatus = "failed"
)

type AliasListParamsStatus added in v0.58.0

type AliasListParamsStatus string

Alias status.

Possible values:

  • `inactive` – The alias or its CDN resource is disabled; the alias is not served.
  • `pending` – The alias configuration has not reached the CDN yet.
  • `http_only` – The alias is served over HTTP only.
  • `active` – The alias is served over HTTP and HTTPS.
const (
	AliasListParamsStatusInactive AliasListParamsStatus = "inactive"
	AliasListParamsStatusPending  AliasListParamsStatus = "pending"
	AliasListParamsStatusHTTPOnly AliasListParamsStatus = "http_only"
	AliasListParamsStatusActive   AliasListParamsStatus = "active"
)

type AliasNewMultipleParams added in v0.58.0

type AliasNewMultipleParams struct {
	// Aliases to create.
	Items []AliasNewMultipleParamsItem `json:"items,omitzero" api:"required"`
	// ID of the CDN resource whose settings the aliases are served with.
	ResourceID int64 `json:"resource_id" api:"required"`
	// contains filtered or unexported fields
}

func (AliasNewMultipleParams) MarshalJSON added in v0.58.0

func (r AliasNewMultipleParams) MarshalJSON() (data []byte, err error)

func (*AliasNewMultipleParams) UnmarshalJSON added in v0.58.0

func (r *AliasNewMultipleParams) UnmarshalJSON(data []byte) error

type AliasNewMultipleParamsItem added in v0.58.0

type AliasNewMultipleParamsItem struct {
	// Alias hostname.
	Cname string `json:"cname" api:"required"`
	// ID of your own SSL certificate to serve for the alias. A Let's Encrypt
	// certificate issued for one of your CDN resources cannot be used. Omit it to have
	// a Let's Encrypt certificate issued automatically.
	SslID param.Opt[int64] `json:"ssl_id,omitzero"`
	// How the alias certificate is managed. Defaults to `true` when `ssl_id` is
	// omitted and to `false` when `ssl_id` is passed.
	Automated param.Opt[bool] `json:"automated,omitzero"`
	// Domain validation method used to issue the Let's Encrypt certificate for the
	// alias.
	//
	// Possible values:
	//
	//   - `dns_01` – Validation via a CNAME record for
	//     `_acme-challenge.<alias hostname>`, shown in
	//     `ssl_provisioning.acme_delegation`.
	//   - `http_01` – Validation via an HTTP request to the alias hostname. The alias
	//     hostname must point to your CDN CNAME, shown in
	//     `ssl_provisioning.http_validation`. The request is served with the settings of
	//     the alias's CDN resource, so they must not block or redirect
	//     `/.well-known/acme-challenge/`.
	//
	// Any of "dns_01", "http_01".
	ChallengeType string `json:"challenge_type,omitzero"`
	// contains filtered or unexported fields
}

The property Cname is required.

func (AliasNewMultipleParamsItem) MarshalJSON added in v0.58.0

func (r AliasNewMultipleParamsItem) MarshalJSON() (data []byte, err error)

func (*AliasNewMultipleParamsItem) UnmarshalJSON added in v0.58.0

func (r *AliasNewMultipleParamsItem) UnmarshalJSON(data []byte) error

type AliasNewMultipleResponse added in v0.58.0

type AliasNewMultipleResponse struct {
	// Aliases created by this request.
	Created []AliasNewMultipleResponseCreated `json:"created"`
	// Items whose hostname was already an alias of the CDN resource. Nothing was
	// changed for them.
	Exists []AliasNewMultipleResponseExist `json:"exists"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Created     respjson.Field
		Exists      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AliasNewMultipleResponse) RawJSON added in v0.58.0

func (r AliasNewMultipleResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AliasNewMultipleResponse) UnmarshalJSON added in v0.58.0

func (r *AliasNewMultipleResponse) UnmarshalJSON(data []byte) error

type AliasNewMultipleResponseCreated added in v0.58.0

type AliasNewMultipleResponseCreated struct {
	// Alias ID.
	ID int64 `json:"id"`
	// Alias hostname.
	Cname string `json:"cname"`
	// Outcome of the certificate we manage for the alias.
	//
	// Possible values:
	//
	//   - `pending` – A certificate attempt is in progress, or was stopped by pausing
	//     the alias and starts again after it is resumed.
	//   - `issued` – The latest attempt succeeded.
	//   - `failed` – The latest attempt ended without a certificate.
	//   - `null` – No certificate is managed for the alias: the alias uses a certificate
	//     you provided, or is automated and has never opened an attempt.
	//
	// Any of "pending", "issued", "failed".
	SslStatus string `json:"ssl_status" api:"nullable"`
	// Alias status.
	//
	// Possible values:
	//
	//   - `inactive` – The alias or its CDN resource is disabled; the alias is not
	//     served.
	//   - `pending` – The alias configuration has not reached the CDN yet.
	//   - `http_only` – The alias is served over HTTP only.
	//   - `active` – The alias is served over HTTP and HTTPS.
	//
	// Any of "inactive", "pending", "http_only", "active".
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Cname       respjson.Field
		SslStatus   respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AliasNewMultipleResponseCreated) RawJSON added in v0.58.0

Returns the unmodified JSON received from the API

func (*AliasNewMultipleResponseCreated) UnmarshalJSON added in v0.58.0

func (r *AliasNewMultipleResponseCreated) UnmarshalJSON(data []byte) error

type AliasNewMultipleResponseExist added in v0.58.0

type AliasNewMultipleResponseExist struct {
	// Alias ID.
	ID int64 `json:"id"`
	// Alias hostname.
	Cname string `json:"cname"`
	// Outcome of the certificate we manage for the alias.
	//
	// Possible values:
	//
	//   - `pending` – A certificate attempt is in progress, or was stopped by pausing
	//     the alias and starts again after it is resumed.
	//   - `issued` – The latest attempt succeeded.
	//   - `failed` – The latest attempt ended without a certificate.
	//   - `null` – No certificate is managed for the alias: the alias uses a certificate
	//     you provided, or is automated and has never opened an attempt.
	//
	// Any of "pending", "issued", "failed".
	SslStatus string `json:"ssl_status" api:"nullable"`
	// Alias status.
	//
	// Possible values:
	//
	//   - `inactive` – The alias or its CDN resource is disabled; the alias is not
	//     served.
	//   - `pending` – The alias configuration has not reached the CDN yet.
	//   - `http_only` – The alias is served over HTTP only.
	//   - `active` – The alias is served over HTTP and HTTPS.
	//
	// Any of "inactive", "pending", "http_only", "active".
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Cname       respjson.Field
		SslStatus   respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AliasNewMultipleResponseExist) RawJSON added in v0.58.0

Returns the unmodified JSON received from the API

func (*AliasNewMultipleResponseExist) UnmarshalJSON added in v0.58.0

func (r *AliasNewMultipleResponseExist) UnmarshalJSON(data []byte) error

type AliasNewParams added in v0.58.0

type AliasNewParams struct {
	// Alias hostname. Wildcard hostnames are not supported.
	Cname string `json:"cname" api:"required"`
	// ID of the CDN resource whose settings the alias is served with.
	ResourceID int64 `json:"resource_id" api:"required"`
	// ID of your own SSL certificate to serve for the alias. The certificate must
	// cover the alias hostname. A Let's Encrypt certificate issued for one of your CDN
	// resources cannot be used.
	//
	// Omit it to have a Let's Encrypt certificate issued automatically.
	SslID param.Opt[int64] `json:"ssl_id,omitzero"`
	// Whether the alias is enabled. Defaults to `true`.
	Active param.Opt[bool] `json:"active,omitzero"`
	// How the alias certificate is managed. Defaults to `true` when `ssl_id` is
	// omitted and to `false` when `ssl_id` is passed.
	//
	// Possible values:
	//
	//   - `true` – A Let's Encrypt certificate is issued and renewed automatically.
	//     `ssl_id` must be omitted.
	//   - `false` – Your own certificate referenced by `ssl_id`, if any, is served.
	Automated param.Opt[bool] `json:"automated,omitzero"`
	// Domain validation method used to issue the Let's Encrypt certificate for the
	// alias.
	//
	// Possible values:
	//
	//   - `dns_01` – Validation via a CNAME record for
	//     `_acme-challenge.<alias hostname>`, shown in
	//     `ssl_provisioning.acme_delegation`.
	//   - `http_01` – Validation via an HTTP request to the alias hostname. The alias
	//     hostname must point to your CDN CNAME, shown in
	//     `ssl_provisioning.http_validation`. The request is served with the settings of
	//     the alias's CDN resource, so they must not block or redirect
	//     `/.well-known/acme-challenge/`.
	//
	// Any of "dns_01", "http_01".
	ChallengeType AliasNewParamsChallengeType `json:"challenge_type,omitzero"`
	// contains filtered or unexported fields
}

func (AliasNewParams) MarshalJSON added in v0.58.0

func (r AliasNewParams) MarshalJSON() (data []byte, err error)

func (*AliasNewParams) UnmarshalJSON added in v0.58.0

func (r *AliasNewParams) UnmarshalJSON(data []byte) error

type AliasNewParamsChallengeType added in v0.60.0

type AliasNewParamsChallengeType string

Domain validation method used to issue the Let's Encrypt certificate for the alias.

Possible values:

  • `dns_01` – Validation via a CNAME record for `_acme-challenge.<alias hostname>`, shown in `ssl_provisioning.acme_delegation`.
  • `http_01` – Validation via an HTTP request to the alias hostname. The alias hostname must point to your CDN CNAME, shown in `ssl_provisioning.http_validation`. The request is served with the settings of the alias's CDN resource, so they must not block or redirect `/.well-known/acme-challenge/`.
const (
	AliasNewParamsChallengeTypeDNS01  AliasNewParamsChallengeType = "dns_01"
	AliasNewParamsChallengeTypeHTTP01 AliasNewParamsChallengeType = "http_01"
)

type AliasService added in v0.58.0

type AliasService struct {
	Options []option.RequestOption
}

CDN aliases are hostnames you own that are served with the settings of one of your CDN resources, each with its own SSL certificate.

AliasService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAliasService method instead.

func NewAliasService added in v0.58.0

func NewAliasService(opts ...option.RequestOption) (r AliasService)

NewAliasService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AliasService) Delete added in v0.58.0

func (r *AliasService) Delete(ctx context.Context, aliasID int64, opts ...option.RequestOption) (err error)

Delete an alias. The hostname stops being served and can be used again. A certificate you added yourself is not affected.

func (*AliasService) DeleteMultiple added in v0.58.0

Delete up to 1000 aliases in a single request, selected either by ID or by hostname.

Aliases that are not found are reported in `not_found` and do not fail the request.

func (*AliasService) Get added in v0.58.0

func (r *AliasService) Get(ctx context.Context, aliasID int64, opts ...option.RequestOption) (res *AliasDetail, err error)

Get alias details

func (*AliasService) GetCertificateStatus added in v0.58.0

func (r *AliasService) GetCertificateStatus(ctx context.Context, aliasID int64, opts ...option.RequestOption) (res *AliasCertificateStatus, err error)

Get details about the latest Let's Encrypt certificate issuance attempt for an alias, including the CNAME records to create for domain validation and the state of each domain validation challenge. Returns attempts in all statuses.

While the alias is switching to a Let's Encrypt certificate, the attempt for the new certificate is returned.

func (*AliasService) List added in v0.58.0

func (r *AliasService) List(ctx context.Context, query AliasListParams, opts ...option.RequestOption) (res *pagination.OffsetPage[Alias], err error)

Get information about aliases.

The response is always paginated.

func (*AliasService) ListAutoPaging added in v0.58.0

Get information about aliases.

The response is always paginated.

func (*AliasService) New added in v0.58.0

func (r *AliasService) New(ctx context.Context, body AliasNewParams, opts ...option.RequestOption) (res *Alias, err error)

Create an alias: a hostname you own that is served with the settings of one of your CDN resources and with its own SSL certificate.

By default, a Let's Encrypt certificate is issued for the alias automatically. Choose how its domain is validated with `challenge_type`.

To use your own certificate instead, pass its ID in `ssl_id`. The certificate must cover the alias hostname; a Let's Encrypt certificate issued for one of your CDN resources cannot be used.

The hostname must be unique across all CDN resources, additional CNAMEs and aliases.

The DNS record the hostname needs for Let's Encrypt domain validation is returned in `ssl_provisioning` of the alias details.

func (*AliasService) NewMultiple added in v0.58.0

Create up to 1000 aliases for one CDN resource in a single request.

The request is atomic: if any item is invalid, nothing is created and the errors are returned per item, in the same order as the request items. An item whose hostname is already an alias of the same CDN resource is reported in `exists` and left unchanged.

The aliases limit of your account is checked against the items that would be created.

func (*AliasService) RetryCertificate added in v0.58.0

func (r *AliasService) RetryCertificate(ctx context.Context, aliasID int64, opts ...option.RequestOption) (res *AliasDetail, err error)

Start a new Let's Encrypt certificate issuance attempt for an alias that has none running. Use it after an attempt has failed and `ssl_status` is `failed`.

The number of attempts you can start per hour is limited.

func (*AliasService) Update added in v0.58.0

func (r *AliasService) Update(ctx context.Context, aliasID int64, body AliasUpdateParams, opts ...option.RequestOption) (res *AliasDetail, err error)

Change an alias. The hostname and the CDN resource of an alias cannot be changed; delete the alias and create a new one instead.

Set `active` to `false` to stop serving the alias; certificate issuance stops, though an attempt already being processed completes. Set it back to `true` to resume. Resuming an alias without a valid Let's Encrypt certificate starts a new issuance attempt, which is rate-limited, so it cannot be combined with `automated` in one request. A renewal stopped by the pause is started again by the scheduled renewal after the alias is resumed.

For an alias with your own certificate, pass a new certificate ID in `ssl_id` to replace it. The new certificate must cover the alias hostname.

Pass `automated` to switch how the certificate is managed. Switching to your own certificate takes effect at once and the Let's Encrypt certificate issued for the alias is removed. Switching to a Let's Encrypt certificate starts an issuance attempt while your certificate keeps being served, and the alias starts serving the new certificate once it is issued; if the attempt fails, `ssl_status` becomes `failed` and your certificate keeps being served. The certificate mode cannot be changed while the alias is paused — resume it first.

Pass `challenge_type` to change how the Let's Encrypt certificate's domain is validated. It cannot be changed while the alias is paused, or together with `active`. While no valid certificate is served, the change cancels the running issuance attempt and starts a new one; this is rate-limited like resuming, and is refused while that attempt is being processed. Otherwise the new method is used from the next attempt.

type AliasSslStatus added in v0.58.0

type AliasSslStatus string

Outcome of the certificate we manage for the alias.

Possible values:

  • `pending` – A certificate attempt is in progress, or was stopped by pausing the alias and starts again after it is resumed.
  • `issued` – The latest attempt succeeded.
  • `failed` – The latest attempt ended without a certificate.
  • `null` – No certificate is managed for the alias: the alias uses a certificate you provided, or is automated and has never opened an attempt.
const (
	AliasSslStatusPending AliasSslStatus = "pending"
	AliasSslStatusIssued  AliasSslStatus = "issued"
	AliasSslStatusFailed  AliasSslStatus = "failed"
)

type AliasStatus added in v0.58.0

type AliasStatus string

Alias status.

Possible values:

  • `inactive` – The alias or its CDN resource is disabled; the alias is not served.
  • `pending` – The alias configuration has not reached the CDN yet.
  • `http_only` – The alias is served over HTTP only.
  • `active` – The alias is served over HTTP and HTTPS.
const (
	AliasStatusInactive AliasStatus = "inactive"
	AliasStatusPending  AliasStatus = "pending"
	AliasStatusHTTPOnly AliasStatus = "http_only"
	AliasStatusActive   AliasStatus = "active"
)

type AliasUpdateParams added in v0.58.0

type AliasUpdateParams struct {
	// Whether the alias is enabled.
	//
	// Possible values:
	//
	//   - `true` – The alias is enabled.
	//   - `false` – The alias is paused and is not served. Certificate issuance stops,
	//     though an attempt already being processed completes.
	Active param.Opt[bool] `json:"active,omitzero"`
	// How the alias certificate is managed. Change it to switch the alias between a
	// Let's Encrypt certificate and your own. Cannot be changed while the alias is
	// paused.
	//
	// Possible values:
	//
	//   - `true` – Switch to a Let's Encrypt certificate. `ssl_id` must be omitted. The
	//     current certificate keeps being served until the new one is issued.
	//   - `false` – Switch to your own certificate. `ssl_id` is required and is served
	//     immediately.
	Automated param.Opt[bool] `json:"automated,omitzero"`
	// ID of your own SSL certificate to serve for the alias instead of the current
	// one. The certificate must cover the alias hostname; a Let's Encrypt certificate
	// issued for one of your CDN resources cannot be used. Available for an alias with
	// `automated` set to `false`, and together with `automated` set to `false` to
	// switch to your own certificate.
	SslID param.Opt[int64] `json:"ssl_id,omitzero"`
	// Domain validation method used to issue the Let's Encrypt certificate for the
	// alias.
	//
	// Possible values:
	//
	//   - `dns_01` – Validation via a CNAME record for
	//     `_acme-challenge.<alias hostname>`, shown in
	//     `ssl_provisioning.acme_delegation`.
	//   - `http_01` – Validation via an HTTP request to the alias hostname. The alias
	//     hostname must point to your CDN CNAME, shown in
	//     `ssl_provisioning.http_validation`. The request is served with the settings of
	//     the alias's CDN resource, so they must not block or redirect
	//     `/.well-known/acme-challenge/`.
	//
	// Any of "dns_01", "http_01".
	ChallengeType AliasUpdateParamsChallengeType `json:"challenge_type,omitzero"`
	// contains filtered or unexported fields
}

func (AliasUpdateParams) MarshalJSON added in v0.58.0

func (r AliasUpdateParams) MarshalJSON() (data []byte, err error)

func (*AliasUpdateParams) UnmarshalJSON added in v0.58.0

func (r *AliasUpdateParams) UnmarshalJSON(data []byte) error

type AliasUpdateParamsChallengeType added in v0.60.0

type AliasUpdateParamsChallengeType string

Domain validation method used to issue the Let's Encrypt certificate for the alias.

Possible values:

  • `dns_01` – Validation via a CNAME record for `_acme-challenge.<alias hostname>`, shown in `ssl_provisioning.acme_delegation`.
  • `http_01` – Validation via an HTTP request to the alias hostname. The alias hostname must point to your CDN CNAME, shown in `ssl_provisioning.http_validation`. The request is served with the settings of the alias's CDN resource, so they must not block or redirect `/.well-known/acme-challenge/`.
const (
	AliasUpdateParamsChallengeTypeDNS01  AliasUpdateParamsChallengeType = "dns_01"
	AliasUpdateParamsChallengeTypeHTTP01 AliasUpdateParamsChallengeType = "http_01"
)

type AlibabaRegions added in v0.17.0

type AlibabaRegions struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string                 `json:"previous" api:"required"`
	Results  []AlibabaRegionsResult `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AlibabaRegions) RawJSON added in v0.51.0

func (r AlibabaRegions) RawJSON() string

Returns the unmodified JSON received from the API

func (*AlibabaRegions) UnmarshalJSON added in v0.51.0

func (r *AlibabaRegions) UnmarshalJSON(data []byte) error

type AlibabaRegionsResult added in v0.51.0

type AlibabaRegionsResult struct {
	// Region ID.
	ID int64 `json:"id"`
	// Region code.
	Code string `json:"code"`
	// Region name.
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Code        respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AlibabaRegionsResult) RawJSON added in v0.51.0

func (r AlibabaRegionsResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*AlibabaRegionsResult) UnmarshalJSON added in v0.51.0

func (r *AlibabaRegionsResult) UnmarshalJSON(data []byte) error

type AppliedPreset added in v0.55.0

type AppliedPreset struct {
	// IDs of the objects the preset is currently applied to. Empty when the preset is
	// not applied to anything.
	ObjectIDs []int64 `json:"object_ids" api:"required"`
	// Type of objects the preset is applied to.
	ObjectType string `json:"object_type" api:"required"`
	// Deprecated. Present only when `object_ids` is empty. Check `object_ids` instead.
	// This field is kept for backward compatibility and will be removed in a future
	// version.
	//
	// Deprecated: deprecated
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ObjectIDs   respjson.Field
		ObjectType  respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AppliedPreset) RawJSON added in v0.55.0

func (r AppliedPreset) RawJSON() string

Returns the unmodified JSON received from the API

func (*AppliedPreset) UnmarshalJSON added in v0.55.0

func (r *AppliedPreset) UnmarshalJSON(data []byte) error

type AppliedPresetCreated added in v0.56.0

type AppliedPresetCreated struct {
	// ID of the object (CDN resource or rule, according to the preset `object_type`)
	// the preset is applied to.
	ObjectID int64 `json:"object_id" api:"required"`
	// ID of the preset that is applied to the object. Matches the `preset_id` path
	// parameter.
	PresetID int64 `json:"preset_id" api:"required"`
	// Deprecated. Use `preset_id` and `object_id` instead. This field is kept for
	// backward compatibility and will be removed in a future version.
	//
	// Deprecated: deprecated
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ObjectID    respjson.Field
		PresetID    respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AppliedPresetCreated) RawJSON added in v0.56.0

func (r AppliedPresetCreated) RawJSON() string

Returns the unmodified JSON received from the API

func (*AppliedPresetCreated) UnmarshalJSON added in v0.56.0

func (r *AppliedPresetCreated) UnmarshalJSON(data []byte) error

type AppliedPresetFields added in v0.52.0

type AppliedPresetFields struct {
	// ID of the applied preset.
	ID int64 `json:"id"`
	// Defines whether the applied preset can be unapplied from the object by the
	// current user.
	Deletable bool `json:"deletable"`
	// Object fields managed by the preset. Option fields are prefixed with `options.`.
	Fields []string `json:"fields"`
	// Name of the applied preset.
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Deletable   respjson.Field
		Fields      respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Preset applied to the object and the list of object fields that are managed by the preset.

func (AppliedPresetFields) RawJSON added in v0.52.0

func (r AppliedPresetFields) RawJSON() string

Returns the unmodified JSON received from the API

func (*AppliedPresetFields) UnmarshalJSON added in v0.52.0

func (r *AppliedPresetFields) UnmarshalJSON(data []byte) error

type AppliedPresetObject added in v0.56.0

type AppliedPresetObject struct {
	// ID of the object (CDN resource or rule, according to the preset `object_type`)
	// the preset is applied to.
	ObjectID int64 `json:"object_id" api:"required"`
	// ID of the preset that is applied to the object. Matches the `preset_id` path
	// parameter.
	PresetID int64 `json:"preset_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ObjectID    respjson.Field
		PresetID    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A single object the preset is applied to.

func (AppliedPresetObject) RawJSON added in v0.56.0

func (r AppliedPresetObject) RawJSON() string

Returns the unmodified JSON received from the API

func (*AppliedPresetObject) UnmarshalJSON added in v0.56.0

func (r *AppliedPresetObject) UnmarshalJSON(data []byte) error

type AuditLogListParams

type AuditLogListParams struct {
	// Client ID.
	ClientID param.Opt[int64] `query:"client_id,omitzero" json:"-"`
	// Maximum number of items in response.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	//
	// You can specify a date with a time separated by a space, or just a date.
	//
	// Examples:
	//
	// - &`max_requested_at`=2021-05-05 12:00:00
	// - &`max_requested_at`=2021-05-05
	MaxRequestedAt param.Opt[string] `query:"max_requested_at,omitzero" json:"-"`
	// HTTP method type of requests.
	//
	// Use upper case only.
	//
	// Example:
	//
	// - ?method=DELETE
	Method param.Opt[string] `query:"method,omitzero" json:"-"`
	// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	//
	// You can specify a date with a time separated by a space, or just a date.
	//
	// Examples:
	//
	// - &`min_requested_at`=2021-05-05 12:00:00
	// - &`min_requested_at`=2021-05-05
	MinRequestedAt param.Opt[string] `query:"min_requested_at,omitzero" json:"-"`
	// Offset relative to the beginning of activity logs.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Exact URL path.
	Path param.Opt[string] `query:"path,omitzero" json:"-"`
	// Exact IP address from which requests are sent.
	RemoteIPAddress param.Opt[string] `query:"remote_ip_address,omitzero" json:"-"`
	// Status code returned in the response.
	//
	// Specify the first numbers of a status code to get requests for a group of status
	// codes.
	//
	// To filter the activity logs by 4xx codes, use:
	//
	// - &`status_code`=4 -
	StatusCode param.Opt[int64] `query:"status_code,omitzero" json:"-"`
	// Permanent API token ID. Requests made with this token should be displayed.
	TokenID param.Opt[int64] `query:"token_id,omitzero" json:"-"`
	// User ID.
	UserID param.Opt[int64] `query:"user_id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AuditLogListParams) URLQuery

func (r AuditLogListParams) URLQuery() (v url.Values, err error)

URLQuery serializes AuditLogListParams's query parameters as `url.Values`.

type AuditLogService

type AuditLogService struct {
	Options []option.RequestOption
}

Get the history of users requests to CDN. It contains requests made both via the API and via the control panel.

The following methods are not tracked in the activity logs:

- HEAD - OPTIONS

AuditLogService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAuditLogService method instead.

func NewAuditLogService

func NewAuditLogService(opts ...option.RequestOption) (r AuditLogService)

NewAuditLogService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AuditLogService) Get

func (r *AuditLogService) Get(ctx context.Context, logID int64, opts ...option.RequestOption) (res *CDNAuditLogEntry, err error)

Get information about CDN activity logs record.

func (*AuditLogService) List

Get information about all CDN activity logs records.

func (*AuditLogService) ListAutoPaging

Get information about all CDN activity logs records.

type AwsRegions added in v0.17.0

type AwsRegions struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string             `json:"previous" api:"required"`
	Results  []AwsRegionsResult `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AwsRegions) RawJSON added in v0.51.0

func (r AwsRegions) RawJSON() string

Returns the unmodified JSON received from the API

func (*AwsRegions) UnmarshalJSON added in v0.51.0

func (r *AwsRegions) UnmarshalJSON(data []byte) error

type AwsRegionsResult added in v0.51.0

type AwsRegionsResult struct {
	// Region ID.
	ID int64 `json:"id"`
	// Region code.
	Code string `json:"code"`
	// Region name.
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Code        respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AwsRegionsResult) RawJSON added in v0.51.0

func (r AwsRegionsResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*AwsRegionsResult) UnmarshalJSON added in v0.51.0

func (r *AwsRegionsResult) UnmarshalJSON(data []byte) error

type CDNAccount added in v0.31.0

type CDNAccount struct {
	// Account ID.
	ID int64 `json:"id"`
	// Defines whether resources will be deactivated automatically by inactivity.
	//
	// Possible values:
	//
	// - **true** - Resources will be deactivated.
	// - **false** - Resources will not be deactivated.
	AutoSuspendEnabled bool `json:"auto_suspend_enabled"`
	// Limit on the number of rules for each CDN resource.
	CDNResourcesRulesMaxCount int64 `json:"cdn_resources_rules_max_count"`
	// Domain zone to which a CNAME record of your CDN resources should be pointed.
	Cname string `json:"cname"`
	// Date of the first synchronization with the Platform (ISO 8601/RFC 3339 format,
	// UTC.)
	Created string `json:"created"`
	// Information about the CDN service status.
	Service CDNAccountService `json:"service"`
	// Date of the last update of information about CDN service (ISO 8601/RFC 3339
	// format, UTC.)
	Updated string `json:"updated"`
	// Defines whether custom balancing is used for content delivery.
	//
	// Possible values:
	//
	// - **true** - Custom balancing is used for content delivery.
	// - **false** - Custom balancing is not used for content delivery.
	UseBalancer bool `json:"use_balancer"`
	// CDN traffic usage limit in gigabytes.
	//
	// When the limit is reached, we will send an email notification.
	UtilizationLevel int64 `json:"utilization_level"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                        respjson.Field
		AutoSuspendEnabled        respjson.Field
		CDNResourcesRulesMaxCount respjson.Field
		Cname                     respjson.Field
		Created                   respjson.Field
		Service                   respjson.Field
		Updated                   respjson.Field
		UseBalancer               respjson.Field
		UtilizationLevel          respjson.Field
		ExtraFields               map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNAccount) RawJSON added in v0.31.0

func (r CDNAccount) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNAccount) UnmarshalJSON added in v0.31.0

func (r *CDNAccount) UnmarshalJSON(data []byte) error

type CDNAccountLimits added in v0.31.0

type CDNAccountLimits struct {
	// Account ID.
	ID int64 `json:"id"`
	// Maximum number of aliases that can be created on your tariff plan.
	AliasesLimit int64 `json:"aliases_limit"`
	// Maximum number of origins that can be added to the origin group on your tariff
	// plan.
	OriginsInGroupLimit int64 `json:"origins_in_group_limit"`
	// Maximum number of patterns per prefetch request.
	PrefetchPatternLimit int64 `json:"prefetch_pattern_limit"`
	// Rate limit for prefetch requests.
	PrefetchRequestLimit string `json:"prefetch_request_limit"`
	// Rate limit for purge-by-URL requests.
	PurgeByURLsRequestLimit string `json:"purge_by_urls_request_limit"`
	// Maximum number of URLs per purge-by-URL request.
	PurgeMaxURLsLimit int64 `json:"purge_max_urls_limit"`
	// Maximum number of patterns per purge request.
	PurgePatternLimit int64 `json:"purge_pattern_limit"`
	// Rate limit for purge-by-pattern requests.
	PurgeRequestLimit string `json:"purge_request_limit"`
	// Maximum number of CDN resources that can be created on your tariff plan.
	ResourcesLimit int64 `json:"resources_limit"`
	// Maximum number of rules that can be created per CDN resource on your tariff
	// plan.
	RulesLimit int64 `json:"rules_limit"`
	// Maximum number of secondary hostnames (additional CNAMEs) per CDN resource.
	SecondaryHostnamesLimit int64 `json:"secondary_hostnames_limit"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                      respjson.Field
		AliasesLimit            respjson.Field
		OriginsInGroupLimit     respjson.Field
		PrefetchPatternLimit    respjson.Field
		PrefetchRequestLimit    respjson.Field
		PurgeByURLsRequestLimit respjson.Field
		PurgeMaxURLsLimit       respjson.Field
		PurgePatternLimit       respjson.Field
		PurgeRequestLimit       respjson.Field
		ResourcesLimit          respjson.Field
		RulesLimit              respjson.Field
		SecondaryHostnamesLimit respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNAccountLimits) RawJSON added in v0.31.0

func (r CDNAccountLimits) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNAccountLimits) UnmarshalJSON added in v0.31.0

func (r *CDNAccountLimits) UnmarshalJSON(data []byte) error

type CDNAccountService added in v0.31.0

type CDNAccountService struct {
	// Defines whether the CDN service is activated.
	//
	// Possible values:
	//
	// - **true** - Service is activated.
	// - **false** - Service is not activated.
	Enabled bool `json:"enabled"`
	// CDN service status.
	//
	// Possible values:
	//
	//   - **new** - CDN service is not activated.
	//   - **trial** - Free trial is in progress.
	//   - **trialend** - Free trial has ended and CDN service is stopped. All CDN
	//     resources are suspended.
	//   - **activating** - CDN service is being activated. It can take up to 15 minutes.
	//   - **active** - CDN service is active.
	//   - **paused** - CDN service is stopped. All CDN resources are suspended.
	//   - **deleted** - CDN service is stopped. All CDN resources are deleted.
	Status string `json:"status"`
	// Date of the last CDN service status update (ISO 8601/RFC 3339 format, UTC.)
	Updated string `json:"updated"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Status      respjson.Field
		Updated     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about the CDN service status.

func (CDNAccountService) RawJSON added in v0.31.0

func (r CDNAccountService) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNAccountService) UnmarshalJSON added in v0.31.0

func (r *CDNAccountService) UnmarshalJSON(data []byte) error

type CDNAuditLogEntry added in v0.31.0

type CDNAuditLogEntry struct {
	// Activity logs record ID.
	ID int64 `json:"id"`
	// State of a requested object before and after the request.
	Actions []CDNAuditLogEntryAction `json:"actions"`
	// ID of the client who made the request.
	ClientID int64 `json:"client_id"`
	// Request body.
	Data any `json:"data"`
	// Host from which the request was made.
	Host string `json:"host"`
	// Request HTTP method.
	Method string `json:"method"`
	// Request URL.
	Path string `json:"path"`
	// Request parameters.
	QueryParams string `json:"query_params"`
	// IP address from which the request was made.
	RemoteIPAddress string `json:"remote_ip_address"`
	// Date and time when the request was made.
	RequestedAt string `json:"requested_at"`
	// Status code that is returned in the response.
	StatusCode int64 `json:"status_code"`
	// Permanent API token ID with which the request was made.
	TokenID int64 `json:"token_id"`
	// ID of the user who made the request.
	UserID int64 `json:"user_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Actions         respjson.Field
		ClientID        respjson.Field
		Data            respjson.Field
		Host            respjson.Field
		Method          respjson.Field
		Path            respjson.Field
		QueryParams     respjson.Field
		RemoteIPAddress respjson.Field
		RequestedAt     respjson.Field
		StatusCode      respjson.Field
		TokenID         respjson.Field
		UserID          respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNAuditLogEntry) RawJSON added in v0.31.0

func (r CDNAuditLogEntry) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNAuditLogEntry) UnmarshalJSON added in v0.31.0

func (r *CDNAuditLogEntry) UnmarshalJSON(data []byte) error

type CDNAuditLogEntryAction added in v0.31.0

type CDNAuditLogEntryAction struct {
	// Type of change.
	//
	// Possible values:
	//
	// - **D** - Object is deleted.
	// - **C** - Object is created.
	// - **U** - Object is updated.
	ActionType string `json:"action_type"`
	// JSON representation of object after the request.
	StateAfterRequest any `json:"state_after_request"`
	// JSON representation of object before the request.
	StateBeforeRequest any `json:"state_before_request"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActionType         respjson.Field
		StateAfterRequest  respjson.Field
		StateBeforeRequest respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNAuditLogEntryAction) RawJSON added in v0.31.0

func (r CDNAuditLogEntryAction) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNAuditLogEntryAction) UnmarshalJSON added in v0.31.0

func (r *CDNAuditLogEntryAction) UnmarshalJSON(data []byte) error

type CDNAvailableFeatures added in v0.31.0

type CDNAvailableFeatures struct {
	// Account ID.
	ID int64 `json:"id"`
	// Free features available for your account.
	FreeFeatures []CDNAvailableFeaturesFreeFeature `json:"free_features"`
	// Paid features available for your account.
	PaidFeatures []CDNAvailableFeaturesPaidFeature `json:"paid_features"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		FreeFeatures respjson.Field
		PaidFeatures respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNAvailableFeatures) RawJSON added in v0.31.0

func (r CDNAvailableFeatures) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNAvailableFeatures) UnmarshalJSON added in v0.31.0

func (r *CDNAvailableFeatures) UnmarshalJSON(data []byte) error

type CDNAvailableFeaturesFreeFeature added in v0.31.0

type CDNAvailableFeaturesFreeFeature struct {
	// Date and time when the feature was activated (ISO 8601/RFC 3339 format, UTC.)
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Internal feature activation ID.
	FreeFeatureID int64 `json:"free_feature_id"`
	// Feature name.
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		FreeFeatureID respjson.Field
		Name          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNAvailableFeaturesFreeFeature) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNAvailableFeaturesFreeFeature) UnmarshalJSON added in v0.31.0

func (r *CDNAvailableFeaturesFreeFeature) UnmarshalJSON(data []byte) error

type CDNAvailableFeaturesPaidFeature added in v0.31.0

type CDNAvailableFeaturesPaidFeature struct {
	// Date and time when the feature was activated (ISO 8601/RFC 3339 format, UTC.)
	CreateDate string `json:"create_date"`
	// Feature ID.
	FeatureID int64 `json:"feature_id"`
	// Feature name.
	Name string `json:"name"`
	// Internal feature activation ID.
	PaidFeatureID int64 `json:"paid_feature_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreateDate    respjson.Field
		FeatureID     respjson.Field
		Name          respjson.Field
		PaidFeatureID respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNAvailableFeaturesPaidFeature) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNAvailableFeaturesPaidFeature) UnmarshalJSON added in v0.31.0

func (r *CDNAvailableFeaturesPaidFeature) UnmarshalJSON(data []byte) error

type CDNListAlibabaRegionsParams added in v0.41.0

type CDNListAlibabaRegionsParams struct {
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CDNListAlibabaRegionsParams) URLQuery added in v0.41.0

func (r CDNListAlibabaRegionsParams) URLQuery() (v url.Values, err error)

URLQuery serializes CDNListAlibabaRegionsParams's query parameters as `url.Values`.

type CDNListAwsRegionsParams added in v0.41.0

type CDNListAwsRegionsParams struct {
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CDNListAwsRegionsParams) URLQuery added in v0.41.0

func (r CDNListAwsRegionsParams) URLQuery() (v url.Values, err error)

URLQuery serializes CDNListAwsRegionsParams's query parameters as `url.Values`.

type CDNListPurgeStatusesParams added in v0.31.0

type CDNListPurgeStatusesParams struct {
	// Purges associated with a specific resource CNAME.
	//
	// Example:
	//
	// - &cname=example.com
	Cname param.Opt[string] `query:"cname,omitzero" json:"-"`
	// Start date and time of the requested time period (ISO 8601/RFC 3339 format,
	// UTC.)
	//
	// Examples:
	//
	// - &`from_created`=2021-06-14T00:00:00Z
	// - &`from_created`=2021-06-14T00:00:00.000Z
	FromCreated param.Opt[string] `query:"from_created,omitzero" json:"-"`
	// Maximum number of purges in the response.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of purge requests in the response to skip starting from the beginning of
	// the requested period.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Purge requests with a certain purge type.
	//
	// Possible values:
	//
	// - **`purge_by_pattern`** - Purge by Pattern.
	// - **`purge_by_url`** - Purge by URL.
	// - **`purge_all`** - Purge All.
	PurgeType param.Opt[string] `query:"purge_type,omitzero" json:"-"`
	// Purge with a certain status.
	//
	// Possible values:
	//
	// - **In progress**
	// - **Successful**
	// - **Failed**
	// - **Status report disabled**
	Status param.Opt[string] `query:"status,omitzero" json:"-"`
	// End date and time of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	//
	// Examples:
	//
	// - &`to_created`=2021-06-15T00:00:00Z
	// - &`to_created`=2021-06-15T00:00:00.000Z
	ToCreated param.Opt[string] `query:"to_created,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CDNListPurgeStatusesParams) URLQuery added in v0.31.0

func (r CDNListPurgeStatusesParams) URLQuery() (v url.Values, err error)

URLQuery serializes CDNListPurgeStatusesParams's query parameters as `url.Values`.

type CDNLogEntry added in v0.31.0

type CDNLogEntry struct {
	// Contains requested logs.
	Data []CDNLogEntryData `json:"data" api:"required"`
	// Contains meta-information.
	Meta CDNLogEntryMeta `json:"meta" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNLogEntry) RawJSON added in v0.31.0

func (r CDNLogEntry) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNLogEntry) UnmarshalJSON added in v0.31.0

func (r *CDNLogEntry) UnmarshalJSON(data []byte) error

type CDNLogEntryData added in v0.31.0

type CDNLogEntryData struct {
	// Cache status: HIT, MISS, etc.
	CacheStatus string `json:"cache_status"`
	// IP address from that the request was received.
	ClientIP string `json:"client_ip"`
	// CDN resource custom domain.
	Cname string `json:"cname"`
	// Data center where the request was processed.
	Datacenter string `json:"datacenter"`
	// HTTP method used in the request.
	Method string `json:"method"`
	// Path requested.
	Path string `json:"path"`
	// Value of 'Referer' header.
	Referer string `json:"referer"`
	// CDN resource ID.
	ResourceID int64 `json:"resource_id"`
	// Value of the Content-Type HTTP header, indicating the MIME type of the resource
	// being transmitted.
	SentHTTPContentType string `json:"sent_http_content_type"`
	// Response size in bytes.
	Size int64 `json:"size"`
	// HTTP status code.
	Status int64 `json:"status"`
	// Time required to transmit a complete TCP segment: from the first bit to the
	// last.
	TcpinfoRtt int64 `json:"tcpinfo_rtt"`
	// Log timestamp.
	Timestamp int64 `json:"timestamp"`
	// Value of 'User-Agent' header.
	UserAgent string `json:"user_agent"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheStatus         respjson.Field
		ClientIP            respjson.Field
		Cname               respjson.Field
		Datacenter          respjson.Field
		Method              respjson.Field
		Path                respjson.Field
		Referer             respjson.Field
		ResourceID          respjson.Field
		SentHTTPContentType respjson.Field
		Size                respjson.Field
		Status              respjson.Field
		TcpinfoRtt          respjson.Field
		Timestamp           respjson.Field
		UserAgent           respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNLogEntryData) RawJSON added in v0.31.0

func (r CDNLogEntryData) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNLogEntryData) UnmarshalJSON added in v0.31.0

func (r *CDNLogEntryData) UnmarshalJSON(data []byte) error

type CDNLogEntryMeta added in v0.31.0

type CDNLogEntryMeta struct {
	// Total number of records which match given parameters.
	Count int64 `json:"count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Contains meta-information.

func (CDNLogEntryMeta) RawJSON added in v0.31.0

func (r CDNLogEntryMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNLogEntryMeta) UnmarshalJSON added in v0.31.0

func (r *CDNLogEntryMeta) UnmarshalJSON(data []byte) error

type CDNMetrics added in v0.31.0

type CDNMetrics struct {
	// If no grouping was requested then "data" holds an array of metric values. If at
	// least one field is specified in "group_by" then "data" is an object whose
	// properties are groups, which may include other groups; the last group will hold
	// array of metrics values.
	Data CDNMetricsDataUnion `json:"data"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNMetrics) RawJSON added in v0.31.0

func (r CDNMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNMetrics) UnmarshalJSON added in v0.31.0

func (r *CDNMetrics) UnmarshalJSON(data []byte) error

type CDNMetricsDataUnion added in v0.31.0

type CDNMetricsDataUnion struct {
	// This field will be present if the value is a [CDNMetricsValues] instead of an
	// object.
	OfCDNMetricsValues CDNMetricsValues `json:",inline"`
	// This field will be present if the value is a [any] instead of an object.
	OfCDNMetricsGroup any `json:",inline"`
	JSON              struct {
		OfCDNMetricsValues respjson.Field
		OfCDNMetricsGroup  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CDNMetricsDataUnion contains all possible properties and values from CDNMetricsValues, CDNMetricsGroups.

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfCDNMetricsValues OfCDNMetricsGroup]

func (CDNMetricsDataUnion) AsAnyMap added in v0.51.0

func (u CDNMetricsDataUnion) AsAnyMap() (v CDNMetricsGroups)

func (CDNMetricsDataUnion) AsCDNMetricsValues added in v0.31.0

func (u CDNMetricsDataUnion) AsCDNMetricsValues() (v CDNMetricsValues)

func (CDNMetricsDataUnion) RawJSON added in v0.31.0

func (u CDNMetricsDataUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNMetricsDataUnion) UnmarshalJSON added in v0.31.0

func (r *CDNMetricsDataUnion) UnmarshalJSON(data []byte) error

type CDNMetricsGroups added in v0.31.0

type CDNMetricsGroups map[string]any

type CDNMetricsValue added in v0.31.0

type CDNMetricsValue struct {
	// Start timestamp of interval.
	Timestamp   int64                           `json:"timestamp"`
	ExtraFields map[string]CDNMetricsValueUnion `json:"" api:"extrafields"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNMetricsValue) RawJSON added in v0.31.0

func (r CDNMetricsValue) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNMetricsValue) UnmarshalJSON added in v0.31.0

func (r *CDNMetricsValue) UnmarshalJSON(data []byte) error

type CDNMetricsValueUnion added in v0.51.0

type CDNMetricsValueUnion struct {
	// This field will be present if the value is a [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	JSON     struct {
		OfFloat  respjson.Field
		OfString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CDNMetricsValueUnion contains all possible properties and values from [float64], [map[string]string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfFloat OfString]

func (CDNMetricsValueUnion) AsFloat added in v0.51.0

func (u CDNMetricsValueUnion) AsFloat() (v float64)

func (CDNMetricsValueUnion) AsStringMap added in v0.51.0

func (u CDNMetricsValueUnion) AsStringMap() (v map[string]string)

func (CDNMetricsValueUnion) RawJSON added in v0.51.0

func (u CDNMetricsValueUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNMetricsValueUnion) UnmarshalJSON added in v0.51.0

func (r *CDNMetricsValueUnion) UnmarshalJSON(data []byte) error

type CDNMetricsValues added in v0.31.0

type CDNMetricsValues []CDNMetricsValue

type CDNResource added in v0.31.0

type CDNResource struct {
	// CDN resource ID.
	ID int64 `json:"id"`
	// Enables or disables a CDN resource.
	//
	// Possible values:
	//
	// - **true** - CDN resource is active. Content is being delivered.
	// - **false** - CDN resource is deactivated. Content is not being delivered.
	Active bool `json:"active"`
	// Defines whether the CDN resource can be used for purge by URLs feature.
	//
	// It's available only in case the CDN resource has enabled `ignore_vary_header`
	// option.
	CanPurgeByURLs bool `json:"can_purge_by_urls"`
	// ID of an account to which the CDN resource belongs.
	Client int64 `json:"client"`
	// Delivery domains that will be used for content delivery through a CDN.
	//
	// Delivery domains should be added to your DNS settings.
	Cname string `json:"cname"`
	// Date of CDN resource creation.
	Created string `json:"created"`
	// Defines whether CDN resource has been deleted.
	//
	// Possible values:
	//
	// - **true** - CDN resource is deleted.
	// - **false** - CDN resource is not deleted.
	Deleted bool `json:"deleted"`
	// Optional comment describing the CDN resource.
	Description string `json:"description"`
	// Enables or disables a CDN resource change by a user.
	//
	// Possible values:
	//
	//   - **true** - CDN resource is enabled and can be changed. Content can be
	//     delivered.
	//   - **false** - CDN resource is disabled and cannot be changed. Content can not be
	//     delivered.
	Enabled bool `json:"enabled"`
	// Defines whether the CDN resource has a custom configuration.
	//
	// Possible values:
	//
	//   - **true** - CDN resource has a custom configuration. You cannot change resource
	//     settings, except for the SSL certificate. To change other settings, contact
	//     technical support.
	//   - **false** - CDN resource has a regular configuration. You can change CDN
	//     resource settings.
	FullCustomEnabled bool `json:"full_custom_enabled"`
	// Defines whether a CDN resource has a cache zone shared with other CDN resources.
	//
	// Possible values:
	//
	//   - **true** - CDN resource is main and has a shared caching zone with other CDN
	//     resources, which are called reserve.
	//   - **false** - CDN resource is reserve and it has a shared caching zone with the
	//     main CDN resource. You cannot change some options, create rules, set up origin
	//     shielding and use the reserve resource for Streaming.
	//   - **null** - CDN resource does not have a shared cache zone.
	//
	// The main CDN resource is specified in the `primary_resource` field. It cannot be
	// suspended unless all related reserve CDN resources are suspended.
	IsPrimary bool `json:"is_primary" api:"nullable"`
	// CDN resource name.
	Name string `json:"name" api:"nullable"`
	// List of options that can be configured for the CDN resource.
	//
	// In case of `null` value the option is not added to the CDN resource. Option may
	// inherit its value from the global account settings.
	Options CDNResourceOptions `json:"options"`
	// Origin group ID with which the CDN resource is associated.
	OriginGroup int64 `json:"originGroup"`
	// Origin group name.
	OriginGroupName string `json:"originGroup_name"`
	// Protocol used by CDN servers to request content from an origin source.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers will connect to the origin via HTTPS.
	//   - **HTTP** - CDN servers will connect to the origin via HTTP.
	//   - **MATCH** - connection protocol will be chosen automatically (content on the
	//     origin source should be available for the CDN both through HTTP and HTTPS).
	//
	// If protocol is not specified, HTTP is used to connect to an origin server.
	//
	// If an enabled origin in the resource's origin group is bound to a Gcore Object
	// Storage (`s3_type` is `gcore`), the CDN connects to every origin in that group
	// over HTTPS regardless of this setting.
	//
	// Any of "HTTP", "HTTPS", "MATCH".
	OriginProtocol CDNResourceOriginProtocol `json:"originProtocol"`
	// Defines whether the CDN resource has a preset applied.
	//
	// Possible values:
	//
	//   - **true** - CDN resource has a preset applied. CDN resource options included in
	//     the preset cannot be edited.
	//   - **false** - CDN resource does not have a preset applied.
	PresetApplied bool `json:"preset_applied"`
	// ID of the main CDN resource which has a shared caching zone with a reserve CDN
	// resource.
	//
	// If the parameter is not empty, then the current CDN resource is the reserve. You
	// cannot change some options, create rules, set up origin shielding, or use the
	// reserve CDN resource for Streaming.
	PrimaryResource int64 `json:"primary_resource" api:"nullable"`
	// ID of the trusted CA certificate used to verify an origin.
	//
	// It can be used only with `"proxy_ssl_enabled": true`.
	ProxySslCa int64 `json:"proxy_ssl_ca" api:"nullable"`
	// ID of the SSL certificate used to verify an origin.
	//
	// It can be used only with `"proxy_ssl_enabled": true`.
	ProxySslData int64 `json:"proxy_ssl_data" api:"nullable"`
	// Enables or disables SSL certificate validation of the origin server before
	// completing any connection.
	//
	// Possible values:
	//
	// - **true** - Origin SSL certificate validation is enabled.
	// - **false** - Origin SSL certificate validation is disabled.
	ProxySslEnabled bool `json:"proxy_ssl_enabled"`
	// Rules configured for the CDN resource.
	Rules []any `json:"rules"`
	// Additional delivery domains (CNAMEs) that will be used to deliver content via
	// the CDN.
	//
	// Up to ten additional CNAMEs are possible.
	SecondaryHostnames []string `json:"secondaryHostnames" format:"domain"`
	// Name of the origin shielding location data center.
	//
	// Parameter returns **null** if origin shielding is disabled.
	ShieldDc string `json:"shield_dc" api:"nullable"`
	// Defines whether origin shield is active and working for the CDN resource.
	//
	// Possible values:
	//
	// - **true** - Origin shield is active.
	// - **false** - Origin shield is not active.
	ShieldEnabled bool `json:"shield_enabled"`
	// Defines whether the origin shield with a dynamic location is enabled for the CDN
	// resource.
	//
	// To manage origin shielding, you must contact customer support.
	ShieldRoutingMap int64 `json:"shield_routing_map" api:"nullable"`
	// Defines whether origin shielding feature is enabled for the resource.
	//
	// Possible values:
	//
	// - **true** - Origin shielding is enabled.
	// - **false** - Origin shielding is disabled.
	Shielded bool `json:"shielded"`
	// ID of the SSL certificate linked to the CDN resource.
	//
	// Can be used only with `"sslEnabled": true`.
	SslData int64 `json:"sslData" api:"nullable"`
	// Defines whether the HTTPS protocol enabled for content delivery.
	//
	// Possible values:
	//
	// - **true** - HTTPS is enabled.
	// - **false** - HTTPS is disabled.
	SslEnabled bool `json:"sslEnabled"`
	// CDN resource status.
	//
	// Possible values:
	//
	//   - **active** - CDN resource is active. Content is available to users.
	//   - **suspended** - CDN resource is suspended. Content is not available to users.
	//   - **processed** - CDN resource has recently been created and is currently being
	//     processed. It will take about fifteen minutes to propagate it to all
	//     locations.
	//   - **deleted** - CDN resource is deleted.
	//
	// Any of "active", "suspended", "processed", "deleted".
	Status CDNResourceStatus `json:"status"`
	// Date when the CDN resource was suspended automatically if there is no traffic on
	// it for 90 days.
	//
	// Not specified if the resource was not stopped due to lack of traffic.
	SuspendDate string `json:"suspend_date" api:"nullable"`
	// Defines whether the CDN resource has been automatically suspended because there
	// was no traffic on it for 90 days.
	//
	// Possible values:
	//
	// - **true** - CDN resource is currently automatically suspended.
	// - **false** - CDN resource is not automatically suspended.
	//
	// You can enable CDN resource using the `active` field. If there is no traffic on
	// the CDN resource within seven days following activation, it will be suspended
	// again.
	//
	// To avoid CDN resource suspension due to no traffic, contact technical support.
	Suspended bool `json:"suspended"`
	// Date of the last CDN resource update.
	Updated string `json:"updated"`
	// Defines whether the CDN resource is integrated with the Streaming Platform.
	//
	// Possible values:
	//
	//   - **true** - CDN resource is configured for Streaming Platform. Changing
	//     resource settings can affect its operation.
	//   - **false** - CDN resource is not configured for Streaming Platform.
	VpEnabled bool `json:"vp_enabled"`
	// The ID of the associated WAAP domain.
	WaapDomainID string `json:"waap_domain_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		Active             respjson.Field
		CanPurgeByURLs     respjson.Field
		Client             respjson.Field
		Cname              respjson.Field
		Created            respjson.Field
		Deleted            respjson.Field
		Description        respjson.Field
		Enabled            respjson.Field
		FullCustomEnabled  respjson.Field
		IsPrimary          respjson.Field
		Name               respjson.Field
		Options            respjson.Field
		OriginGroup        respjson.Field
		OriginGroupName    respjson.Field
		OriginProtocol     respjson.Field
		PresetApplied      respjson.Field
		PrimaryResource    respjson.Field
		ProxySslCa         respjson.Field
		ProxySslData       respjson.Field
		ProxySslEnabled    respjson.Field
		Rules              respjson.Field
		SecondaryHostnames respjson.Field
		ShieldDc           respjson.Field
		ShieldEnabled      respjson.Field
		ShieldRoutingMap   respjson.Field
		Shielded           respjson.Field
		SslData            respjson.Field
		SslEnabled         respjson.Field
		Status             respjson.Field
		SuspendDate        respjson.Field
		Suspended          respjson.Field
		Updated            respjson.Field
		VpEnabled          respjson.Field
		WaapDomainID       respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNResource) RawJSON added in v0.31.0

func (r CDNResource) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResource) UnmarshalJSON added in v0.31.0

func (r *CDNResource) UnmarshalJSON(data []byte) error

type CDNResourceList added in v0.31.0

type CDNResourceList struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string        `json:"previous" api:"required"`
	Results  []CDNResource `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNResourceList) RawJSON added in v0.51.0

func (r CDNResourceList) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceList) UnmarshalJSON added in v0.51.0

func (r *CDNResourceList) UnmarshalJSON(data []byte) error

type CDNResourceListParams added in v0.31.0

type CDNResourceListParams struct {
	// Defines whether a CDN resource is activated.
	//
	// Possible values:
	//
	// - **true** - CDN resource is activated.
	// - **false** - CDN resource is deactivated.
	Active param.Opt[bool] `query:"active,omitzero" json:"-"`
	// Delivery domain (CNAME) of the CDN resource.
	Cname param.Opt[string] `query:"cname,omitzero" json:"-"`
	// Defines whether a CDN resource has been deleted.
	//
	// Possible values:
	//
	// - **true** - CDN resource has been deleted.
	// - **false** - CDN resource has not been deleted.
	Deleted param.Opt[bool] `query:"deleted,omitzero" json:"-"`
	// Enables or disables a CDN resource change by a user.
	//
	// Possible values:
	//
	// - **true** - CDN resource is enabled.
	// - **false** - CDN resource is disabled.
	Enabled param.Opt[bool] `query:"enabled,omitzero" json:"-"`
	// Filters CDN resources by their primary/alternate relationship. Standalone
	// resources — those not linked to another resource, which is the default — match
	// neither value and are returned by neither `true` nor `false`.
	//
	// Possible values:
	//
	//   - **true** - CDN resource is a primary resource for one or more alternate
	//     resources.
	//   - **false** - CDN resource is an alternate resource linked to a primary
	//     resource.
	IsPrimary param.Opt[bool] `query:"is_primary,omitzero" json:"-"`
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Most recent date of CDN resource creation for which CDN resources should be
	// returned (ISO 8601/RFC 3339 format, UTC.)
	MaxCreated param.Opt[string] `query:"max_created,omitzero" json:"-"`
	// Most recent date of CDN resource update for which CDN resources should be
	// returned (ISO 8601/RFC 3339 format, UTC.)
	MaxUpdated param.Opt[string] `query:"max_updated,omitzero" json:"-"`
	// Earliest date of CDN resource creation for which CDN resources should be
	// returned (ISO 8601/RFC 3339 format, UTC.)
	MinCreated param.Opt[string] `query:"min_created,omitzero" json:"-"`
	// Earliest date of CDN resource update for which CDN resources should be returned
	// (ISO 8601/RFC 3339 format, UTC.)
	MinUpdated param.Opt[string] `query:"min_updated,omitzero" json:"-"`
	// Name of the CDN resource. Matches partially and is case-insensitive.
	Name param.Opt[string] `query:"name,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Origin group ID.
	OriginGroup param.Opt[int64] `query:"originGroup,omitzero" json:"-"`
	// Origin group IDs. Values should be separated by a comma.
	//
	// Example:
	//
	// - ?`originGroup__in`=1,2,3
	OriginGroupIn param.Opt[string] `query:"originGroup__in,omitzero" json:"-"`
	// Rule name or pattern.
	Rules param.Opt[string] `query:"rules,omitzero" json:"-"`
	// Additional delivery domains (CNAMEs) of the CDN resource.
	SecondaryHostnames param.Opt[string] `query:"secondaryHostnames,omitzero" json:"-"`
	// Name of the origin shielding data center location.
	ShieldDc param.Opt[string] `query:"shield_dc,omitzero" json:"-"`
	// Defines whether origin shielding is enabled for the CDN resource.
	//
	// Possible values:
	//
	// - **true** - Origin shielding is enabled for the CDN resource.
	// - **false** - Origin shielding is disabled for the CDN resource.
	Shielded param.Opt[bool] `query:"shielded,omitzero" json:"-"`
	// SSL certificate ID.
	SslData param.Opt[int64] `query:"sslData,omitzero" json:"-"`
	// SSL certificates IDs.
	//
	// Example:
	//
	// - ?`sslData_in`=1643,1644,1652
	SslDataIn param.Opt[int64] `query:"sslData_in,omitzero" json:"-"`
	// Defines whether the HTTPS protocol is enabled for content delivery.
	//
	// Possible values:
	//
	// - **true** - HTTPS protocol is enabled for CDN resource.
	// - **false** - HTTPS protocol is disabled for CDN resource.
	SslEnabled param.Opt[bool] `query:"sslEnabled,omitzero" json:"-"`
	// Defines whether the CDN resource was automatically suspended by the system.
	//
	// Possible values:
	//
	//   - **true** - CDN resource is selected for automatic suspension in the next 7
	//     days.
	//   - **false** - CDN resource is not selected for automatic suspension.
	Suspend param.Opt[bool] `query:"suspend,omitzero" json:"-"`
	// Defines whether a CDN resource is currently suspended. This reflects the
	// resource's suspended state, unlike the `suspend` parameter, which selects
	// resources that have a scheduled automatic suspension date.
	//
	// Possible values:
	//
	// - **true** - CDN resource is currently suspended.
	// - **false** - CDN resource is not suspended.
	Suspended param.Opt[bool] `query:"suspended,omitzero" json:"-"`
	// Defines whether the CDN resource is integrated with the Streaming platform.
	//
	// Possible values:
	//
	// - **true** - CDN resource is used for Streaming platform.
	// - **false** - CDN resource is not used for Streaming platform.
	VpEnabled param.Opt[bool] `query:"vp_enabled,omitzero" json:"-"`
	// Filters CDN resources by whether they are linked to a WAAP domain. A CDN
	// resource stays linked when WAAP is turned off on it.
	//
	// Possible values:
	//
	// - **true** - CDN resource is not linked to a WAAP domain.
	// - **false** - CDN resource is linked to a WAAP domain.
	WaapDomainIDIsnull param.Opt[bool] `query:"waap_domain_id__isnull,omitzero" json:"-"`
	// Protocol used by CDN servers to request content from an origin source.
	//
	// Any of "HTTP", "HTTPS", "MATCH".
	OriginProtocol CDNResourceListParamsOriginProtocol `query:"originProtocol,omitzero" json:"-"`
	// CDN resource status.
	//
	// Any of "active", "processed", "suspended", "deleted".
	Status CDNResourceListParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CDNResourceListParams) URLQuery added in v0.31.0

func (r CDNResourceListParams) URLQuery() (v url.Values, err error)

URLQuery serializes CDNResourceListParams's query parameters as `url.Values`.

type CDNResourceListParamsOriginProtocol added in v0.51.0

type CDNResourceListParamsOriginProtocol string

Protocol used by CDN servers to request content from an origin source.

const (
	CDNResourceListParamsOriginProtocolHTTP  CDNResourceListParamsOriginProtocol = "HTTP"
	CDNResourceListParamsOriginProtocolHTTPS CDNResourceListParamsOriginProtocol = "HTTPS"
	CDNResourceListParamsOriginProtocolMatch CDNResourceListParamsOriginProtocol = "MATCH"
)

type CDNResourceListParamsStatus added in v0.31.0

type CDNResourceListParamsStatus string

CDN resource status.

const (
	CDNResourceListParamsStatusActive    CDNResourceListParamsStatus = "active"
	CDNResourceListParamsStatusProcessed CDNResourceListParamsStatus = "processed"
	CDNResourceListParamsStatusSuspended CDNResourceListParamsStatus = "suspended"
	CDNResourceListParamsStatusDeleted   CDNResourceListParamsStatus = "deleted"
)

type CDNResourceNewParams added in v0.31.0

type CDNResourceNewParams struct {
	// Delivery domains that will be used for content delivery through a CDN.
	//
	// Delivery domains should be added to your DNS settings.
	Cname string `json:"cname" api:"required"`
	// CDN resource name.
	Name param.Opt[string] `json:"name,omitzero"`
	// ID of the main CDN resource which has a shared caching zone with a reserve CDN
	// resource.
	//
	// If the parameter is not empty, then the current CDN resource is the reserve. You
	// cannot change some options, create rules, set up origin shielding, or use the
	// reserve CDN resource for Streaming.
	PrimaryResource param.Opt[int64] `json:"primary_resource,omitzero"`
	// ID of the trusted CA certificate used to verify an origin.
	//
	// It can be used only with `"proxy_ssl_enabled": true`.
	ProxySslCa param.Opt[int64] `json:"proxy_ssl_ca,omitzero"`
	// ID of the SSL certificate used to verify an origin.
	//
	// It can be used only with `"proxy_ssl_enabled": true`.
	ProxySslData param.Opt[int64] `json:"proxy_ssl_data,omitzero"`
	// ID of the SSL certificate linked to the CDN resource.
	//
	// Can be used only with `"sslEnabled": true`.
	SslData param.Opt[int64] `json:"sslData,omitzero"`
	// Enables or disables a CDN resource.
	//
	// Possible values:
	//
	// - **true** - CDN resource is active. Content is being delivered.
	// - **false** - CDN resource is deactivated. Content is not being delivered.
	Active param.Opt[bool] `json:"active,omitzero"`
	// Optional comment describing the CDN resource.
	Description param.Opt[string] `json:"description,omitzero"`
	// IP address or domain name of the origin and the port, if custom port is used.
	//
	// Exactly one of `origin` or `originGroup` must be provided during resource
	// creation.
	Origin param.Opt[string] `json:"origin,omitzero"`
	// Origin group ID with which the CDN resource is associated.
	//
	// Exactly one of `origin` or `originGroup` must be provided during resource
	// creation.
	OriginGroup param.Opt[int64] `json:"originGroup,omitzero"`
	// Enables or disables SSL certificate validation of the origin server before
	// completing any connection.
	//
	// Possible values:
	//
	// - **true** - Origin SSL certificate validation is enabled.
	// - **false** - Origin SSL certificate validation is disabled.
	ProxySslEnabled param.Opt[bool] `json:"proxy_ssl_enabled,omitzero"`
	// Defines whether the HTTPS protocol enabled for content delivery.
	//
	// Possible values:
	//
	// - **true** - HTTPS is enabled.
	// - **false** - HTTPS is disabled.
	SslEnabled param.Opt[bool] `json:"sslEnabled,omitzero"`
	// List of options that can be configured for the CDN resource.
	//
	// In case of `null` value the option is not added to the CDN resource. Option may
	// inherit its value from the global account settings.
	Options CDNResourceNewParamsOptions `json:"options,omitzero"`
	// Protocol used by CDN servers to request content from an origin source.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers will connect to the origin via HTTPS.
	//   - **HTTP** - CDN servers will connect to the origin via HTTP.
	//   - **MATCH** - connection protocol will be chosen automatically (content on the
	//     origin source should be available for the CDN both through HTTP and HTTPS).
	//
	// If protocol is not specified, HTTP is used to connect to an origin server.
	//
	// If an enabled origin in the resource's origin group is bound to a Gcore Object
	// Storage (`s3_type` is `gcore`), the CDN connects to every origin in that group
	// over HTTPS regardless of this setting.
	//
	// Any of "HTTP", "HTTPS", "MATCH".
	OriginProtocol CDNResourceNewParamsOriginProtocol `json:"originProtocol,omitzero"`
	// Additional delivery domains (CNAMEs) that will be used to deliver content via
	// the CDN.
	//
	// Up to ten additional CNAMEs are possible.
	SecondaryHostnames []string `json:"secondaryHostnames,omitzero" format:"domain"`
	// contains filtered or unexported fields
}

func (CDNResourceNewParams) MarshalJSON added in v0.31.0

func (r CDNResourceNewParams) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParams) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParams) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptions added in v0.31.0

type CDNResourceNewParamsOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods CDNResourceNewParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression CDNResourceNewParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings CDNResourceNewParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders CDNResourceNewParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors CDNResourceNewParamsOptionsCors `json:"cors,omitzero"`
	// Enables control access to content for specified countries.
	CountryACL CDNResourceNewParamsOptionsCountryACL `json:"country_acl,omitzero"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache CDNResourceNewParamsOptionsDisableCache `json:"disable_cache,omitzero"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges CDNResourceNewParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings CDNResourceNewParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge CDNResourceNewParamsOptionsFastedge `json:"fastedge,omitzero"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed CDNResourceNewParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect CDNResourceNewParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn CDNResourceNewParamsOptionsForceReturn `json:"force_return,omitzero"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader CDNResourceNewParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
	// Enables gRPC pass-through for the CDN resource.
	GrpcPassthrough CDNResourceNewParamsOptionsGrpcPassthrough `json:"grpc_passthrough,omitzero"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn CDNResourceNewParamsOptionsGzipOn `json:"gzipOn,omitzero"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader CDNResourceNewParamsOptionsHostHeader `json:"hostHeader,omitzero"`
	// Enables HTTP/3 protocol for content delivery.
	//
	// `http3_enabled` option works only with `"sslEnabled": true`.
	Http3Enabled CDNResourceNewParamsOptionsHttp3Enabled `json:"http3_enabled,omitzero"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie CDNResourceNewParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString CDNResourceNewParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack CDNResourceNewParamsOptionsImageStack `json:"image_stack,omitzero"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL CDNResourceNewParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
	// Allows to control the download speed per connection.
	LimitBandwidth CDNResourceNewParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
	// Enables Network Error Logging (NEL) for the resource.
	//
	// When enabled, the edge instructs browsers to collect and report network errors
	// (via the `Report-To` and `NEL` response headers), improving observability of
	// connectivity issues for the resource.
	NetworkErrorLogging CDNResourceNewParamsOptionsNetworkErrorLogging `json:"network_error_logging,omitzero"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey CDNResourceNewParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet CDNResourceNewParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout CDNResourceNewParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout CDNResourceNewParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist CDNResourceNewParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist CDNResourceNewParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding CDNResourceNewParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS CDNResourceNewParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP CDNResourceNewParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL CDNResourceNewParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy CDNResourceNewParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite CDNResourceNewParamsOptionsRewrite `json:"rewrite,omitzero"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey CDNResourceNewParamsOptionsSecureKey `json:"secure_key,omitzero"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice CDNResourceNewParamsOptionsSlice `json:"slice,omitzero"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni CDNResourceNewParamsOptionsSni `json:"sni,omitzero"`
	// Serves stale cached content in case of origin unavailability.
	Stale CDNResourceNewParamsOptionsStale `json:"stale,omitzero"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders CDNResourceNewParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders CDNResourceNewParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders CDNResourceNewParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
	// List of SSL/TLS protocol versions allowed for HTTPS connections from end users
	// to the domain.
	//
	// When the option is disabled, all protocols versions are allowed.
	//
	// While the `tls_ciphers` option is active on the resource, only the TLS versions
	// its cipher profile allows can be enabled, and this option cannot be deleted or
	// disabled.
	TlsVersions CDNResourceNewParamsOptionsTlsVersions `json:"tls_versions,omitzero"`
	// Let's Encrypt certificate chain.
	//
	// The specified chain will be used during the next Let's Encrypt certificate issue
	// or renewal.
	UseDefaultLeChain CDNResourceNewParamsOptionsUseDefaultLeChain `json:"use_default_le_chain,omitzero"`
	// DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
	//
	// DNS service should be activated to enable this option.
	UseDns01LeChallenge CDNResourceNewParamsOptionsUseDns01LeChallenge `json:"use_dns01_le_challenge,omitzero"`
	// RSA Let's Encrypt certificate type for the CDN resource.
	//
	// The specified value will be used during the next Let's Encrypt certificate issue
	// or renewal.
	UseRsaLeCert CDNResourceNewParamsOptionsUseRsaLeCert `json:"use_rsa_le_cert,omitzero"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL CDNResourceNewParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap CDNResourceNewParamsOptionsWaap `json:"waap,omitzero"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets CDNResourceNewParamsOptionsWebsockets `json:"websockets,omitzero"`
	// contains filtered or unexported fields
}

List of options that can be configured for the CDN resource.

In case of `null` value the option is not added to the CDN resource. Option may inherit its value from the global account settings.

func (CDNResourceNewParamsOptions) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptions) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptions) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsAllowedHTTPMethods added in v0.31.0

type CDNResourceNewParamsOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

HTTP methods allowed for content requests from the CDN.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsAllowedHTTPMethods) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsAllowedHTTPMethods) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsBrotliCompression added in v0.31.0

type CDNResourceNewParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsBrotliCompression) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsBrotliCompression) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsBrowserCacheSettings added in v0.31.0

type CDNResourceNewParamsOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsBrowserCacheSettings) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsBrowserCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsCacheHTTPHeaders deprecated added in v0.31.0

type CDNResourceNewParamsOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsCacheHTTPHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsCors added in v0.31.0

type CDNResourceNewParamsOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsCors) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsCors) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsCors) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsCors) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsCountryACL added in v0.31.0

type CDNResourceNewParamsOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Enables control access to content for specified countries.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceNewParamsOptionsCountryACL) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsCountryACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsCountryACL) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsDisableCache deprecated added in v0.31.0

type CDNResourceNewParamsOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsDisableCache) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsDisableCache) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsDisableCache) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsDisableProxyForceRanges added in v0.31.0

type CDNResourceNewParamsOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows 206 responses regardless of the settings of an origin source.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsDisableProxyForceRanges) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsDisableProxyForceRanges) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsEdgeCacheSettings added in v0.31.0

type CDNResourceNewParamsOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

The property Enabled is required.

func (CDNResourceNewParamsOptionsEdgeCacheSettings) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsEdgeCacheSettings) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsFastedge added in v0.31.0

type CDNResourceNewParamsOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody CDNResourceNewParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders CDNResourceNewParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache CDNResourceNewParamsOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody CDNResourceNewParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders CDNResourceNewParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

The property Enabled is required.

func (CDNResourceNewParamsOptionsFastedge) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsFastedge) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsFastedge) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsFastedge) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsFastedgeOnRequestBody added in v0.31.0

type CDNResourceNewParamsOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

The property AppID is required.

func (CDNResourceNewParamsOptionsFastedgeOnRequestBody) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsFastedgeOnRequestBody) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsFastedgeOnRequestHeaders added in v0.31.0

type CDNResourceNewParamsOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

The property AppID is required.

func (CDNResourceNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type CDNResourceNewParamsOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

The property AppID is required.

func (CDNResourceNewParamsOptionsFastedgeOnRequestHeadersAfterCache) MarshalJSON added in v0.50.0

func (*CDNResourceNewParamsOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type CDNResourceNewParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceNewParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceNewParamsOptionsFastedgeOnResponseBody) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsFastedgeOnResponseBody) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsFastedgeOnResponseHeaders added in v0.31.0

type CDNResourceNewParamsOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceNewParamsOptionsFastedgeOnResponseHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsFastedgeOnResponseHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsFetchCompressed added in v0.31.0

type CDNResourceNewParamsOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsFetchCompressed) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsFetchCompressed) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsFollowOriginRedirect added in v0.31.0

type CDNResourceNewParamsOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

The properties Codes, Enabled are required.

func (CDNResourceNewParamsOptionsFollowOriginRedirect) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsFollowOriginRedirect) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsForceReturn added in v0.31.0

type CDNResourceNewParamsOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval CDNResourceNewParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
	// contains filtered or unexported fields
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

The properties Body, Code, Enabled are required.

func (CDNResourceNewParamsOptionsForceReturn) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsForceReturn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsForceReturn) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsForceReturnTimeInterval added in v0.31.0

type CDNResourceNewParamsOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
	// contains filtered or unexported fields
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

The properties EndTime, StartTime are required.

func (CDNResourceNewParamsOptionsForceReturnTimeInterval) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsForceReturnTimeInterval) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsForwardHostHeader added in v0.31.0

type CDNResourceNewParamsOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsForwardHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsForwardHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsGrpcPassthrough added in v0.34.0

type CDNResourceNewParamsOptionsGrpcPassthrough struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables gRPC pass-through for the CDN resource.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsGrpcPassthrough) MarshalJSON added in v0.34.0

func (r CDNResourceNewParamsOptionsGrpcPassthrough) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsGrpcPassthrough) UnmarshalJSON added in v0.34.0

func (r *CDNResourceNewParamsOptionsGrpcPassthrough) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsGzipOn added in v0.31.0

type CDNResourceNewParamsOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsGzipOn) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsGzipOn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsGzipOn) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsHostHeader added in v0.31.0

type CDNResourceNewParamsOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsHttp3Enabled added in v0.31.0

type CDNResourceNewParamsOptionsHttp3Enabled struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables HTTP/3 protocol for content delivery.

`http3_enabled` option works only with `"sslEnabled": true`.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsHttp3Enabled) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsHttp3Enabled) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsHttp3Enabled) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsHttp3Enabled) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsIPAddressACL added in v0.31.0

type CDNResourceNewParamsOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceNewParamsOptionsIPAddressACL) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsIPAddressACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsIgnoreCookie added in v0.31.0

type CDNResourceNewParamsOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsIgnoreCookie) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsIgnoreCookie) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsIgnoreQueryString added in v0.31.0

type CDNResourceNewParamsOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsIgnoreQueryString) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsIgnoreQueryString) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsImageStack added in v0.31.0

type CDNResourceNewParamsOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality param.Opt[int64] `json:"quality,omitzero"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
	// contains filtered or unexported fields
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

The property Enabled is required.

func (CDNResourceNewParamsOptionsImageStack) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsImageStack) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsImageStack) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsImageStack) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsLimitBandwidth added in v0.31.0

type CDNResourceNewParamsOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type,omitzero" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer param.Opt[int64] `json:"buffer,omitzero"`
	// Maximum download speed per connection.
	Speed param.Opt[int64] `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

Allows to control the download speed per connection.

The properties Enabled, LimitType are required.

func (CDNResourceNewParamsOptionsLimitBandwidth) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsLimitBandwidth) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsNetworkErrorLogging added in v0.50.0

type CDNResourceNewParamsOptionsNetworkErrorLogging struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables Network Error Logging (NEL) for the resource.

When enabled, the edge instructs browsers to collect and report network errors (via the `Report-To` and `NEL` response headers), improving observability of connectivity issues for the resource.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsNetworkErrorLogging) MarshalJSON added in v0.50.0

func (r CDNResourceNewParamsOptionsNetworkErrorLogging) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsNetworkErrorLogging) UnmarshalJSON added in v0.50.0

type CDNResourceNewParamsOptionsProxyCacheKey added in v0.31.0

type CDNResourceNewParamsOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsProxyCacheKey) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsProxyCacheKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsProxyCacheMethodsSet added in v0.31.0

type CDNResourceNewParamsOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Caching for POST requests along with default GET and HEAD.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsProxyCacheMethodsSet) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsProxyCacheMethodsSet) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsProxyConnectTimeout added in v0.31.0

type CDNResourceNewParamsOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for establishing a connection with the origin.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsProxyConnectTimeout) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsProxyConnectTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsProxyReadTimeout added in v0.31.0

type CDNResourceNewParamsOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsProxyReadTimeout) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsProxyReadTimeout) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsQueryParamsBlacklist added in v0.31.0

type CDNResourceNewParamsOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsQueryParamsBlacklist) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsQueryParamsBlacklist) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsQueryParamsWhitelist added in v0.31.0

type CDNResourceNewParamsOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsQueryParamsWhitelist) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsQueryParamsWhitelist) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsQueryStringForwarding added in v0.31.0

type CDNResourceNewParamsOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types,omitzero" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
	// contains filtered or unexported fields
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.

func (CDNResourceNewParamsOptionsQueryStringForwarding) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsQueryStringForwarding) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsRedirectHTTPSToHTTP added in v0.31.0

type CDNResourceNewParamsOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsRedirectHTTPToHTTPS added in v0.31.0

type CDNResourceNewParamsOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsReferrerACL added in v0.31.0

type CDNResourceNewParamsOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specified domain names.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceNewParamsOptionsReferrerACL) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsReferrerACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsResponseHeadersHidingPolicy added in v0.31.0

type CDNResourceNewParamsOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted,omitzero" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Hides HTTP headers from an origin server in the CDN response.

The properties Enabled, Excepted, Mode are required.

func (CDNResourceNewParamsOptionsResponseHeadersHidingPolicy) MarshalJSON added in v0.31.0

func (*CDNResourceNewParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsRewrite added in v0.31.0

type CDNResourceNewParamsOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag,omitzero"`
	// contains filtered or unexported fields
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

The properties Body, Enabled are required.

func (CDNResourceNewParamsOptionsRewrite) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsRewrite) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsRewrite) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsRewrite) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsSecureKey added in v0.31.0

type CDNResourceNewParamsOptionsSecureKey struct {
	// Key generated on your side that will be used for URL signing.
	Key param.Opt[string] `json:"key,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

The properties Enabled, Key are required.

func (CDNResourceNewParamsOptionsSecureKey) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsSecureKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsSecureKey) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsSlice added in v0.31.0

type CDNResourceNewParamsOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsSlice) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsSlice) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsSlice) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsSlice) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsSni added in v0.31.0

type CDNResourceNewParamsOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type,omitzero"`
	// contains filtered or unexported fields
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

The properties CustomHostname, Enabled are required.

func (CDNResourceNewParamsOptionsSni) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsSni) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsSni) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsSni) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsStale added in v0.31.0

type CDNResourceNewParamsOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Serves stale cached content in case of origin unavailability.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsStale) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsStale) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsStale) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsStale) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsStaticHeaders deprecated added in v0.31.0

type CDNResourceNewParamsOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsStaticHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsStaticHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsStaticRequestHeaders added in v0.31.0

type CDNResourceNewParamsOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsStaticRequestHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsStaticRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsStaticResponseHeaders added in v0.31.0

type CDNResourceNewParamsOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                                    `json:"enabled" api:"required"`
	Value   []CDNResourceNewParamsOptionsStaticResponseHeadersValue `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers that a CDN server adds to a response.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsStaticResponseHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsStaticResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsStaticResponseHeadersValue added in v0.31.0

type CDNResourceNewParamsOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (CDNResourceNewParamsOptionsStaticResponseHeadersValue) MarshalJSON added in v0.31.0

func (*CDNResourceNewParamsOptionsStaticResponseHeadersValue) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsTlsCiphers added in v0.57.0

type CDNResourceNewParamsOptionsTlsCiphers struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Cipher suite policy for HTTPS connections from end users to the domain, selected from predefined profiles.

The exact cipher suites the policy enforces are returned in the `ciphers` field, and each profile defines which TLS versions may be enabled together with it. While the option is active:

- The `tls_versions` option can include only the versions the profile allows. - The `tls_versions` option cannot be deleted or disabled.

The option is read-only. Contact support to change it.

When the option is absent or disabled, the default cipher suites of the CDN are used.

The properties Enabled, Mode are required.

func (CDNResourceNewParamsOptionsTlsCiphers) MarshalJSON added in v0.57.0

func (r CDNResourceNewParamsOptionsTlsCiphers) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsTlsCiphers) UnmarshalJSON added in v0.57.0

func (r *CDNResourceNewParamsOptionsTlsCiphers) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsTlsVersions added in v0.31.0

type CDNResourceNewParamsOptionsTlsVersions struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of SSL/TLS protocol versions (case sensitive).
	//
	// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

List of SSL/TLS protocol versions allowed for HTTPS connections from end users to the domain.

When the option is disabled, all protocols versions are allowed.

While the `tls_ciphers` option is active on the resource, only the TLS versions its cipher profile allows can be enabled, and this option cannot be deleted or disabled.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsTlsVersions) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsTlsVersions) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsTlsVersions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsTlsVersions) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsUseDefaultLeChain added in v0.31.0

type CDNResourceNewParamsOptionsUseDefaultLeChain struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Default Let's Encrypt certificate chain. This is a deprecated
	//     version, use it only for compatibilities with Android devices 7.1.1 or lower.
	//   - **false** - Alternative Let's Encrypt certificate chain.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Let's Encrypt certificate chain.

The specified chain will be used during the next Let's Encrypt certificate issue or renewal.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsUseDefaultLeChain) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsUseDefaultLeChain) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsUseDefaultLeChain) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsUseDefaultLeChain) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsUseDns01LeChallenge added in v0.31.0

type CDNResourceNewParamsOptionsUseDns01LeChallenge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - DNS-01 challenge is used to issue Let's Encrypt certificate.
	// - **false** - HTTP-01 challenge is used to issue Let's Encrypt certificate.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

DNS-01 challenge to issue a Let's Encrypt certificate for the resource.

DNS service should be activated to enable this option.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsUseDns01LeChallenge) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsUseDns01LeChallenge) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsUseDns01LeChallenge) UnmarshalJSON added in v0.31.0

type CDNResourceNewParamsOptionsUseRsaLeCert added in v0.31.0

type CDNResourceNewParamsOptionsUseRsaLeCert struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - RSA Let's Encrypt certificate.
	// - **false** - ECDSA Let's Encrypt certificate.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

RSA Let's Encrypt certificate type for the CDN resource.

The specified value will be used during the next Let's Encrypt certificate issue or renewal.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsUseRsaLeCert) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsUseRsaLeCert) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsUseRsaLeCert) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsUseRsaLeCert) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsUserAgentACL added in v0.31.0

type CDNResourceNewParamsOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the content for specified User-Agents.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceNewParamsOptionsUserAgentACL) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsUserAgentACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsWaap added in v0.31.0

type CDNResourceNewParamsOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows to enable WAAP (Web Application and API Protection).

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsWaap) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsWaap) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsWaap) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsWaap) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOptionsWebsockets added in v0.31.0

type CDNResourceNewParamsOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables or disables WebSockets connections to an origin server.

The properties Enabled, Value are required.

func (CDNResourceNewParamsOptionsWebsockets) MarshalJSON added in v0.31.0

func (r CDNResourceNewParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)

func (*CDNResourceNewParamsOptionsWebsockets) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsWebsockets) UnmarshalJSON(data []byte) error

type CDNResourceNewParamsOriginProtocol added in v0.31.0

type CDNResourceNewParamsOriginProtocol string

Protocol used by CDN servers to request content from an origin source.

Possible values:

  • **HTTPS** - CDN servers will connect to the origin via HTTPS.
  • **HTTP** - CDN servers will connect to the origin via HTTP.
  • **MATCH** - connection protocol will be chosen automatically (content on the origin source should be available for the CDN both through HTTP and HTTPS).

If protocol is not specified, HTTP is used to connect to an origin server.

If an enabled origin in the resource's origin group is bound to a Gcore Object Storage (`s3_type` is `gcore`), the CDN connects to every origin in that group over HTTPS regardless of this setting.

const (
	CDNResourceNewParamsOriginProtocolHTTP  CDNResourceNewParamsOriginProtocol = "HTTP"
	CDNResourceNewParamsOriginProtocolHTTPS CDNResourceNewParamsOriginProtocol = "HTTPS"
	CDNResourceNewParamsOriginProtocolMatch CDNResourceNewParamsOriginProtocol = "MATCH"
)

type CDNResourceOptions added in v0.31.0

type CDNResourceOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods CDNResourceOptionsAllowedHTTPMethods `json:"allowedHttpMethods" api:"nullable"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression CDNResourceOptionsBrotliCompression `json:"brotli_compression" api:"nullable"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings CDNResourceOptionsBrowserCacheSettings `json:"browser_cache_settings" api:"nullable"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders CDNResourceOptionsCacheHTTPHeaders `json:"cache_http_headers" api:"nullable"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors CDNResourceOptionsCors `json:"cors" api:"nullable"`
	// Enables control access to content for specified countries.
	CountryACL CDNResourceOptionsCountryACL `json:"country_acl" api:"nullable"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache CDNResourceOptionsDisableCache `json:"disable_cache" api:"nullable"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges CDNResourceOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges" api:"nullable"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings CDNResourceOptionsEdgeCacheSettings `json:"edge_cache_settings" api:"nullable"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge CDNResourceOptionsFastedge `json:"fastedge" api:"nullable"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed CDNResourceOptionsFetchCompressed `json:"fetch_compressed" api:"nullable"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect CDNResourceOptionsFollowOriginRedirect `json:"follow_origin_redirect" api:"nullable"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn CDNResourceOptionsForceReturn `json:"force_return" api:"nullable"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader CDNResourceOptionsForwardHostHeader `json:"forward_host_header" api:"nullable"`
	// Enables gRPC pass-through for the CDN resource.
	GrpcPassthrough CDNResourceOptionsGrpcPassthrough `json:"grpc_passthrough" api:"nullable"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn CDNResourceOptionsGzipOn `json:"gzipOn" api:"nullable"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader CDNResourceOptionsHostHeader `json:"hostHeader" api:"nullable"`
	// Enables HTTP/3 protocol for content delivery.
	//
	// `http3_enabled` option works only with `"sslEnabled": true`.
	Http3Enabled CDNResourceOptionsHttp3Enabled `json:"http3_enabled" api:"nullable"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie CDNResourceOptionsIgnoreCookie `json:"ignore_cookie" api:"nullable"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString CDNResourceOptionsIgnoreQueryString `json:"ignoreQueryString" api:"nullable"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack CDNResourceOptionsImageStack `json:"image_stack" api:"nullable"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL CDNResourceOptionsIPAddressACL `json:"ip_address_acl" api:"nullable"`
	// Allows to control the download speed per connection.
	LimitBandwidth CDNResourceOptionsLimitBandwidth `json:"limit_bandwidth" api:"nullable"`
	// Enables Network Error Logging (NEL) for the resource.
	//
	// When enabled, the edge instructs browsers to collect and report network errors
	// (via the `Report-To` and `NEL` response headers), improving observability of
	// connectivity issues for the resource.
	NetworkErrorLogging CDNResourceOptionsNetworkErrorLogging `json:"network_error_logging" api:"nullable"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey CDNResourceOptionsProxyCacheKey `json:"proxy_cache_key" api:"nullable"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet CDNResourceOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set" api:"nullable"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout CDNResourceOptionsProxyConnectTimeout `json:"proxy_connect_timeout" api:"nullable"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout CDNResourceOptionsProxyReadTimeout `json:"proxy_read_timeout" api:"nullable"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist CDNResourceOptionsQueryParamsBlacklist `json:"query_params_blacklist" api:"nullable"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist CDNResourceOptionsQueryParamsWhitelist `json:"query_params_whitelist" api:"nullable"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding CDNResourceOptionsQueryStringForwarding `json:"query_string_forwarding" api:"nullable"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS CDNResourceOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https" api:"nullable"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP CDNResourceOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http" api:"nullable"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL CDNResourceOptionsReferrerACL `json:"referrer_acl" api:"nullable"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy CDNResourceOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy" api:"nullable"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite CDNResourceOptionsRewrite `json:"rewrite" api:"nullable"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey CDNResourceOptionsSecureKey `json:"secure_key" api:"nullable"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice CDNResourceOptionsSlice `json:"slice" api:"nullable"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni CDNResourceOptionsSni `json:"sni" api:"nullable"`
	// Serves stale cached content in case of origin unavailability.
	Stale CDNResourceOptionsStale `json:"stale" api:"nullable"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders CDNResourceOptionsStaticResponseHeaders `json:"static_response_headers" api:"nullable"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders CDNResourceOptionsStaticHeaders `json:"staticHeaders" api:"nullable"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders CDNResourceOptionsStaticRequestHeaders `json:"staticRequestHeaders" api:"nullable"`
	// Cipher suite policy for HTTPS connections from end users to the domain, selected
	// from predefined profiles.
	//
	// The exact cipher suites the policy enforces are returned in the `ciphers` field,
	// and each profile defines which TLS versions may be enabled together with it.
	// While the option is active:
	//
	// - The `tls_versions` option can include only the versions the profile allows.
	// - The `tls_versions` option cannot be deleted or disabled.
	//
	// The option is read-only. Contact support to change it.
	//
	// When the option is absent or disabled, the default cipher suites of the CDN are
	// used.
	TlsCiphers CDNResourceOptionsTlsCiphers `json:"tls_ciphers" api:"nullable"`
	// List of SSL/TLS protocol versions allowed for HTTPS connections from end users
	// to the domain.
	//
	// When the option is disabled, all protocols versions are allowed.
	//
	// While the `tls_ciphers` option is active on the resource, only the TLS versions
	// its cipher profile allows can be enabled, and this option cannot be deleted or
	// disabled.
	TlsVersions CDNResourceOptionsTlsVersions `json:"tls_versions" api:"nullable"`
	// Let's Encrypt certificate chain.
	//
	// The specified chain will be used during the next Let's Encrypt certificate issue
	// or renewal.
	UseDefaultLeChain CDNResourceOptionsUseDefaultLeChain `json:"use_default_le_chain" api:"nullable"`
	// DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
	//
	// DNS service should be activated to enable this option.
	UseDns01LeChallenge CDNResourceOptionsUseDns01LeChallenge `json:"use_dns01_le_challenge" api:"nullable"`
	// RSA Let's Encrypt certificate type for the CDN resource.
	//
	// The specified value will be used during the next Let's Encrypt certificate issue
	// or renewal.
	UseRsaLeCert CDNResourceOptionsUseRsaLeCert `json:"use_rsa_le_cert" api:"nullable"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL CDNResourceOptionsUserAgentACL `json:"user_agent_acl" api:"nullable"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap CDNResourceOptionsWaap `json:"waap" api:"nullable"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets CDNResourceOptionsWebsockets `json:"websockets" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowedHTTPMethods          respjson.Field
		BrotliCompression           respjson.Field
		BrowserCacheSettings        respjson.Field
		CacheHTTPHeaders            respjson.Field
		Cors                        respjson.Field
		CountryACL                  respjson.Field
		DisableCache                respjson.Field
		DisableProxyForceRanges     respjson.Field
		EdgeCacheSettings           respjson.Field
		Fastedge                    respjson.Field
		FetchCompressed             respjson.Field
		FollowOriginRedirect        respjson.Field
		ForceReturn                 respjson.Field
		ForwardHostHeader           respjson.Field
		GrpcPassthrough             respjson.Field
		GzipOn                      respjson.Field
		HostHeader                  respjson.Field
		Http3Enabled                respjson.Field
		IgnoreCookie                respjson.Field
		IgnoreQueryString           respjson.Field
		ImageStack                  respjson.Field
		IPAddressACL                respjson.Field
		LimitBandwidth              respjson.Field
		NetworkErrorLogging         respjson.Field
		ProxyCacheKey               respjson.Field
		ProxyCacheMethodsSet        respjson.Field
		ProxyConnectTimeout         respjson.Field
		ProxyReadTimeout            respjson.Field
		QueryParamsBlacklist        respjson.Field
		QueryParamsWhitelist        respjson.Field
		QueryStringForwarding       respjson.Field
		RedirectHTTPToHTTPS         respjson.Field
		RedirectHTTPSToHTTP         respjson.Field
		ReferrerACL                 respjson.Field
		ResponseHeadersHidingPolicy respjson.Field
		Rewrite                     respjson.Field
		SecureKey                   respjson.Field
		Slice                       respjson.Field
		Sni                         respjson.Field
		Stale                       respjson.Field
		StaticResponseHeaders       respjson.Field
		StaticHeaders               respjson.Field
		StaticRequestHeaders        respjson.Field
		TlsCiphers                  respjson.Field
		TlsVersions                 respjson.Field
		UseDefaultLeChain           respjson.Field
		UseDns01LeChallenge         respjson.Field
		UseRsaLeCert                respjson.Field
		UserAgentACL                respjson.Field
		Waap                        respjson.Field
		Websockets                  respjson.Field
		ExtraFields                 map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of options that can be configured for the CDN resource.

In case of `null` value the option is not added to the CDN resource. Option may inherit its value from the global account settings.

func (CDNResourceOptions) RawJSON added in v0.31.0

func (r CDNResourceOptions) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceOptions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptions) UnmarshalJSON(data []byte) error

type CDNResourceOptionsAllowedHTTPMethods added in v0.31.0

type CDNResourceOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

HTTP methods allowed for content requests from the CDN.

func (CDNResourceOptionsAllowedHTTPMethods) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsAllowedHTTPMethods) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error

type CDNResourceOptionsBrotliCompression added in v0.31.0

type CDNResourceOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

func (CDNResourceOptionsBrotliCompression) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsBrotliCompression) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsBrotliCompression) UnmarshalJSON(data []byte) error

type CDNResourceOptionsBrowserCacheSettings added in v0.31.0

type CDNResourceOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

func (CDNResourceOptionsBrowserCacheSettings) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsBrowserCacheSettings) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error

type CDNResourceOptionsCacheHTTPHeaders deprecated added in v0.31.0

type CDNResourceOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

func (CDNResourceOptionsCacheHTTPHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsCacheHTTPHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error

type CDNResourceOptionsCors added in v0.31.0

type CDNResourceOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always bool `json:"always"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		Always      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

func (CDNResourceOptionsCors) RawJSON added in v0.31.0

func (r CDNResourceOptionsCors) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsCors) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsCors) UnmarshalJSON(data []byte) error

type CDNResourceOptionsCountryACL added in v0.31.0

type CDNResourceOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables control access to content for specified countries.

func (CDNResourceOptionsCountryACL) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsCountryACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsCountryACL) UnmarshalJSON(data []byte) error

type CDNResourceOptionsDisableCache deprecated added in v0.31.0

type CDNResourceOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

func (CDNResourceOptionsDisableCache) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsDisableCache) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsDisableCache) UnmarshalJSON(data []byte) error

type CDNResourceOptionsDisableProxyForceRanges added in v0.31.0

type CDNResourceOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows 206 responses regardless of the settings of an origin source.

func (CDNResourceOptionsDisableProxyForceRanges) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsDisableProxyForceRanges) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error

type CDNResourceOptionsEdgeCacheSettings added in v0.31.0

type CDNResourceOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values" format:"nginx time"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default string `json:"default" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" format:"nginx time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled      respjson.Field
		CustomValues respjson.Field
		Default      respjson.Field
		Value        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

func (CDNResourceOptionsEdgeCacheSettings) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsEdgeCacheSettings) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error

type CDNResourceOptionsFastedge added in v0.31.0

type CDNResourceOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody CDNResourceOptionsFastedgeOnRequestBody `json:"on_request_body"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders CDNResourceOptionsFastedgeOnRequestHeaders `json:"on_request_headers"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache CDNResourceOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody CDNResourceOptionsFastedgeOnResponseBody `json:"on_response_body"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders CDNResourceOptionsFastedgeOnResponseHeaders `json:"on_response_headers"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled                    respjson.Field
		OnRequestBody              respjson.Field
		OnRequestHeaders           respjson.Field
		OnRequestHeadersAfterCache respjson.Field
		OnResponseBody             respjson.Field
		OnResponseHeaders          respjson.Field
		ExtraFields                map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

func (CDNResourceOptionsFastedge) RawJSON added in v0.31.0

func (r CDNResourceOptionsFastedge) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsFastedge) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsFastedge) UnmarshalJSON(data []byte) error

type CDNResourceOptionsFastedgeOnRequestBody added in v0.31.0

type CDNResourceOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

func (CDNResourceOptionsFastedgeOnRequestBody) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsFastedgeOnRequestBody) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error

type CDNResourceOptionsFastedgeOnRequestHeaders added in v0.31.0

type CDNResourceOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

func (CDNResourceOptionsFastedgeOnRequestHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error

type CDNResourceOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type CDNResourceOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

func (CDNResourceOptionsFastedgeOnRequestHeadersAfterCache) RawJSON added in v0.50.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type CDNResourceOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

func (CDNResourceOptionsFastedgeOnResponseBody) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsFastedgeOnResponseBody) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error

type CDNResourceOptionsFastedgeOnResponseHeaders added in v0.31.0

type CDNResourceOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

func (CDNResourceOptionsFastedgeOnResponseHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsFastedgeOnResponseHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error

type CDNResourceOptionsFetchCompressed added in v0.31.0

type CDNResourceOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

func (CDNResourceOptionsFetchCompressed) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsFetchCompressed) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsFetchCompressed) UnmarshalJSON(data []byte) error

type CDNResourceOptionsFollowOriginRedirect added in v0.31.0

type CDNResourceOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Codes       respjson.Field
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

func (CDNResourceOptionsFollowOriginRedirect) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsFollowOriginRedirect) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error

type CDNResourceOptionsForceReturn added in v0.31.0

type CDNResourceOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval CDNResourceOptionsForceReturnTimeInterval `json:"time_interval" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Body         respjson.Field
		Code         respjson.Field
		Enabled      respjson.Field
		TimeInterval respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

func (CDNResourceOptionsForceReturn) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsForceReturn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsForceReturn) UnmarshalJSON(data []byte) error

type CDNResourceOptionsForceReturnTimeInterval added in v0.31.0

type CDNResourceOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone string `json:"time_zone" format:"timezone"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EndTime     respjson.Field
		StartTime   respjson.Field
		TimeZone    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

func (CDNResourceOptionsForceReturnTimeInterval) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsForceReturnTimeInterval) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error

type CDNResourceOptionsForwardHostHeader added in v0.31.0

type CDNResourceOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

func (CDNResourceOptionsForwardHostHeader) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsForwardHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsForwardHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceOptionsGrpcPassthrough added in v0.34.0

type CDNResourceOptionsGrpcPassthrough struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables gRPC pass-through for the CDN resource.

func (CDNResourceOptionsGrpcPassthrough) RawJSON added in v0.34.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsGrpcPassthrough) UnmarshalJSON added in v0.34.0

func (r *CDNResourceOptionsGrpcPassthrough) UnmarshalJSON(data []byte) error

type CDNResourceOptionsGzipOn added in v0.31.0

type CDNResourceOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

func (CDNResourceOptionsGzipOn) RawJSON added in v0.31.0

func (r CDNResourceOptionsGzipOn) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsGzipOn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsGzipOn) UnmarshalJSON(data []byte) error

type CDNResourceOptionsHostHeader added in v0.31.0

type CDNResourceOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

func (CDNResourceOptionsHostHeader) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceOptionsHttp3Enabled added in v0.31.0

type CDNResourceOptionsHttp3Enabled struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables HTTP/3 protocol for content delivery.

`http3_enabled` option works only with `"sslEnabled": true`.

func (CDNResourceOptionsHttp3Enabled) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsHttp3Enabled) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsHttp3Enabled) UnmarshalJSON(data []byte) error

type CDNResourceOptionsIPAddressACL added in v0.31.0

type CDNResourceOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

func (CDNResourceOptionsIPAddressACL) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsIPAddressACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsIPAddressACL) UnmarshalJSON(data []byte) error

type CDNResourceOptionsIgnoreCookie added in v0.31.0

type CDNResourceOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

func (CDNResourceOptionsIgnoreCookie) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsIgnoreCookie) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsIgnoreCookie) UnmarshalJSON(data []byte) error

type CDNResourceOptionsIgnoreQueryString added in v0.31.0

type CDNResourceOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

func (CDNResourceOptionsIgnoreQueryString) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsIgnoreQueryString) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error

type CDNResourceOptionsImageStack added in v0.31.0

type CDNResourceOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled bool `json:"avif_enabled"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless bool `json:"png_lossless"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality int64 `json:"quality"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled bool `json:"webp_enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		AvifEnabled respjson.Field
		PngLossless respjson.Field
		Quality     respjson.Field
		WebpEnabled respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

func (CDNResourceOptionsImageStack) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsImageStack) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsImageStack) UnmarshalJSON(data []byte) error

type CDNResourceOptionsLimitBandwidth added in v0.31.0

type CDNResourceOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer int64 `json:"buffer"`
	// Maximum download speed per connection.
	Speed int64 `json:"speed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		LimitType   respjson.Field
		Buffer      respjson.Field
		Speed       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to control the download speed per connection.

func (CDNResourceOptionsLimitBandwidth) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsLimitBandwidth) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsLimitBandwidth) UnmarshalJSON(data []byte) error

type CDNResourceOptionsNetworkErrorLogging added in v0.50.0

type CDNResourceOptionsNetworkErrorLogging struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables Network Error Logging (NEL) for the resource.

When enabled, the edge instructs browsers to collect and report network errors (via the `Report-To` and `NEL` response headers), improving observability of connectivity issues for the resource.

func (CDNResourceOptionsNetworkErrorLogging) RawJSON added in v0.50.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsNetworkErrorLogging) UnmarshalJSON added in v0.50.0

func (r *CDNResourceOptionsNetworkErrorLogging) UnmarshalJSON(data []byte) error

type CDNResourceOptionsProxyCacheKey added in v0.31.0

type CDNResourceOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

func (CDNResourceOptionsProxyCacheKey) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsProxyCacheKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsProxyCacheKey) UnmarshalJSON(data []byte) error

type CDNResourceOptionsProxyCacheMethodsSet added in v0.31.0

type CDNResourceOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Caching for POST requests along with default GET and HEAD.

func (CDNResourceOptionsProxyCacheMethodsSet) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsProxyCacheMethodsSet) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error

type CDNResourceOptionsProxyConnectTimeout added in v0.31.0

type CDNResourceOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The time limit for establishing a connection with the origin.

func (CDNResourceOptionsProxyConnectTimeout) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsProxyConnectTimeout) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error

type CDNResourceOptionsProxyReadTimeout added in v0.31.0

type CDNResourceOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

func (CDNResourceOptionsProxyReadTimeout) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsProxyReadTimeout) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error

type CDNResourceOptionsQueryParamsBlacklist added in v0.31.0

type CDNResourceOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

func (CDNResourceOptionsQueryParamsBlacklist) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsQueryParamsBlacklist) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error

type CDNResourceOptionsQueryParamsWhitelist added in v0.31.0

type CDNResourceOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

func (CDNResourceOptionsQueryParamsWhitelist) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsQueryParamsWhitelist) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error

type CDNResourceOptionsQueryStringForwarding added in v0.31.0

type CDNResourceOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled              respjson.Field
		ForwardFromFileTypes respjson.Field
		ForwardToFileTypes   respjson.Field
		ForwardExceptKeys    respjson.Field
		ForwardOnlyKeys      respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

func (CDNResourceOptionsQueryStringForwarding) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsQueryStringForwarding) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error

type CDNResourceOptionsRedirectHTTPSToHTTP added in v0.31.0

type CDNResourceOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

func (CDNResourceOptionsRedirectHTTPSToHTTP) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsRedirectHTTPSToHTTP) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error

type CDNResourceOptionsRedirectHTTPToHTTPS added in v0.31.0

type CDNResourceOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

func (CDNResourceOptionsRedirectHTTPToHTTPS) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsRedirectHTTPToHTTPS) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error

type CDNResourceOptionsReferrerACL added in v0.31.0

type CDNResourceOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls access to the CDN resource content for specified domain names.

func (CDNResourceOptionsReferrerACL) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsReferrerACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsReferrerACL) UnmarshalJSON(data []byte) error

type CDNResourceOptionsResponseHeadersHidingPolicy added in v0.31.0

type CDNResourceOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Excepted    respjson.Field
		Mode        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Hides HTTP headers from an origin server in the CDN response.

func (CDNResourceOptionsResponseHeadersHidingPolicy) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsResponseHeadersHidingPolicy) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error

type CDNResourceOptionsRewrite added in v0.31.0

type CDNResourceOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Body        respjson.Field
		Enabled     respjson.Field
		Flag        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

func (CDNResourceOptionsRewrite) RawJSON added in v0.31.0

func (r CDNResourceOptionsRewrite) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsRewrite) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsRewrite) UnmarshalJSON(data []byte) error

type CDNResourceOptionsSecureKey added in v0.31.0

type CDNResourceOptionsSecureKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key generated on your side that will be used for URL signing.
	Key string `json:"key" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Key         respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

func (CDNResourceOptionsSecureKey) RawJSON added in v0.31.0

func (r CDNResourceOptionsSecureKey) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsSecureKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsSecureKey) UnmarshalJSON(data []byte) error

type CDNResourceOptionsSlice added in v0.31.0

type CDNResourceOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

func (CDNResourceOptionsSlice) RawJSON added in v0.31.0

func (r CDNResourceOptionsSlice) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsSlice) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsSlice) UnmarshalJSON(data []byte) error

type CDNResourceOptionsSni added in v0.31.0

type CDNResourceOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomHostname respjson.Field
		Enabled        respjson.Field
		SniType        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

func (CDNResourceOptionsSni) RawJSON added in v0.31.0

func (r CDNResourceOptionsSni) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsSni) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsSni) UnmarshalJSON(data []byte) error

type CDNResourceOptionsStale added in v0.31.0

type CDNResourceOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Serves stale cached content in case of origin unavailability.

func (CDNResourceOptionsStale) RawJSON added in v0.31.0

func (r CDNResourceOptionsStale) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsStale) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsStale) UnmarshalJSON(data []byte) error

type CDNResourceOptionsStaticHeaders deprecated added in v0.31.0

type CDNResourceOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

func (CDNResourceOptionsStaticHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsStaticHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsStaticHeaders) UnmarshalJSON(data []byte) error

type CDNResourceOptionsStaticRequestHeaders added in v0.31.0

type CDNResourceOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

func (CDNResourceOptionsStaticRequestHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsStaticRequestHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error

type CDNResourceOptionsStaticResponseHeaders added in v0.31.0

type CDNResourceOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                           `json:"enabled" api:"required"`
	Value   []CDNResourceOptionsStaticResponseHeadersValue `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Custom HTTP Headers that a CDN server adds to a response.

func (CDNResourceOptionsStaticResponseHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsStaticResponseHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error

type CDNResourceOptionsStaticResponseHeadersValue added in v0.31.0

type CDNResourceOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always bool `json:"always"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Value       respjson.Field
		Always      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNResourceOptionsStaticResponseHeadersValue) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsStaticResponseHeadersValue) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error

type CDNResourceOptionsTlsCiphers added in v0.57.0

type CDNResourceOptionsTlsCiphers struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Name of the cipher profile.
	//
	// Possible values:
	//
	//   - **`pci_dss`** - TLS 1.2 cipher suites compliant with PCI DSS. Allows only
	//     `TLSv1.2` and `TLSv1.3`; TLS 1.3 connections use the protocol's own standard
	//     cipher suites, which are PCI DSS compliant.
	//
	// Any of "pci_dss".
	Mode string `json:"mode" api:"required"`
	// Cipher suites the profile resolves to, in the server preference order.
	Ciphers []string `json:"ciphers"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Mode        respjson.Field
		Ciphers     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cipher suite policy for HTTPS connections from end users to the domain, selected from predefined profiles.

The exact cipher suites the policy enforces are returned in the `ciphers` field, and each profile defines which TLS versions may be enabled together with it. While the option is active:

- The `tls_versions` option can include only the versions the profile allows. - The `tls_versions` option cannot be deleted or disabled.

The option is read-only. Contact support to change it.

When the option is absent or disabled, the default cipher suites of the CDN are used.

func (CDNResourceOptionsTlsCiphers) RawJSON added in v0.57.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsTlsCiphers) UnmarshalJSON added in v0.57.0

func (r *CDNResourceOptionsTlsCiphers) UnmarshalJSON(data []byte) error

type CDNResourceOptionsTlsVersions added in v0.31.0

type CDNResourceOptionsTlsVersions struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of SSL/TLS protocol versions (case sensitive).
	//
	// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of SSL/TLS protocol versions allowed for HTTPS connections from end users to the domain.

When the option is disabled, all protocols versions are allowed.

While the `tls_ciphers` option is active on the resource, only the TLS versions its cipher profile allows can be enabled, and this option cannot be deleted or disabled.

func (CDNResourceOptionsTlsVersions) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsTlsVersions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsTlsVersions) UnmarshalJSON(data []byte) error

type CDNResourceOptionsUseDefaultLeChain added in v0.31.0

type CDNResourceOptionsUseDefaultLeChain struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Default Let's Encrypt certificate chain. This is a deprecated
	//     version, use it only for compatibilities with Android devices 7.1.1 or lower.
	//   - **false** - Alternative Let's Encrypt certificate chain.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Let's Encrypt certificate chain.

The specified chain will be used during the next Let's Encrypt certificate issue or renewal.

func (CDNResourceOptionsUseDefaultLeChain) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsUseDefaultLeChain) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsUseDefaultLeChain) UnmarshalJSON(data []byte) error

type CDNResourceOptionsUseDns01LeChallenge added in v0.31.0

type CDNResourceOptionsUseDns01LeChallenge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - DNS-01 challenge is used to issue Let's Encrypt certificate.
	// - **false** - HTTP-01 challenge is used to issue Let's Encrypt certificate.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

DNS-01 challenge to issue a Let's Encrypt certificate for the resource.

DNS service should be activated to enable this option.

func (CDNResourceOptionsUseDns01LeChallenge) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsUseDns01LeChallenge) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsUseDns01LeChallenge) UnmarshalJSON(data []byte) error

type CDNResourceOptionsUseRsaLeCert added in v0.31.0

type CDNResourceOptionsUseRsaLeCert struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - RSA Let's Encrypt certificate.
	// - **false** - ECDSA Let's Encrypt certificate.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

RSA Let's Encrypt certificate type for the CDN resource.

The specified value will be used during the next Let's Encrypt certificate issue or renewal.

func (CDNResourceOptionsUseRsaLeCert) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsUseRsaLeCert) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsUseRsaLeCert) UnmarshalJSON(data []byte) error

type CDNResourceOptionsUserAgentACL added in v0.31.0

type CDNResourceOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls access to the content for specified User-Agents.

func (CDNResourceOptionsUserAgentACL) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsUserAgentACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsUserAgentACL) UnmarshalJSON(data []byte) error

type CDNResourceOptionsWaap added in v0.31.0

type CDNResourceOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to enable WAAP (Web Application and API Protection).

func (CDNResourceOptionsWaap) RawJSON added in v0.31.0

func (r CDNResourceOptionsWaap) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsWaap) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsWaap) UnmarshalJSON(data []byte) error

type CDNResourceOptionsWebsockets added in v0.31.0

type CDNResourceOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables or disables WebSockets connections to an origin server.

func (CDNResourceOptionsWebsockets) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsWebsockets) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsWebsockets) UnmarshalJSON(data []byte) error

type CDNResourceOriginProtocol added in v0.31.0

type CDNResourceOriginProtocol string

Protocol used by CDN servers to request content from an origin source.

Possible values:

  • **HTTPS** - CDN servers will connect to the origin via HTTPS.
  • **HTTP** - CDN servers will connect to the origin via HTTP.
  • **MATCH** - connection protocol will be chosen automatically (content on the origin source should be available for the CDN both through HTTP and HTTPS).

If protocol is not specified, HTTP is used to connect to an origin server.

If an enabled origin in the resource's origin group is bound to a Gcore Object Storage (`s3_type` is `gcore`), the CDN connects to every origin in that group over HTTPS regardless of this setting.

const (
	CDNResourceOriginProtocolHTTP  CDNResourceOriginProtocol = "HTTP"
	CDNResourceOriginProtocolHTTPS CDNResourceOriginProtocol = "HTTPS"
	CDNResourceOriginProtocolMatch CDNResourceOriginProtocol = "MATCH"
)

type CDNResourcePrefetchParams added in v0.31.0

type CDNResourcePrefetchParams struct {
	// Paths to files that should be pre-populated to the CDN.
	//
	// Paths to the files should be specified without a domain name.
	Paths []string `json:"paths,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (CDNResourcePrefetchParams) MarshalJSON added in v0.31.0

func (r CDNResourcePrefetchParams) MarshalJSON() (data []byte, err error)

func (*CDNResourcePrefetchParams) UnmarshalJSON added in v0.31.0

func (r *CDNResourcePrefetchParams) UnmarshalJSON(data []byte) error

type CDNResourcePurgeParams added in v0.31.0

type CDNResourcePurgeParams struct {

	// This field is a request body variant, only one variant field can be set.
	OfPurgeByURL *CDNResourcePurgeParamsBodyPurgeByURL `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfPurgeByPattern *CDNResourcePurgeParamsBodyPurgeByPattern `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfPurgeAllCache *CDNResourcePurgeParamsBodyPurgeAllCache `json:",inline"`
	// contains filtered or unexported fields
}

func (CDNResourcePurgeParams) MarshalJSON added in v0.31.0

func (u CDNResourcePurgeParams) MarshalJSON() ([]byte, error)

func (*CDNResourcePurgeParams) UnmarshalJSON added in v0.31.0

func (r *CDNResourcePurgeParams) UnmarshalJSON(data []byte) error

type CDNResourcePurgeParamsBodyPurgeAllCache added in v0.31.0

type CDNResourcePurgeParamsBodyPurgeAllCache struct {
	// **Purge all cache** clears the entire cache for the CDN resource.
	//
	// Specify an empty array to purge all content for the resource.
	//
	// When you purge all assets, CDN servers request content from your origin server
	// and cause a high load. Therefore, we recommend to use purge by URL for large
	// content quantities.
	Paths []string `json:"paths,omitzero"`
	// contains filtered or unexported fields
}

func (CDNResourcePurgeParamsBodyPurgeAllCache) MarshalJSON added in v0.31.0

func (r CDNResourcePurgeParamsBodyPurgeAllCache) MarshalJSON() (data []byte, err error)

func (*CDNResourcePurgeParamsBodyPurgeAllCache) UnmarshalJSON added in v0.31.0

func (r *CDNResourcePurgeParamsBodyPurgeAllCache) UnmarshalJSON(data []byte) error

type CDNResourcePurgeParamsBodyPurgeByPattern added in v0.31.0

type CDNResourcePurgeParamsBodyPurgeByPattern struct {
	// **Purge by pattern** clears the cache that matches the pattern.
	//
	// Use _ operator, which replaces any number of symbols in your path. It's
	// important to note that wildcard usage (_) is permitted only at the end of a
	// pattern.
	//
	// Query string added to any patterns will be ignored, and purge request will be
	// processed as if there weren't any parameters.
	//
	// Purge by pattern is recursive. Both /path and /path* will result in recursive
	// purging, meaning all content under the specified path will be affected. As such,
	// using the pattern /path* is functionally equivalent to simply using /path.
	Paths []string `json:"paths,omitzero"`
	// contains filtered or unexported fields
}

func (CDNResourcePurgeParamsBodyPurgeByPattern) MarshalJSON added in v0.31.0

func (r CDNResourcePurgeParamsBodyPurgeByPattern) MarshalJSON() (data []byte, err error)

func (*CDNResourcePurgeParamsBodyPurgeByPattern) UnmarshalJSON added in v0.31.0

func (r *CDNResourcePurgeParamsBodyPurgeByPattern) UnmarshalJSON(data []byte) error

type CDNResourcePurgeParamsBodyPurgeByURL added in v0.31.0

type CDNResourcePurgeParamsBodyPurgeByURL struct {
	// **Purge by URL** clears the cache of a specific files. This purge type is
	// recommended.
	//
	// Specify file URLs including query strings. URLs should start with / without a
	// domain name.
	//
	// Purge by URL depends on the following CDN options:
	//
	//  1. "vary response header" is used. If your origin serves variants of the same
	//     content depending on the Vary HTTP response header, purge by URL will delete
	//     only one version of the file.
	//  2. "slice" is used. If you update several files in the origin without clearing
	//     the CDN cache, purge by URL will delete only the first slice (with bytes=0…
	//     .)
	//  3. "ignoreQueryString" is used. Don’t specify parameters in the purge request.
	//  4. "query_params_blacklist" is used. Only files with the listed in the option
	//     parameters will be cached as different objects. Files with other parameters
	//     will be cached as one object. In this case, specify the listed parameters in
	//     the Purge request. Don't specify other parameters.
	//  5. "query_params_whitelist" is used. Files with listed in the option parameters
	//     will be cached as one object. Files with other parameters will be cached as
	//     different objects. In this case, specify other parameters (if any) besides
	//     the ones listed in the purge request.
	URLs []string `json:"urls,omitzero"`
	// contains filtered or unexported fields
}

func (CDNResourcePurgeParamsBodyPurgeByURL) MarshalJSON added in v0.31.0

func (r CDNResourcePurgeParamsBodyPurgeByURL) MarshalJSON() (data []byte, err error)

func (*CDNResourcePurgeParamsBodyPurgeByURL) UnmarshalJSON added in v0.31.0

func (r *CDNResourcePurgeParamsBodyPurgeByURL) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParams added in v0.31.0

type CDNResourceReplaceParams struct {
	// Origin group ID with which the CDN resource is associated.
	OriginGroup int64 `json:"originGroup" api:"required"`
	// CDN resource name.
	Name param.Opt[string] `json:"name,omitzero"`
	// ID of the trusted CA certificate used to verify an origin.
	//
	// It can be used only with `"proxy_ssl_enabled": true`.
	ProxySslCa param.Opt[int64] `json:"proxy_ssl_ca,omitzero"`
	// ID of the SSL certificate used to verify an origin.
	//
	// It can be used only with `"proxy_ssl_enabled": true`.
	ProxySslData param.Opt[int64] `json:"proxy_ssl_data,omitzero"`
	// ID of the SSL certificate linked to the CDN resource.
	//
	// Can be used only with `"sslEnabled": true`.
	SslData param.Opt[int64] `json:"sslData,omitzero"`
	// Enables or disables a CDN resource.
	//
	// Possible values:
	//
	// - **true** - CDN resource is active. Content is being delivered.
	// - **false** - CDN resource is deactivated. Content is not being delivered.
	Active param.Opt[bool] `json:"active,omitzero"`
	// Optional comment describing the CDN resource.
	Description param.Opt[string] `json:"description,omitzero"`
	// Enables or disables SSL certificate validation of the origin server before
	// completing any connection.
	//
	// Possible values:
	//
	// - **true** - Origin SSL certificate validation is enabled.
	// - **false** - Origin SSL certificate validation is disabled.
	ProxySslEnabled param.Opt[bool] `json:"proxy_ssl_enabled,omitzero"`
	// Defines whether the HTTPS protocol enabled for content delivery.
	//
	// Possible values:
	//
	// - **true** - HTTPS is enabled.
	// - **false** - HTTPS is disabled.
	SslEnabled param.Opt[bool] `json:"sslEnabled,omitzero"`
	// List of options that can be configured for the CDN resource.
	//
	// In case of `null` value the option is not added to the CDN resource. Option may
	// inherit its value from the global account settings.
	Options CDNResourceReplaceParamsOptions `json:"options,omitzero"`
	// Protocol used by CDN servers to request content from an origin source.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers will connect to the origin via HTTPS.
	//   - **HTTP** - CDN servers will connect to the origin via HTTP.
	//   - **MATCH** - connection protocol will be chosen automatically (content on the
	//     origin source should be available for the CDN both through HTTP and HTTPS).
	//
	// If protocol is not specified, HTTP is used to connect to an origin server.
	//
	// If an enabled origin in the resource's origin group is bound to a Gcore Object
	// Storage (`s3_type` is `gcore`), the CDN connects to every origin in that group
	// over HTTPS regardless of this setting.
	//
	// Any of "HTTP", "HTTPS", "MATCH".
	OriginProtocol CDNResourceReplaceParamsOriginProtocol `json:"originProtocol,omitzero"`
	// Additional delivery domains (CNAMEs) that will be used to deliver content via
	// the CDN.
	//
	// Up to ten additional CNAMEs are possible.
	SecondaryHostnames []string `json:"secondaryHostnames,omitzero" format:"domain"`
	// contains filtered or unexported fields
}

func (CDNResourceReplaceParams) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParams) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParams) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParams) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptions added in v0.31.0

type CDNResourceReplaceParamsOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods CDNResourceReplaceParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression CDNResourceReplaceParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings CDNResourceReplaceParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders CDNResourceReplaceParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors CDNResourceReplaceParamsOptionsCors `json:"cors,omitzero"`
	// Enables control access to content for specified countries.
	CountryACL CDNResourceReplaceParamsOptionsCountryACL `json:"country_acl,omitzero"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache CDNResourceReplaceParamsOptionsDisableCache `json:"disable_cache,omitzero"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges CDNResourceReplaceParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings CDNResourceReplaceParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge CDNResourceReplaceParamsOptionsFastedge `json:"fastedge,omitzero"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed CDNResourceReplaceParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect CDNResourceReplaceParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn CDNResourceReplaceParamsOptionsForceReturn `json:"force_return,omitzero"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader CDNResourceReplaceParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
	// Enables gRPC pass-through for the CDN resource.
	GrpcPassthrough CDNResourceReplaceParamsOptionsGrpcPassthrough `json:"grpc_passthrough,omitzero"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn CDNResourceReplaceParamsOptionsGzipOn `json:"gzipOn,omitzero"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader CDNResourceReplaceParamsOptionsHostHeader `json:"hostHeader,omitzero"`
	// Enables HTTP/3 protocol for content delivery.
	//
	// `http3_enabled` option works only with `"sslEnabled": true`.
	Http3Enabled CDNResourceReplaceParamsOptionsHttp3Enabled `json:"http3_enabled,omitzero"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie CDNResourceReplaceParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString CDNResourceReplaceParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack CDNResourceReplaceParamsOptionsImageStack `json:"image_stack,omitzero"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL CDNResourceReplaceParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
	// Allows to control the download speed per connection.
	LimitBandwidth CDNResourceReplaceParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
	// Enables Network Error Logging (NEL) for the resource.
	//
	// When enabled, the edge instructs browsers to collect and report network errors
	// (via the `Report-To` and `NEL` response headers), improving observability of
	// connectivity issues for the resource.
	NetworkErrorLogging CDNResourceReplaceParamsOptionsNetworkErrorLogging `json:"network_error_logging,omitzero"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey CDNResourceReplaceParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet CDNResourceReplaceParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout CDNResourceReplaceParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout CDNResourceReplaceParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist CDNResourceReplaceParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist CDNResourceReplaceParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding CDNResourceReplaceParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS CDNResourceReplaceParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP CDNResourceReplaceParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL CDNResourceReplaceParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy CDNResourceReplaceParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite CDNResourceReplaceParamsOptionsRewrite `json:"rewrite,omitzero"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey CDNResourceReplaceParamsOptionsSecureKey `json:"secure_key,omitzero"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice CDNResourceReplaceParamsOptionsSlice `json:"slice,omitzero"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni CDNResourceReplaceParamsOptionsSni `json:"sni,omitzero"`
	// Serves stale cached content in case of origin unavailability.
	Stale CDNResourceReplaceParamsOptionsStale `json:"stale,omitzero"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders CDNResourceReplaceParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders CDNResourceReplaceParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders CDNResourceReplaceParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
	// List of SSL/TLS protocol versions allowed for HTTPS connections from end users
	// to the domain.
	//
	// When the option is disabled, all protocols versions are allowed.
	//
	// While the `tls_ciphers` option is active on the resource, only the TLS versions
	// its cipher profile allows can be enabled, and this option cannot be deleted or
	// disabled.
	TlsVersions CDNResourceReplaceParamsOptionsTlsVersions `json:"tls_versions,omitzero"`
	// Let's Encrypt certificate chain.
	//
	// The specified chain will be used during the next Let's Encrypt certificate issue
	// or renewal.
	UseDefaultLeChain CDNResourceReplaceParamsOptionsUseDefaultLeChain `json:"use_default_le_chain,omitzero"`
	// DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
	//
	// DNS service should be activated to enable this option.
	UseDns01LeChallenge CDNResourceReplaceParamsOptionsUseDns01LeChallenge `json:"use_dns01_le_challenge,omitzero"`
	// RSA Let's Encrypt certificate type for the CDN resource.
	//
	// The specified value will be used during the next Let's Encrypt certificate issue
	// or renewal.
	UseRsaLeCert CDNResourceReplaceParamsOptionsUseRsaLeCert `json:"use_rsa_le_cert,omitzero"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL CDNResourceReplaceParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap CDNResourceReplaceParamsOptionsWaap `json:"waap,omitzero"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets CDNResourceReplaceParamsOptionsWebsockets `json:"websockets,omitzero"`
	// contains filtered or unexported fields
}

List of options that can be configured for the CDN resource.

In case of `null` value the option is not added to the CDN resource. Option may inherit its value from the global account settings.

func (CDNResourceReplaceParamsOptions) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptions) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptions) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsAllowedHTTPMethods added in v0.31.0

type CDNResourceReplaceParamsOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

HTTP methods allowed for content requests from the CDN.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsAllowedHTTPMethods) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsBrotliCompression added in v0.31.0

type CDNResourceReplaceParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsBrotliCompression) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsBrotliCompression) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsBrowserCacheSettings added in v0.31.0

type CDNResourceReplaceParamsOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsBrowserCacheSettings) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsBrowserCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsCacheHTTPHeaders deprecated added in v0.31.0

type CDNResourceReplaceParamsOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsCacheHTTPHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsCors added in v0.31.0

type CDNResourceReplaceParamsOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsCors) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsCors) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsCors) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsCors) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsCountryACL added in v0.31.0

type CDNResourceReplaceParamsOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Enables control access to content for specified countries.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceReplaceParamsOptionsCountryACL) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsCountryACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsCountryACL) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsDisableCache deprecated added in v0.31.0

type CDNResourceReplaceParamsOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsDisableCache) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsDisableCache) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsDisableCache) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsDisableProxyForceRanges added in v0.31.0

type CDNResourceReplaceParamsOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows 206 responses regardless of the settings of an origin source.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsDisableProxyForceRanges) MarshalJSON added in v0.31.0

func (*CDNResourceReplaceParamsOptionsDisableProxyForceRanges) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsEdgeCacheSettings added in v0.31.0

type CDNResourceReplaceParamsOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

The property Enabled is required.

func (CDNResourceReplaceParamsOptionsEdgeCacheSettings) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsEdgeCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedge added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody CDNResourceReplaceParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders CDNResourceReplaceParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache CDNResourceReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody CDNResourceReplaceParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders CDNResourceReplaceParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

The property Enabled is required.

func (CDNResourceReplaceParamsOptionsFastedge) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsFastedge) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsFastedge) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsFastedge) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsFastedgeOnRequestBody added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

The property AppID is required.

func (CDNResourceReplaceParamsOptionsFastedgeOnRequestBody) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsFastedgeOnRequestBody) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedgeOnRequestHeaders added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

The property AppID is required.

func (CDNResourceReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type CDNResourceReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

The property AppID is required.

func (CDNResourceReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache) MarshalJSON added in v0.50.0

func (*CDNResourceReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type CDNResourceReplaceParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceReplaceParamsOptionsFastedgeOnResponseBody) MarshalJSON added in v0.31.0

func (*CDNResourceReplaceParamsOptionsFastedgeOnResponseBody) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedgeOnResponseHeaders added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceReplaceParamsOptionsFastedgeOnResponseHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceReplaceParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsFetchCompressed added in v0.31.0

type CDNResourceReplaceParamsOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsFetchCompressed) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsFetchCompressed) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsFollowOriginRedirect added in v0.31.0

type CDNResourceReplaceParamsOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

The properties Codes, Enabled are required.

func (CDNResourceReplaceParamsOptionsFollowOriginRedirect) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsFollowOriginRedirect) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsForceReturn added in v0.31.0

type CDNResourceReplaceParamsOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval CDNResourceReplaceParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
	// contains filtered or unexported fields
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

The properties Body, Code, Enabled are required.

func (CDNResourceReplaceParamsOptionsForceReturn) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsForceReturn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsForceReturn) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsForceReturnTimeInterval added in v0.31.0

type CDNResourceReplaceParamsOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
	// contains filtered or unexported fields
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

The properties EndTime, StartTime are required.

func (CDNResourceReplaceParamsOptionsForceReturnTimeInterval) MarshalJSON added in v0.31.0

func (*CDNResourceReplaceParamsOptionsForceReturnTimeInterval) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsForwardHostHeader added in v0.31.0

type CDNResourceReplaceParamsOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsForwardHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsForwardHostHeader) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsGrpcPassthrough added in v0.34.0

type CDNResourceReplaceParamsOptionsGrpcPassthrough struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables gRPC pass-through for the CDN resource.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsGrpcPassthrough) MarshalJSON added in v0.34.0

func (r CDNResourceReplaceParamsOptionsGrpcPassthrough) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsGrpcPassthrough) UnmarshalJSON added in v0.34.0

type CDNResourceReplaceParamsOptionsGzipOn added in v0.31.0

type CDNResourceReplaceParamsOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsGzipOn) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsGzipOn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsGzipOn) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsHostHeader added in v0.31.0

type CDNResourceReplaceParamsOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsHttp3Enabled added in v0.31.0

type CDNResourceReplaceParamsOptionsHttp3Enabled struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables HTTP/3 protocol for content delivery.

`http3_enabled` option works only with `"sslEnabled": true`.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsHttp3Enabled) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsHttp3Enabled) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsHttp3Enabled) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsHttp3Enabled) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsIPAddressACL added in v0.31.0

type CDNResourceReplaceParamsOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceReplaceParamsOptionsIPAddressACL) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsIPAddressACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsIgnoreCookie added in v0.31.0

type CDNResourceReplaceParamsOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsIgnoreCookie) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsIgnoreCookie) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsIgnoreQueryString added in v0.31.0

type CDNResourceReplaceParamsOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsIgnoreQueryString) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsIgnoreQueryString) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsImageStack added in v0.31.0

type CDNResourceReplaceParamsOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality param.Opt[int64] `json:"quality,omitzero"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
	// contains filtered or unexported fields
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

The property Enabled is required.

func (CDNResourceReplaceParamsOptionsImageStack) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsImageStack) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsImageStack) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsImageStack) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsLimitBandwidth added in v0.31.0

type CDNResourceReplaceParamsOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type,omitzero" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer param.Opt[int64] `json:"buffer,omitzero"`
	// Maximum download speed per connection.
	Speed param.Opt[int64] `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

Allows to control the download speed per connection.

The properties Enabled, LimitType are required.

func (CDNResourceReplaceParamsOptionsLimitBandwidth) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsLimitBandwidth) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsNetworkErrorLogging added in v0.50.0

type CDNResourceReplaceParamsOptionsNetworkErrorLogging struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables Network Error Logging (NEL) for the resource.

When enabled, the edge instructs browsers to collect and report network errors (via the `Report-To` and `NEL` response headers), improving observability of connectivity issues for the resource.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsNetworkErrorLogging) MarshalJSON added in v0.50.0

func (r CDNResourceReplaceParamsOptionsNetworkErrorLogging) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsNetworkErrorLogging) UnmarshalJSON added in v0.50.0

type CDNResourceReplaceParamsOptionsProxyCacheKey added in v0.31.0

type CDNResourceReplaceParamsOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsProxyCacheKey) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsProxyCacheKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsProxyCacheMethodsSet added in v0.31.0

type CDNResourceReplaceParamsOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Caching for POST requests along with default GET and HEAD.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsProxyCacheMethodsSet) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsProxyConnectTimeout added in v0.31.0

type CDNResourceReplaceParamsOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for establishing a connection with the origin.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsProxyConnectTimeout) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsProxyConnectTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsProxyReadTimeout added in v0.31.0

type CDNResourceReplaceParamsOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsProxyReadTimeout) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsProxyReadTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsQueryParamsBlacklist added in v0.31.0

type CDNResourceReplaceParamsOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsQueryParamsBlacklist) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsQueryParamsWhitelist added in v0.31.0

type CDNResourceReplaceParamsOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsQueryParamsWhitelist) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsQueryStringForwarding added in v0.31.0

type CDNResourceReplaceParamsOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types,omitzero" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
	// contains filtered or unexported fields
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.

func (CDNResourceReplaceParamsOptionsQueryStringForwarding) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsQueryStringForwarding) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsRedirectHTTPSToHTTP added in v0.31.0

type CDNResourceReplaceParamsOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsRedirectHTTPToHTTPS added in v0.31.0

type CDNResourceReplaceParamsOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsReferrerACL added in v0.31.0

type CDNResourceReplaceParamsOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specified domain names.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceReplaceParamsOptionsReferrerACL) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsReferrerACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsResponseHeadersHidingPolicy added in v0.31.0

type CDNResourceReplaceParamsOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted,omitzero" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Hides HTTP headers from an origin server in the CDN response.

The properties Enabled, Excepted, Mode are required.

func (CDNResourceReplaceParamsOptionsResponseHeadersHidingPolicy) MarshalJSON added in v0.31.0

func (*CDNResourceReplaceParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsRewrite added in v0.31.0

type CDNResourceReplaceParamsOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag,omitzero"`
	// contains filtered or unexported fields
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

The properties Body, Enabled are required.

func (CDNResourceReplaceParamsOptionsRewrite) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsRewrite) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsRewrite) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsRewrite) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsSecureKey added in v0.31.0

type CDNResourceReplaceParamsOptionsSecureKey struct {
	// Key generated on your side that will be used for URL signing.
	Key param.Opt[string] `json:"key,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

The properties Enabled, Key are required.

func (CDNResourceReplaceParamsOptionsSecureKey) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsSecureKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsSecureKey) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsSlice added in v0.31.0

type CDNResourceReplaceParamsOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsSlice) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsSlice) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsSlice) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsSlice) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsSni added in v0.31.0

type CDNResourceReplaceParamsOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type,omitzero"`
	// contains filtered or unexported fields
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

The properties CustomHostname, Enabled are required.

func (CDNResourceReplaceParamsOptionsSni) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsSni) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsSni) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsSni) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsStale added in v0.31.0

type CDNResourceReplaceParamsOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Serves stale cached content in case of origin unavailability.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsStale) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsStale) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsStale) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsStale) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsStaticHeaders deprecated added in v0.31.0

type CDNResourceReplaceParamsOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsStaticHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsStaticHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsStaticRequestHeaders added in v0.31.0

type CDNResourceReplaceParamsOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsStaticRequestHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsStaticRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsStaticResponseHeaders added in v0.31.0

type CDNResourceReplaceParamsOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                                        `json:"enabled" api:"required"`
	Value   []CDNResourceReplaceParamsOptionsStaticResponseHeadersValue `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers that a CDN server adds to a response.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsStaticResponseHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsStaticResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsStaticResponseHeadersValue added in v0.31.0

type CDNResourceReplaceParamsOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (CDNResourceReplaceParamsOptionsStaticResponseHeadersValue) MarshalJSON added in v0.31.0

func (*CDNResourceReplaceParamsOptionsStaticResponseHeadersValue) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsTlsCiphers added in v0.57.0

type CDNResourceReplaceParamsOptionsTlsCiphers struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Cipher suite policy for HTTPS connections from end users to the domain, selected from predefined profiles.

The exact cipher suites the policy enforces are returned in the `ciphers` field, and each profile defines which TLS versions may be enabled together with it. While the option is active:

- The `tls_versions` option can include only the versions the profile allows. - The `tls_versions` option cannot be deleted or disabled.

The option is read-only. Contact support to change it.

When the option is absent or disabled, the default cipher suites of the CDN are used.

The properties Enabled, Mode are required.

func (CDNResourceReplaceParamsOptionsTlsCiphers) MarshalJSON added in v0.57.0

func (r CDNResourceReplaceParamsOptionsTlsCiphers) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsTlsCiphers) UnmarshalJSON added in v0.57.0

func (r *CDNResourceReplaceParamsOptionsTlsCiphers) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsTlsVersions added in v0.31.0

type CDNResourceReplaceParamsOptionsTlsVersions struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of SSL/TLS protocol versions (case sensitive).
	//
	// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

List of SSL/TLS protocol versions allowed for HTTPS connections from end users to the domain.

When the option is disabled, all protocols versions are allowed.

While the `tls_ciphers` option is active on the resource, only the TLS versions its cipher profile allows can be enabled, and this option cannot be deleted or disabled.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsTlsVersions) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsTlsVersions) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsTlsVersions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsTlsVersions) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsUseDefaultLeChain added in v0.31.0

type CDNResourceReplaceParamsOptionsUseDefaultLeChain struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Default Let's Encrypt certificate chain. This is a deprecated
	//     version, use it only for compatibilities with Android devices 7.1.1 or lower.
	//   - **false** - Alternative Let's Encrypt certificate chain.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Let's Encrypt certificate chain.

The specified chain will be used during the next Let's Encrypt certificate issue or renewal.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsUseDefaultLeChain) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsUseDefaultLeChain) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsUseDefaultLeChain) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsUseDns01LeChallenge added in v0.31.0

type CDNResourceReplaceParamsOptionsUseDns01LeChallenge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - DNS-01 challenge is used to issue Let's Encrypt certificate.
	// - **false** - HTTP-01 challenge is used to issue Let's Encrypt certificate.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

DNS-01 challenge to issue a Let's Encrypt certificate for the resource.

DNS service should be activated to enable this option.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsUseDns01LeChallenge) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsUseDns01LeChallenge) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsUseDns01LeChallenge) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsUseRsaLeCert added in v0.31.0

type CDNResourceReplaceParamsOptionsUseRsaLeCert struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - RSA Let's Encrypt certificate.
	// - **false** - ECDSA Let's Encrypt certificate.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

RSA Let's Encrypt certificate type for the CDN resource.

The specified value will be used during the next Let's Encrypt certificate issue or renewal.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsUseRsaLeCert) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsUseRsaLeCert) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsUseRsaLeCert) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsUseRsaLeCert) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsUserAgentACL added in v0.31.0

type CDNResourceReplaceParamsOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the content for specified User-Agents.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceReplaceParamsOptionsUserAgentACL) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsUserAgentACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsWaap added in v0.31.0

type CDNResourceReplaceParamsOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows to enable WAAP (Web Application and API Protection).

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsWaap) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsWaap) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsWaap) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsWaap) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOptionsWebsockets added in v0.31.0

type CDNResourceReplaceParamsOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables or disables WebSockets connections to an origin server.

The properties Enabled, Value are required.

func (CDNResourceReplaceParamsOptionsWebsockets) MarshalJSON added in v0.31.0

func (r CDNResourceReplaceParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)

func (*CDNResourceReplaceParamsOptionsWebsockets) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsWebsockets) UnmarshalJSON(data []byte) error

type CDNResourceReplaceParamsOriginProtocol added in v0.31.0

type CDNResourceReplaceParamsOriginProtocol string

Protocol used by CDN servers to request content from an origin source.

Possible values:

  • **HTTPS** - CDN servers will connect to the origin via HTTPS.
  • **HTTP** - CDN servers will connect to the origin via HTTP.
  • **MATCH** - connection protocol will be chosen automatically (content on the origin source should be available for the CDN both through HTTP and HTTPS).

If protocol is not specified, HTTP is used to connect to an origin server.

If an enabled origin in the resource's origin group is bound to a Gcore Object Storage (`s3_type` is `gcore`), the CDN connects to every origin in that group over HTTPS regardless of this setting.

const (
	CDNResourceReplaceParamsOriginProtocolHTTP  CDNResourceReplaceParamsOriginProtocol = "HTTP"
	CDNResourceReplaceParamsOriginProtocolHTTPS CDNResourceReplaceParamsOriginProtocol = "HTTPS"
	CDNResourceReplaceParamsOriginProtocolMatch CDNResourceReplaceParamsOriginProtocol = "MATCH"
)

type CDNResourceRule added in v0.31.0

type CDNResourceRule struct {
	// Rule ID.
	ID int64 `json:"id"`
	// Enables or disables a rule.
	//
	// Possible values:
	//
	// - **true** - Rule is active, rule settings are applied.
	// - **false** - Rule is inactive, rule settings are not applied.
	Active bool `json:"active"`
	// Defines whether the rule has been deleted.
	//
	// Possible values:
	//
	// - **true** - Rule has been deleted.
	// - **false** - Rule has not been deleted.
	Deleted bool `json:"deleted"`
	// Rule name.
	Name string `json:"name"`
	// List of options that can be configured for the rule.
	//
	// In case of `null` value the option is not added to the rule. Option inherits its
	// value from the CDN resource settings.
	Options CDNResourceRuleOptions `json:"options"`
	// ID of the origin group to which the rule is applied.
	//
	// If the origin group is not specified, the rule is applied to the origin group
	// that the CDN resource is associated with.
	OriginGroup int64 `json:"originGroup" api:"nullable"`
	// Protocol used by CDN servers to request content from an origin source.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
	//   - **HTTP** - CDN servers connect to origin via HTTP protocol.
	//   - **MATCH** - Connection protocol is chosen automatically; in this case, content
	//     on origin source should be available for the CDN both through HTTP and HTTPS
	//     protocols.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OriginProtocol CDNResourceRuleOriginProtocol `json:"originProtocol"`
	// Sets a protocol other than the one specified in the CDN resource settings to
	// connect to the origin.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
	//   - **HTTP** - CDN servers connect to origin via HTTP protocol.
	//   - **MATCH** - Connection protocol is chosen automatically; in this case, content
	//     on origin source should be available for the CDN both through HTTP and HTTPS
	//     protocols.
	//   - **null** - `originProtocol` setting is inherited from the CDN resource
	//     settings.
	//
	// If an enabled origin among the origins this rule pulls from is bound to a Gcore
	// Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OverrideOriginProtocol CDNResourceRuleOverrideOriginProtocol `json:"overrideOriginProtocol" api:"nullable"`
	// Defines whether the rule has an applied preset.
	//
	// Possible values:
	//
	// - **true** - Rule has a preset applied.
	// - **false** - Rule does not have a preset applied.
	//
	// If a preset is applied to the rule, the options included in the preset cannot be
	// edited for the rule.
	PresetApplied bool `json:"preset_applied"`
	// ID of the rule with which the current rule is synchronized within the CDN
	// resource shared cache zone feature.
	PrimaryRule int64 `json:"primary_rule" api:"nullable"`
	// Path to the file or folder for which the rule will be applied.
	//
	// The rule is applied if the requested URI matches the rule path.
	//
	// We add a leading forward slash to any rule path. Specify a path without a
	// forward slash.
	Rule string `json:"rule"`
	// Rule type.
	//
	// Possible values:
	//
	//   - **Type 0** - Regular expression. Must start with '^/' or '/'.
	//   - **Type 1** - Regular expression. Note that for this rule type we automatically
	//     add / to each rule pattern before your regular expression. This type is
	//     **legacy**, please use Type 0.
	RuleType int64 `json:"ruleType"`
	// Rule execution order: from lowest (1) to highest.
	//
	// If requested URI matches multiple rules, the one higher in the order of the
	// rules will be applied.
	Weight int64 `json:"weight"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                     respjson.Field
		Active                 respjson.Field
		Deleted                respjson.Field
		Name                   respjson.Field
		Options                respjson.Field
		OriginGroup            respjson.Field
		OriginProtocol         respjson.Field
		OverrideOriginProtocol respjson.Field
		PresetApplied          respjson.Field
		PrimaryRule            respjson.Field
		Rule                   respjson.Field
		RuleType               respjson.Field
		Weight                 respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNResourceRule) RawJSON added in v0.31.0

func (r CDNResourceRule) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceRule) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRule) UnmarshalJSON(data []byte) error

type CDNResourceRuleDeleteParams added in v0.31.0

type CDNResourceRuleDeleteParams struct {
	ResourceID int64 `path:"resource_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type CDNResourceRuleGetParams added in v0.31.0

type CDNResourceRuleGetParams struct {
	ResourceID int64 `path:"resource_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type CDNResourceRuleList added in v0.34.0

type CDNResourceRuleList struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string            `json:"previous" api:"required"`
	Results  []CDNResourceRule `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNResourceRuleList) RawJSON added in v0.51.0

func (r CDNResourceRuleList) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceRuleList) UnmarshalJSON added in v0.51.0

func (r *CDNResourceRuleList) UnmarshalJSON(data []byte) error

type CDNResourceRuleListParams added in v0.41.0

type CDNResourceRuleListParams struct {
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CDNResourceRuleListParams) URLQuery added in v0.41.0

func (r CDNResourceRuleListParams) URLQuery() (v url.Values, err error)

URLQuery serializes CDNResourceRuleListParams's query parameters as `url.Values`.

type CDNResourceRuleNewParams added in v0.31.0

type CDNResourceRuleNewParams struct {
	// Rule name.
	Name string `json:"name" api:"required"`
	// Path to the file or folder for which the rule will be applied.
	//
	// The rule is applied if the requested URI matches the rule path.
	//
	// We add a leading forward slash to any rule path. Specify a path without a
	// forward slash.
	Rule string `json:"rule" api:"required"`
	// Rule type.
	//
	// Possible values:
	//
	//   - **Type 0** - Regular expression. Must start with '^/' or '/'.
	//   - **Type 1** - Regular expression. Note that for this rule type we automatically
	//     add / to each rule pattern before your regular expression. This type is
	//     **legacy**, please use Type 0.
	RuleType int64 `json:"ruleType" api:"required"`
	// ID of the origin group to which the rule is applied.
	//
	// If the origin group is not specified, the rule is applied to the origin group
	// that the CDN resource is associated with.
	OriginGroup param.Opt[int64] `json:"originGroup,omitzero"`
	// Enables or disables a rule.
	//
	// Possible values:
	//
	// - **true** - Rule is active, rule settings are applied.
	// - **false** - Rule is inactive, rule settings are not applied.
	Active param.Opt[bool] `json:"active,omitzero"`
	// Rule execution order: from lowest (1) to highest.
	//
	// If requested URI matches multiple rules, the one higher in the order of the
	// rules will be applied.
	Weight param.Opt[int64] `json:"weight,omitzero"`
	// Sets a protocol other than the one specified in the CDN resource settings to
	// connect to the origin.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
	//   - **HTTP** - CDN servers connect to origin via HTTP protocol.
	//   - **MATCH** - Connection protocol is chosen automatically; in this case, content
	//     on origin source should be available for the CDN both through HTTP and HTTPS
	//     protocols.
	//   - **null** - `originProtocol` setting is inherited from the CDN resource
	//     settings.
	//
	// If an enabled origin among the origins this rule pulls from is bound to a Gcore
	// Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OverrideOriginProtocol CDNResourceRuleNewParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
	// List of options that can be configured for the rule.
	//
	// In case of `null` value the option is not added to the rule. Option inherits its
	// value from the CDN resource settings.
	Options CDNResourceRuleNewParamsOptions `json:"options,omitzero"`
	// contains filtered or unexported fields
}

func (CDNResourceRuleNewParams) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParams) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParams) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParams) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptions added in v0.31.0

type CDNResourceRuleNewParamsOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods CDNResourceRuleNewParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression CDNResourceRuleNewParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings CDNResourceRuleNewParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders CDNResourceRuleNewParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors CDNResourceRuleNewParamsOptionsCors `json:"cors,omitzero"`
	// Enables control access to content for specified countries.
	CountryACL CDNResourceRuleNewParamsOptionsCountryACL `json:"country_acl,omitzero"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache CDNResourceRuleNewParamsOptionsDisableCache `json:"disable_cache,omitzero"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges CDNResourceRuleNewParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings CDNResourceRuleNewParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge CDNResourceRuleNewParamsOptionsFastedge `json:"fastedge,omitzero"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed CDNResourceRuleNewParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect CDNResourceRuleNewParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn CDNResourceRuleNewParamsOptionsForceReturn `json:"force_return,omitzero"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader CDNResourceRuleNewParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn CDNResourceRuleNewParamsOptionsGzipOn `json:"gzipOn,omitzero"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader CDNResourceRuleNewParamsOptionsHostHeader `json:"hostHeader,omitzero"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie CDNResourceRuleNewParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString CDNResourceRuleNewParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack CDNResourceRuleNewParamsOptionsImageStack `json:"image_stack,omitzero"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL CDNResourceRuleNewParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
	// Allows to control the download speed per connection.
	LimitBandwidth CDNResourceRuleNewParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey CDNResourceRuleNewParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet CDNResourceRuleNewParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout CDNResourceRuleNewParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout CDNResourceRuleNewParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist CDNResourceRuleNewParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist CDNResourceRuleNewParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding CDNResourceRuleNewParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS CDNResourceRuleNewParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP CDNResourceRuleNewParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL CDNResourceRuleNewParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy CDNResourceRuleNewParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite CDNResourceRuleNewParamsOptionsRewrite `json:"rewrite,omitzero"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey CDNResourceRuleNewParamsOptionsSecureKey `json:"secure_key,omitzero"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice CDNResourceRuleNewParamsOptionsSlice `json:"slice,omitzero"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni CDNResourceRuleNewParamsOptionsSni `json:"sni,omitzero"`
	// Serves stale cached content in case of origin unavailability.
	Stale CDNResourceRuleNewParamsOptionsStale `json:"stale,omitzero"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders CDNResourceRuleNewParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders CDNResourceRuleNewParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders CDNResourceRuleNewParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL CDNResourceRuleNewParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap CDNResourceRuleNewParamsOptionsWaap `json:"waap,omitzero"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets CDNResourceRuleNewParamsOptionsWebsockets `json:"websockets,omitzero"`
	// contains filtered or unexported fields
}

List of options that can be configured for the rule.

In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.

func (CDNResourceRuleNewParamsOptions) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptions) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptions) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsAllowedHTTPMethods added in v0.31.0

type CDNResourceRuleNewParamsOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

HTTP methods allowed for content requests from the CDN.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsAllowedHTTPMethods) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsAllowedHTTPMethods) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsBrotliCompression added in v0.31.0

type CDNResourceRuleNewParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsBrotliCompression) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsBrotliCompression) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsBrowserCacheSettings added in v0.31.0

type CDNResourceRuleNewParamsOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsBrowserCacheSettings) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsBrowserCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsCacheHTTPHeaders deprecated added in v0.31.0

type CDNResourceRuleNewParamsOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsCacheHTTPHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsCors added in v0.31.0

type CDNResourceRuleNewParamsOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsCors) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsCors) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsCors) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsCors) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsCountryACL added in v0.31.0

type CDNResourceRuleNewParamsOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Enables control access to content for specified countries.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleNewParamsOptionsCountryACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsCountryACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsCountryACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsDisableCache deprecated added in v0.31.0

type CDNResourceRuleNewParamsOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsDisableCache) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsDisableCache) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsDisableCache) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsDisableProxyForceRanges added in v0.31.0

type CDNResourceRuleNewParamsOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows 206 responses regardless of the settings of an origin source.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsDisableProxyForceRanges) MarshalJSON added in v0.31.0

func (*CDNResourceRuleNewParamsOptionsDisableProxyForceRanges) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsEdgeCacheSettings added in v0.31.0

type CDNResourceRuleNewParamsOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

The property Enabled is required.

func (CDNResourceRuleNewParamsOptionsEdgeCacheSettings) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsEdgeCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedge added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody CDNResourceRuleNewParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody CDNResourceRuleNewParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders CDNResourceRuleNewParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

The property Enabled is required.

func (CDNResourceRuleNewParamsOptionsFastedge) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsFastedge) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsFastedge) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsFastedge) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsFastedgeOnRequestBody added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

The property AppID is required.

func (CDNResourceRuleNewParamsOptionsFastedgeOnRequestBody) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsFastedgeOnRequestBody) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeaders added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

The property AppID is required.

func (CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

The property AppID is required.

func (CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeadersAfterCache) MarshalJSON added in v0.50.0

func (*CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type CDNResourceRuleNewParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceRuleNewParamsOptionsFastedgeOnResponseBody) MarshalJSON added in v0.31.0

func (*CDNResourceRuleNewParamsOptionsFastedgeOnResponseBody) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedgeOnResponseHeaders added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceRuleNewParamsOptionsFastedgeOnResponseHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleNewParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsFetchCompressed added in v0.31.0

type CDNResourceRuleNewParamsOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsFetchCompressed) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsFetchCompressed) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsFollowOriginRedirect added in v0.31.0

type CDNResourceRuleNewParamsOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

The properties Codes, Enabled are required.

func (CDNResourceRuleNewParamsOptionsFollowOriginRedirect) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsFollowOriginRedirect) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsForceReturn added in v0.31.0

type CDNResourceRuleNewParamsOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval CDNResourceRuleNewParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
	// contains filtered or unexported fields
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

The properties Body, Code, Enabled are required.

func (CDNResourceRuleNewParamsOptionsForceReturn) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsForceReturn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsForceReturn) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsForceReturnTimeInterval added in v0.31.0

type CDNResourceRuleNewParamsOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
	// contains filtered or unexported fields
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

The properties EndTime, StartTime are required.

func (CDNResourceRuleNewParamsOptionsForceReturnTimeInterval) MarshalJSON added in v0.31.0

func (*CDNResourceRuleNewParamsOptionsForceReturnTimeInterval) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsForwardHostHeader added in v0.31.0

type CDNResourceRuleNewParamsOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsForwardHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsForwardHostHeader) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsGzipOn added in v0.31.0

type CDNResourceRuleNewParamsOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsGzipOn) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsGzipOn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsGzipOn) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsHostHeader added in v0.31.0

type CDNResourceRuleNewParamsOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsIPAddressACL added in v0.31.0

type CDNResourceRuleNewParamsOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleNewParamsOptionsIPAddressACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsIPAddressACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsIgnoreCookie added in v0.31.0

type CDNResourceRuleNewParamsOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsIgnoreCookie) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsIgnoreCookie) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsIgnoreQueryString added in v0.31.0

type CDNResourceRuleNewParamsOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsIgnoreQueryString) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsIgnoreQueryString) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsImageStack added in v0.31.0

type CDNResourceRuleNewParamsOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality param.Opt[int64] `json:"quality,omitzero"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
	// contains filtered or unexported fields
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

The property Enabled is required.

func (CDNResourceRuleNewParamsOptionsImageStack) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsImageStack) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsImageStack) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsImageStack) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsLimitBandwidth added in v0.31.0

type CDNResourceRuleNewParamsOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type,omitzero" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer param.Opt[int64] `json:"buffer,omitzero"`
	// Maximum download speed per connection.
	Speed param.Opt[int64] `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

Allows to control the download speed per connection.

The properties Enabled, LimitType are required.

func (CDNResourceRuleNewParamsOptionsLimitBandwidth) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsLimitBandwidth) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsProxyCacheKey added in v0.31.0

type CDNResourceRuleNewParamsOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsProxyCacheKey) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsProxyCacheKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsProxyCacheMethodsSet added in v0.31.0

type CDNResourceRuleNewParamsOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Caching for POST requests along with default GET and HEAD.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsProxyCacheMethodsSet) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsProxyCacheMethodsSet) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsProxyConnectTimeout added in v0.31.0

type CDNResourceRuleNewParamsOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for establishing a connection with the origin.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsProxyConnectTimeout) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsProxyConnectTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsProxyReadTimeout added in v0.31.0

type CDNResourceRuleNewParamsOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsProxyReadTimeout) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsProxyReadTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsQueryParamsBlacklist added in v0.31.0

type CDNResourceRuleNewParamsOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsQueryParamsBlacklist) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsQueryParamsBlacklist) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsQueryParamsWhitelist added in v0.31.0

type CDNResourceRuleNewParamsOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsQueryParamsWhitelist) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsQueryParamsWhitelist) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsQueryStringForwarding added in v0.31.0

type CDNResourceRuleNewParamsOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types,omitzero" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
	// contains filtered or unexported fields
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.

func (CDNResourceRuleNewParamsOptionsQueryStringForwarding) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsQueryStringForwarding) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsRedirectHTTPSToHTTP added in v0.31.0

type CDNResourceRuleNewParamsOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsRedirectHTTPToHTTPS added in v0.31.0

type CDNResourceRuleNewParamsOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsReferrerACL added in v0.31.0

type CDNResourceRuleNewParamsOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specified domain names.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleNewParamsOptionsReferrerACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsReferrerACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsResponseHeadersHidingPolicy added in v0.31.0

type CDNResourceRuleNewParamsOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted,omitzero" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Hides HTTP headers from an origin server in the CDN response.

The properties Enabled, Excepted, Mode are required.

func (CDNResourceRuleNewParamsOptionsResponseHeadersHidingPolicy) MarshalJSON added in v0.31.0

func (*CDNResourceRuleNewParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsRewrite added in v0.31.0

type CDNResourceRuleNewParamsOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag,omitzero"`
	// contains filtered or unexported fields
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

The properties Body, Enabled are required.

func (CDNResourceRuleNewParamsOptionsRewrite) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsRewrite) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsRewrite) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsRewrite) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsSecureKey added in v0.31.0

type CDNResourceRuleNewParamsOptionsSecureKey struct {
	// Key generated on your side that will be used for URL signing.
	Key param.Opt[string] `json:"key,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

The properties Enabled, Key are required.

func (CDNResourceRuleNewParamsOptionsSecureKey) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsSecureKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsSecureKey) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsSlice added in v0.31.0

type CDNResourceRuleNewParamsOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsSlice) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsSlice) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsSlice) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsSlice) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsSni added in v0.31.0

type CDNResourceRuleNewParamsOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type,omitzero"`
	// contains filtered or unexported fields
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

The properties CustomHostname, Enabled are required.

func (CDNResourceRuleNewParamsOptionsSni) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsSni) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsSni) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsSni) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsStale added in v0.31.0

type CDNResourceRuleNewParamsOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Serves stale cached content in case of origin unavailability.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsStale) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsStale) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsStale) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsStale) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsStaticHeaders deprecated added in v0.31.0

type CDNResourceRuleNewParamsOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsStaticHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsStaticHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsStaticRequestHeaders added in v0.31.0

type CDNResourceRuleNewParamsOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsStaticRequestHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsStaticRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsStaticResponseHeaders added in v0.31.0

type CDNResourceRuleNewParamsOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                                        `json:"enabled" api:"required"`
	Value   []CDNResourceRuleNewParamsOptionsStaticResponseHeadersValue `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers that a CDN server adds to a response.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsStaticResponseHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsStaticResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsStaticResponseHeadersValue added in v0.31.0

type CDNResourceRuleNewParamsOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (CDNResourceRuleNewParamsOptionsStaticResponseHeadersValue) MarshalJSON added in v0.31.0

func (*CDNResourceRuleNewParamsOptionsStaticResponseHeadersValue) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsUserAgentACL added in v0.31.0

type CDNResourceRuleNewParamsOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the content for specified User-Agents.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleNewParamsOptionsUserAgentACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsUserAgentACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsWaap added in v0.31.0

type CDNResourceRuleNewParamsOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows to enable WAAP (Web Application and API Protection).

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsWaap) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsWaap) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsWaap) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsWaap) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOptionsWebsockets added in v0.31.0

type CDNResourceRuleNewParamsOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables or disables WebSockets connections to an origin server.

The properties Enabled, Value are required.

func (CDNResourceRuleNewParamsOptionsWebsockets) MarshalJSON added in v0.31.0

func (r CDNResourceRuleNewParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleNewParamsOptionsWebsockets) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsWebsockets) UnmarshalJSON(data []byte) error

type CDNResourceRuleNewParamsOverrideOriginProtocol added in v0.31.0

type CDNResourceRuleNewParamsOverrideOriginProtocol string

Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.

Possible values:

  • **HTTPS** - CDN servers connect to origin via HTTPS protocol.
  • **HTTP** - CDN servers connect to origin via HTTP protocol.
  • **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
  • **null** - `originProtocol` setting is inherited from the CDN resource settings.

If an enabled origin among the origins this rule pulls from is bound to a Gcore Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.

const (
	CDNResourceRuleNewParamsOverrideOriginProtocolHTTPS CDNResourceRuleNewParamsOverrideOriginProtocol = "HTTPS"
	CDNResourceRuleNewParamsOverrideOriginProtocolHTTP  CDNResourceRuleNewParamsOverrideOriginProtocol = "HTTP"
	CDNResourceRuleNewParamsOverrideOriginProtocolMatch CDNResourceRuleNewParamsOverrideOriginProtocol = "MATCH"
)

type CDNResourceRuleOptions added in v0.31.0

type CDNResourceRuleOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods CDNResourceRuleOptionsAllowedHTTPMethods `json:"allowedHttpMethods" api:"nullable"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression CDNResourceRuleOptionsBrotliCompression `json:"brotli_compression" api:"nullable"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings CDNResourceRuleOptionsBrowserCacheSettings `json:"browser_cache_settings" api:"nullable"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders CDNResourceRuleOptionsCacheHTTPHeaders `json:"cache_http_headers" api:"nullable"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors CDNResourceRuleOptionsCors `json:"cors" api:"nullable"`
	// Enables control access to content for specified countries.
	CountryACL CDNResourceRuleOptionsCountryACL `json:"country_acl" api:"nullable"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache CDNResourceRuleOptionsDisableCache `json:"disable_cache" api:"nullable"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges CDNResourceRuleOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges" api:"nullable"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings CDNResourceRuleOptionsEdgeCacheSettings `json:"edge_cache_settings" api:"nullable"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge CDNResourceRuleOptionsFastedge `json:"fastedge" api:"nullable"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed CDNResourceRuleOptionsFetchCompressed `json:"fetch_compressed" api:"nullable"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect CDNResourceRuleOptionsFollowOriginRedirect `json:"follow_origin_redirect" api:"nullable"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn CDNResourceRuleOptionsForceReturn `json:"force_return" api:"nullable"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader CDNResourceRuleOptionsForwardHostHeader `json:"forward_host_header" api:"nullable"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn CDNResourceRuleOptionsGzipOn `json:"gzipOn" api:"nullable"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader CDNResourceRuleOptionsHostHeader `json:"hostHeader" api:"nullable"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie CDNResourceRuleOptionsIgnoreCookie `json:"ignore_cookie" api:"nullable"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString CDNResourceRuleOptionsIgnoreQueryString `json:"ignoreQueryString" api:"nullable"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack CDNResourceRuleOptionsImageStack `json:"image_stack" api:"nullable"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL CDNResourceRuleOptionsIPAddressACL `json:"ip_address_acl" api:"nullable"`
	// Allows to control the download speed per connection.
	LimitBandwidth CDNResourceRuleOptionsLimitBandwidth `json:"limit_bandwidth" api:"nullable"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey CDNResourceRuleOptionsProxyCacheKey `json:"proxy_cache_key" api:"nullable"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet CDNResourceRuleOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set" api:"nullable"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout CDNResourceRuleOptionsProxyConnectTimeout `json:"proxy_connect_timeout" api:"nullable"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout CDNResourceRuleOptionsProxyReadTimeout `json:"proxy_read_timeout" api:"nullable"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist CDNResourceRuleOptionsQueryParamsBlacklist `json:"query_params_blacklist" api:"nullable"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist CDNResourceRuleOptionsQueryParamsWhitelist `json:"query_params_whitelist" api:"nullable"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding CDNResourceRuleOptionsQueryStringForwarding `json:"query_string_forwarding" api:"nullable"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS CDNResourceRuleOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https" api:"nullable"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP CDNResourceRuleOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http" api:"nullable"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL CDNResourceRuleOptionsReferrerACL `json:"referrer_acl" api:"nullable"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy CDNResourceRuleOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy" api:"nullable"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite CDNResourceRuleOptionsRewrite `json:"rewrite" api:"nullable"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey CDNResourceRuleOptionsSecureKey `json:"secure_key" api:"nullable"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice CDNResourceRuleOptionsSlice `json:"slice" api:"nullable"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni CDNResourceRuleOptionsSni `json:"sni" api:"nullable"`
	// Serves stale cached content in case of origin unavailability.
	Stale CDNResourceRuleOptionsStale `json:"stale" api:"nullable"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders CDNResourceRuleOptionsStaticResponseHeaders `json:"static_response_headers" api:"nullable"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders CDNResourceRuleOptionsStaticHeaders `json:"staticHeaders" api:"nullable"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders CDNResourceRuleOptionsStaticRequestHeaders `json:"staticRequestHeaders" api:"nullable"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL CDNResourceRuleOptionsUserAgentACL `json:"user_agent_acl" api:"nullable"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap CDNResourceRuleOptionsWaap `json:"waap" api:"nullable"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets CDNResourceRuleOptionsWebsockets `json:"websockets" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowedHTTPMethods          respjson.Field
		BrotliCompression           respjson.Field
		BrowserCacheSettings        respjson.Field
		CacheHTTPHeaders            respjson.Field
		Cors                        respjson.Field
		CountryACL                  respjson.Field
		DisableCache                respjson.Field
		DisableProxyForceRanges     respjson.Field
		EdgeCacheSettings           respjson.Field
		Fastedge                    respjson.Field
		FetchCompressed             respjson.Field
		FollowOriginRedirect        respjson.Field
		ForceReturn                 respjson.Field
		ForwardHostHeader           respjson.Field
		GzipOn                      respjson.Field
		HostHeader                  respjson.Field
		IgnoreCookie                respjson.Field
		IgnoreQueryString           respjson.Field
		ImageStack                  respjson.Field
		IPAddressACL                respjson.Field
		LimitBandwidth              respjson.Field
		ProxyCacheKey               respjson.Field
		ProxyCacheMethodsSet        respjson.Field
		ProxyConnectTimeout         respjson.Field
		ProxyReadTimeout            respjson.Field
		QueryParamsBlacklist        respjson.Field
		QueryParamsWhitelist        respjson.Field
		QueryStringForwarding       respjson.Field
		RedirectHTTPToHTTPS         respjson.Field
		RedirectHTTPSToHTTP         respjson.Field
		ReferrerACL                 respjson.Field
		ResponseHeadersHidingPolicy respjson.Field
		Rewrite                     respjson.Field
		SecureKey                   respjson.Field
		Slice                       respjson.Field
		Sni                         respjson.Field
		Stale                       respjson.Field
		StaticResponseHeaders       respjson.Field
		StaticHeaders               respjson.Field
		StaticRequestHeaders        respjson.Field
		UserAgentACL                respjson.Field
		Waap                        respjson.Field
		Websockets                  respjson.Field
		ExtraFields                 map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of options that can be configured for the rule.

In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.

func (CDNResourceRuleOptions) RawJSON added in v0.31.0

func (r CDNResourceRuleOptions) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptions) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsAllowedHTTPMethods added in v0.31.0

type CDNResourceRuleOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

HTTP methods allowed for content requests from the CDN.

func (CDNResourceRuleOptionsAllowedHTTPMethods) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsAllowedHTTPMethods) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsBrotliCompression added in v0.31.0

type CDNResourceRuleOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

func (CDNResourceRuleOptionsBrotliCompression) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsBrotliCompression) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsBrotliCompression) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsBrowserCacheSettings added in v0.31.0

type CDNResourceRuleOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

func (CDNResourceRuleOptionsBrowserCacheSettings) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsBrowserCacheSettings) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsCacheHTTPHeaders deprecated added in v0.31.0

type CDNResourceRuleOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

func (CDNResourceRuleOptionsCacheHTTPHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsCacheHTTPHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsCors added in v0.31.0

type CDNResourceRuleOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always bool `json:"always"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		Always      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

func (CDNResourceRuleOptionsCors) RawJSON added in v0.31.0

func (r CDNResourceRuleOptionsCors) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsCors) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsCors) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsCountryACL added in v0.31.0

type CDNResourceRuleOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables control access to content for specified countries.

func (CDNResourceRuleOptionsCountryACL) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsCountryACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsCountryACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsDisableCache deprecated added in v0.31.0

type CDNResourceRuleOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

func (CDNResourceRuleOptionsDisableCache) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsDisableCache) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsDisableCache) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsDisableProxyForceRanges added in v0.31.0

type CDNResourceRuleOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows 206 responses regardless of the settings of an origin source.

func (CDNResourceRuleOptionsDisableProxyForceRanges) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsDisableProxyForceRanges) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsEdgeCacheSettings added in v0.31.0

type CDNResourceRuleOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values" format:"nginx time"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default string `json:"default" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" format:"nginx time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled      respjson.Field
		CustomValues respjson.Field
		Default      respjson.Field
		Value        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

func (CDNResourceRuleOptionsEdgeCacheSettings) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsEdgeCacheSettings) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsFastedge added in v0.31.0

type CDNResourceRuleOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody CDNResourceRuleOptionsFastedgeOnRequestBody `json:"on_request_body"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders CDNResourceRuleOptionsFastedgeOnRequestHeaders `json:"on_request_headers"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache CDNResourceRuleOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody CDNResourceRuleOptionsFastedgeOnResponseBody `json:"on_response_body"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders CDNResourceRuleOptionsFastedgeOnResponseHeaders `json:"on_response_headers"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled                    respjson.Field
		OnRequestBody              respjson.Field
		OnRequestHeaders           respjson.Field
		OnRequestHeadersAfterCache respjson.Field
		OnResponseBody             respjson.Field
		OnResponseHeaders          respjson.Field
		ExtraFields                map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

func (CDNResourceRuleOptionsFastedge) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsFastedge) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsFastedge) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsFastedgeOnRequestBody added in v0.31.0

type CDNResourceRuleOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

func (CDNResourceRuleOptionsFastedgeOnRequestBody) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsFastedgeOnRequestBody) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsFastedgeOnRequestHeaders added in v0.31.0

type CDNResourceRuleOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

func (CDNResourceRuleOptionsFastedgeOnRequestHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type CDNResourceRuleOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

func (CDNResourceRuleOptionsFastedgeOnRequestHeadersAfterCache) RawJSON added in v0.50.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type CDNResourceRuleOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceRuleOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

func (CDNResourceRuleOptionsFastedgeOnResponseBody) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsFastedgeOnResponseBody) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsFastedgeOnResponseHeaders added in v0.31.0

type CDNResourceRuleOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

func (CDNResourceRuleOptionsFastedgeOnResponseHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsFastedgeOnResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleOptionsFetchCompressed added in v0.31.0

type CDNResourceRuleOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

func (CDNResourceRuleOptionsFetchCompressed) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsFetchCompressed) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsFetchCompressed) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsFollowOriginRedirect added in v0.31.0

type CDNResourceRuleOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Codes       respjson.Field
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

func (CDNResourceRuleOptionsFollowOriginRedirect) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsFollowOriginRedirect) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsForceReturn added in v0.31.0

type CDNResourceRuleOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval CDNResourceRuleOptionsForceReturnTimeInterval `json:"time_interval" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Body         respjson.Field
		Code         respjson.Field
		Enabled      respjson.Field
		TimeInterval respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

func (CDNResourceRuleOptionsForceReturn) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsForceReturn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsForceReturn) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsForceReturnTimeInterval added in v0.31.0

type CDNResourceRuleOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone string `json:"time_zone" format:"timezone"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EndTime     respjson.Field
		StartTime   respjson.Field
		TimeZone    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

func (CDNResourceRuleOptionsForceReturnTimeInterval) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsForceReturnTimeInterval) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsForwardHostHeader added in v0.31.0

type CDNResourceRuleOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

func (CDNResourceRuleOptionsForwardHostHeader) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsForwardHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsForwardHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsGzipOn added in v0.31.0

type CDNResourceRuleOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

func (CDNResourceRuleOptionsGzipOn) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsGzipOn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsGzipOn) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsHostHeader added in v0.31.0

type CDNResourceRuleOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

func (CDNResourceRuleOptionsHostHeader) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsIPAddressACL added in v0.31.0

type CDNResourceRuleOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

func (CDNResourceRuleOptionsIPAddressACL) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsIPAddressACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsIPAddressACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsIgnoreCookie added in v0.31.0

type CDNResourceRuleOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

func (CDNResourceRuleOptionsIgnoreCookie) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsIgnoreCookie) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsIgnoreCookie) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsIgnoreQueryString added in v0.31.0

type CDNResourceRuleOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

func (CDNResourceRuleOptionsIgnoreQueryString) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsIgnoreQueryString) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsImageStack added in v0.31.0

type CDNResourceRuleOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled bool `json:"avif_enabled"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless bool `json:"png_lossless"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality int64 `json:"quality"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled bool `json:"webp_enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		AvifEnabled respjson.Field
		PngLossless respjson.Field
		Quality     respjson.Field
		WebpEnabled respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

func (CDNResourceRuleOptionsImageStack) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsImageStack) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsImageStack) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsLimitBandwidth added in v0.31.0

type CDNResourceRuleOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer int64 `json:"buffer"`
	// Maximum download speed per connection.
	Speed int64 `json:"speed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		LimitType   respjson.Field
		Buffer      respjson.Field
		Speed       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to control the download speed per connection.

func (CDNResourceRuleOptionsLimitBandwidth) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsLimitBandwidth) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsLimitBandwidth) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsProxyCacheKey added in v0.31.0

type CDNResourceRuleOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

func (CDNResourceRuleOptionsProxyCacheKey) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsProxyCacheKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsProxyCacheKey) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsProxyCacheMethodsSet added in v0.31.0

type CDNResourceRuleOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Caching for POST requests along with default GET and HEAD.

func (CDNResourceRuleOptionsProxyCacheMethodsSet) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsProxyCacheMethodsSet) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsProxyConnectTimeout added in v0.31.0

type CDNResourceRuleOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The time limit for establishing a connection with the origin.

func (CDNResourceRuleOptionsProxyConnectTimeout) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsProxyConnectTimeout) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsProxyReadTimeout added in v0.31.0

type CDNResourceRuleOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

func (CDNResourceRuleOptionsProxyReadTimeout) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsProxyReadTimeout) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsQueryParamsBlacklist added in v0.31.0

type CDNResourceRuleOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

func (CDNResourceRuleOptionsQueryParamsBlacklist) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsQueryParamsBlacklist) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsQueryParamsWhitelist added in v0.31.0

type CDNResourceRuleOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

func (CDNResourceRuleOptionsQueryParamsWhitelist) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsQueryParamsWhitelist) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsQueryStringForwarding added in v0.31.0

type CDNResourceRuleOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled              respjson.Field
		ForwardFromFileTypes respjson.Field
		ForwardToFileTypes   respjson.Field
		ForwardExceptKeys    respjson.Field
		ForwardOnlyKeys      respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

func (CDNResourceRuleOptionsQueryStringForwarding) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsQueryStringForwarding) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsRedirectHTTPSToHTTP added in v0.31.0

type CDNResourceRuleOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

func (CDNResourceRuleOptionsRedirectHTTPSToHTTP) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsRedirectHTTPSToHTTP) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsRedirectHTTPToHTTPS added in v0.31.0

type CDNResourceRuleOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

func (CDNResourceRuleOptionsRedirectHTTPToHTTPS) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsRedirectHTTPToHTTPS) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsReferrerACL added in v0.31.0

type CDNResourceRuleOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls access to the CDN resource content for specified domain names.

func (CDNResourceRuleOptionsReferrerACL) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsReferrerACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsReferrerACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsResponseHeadersHidingPolicy added in v0.31.0

type CDNResourceRuleOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Excepted    respjson.Field
		Mode        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Hides HTTP headers from an origin server in the CDN response.

func (CDNResourceRuleOptionsResponseHeadersHidingPolicy) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsResponseHeadersHidingPolicy) UnmarshalJSON added in v0.31.0

type CDNResourceRuleOptionsRewrite added in v0.31.0

type CDNResourceRuleOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Body        respjson.Field
		Enabled     respjson.Field
		Flag        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

func (CDNResourceRuleOptionsRewrite) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsRewrite) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsRewrite) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsSecureKey added in v0.31.0

type CDNResourceRuleOptionsSecureKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key generated on your side that will be used for URL signing.
	Key string `json:"key" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Key         respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

func (CDNResourceRuleOptionsSecureKey) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsSecureKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsSecureKey) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsSlice added in v0.31.0

type CDNResourceRuleOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

func (CDNResourceRuleOptionsSlice) RawJSON added in v0.31.0

func (r CDNResourceRuleOptionsSlice) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsSlice) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsSlice) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsSni added in v0.31.0

type CDNResourceRuleOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomHostname respjson.Field
		Enabled        respjson.Field
		SniType        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

func (CDNResourceRuleOptionsSni) RawJSON added in v0.31.0

func (r CDNResourceRuleOptionsSni) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsSni) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsSni) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsStale added in v0.31.0

type CDNResourceRuleOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Serves stale cached content in case of origin unavailability.

func (CDNResourceRuleOptionsStale) RawJSON added in v0.31.0

func (r CDNResourceRuleOptionsStale) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsStale) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsStale) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsStaticHeaders deprecated added in v0.31.0

type CDNResourceRuleOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

func (CDNResourceRuleOptionsStaticHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsStaticHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsStaticHeaders) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsStaticRequestHeaders added in v0.31.0

type CDNResourceRuleOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

func (CDNResourceRuleOptionsStaticRequestHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsStaticRequestHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsStaticResponseHeaders added in v0.31.0

type CDNResourceRuleOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                               `json:"enabled" api:"required"`
	Value   []CDNResourceRuleOptionsStaticResponseHeadersValue `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Custom HTTP Headers that a CDN server adds to a response.

func (CDNResourceRuleOptionsStaticResponseHeaders) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsStaticResponseHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsStaticResponseHeadersValue added in v0.31.0

type CDNResourceRuleOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always bool `json:"always"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Value       respjson.Field
		Always      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNResourceRuleOptionsStaticResponseHeadersValue) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsStaticResponseHeadersValue) UnmarshalJSON added in v0.31.0

type CDNResourceRuleOptionsUserAgentACL added in v0.31.0

type CDNResourceRuleOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls access to the content for specified User-Agents.

func (CDNResourceRuleOptionsUserAgentACL) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsUserAgentACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsUserAgentACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsWaap added in v0.31.0

type CDNResourceRuleOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to enable WAAP (Web Application and API Protection).

func (CDNResourceRuleOptionsWaap) RawJSON added in v0.31.0

func (r CDNResourceRuleOptionsWaap) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsWaap) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsWaap) UnmarshalJSON(data []byte) error

type CDNResourceRuleOptionsWebsockets added in v0.31.0

type CDNResourceRuleOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables or disables WebSockets connections to an origin server.

func (CDNResourceRuleOptionsWebsockets) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsWebsockets) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsWebsockets) UnmarshalJSON(data []byte) error

type CDNResourceRuleOriginProtocol added in v0.31.0

type CDNResourceRuleOriginProtocol string

Protocol used by CDN servers to request content from an origin source.

Possible values:

  • **HTTPS** - CDN servers connect to origin via HTTPS protocol.
  • **HTTP** - CDN servers connect to origin via HTTP protocol.
  • **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
const (
	CDNResourceRuleOriginProtocolHTTPS CDNResourceRuleOriginProtocol = "HTTPS"
	CDNResourceRuleOriginProtocolHTTP  CDNResourceRuleOriginProtocol = "HTTP"
	CDNResourceRuleOriginProtocolMatch CDNResourceRuleOriginProtocol = "MATCH"
)

type CDNResourceRuleOverrideOriginProtocol added in v0.31.0

type CDNResourceRuleOverrideOriginProtocol string

Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.

Possible values:

  • **HTTPS** - CDN servers connect to origin via HTTPS protocol.
  • **HTTP** - CDN servers connect to origin via HTTP protocol.
  • **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
  • **null** - `originProtocol` setting is inherited from the CDN resource settings.

If an enabled origin among the origins this rule pulls from is bound to a Gcore Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.

const (
	CDNResourceRuleOverrideOriginProtocolHTTPS CDNResourceRuleOverrideOriginProtocol = "HTTPS"
	CDNResourceRuleOverrideOriginProtocolHTTP  CDNResourceRuleOverrideOriginProtocol = "HTTP"
	CDNResourceRuleOverrideOriginProtocolMatch CDNResourceRuleOverrideOriginProtocol = "MATCH"
)

type CDNResourceRuleReplaceParams added in v0.31.0

type CDNResourceRuleReplaceParams struct {
	ResourceID int64 `path:"resource_id" api:"required" json:"-"`
	// Path to the file or folder for which the rule will be applied.
	//
	// The rule is applied if the requested URI matches the rule path.
	//
	// We add a leading forward slash to any rule path. Specify a path without a
	// forward slash.
	Rule string `json:"rule" api:"required"`
	// Rule type.
	//
	// Possible values:
	//
	//   - **Type 0** - Regular expression. Must start with '^/' or '/'.
	//   - **Type 1** - Regular expression. Note that for this rule type we automatically
	//     add / to each rule pattern before your regular expression. This type is
	//     **legacy**, please use Type 0.
	RuleType int64 `json:"ruleType" api:"required"`
	// ID of the origin group to which the rule is applied.
	//
	// If the origin group is not specified, the rule is applied to the origin group
	// that the CDN resource is associated with.
	OriginGroup param.Opt[int64] `json:"originGroup,omitzero"`
	// Enables or disables a rule.
	//
	// Possible values:
	//
	// - **true** - Rule is active, rule settings are applied.
	// - **false** - Rule is inactive, rule settings are not applied.
	Active param.Opt[bool] `json:"active,omitzero"`
	// Rule name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Rule execution order: from lowest (1) to highest.
	//
	// If requested URI matches multiple rules, the one higher in the order of the
	// rules will be applied.
	Weight param.Opt[int64] `json:"weight,omitzero"`
	// Sets a protocol other than the one specified in the CDN resource settings to
	// connect to the origin.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
	//   - **HTTP** - CDN servers connect to origin via HTTP protocol.
	//   - **MATCH** - Connection protocol is chosen automatically; in this case, content
	//     on origin source should be available for the CDN both through HTTP and HTTPS
	//     protocols.
	//   - **null** - `originProtocol` setting is inherited from the CDN resource
	//     settings.
	//
	// If an enabled origin among the origins this rule pulls from is bound to a Gcore
	// Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OverrideOriginProtocol CDNResourceRuleReplaceParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
	// List of options that can be configured for the rule.
	//
	// In case of `null` value the option is not added to the rule. Option inherits its
	// value from the CDN resource settings.
	Options CDNResourceRuleReplaceParamsOptions `json:"options,omitzero"`
	// contains filtered or unexported fields
}

func (CDNResourceRuleReplaceParams) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParams) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParams) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParams) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptions added in v0.31.0

type CDNResourceRuleReplaceParamsOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods CDNResourceRuleReplaceParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression CDNResourceRuleReplaceParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings CDNResourceRuleReplaceParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders CDNResourceRuleReplaceParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors CDNResourceRuleReplaceParamsOptionsCors `json:"cors,omitzero"`
	// Enables control access to content for specified countries.
	CountryACL CDNResourceRuleReplaceParamsOptionsCountryACL `json:"country_acl,omitzero"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache CDNResourceRuleReplaceParamsOptionsDisableCache `json:"disable_cache,omitzero"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges CDNResourceRuleReplaceParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings CDNResourceRuleReplaceParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge CDNResourceRuleReplaceParamsOptionsFastedge `json:"fastedge,omitzero"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed CDNResourceRuleReplaceParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect CDNResourceRuleReplaceParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn CDNResourceRuleReplaceParamsOptionsForceReturn `json:"force_return,omitzero"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader CDNResourceRuleReplaceParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn CDNResourceRuleReplaceParamsOptionsGzipOn `json:"gzipOn,omitzero"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader CDNResourceRuleReplaceParamsOptionsHostHeader `json:"hostHeader,omitzero"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie CDNResourceRuleReplaceParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString CDNResourceRuleReplaceParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack CDNResourceRuleReplaceParamsOptionsImageStack `json:"image_stack,omitzero"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL CDNResourceRuleReplaceParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
	// Allows to control the download speed per connection.
	LimitBandwidth CDNResourceRuleReplaceParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey CDNResourceRuleReplaceParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet CDNResourceRuleReplaceParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout CDNResourceRuleReplaceParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout CDNResourceRuleReplaceParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist CDNResourceRuleReplaceParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist CDNResourceRuleReplaceParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding CDNResourceRuleReplaceParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS CDNResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP CDNResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL CDNResourceRuleReplaceParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy CDNResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite CDNResourceRuleReplaceParamsOptionsRewrite `json:"rewrite,omitzero"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey CDNResourceRuleReplaceParamsOptionsSecureKey `json:"secure_key,omitzero"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice CDNResourceRuleReplaceParamsOptionsSlice `json:"slice,omitzero"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni CDNResourceRuleReplaceParamsOptionsSni `json:"sni,omitzero"`
	// Serves stale cached content in case of origin unavailability.
	Stale CDNResourceRuleReplaceParamsOptionsStale `json:"stale,omitzero"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders CDNResourceRuleReplaceParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders CDNResourceRuleReplaceParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders CDNResourceRuleReplaceParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL CDNResourceRuleReplaceParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap CDNResourceRuleReplaceParamsOptionsWaap `json:"waap,omitzero"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets CDNResourceRuleReplaceParamsOptionsWebsockets `json:"websockets,omitzero"`
	// contains filtered or unexported fields
}

List of options that can be configured for the rule.

In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.

func (CDNResourceRuleReplaceParamsOptions) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptions) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptions) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsAllowedHTTPMethods added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

HTTP methods allowed for content requests from the CDN.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsAllowedHTTPMethods) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsBrotliCompression added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsBrotliCompression) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsBrotliCompression) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsBrowserCacheSettings added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsBrowserCacheSettings) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsBrowserCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsCacheHTTPHeaders deprecated added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsCacheHTTPHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsCors added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsCors) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsCors) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsCors) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsCors) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsCountryACL added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Enables control access to content for specified countries.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleReplaceParamsOptionsCountryACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsCountryACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsCountryACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsDisableCache deprecated added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsDisableCache) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsDisableCache) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsDisableProxyForceRanges added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows 206 responses regardless of the settings of an origin source.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsDisableProxyForceRanges) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsDisableProxyForceRanges) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsEdgeCacheSettings added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

The property Enabled is required.

func (CDNResourceRuleReplaceParamsOptionsEdgeCacheSettings) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsEdgeCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedge added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

The property Enabled is required.

func (CDNResourceRuleReplaceParamsOptionsFastedge) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsFastedge) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsFastedge) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsFastedge) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestBody added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

The property AppID is required.

func (CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestBody) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestBody) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

The property AppID is required.

func (CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

The property AppID is required.

func (CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache) MarshalJSON added in v0.50.0

func (*CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseBody) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseBody) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFetchCompressed added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsFetchCompressed) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsFetchCompressed) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFollowOriginRedirect added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

The properties Codes, Enabled are required.

func (CDNResourceRuleReplaceParamsOptionsFollowOriginRedirect) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsFollowOriginRedirect) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsForceReturn added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval CDNResourceRuleReplaceParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
	// contains filtered or unexported fields
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

The properties Body, Code, Enabled are required.

func (CDNResourceRuleReplaceParamsOptionsForceReturn) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsForceReturn) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsForceReturnTimeInterval added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
	// contains filtered or unexported fields
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

The properties EndTime, StartTime are required.

func (CDNResourceRuleReplaceParamsOptionsForceReturnTimeInterval) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsForceReturnTimeInterval) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsForwardHostHeader added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsForwardHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsForwardHostHeader) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsGzipOn added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsGzipOn) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsGzipOn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsGzipOn) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsHostHeader added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsIPAddressACL added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleReplaceParamsOptionsIPAddressACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsIPAddressACL) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsIgnoreCookie added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsIgnoreCookie) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsIgnoreCookie) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsIgnoreQueryString added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsIgnoreQueryString) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsIgnoreQueryString) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsImageStack added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality param.Opt[int64] `json:"quality,omitzero"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
	// contains filtered or unexported fields
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

The property Enabled is required.

func (CDNResourceRuleReplaceParamsOptionsImageStack) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsImageStack) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsImageStack) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsImageStack) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsLimitBandwidth added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type,omitzero" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer param.Opt[int64] `json:"buffer,omitzero"`
	// Maximum download speed per connection.
	Speed param.Opt[int64] `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

Allows to control the download speed per connection.

The properties Enabled, LimitType are required.

func (CDNResourceRuleReplaceParamsOptionsLimitBandwidth) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsLimitBandwidth) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsProxyCacheKey added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsProxyCacheKey) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsProxyCacheKey) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsProxyCacheMethodsSet added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Caching for POST requests along with default GET and HEAD.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsProxyCacheMethodsSet) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsProxyConnectTimeout added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for establishing a connection with the origin.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsProxyConnectTimeout) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsProxyConnectTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsProxyReadTimeout added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsProxyReadTimeout) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsProxyReadTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsQueryParamsBlacklist added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsQueryParamsBlacklist) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsQueryParamsWhitelist added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsQueryParamsWhitelist) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsQueryStringForwarding added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types,omitzero" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
	// contains filtered or unexported fields
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.

func (CDNResourceRuleReplaceParamsOptionsQueryStringForwarding) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsQueryStringForwarding) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsReferrerACL added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specified domain names.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleReplaceParamsOptionsReferrerACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsReferrerACL) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted,omitzero" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Hides HTTP headers from an origin server in the CDN response.

The properties Enabled, Excepted, Mode are required.

func (CDNResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsRewrite added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag,omitzero"`
	// contains filtered or unexported fields
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

The properties Body, Enabled are required.

func (CDNResourceRuleReplaceParamsOptionsRewrite) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsRewrite) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsRewrite) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsRewrite) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsSecureKey added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsSecureKey struct {
	// Key generated on your side that will be used for URL signing.
	Key param.Opt[string] `json:"key,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

The properties Enabled, Key are required.

func (CDNResourceRuleReplaceParamsOptionsSecureKey) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsSecureKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsSecureKey) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsSlice added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsSlice) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsSlice) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsSlice) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsSlice) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsSni added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type,omitzero"`
	// contains filtered or unexported fields
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

The properties CustomHostname, Enabled are required.

func (CDNResourceRuleReplaceParamsOptionsSni) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsSni) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsSni) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsSni) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsStale added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Serves stale cached content in case of origin unavailability.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsStale) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsStale) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsStale) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsStale) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsStaticHeaders deprecated added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsStaticHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsStaticHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsStaticRequestHeaders added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsStaticRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsStaticRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsStaticResponseHeaders added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                                            `json:"enabled" api:"required"`
	Value   []CDNResourceRuleReplaceParamsOptionsStaticResponseHeadersValue `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers that a CDN server adds to a response.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsStaticResponseHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsStaticResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsStaticResponseHeadersValue added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (CDNResourceRuleReplaceParamsOptionsStaticResponseHeadersValue) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsStaticResponseHeadersValue) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsUserAgentACL added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the content for specified User-Agents.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleReplaceParamsOptionsUserAgentACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsUserAgentACL) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsWaap added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows to enable WAAP (Web Application and API Protection).

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsWaap) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsWaap) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsWaap) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsWaap) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOptionsWebsockets added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables or disables WebSockets connections to an origin server.

The properties Enabled, Value are required.

func (CDNResourceRuleReplaceParamsOptionsWebsockets) MarshalJSON added in v0.31.0

func (r CDNResourceRuleReplaceParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleReplaceParamsOptionsWebsockets) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleReplaceParamsOptionsWebsockets) UnmarshalJSON(data []byte) error

type CDNResourceRuleReplaceParamsOverrideOriginProtocol added in v0.31.0

type CDNResourceRuleReplaceParamsOverrideOriginProtocol string

Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.

Possible values:

  • **HTTPS** - CDN servers connect to origin via HTTPS protocol.
  • **HTTP** - CDN servers connect to origin via HTTP protocol.
  • **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
  • **null** - `originProtocol` setting is inherited from the CDN resource settings.

If an enabled origin among the origins this rule pulls from is bound to a Gcore Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.

const (
	CDNResourceRuleReplaceParamsOverrideOriginProtocolHTTPS CDNResourceRuleReplaceParamsOverrideOriginProtocol = "HTTPS"
	CDNResourceRuleReplaceParamsOverrideOriginProtocolHTTP  CDNResourceRuleReplaceParamsOverrideOriginProtocol = "HTTP"
	CDNResourceRuleReplaceParamsOverrideOriginProtocolMatch CDNResourceRuleReplaceParamsOverrideOriginProtocol = "MATCH"
)

type CDNResourceRuleService added in v0.31.0

type CDNResourceRuleService struct {
	Options []option.RequestOption
}

CDN resource rules set custom caching, delivery, and security options for specific URL patterns or file types.

CDNResourceRuleService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCDNResourceRuleService method instead.

func NewCDNResourceRuleService added in v0.31.0

func NewCDNResourceRuleService(opts ...option.RequestOption) (r CDNResourceRuleService)

NewCDNResourceRuleService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CDNResourceRuleService) Delete added in v0.31.0

Delete the rule from the system permanently.

Notes:

  • **Deactivation Requirement**: Set the `active` attribute to `false` before deletion.
  • **Irreversibility**: This action is irreversible. Once deleted, the rule cannot be recovered.

func (*CDNResourceRuleService) Get added in v0.31.0

Get rule details

func (*CDNResourceRuleService) List added in v0.31.0

Get rules list

func (*CDNResourceRuleService) ListAutoPaging added in v0.41.0

Get rules list

func (*CDNResourceRuleService) New added in v0.31.0

Create rule

func (*CDNResourceRuleService) Replace added in v0.31.0

Change rule

func (*CDNResourceRuleService) Update added in v0.31.0

Change rule

type CDNResourceRuleUpdateParams added in v0.31.0

type CDNResourceRuleUpdateParams struct {
	ResourceID int64 `path:"resource_id" api:"required" json:"-"`
	// ID of the origin group to which the rule is applied.
	//
	// If the origin group is not specified, the rule is applied to the origin group
	// that the CDN resource is associated with.
	OriginGroup param.Opt[int64] `json:"originGroup,omitzero"`
	// Enables or disables a rule.
	//
	// Possible values:
	//
	// - **true** - Rule is active, rule settings are applied.
	// - **false** - Rule is inactive, rule settings are not applied.
	Active param.Opt[bool] `json:"active,omitzero"`
	// Rule name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Path to the file or folder for which the rule will be applied.
	//
	// The rule is applied if the requested URI matches the rule path.
	//
	// We add a leading forward slash to any rule path. Specify a path without a
	// forward slash.
	Rule param.Opt[string] `json:"rule,omitzero"`
	// Rule type.
	//
	// Possible values:
	//
	//   - **Type 0** - Regular expression. Must start with '^/' or '/'.
	//   - **Type 1** - Regular expression. Note that for this rule type we automatically
	//     add / to each rule pattern before your regular expression. This type is
	//     **legacy**, please use Type 0.
	RuleType param.Opt[int64] `json:"ruleType,omitzero"`
	// Rule execution order: from lowest (1) to highest.
	//
	// If requested URI matches multiple rules, the one higher in the order of the
	// rules will be applied.
	Weight param.Opt[int64] `json:"weight,omitzero"`
	// Sets a protocol other than the one specified in the CDN resource settings to
	// connect to the origin.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
	//   - **HTTP** - CDN servers connect to origin via HTTP protocol.
	//   - **MATCH** - Connection protocol is chosen automatically; in this case, content
	//     on origin source should be available for the CDN both through HTTP and HTTPS
	//     protocols.
	//   - **null** - `originProtocol` setting is inherited from the CDN resource
	//     settings.
	//
	// If an enabled origin among the origins this rule pulls from is bound to a Gcore
	// Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OverrideOriginProtocol CDNResourceRuleUpdateParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
	// List of options that can be configured for the rule.
	//
	// In case of `null` value the option is not added to the rule. Option inherits its
	// value from the CDN resource settings.
	Options CDNResourceRuleUpdateParamsOptions `json:"options,omitzero"`
	// contains filtered or unexported fields
}

func (CDNResourceRuleUpdateParams) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParams) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParams) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParams) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptions added in v0.31.0

type CDNResourceRuleUpdateParamsOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods CDNResourceRuleUpdateParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression CDNResourceRuleUpdateParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings CDNResourceRuleUpdateParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders CDNResourceRuleUpdateParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors CDNResourceRuleUpdateParamsOptionsCors `json:"cors,omitzero"`
	// Enables control access to content for specified countries.
	CountryACL CDNResourceRuleUpdateParamsOptionsCountryACL `json:"country_acl,omitzero"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache CDNResourceRuleUpdateParamsOptionsDisableCache `json:"disable_cache,omitzero"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges CDNResourceRuleUpdateParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings CDNResourceRuleUpdateParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge CDNResourceRuleUpdateParamsOptionsFastedge `json:"fastedge,omitzero"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed CDNResourceRuleUpdateParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect CDNResourceRuleUpdateParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn CDNResourceRuleUpdateParamsOptionsForceReturn `json:"force_return,omitzero"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader CDNResourceRuleUpdateParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn CDNResourceRuleUpdateParamsOptionsGzipOn `json:"gzipOn,omitzero"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader CDNResourceRuleUpdateParamsOptionsHostHeader `json:"hostHeader,omitzero"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie CDNResourceRuleUpdateParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString CDNResourceRuleUpdateParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack CDNResourceRuleUpdateParamsOptionsImageStack `json:"image_stack,omitzero"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL CDNResourceRuleUpdateParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
	// Allows to control the download speed per connection.
	LimitBandwidth CDNResourceRuleUpdateParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey CDNResourceRuleUpdateParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet CDNResourceRuleUpdateParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout CDNResourceRuleUpdateParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout CDNResourceRuleUpdateParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist CDNResourceRuleUpdateParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist CDNResourceRuleUpdateParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding CDNResourceRuleUpdateParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS CDNResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP CDNResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL CDNResourceRuleUpdateParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy CDNResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite CDNResourceRuleUpdateParamsOptionsRewrite `json:"rewrite,omitzero"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey CDNResourceRuleUpdateParamsOptionsSecureKey `json:"secure_key,omitzero"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice CDNResourceRuleUpdateParamsOptionsSlice `json:"slice,omitzero"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni CDNResourceRuleUpdateParamsOptionsSni `json:"sni,omitzero"`
	// Serves stale cached content in case of origin unavailability.
	Stale CDNResourceRuleUpdateParamsOptionsStale `json:"stale,omitzero"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders CDNResourceRuleUpdateParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders CDNResourceRuleUpdateParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders CDNResourceRuleUpdateParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL CDNResourceRuleUpdateParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap CDNResourceRuleUpdateParamsOptionsWaap `json:"waap,omitzero"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets CDNResourceRuleUpdateParamsOptionsWebsockets `json:"websockets,omitzero"`
	// contains filtered or unexported fields
}

List of options that can be configured for the rule.

In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.

func (CDNResourceRuleUpdateParamsOptions) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptions) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptions) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsAllowedHTTPMethods added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

HTTP methods allowed for content requests from the CDN.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsAllowedHTTPMethods) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsBrotliCompression added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsBrotliCompression) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsBrotliCompression) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsBrowserCacheSettings added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsBrowserCacheSettings) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsBrowserCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsCacheHTTPHeaders deprecated added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsCacheHTTPHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsCors added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsCors) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsCors) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsCors) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsCors) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsCountryACL added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Enables control access to content for specified countries.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleUpdateParamsOptionsCountryACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsCountryACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsCountryACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsDisableCache deprecated added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsDisableCache) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsDisableCache) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsDisableProxyForceRanges added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows 206 responses regardless of the settings of an origin source.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsDisableProxyForceRanges) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsDisableProxyForceRanges) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsEdgeCacheSettings added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

The property Enabled is required.

func (CDNResourceRuleUpdateParamsOptionsEdgeCacheSettings) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsEdgeCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedge added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

The property Enabled is required.

func (CDNResourceRuleUpdateParamsOptionsFastedge) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsFastedge) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsFastedge) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsFastedge) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestBody added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

The property AppID is required.

func (CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestBody) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

The property AppID is required.

func (CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

The property AppID is required.

func (CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache) MarshalJSON added in v0.50.0

func (*CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseBody) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseBody) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFetchCompressed added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsFetchCompressed) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsFetchCompressed) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFollowOriginRedirect added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

The properties Codes, Enabled are required.

func (CDNResourceRuleUpdateParamsOptionsFollowOriginRedirect) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsFollowOriginRedirect) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsForceReturn added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval CDNResourceRuleUpdateParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
	// contains filtered or unexported fields
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

The properties Body, Code, Enabled are required.

func (CDNResourceRuleUpdateParamsOptionsForceReturn) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsForceReturn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsForceReturn) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsForceReturnTimeInterval added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
	// contains filtered or unexported fields
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

The properties EndTime, StartTime are required.

func (CDNResourceRuleUpdateParamsOptionsForceReturnTimeInterval) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsForceReturnTimeInterval) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsForwardHostHeader added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsForwardHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsForwardHostHeader) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsGzipOn added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsGzipOn) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsGzipOn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsGzipOn) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsHostHeader added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsIPAddressACL added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleUpdateParamsOptionsIPAddressACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsIPAddressACL) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsIgnoreCookie added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsIgnoreCookie) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsIgnoreCookie) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsIgnoreQueryString added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsIgnoreQueryString) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsIgnoreQueryString) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsImageStack added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality param.Opt[int64] `json:"quality,omitzero"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
	// contains filtered or unexported fields
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

The property Enabled is required.

func (CDNResourceRuleUpdateParamsOptionsImageStack) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsImageStack) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsImageStack) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsImageStack) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsLimitBandwidth added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type,omitzero" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer param.Opt[int64] `json:"buffer,omitzero"`
	// Maximum download speed per connection.
	Speed param.Opt[int64] `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

Allows to control the download speed per connection.

The properties Enabled, LimitType are required.

func (CDNResourceRuleUpdateParamsOptionsLimitBandwidth) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsLimitBandwidth) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsProxyCacheKey added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsProxyCacheKey) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsProxyCacheKey) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsProxyCacheMethodsSet added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Caching for POST requests along with default GET and HEAD.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsProxyCacheMethodsSet) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsProxyConnectTimeout added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for establishing a connection with the origin.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsProxyConnectTimeout) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsProxyConnectTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsProxyReadTimeout added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsProxyReadTimeout) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsProxyReadTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsQueryParamsBlacklist added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsQueryParamsBlacklist) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsQueryParamsWhitelist added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsQueryParamsWhitelist) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsQueryStringForwarding added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types,omitzero" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
	// contains filtered or unexported fields
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.

func (CDNResourceRuleUpdateParamsOptionsQueryStringForwarding) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsQueryStringForwarding) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsReferrerACL added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specified domain names.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleUpdateParamsOptionsReferrerACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsReferrerACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted,omitzero" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Hides HTTP headers from an origin server in the CDN response.

The properties Enabled, Excepted, Mode are required.

func (CDNResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsRewrite added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag,omitzero"`
	// contains filtered or unexported fields
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

The properties Body, Enabled are required.

func (CDNResourceRuleUpdateParamsOptionsRewrite) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsRewrite) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsRewrite) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsRewrite) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsSecureKey added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsSecureKey struct {
	// Key generated on your side that will be used for URL signing.
	Key param.Opt[string] `json:"key,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

The properties Enabled, Key are required.

func (CDNResourceRuleUpdateParamsOptionsSecureKey) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsSecureKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsSecureKey) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsSlice added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsSlice) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsSlice) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsSlice) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsSlice) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsSni added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type,omitzero"`
	// contains filtered or unexported fields
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

The properties CustomHostname, Enabled are required.

func (CDNResourceRuleUpdateParamsOptionsSni) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsSni) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsSni) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsSni) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsStale added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Serves stale cached content in case of origin unavailability.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsStale) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsStale) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsStale) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsStale) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsStaticHeaders deprecated added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsStaticHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsStaticHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsStaticRequestHeaders added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsStaticRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsStaticRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsStaticResponseHeaders added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                                           `json:"enabled" api:"required"`
	Value   []CDNResourceRuleUpdateParamsOptionsStaticResponseHeadersValue `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers that a CDN server adds to a response.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsStaticResponseHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsStaticResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsStaticResponseHeadersValue added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (CDNResourceRuleUpdateParamsOptionsStaticResponseHeadersValue) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsStaticResponseHeadersValue) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsUserAgentACL added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the content for specified User-Agents.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceRuleUpdateParamsOptionsUserAgentACL) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsUserAgentACL) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsWaap added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows to enable WAAP (Web Application and API Protection).

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsWaap) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsWaap) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsWaap) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsWaap) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOptionsWebsockets added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables or disables WebSockets connections to an origin server.

The properties Enabled, Value are required.

func (CDNResourceRuleUpdateParamsOptionsWebsockets) MarshalJSON added in v0.31.0

func (r CDNResourceRuleUpdateParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)

func (*CDNResourceRuleUpdateParamsOptionsWebsockets) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleUpdateParamsOptionsWebsockets) UnmarshalJSON(data []byte) error

type CDNResourceRuleUpdateParamsOverrideOriginProtocol added in v0.31.0

type CDNResourceRuleUpdateParamsOverrideOriginProtocol string

Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.

Possible values:

  • **HTTPS** - CDN servers connect to origin via HTTPS protocol.
  • **HTTP** - CDN servers connect to origin via HTTP protocol.
  • **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
  • **null** - `originProtocol` setting is inherited from the CDN resource settings.

If an enabled origin among the origins this rule pulls from is bound to a Gcore Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.

const (
	CDNResourceRuleUpdateParamsOverrideOriginProtocolHTTPS CDNResourceRuleUpdateParamsOverrideOriginProtocol = "HTTPS"
	CDNResourceRuleUpdateParamsOverrideOriginProtocolHTTP  CDNResourceRuleUpdateParamsOverrideOriginProtocol = "HTTP"
	CDNResourceRuleUpdateParamsOverrideOriginProtocolMatch CDNResourceRuleUpdateParamsOverrideOriginProtocol = "MATCH"
)

type CDNResourceService added in v0.31.0

type CDNResourceService struct {
	Options []option.RequestOption
	// Origin shielding protects your origin server from being overloaded by routing
	// all CDN requests through a single shield (precache) server for a CDN resource.
	Shield CDNResourceShieldService
	// CDN resource rules set custom caching, delivery, and security options for
	// specific URL patterns or file types.
	Rules CDNResourceRuleService
}

CDNResourceService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCDNResourceService method instead.

func NewCDNResourceService added in v0.31.0

func NewCDNResourceService(opts ...option.RequestOption) (r CDNResourceService)

NewCDNResourceService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CDNResourceService) DeactivateAndDelete added in v0.32.0

func (r *CDNResourceService) DeactivateAndDelete(ctx context.Context, resourceID int64, opts ...option.RequestOption) (err error)

DeactivateAndDelete is a utility method that first deactivates the CDN resource by setting the `active` attribute to `false`, then deletes the resource from the system permanently.

This method is useful because the Delete operation requires the CDN resource to be deactivated first. DeactivateAndDelete handles both steps in a single call.

func (*CDNResourceService) Delete added in v0.31.0

func (r *CDNResourceService) Delete(ctx context.Context, resourceID int64, opts ...option.RequestOption) (err error)

Delete the CDN resource from the system permanently.

Notes:

  • **Deactivation Requirement**: Set the `active` attribute to `false` before deletion.
  • **Statistics Availability**: Statistics will be available for **365 days** after deletion through the [statistics endpoints](/docs/api-reference/cdn/cdn-statistics/cdn-resource-statistics).
  • **Irreversibility**: This action is irreversible. Once deleted, the CDN resource cannot be recovered.

func (*CDNResourceService) Get added in v0.31.0

func (r *CDNResourceService) Get(ctx context.Context, resourceID int64, opts ...option.RequestOption) (res *CDNResource, err error)

Get CDN resource details

func (*CDNResourceService) List added in v0.31.0

Get information about all CDN resources in your account.

func (*CDNResourceService) ListAutoPaging added in v0.51.0

Get information about all CDN resources in your account.

func (*CDNResourceService) New added in v0.31.0

Create CDN resource

func (*CDNResourceService) Prefetch added in v0.31.0

func (r *CDNResourceService) Prefetch(ctx context.Context, resourceID int64, body CDNResourcePrefetchParams, opts ...option.RequestOption) (err error)

Pre-populate files to a CDN cache before users requests. Prefetch is recommended only for files that **more than 200 MB** and **less than 5 GB**.

You can make one prefetch request for a CDN resource per minute. One request for prefetch may content only up to 100 paths to files.

The time of procedure depends on the number and size of the files.

If you need to update files stored in the CDN, first purge these files and then prefetch.

func (*CDNResourceService) PrevalidateSslLeCertificate added in v0.31.0

func (r *CDNResourceService) PrevalidateSslLeCertificate(ctx context.Context, resourceID int64, opts ...option.RequestOption) (err error)

Check whether a Let's Encrypt certificate can be issued for the CDN resource.

func (*CDNResourceService) Purge added in v0.31.0

func (r *CDNResourceService) Purge(ctx context.Context, resourceID int64, body CDNResourcePurgeParams, opts ...option.RequestOption) (err error)

Delete cache from CDN servers. This is necessary to update CDN content.

We have different limits for different purge types:

  • **Purge all cache** - One purge request for a CDN resource per minute.
  • **Purge by URL** - Two purge requests for a CDN resource per minute. One purge request is limited to 100 URLs.
  • **Purge by pattern** - One purge request for a CDN resource per minute. One purge request is limited to 10 patterns.

func (*CDNResourceService) Replace added in v0.31.0

func (r *CDNResourceService) Replace(ctx context.Context, resourceID int64, body CDNResourceReplaceParams, opts ...option.RequestOption) (res *CDNResource, err error)

Change CDN resource

func (*CDNResourceService) Update added in v0.31.0

func (r *CDNResourceService) Update(ctx context.Context, resourceID int64, body CDNResourceUpdateParams, opts ...option.RequestOption) (res *CDNResource, err error)

Change CDN resource

type CDNResourceShieldReplaceParams added in v0.31.0

type CDNResourceShieldReplaceParams struct {
	OriginShielding OriginShieldingParam
	// contains filtered or unexported fields
}

func (CDNResourceShieldReplaceParams) MarshalJSON added in v0.31.0

func (r CDNResourceShieldReplaceParams) MarshalJSON() (data []byte, err error)

func (*CDNResourceShieldReplaceParams) UnmarshalJSON added in v0.31.0

func (r *CDNResourceShieldReplaceParams) UnmarshalJSON(data []byte) error

type CDNResourceShieldService added in v0.31.0

type CDNResourceShieldService struct {
	Options []option.RequestOption
}

Origin shielding protects your origin server from being overloaded by routing all CDN requests through a single shield (precache) server for a CDN resource.

CDNResourceShieldService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCDNResourceShieldService method instead.

func NewCDNResourceShieldService added in v0.31.0

func NewCDNResourceShieldService(opts ...option.RequestOption) (r CDNResourceShieldService)

NewCDNResourceShieldService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CDNResourceShieldService) Get added in v0.31.0

func (r *CDNResourceShieldService) Get(ctx context.Context, resourceID int64, opts ...option.RequestOption) (res *OriginShielding, err error)

Get information about origin shielding.

func (*CDNResourceShieldService) Replace added in v0.31.0

Change origin shielding settings or disabled origin shielding.

type CDNResourceStatus added in v0.31.0

type CDNResourceStatus string

CDN resource status.

Possible values:

  • **active** - CDN resource is active. Content is available to users.
  • **suspended** - CDN resource is suspended. Content is not available to users.
  • **processed** - CDN resource has recently been created and is currently being processed. It will take about fifteen minutes to propagate it to all locations.
  • **deleted** - CDN resource is deleted.
const (
	CDNResourceStatusActive    CDNResourceStatus = "active"
	CDNResourceStatusSuspended CDNResourceStatus = "suspended"
	CDNResourceStatusProcessed CDNResourceStatus = "processed"
	CDNResourceStatusDeleted   CDNResourceStatus = "deleted"
)

type CDNResourceUpdateParams added in v0.31.0

type CDNResourceUpdateParams struct {
	// CDN resource name.
	Name param.Opt[string] `json:"name,omitzero"`
	// ID of the trusted CA certificate used to verify an origin.
	//
	// It can be used only with `"proxy_ssl_enabled": true`.
	ProxySslCa param.Opt[int64] `json:"proxy_ssl_ca,omitzero"`
	// ID of the SSL certificate used to verify an origin.
	//
	// It can be used only with `"proxy_ssl_enabled": true`.
	ProxySslData param.Opt[int64] `json:"proxy_ssl_data,omitzero"`
	// ID of the SSL certificate linked to the CDN resource.
	//
	// Can be used only with `"sslEnabled": true`.
	SslData param.Opt[int64] `json:"sslData,omitzero"`
	// Enables or disables a CDN resource.
	//
	// Possible values:
	//
	// - **true** - CDN resource is active. Content is being delivered.
	// - **false** - CDN resource is deactivated. Content is not being delivered.
	Active param.Opt[bool] `json:"active,omitzero"`
	// Optional comment describing the CDN resource.
	Description param.Opt[string] `json:"description,omitzero"`
	// Origin group ID with which the CDN resource is associated.
	OriginGroup param.Opt[int64] `json:"originGroup,omitzero"`
	// Enables or disables SSL certificate validation of the origin server before
	// completing any connection.
	//
	// Possible values:
	//
	// - **true** - Origin SSL certificate validation is enabled.
	// - **false** - Origin SSL certificate validation is disabled.
	ProxySslEnabled param.Opt[bool] `json:"proxy_ssl_enabled,omitzero"`
	// Defines whether the HTTPS protocol enabled for content delivery.
	//
	// Possible values:
	//
	// - **true** - HTTPS is enabled.
	// - **false** - HTTPS is disabled.
	SslEnabled param.Opt[bool] `json:"sslEnabled,omitzero"`
	// List of options that can be configured for the CDN resource.
	//
	// In case of `null` value the option is not added to the CDN resource. Option may
	// inherit its value from the global account settings.
	Options CDNResourceUpdateParamsOptions `json:"options,omitzero"`
	// Protocol used by CDN servers to request content from an origin source.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers will connect to the origin via HTTPS.
	//   - **HTTP** - CDN servers will connect to the origin via HTTP.
	//   - **MATCH** - connection protocol will be chosen automatically (content on the
	//     origin source should be available for the CDN both through HTTP and HTTPS).
	//
	// If protocol is not specified, HTTP is used to connect to an origin server.
	//
	// If an enabled origin in the resource's origin group is bound to a Gcore Object
	// Storage (`s3_type` is `gcore`), the CDN connects to every origin in that group
	// over HTTPS regardless of this setting.
	//
	// Any of "HTTP", "HTTPS", "MATCH".
	OriginProtocol CDNResourceUpdateParamsOriginProtocol `json:"originProtocol,omitzero"`
	// Additional delivery domains (CNAMEs) that will be used to deliver content via
	// the CDN.
	//
	// Up to ten additional CNAMEs are possible.
	SecondaryHostnames []string `json:"secondaryHostnames,omitzero" format:"domain"`
	// contains filtered or unexported fields
}

func (CDNResourceUpdateParams) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParams) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParams) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParams) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptions added in v0.31.0

type CDNResourceUpdateParamsOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods CDNResourceUpdateParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression CDNResourceUpdateParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings CDNResourceUpdateParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders CDNResourceUpdateParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors CDNResourceUpdateParamsOptionsCors `json:"cors,omitzero"`
	// Enables control access to content for specified countries.
	CountryACL CDNResourceUpdateParamsOptionsCountryACL `json:"country_acl,omitzero"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache CDNResourceUpdateParamsOptionsDisableCache `json:"disable_cache,omitzero"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges CDNResourceUpdateParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings CDNResourceUpdateParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge CDNResourceUpdateParamsOptionsFastedge `json:"fastedge,omitzero"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed CDNResourceUpdateParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect CDNResourceUpdateParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn CDNResourceUpdateParamsOptionsForceReturn `json:"force_return,omitzero"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader CDNResourceUpdateParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
	// Enables gRPC pass-through for the CDN resource.
	GrpcPassthrough CDNResourceUpdateParamsOptionsGrpcPassthrough `json:"grpc_passthrough,omitzero"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn CDNResourceUpdateParamsOptionsGzipOn `json:"gzipOn,omitzero"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader CDNResourceUpdateParamsOptionsHostHeader `json:"hostHeader,omitzero"`
	// Enables HTTP/3 protocol for content delivery.
	//
	// `http3_enabled` option works only with `"sslEnabled": true`.
	Http3Enabled CDNResourceUpdateParamsOptionsHttp3Enabled `json:"http3_enabled,omitzero"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie CDNResourceUpdateParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString CDNResourceUpdateParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack CDNResourceUpdateParamsOptionsImageStack `json:"image_stack,omitzero"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL CDNResourceUpdateParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
	// Allows to control the download speed per connection.
	LimitBandwidth CDNResourceUpdateParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
	// Enables Network Error Logging (NEL) for the resource.
	//
	// When enabled, the edge instructs browsers to collect and report network errors
	// (via the `Report-To` and `NEL` response headers), improving observability of
	// connectivity issues for the resource.
	NetworkErrorLogging CDNResourceUpdateParamsOptionsNetworkErrorLogging `json:"network_error_logging,omitzero"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey CDNResourceUpdateParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet CDNResourceUpdateParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout CDNResourceUpdateParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout CDNResourceUpdateParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist CDNResourceUpdateParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist CDNResourceUpdateParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding CDNResourceUpdateParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS CDNResourceUpdateParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP CDNResourceUpdateParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL CDNResourceUpdateParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy CDNResourceUpdateParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite CDNResourceUpdateParamsOptionsRewrite `json:"rewrite,omitzero"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey CDNResourceUpdateParamsOptionsSecureKey `json:"secure_key,omitzero"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice CDNResourceUpdateParamsOptionsSlice `json:"slice,omitzero"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni CDNResourceUpdateParamsOptionsSni `json:"sni,omitzero"`
	// Serves stale cached content in case of origin unavailability.
	Stale CDNResourceUpdateParamsOptionsStale `json:"stale,omitzero"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders CDNResourceUpdateParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders CDNResourceUpdateParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders CDNResourceUpdateParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
	// List of SSL/TLS protocol versions allowed for HTTPS connections from end users
	// to the domain.
	//
	// When the option is disabled, all protocols versions are allowed.
	//
	// While the `tls_ciphers` option is active on the resource, only the TLS versions
	// its cipher profile allows can be enabled, and this option cannot be deleted or
	// disabled.
	TlsVersions CDNResourceUpdateParamsOptionsTlsVersions `json:"tls_versions,omitzero"`
	// Let's Encrypt certificate chain.
	//
	// The specified chain will be used during the next Let's Encrypt certificate issue
	// or renewal.
	UseDefaultLeChain CDNResourceUpdateParamsOptionsUseDefaultLeChain `json:"use_default_le_chain,omitzero"`
	// DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
	//
	// DNS service should be activated to enable this option.
	UseDns01LeChallenge CDNResourceUpdateParamsOptionsUseDns01LeChallenge `json:"use_dns01_le_challenge,omitzero"`
	// RSA Let's Encrypt certificate type for the CDN resource.
	//
	// The specified value will be used during the next Let's Encrypt certificate issue
	// or renewal.
	UseRsaLeCert CDNResourceUpdateParamsOptionsUseRsaLeCert `json:"use_rsa_le_cert,omitzero"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL CDNResourceUpdateParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap CDNResourceUpdateParamsOptionsWaap `json:"waap,omitzero"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets CDNResourceUpdateParamsOptionsWebsockets `json:"websockets,omitzero"`
	// contains filtered or unexported fields
}

List of options that can be configured for the CDN resource.

In case of `null` value the option is not added to the CDN resource. Option may inherit its value from the global account settings.

func (CDNResourceUpdateParamsOptions) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptions) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptions) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsAllowedHTTPMethods added in v0.31.0

type CDNResourceUpdateParamsOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

HTTP methods allowed for content requests from the CDN.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsAllowedHTTPMethods) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsBrotliCompression added in v0.31.0

type CDNResourceUpdateParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsBrotliCompression) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsBrotliCompression) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsBrowserCacheSettings added in v0.31.0

type CDNResourceUpdateParamsOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsBrowserCacheSettings) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsBrowserCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsCacheHTTPHeaders deprecated added in v0.31.0

type CDNResourceUpdateParamsOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsCacheHTTPHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsCors added in v0.31.0

type CDNResourceUpdateParamsOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsCors) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsCors) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsCors) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsCors) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsCountryACL added in v0.31.0

type CDNResourceUpdateParamsOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Enables control access to content for specified countries.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceUpdateParamsOptionsCountryACL) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsCountryACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsCountryACL) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsDisableCache deprecated added in v0.31.0

type CDNResourceUpdateParamsOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsDisableCache) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsDisableCache) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsDisableCache) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsDisableProxyForceRanges added in v0.31.0

type CDNResourceUpdateParamsOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows 206 responses regardless of the settings of an origin source.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsDisableProxyForceRanges) MarshalJSON added in v0.31.0

func (*CDNResourceUpdateParamsOptionsDisableProxyForceRanges) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsEdgeCacheSettings added in v0.31.0

type CDNResourceUpdateParamsOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

The property Enabled is required.

func (CDNResourceUpdateParamsOptionsEdgeCacheSettings) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsEdgeCacheSettings) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedge added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody CDNResourceUpdateParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders CDNResourceUpdateParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache CDNResourceUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody CDNResourceUpdateParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders CDNResourceUpdateParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

The property Enabled is required.

func (CDNResourceUpdateParamsOptionsFastedge) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsFastedge) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsFastedge) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsFastedge) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsFastedgeOnRequestBody added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

The property AppID is required.

func (CDNResourceUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsFastedgeOnRequestBody) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedgeOnRequestHeaders added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

The property AppID is required.

func (CDNResourceUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type CDNResourceUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

The property AppID is required.

func (CDNResourceUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache) MarshalJSON added in v0.50.0

func (*CDNResourceUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type CDNResourceUpdateParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceUpdateParamsOptionsFastedgeOnResponseBody) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsFastedgeOnResponseBody) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedgeOnResponseHeaders added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

The property AppID is required.

func (CDNResourceUpdateParamsOptionsFastedgeOnResponseHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceUpdateParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsFetchCompressed added in v0.31.0

type CDNResourceUpdateParamsOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsFetchCompressed) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsFetchCompressed) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsFollowOriginRedirect added in v0.31.0

type CDNResourceUpdateParamsOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

The properties Codes, Enabled are required.

func (CDNResourceUpdateParamsOptionsFollowOriginRedirect) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsFollowOriginRedirect) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsForceReturn added in v0.31.0

type CDNResourceUpdateParamsOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval CDNResourceUpdateParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
	// contains filtered or unexported fields
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

The properties Body, Code, Enabled are required.

func (CDNResourceUpdateParamsOptionsForceReturn) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsForceReturn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsForceReturn) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsForceReturnTimeInterval added in v0.31.0

type CDNResourceUpdateParamsOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
	// contains filtered or unexported fields
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

The properties EndTime, StartTime are required.

func (CDNResourceUpdateParamsOptionsForceReturnTimeInterval) MarshalJSON added in v0.31.0

func (*CDNResourceUpdateParamsOptionsForceReturnTimeInterval) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsForwardHostHeader added in v0.31.0

type CDNResourceUpdateParamsOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsForwardHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsForwardHostHeader) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsGrpcPassthrough added in v0.34.0

type CDNResourceUpdateParamsOptionsGrpcPassthrough struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables gRPC pass-through for the CDN resource.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsGrpcPassthrough) MarshalJSON added in v0.34.0

func (r CDNResourceUpdateParamsOptionsGrpcPassthrough) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsGrpcPassthrough) UnmarshalJSON added in v0.34.0

func (r *CDNResourceUpdateParamsOptionsGrpcPassthrough) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsGzipOn added in v0.31.0

type CDNResourceUpdateParamsOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsGzipOn) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsGzipOn) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsGzipOn) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsHostHeader added in v0.31.0

type CDNResourceUpdateParamsOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsHostHeader) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsHostHeader) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsHostHeader) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsHttp3Enabled added in v0.31.0

type CDNResourceUpdateParamsOptionsHttp3Enabled struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables HTTP/3 protocol for content delivery.

`http3_enabled` option works only with `"sslEnabled": true`.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsHttp3Enabled) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsHttp3Enabled) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsHttp3Enabled) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsHttp3Enabled) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsIPAddressACL added in v0.31.0

type CDNResourceUpdateParamsOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceUpdateParamsOptionsIPAddressACL) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsIPAddressACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsIgnoreCookie added in v0.31.0

type CDNResourceUpdateParamsOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsIgnoreCookie) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsIgnoreCookie) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsIgnoreQueryString added in v0.31.0

type CDNResourceUpdateParamsOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsIgnoreQueryString) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsIgnoreQueryString) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsImageStack added in v0.31.0

type CDNResourceUpdateParamsOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality param.Opt[int64] `json:"quality,omitzero"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
	// contains filtered or unexported fields
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

The property Enabled is required.

func (CDNResourceUpdateParamsOptionsImageStack) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsImageStack) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsImageStack) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsImageStack) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsLimitBandwidth added in v0.31.0

type CDNResourceUpdateParamsOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type,omitzero" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer param.Opt[int64] `json:"buffer,omitzero"`
	// Maximum download speed per connection.
	Speed param.Opt[int64] `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

Allows to control the download speed per connection.

The properties Enabled, LimitType are required.

func (CDNResourceUpdateParamsOptionsLimitBandwidth) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsLimitBandwidth) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsNetworkErrorLogging added in v0.50.0

type CDNResourceUpdateParamsOptionsNetworkErrorLogging struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables Network Error Logging (NEL) for the resource.

When enabled, the edge instructs browsers to collect and report network errors (via the `Report-To` and `NEL` response headers), improving observability of connectivity issues for the resource.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsNetworkErrorLogging) MarshalJSON added in v0.50.0

func (r CDNResourceUpdateParamsOptionsNetworkErrorLogging) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsNetworkErrorLogging) UnmarshalJSON added in v0.50.0

type CDNResourceUpdateParamsOptionsProxyCacheKey added in v0.31.0

type CDNResourceUpdateParamsOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsProxyCacheKey) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsProxyCacheKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsProxyCacheMethodsSet added in v0.31.0

type CDNResourceUpdateParamsOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Caching for POST requests along with default GET and HEAD.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsProxyCacheMethodsSet) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsProxyConnectTimeout added in v0.31.0

type CDNResourceUpdateParamsOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for establishing a connection with the origin.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsProxyConnectTimeout) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsProxyConnectTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsProxyReadTimeout added in v0.31.0

type CDNResourceUpdateParamsOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsProxyReadTimeout) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsProxyReadTimeout) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsQueryParamsBlacklist added in v0.31.0

type CDNResourceUpdateParamsOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsQueryParamsBlacklist) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsQueryParamsWhitelist added in v0.31.0

type CDNResourceUpdateParamsOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsQueryParamsWhitelist) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsQueryStringForwarding added in v0.31.0

type CDNResourceUpdateParamsOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types,omitzero" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
	// contains filtered or unexported fields
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.

func (CDNResourceUpdateParamsOptionsQueryStringForwarding) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsQueryStringForwarding) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsRedirectHTTPSToHTTP added in v0.31.0

type CDNResourceUpdateParamsOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsRedirectHTTPToHTTPS added in v0.31.0

type CDNResourceUpdateParamsOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsReferrerACL added in v0.31.0

type CDNResourceUpdateParamsOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specified domain names.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceUpdateParamsOptionsReferrerACL) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsReferrerACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsResponseHeadersHidingPolicy added in v0.31.0

type CDNResourceUpdateParamsOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted,omitzero" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Hides HTTP headers from an origin server in the CDN response.

The properties Enabled, Excepted, Mode are required.

func (CDNResourceUpdateParamsOptionsResponseHeadersHidingPolicy) MarshalJSON added in v0.31.0

func (*CDNResourceUpdateParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsRewrite added in v0.31.0

type CDNResourceUpdateParamsOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag,omitzero"`
	// contains filtered or unexported fields
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

The properties Body, Enabled are required.

func (CDNResourceUpdateParamsOptionsRewrite) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsRewrite) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsRewrite) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsRewrite) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsSecureKey added in v0.31.0

type CDNResourceUpdateParamsOptionsSecureKey struct {
	// Key generated on your side that will be used for URL signing.
	Key param.Opt[string] `json:"key,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

The properties Enabled, Key are required.

func (CDNResourceUpdateParamsOptionsSecureKey) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsSecureKey) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsSecureKey) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsSlice added in v0.31.0

type CDNResourceUpdateParamsOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsSlice) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsSlice) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsSlice) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsSlice) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsSni added in v0.31.0

type CDNResourceUpdateParamsOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type,omitzero"`
	// contains filtered or unexported fields
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

The properties CustomHostname, Enabled are required.

func (CDNResourceUpdateParamsOptionsSni) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsSni) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsSni) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsSni) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsStale added in v0.31.0

type CDNResourceUpdateParamsOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Serves stale cached content in case of origin unavailability.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsStale) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsStale) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsStale) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsStale) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsStaticHeaders deprecated added in v0.31.0

type CDNResourceUpdateParamsOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsStaticHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsStaticHeaders) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsStaticRequestHeaders added in v0.31.0

type CDNResourceUpdateParamsOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsStaticRequestHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsStaticRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsStaticResponseHeaders added in v0.31.0

type CDNResourceUpdateParamsOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                                       `json:"enabled" api:"required"`
	Value   []CDNResourceUpdateParamsOptionsStaticResponseHeadersValue `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers that a CDN server adds to a response.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsStaticResponseHeaders) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsStaticResponseHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsStaticResponseHeadersValue added in v0.31.0

type CDNResourceUpdateParamsOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (CDNResourceUpdateParamsOptionsStaticResponseHeadersValue) MarshalJSON added in v0.31.0

func (*CDNResourceUpdateParamsOptionsStaticResponseHeadersValue) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsTlsCiphers added in v0.57.0

type CDNResourceUpdateParamsOptionsTlsCiphers struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Cipher suite policy for HTTPS connections from end users to the domain, selected from predefined profiles.

The exact cipher suites the policy enforces are returned in the `ciphers` field, and each profile defines which TLS versions may be enabled together with it. While the option is active:

- The `tls_versions` option can include only the versions the profile allows. - The `tls_versions` option cannot be deleted or disabled.

The option is read-only. Contact support to change it.

When the option is absent or disabled, the default cipher suites of the CDN are used.

The properties Enabled, Mode are required.

func (CDNResourceUpdateParamsOptionsTlsCiphers) MarshalJSON added in v0.57.0

func (r CDNResourceUpdateParamsOptionsTlsCiphers) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsTlsCiphers) UnmarshalJSON added in v0.57.0

func (r *CDNResourceUpdateParamsOptionsTlsCiphers) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsTlsVersions added in v0.31.0

type CDNResourceUpdateParamsOptionsTlsVersions struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of SSL/TLS protocol versions (case sensitive).
	//
	// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

List of SSL/TLS protocol versions allowed for HTTPS connections from end users to the domain.

When the option is disabled, all protocols versions are allowed.

While the `tls_ciphers` option is active on the resource, only the TLS versions its cipher profile allows can be enabled, and this option cannot be deleted or disabled.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsTlsVersions) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsTlsVersions) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsTlsVersions) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsTlsVersions) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsUseDefaultLeChain added in v0.31.0

type CDNResourceUpdateParamsOptionsUseDefaultLeChain struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Default Let's Encrypt certificate chain. This is a deprecated
	//     version, use it only for compatibilities with Android devices 7.1.1 or lower.
	//   - **false** - Alternative Let's Encrypt certificate chain.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Let's Encrypt certificate chain.

The specified chain will be used during the next Let's Encrypt certificate issue or renewal.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsUseDefaultLeChain) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsUseDefaultLeChain) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsUseDefaultLeChain) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsUseDns01LeChallenge added in v0.31.0

type CDNResourceUpdateParamsOptionsUseDns01LeChallenge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - DNS-01 challenge is used to issue Let's Encrypt certificate.
	// - **false** - HTTP-01 challenge is used to issue Let's Encrypt certificate.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

DNS-01 challenge to issue a Let's Encrypt certificate for the resource.

DNS service should be activated to enable this option.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsUseDns01LeChallenge) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsUseDns01LeChallenge) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsUseDns01LeChallenge) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsUseRsaLeCert added in v0.31.0

type CDNResourceUpdateParamsOptionsUseRsaLeCert struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - RSA Let's Encrypt certificate.
	// - **false** - ECDSA Let's Encrypt certificate.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

RSA Let's Encrypt certificate type for the CDN resource.

The specified value will be used during the next Let's Encrypt certificate issue or renewal.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsUseRsaLeCert) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsUseRsaLeCert) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsUseRsaLeCert) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsUseRsaLeCert) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsUserAgentACL added in v0.31.0

type CDNResourceUpdateParamsOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the content for specified User-Agents.

The properties Enabled, ExceptedValues, PolicyType are required.

func (CDNResourceUpdateParamsOptionsUserAgentACL) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsUserAgentACL) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsWaap added in v0.31.0

type CDNResourceUpdateParamsOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows to enable WAAP (Web Application and API Protection).

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsWaap) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsWaap) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsWaap) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsWaap) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOptionsWebsockets added in v0.31.0

type CDNResourceUpdateParamsOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables or disables WebSockets connections to an origin server.

The properties Enabled, Value are required.

func (CDNResourceUpdateParamsOptionsWebsockets) MarshalJSON added in v0.31.0

func (r CDNResourceUpdateParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)

func (*CDNResourceUpdateParamsOptionsWebsockets) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsWebsockets) UnmarshalJSON(data []byte) error

type CDNResourceUpdateParamsOriginProtocol added in v0.31.0

type CDNResourceUpdateParamsOriginProtocol string

Protocol used by CDN servers to request content from an origin source.

Possible values:

  • **HTTPS** - CDN servers will connect to the origin via HTTPS.
  • **HTTP** - CDN servers will connect to the origin via HTTP.
  • **MATCH** - connection protocol will be chosen automatically (content on the origin source should be available for the CDN both through HTTP and HTTPS).

If protocol is not specified, HTTP is used to connect to an origin server.

If an enabled origin in the resource's origin group is bound to a Gcore Object Storage (`s3_type` is `gcore`), the CDN connects to every origin in that group over HTTPS regardless of this setting.

const (
	CDNResourceUpdateParamsOriginProtocolHTTP  CDNResourceUpdateParamsOriginProtocol = "HTTP"
	CDNResourceUpdateParamsOriginProtocolHTTPS CDNResourceUpdateParamsOriginProtocol = "HTTPS"
	CDNResourceUpdateParamsOriginProtocolMatch CDNResourceUpdateParamsOriginProtocol = "MATCH"
)

type CDNService added in v0.31.0

type CDNService struct {
	Options      []option.RequestOption
	CDNResources CDNResourceService
	// CDN origin shielding locations are the available shield (precache) points of
	// presence that can be referenced when configuring origin shielding for a CDN
	// resource.
	ShieldingLocation ShieldingLocationService
	// CDN origin groups aggregate one or more origin servers with failover and load
	// balancing for content delivery.
	OriginGroups OriginGroupService
	// CDN rule templates define reusable rule configurations that can be applied
	// across multiple CDN resources for consistent caching, delivery, and security
	// policies.
	RuleTemplates RuleTemplateService
	// CDN presets are predefined sets of CDN resource or rule settings that can be
	// applied to an object in a single request, letting you configure caching,
	// delivery, and security options consistently.
	Presets PresetService
	// CDN aliases are hostnames you own that are served with the settings of one of
	// your CDN resources, each with its own SSL certificate.
	Aliases AliasService
	// CDN SSL certificates enable HTTPS content delivery, supporting both uploaded
	// certificates and automated Let's Encrypt provisioning.
	Certificates CertificateService
	// Trusted CA certificates verify the authenticity of CDN origin servers during
	// HTTPS connections.
	TrustedCaCertificates TrustedCaCertificateService
	// Get the history of users requests to CDN. It contains requests made both via the
	// API and via the control panel.
	//
	// The following methods are not tracked in the activity logs:
	//
	// - HEAD
	// - OPTIONS
	AuditLogs AuditLogService
	// Log viewer provides you with general information about CDN operation. This
	// information does not contain all possible sets of fields and restricted by time.
	// To receive full data, use Logs Uploader.
	Logs         LogService
	LogsUploader LogsUploaderService
	// Consumption statistics is updated in near real-time as a standard practice.
	// However, the frequency of updates can vary, but they are typically available
	// within a 24-hour period. Exceptions, such as maintenance periods, may delay data
	// beyond 24 hours until servers resume and fill in the missing statistics.
	Statistics StatisticService
	// Consumption statistics is updated in near real-time as a standard practice.
	// However, the frequency of updates can vary, but they are typically available
	// within a 24-hour period. Exceptions, such as maintenance periods, may delay data
	// beyond 24 hours until servers resume and fill in the missing statistics.
	NetworkCapacity NetworkCapacityService
	// Consumption statistics is updated in near real-time as a standard practice.
	// However, the frequency of updates can vary, but they are typically available
	// within a 24-hour period. Exceptions, such as maintenance periods, may delay data
	// beyond 24 hours until servers resume and fill in the missing statistics.
	Metrics  MetricService
	IPRanges IPRangeService
	IPs      IPService
	// Information about the current state of the CDN service in your account.
	ClientConfig ClientConfigService
}

CDNService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCDNService method instead.

func NewCDNService added in v0.31.0

func NewCDNService(opts ...option.RequestOption) (r CDNService)

NewCDNService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CDNService) GetAccountLimits added in v0.31.0

func (r *CDNService) GetAccountLimits(ctx context.Context, opts ...option.RequestOption) (res *CDNAccountLimits, err error)

Get information about CDN service limits.

func (*CDNService) GetAccountOverview added in v0.31.0

func (r *CDNService) GetAccountOverview(ctx context.Context, opts ...option.RequestOption) (res *CDNAccount, err error)

Get information about CDN service.

func (*CDNService) GetAvailableFeatures added in v0.31.0

func (r *CDNService) GetAvailableFeatures(ctx context.Context, opts ...option.RequestOption) (res *CDNAvailableFeatures, err error)

Get information about available CDN features.

func (*CDNService) ListAlibabaRegions added in v0.31.0

Get the list of Alibaba Cloud regions.

func (*CDNService) ListAlibabaRegionsAutoPaging added in v0.51.0

Get the list of Alibaba Cloud regions.

func (*CDNService) ListAwsRegions added in v0.31.0

Get the list of Amazon AWS regions.

func (*CDNService) ListAwsRegionsAutoPaging added in v0.51.0

Get the list of Amazon AWS regions.

func (*CDNService) ListPurgeStatuses added in v0.31.0

func (r *CDNService) ListPurgeStatuses(ctx context.Context, query CDNListPurgeStatusesParams, opts ...option.RequestOption) (res *pagination.OffsetPage[PurgeStatus], err error)

Get purges history.

func (*CDNService) ListPurgeStatusesAutoPaging added in v0.51.0

Get purges history.

func (*CDNService) UpdateAccount added in v0.31.0

func (r *CDNService) UpdateAccount(ctx context.Context, body CDNUpdateAccountParams, opts ...option.RequestOption) (res *CDNAccount, err error)

Change information about CDN service.

type CDNUpdateAccountParams added in v0.31.0

type CDNUpdateAccountParams struct {
	// CDN traffic usage limit in gigabytes.
	//
	// When the limit is reached, we will send an email notification.
	UtilizationLevel param.Opt[int64] `json:"utilization_level,omitzero"`
	// contains filtered or unexported fields
}

func (CDNUpdateAccountParams) MarshalJSON added in v0.31.0

func (r CDNUpdateAccountParams) MarshalJSON() (data []byte, err error)

func (*CDNUpdateAccountParams) UnmarshalJSON added in v0.31.0

func (r *CDNUpdateAccountParams) UnmarshalJSON(data []byte) error

type CaCertificate

type CaCertificate struct {
	// CA certificate ID.
	ID int64 `json:"id"`
	// Name of the certification center that issued the CA certificate.
	CertIssuer string `json:"cert_issuer"`
	// Alternative domain names that the CA certificate secures.
	CertSubjectAlt string `json:"cert_subject_alt"`
	// Domain name that the CA certificate secures.
	CertSubjectCn string `json:"cert_subject_cn"`
	// Defines whether the certificate has been deleted. Parameter is **deprecated**.
	//
	// Possible values:
	//
	// - **true** - Certificate has been deleted.
	// - **false** - Certificate has not been deleted.
	Deleted bool `json:"deleted"`
	// Defines whether the CA certificate is used by a CDN resource.
	//
	// Possible values:
	//
	// - **true** - Certificate is used by a CDN resource.
	// - **false** - Certificate is not used by a CDN resource.
	HasRelatedResources bool `json:"hasRelatedResources"`
	// CA certificate name.
	Name string `json:"name"`
	// Parameter is **deprecated**.
	SslCertificateChain string `json:"sslCertificateChain"`
	// Date when the CA certificate become untrusted (ISO 8601/RFC 3339 format, UTC.)
	ValidityNotAfter string `json:"validity_not_after"`
	// Date when the CA certificate become valid (ISO 8601/RFC 3339 format, UTC.)
	ValidityNotBefore string `json:"validity_not_before"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		CertIssuer          respjson.Field
		CertSubjectAlt      respjson.Field
		CertSubjectCn       respjson.Field
		Deleted             respjson.Field
		HasRelatedResources respjson.Field
		Name                respjson.Field
		SslCertificateChain respjson.Field
		ValidityNotAfter    respjson.Field
		ValidityNotBefore   respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CaCertificate) RawJSON

func (r CaCertificate) RawJSON() string

Returns the unmodified JSON received from the API

func (*CaCertificate) UnmarshalJSON

func (r *CaCertificate) UnmarshalJSON(data []byte) error

type CaCertificateList

type CaCertificateList struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string          `json:"previous" api:"required"`
	Results  []CaCertificate `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CaCertificateList) RawJSON added in v0.51.0

func (r CaCertificateList) RawJSON() string

Returns the unmodified JSON received from the API

func (*CaCertificateList) UnmarshalJSON added in v0.51.0

func (r *CaCertificateList) UnmarshalJSON(data []byte) error

type CertificateGetStatusParams

type CertificateGetStatusParams struct {
	// Listed fields will be excluded from the response.
	Exclude []string `query:"exclude,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CertificateGetStatusParams) URLQuery

func (r CertificateGetStatusParams) URLQuery() (v url.Values, err error)

URLQuery serializes CertificateGetStatusParams's query parameters as `url.Values`.

type CertificateListParams

type CertificateListParams struct {
	// How the SSL certificate was issued.
	//
	// Possible values:
	//
	// - **true** – Certificate was issued automatically.
	// - **false** – Certificate was added by a user.
	Automated param.Opt[bool] `query:"automated,omitzero" json:"-"`
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// CDN resource ID for which certificates are requested.
	ResourceID param.Opt[int64] `query:"resource_id,omitzero" json:"-"`
	// Date and time when the certificate become untrusted (ISO 8601/RFC 3339 format,
	// UTC.)
	//
	// Response will contain only certificates valid until the specified time.
	ValidityNotAfterLte param.Opt[string] `query:"validity_not_after_lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CertificateListParams) URLQuery

func (r CertificateListParams) URLQuery() (v url.Values, err error)

URLQuery serializes CertificateListParams's query parameters as `url.Values`.

type CertificateNewParams

type CertificateNewParams struct {

	// This field is a request body variant, only one variant field can be set.
	OfOwnCertificate *CertificateNewParamsBodyOwnCertificate `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfLetSEncryptCertificate *CertificateNewParamsBodyLetSEncryptCertificate `json:",inline"`
	// contains filtered or unexported fields
}

func (CertificateNewParams) MarshalJSON

func (u CertificateNewParams) MarshalJSON() ([]byte, error)

func (*CertificateNewParams) UnmarshalJSON

func (r *CertificateNewParams) UnmarshalJSON(data []byte) error

type CertificateNewParamsBodyLetSEncryptCertificate

type CertificateNewParamsBodyLetSEncryptCertificate struct {
	// Must be **true** to issue certificate automatically.
	Automated bool `json:"automated" api:"required"`
	// SSL certificate name. It must be unique.
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

The properties Automated, Name are required.

func (CertificateNewParamsBodyLetSEncryptCertificate) MarshalJSON

func (r CertificateNewParamsBodyLetSEncryptCertificate) MarshalJSON() (data []byte, err error)

func (*CertificateNewParamsBodyLetSEncryptCertificate) UnmarshalJSON

type CertificateNewParamsBodyOwnCertificate

type CertificateNewParamsBodyOwnCertificate struct {
	// SSL certificate name.
	//
	// It must be unique.
	Name string `json:"name" api:"required"`
	// Public part of the SSL certificate.
	//
	// All chain of the SSL certificate should be added.
	SslCertificate string `json:"sslCertificate" api:"required"`
	// Private key of the SSL certificate.
	SslPrivateKey string `json:"sslPrivateKey" api:"required"`
	// Defines whether to check the SSL certificate for a signature from a trusted
	// certificate authority.
	//
	// Possible values:
	//
	//   - **true** - SSL certificate must be verified to be signed by a trusted
	//     certificate authority.
	//   - **false** - SSL certificate will not be verified to be signed by a trusted
	//     certificate authority.
	ValidateRootCa param.Opt[bool] `json:"validate_root_ca,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, SslCertificate, SslPrivateKey are required.

func (CertificateNewParamsBodyOwnCertificate) MarshalJSON

func (r CertificateNewParamsBodyOwnCertificate) MarshalJSON() (data []byte, err error)

func (*CertificateNewParamsBodyOwnCertificate) UnmarshalJSON

func (r *CertificateNewParamsBodyOwnCertificate) UnmarshalJSON(data []byte) error

type CertificateReplaceParams

type CertificateReplaceParams struct {
	// SSL certificate name.
	//
	// It must be unique.
	Name string `json:"name" api:"required"`
	// Public part of the SSL certificate.
	//
	// All chain of the SSL certificate should be added.
	SslCertificate string `json:"sslCertificate" api:"required"`
	// Private key of the SSL certificate.
	SslPrivateKey string `json:"sslPrivateKey" api:"required"`
	// Defines whether to check the SSL certificate for a signature from a trusted
	// certificate authority.
	//
	// Possible values:
	//
	//   - **true** - SSL certificate must be verified to be signed by a trusted
	//     certificate authority.
	//   - **false** - SSL certificate will not be verified to be signed by a trusted
	//     certificate authority.
	ValidateRootCa param.Opt[bool] `json:"validate_root_ca,omitzero"`
	// contains filtered or unexported fields
}

func (CertificateReplaceParams) MarshalJSON

func (r CertificateReplaceParams) MarshalJSON() (data []byte, err error)

func (*CertificateReplaceParams) UnmarshalJSON

func (r *CertificateReplaceParams) UnmarshalJSON(data []byte) error

type CertificateService

type CertificateService struct {
	Options []option.RequestOption
}

CDN SSL certificates enable HTTPS content delivery, supporting both uploaded certificates and automated Let's Encrypt provisioning.

CertificateService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCertificateService method instead.

func NewCertificateService

func NewCertificateService(opts ...option.RequestOption) (r CertificateService)

NewCertificateService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CertificateService) Delete

func (r *CertificateService) Delete(ctx context.Context, sslID int64, opts ...option.RequestOption) (err error)

Delete SSL certificate

func (*CertificateService) ForceRetry

func (r *CertificateService) ForceRetry(ctx context.Context, certID int64, opts ...option.RequestOption) (err error)

Force retry issuance of Let's Encrypt certificate if the previous attempt was failed.

func (*CertificateService) Get

func (r *CertificateService) Get(ctx context.Context, sslID int64, opts ...option.RequestOption) (res *SslDetail, err error)

Get SSL certificate details

func (*CertificateService) GetStatus

func (r *CertificateService) GetStatus(ctx context.Context, certID int64, query CertificateGetStatusParams, opts ...option.RequestOption) (res *SslRequestStatus, err error)

Get details about the latest Let's Encrypt certificate issuing attempt for the CDN resource. Returns attempts in all statuses.

func (*CertificateService) GetUsage added in v0.58.0

func (r *CertificateService) GetUsage(ctx context.Context, certID int64, opts ...option.RequestOption) (res *SslCertificateUsage, err error)

Get list of CDN resources and aliases that are using this SSL certificate.

This endpoint is useful to check which resources and aliases depend on a certificate before renewing, modifying, or deleting it.

func (*CertificateService) List

Get information about SSL certificates.

func (*CertificateService) ListAutoPaging added in v0.51.0

Get information about SSL certificates.

func (*CertificateService) New

Add an SSL certificate for content delivery over HTTPS protocol.

Enter all strings of the certificate(s) and the private key into one string parameter. Each certificate and the private key in chain should be separated by the "\n" symbol, as shown in the example.

Additionally, you can add a Let's Encrypt certificate. In this case, certificate and private key will be generated automatically after attaching this certificate to your CDN resource.

func (*CertificateService) Renew

func (r *CertificateService) Renew(ctx context.Context, certID int64, opts ...option.RequestOption) (err error)

Renew free Let's Encrypt certificate for the CDN resource. It can take up to fifteen minutes.

func (*CertificateService) Replace

func (r *CertificateService) Replace(ctx context.Context, sslID int64, body CertificateReplaceParams, opts ...option.RequestOption) (res *SslDetail, err error)

Change SSL certificate

type ClientConfigService added in v0.46.0

type ClientConfigService struct {
	Options []option.RequestOption
}

Information about the current state of the CDN service in your account.

ClientConfigService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewClientConfigService method instead.

func NewClientConfigService added in v0.46.0

func NewClientConfigService(opts ...option.RequestOption) (r ClientConfigService)

NewClientConfigService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ClientConfigService) Get added in v0.46.0

func (r *ClientConfigService) Get(ctx context.Context, opts ...option.RequestOption) (res *CDNAccount, err error)

Get information about CDN service.

type Error

type Error = apierror.Error

type IPListParams added in v0.34.0

type IPListParams struct {
	// Optional format override. When set, this takes precedence over the `Accept`
	// header.
	//
	// Any of "json", "plain".
	Format IPListParamsFormat `query:"format,omitzero" json:"-"`
	// Any of "application/json", "text/plain".
	Accept IPListParamsAccept `header:"Accept,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (IPListParams) URLQuery added in v0.34.0

func (r IPListParams) URLQuery() (v url.Values, err error)

URLQuery serializes IPListParams's query parameters as `url.Values`.

type IPListParamsAccept added in v0.34.0

type IPListParamsAccept string
const (
	IPListParamsAcceptApplicationJson IPListParamsAccept = "application/json"
	IPListParamsAcceptTextPlain       IPListParamsAccept = "text/plain"
)

type IPListParamsFormat added in v0.34.0

type IPListParamsFormat string

Optional format override. When set, this takes precedence over the `Accept` header.

const (
	IPListParamsFormatJson  IPListParamsFormat = "json"
	IPListParamsFormatPlain IPListParamsFormat = "plain"
)

type IPRangeListParams added in v0.18.0

type IPRangeListParams struct {
	// Optional format override. When set, this takes precedence over the `Accept`
	// header.
	//
	// Any of "json", "plain".
	Format IPRangeListParamsFormat `query:"format,omitzero" json:"-"`
	// Any of "application/json", "text/plain".
	Accept IPRangeListParamsAccept `header:"Accept,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (IPRangeListParams) URLQuery added in v0.18.0

func (r IPRangeListParams) URLQuery() (v url.Values, err error)

URLQuery serializes IPRangeListParams's query parameters as `url.Values`.

type IPRangeListParamsAccept added in v0.18.0

type IPRangeListParamsAccept string
const (
	IPRangeListParamsAcceptApplicationJson IPRangeListParamsAccept = "application/json"
	IPRangeListParamsAcceptTextPlain       IPRangeListParamsAccept = "text/plain"
)

type IPRangeListParamsFormat added in v0.18.0

type IPRangeListParamsFormat string

Optional format override. When set, this takes precedence over the `Accept` header.

const (
	IPRangeListParamsFormatJson  IPRangeListParamsFormat = "json"
	IPRangeListParamsFormatPlain IPRangeListParamsFormat = "plain"
)

type IPRangeService

type IPRangeService struct {
	Options []option.RequestOption
}

IPRangeService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIPRangeService method instead.

func NewIPRangeService

func NewIPRangeService(opts ...option.RequestOption) (r IPRangeService)

NewIPRangeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*IPRangeService) List

func (r *IPRangeService) List(ctx context.Context, params IPRangeListParams, opts ...option.RequestOption) (res *PublicNetworkList, err error)

Get all CDN networks that can be used to pull content from your origin.

This list is updated periodically. If you want to use network from this list to configure IP ACL on your origin, you need to independently monitor its relevance. We recommend using a script for automatically update IP ACL.

This request does not require authorization.

type IPService added in v0.34.0

type IPService struct {
	Options []option.RequestOption
}

IPService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewIPService method instead.

func NewIPService added in v0.34.0

func NewIPService(opts ...option.RequestOption) (r IPService)

NewIPService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*IPService) List added in v0.34.0

func (r *IPService) List(ctx context.Context, params IPListParams, opts ...option.RequestOption) (res *PublicIPList, err error)

Get all IP addresses of CDN servers that can be used to pull content from your origin.

This list is updated periodically. If you want to use IP from this list to configure IP ACL in your origin, you need to independently monitor its relevance. We recommend using a script to automatically update IP ACL.

This request does not require authorization.

type LogDownloadParams

type LogDownloadParams struct {
	// Output format.
	//
	// Possible values:
	//
	// - csv
	// - tsv
	Format string `query:"format" api:"required" json:"-"`
	// Start date and time of the requested time period (ISO 8601/RFC 3339 format,
	// UTC.)
	//
	// Difference between "from" and "to" cannot exceed 6 hours.
	//
	// Examples:
	//
	// - &from=2021-06-14T00:00:00Z
	// - &from=2021-06-14T00:00:00.000Z
	From string `query:"from" api:"required" json:"-"`
	// End date and time of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	//
	// Difference between "from" and "to" cannot exceed 6 hours.
	//
	// Examples:
	//
	// - &to=2021-06-15T00:00:00Z
	// - &to=2021-06-15T00:00:00.000Z
	To string `query:"to" api:"required" json:"-"`
	// Caching status. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE',
	// 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'.
	CacheStatusEq param.Opt[string] `query:"cache_status__eq,omitzero" json:"-"`
	// List of caching statuses. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE',
	// 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'. Values should be separated by
	// a comma.
	CacheStatusIn param.Opt[string] `query:"cache_status__in,omitzero" json:"-"`
	// Caching status not equal to the specified value. Possible values: 'MISS',
	// 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'.
	CacheStatusNe param.Opt[string] `query:"cache_status__ne,omitzero" json:"-"`
	// List of caching statuses not equal to the specified values. Possible values:
	// 'MISS', 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED',
	// 'HIT', '-'. Values should be separated by a comma.
	CacheStatusNotIn param.Opt[string] `query:"cache_status__not_in,omitzero" json:"-"`
	// IP address of the client who sent the request.
	ClientIPEq param.Opt[string] `query:"client_ip__eq,omitzero" json:"-"`
	// List of IP addresses of the clients who sent the request.
	ClientIPIn param.Opt[string] `query:"client_ip__in,omitzero" json:"-"`
	// IP address of the client who did not send the request.
	ClientIPNe param.Opt[string] `query:"client_ip__ne,omitzero" json:"-"`
	// List of IP addresses of the clients who did not send the request.
	ClientIPNotIn param.Opt[string] `query:"client_ip__not_in,omitzero" json:"-"`
	// Part of the custom domain of the requested CDN resource. Minimum length is 3
	// characters.
	CnameContains param.Opt[string] `query:"cname__contains,omitzero" json:"-"`
	// Custom domain of the requested CDN resource.
	CnameEq param.Opt[string] `query:"cname__eq,omitzero" json:"-"`
	// List of custom domains of the requested CDN resource. Values should be separated
	// by a comma.
	CnameIn param.Opt[string] `query:"cname__in,omitzero" json:"-"`
	// Custom domain of the requested CDN resource not equal to the specified value.
	CnameNe param.Opt[string] `query:"cname__ne,omitzero" json:"-"`
	// List of custom domains of the requested CDN resource not equal to the specified
	// values. Values should be separated by a comma.
	CnameNotIn param.Opt[string] `query:"cname__not_in,omitzero" json:"-"`
	// Data center where request was processed.
	DatacenterEq param.Opt[string] `query:"datacenter__eq,omitzero" json:"-"`
	// List of data centers where request was processed. Values should be separated by
	// a comma.
	DatacenterIn param.Opt[string] `query:"datacenter__in,omitzero" json:"-"`
	// Data center where request was not processed.
	DatacenterNe param.Opt[string] `query:"datacenter__ne,omitzero" json:"-"`
	// List of data centers where request was not processed. Values should be separated
	// by a comma.
	DatacenterNotIn param.Opt[string] `query:"datacenter__not_in,omitzero" json:"-"`
	// A comma-separated list of returned fields.
	//
	// Supported fields are presented in the responses section.
	//
	// Example:
	//
	// - &fields=timestamp,path,status
	Fields param.Opt[string] `query:"fields,omitzero" json:"-"`
	// Maximum number of log records in the response.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
	// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'.
	MethodEq param.Opt[string] `query:"method__eq,omitzero" json:"-"`
	// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
	// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'. Values should be separated by a
	// comma.
	MethodIn param.Opt[string] `query:"method__in,omitzero" json:"-"`
	// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
	// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'.
	MethodNe param.Opt[string] `query:"method__ne,omitzero" json:"-"`
	// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
	// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'. Values should be separated by a
	// comma.
	MethodNotIn param.Opt[string] `query:"method__not_in,omitzero" json:"-"`
	// Number of log records to skip starting from the beginning of the requested
	// period.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// ID of the requested CDN resource equal to the specified value.
	ResourceIDEq param.Opt[int64] `query:"resource_id__eq,omitzero" json:"-"`
	// ID of the requested CDN resource greater than the specified value.
	ResourceIDGt param.Opt[int64] `query:"resource_id__gt,omitzero" json:"-"`
	// ID of the requested CDN resource greater than or equal to the specified value.
	ResourceIDGte param.Opt[int64] `query:"resource_id__gte,omitzero" json:"-"`
	// List of IDs of the requested CDN resource. Values should be separated by a
	// comma.
	ResourceIDIn param.Opt[string] `query:"resource_id__in,omitzero" json:"-"`
	// ID of the requested CDN resource less than the specified value.
	ResourceIDLt param.Opt[int64] `query:"resource_id__lt,omitzero" json:"-"`
	// ID of the requested CDN resource less than or equal to the specified value.
	ResourceIDLte param.Opt[int64] `query:"resource_id__lte,omitzero" json:"-"`
	// ID of the requested CDN resource not equal to the specified value.
	ResourceIDNe param.Opt[int64] `query:"resource_id__ne,omitzero" json:"-"`
	// List of IDs of the requested CDN resource not equal to the specified values.
	// Values should be separated by a comma.
	ResourceIDNotIn param.Opt[string] `query:"resource_id__not_in,omitzero" json:"-"`
	// Response size in bytes equal to the specified value.
	SizeEq param.Opt[int64] `query:"size__eq,omitzero" json:"-"`
	// Response size in bytes greater than the specified value.
	SizeGt param.Opt[int64] `query:"size__gt,omitzero" json:"-"`
	// Response size in bytes greater than or equal to the specified value.
	SizeGte param.Opt[int64] `query:"size__gte,omitzero" json:"-"`
	// List of response sizes in bytes. Values should be separated by a comma.
	SizeIn param.Opt[string] `query:"size__in,omitzero" json:"-"`
	// Response size in bytes less than the specified value.
	SizeLt param.Opt[int64] `query:"size__lt,omitzero" json:"-"`
	// Response size in bytes less than or equal to the specified value.
	SizeLte param.Opt[int64] `query:"size__lte,omitzero" json:"-"`
	// Response size in bytes not equal to the specified value.
	SizeNe param.Opt[int64] `query:"size__ne,omitzero" json:"-"`
	// List of response sizes in bytes not equal to the specified values. Values should
	// be separated by
	SizeNotIn param.Opt[string] `query:"size__not_in,omitzero" json:"-"`
	// Sorting rules.
	//
	// Possible values:
	//
	// - **method** - Request HTTP method.
	// - **`client_ip`** - IP address of the client who sent the request.
	// - **status** - Status code in the response.
	// - **size** - Response size in bytes.
	// - **cname** - Custom domain of the requested resource.
	// - **`resource_id`** - ID of the requested CDN resource.
	// - **`cache_status`** - Caching status.
	// - **datacenter** - Data center where request was processed.
	// - **timestamp** - Date and time when the request was made.
	//
	// May include multiple values separated by a comma.
	//
	// Example:
	//
	// - &sort=-timestamp,status
	Sort param.Opt[string] `query:"sort,omitzero" json:"-"`
	// Status code in the response equal to the specified value.
	StatusEq param.Opt[int64] `query:"status__eq,omitzero" json:"-"`
	// Status code in the response greater than the specified value.
	StatusGt param.Opt[int64] `query:"status__gt,omitzero" json:"-"`
	// Status code in the response greater than or equal to the specified value.
	StatusGte param.Opt[int64] `query:"status__gte,omitzero" json:"-"`
	// List of status codes in the response. Values should be separated by a comma.
	StatusIn param.Opt[string] `query:"status__in,omitzero" json:"-"`
	// Status code in the response less than the specified value.
	StatusLt param.Opt[int64] `query:"status__lt,omitzero" json:"-"`
	// Status code in the response less than or equal to the specified value.
	StatusLte param.Opt[int64] `query:"status__lte,omitzero" json:"-"`
	// Status code in the response not equal to the specified value.
	StatusNe param.Opt[int64] `query:"status__ne,omitzero" json:"-"`
	// List of status codes not in the response. Values should be separated by a comma.
	StatusNotIn param.Opt[string] `query:"status__not_in,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (LogDownloadParams) URLQuery

func (r LogDownloadParams) URLQuery() (v url.Values, err error)

URLQuery serializes LogDownloadParams's query parameters as `url.Values`.

type LogListParams

type LogListParams struct {
	// Start date and time of the requested time period (ISO 8601/RFC 3339 format,
	// UTC.)
	//
	// Difference between "from" and "to" cannot exceed 6 hours.
	//
	// Examples:
	//
	// - &from=2021-06-14T00:00:00Z
	// - &from=2021-06-14T00:00:00.000Z
	From string `query:"from" api:"required" json:"-"`
	// End date and time of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	//
	// Difference between "from" and "to" cannot exceed 6 hours.
	//
	// Examples:
	//
	// - &to=2021-06-15T00:00:00Z
	// - &to=2021-06-15T00:00:00.000Z
	To string `query:"to" api:"required" json:"-"`
	// Caching status. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE',
	// 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'.
	CacheStatusEq param.Opt[string] `query:"cache_status__eq,omitzero" json:"-"`
	// List of caching statuses. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE',
	// 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'. Values should be separated by
	// a comma.
	CacheStatusIn param.Opt[string] `query:"cache_status__in,omitzero" json:"-"`
	// Caching status not equal to the specified value. Possible values: 'MISS',
	// 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'.
	CacheStatusNe param.Opt[string] `query:"cache_status__ne,omitzero" json:"-"`
	// List of caching statuses not equal to the specified values. Possible values:
	// 'MISS', 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED',
	// 'HIT', '-'. Values should be separated by a comma.
	CacheStatusNotIn param.Opt[string] `query:"cache_status__not_in,omitzero" json:"-"`
	// IP address of the client who sent the request.
	ClientIPEq param.Opt[string] `query:"client_ip__eq,omitzero" json:"-"`
	// List of IP addresses of the clients who sent the request.
	ClientIPIn param.Opt[string] `query:"client_ip__in,omitzero" json:"-"`
	// IP address of the client who did not send the request.
	ClientIPNe param.Opt[string] `query:"client_ip__ne,omitzero" json:"-"`
	// List of IP addresses of the clients who did not send the request.
	ClientIPNotIn param.Opt[string] `query:"client_ip__not_in,omitzero" json:"-"`
	// Part of the custom domain of the requested CDN resource. Minimum length is 3
	// characters.
	CnameContains param.Opt[string] `query:"cname__contains,omitzero" json:"-"`
	// Custom domain of the requested CDN resource.
	CnameEq param.Opt[string] `query:"cname__eq,omitzero" json:"-"`
	// List of custom domains of the requested CDN resource. Values should be separated
	// by a comma.
	CnameIn param.Opt[string] `query:"cname__in,omitzero" json:"-"`
	// Custom domain of the requested CDN resource not equal to the specified value.
	CnameNe param.Opt[string] `query:"cname__ne,omitzero" json:"-"`
	// List of custom domains of the requested CDN resource not equal to the specified
	// values. Values should be separated by a comma.
	CnameNotIn param.Opt[string] `query:"cname__not_in,omitzero" json:"-"`
	// Data center where request was processed.
	DatacenterEq param.Opt[string] `query:"datacenter__eq,omitzero" json:"-"`
	// List of data centers where request was processed. Values should be separated by
	// a comma.
	DatacenterIn param.Opt[string] `query:"datacenter__in,omitzero" json:"-"`
	// Data center where request was not processed.
	DatacenterNe param.Opt[string] `query:"datacenter__ne,omitzero" json:"-"`
	// List of data centers where request was not processed. Values should be separated
	// by a comma.
	DatacenterNotIn param.Opt[string] `query:"datacenter__not_in,omitzero" json:"-"`
	// A comma-separated list of returned fields.
	//
	// Supported fields are presented in the responses section.
	//
	// Example:
	//
	// - &fields=timestamp,path,status
	Fields param.Opt[string] `query:"fields,omitzero" json:"-"`
	// Maximum number of log records in the response.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
	// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'.
	MethodEq param.Opt[string] `query:"method__eq,omitzero" json:"-"`
	// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
	// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'. Values should be separated by a
	// comma.
	MethodIn param.Opt[string] `query:"method__in,omitzero" json:"-"`
	// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
	// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'.
	MethodNe param.Opt[string] `query:"method__ne,omitzero" json:"-"`
	// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
	// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'. Values should be separated by a
	// comma.
	MethodNotIn param.Opt[string] `query:"method__not_in,omitzero" json:"-"`
	// Number of log records to skip starting from the beginning of the requested
	// period.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Sorting rules.
	//
	// Possible values:
	//
	// - **method** - Request HTTP method.
	// - **`client_ip`** - IP address of the client who sent the request.
	// - **status** - Status code in the response.
	// - **size** - Response size in bytes.
	// - **cname** - Custom domain of the requested resource.
	// - **`resource_id`** - ID of the requested CDN resource.
	// - **`cache_status`** - Caching status.
	// - **datacenter** - Data center where request was processed.
	// - **timestamp** - Date and time when the request was made.
	//
	// Parameter may have multiple values separated by a comma.
	//
	// By default, ascending sorting is applied. To sort in descending order, add '-'
	// prefix.
	//
	// Example:
	//
	// - &ordering=-timestamp,status
	Ordering param.Opt[string] `query:"ordering,omitzero" json:"-"`
	// ID of the requested CDN resource equal to the specified value.
	ResourceIDEq param.Opt[int64] `query:"resource_id__eq,omitzero" json:"-"`
	// ID of the requested CDN resource greater than the specified value.
	ResourceIDGt param.Opt[int64] `query:"resource_id__gt,omitzero" json:"-"`
	// ID of the requested CDN resource greater than or equal to the specified value.
	ResourceIDGte param.Opt[int64] `query:"resource_id__gte,omitzero" json:"-"`
	// List of IDs of the requested CDN resource. Values should be separated by a
	// comma.
	ResourceIDIn param.Opt[string] `query:"resource_id__in,omitzero" json:"-"`
	// ID of the requested CDN resource less than the specified value.
	ResourceIDLt param.Opt[int64] `query:"resource_id__lt,omitzero" json:"-"`
	// ID of the requested CDN resource less than or equal to the specified value.
	ResourceIDLte param.Opt[int64] `query:"resource_id__lte,omitzero" json:"-"`
	// ID of the requested CDN resource not equal to the specified value.
	ResourceIDNe param.Opt[int64] `query:"resource_id__ne,omitzero" json:"-"`
	// List of IDs of the requested CDN resource not equal to the specified values.
	// Values should be separated by a comma.
	ResourceIDNotIn param.Opt[string] `query:"resource_id__not_in,omitzero" json:"-"`
	// Response size in bytes equal to the specified value.
	SizeEq param.Opt[int64] `query:"size__eq,omitzero" json:"-"`
	// Response size in bytes greater than the specified value.
	SizeGt param.Opt[int64] `query:"size__gt,omitzero" json:"-"`
	// Response size in bytes greater than or equal to the specified value.
	SizeGte param.Opt[int64] `query:"size__gte,omitzero" json:"-"`
	// List of response sizes in bytes. Values should be separated by a comma.
	SizeIn param.Opt[string] `query:"size__in,omitzero" json:"-"`
	// Response size in bytes less than the specified value.
	SizeLt param.Opt[int64] `query:"size__lt,omitzero" json:"-"`
	// Response size in bytes less than or equal to the specified value.
	SizeLte param.Opt[int64] `query:"size__lte,omitzero" json:"-"`
	// Response size in bytes not equal to the specified value.
	SizeNe param.Opt[int64] `query:"size__ne,omitzero" json:"-"`
	// List of response sizes in bytes not equal to the specified values. Values should
	// be separated by
	SizeNotIn param.Opt[string] `query:"size__not_in,omitzero" json:"-"`
	// Status code in the response equal to the specified value.
	StatusEq param.Opt[int64] `query:"status__eq,omitzero" json:"-"`
	// Status code in the response greater than the specified value.
	StatusGt param.Opt[int64] `query:"status__gt,omitzero" json:"-"`
	// Status code in the response greater than or equal to the specified value.
	StatusGte param.Opt[int64] `query:"status__gte,omitzero" json:"-"`
	// List of status codes in the response. Values should be separated by a comma.
	StatusIn param.Opt[string] `query:"status__in,omitzero" json:"-"`
	// Status code in the response less than the specified value.
	StatusLt param.Opt[int64] `query:"status__lt,omitzero" json:"-"`
	// Status code in the response less than or equal to the specified value.
	StatusLte param.Opt[int64] `query:"status__lte,omitzero" json:"-"`
	// Status code in the response not equal to the specified value.
	StatusNe param.Opt[int64] `query:"status__ne,omitzero" json:"-"`
	// List of status codes not in the response. Values should be separated by a comma.
	StatusNotIn param.Opt[string] `query:"status__not_in,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (LogListParams) URLQuery

func (r LogListParams) URLQuery() (v url.Values, err error)

URLQuery serializes LogListParams's query parameters as `url.Values`.

type LogService

type LogService struct {
	Options []option.RequestOption
}

Log viewer provides you with general information about CDN operation. This information does not contain all possible sets of fields and restricted by time. To receive full data, use Logs Uploader.

LogService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLogService method instead.

func NewLogService

func NewLogService(opts ...option.RequestOption) (r LogService)

NewLogService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*LogService) Download

func (r *LogService) Download(ctx context.Context, query LogDownloadParams, opts ...option.RequestOption) (res *http.Response, err error)

Download CDN logs for up to 3 days starting today.

You can filter logs using query params by client IP, CDN resource, date, path and etc.

func (*LogService) List

Get CDN logs for up to 3 days starting today.

You can filter logs using query parameters by client IP, CDN resource, date, path and etc.

To filter the CDN logs by 2xx status codes, use:

- &`status__gte`=200&`status__lt`=300

func (*LogService) ListAutoPaging

Get CDN logs for up to 3 days starting today.

You can filter logs using query parameters by client IP, CDN resource, date, path and etc.

To filter the CDN logs by 2xx status codes, use:

- &`status__gte`=200&`status__lt`=300

type LogsAggregatedStats

type LogsAggregatedStats struct {
	// CDN resource ID for which statistics data is shown.
	Number1Example any `json:"1 (example)"`
	// Statistics parameters.
	Metrics any `json:"metrics"`
	// Number of resources that used Logs uploader.
	RawLogsUsage string `json:"raw_logs_usage"`
	// Resources IDs by which statistics data is grouped..
	Resource any `json:"resource"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Number1Example respjson.Field
		Metrics        respjson.Field
		RawLogsUsage   respjson.Field
		Resource       respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsAggregatedStats) RawJSON

func (r LogsAggregatedStats) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsAggregatedStats) UnmarshalJSON

func (r *LogsAggregatedStats) UnmarshalJSON(data []byte) error

type LogsUploaderConfig

type LogsUploaderConfig struct {
	ID int64 `json:"id"`
	// Client that owns the config.
	ClientID int64 `json:"client_id"`
	// Time when the config was created.
	Created time.Time `json:"created" format:"date-time"`
	// Enables or disables the config.
	Enabled bool `json:"enabled"`
	// If set to true, the config will be applied to all CDN resources. If set to
	// false, the config will be applied to the resources specified in the `resources`
	// field.
	ForAllResources bool `json:"for_all_resources"`
	// Name of the config.
	Name string `json:"name"`
	// ID of the policy that should be assigned to given config.
	Policy int64 `json:"policy"`
	// List of resource IDs to which the config should be applied.
	Resources []int64 `json:"resources"`
	// Validation status of the logs uploader config.
	Status LogsUploaderConfigStatus `json:"status"`
	// ID of the target to which logs should be uploaded.
	Target int64 `json:"target"`
	// Time when the config was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ClientID        respjson.Field
		Created         respjson.Field
		Enabled         respjson.Field
		ForAllResources respjson.Field
		Name            respjson.Field
		Policy          respjson.Field
		Resources       respjson.Field
		Status          respjson.Field
		Target          respjson.Field
		Updated         respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderConfig) RawJSON

func (r LogsUploaderConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderConfig) UnmarshalJSON

func (r *LogsUploaderConfig) UnmarshalJSON(data []byte) error

type LogsUploaderConfigList

type LogsUploaderConfigList struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string               `json:"previous" api:"required"`
	Results  []LogsUploaderConfig `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderConfigList) RawJSON added in v0.51.0

func (r LogsUploaderConfigList) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderConfigList) UnmarshalJSON added in v0.51.0

func (r *LogsUploaderConfigList) UnmarshalJSON(data []byte) error

type LogsUploaderConfigListParams

type LogsUploaderConfigListParams struct {
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Search by config name or id.
	Search param.Opt[string] `query:"search,omitzero" json:"-"`
	// Filter by ids of CDN resources that are assigned to given config.
	ResourceIDs []int64 `query:"resource_ids,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (LogsUploaderConfigListParams) URLQuery

func (r LogsUploaderConfigListParams) URLQuery() (v url.Values, err error)

URLQuery serializes LogsUploaderConfigListParams's query parameters as `url.Values`.

type LogsUploaderConfigNewParams

type LogsUploaderConfigNewParams struct {
	// Name of the config.
	Name string `json:"name" api:"required"`
	// ID of the policy that should be assigned to given config.
	Policy int64 `json:"policy" api:"required"`
	// ID of the target to which logs should be uploaded.
	Target int64 `json:"target" api:"required"`
	// Enables or disables the config.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// If set to true, the config will be applied to all CDN resources. If set to
	// false, the config will be applied to the resources specified in the `resources`
	// field.
	ForAllResources param.Opt[bool] `json:"for_all_resources,omitzero"`
	// List of resource IDs to which the config should be applied.
	Resources []int64 `json:"resources,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderConfigNewParams) MarshalJSON

func (r LogsUploaderConfigNewParams) MarshalJSON() (data []byte, err error)

func (*LogsUploaderConfigNewParams) UnmarshalJSON

func (r *LogsUploaderConfigNewParams) UnmarshalJSON(data []byte) error

type LogsUploaderConfigReplaceParams

type LogsUploaderConfigReplaceParams struct {
	// Name of the config.
	Name string `json:"name" api:"required"`
	// ID of the policy that should be assigned to given config.
	Policy int64 `json:"policy" api:"required"`
	// ID of the target to which logs should be uploaded.
	Target int64 `json:"target" api:"required"`
	// Enables or disables the config.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// If set to true, the config will be applied to all CDN resources. If set to
	// false, the config will be applied to the resources specified in the `resources`
	// field.
	ForAllResources param.Opt[bool] `json:"for_all_resources,omitzero"`
	// List of resource IDs to which the config should be applied.
	Resources []int64 `json:"resources,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderConfigReplaceParams) MarshalJSON

func (r LogsUploaderConfigReplaceParams) MarshalJSON() (data []byte, err error)

func (*LogsUploaderConfigReplaceParams) UnmarshalJSON

func (r *LogsUploaderConfigReplaceParams) UnmarshalJSON(data []byte) error

type LogsUploaderConfigService

type LogsUploaderConfigService struct {
	Options []option.RequestOption
}

Logs uploader configs tie a logs uploader policy to one or more targets and a set of CDN resources, controlling which access logs are uploaded and where they are delivered.

LogsUploaderConfigService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLogsUploaderConfigService method instead.

func NewLogsUploaderConfigService

func NewLogsUploaderConfigService(opts ...option.RequestOption) (r LogsUploaderConfigService)

NewLogsUploaderConfigService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*LogsUploaderConfigService) Delete

func (r *LogsUploaderConfigService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)

Delete the logs uploader config from the system permanently.

Notes:

  • **Irreversibility**: This action is irreversible. Once deleted, the logs uploader config cannot be recovered.

func (*LogsUploaderConfigService) Get

Get information about logs uploader config.

func (*LogsUploaderConfigService) List

Get list of logs uploader configs.

func (*LogsUploaderConfigService) ListAutoPaging added in v0.51.0

Get list of logs uploader configs.

func (*LogsUploaderConfigService) New

Create logs uploader config.

func (*LogsUploaderConfigService) Replace

Change logs uploader config.

func (*LogsUploaderConfigService) Update

Change logs uploader config partially.

func (*LogsUploaderConfigService) Validate

Validate logs uploader config.

type LogsUploaderConfigStatus

type LogsUploaderConfigStatus struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader config.

func (LogsUploaderConfigStatus) RawJSON

func (r LogsUploaderConfigStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderConfigStatus) UnmarshalJSON

func (r *LogsUploaderConfigStatus) UnmarshalJSON(data []byte) error

type LogsUploaderConfigUpdateParams

type LogsUploaderConfigUpdateParams struct {
	// Enables or disables the config.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// If set to true, the config will be applied to all CDN resources. If set to
	// false, the config will be applied to the resources specified in the `resources`
	// field.
	ForAllResources param.Opt[bool] `json:"for_all_resources,omitzero"`
	// Name of the config.
	Name param.Opt[string] `json:"name,omitzero"`
	// ID of the policy that should be assigned to given config.
	Policy param.Opt[int64] `json:"policy,omitzero"`
	// ID of the target to which logs should be uploaded.
	Target param.Opt[int64] `json:"target,omitzero"`
	// List of resource IDs to which the config should be applied.
	Resources []int64 `json:"resources,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderConfigUpdateParams) MarshalJSON

func (r LogsUploaderConfigUpdateParams) MarshalJSON() (data []byte, err error)

func (*LogsUploaderConfigUpdateParams) UnmarshalJSON

func (r *LogsUploaderConfigUpdateParams) UnmarshalJSON(data []byte) error

type LogsUploaderPolicy

type LogsUploaderPolicy struct {
	ID int64 `json:"id"`
	// Client that owns the policy.
	ClientID int64 `json:"client_id"`
	// Time when logs uploader policy was created.
	Created time.Time `json:"created" format:"date-time"`
	// Date format for logs.
	DateFormat string `json:"date_format"`
	// Description of the policy.
	Description string `json:"description"`
	// When set to true, the service sanitizes string values by escaping characters
	// that may be unsafe for transport, logging, or downstream processing.
	//
	// The following categories of characters are escaped:
	//
	// - Control and non-printable characters
	// - Quotation marks and escape characters
	// - Characters outside the standard ASCII range
	//
	// The resulting output contains only printable ASCII characters.
	EscapeSpecialCharacters bool `json:"escape_special_characters"`
	// Per-field value conversions for exported logs. Maps a canonical Gcore field name
	// to the pipeline applied to its values. Field names are limited to 255 characters
	// and must not be empty. Each key must be present in `fields`, and each conversion
	// type must be listed in that field's `allowed_conversions` from
	// `/cdn/v2/logs_uploader/policies/fields`. Conversions in a pipeline are applied
	// in array order. Values are converted independently of `field_remap`, which
	// renames the exported field: both are keyed on the canonical field name.
	FieldConversions map[string]LogsUploaderPolicyFieldConversion `json:"field_conversions"`
	// Field delimiter for logs.
	FieldDelimiter string `json:"field_delimiter"`
	// Per-field output-name remap for exported logs. Maps a canonical Gcore field name
	// (from `/cdn/logs_uploader/policies/fields`, and must be present in `fields`) to
	// the field name it should have in the exported logs. Unmapped fields keep their
	// canonical name. Output names (after remapping) must be unique.
	FieldRemap map[string]string `json:"field_remap"`
	// Field separator for logs.
	FieldSeparator string `json:"field_separator"`
	// List of fields to include in logs. Duplicate names are allowed for plain text
	// output, but rejected when `format_type` is `json` or a `field_remap` is set
	// (each field becomes a distinct output key).
	Fields []string `json:"fields"`
	// Template for log file name.
	FileNameTemplate string `json:"file_name_template"`
	// Format type for logs.
	//
	// Possible values:
	//
	//   - **""** - empty, it means it will apply the format configurations from the
	//     policy.
	//   - **"json"** - output the logs as json lines.
	//
	// Any of "json", "".
	FormatType LogsUploaderPolicyFormatType `json:"format_type"`
	// Include empty logs in the upload.
	IncludeEmptyLogs bool `json:"include_empty_logs"`
	// Include logs from origin shielding in the upload.
	IncludeShieldLogs bool `json:"include_shield_logs"`
	// Sampling rate for logs. A value between 0 and 1 that determines the fraction of
	// log entries to collect.
	//
	//   - **1** - collect all logs (default).
	//   - **0.5** - collect approximately 50% of logs.
	//   - **0** - collect no logs (effectively disables logging without removing the
	//     policy).
	LogSampleRate float64 `json:"log_sample_rate"`
	// Name of the policy.
	Name string `json:"name"`
	// List of logs uploader configs that use this policy.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Interval in minutes to retry failed uploads.
	RetryIntervalMinutes int64 `json:"retry_interval_minutes"`
	// Interval in minutes to rotate logs.
	RotateIntervalMinutes int64 `json:"rotate_interval_minutes"`
	// Threshold in lines to rotate logs.
	RotateThresholdLines int64 `json:"rotate_threshold_lines"`
	// Threshold in MB to rotate logs.
	RotateThresholdMB int64 `json:"rotate_threshold_mb" api:"nullable"`
	// Tags allow for dynamic decoration of logs by adding predefined fields to the log
	// format. These tags serve as customizable key-value pairs that can be included in
	// log entries to enhance context and readability.
	Tags map[string]string `json:"tags"`
	// Time when logs uploader policy was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                      respjson.Field
		ClientID                respjson.Field
		Created                 respjson.Field
		DateFormat              respjson.Field
		Description             respjson.Field
		EscapeSpecialCharacters respjson.Field
		FieldConversions        respjson.Field
		FieldDelimiter          respjson.Field
		FieldRemap              respjson.Field
		FieldSeparator          respjson.Field
		Fields                  respjson.Field
		FileNameTemplate        respjson.Field
		FormatType              respjson.Field
		IncludeEmptyLogs        respjson.Field
		IncludeShieldLogs       respjson.Field
		LogSampleRate           respjson.Field
		Name                    respjson.Field
		RelatedUploaderConfigs  respjson.Field
		RetryIntervalMinutes    respjson.Field
		RotateIntervalMinutes   respjson.Field
		RotateThresholdLines    respjson.Field
		RotateThresholdMB       respjson.Field
		Tags                    respjson.Field
		Updated                 respjson.Field
		ExtraFields             map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderPolicy) RawJSON

func (r LogsUploaderPolicy) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderPolicy) UnmarshalJSON

func (r *LogsUploaderPolicy) UnmarshalJSON(data []byte) error

type LogsUploaderPolicyField added in v0.57.0

type LogsUploaderPolicyField struct {
	// Conversion types this field permits in `field_conversions`. Empty when the field
	// permits none.
	//
	// Any of "scale", "replace".
	AllowedConversions []string `json:"allowed_conversions" api:"required"`
	// Canonical Gcore field name, or `-` as the skipped-column placeholder, selectable
	// in a policy's `fields`.
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowedConversions respjson.Field
		Name               respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderPolicyField) RawJSON added in v0.57.0

func (r LogsUploaderPolicyField) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderPolicyField) UnmarshalJSON added in v0.57.0

func (r *LogsUploaderPolicyField) UnmarshalJSON(data []byte) error

type LogsUploaderPolicyFieldConversion added in v0.57.0

type LogsUploaderPolicyFieldConversion struct {
	Conversions []LogsUploaderPolicyFieldConversionConversionUnion `json:"conversions" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Conversions respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderPolicyFieldConversion) RawJSON added in v0.57.0

Returns the unmodified JSON received from the API

func (*LogsUploaderPolicyFieldConversion) UnmarshalJSON added in v0.57.0

func (r *LogsUploaderPolicyFieldConversion) UnmarshalJSON(data []byte) error

type LogsUploaderPolicyFieldConversionConversionReplace added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionReplace struct {
	Config LogsUploaderPolicyFieldConversionConversionReplaceConfig `json:"config" api:"required"`
	Type   constant.Replace                                         `json:"type" default:"replace"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Config      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderPolicyFieldConversionConversionReplace) RawJSON added in v0.57.0

Returns the unmodified JSON received from the API

func (*LogsUploaderPolicyFieldConversionConversionReplace) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionReplaceConfig added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionReplaceConfig struct {
	// Exact, case-sensitive replacements, matched and written without trimming. Keys
	// must not be empty and are limited to 255 characters; values are limited to 100
	// characters and may be empty.
	Values map[string]string `json:"values" api:"required"`
	// Value used when the input does not match any key in `values`.
	Default string `json:"default"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Values      respjson.Field
		Default     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderPolicyFieldConversionConversionReplaceConfig) RawJSON added in v0.57.0

Returns the unmodified JSON received from the API

func (*LogsUploaderPolicyFieldConversionConversionReplaceConfig) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionScale added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionScale struct {
	Config LogsUploaderPolicyFieldConversionConversionScaleConfig `json:"config" api:"required"`
	Type   constant.Scale                                         `json:"type" default:"scale"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Config      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderPolicyFieldConversionConversionScale) RawJSON added in v0.57.0

Returns the unmodified JSON received from the API

func (*LogsUploaderPolicyFieldConversionConversionScale) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionScaleConfig added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionScaleConfig struct {
	// Multiplier applied to the field value.
	Factor float64 `json:"factor" api:"required"`
	// Optional number of decimal places in the converted value. Must be specified
	// together with `rounding`; returned as `null` when unspecified.
	Precision int64 `json:"precision" api:"nullable"`
	// Optional rounding mode. Must be specified together with `precision`; returned as
	// `null` when unspecified.
	//
	// Any of "nearest", "down", "up".
	Rounding string `json:"rounding" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Factor      respjson.Field
		Precision   respjson.Field
		Rounding    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderPolicyFieldConversionConversionScaleConfig) RawJSON added in v0.57.0

Returns the unmodified JSON received from the API

func (*LogsUploaderPolicyFieldConversionConversionScaleConfig) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionUnion added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionUnion struct {
	// This field is a union of
	// [LogsUploaderPolicyFieldConversionConversionScaleConfig],
	// [LogsUploaderPolicyFieldConversionConversionReplaceConfig]
	Config LogsUploaderPolicyFieldConversionConversionUnionConfig `json:"config"`
	// Any of "scale", "replace".
	Type string `json:"type"`
	JSON struct {
		Config respjson.Field
		Type   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LogsUploaderPolicyFieldConversionConversionUnion contains all possible properties and values from LogsUploaderPolicyFieldConversionConversionScale, LogsUploaderPolicyFieldConversionConversionReplace.

Use the LogsUploaderPolicyFieldConversionConversionUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (LogsUploaderPolicyFieldConversionConversionUnion) AsAny added in v0.57.0

func (u LogsUploaderPolicyFieldConversionConversionUnion) AsAny() anyLogsUploaderPolicyFieldConversionConversion

Use the following switch statement to find the correct variant

switch variant := LogsUploaderPolicyFieldConversionConversionUnion.AsAny().(type) {
case cdn.LogsUploaderPolicyFieldConversionConversionScale:
case cdn.LogsUploaderPolicyFieldConversionConversionReplace:
default:
  fmt.Errorf("no variant present")
}

func (LogsUploaderPolicyFieldConversionConversionUnion) AsReplace added in v0.57.0

func (LogsUploaderPolicyFieldConversionConversionUnion) AsScale added in v0.57.0

func (LogsUploaderPolicyFieldConversionConversionUnion) RawJSON added in v0.57.0

Returns the unmodified JSON received from the API

func (*LogsUploaderPolicyFieldConversionConversionUnion) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionUnionConfig added in v0.57.0

type LogsUploaderPolicyFieldConversionConversionUnionConfig struct {
	// This field is from variant
	// [LogsUploaderPolicyFieldConversionConversionScaleConfig].
	Factor float64 `json:"factor"`
	// This field is from variant
	// [LogsUploaderPolicyFieldConversionConversionScaleConfig].
	Precision int64 `json:"precision"`
	// This field is from variant
	// [LogsUploaderPolicyFieldConversionConversionScaleConfig].
	Rounding string `json:"rounding"`
	// This field is from variant
	// [LogsUploaderPolicyFieldConversionConversionReplaceConfig].
	Values map[string]string `json:"values"`
	// This field is from variant
	// [LogsUploaderPolicyFieldConversionConversionReplaceConfig].
	Default string `json:"default"`
	JSON    struct {
		Factor    respjson.Field
		Precision respjson.Field
		Rounding  respjson.Field
		Values    respjson.Field
		Default   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LogsUploaderPolicyFieldConversionConversionUnionConfig is an implicit subunion of LogsUploaderPolicyFieldConversionConversionUnion. LogsUploaderPolicyFieldConversionConversionUnionConfig provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the LogsUploaderPolicyFieldConversionConversionUnion.

func (*LogsUploaderPolicyFieldConversionConversionUnionConfig) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyFormatType added in v0.29.0

type LogsUploaderPolicyFormatType string

Format type for logs.

Possible values:

  • **""** - empty, it means it will apply the format configurations from the policy.
  • **"json"** - output the logs as json lines.
const (
	LogsUploaderPolicyFormatTypeJson  LogsUploaderPolicyFormatType = "json"
	LogsUploaderPolicyFormatTypeEmpty LogsUploaderPolicyFormatType = ""
)

type LogsUploaderPolicyList

type LogsUploaderPolicyList struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string               `json:"previous" api:"required"`
	Results  []LogsUploaderPolicy `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderPolicyList) RawJSON added in v0.51.0

func (r LogsUploaderPolicyList) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderPolicyList) UnmarshalJSON added in v0.51.0

func (r *LogsUploaderPolicyList) UnmarshalJSON(data []byte) error

type LogsUploaderPolicyListParams

type LogsUploaderPolicyListParams struct {
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Search by policy name or id.
	Search param.Opt[string] `query:"search,omitzero" json:"-"`
	// Filter by ids of related logs uploader configs that use given policy.
	ConfigIDs []int64 `query:"config_ids,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (LogsUploaderPolicyListParams) URLQuery

func (r LogsUploaderPolicyListParams) URLQuery() (v url.Values, err error)

URLQuery serializes LogsUploaderPolicyListParams's query parameters as `url.Values`.

type LogsUploaderPolicyNewParams

type LogsUploaderPolicyNewParams struct {
	// Threshold in MB to rotate logs.
	RotateThresholdMB param.Opt[int64] `json:"rotate_threshold_mb,omitzero"`
	// Date format for logs.
	DateFormat param.Opt[string] `json:"date_format,omitzero"`
	// Description of the policy.
	Description param.Opt[string] `json:"description,omitzero"`
	// When set to true, the service sanitizes string values by escaping characters
	// that may be unsafe for transport, logging, or downstream processing.
	//
	// The following categories of characters are escaped:
	//
	// - Control and non-printable characters
	// - Quotation marks and escape characters
	// - Characters outside the standard ASCII range
	//
	// The resulting output contains only printable ASCII characters.
	EscapeSpecialCharacters param.Opt[bool] `json:"escape_special_characters,omitzero"`
	// Field delimiter for logs.
	FieldDelimiter param.Opt[string] `json:"field_delimiter,omitzero"`
	// Field separator for logs.
	FieldSeparator param.Opt[string] `json:"field_separator,omitzero"`
	// Template for log file name.
	FileNameTemplate param.Opt[string] `json:"file_name_template,omitzero"`
	// Include empty logs in the upload.
	IncludeEmptyLogs param.Opt[bool] `json:"include_empty_logs,omitzero"`
	// Include logs from origin shielding in the upload.
	IncludeShieldLogs param.Opt[bool] `json:"include_shield_logs,omitzero"`
	// Sampling rate for logs. A value between 0 and 1 that determines the fraction of
	// log entries to collect.
	//
	//   - **1** - collect all logs (default).
	//   - **0.5** - collect approximately 50% of logs.
	//   - **0** - collect no logs (effectively disables logging without removing the
	//     policy).
	LogSampleRate param.Opt[float64] `json:"log_sample_rate,omitzero"`
	// Name of the policy.
	Name param.Opt[string] `json:"name,omitzero"`
	// Interval in minutes to retry failed uploads.
	RetryIntervalMinutes param.Opt[int64] `json:"retry_interval_minutes,omitzero"`
	// Interval in minutes to rotate logs.
	RotateIntervalMinutes param.Opt[int64] `json:"rotate_interval_minutes,omitzero"`
	// Threshold in lines to rotate logs.
	RotateThresholdLines param.Opt[int64] `json:"rotate_threshold_lines,omitzero"`
	// Per-field value conversions for exported logs. Maps a canonical Gcore field name
	// to the pipeline applied to its values. Field names are limited to 255 characters
	// and must not be empty. Each key must be present in `fields`, and each conversion
	// type must be listed in that field's `allowed_conversions` from
	// `/cdn/v2/logs_uploader/policies/fields`. Conversions in a pipeline are applied
	// in array order. Values are converted independently of `field_remap`, which
	// renames the exported field: both are keyed on the canonical field name.
	FieldConversions map[string]LogsUploaderPolicyNewParamsFieldConversion `json:"field_conversions,omitzero"`
	// Per-field output-name remap for exported logs. Maps a canonical Gcore field name
	// (from `/cdn/logs_uploader/policies/fields`, and must be present in `fields`) to
	// the field name it should have in the exported logs. Unmapped fields keep their
	// canonical name. Output names (after remapping) must be unique.
	FieldRemap map[string]string `json:"field_remap,omitzero"`
	// List of fields to include in logs. Duplicate names are allowed for plain text
	// output, but rejected when `format_type` is `json` or a `field_remap` is set
	// (each field becomes a distinct output key).
	Fields []string `json:"fields,omitzero"`
	// Format type for logs.
	//
	// Possible values:
	//
	//   - **""** - empty, it means it will apply the format configurations from the
	//     policy.
	//   - **"json"** - output the logs as json lines.
	//
	// Any of "json", "".
	FormatType LogsUploaderPolicyNewParamsFormatType `json:"format_type,omitzero"`
	// Tags allow for dynamic decoration of logs by adding predefined fields to the log
	// format. These tags serve as customizable key-value pairs that can be included in
	// log entries to enhance context and readability.
	Tags map[string]string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderPolicyNewParams) MarshalJSON

func (r LogsUploaderPolicyNewParams) MarshalJSON() (data []byte, err error)

func (*LogsUploaderPolicyNewParams) UnmarshalJSON

func (r *LogsUploaderPolicyNewParams) UnmarshalJSON(data []byte) error

type LogsUploaderPolicyNewParamsFieldConversion added in v0.57.0

type LogsUploaderPolicyNewParamsFieldConversion struct {
	Conversions []LogsUploaderPolicyNewParamsFieldConversionConversionUnion `json:"conversions,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property Conversions is required.

func (LogsUploaderPolicyNewParamsFieldConversion) MarshalJSON added in v0.57.0

func (r LogsUploaderPolicyNewParamsFieldConversion) MarshalJSON() (data []byte, err error)

func (*LogsUploaderPolicyNewParamsFieldConversion) UnmarshalJSON added in v0.57.0

func (r *LogsUploaderPolicyNewParamsFieldConversion) UnmarshalJSON(data []byte) error

type LogsUploaderPolicyNewParamsFieldConversionConversionReplace added in v0.57.0

type LogsUploaderPolicyNewParamsFieldConversionConversionReplace struct {
	Config LogsUploaderPolicyNewParamsFieldConversionConversionReplaceConfig `json:"config,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "replace".
	Type constant.Replace `json:"type" default:"replace"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderPolicyNewParamsFieldConversionConversionReplace) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyNewParamsFieldConversionConversionReplace) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyNewParamsFieldConversionConversionReplaceConfig added in v0.57.0

type LogsUploaderPolicyNewParamsFieldConversionConversionReplaceConfig struct {
	// Exact, case-sensitive replacements, matched and written without trimming. Keys
	// must not be empty and are limited to 255 characters; values are limited to 100
	// characters and may be empty.
	Values map[string]string `json:"values,omitzero" api:"required"`
	// Value used when the input does not match any key in `values`.
	Default param.Opt[string] `json:"default,omitzero"`
	// contains filtered or unexported fields
}

The property Values is required.

func (LogsUploaderPolicyNewParamsFieldConversionConversionReplaceConfig) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyNewParamsFieldConversionConversionReplaceConfig) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyNewParamsFieldConversionConversionScale added in v0.57.0

type LogsUploaderPolicyNewParamsFieldConversionConversionScale struct {
	Config LogsUploaderPolicyNewParamsFieldConversionConversionScaleConfig `json:"config,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "scale".
	Type constant.Scale `json:"type" default:"scale"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderPolicyNewParamsFieldConversionConversionScale) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyNewParamsFieldConversionConversionScale) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyNewParamsFieldConversionConversionScaleConfig added in v0.57.0

type LogsUploaderPolicyNewParamsFieldConversionConversionScaleConfig struct {
	// Multiplier applied to the field value.
	Factor float64 `json:"factor" api:"required"`
	// Optional number of decimal places in the converted value. Must be specified
	// together with `rounding`; returned as `null` when unspecified.
	Precision param.Opt[int64] `json:"precision,omitzero"`
	// Optional rounding mode. Must be specified together with `precision`; returned as
	// `null` when unspecified.
	//
	// Any of "nearest", "down", "up".
	Rounding string `json:"rounding,omitzero"`
	// contains filtered or unexported fields
}

The property Factor is required.

func (LogsUploaderPolicyNewParamsFieldConversionConversionScaleConfig) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyNewParamsFieldConversionConversionScaleConfig) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyNewParamsFieldConversionConversionUnion added in v0.57.0

type LogsUploaderPolicyNewParamsFieldConversionConversionUnion struct {
	OfScale   *LogsUploaderPolicyNewParamsFieldConversionConversionScale   `json:",omitzero,inline"`
	OfReplace *LogsUploaderPolicyNewParamsFieldConversionConversionReplace `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (LogsUploaderPolicyNewParamsFieldConversionConversionUnion) GetConfig added in v0.57.0

func (u LogsUploaderPolicyNewParamsFieldConversionConversionUnion) GetConfig() (res logsUploaderPolicyNewParamsFieldConversionConversionUnionConfig)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (LogsUploaderPolicyNewParamsFieldConversionConversionUnion) GetType added in v0.57.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderPolicyNewParamsFieldConversionConversionUnion) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyNewParamsFieldConversionConversionUnion) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyNewParamsFormatType added in v0.29.0

type LogsUploaderPolicyNewParamsFormatType string

Format type for logs.

Possible values:

  • **""** - empty, it means it will apply the format configurations from the policy.
  • **"json"** - output the logs as json lines.
const (
	LogsUploaderPolicyNewParamsFormatTypeJson  LogsUploaderPolicyNewParamsFormatType = "json"
	LogsUploaderPolicyNewParamsFormatTypeEmpty LogsUploaderPolicyNewParamsFormatType = ""
)

type LogsUploaderPolicyReplaceParams

type LogsUploaderPolicyReplaceParams struct {
	// Threshold in MB to rotate logs.
	RotateThresholdMB param.Opt[int64] `json:"rotate_threshold_mb,omitzero"`
	// Date format for logs.
	DateFormat param.Opt[string] `json:"date_format,omitzero"`
	// Description of the policy.
	Description param.Opt[string] `json:"description,omitzero"`
	// When set to true, the service sanitizes string values by escaping characters
	// that may be unsafe for transport, logging, or downstream processing.
	//
	// The following categories of characters are escaped:
	//
	// - Control and non-printable characters
	// - Quotation marks and escape characters
	// - Characters outside the standard ASCII range
	//
	// The resulting output contains only printable ASCII characters.
	EscapeSpecialCharacters param.Opt[bool] `json:"escape_special_characters,omitzero"`
	// Field delimiter for logs.
	FieldDelimiter param.Opt[string] `json:"field_delimiter,omitzero"`
	// Field separator for logs.
	FieldSeparator param.Opt[string] `json:"field_separator,omitzero"`
	// Template for log file name.
	FileNameTemplate param.Opt[string] `json:"file_name_template,omitzero"`
	// Include empty logs in the upload.
	IncludeEmptyLogs param.Opt[bool] `json:"include_empty_logs,omitzero"`
	// Include logs from origin shielding in the upload.
	IncludeShieldLogs param.Opt[bool] `json:"include_shield_logs,omitzero"`
	// Sampling rate for logs. A value between 0 and 1 that determines the fraction of
	// log entries to collect.
	//
	//   - **1** - collect all logs (default).
	//   - **0.5** - collect approximately 50% of logs.
	//   - **0** - collect no logs (effectively disables logging without removing the
	//     policy).
	LogSampleRate param.Opt[float64] `json:"log_sample_rate,omitzero"`
	// Name of the policy.
	Name param.Opt[string] `json:"name,omitzero"`
	// Interval in minutes to retry failed uploads.
	RetryIntervalMinutes param.Opt[int64] `json:"retry_interval_minutes,omitzero"`
	// Interval in minutes to rotate logs.
	RotateIntervalMinutes param.Opt[int64] `json:"rotate_interval_minutes,omitzero"`
	// Threshold in lines to rotate logs.
	RotateThresholdLines param.Opt[int64] `json:"rotate_threshold_lines,omitzero"`
	// Per-field value conversions for exported logs. Maps a canonical Gcore field name
	// to the pipeline applied to its values. Field names are limited to 255 characters
	// and must not be empty. Each key must be present in `fields`, and each conversion
	// type must be listed in that field's `allowed_conversions` from
	// `/cdn/v2/logs_uploader/policies/fields`. Conversions in a pipeline are applied
	// in array order. Values are converted independently of `field_remap`, which
	// renames the exported field: both are keyed on the canonical field name.
	FieldConversions map[string]LogsUploaderPolicyReplaceParamsFieldConversion `json:"field_conversions,omitzero"`
	// Per-field output-name remap for exported logs. Maps a canonical Gcore field name
	// (from `/cdn/logs_uploader/policies/fields`, and must be present in `fields`) to
	// the field name it should have in the exported logs. Unmapped fields keep their
	// canonical name. Output names (after remapping) must be unique.
	FieldRemap map[string]string `json:"field_remap,omitzero"`
	// List of fields to include in logs. Duplicate names are allowed for plain text
	// output, but rejected when `format_type` is `json` or a `field_remap` is set
	// (each field becomes a distinct output key).
	Fields []string `json:"fields,omitzero"`
	// Format type for logs.
	//
	// Possible values:
	//
	//   - **""** - empty, it means it will apply the format configurations from the
	//     policy.
	//   - **"json"** - output the logs as json lines.
	//
	// Any of "json", "".
	FormatType LogsUploaderPolicyReplaceParamsFormatType `json:"format_type,omitzero"`
	// Tags allow for dynamic decoration of logs by adding predefined fields to the log
	// format. These tags serve as customizable key-value pairs that can be included in
	// log entries to enhance context and readability.
	Tags map[string]string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderPolicyReplaceParams) MarshalJSON

func (r LogsUploaderPolicyReplaceParams) MarshalJSON() (data []byte, err error)

func (*LogsUploaderPolicyReplaceParams) UnmarshalJSON

func (r *LogsUploaderPolicyReplaceParams) UnmarshalJSON(data []byte) error

type LogsUploaderPolicyReplaceParamsFieldConversion added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversion struct {
	Conversions []LogsUploaderPolicyReplaceParamsFieldConversionConversionUnion `json:"conversions,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property Conversions is required.

func (LogsUploaderPolicyReplaceParamsFieldConversion) MarshalJSON added in v0.57.0

func (r LogsUploaderPolicyReplaceParamsFieldConversion) MarshalJSON() (data []byte, err error)

func (*LogsUploaderPolicyReplaceParamsFieldConversion) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversionConversionReplace added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversionConversionReplace struct {
	Config LogsUploaderPolicyReplaceParamsFieldConversionConversionReplaceConfig `json:"config,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "replace".
	Type constant.Replace `json:"type" default:"replace"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderPolicyReplaceParamsFieldConversionConversionReplace) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyReplaceParamsFieldConversionConversionReplace) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversionConversionReplaceConfig added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversionConversionReplaceConfig struct {
	// Exact, case-sensitive replacements, matched and written without trimming. Keys
	// must not be empty and are limited to 255 characters; values are limited to 100
	// characters and may be empty.
	Values map[string]string `json:"values,omitzero" api:"required"`
	// Value used when the input does not match any key in `values`.
	Default param.Opt[string] `json:"default,omitzero"`
	// contains filtered or unexported fields
}

The property Values is required.

func (LogsUploaderPolicyReplaceParamsFieldConversionConversionReplaceConfig) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyReplaceParamsFieldConversionConversionReplaceConfig) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversionConversionScale added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversionConversionScale struct {
	Config LogsUploaderPolicyReplaceParamsFieldConversionConversionScaleConfig `json:"config,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "scale".
	Type constant.Scale `json:"type" default:"scale"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderPolicyReplaceParamsFieldConversionConversionScale) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyReplaceParamsFieldConversionConversionScale) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversionConversionScaleConfig added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversionConversionScaleConfig struct {
	// Multiplier applied to the field value.
	Factor float64 `json:"factor" api:"required"`
	// Optional number of decimal places in the converted value. Must be specified
	// together with `rounding`; returned as `null` when unspecified.
	Precision param.Opt[int64] `json:"precision,omitzero"`
	// Optional rounding mode. Must be specified together with `precision`; returned as
	// `null` when unspecified.
	//
	// Any of "nearest", "down", "up".
	Rounding string `json:"rounding,omitzero"`
	// contains filtered or unexported fields
}

The property Factor is required.

func (LogsUploaderPolicyReplaceParamsFieldConversionConversionScaleConfig) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyReplaceParamsFieldConversionConversionScaleConfig) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversionConversionUnion added in v0.57.0

type LogsUploaderPolicyReplaceParamsFieldConversionConversionUnion struct {
	OfScale   *LogsUploaderPolicyReplaceParamsFieldConversionConversionScale   `json:",omitzero,inline"`
	OfReplace *LogsUploaderPolicyReplaceParamsFieldConversionConversionReplace `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (LogsUploaderPolicyReplaceParamsFieldConversionConversionUnion) GetConfig added in v0.57.0

func (u LogsUploaderPolicyReplaceParamsFieldConversionConversionUnion) GetConfig() (res logsUploaderPolicyReplaceParamsFieldConversionConversionUnionConfig)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (LogsUploaderPolicyReplaceParamsFieldConversionConversionUnion) GetType added in v0.57.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderPolicyReplaceParamsFieldConversionConversionUnion) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyReplaceParamsFieldConversionConversionUnion) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyReplaceParamsFormatType added in v0.29.0

type LogsUploaderPolicyReplaceParamsFormatType string

Format type for logs.

Possible values:

  • **""** - empty, it means it will apply the format configurations from the policy.
  • **"json"** - output the logs as json lines.
const (
	LogsUploaderPolicyReplaceParamsFormatTypeJson  LogsUploaderPolicyReplaceParamsFormatType = "json"
	LogsUploaderPolicyReplaceParamsFormatTypeEmpty LogsUploaderPolicyReplaceParamsFormatType = ""
)

type LogsUploaderPolicyService

type LogsUploaderPolicyService struct {
	Options []option.RequestOption
}

Logs uploader policies define how CDN logs are formatted and delivered, including field selection, field ordering, delimiters, delivery frequency, and file size limits.

LogsUploaderPolicyService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLogsUploaderPolicyService method instead.

func NewLogsUploaderPolicyService

func NewLogsUploaderPolicyService(opts ...option.RequestOption) (r LogsUploaderPolicyService)

NewLogsUploaderPolicyService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*LogsUploaderPolicyService) Delete

func (r *LogsUploaderPolicyService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)

Delete the logs uploader policy from the system permanently.

Notes:

  • **Irreversibility**: This action is irreversible. Once deleted, the logs uploader policy cannot be recovered.

func (*LogsUploaderPolicyService) Get

Get information about logs uploader policy.

func (*LogsUploaderPolicyService) List

Get list of logs uploader policies.

func (*LogsUploaderPolicyService) ListAutoPaging added in v0.51.0

Get list of logs uploader policies.

func (*LogsUploaderPolicyService) ListFields

func (r *LogsUploaderPolicyService) ListFields(ctx context.Context, opts ...option.RequestOption) (res *[]string, err error)

Get list of available fields for logs uploader policy.

`/cdn/v2/logs_uploader/policies/fields` returns the same fields together with the conversion types each one permits.

func (*LogsUploaderPolicyService) ListFieldsAllowedConversions added in v0.57.0

func (r *LogsUploaderPolicyService) ListFieldsAllowedConversions(ctx context.Context, opts ...option.RequestOption) (res *[]LogsUploaderPolicyField, err error)

Get the available fields for a logs uploader policy, each with the conversion types it permits in `field_conversions`.

Supersedes `/cdn/logs_uploader/policies/fields`, which returns field names only.

`-` is the placeholder for a skipped column: it may appear in `fields` and permits no conversion.

func (*LogsUploaderPolicyService) New

Create logs uploader policy.

func (*LogsUploaderPolicyService) Replace

Change logs uploader policy.

func (*LogsUploaderPolicyService) Update

Change logs uploader policy partially.

type LogsUploaderPolicyUpdateParams

type LogsUploaderPolicyUpdateParams struct {
	// Threshold in MB to rotate logs.
	RotateThresholdMB param.Opt[int64] `json:"rotate_threshold_mb,omitzero"`
	// Date format for logs.
	DateFormat param.Opt[string] `json:"date_format,omitzero"`
	// Description of the policy.
	Description param.Opt[string] `json:"description,omitzero"`
	// When set to true, the service sanitizes string values by escaping characters
	// that may be unsafe for transport, logging, or downstream processing.
	//
	// The following categories of characters are escaped:
	//
	// - Control and non-printable characters
	// - Quotation marks and escape characters
	// - Characters outside the standard ASCII range
	//
	// The resulting output contains only printable ASCII characters.
	EscapeSpecialCharacters param.Opt[bool] `json:"escape_special_characters,omitzero"`
	// Field delimiter for logs.
	FieldDelimiter param.Opt[string] `json:"field_delimiter,omitzero"`
	// Field separator for logs.
	FieldSeparator param.Opt[string] `json:"field_separator,omitzero"`
	// Template for log file name.
	FileNameTemplate param.Opt[string] `json:"file_name_template,omitzero"`
	// Include empty logs in the upload.
	IncludeEmptyLogs param.Opt[bool] `json:"include_empty_logs,omitzero"`
	// Include logs from origin shielding in the upload.
	IncludeShieldLogs param.Opt[bool] `json:"include_shield_logs,omitzero"`
	// Sampling rate for logs. A value between 0 and 1 that determines the fraction of
	// log entries to collect.
	//
	//   - **1** - collect all logs (default).
	//   - **0.5** - collect approximately 50% of logs.
	//   - **0** - collect no logs (effectively disables logging without removing the
	//     policy).
	LogSampleRate param.Opt[float64] `json:"log_sample_rate,omitzero"`
	// Name of the policy.
	Name param.Opt[string] `json:"name,omitzero"`
	// Interval in minutes to retry failed uploads.
	RetryIntervalMinutes param.Opt[int64] `json:"retry_interval_minutes,omitzero"`
	// Interval in minutes to rotate logs.
	RotateIntervalMinutes param.Opt[int64] `json:"rotate_interval_minutes,omitzero"`
	// Threshold in lines to rotate logs.
	RotateThresholdLines param.Opt[int64] `json:"rotate_threshold_lines,omitzero"`
	// Per-field value conversions for exported logs. Maps a canonical Gcore field name
	// to the pipeline applied to its values. Field names are limited to 255 characters
	// and must not be empty. Each key must be present in `fields`, and each conversion
	// type must be listed in that field's `allowed_conversions` from
	// `/cdn/v2/logs_uploader/policies/fields`. Conversions in a pipeline are applied
	// in array order. Values are converted independently of `field_remap`, which
	// renames the exported field: both are keyed on the canonical field name.
	FieldConversions map[string]LogsUploaderPolicyUpdateParamsFieldConversion `json:"field_conversions,omitzero"`
	// Per-field output-name remap for exported logs. Maps a canonical Gcore field name
	// (from `/cdn/logs_uploader/policies/fields`, and must be present in `fields`) to
	// the field name it should have in the exported logs. Unmapped fields keep their
	// canonical name. Output names (after remapping) must be unique.
	FieldRemap map[string]string `json:"field_remap,omitzero"`
	// List of fields to include in logs. Duplicate names are allowed for plain text
	// output, but rejected when `format_type` is `json` or a `field_remap` is set
	// (each field becomes a distinct output key).
	Fields []string `json:"fields,omitzero"`
	// Format type for logs.
	//
	// Possible values:
	//
	//   - **""** - empty, it means it will apply the format configurations from the
	//     policy.
	//   - **"json"** - output the logs as json lines.
	//
	// Any of "json", "".
	FormatType LogsUploaderPolicyUpdateParamsFormatType `json:"format_type,omitzero"`
	// Tags allow for dynamic decoration of logs by adding predefined fields to the log
	// format. These tags serve as customizable key-value pairs that can be included in
	// log entries to enhance context and readability.
	Tags map[string]string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderPolicyUpdateParams) MarshalJSON

func (r LogsUploaderPolicyUpdateParams) MarshalJSON() (data []byte, err error)

func (*LogsUploaderPolicyUpdateParams) UnmarshalJSON

func (r *LogsUploaderPolicyUpdateParams) UnmarshalJSON(data []byte) error

type LogsUploaderPolicyUpdateParamsFieldConversion added in v0.57.0

type LogsUploaderPolicyUpdateParamsFieldConversion struct {
	Conversions []LogsUploaderPolicyUpdateParamsFieldConversionConversionUnion `json:"conversions,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The property Conversions is required.

func (LogsUploaderPolicyUpdateParamsFieldConversion) MarshalJSON added in v0.57.0

func (r LogsUploaderPolicyUpdateParamsFieldConversion) MarshalJSON() (data []byte, err error)

func (*LogsUploaderPolicyUpdateParamsFieldConversion) UnmarshalJSON added in v0.57.0

func (r *LogsUploaderPolicyUpdateParamsFieldConversion) UnmarshalJSON(data []byte) error

type LogsUploaderPolicyUpdateParamsFieldConversionConversionReplace added in v0.57.0

type LogsUploaderPolicyUpdateParamsFieldConversionConversionReplace struct {
	Config LogsUploaderPolicyUpdateParamsFieldConversionConversionReplaceConfig `json:"config,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "replace".
	Type constant.Replace `json:"type" default:"replace"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderPolicyUpdateParamsFieldConversionConversionReplace) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyUpdateParamsFieldConversionConversionReplace) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyUpdateParamsFieldConversionConversionReplaceConfig added in v0.57.0

type LogsUploaderPolicyUpdateParamsFieldConversionConversionReplaceConfig struct {
	// Exact, case-sensitive replacements, matched and written without trimming. Keys
	// must not be empty and are limited to 255 characters; values are limited to 100
	// characters and may be empty.
	Values map[string]string `json:"values,omitzero" api:"required"`
	// Value used when the input does not match any key in `values`.
	Default param.Opt[string] `json:"default,omitzero"`
	// contains filtered or unexported fields
}

The property Values is required.

func (LogsUploaderPolicyUpdateParamsFieldConversionConversionReplaceConfig) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyUpdateParamsFieldConversionConversionReplaceConfig) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyUpdateParamsFieldConversionConversionScale added in v0.57.0

type LogsUploaderPolicyUpdateParamsFieldConversionConversionScale struct {
	Config LogsUploaderPolicyUpdateParamsFieldConversionConversionScaleConfig `json:"config,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "scale".
	Type constant.Scale `json:"type" default:"scale"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderPolicyUpdateParamsFieldConversionConversionScale) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyUpdateParamsFieldConversionConversionScale) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyUpdateParamsFieldConversionConversionScaleConfig added in v0.57.0

type LogsUploaderPolicyUpdateParamsFieldConversionConversionScaleConfig struct {
	// Multiplier applied to the field value.
	Factor float64 `json:"factor" api:"required"`
	// Optional number of decimal places in the converted value. Must be specified
	// together with `rounding`; returned as `null` when unspecified.
	Precision param.Opt[int64] `json:"precision,omitzero"`
	// Optional rounding mode. Must be specified together with `precision`; returned as
	// `null` when unspecified.
	//
	// Any of "nearest", "down", "up".
	Rounding string `json:"rounding,omitzero"`
	// contains filtered or unexported fields
}

The property Factor is required.

func (LogsUploaderPolicyUpdateParamsFieldConversionConversionScaleConfig) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyUpdateParamsFieldConversionConversionScaleConfig) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyUpdateParamsFieldConversionConversionUnion added in v0.57.0

type LogsUploaderPolicyUpdateParamsFieldConversionConversionUnion struct {
	OfScale   *LogsUploaderPolicyUpdateParamsFieldConversionConversionScale   `json:",omitzero,inline"`
	OfReplace *LogsUploaderPolicyUpdateParamsFieldConversionConversionReplace `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (LogsUploaderPolicyUpdateParamsFieldConversionConversionUnion) GetConfig added in v0.57.0

func (u LogsUploaderPolicyUpdateParamsFieldConversionConversionUnion) GetConfig() (res logsUploaderPolicyUpdateParamsFieldConversionConversionUnionConfig)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (LogsUploaderPolicyUpdateParamsFieldConversionConversionUnion) GetType added in v0.57.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderPolicyUpdateParamsFieldConversionConversionUnion) MarshalJSON added in v0.57.0

func (*LogsUploaderPolicyUpdateParamsFieldConversionConversionUnion) UnmarshalJSON added in v0.57.0

type LogsUploaderPolicyUpdateParamsFormatType added in v0.29.0

type LogsUploaderPolicyUpdateParamsFormatType string

Format type for logs.

Possible values:

  • **""** - empty, it means it will apply the format configurations from the policy.
  • **"json"** - output the logs as json lines.
const (
	LogsUploaderPolicyUpdateParamsFormatTypeJson  LogsUploaderPolicyUpdateParamsFormatType = "json"
	LogsUploaderPolicyUpdateParamsFormatTypeEmpty LogsUploaderPolicyUpdateParamsFormatType = ""
)

type LogsUploaderService

type LogsUploaderService struct {
	Options []option.RequestOption
	// Logs uploader policies define how CDN logs are formatted and delivered,
	// including field selection, field ordering, delimiters, delivery frequency, and
	// file size limits.
	Policies LogsUploaderPolicyService
	// Logs uploader targets define destinations for CDN log delivery, such as S3
	// buckets or SFTP servers, with associated authentication and configuration
	// settings.
	Targets LogsUploaderTargetService
	// Logs uploader configs tie a logs uploader policy to one or more targets and a
	// set of CDN resources, controlling which access logs are uploaded and where they
	// are delivered.
	Configs LogsUploaderConfigService
}

LogsUploaderService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLogsUploaderService method instead.

func NewLogsUploaderService

func NewLogsUploaderService(opts ...option.RequestOption) (r LogsUploaderService)

NewLogsUploaderService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type LogsUploaderTargetAzureBlob added in v0.60.0

type LogsUploaderTargetAzureBlob struct {
	// Type of storage for logs.
	StorageType constant.AzureBlob `json:"storage_type" default:"azure_blob"`
	ID          int64              `json:"id"`
	// Client that owns the target.
	ClientID int64                             `json:"client_id"`
	Config   LogsUploaderTargetAzureBlobConfig `json:"config"`
	// Time when logs uploader target was created.
	Created time.Time `json:"created" format:"date-time"`
	// Description of the target.
	Description string `json:"description"`
	// Name of the target.
	Name string `json:"name"`
	// List of logs uploader configs that use this target.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Validation status of the logs uploader target. Informs if the specified target
	// is reachable.
	Status LogsUploaderTargetAzureBlobStatus `json:"status"`
	// Time when logs uploader target was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetAzureBlob) RawJSON added in v0.60.0

func (r LogsUploaderTargetAzureBlob) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetAzureBlob) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetAzureBlob) UnmarshalJSON(data []byte) error

type LogsUploaderTargetAzureBlobConfig added in v0.60.0

type LogsUploaderTargetAzureBlobConfig struct {
	// Azure Blob Storage account name.
	AccountName string                                `json:"account_name"`
	Auth        LogsUploaderTargetAzureBlobConfigAuth `json:"auth"`
	// Azure Blob Storage container name.
	ContainerName string `json:"container_name"`
	// Directory path within the container.
	Directory string `json:"directory" api:"nullable"`
	// Custom Azure Blob Storage endpoint URL.
	Endpoint string `json:"endpoint" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountName   respjson.Field
		Auth          respjson.Field
		ContainerName respjson.Field
		Directory     respjson.Field
		Endpoint      respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetAzureBlobConfig) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetAzureBlobConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetAzureBlobConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetAzureBlobConfigAuth added in v0.60.0

type LogsUploaderTargetAzureBlobConfigAuth struct {
	// Authentication credentials. Secret fields are masked with '**\***'.
	Config LogsUploaderTargetAzureBlobConfigAuthConfigUnion `json:"config" api:"required"`
	// Authentication type.
	//
	// Any of "shared_key", "sas_token".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Config      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetAzureBlobConfigAuth) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetAzureBlobConfigAuth) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetAzureBlobConfigAuth) UnmarshalJSON(data []byte) error

type LogsUploaderTargetAzureBlobConfigAuthConfigAccountKey added in v0.60.0

type LogsUploaderTargetAzureBlobConfigAuthConfigAccountKey struct {
	// Masked secret value.
	AccountKey string `json:"account_key" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccountKey  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetAzureBlobConfigAuthConfigAccountKey) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetAzureBlobConfigAuthConfigAccountKey) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetAzureBlobConfigAuthConfigToken added in v0.60.0

type LogsUploaderTargetAzureBlobConfigAuthConfigToken struct {
	// Masked secret value.
	Token string `json:"token" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Token       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetAzureBlobConfigAuthConfigToken) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetAzureBlobConfigAuthConfigToken) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetAzureBlobConfigAuthConfigUnion added in v0.60.0

type LogsUploaderTargetAzureBlobConfigAuthConfigUnion struct {
	// This field is from variant
	// [LogsUploaderTargetAzureBlobConfigAuthConfigAccountKey].
	AccountKey string `json:"account_key"`
	// This field is from variant [LogsUploaderTargetAzureBlobConfigAuthConfigToken].
	Token string `json:"token"`
	JSON  struct {
		AccountKey respjson.Field
		Token      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LogsUploaderTargetAzureBlobConfigAuthConfigUnion contains all possible properties and values from LogsUploaderTargetAzureBlobConfigAuthConfigAccountKey, LogsUploaderTargetAzureBlobConfigAuthConfigToken.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (LogsUploaderTargetAzureBlobConfigAuthConfigUnion) AsLogsUploaderTargetAzureBlobConfigAuthConfigAccountKey added in v0.60.0

func (u LogsUploaderTargetAzureBlobConfigAuthConfigUnion) AsLogsUploaderTargetAzureBlobConfigAuthConfigAccountKey() (v LogsUploaderTargetAzureBlobConfigAuthConfigAccountKey)

func (LogsUploaderTargetAzureBlobConfigAuthConfigUnion) AsLogsUploaderTargetAzureBlobConfigAuthConfigToken added in v0.60.0

func (u LogsUploaderTargetAzureBlobConfigAuthConfigUnion) AsLogsUploaderTargetAzureBlobConfigAuthConfigToken() (v LogsUploaderTargetAzureBlobConfigAuthConfigToken)

func (LogsUploaderTargetAzureBlobConfigAuthConfigUnion) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetAzureBlobConfigAuthConfigUnion) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetAzureBlobStatus added in v0.60.0

type LogsUploaderTargetAzureBlobStatus struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader target. Informs if the specified target is reachable.

func (LogsUploaderTargetAzureBlobStatus) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetAzureBlobStatus) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetAzureBlobStatus) UnmarshalJSON(data []byte) error

type LogsUploaderTargetFtp added in v0.60.0

type LogsUploaderTargetFtp struct {
	// Type of storage for logs.
	StorageType constant.Ftp `json:"storage_type" default:"ftp"`
	ID          int64        `json:"id"`
	// Client that owns the target.
	ClientID int64                       `json:"client_id"`
	Config   LogsUploaderTargetFtpConfig `json:"config"`
	// Time when logs uploader target was created.
	Created time.Time `json:"created" format:"date-time"`
	// Description of the target.
	Description string `json:"description"`
	// Name of the target.
	Name string `json:"name"`
	// List of logs uploader configs that use this target.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Validation status of the logs uploader target. Informs if the specified target
	// is reachable.
	Status LogsUploaderTargetFtpStatus `json:"status"`
	// Time when logs uploader target was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetFtp) RawJSON added in v0.60.0

func (r LogsUploaderTargetFtp) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetFtp) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetFtp) UnmarshalJSON(data []byte) error

type LogsUploaderTargetFtpConfig added in v0.60.0

type LogsUploaderTargetFtpConfig struct {
	Directory      string `json:"directory" api:"nullable"`
	Hostname       string `json:"hostname"`
	TimeoutSeconds int64  `json:"timeout_seconds"`
	User           string `json:"user"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Directory      respjson.Field
		Hostname       respjson.Field
		TimeoutSeconds respjson.Field
		User           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetFtpConfig) RawJSON added in v0.60.0

func (r LogsUploaderTargetFtpConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetFtpConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetFtpConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetFtpStatus added in v0.60.0

type LogsUploaderTargetFtpStatus struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader target. Informs if the specified target is reachable.

func (LogsUploaderTargetFtpStatus) RawJSON added in v0.60.0

func (r LogsUploaderTargetFtpStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetFtpStatus) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetFtpStatus) UnmarshalJSON(data []byte) error

type LogsUploaderTargetHTTP added in v0.60.0

type LogsUploaderTargetHTTP struct {
	// Type of storage for logs.
	StorageType constant.HTTP `json:"storage_type" default:"http"`
	ID          int64         `json:"id"`
	// Client that owns the target.
	ClientID int64                        `json:"client_id"`
	Config   LogsUploaderTargetHTTPConfig `json:"config"`
	// Time when logs uploader target was created.
	Created time.Time `json:"created" format:"date-time"`
	// Description of the target.
	Description string `json:"description"`
	// Name of the target.
	Name string `json:"name"`
	// List of logs uploader configs that use this target.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Validation status of the logs uploader target. Informs if the specified target
	// is reachable.
	Status LogsUploaderTargetHTTPStatus `json:"status"`
	// Time when logs uploader target was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetHTTP) RawJSON added in v0.60.0

func (r LogsUploaderTargetHTTP) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTP) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetHTTP) UnmarshalJSON(data []byte) error

type LogsUploaderTargetHTTPConfig added in v0.60.0

type LogsUploaderTargetHTTPConfig struct {
	Append LogsUploaderTargetHTTPConfigAppend `json:"append" api:"nullable"`
	Auth   LogsUploaderTargetHTTPConfigAuth   `json:"auth" api:"nullable"`
	// Any of "json", "text".
	ContentType string                             `json:"content_type"`
	Retry       LogsUploaderTargetHTTPConfigRetry  `json:"retry" api:"nullable"`
	Upload      LogsUploaderTargetHTTPConfigUpload `json:"upload"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Append      respjson.Field
		Auth        respjson.Field
		ContentType respjson.Field
		Retry       respjson.Field
		Upload      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetHTTPConfig) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTPConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetHTTPConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetHTTPConfigAppend added in v0.60.0

type LogsUploaderTargetHTTPConfigAppend struct {
	Headers map[string]string `json:"headers"`
	// Any of "POST", "PUT".
	Method          string                                             `json:"method"`
	ResponseActions []LogsUploaderTargetHTTPConfigAppendResponseAction `json:"response_actions"`
	TimeoutSeconds  int64                                              `json:"timeout_seconds"`
	URL             string                                             `json:"url"`
	UseCompression  bool                                               `json:"use_compression"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Headers         respjson.Field
		Method          respjson.Field
		ResponseActions respjson.Field
		TimeoutSeconds  respjson.Field
		URL             respjson.Field
		UseCompression  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetHTTPConfigAppend) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTPConfigAppend) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetHTTPConfigAppend) UnmarshalJSON(data []byte) error

type LogsUploaderTargetHTTPConfigAppendResponseAction added in v0.60.0

type LogsUploaderTargetHTTPConfigAppendResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string `json:"action"`
	Description     string `json:"description"`
	MatchPayload    string `json:"match_payload"`
	MatchStatusCode int64  `json:"match_status_code"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Action          respjson.Field
		Description     respjson.Field
		MatchPayload    respjson.Field
		MatchStatusCode respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetHTTPConfigAppendResponseAction) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTPConfigAppendResponseAction) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetHTTPConfigAuth added in v0.60.0

type LogsUploaderTargetHTTPConfigAuth struct {
	Config LogsUploaderTargetHTTPConfigAuthConfig `json:"config"`
	// Any of "token".
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Config      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetHTTPConfigAuth) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTPConfigAuth) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetHTTPConfigAuth) UnmarshalJSON(data []byte) error

type LogsUploaderTargetHTTPConfigAuthConfig added in v0.60.0

type LogsUploaderTargetHTTPConfigAuthConfig struct {
	Token      string `json:"token"`
	HeaderName string `json:"header_name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Token       respjson.Field
		HeaderName  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetHTTPConfigAuthConfig) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTPConfigAuthConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetHTTPConfigAuthConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetHTTPConfigRetry added in v0.60.0

type LogsUploaderTargetHTTPConfigRetry struct {
	Headers map[string]string `json:"headers"`
	// Any of "POST", "PUT".
	Method          string                                            `json:"method"`
	ResponseActions []LogsUploaderTargetHTTPConfigRetryResponseAction `json:"response_actions"`
	TimeoutSeconds  int64                                             `json:"timeout_seconds"`
	URL             string                                            `json:"url"`
	UseCompression  bool                                              `json:"use_compression"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Headers         respjson.Field
		Method          respjson.Field
		ResponseActions respjson.Field
		TimeoutSeconds  respjson.Field
		URL             respjson.Field
		UseCompression  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetHTTPConfigRetry) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTPConfigRetry) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetHTTPConfigRetry) UnmarshalJSON(data []byte) error

type LogsUploaderTargetHTTPConfigRetryResponseAction added in v0.60.0

type LogsUploaderTargetHTTPConfigRetryResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string `json:"action"`
	Description     string `json:"description"`
	MatchPayload    string `json:"match_payload"`
	MatchStatusCode int64  `json:"match_status_code"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Action          respjson.Field
		Description     respjson.Field
		MatchPayload    respjson.Field
		MatchStatusCode respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetHTTPConfigRetryResponseAction) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTPConfigRetryResponseAction) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetHTTPConfigUpload added in v0.60.0

type LogsUploaderTargetHTTPConfigUpload struct {
	Headers map[string]string `json:"headers"`
	// Any of "POST", "PUT".
	Method          string                                             `json:"method"`
	ResponseActions []LogsUploaderTargetHTTPConfigUploadResponseAction `json:"response_actions"`
	TimeoutSeconds  int64                                              `json:"timeout_seconds"`
	URL             string                                             `json:"url"`
	UseCompression  bool                                               `json:"use_compression"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Headers         respjson.Field
		Method          respjson.Field
		ResponseActions respjson.Field
		TimeoutSeconds  respjson.Field
		URL             respjson.Field
		UseCompression  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetHTTPConfigUpload) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTPConfigUpload) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetHTTPConfigUpload) UnmarshalJSON(data []byte) error

type LogsUploaderTargetHTTPConfigUploadResponseAction added in v0.60.0

type LogsUploaderTargetHTTPConfigUploadResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string `json:"action"`
	Description     string `json:"description"`
	MatchPayload    string `json:"match_payload"`
	MatchStatusCode int64  `json:"match_status_code"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Action          respjson.Field
		Description     respjson.Field
		MatchPayload    respjson.Field
		MatchStatusCode respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetHTTPConfigUploadResponseAction) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTPConfigUploadResponseAction) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetHTTPStatus added in v0.60.0

type LogsUploaderTargetHTTPStatus struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader target. Informs if the specified target is reachable.

func (LogsUploaderTargetHTTPStatus) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetHTTPStatus) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetHTTPStatus) UnmarshalJSON(data []byte) error

type LogsUploaderTargetList

type LogsUploaderTargetList struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string                    `json:"previous" api:"required"`
	Results  []LogsUploaderTargetUnion `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetList) RawJSON added in v0.51.0

func (r LogsUploaderTargetList) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetList) UnmarshalJSON added in v0.51.0

func (r *LogsUploaderTargetList) UnmarshalJSON(data []byte) error

type LogsUploaderTargetListParams

type LogsUploaderTargetListParams struct {
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Search by target name or id.
	Search param.Opt[string] `query:"search,omitzero" json:"-"`
	// Filter by ids of related logs uploader configs that use given target.
	ConfigIDs []int64 `query:"config_ids,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetListParams) URLQuery

func (r LogsUploaderTargetListParams) URLQuery() (v url.Values, err error)

URLQuery serializes LogsUploaderTargetListParams's query parameters as `url.Values`.

type LogsUploaderTargetNewParams

type LogsUploaderTargetNewParams struct {

	// This field is a request body variant, only one variant field can be set.
	OfS3Gcore *LogsUploaderTargetNewParamsBodyS3Gcore `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfS3Amazon *LogsUploaderTargetNewParamsBodyS3Amazon `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfS3Oss *LogsUploaderTargetNewParamsBodyS3Oss `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfS3Other *LogsUploaderTargetNewParamsBodyS3Other `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfS3V1 *LogsUploaderTargetNewParamsBodyS3V1 `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfFtp *LogsUploaderTargetNewParamsBodyFtp `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfSftp *LogsUploaderTargetNewParamsBodySftp `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfHTTP *LogsUploaderTargetNewParamsBodyHTTP `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfAzureBlob *LogsUploaderTargetNewParamsBodyAzureBlob `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfSls *LogsUploaderTargetNewParamsBodySls `json:",inline"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetNewParams) MarshalJSON

func (u LogsUploaderTargetNewParams) MarshalJSON() ([]byte, error)

func (*LogsUploaderTargetNewParams) UnmarshalJSON

func (r *LogsUploaderTargetNewParams) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyAzureBlob added in v0.60.0

type LogsUploaderTargetNewParamsBodyAzureBlob struct {
	Config LogsUploaderTargetNewParamsBodyAzureBlobConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "azure_blob".
	StorageType constant.AzureBlob `json:"storage_type" default:"azure_blob"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetNewParamsBodyAzureBlob) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyAzureBlob) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyAzureBlob) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyAzureBlob) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyAzureBlobConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodyAzureBlobConfig struct {
	// Directory path within the container.
	Directory param.Opt[string] `json:"directory,omitzero"`
	// Custom Azure Blob Storage endpoint URL.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	// Azure Blob Storage account name.
	AccountName param.Opt[string] `json:"account_name,omitzero"`
	// Azure Blob Storage container name.
	ContainerName param.Opt[string]                                  `json:"container_name,omitzero"`
	Auth          LogsUploaderTargetNewParamsBodyAzureBlobConfigAuth `json:"auth,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetNewParamsBodyAzureBlobConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyAzureBlobConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyAzureBlobConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyAzureBlobConfigAuth added in v0.60.0

type LogsUploaderTargetNewParamsBodyAzureBlobConfigAuth struct {
	// Authentication credentials.
	Config LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigUnion `json:"config,omitzero" api:"required"`
	// Authentication type.
	//
	// Any of "shared_key", "sas_token".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetNewParamsBodyAzureBlobConfigAuth) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyAzureBlobConfigAuth) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyAzureBlobConfigAuth) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigAccountKey added in v0.60.0

type LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigAccountKey struct {
	// Azure Blob Storage account key.
	AccountKey string `json:"account_key" api:"required"`
	// contains filtered or unexported fields
}

The property AccountKey is required.

func (LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigAccountKey) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigAccountKey) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigToken added in v0.60.0

type LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigToken struct {
	// Azure Blob Storage SAS token.
	Token string `json:"token" api:"required"`
	// contains filtered or unexported fields
}

The property Token is required.

func (LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigToken) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigToken) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigUnion added in v0.60.0

type LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigUnion struct {
	OfLogsUploaderTargetNewsBodyAzureBlobConfigAuthConfigAccountKey *LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigAccountKey `json:",omitzero,inline"`
	OfLogsUploaderTargetNewsBodyAzureBlobConfigAuthConfigToken      *LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigToken      `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigUnion) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetNewParamsBodyAzureBlobConfigAuthConfigUnion) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyFtp added in v0.60.0

type LogsUploaderTargetNewParamsBodyFtp struct {
	Config LogsUploaderTargetNewParamsBodyFtpConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "ftp".
	StorageType constant.Ftp `json:"storage_type" default:"ftp"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetNewParamsBodyFtp) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyFtp) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyFtp) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyFtp) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyFtpConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodyFtpConfig struct {
	Directory      param.Opt[string] `json:"directory,omitzero"`
	Hostname       param.Opt[string] `json:"hostname,omitzero"`
	Password       param.Opt[string] `json:"password,omitzero"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	User           param.Opt[string] `json:"user,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetNewParamsBodyFtpConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyFtpConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyFtpConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyFtpConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyHTTP added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTP struct {
	Config LogsUploaderTargetNewParamsBodyHTTPConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "http".
	StorageType constant.HTTP `json:"storage_type" default:"http"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetNewParamsBodyHTTP) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyHTTP) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyHTTP) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyHTTP) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyHTTPConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfig struct {
	Upload LogsUploaderTargetNewParamsBodyHTTPConfigUpload `json:"upload,omitzero" api:"required"`
	Append LogsUploaderTargetNewParamsBodyHTTPConfigAppend `json:"append,omitzero"`
	Auth   LogsUploaderTargetNewParamsBodyHTTPConfigAuth   `json:"auth,omitzero"`
	// Any of "json", "text".
	ContentType string                                         `json:"content_type,omitzero"`
	Retry       LogsUploaderTargetNewParamsBodyHTTPConfigRetry `json:"retry,omitzero"`
	// contains filtered or unexported fields
}

The property Upload is required.

func (LogsUploaderTargetNewParamsBodyHTTPConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyHTTPConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyHTTPConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyHTTPConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyHTTPConfigAppend added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigAppend struct {
	URL            string            `json:"url" api:"required"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	UseCompression param.Opt[bool]   `json:"use_compression,omitzero"`
	Headers        map[string]string `json:"headers,omitzero"`
	// Any of "POST", "PUT".
	Method          string                                                          `json:"method,omitzero"`
	ResponseActions []LogsUploaderTargetNewParamsBodyHTTPConfigAppendResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetNewParamsBodyHTTPConfigAppend) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyHTTPConfigAppend) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyHTTPConfigAppend) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigAppendResponseAction added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigAppendResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero" api:"required"`
	Description     param.Opt[string] `json:"description,omitzero"`
	MatchPayload    param.Opt[string] `json:"match_payload,omitzero"`
	MatchStatusCode param.Opt[int64]  `json:"match_status_code,omitzero"`
	// contains filtered or unexported fields
}

The property Action is required.

func (LogsUploaderTargetNewParamsBodyHTTPConfigAppendResponseAction) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetNewParamsBodyHTTPConfigAppendResponseAction) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigAuth added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigAuth struct {
	Config LogsUploaderTargetNewParamsBodyHTTPConfigAuthConfig `json:"config,omitzero" api:"required"`
	// Any of "token".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetNewParamsBodyHTTPConfigAuth) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyHTTPConfigAuth) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyHTTPConfigAuth) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyHTTPConfigAuth) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyHTTPConfigAuthConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigAuthConfig struct {
	Token      string `json:"token" api:"required"`
	HeaderName string `json:"header_name" api:"required"`
	// contains filtered or unexported fields
}

The properties Token, HeaderName are required.

func (LogsUploaderTargetNewParamsBodyHTTPConfigAuthConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyHTTPConfigAuthConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyHTTPConfigAuthConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigRetry added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigRetry struct {
	URL            string            `json:"url" api:"required"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	UseCompression param.Opt[bool]   `json:"use_compression,omitzero"`
	Headers        map[string]string `json:"headers,omitzero"`
	// Any of "POST", "PUT".
	Method          string                                                         `json:"method,omitzero"`
	ResponseActions []LogsUploaderTargetNewParamsBodyHTTPConfigRetryResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetNewParamsBodyHTTPConfigRetry) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyHTTPConfigRetry) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyHTTPConfigRetry) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigRetryResponseAction added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigRetryResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero" api:"required"`
	Description     param.Opt[string] `json:"description,omitzero"`
	MatchPayload    param.Opt[string] `json:"match_payload,omitzero"`
	MatchStatusCode param.Opt[int64]  `json:"match_status_code,omitzero"`
	// contains filtered or unexported fields
}

The property Action is required.

func (LogsUploaderTargetNewParamsBodyHTTPConfigRetryResponseAction) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetNewParamsBodyHTTPConfigRetryResponseAction) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigUpload added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigUpload struct {
	URL            string            `json:"url" api:"required"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	UseCompression param.Opt[bool]   `json:"use_compression,omitzero"`
	Headers        map[string]string `json:"headers,omitzero"`
	// Any of "POST", "PUT".
	Method          string                                                          `json:"method,omitzero"`
	ResponseActions []LogsUploaderTargetNewParamsBodyHTTPConfigUploadResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetNewParamsBodyHTTPConfigUpload) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyHTTPConfigUpload) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyHTTPConfigUpload) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigUploadResponseAction added in v0.60.0

type LogsUploaderTargetNewParamsBodyHTTPConfigUploadResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero" api:"required"`
	Description     param.Opt[string] `json:"description,omitzero"`
	MatchPayload    param.Opt[string] `json:"match_payload,omitzero"`
	MatchStatusCode param.Opt[int64]  `json:"match_status_code,omitzero"`
	// contains filtered or unexported fields
}

The property Action is required.

func (LogsUploaderTargetNewParamsBodyHTTPConfigUploadResponseAction) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetNewParamsBodyHTTPConfigUploadResponseAction) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3Amazon added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3Amazon struct {
	Config LogsUploaderTargetNewParamsBodyS3AmazonConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "s3_amazon".
	StorageType constant.S3Amazon `json:"storage_type" default:"s3_amazon"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetNewParamsBodyS3Amazon) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyS3Amazon) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyS3Amazon) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyS3Amazon) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyS3AmazonConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3AmazonConfig struct {
	AccessKeyID     string            `json:"access_key_id" api:"required"`
	BucketName      string            `json:"bucket_name" api:"required"`
	Region          string            `json:"region" api:"required"`
	SecretAccessKey string            `json:"secret_access_key" api:"required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Region, SecretAccessKey are required.

func (LogsUploaderTargetNewParamsBodyS3AmazonConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyS3AmazonConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyS3AmazonConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyS3AmazonConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyS3Gcore added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3Gcore struct {
	// Config for the `s3_gcore` storage type.
	Config LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "s3_gcore".
	StorageType constant.S3Gcore `json:"storage_type" default:"s3_gcore"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetNewParamsBodyS3Gcore) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyS3Gcore) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyS3Gcore) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyS3Gcore) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyS3GcoreConfigS3GcoreBoundConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3GcoreConfigS3GcoreBoundConfig struct {
	// Name of a bucket in the selected storage.
	BucketName string `json:"bucket_name" api:"required"`
	// ID of your Gcore Object Storage. The storage must be active and of the Standard
	// type.
	StorageID int64             `json:"storage_id" api:"required"`
	Directory param.Opt[string] `json:"directory,omitzero"`
	// contains filtered or unexported fields
}

Deliver logs to a bucket in your Gcore Object Storage. Select the storage and bucket, and the CDN configures the connection for you.

The properties BucketName, StorageID are required.

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigS3GcoreBoundConfig) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetNewParamsBodyS3GcoreConfigS3GcoreBoundConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3GcoreConfigS3GcoreConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3GcoreConfigS3GcoreConfig struct {
	Directory   param.Opt[string] `json:"directory,omitzero"`
	AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
	BucketName  param.Opt[string] `json:"bucket_name,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint        param.Opt[string] `json:"endpoint,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigS3GcoreConfig) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetNewParamsBodyS3GcoreConfigS3GcoreConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion struct {
	OfS3GcoreConfig      *LogsUploaderTargetNewParamsBodyS3GcoreConfigS3GcoreConfig      `json:",omitzero,inline"`
	OfS3GcoreBoundConfig *LogsUploaderTargetNewParamsBodyS3GcoreConfigS3GcoreBoundConfig `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion) GetAccessKeyID added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion) GetBucketName added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion) GetDirectory added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion) GetEndpoint added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion) GetRegion added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion) GetSecretAccessKey added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion) GetStorageID added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion) GetUsePathStyle added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetNewParamsBodyS3GcoreConfigUnion) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3Oss added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3Oss struct {
	Config LogsUploaderTargetNewParamsBodyS3OssConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "s3_oss".
	StorageType constant.S3Oss `json:"storage_type" default:"s3_oss"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetNewParamsBodyS3Oss) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyS3Oss) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyS3Oss) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyS3Oss) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyS3OssConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3OssConfig struct {
	AccessKeyID     string            `json:"access_key_id" api:"required"`
	BucketName      string            `json:"bucket_name" api:"required"`
	SecretAccessKey string            `json:"secret_access_key" api:"required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	Region   param.Opt[string] `json:"region,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, SecretAccessKey are required.

func (LogsUploaderTargetNewParamsBodyS3OssConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyS3OssConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyS3OssConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyS3OssConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyS3Other added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3Other struct {
	Config LogsUploaderTargetNewParamsBodyS3OtherConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "s3_other".
	StorageType constant.S3Other `json:"storage_type" default:"s3_other"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetNewParamsBodyS3Other) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyS3Other) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyS3Other) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyS3Other) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyS3OtherConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3OtherConfig struct {
	Directory   param.Opt[string] `json:"directory,omitzero"`
	AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
	BucketName  param.Opt[string] `json:"bucket_name,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint        param.Opt[string] `json:"endpoint,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetNewParamsBodyS3OtherConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyS3OtherConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyS3OtherConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyS3OtherConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyS3V1 added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3V1 struct {
	Config LogsUploaderTargetNewParamsBodyS3V1Config `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "s3_v1".
	StorageType constant.S3V1 `json:"storage_type" default:"s3_v1"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetNewParamsBodyS3V1) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyS3V1) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyS3V1) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyS3V1) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodyS3V1Config added in v0.60.0

type LogsUploaderTargetNewParamsBodyS3V1Config struct {
	Directory   param.Opt[string] `json:"directory,omitzero"`
	AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
	BucketName  param.Opt[string] `json:"bucket_name,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint        param.Opt[string] `json:"endpoint,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetNewParamsBodyS3V1Config) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodyS3V1Config) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodyS3V1Config) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodyS3V1Config) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodySftp added in v0.60.0

type LogsUploaderTargetNewParamsBodySftp struct {
	Config LogsUploaderTargetNewParamsBodySftpConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "sftp".
	StorageType constant.Sftp `json:"storage_type" default:"sftp"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetNewParamsBodySftp) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodySftp) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodySftp) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodySftp) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodySftpConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodySftpConfig struct {
	Directory      param.Opt[string] `json:"directory,omitzero"`
	KeyPassphrase  param.Opt[string] `json:"key_passphrase,omitzero"`
	Password       param.Opt[string] `json:"password,omitzero"`
	PrivateKey     param.Opt[string] `json:"private_key,omitzero"`
	Hostname       param.Opt[string] `json:"hostname,omitzero"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	User           param.Opt[string] `json:"user,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetNewParamsBodySftpConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodySftpConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodySftpConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodySftpConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodySls added in v0.60.0

type LogsUploaderTargetNewParamsBodySls struct {
	Config LogsUploaderTargetNewParamsBodySlsConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "sls".
	StorageType constant.Sls `json:"storage_type" default:"sls"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetNewParamsBodySls) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodySls) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodySls) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodySls) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodySlsConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodySlsConfig struct {
	// SLS endpoint. Optional — derived from the region as `{region}.log.aliyuncs.com`
	// when omitted.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	// Optional SLS topic (0-128 characters).
	Topic param.Opt[string] `json:"topic,omitzero"`
	// SLS logstore name. 3-36 characters; lowercase letters, digits, hyphens, and
	// underscores.
	LogStore param.Opt[string] `json:"log_store,omitzero"`
	// SLS project name. 3-63 characters; lowercase letters, digits, and hyphens.
	Project param.Opt[string] `json:"project,omitzero"`
	// SLS region (e.g. `eu-central-1`).
	Region param.Opt[string]                            `json:"region,omitzero"`
	Auth   LogsUploaderTargetNewParamsBodySlsConfigAuth `json:"auth,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetNewParamsBodySlsConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodySlsConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodySlsConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodySlsConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodySlsConfigAuth added in v0.60.0

type LogsUploaderTargetNewParamsBodySlsConfigAuth struct {
	// Authentication credentials.
	Config LogsUploaderTargetNewParamsBodySlsConfigAuthConfig `json:"config,omitzero" api:"required"`
	// Authentication type.
	//
	// Any of "ak_sk".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetNewParamsBodySlsConfigAuth) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodySlsConfigAuth) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodySlsConfigAuth) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetNewParamsBodySlsConfigAuth) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsBodySlsConfigAuthConfig added in v0.60.0

type LogsUploaderTargetNewParamsBodySlsConfigAuthConfig struct {
	// Alibaba access key ID.
	AccessKeyID string `json:"access_key_id" api:"required"`
	// Alibaba secret access key.
	SecretAccessKey string `json:"secret_access_key" api:"required"`
	// contains filtered or unexported fields
}

Authentication credentials.

The properties AccessKeyID, SecretAccessKey are required.

func (LogsUploaderTargetNewParamsBodySlsConfigAuthConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetNewParamsBodySlsConfigAuthConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetNewParamsBodySlsConfigAuthConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParams

type LogsUploaderTargetReplaceParams struct {

	// This field is a request body variant, only one variant field can be set.
	OfS3Gcore *LogsUploaderTargetReplaceParamsBodyS3Gcore `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfS3Amazon *LogsUploaderTargetReplaceParamsBodyS3Amazon `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfS3Oss *LogsUploaderTargetReplaceParamsBodyS3Oss `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfS3Other *LogsUploaderTargetReplaceParamsBodyS3Other `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfS3V1 *LogsUploaderTargetReplaceParamsBodyS3V1 `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfFtp *LogsUploaderTargetReplaceParamsBodyFtp `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfSftp *LogsUploaderTargetReplaceParamsBodySftp `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfHTTP *LogsUploaderTargetReplaceParamsBodyHTTP `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfAzureBlob *LogsUploaderTargetReplaceParamsBodyAzureBlob `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfSls *LogsUploaderTargetReplaceParamsBodySls `json:",inline"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetReplaceParams) MarshalJSON

func (u LogsUploaderTargetReplaceParams) MarshalJSON() ([]byte, error)

func (*LogsUploaderTargetReplaceParams) UnmarshalJSON

func (r *LogsUploaderTargetReplaceParams) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyAzureBlob added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyAzureBlob struct {
	Config LogsUploaderTargetReplaceParamsBodyAzureBlobConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "azure_blob".
	StorageType constant.AzureBlob `json:"storage_type" default:"azure_blob"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetReplaceParamsBodyAzureBlob) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyAzureBlob) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyAzureBlob) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyAzureBlob) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyAzureBlobConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyAzureBlobConfig struct {
	// Directory path within the container.
	Directory param.Opt[string] `json:"directory,omitzero"`
	// Custom Azure Blob Storage endpoint URL.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	// Azure Blob Storage account name.
	AccountName param.Opt[string] `json:"account_name,omitzero"`
	// Azure Blob Storage container name.
	ContainerName param.Opt[string]                                      `json:"container_name,omitzero"`
	Auth          LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuth `json:"auth,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetReplaceParamsBodyAzureBlobConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyAzureBlobConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyAzureBlobConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuth added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuth struct {
	// Authentication credentials.
	Config LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigUnion `json:"config,omitzero" api:"required"`
	// Authentication type.
	//
	// Any of "shared_key", "sas_token".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuth) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuth) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigAccountKey added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigAccountKey struct {
	// Azure Blob Storage account key.
	AccountKey string `json:"account_key" api:"required"`
	// contains filtered or unexported fields
}

The property AccountKey is required.

func (LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigAccountKey) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigAccountKey) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigToken added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigToken struct {
	// Azure Blob Storage SAS token.
	Token string `json:"token" api:"required"`
	// contains filtered or unexported fields
}

The property Token is required.

func (LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigToken) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigToken) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigUnion added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigUnion struct {
	OfLogsUploaderTargetReplacesBodyAzureBlobConfigAuthConfigAccountKey *LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigAccountKey `json:",omitzero,inline"`
	OfLogsUploaderTargetReplacesBodyAzureBlobConfigAuthConfigToken      *LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigToken      `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigUnion) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyAzureBlobConfigAuthConfigUnion) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyFtp added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyFtp struct {
	Config LogsUploaderTargetReplaceParamsBodyFtpConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "ftp".
	StorageType constant.Ftp `json:"storage_type" default:"ftp"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetReplaceParamsBodyFtp) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyFtp) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyFtp) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyFtp) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyFtpConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyFtpConfig struct {
	Directory      param.Opt[string] `json:"directory,omitzero"`
	Hostname       param.Opt[string] `json:"hostname,omitzero"`
	Password       param.Opt[string] `json:"password,omitzero"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	User           param.Opt[string] `json:"user,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetReplaceParamsBodyFtpConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyFtpConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyFtpConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyFtpConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyHTTP added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTP struct {
	Config LogsUploaderTargetReplaceParamsBodyHTTPConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "http".
	StorageType constant.HTTP `json:"storage_type" default:"http"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetReplaceParamsBodyHTTP) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyHTTP) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyHTTP) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyHTTP) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyHTTPConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfig struct {
	Upload LogsUploaderTargetReplaceParamsBodyHTTPConfigUpload `json:"upload,omitzero" api:"required"`
	Append LogsUploaderTargetReplaceParamsBodyHTTPConfigAppend `json:"append,omitzero"`
	Auth   LogsUploaderTargetReplaceParamsBodyHTTPConfigAuth   `json:"auth,omitzero"`
	// Any of "json", "text".
	ContentType string                                             `json:"content_type,omitzero"`
	Retry       LogsUploaderTargetReplaceParamsBodyHTTPConfigRetry `json:"retry,omitzero"`
	// contains filtered or unexported fields
}

The property Upload is required.

func (LogsUploaderTargetReplaceParamsBodyHTTPConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyHTTPConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyHTTPConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyHTTPConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyHTTPConfigAppend added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigAppend struct {
	URL            string            `json:"url" api:"required"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	UseCompression param.Opt[bool]   `json:"use_compression,omitzero"`
	Headers        map[string]string `json:"headers,omitzero"`
	// Any of "POST", "PUT".
	Method          string                                                              `json:"method,omitzero"`
	ResponseActions []LogsUploaderTargetReplaceParamsBodyHTTPConfigAppendResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetReplaceParamsBodyHTTPConfigAppend) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyHTTPConfigAppend) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyHTTPConfigAppend) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigAppendResponseAction added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigAppendResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero" api:"required"`
	Description     param.Opt[string] `json:"description,omitzero"`
	MatchPayload    param.Opt[string] `json:"match_payload,omitzero"`
	MatchStatusCode param.Opt[int64]  `json:"match_status_code,omitzero"`
	// contains filtered or unexported fields
}

The property Action is required.

func (LogsUploaderTargetReplaceParamsBodyHTTPConfigAppendResponseAction) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyHTTPConfigAppendResponseAction) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigAuth added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigAuth struct {
	Config LogsUploaderTargetReplaceParamsBodyHTTPConfigAuthConfig `json:"config,omitzero" api:"required"`
	// Any of "token".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetReplaceParamsBodyHTTPConfigAuth) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyHTTPConfigAuth) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyHTTPConfigAuth) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigAuthConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigAuthConfig struct {
	Token      string `json:"token" api:"required"`
	HeaderName string `json:"header_name" api:"required"`
	// contains filtered or unexported fields
}

The properties Token, HeaderName are required.

func (LogsUploaderTargetReplaceParamsBodyHTTPConfigAuthConfig) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyHTTPConfigAuthConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigRetry added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigRetry struct {
	URL            string            `json:"url" api:"required"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	UseCompression param.Opt[bool]   `json:"use_compression,omitzero"`
	Headers        map[string]string `json:"headers,omitzero"`
	// Any of "POST", "PUT".
	Method          string                                                             `json:"method,omitzero"`
	ResponseActions []LogsUploaderTargetReplaceParamsBodyHTTPConfigRetryResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetReplaceParamsBodyHTTPConfigRetry) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyHTTPConfigRetry) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyHTTPConfigRetry) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigRetryResponseAction added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigRetryResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero" api:"required"`
	Description     param.Opt[string] `json:"description,omitzero"`
	MatchPayload    param.Opt[string] `json:"match_payload,omitzero"`
	MatchStatusCode param.Opt[int64]  `json:"match_status_code,omitzero"`
	// contains filtered or unexported fields
}

The property Action is required.

func (LogsUploaderTargetReplaceParamsBodyHTTPConfigRetryResponseAction) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyHTTPConfigRetryResponseAction) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigUpload added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigUpload struct {
	URL            string            `json:"url" api:"required"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	UseCompression param.Opt[bool]   `json:"use_compression,omitzero"`
	Headers        map[string]string `json:"headers,omitzero"`
	// Any of "POST", "PUT".
	Method          string                                                              `json:"method,omitzero"`
	ResponseActions []LogsUploaderTargetReplaceParamsBodyHTTPConfigUploadResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetReplaceParamsBodyHTTPConfigUpload) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyHTTPConfigUpload) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyHTTPConfigUpload) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigUploadResponseAction added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyHTTPConfigUploadResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero" api:"required"`
	Description     param.Opt[string] `json:"description,omitzero"`
	MatchPayload    param.Opt[string] `json:"match_payload,omitzero"`
	MatchStatusCode param.Opt[int64]  `json:"match_status_code,omitzero"`
	// contains filtered or unexported fields
}

The property Action is required.

func (LogsUploaderTargetReplaceParamsBodyHTTPConfigUploadResponseAction) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyHTTPConfigUploadResponseAction) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3Amazon added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3Amazon struct {
	Config LogsUploaderTargetReplaceParamsBodyS3AmazonConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "s3_amazon".
	StorageType constant.S3Amazon `json:"storage_type" default:"s3_amazon"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetReplaceParamsBodyS3Amazon) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyS3Amazon) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyS3Amazon) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyS3Amazon) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyS3AmazonConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3AmazonConfig struct {
	AccessKeyID     string            `json:"access_key_id" api:"required"`
	BucketName      string            `json:"bucket_name" api:"required"`
	Region          string            `json:"region" api:"required"`
	SecretAccessKey string            `json:"secret_access_key" api:"required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Region, SecretAccessKey are required.

func (LogsUploaderTargetReplaceParamsBodyS3AmazonConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyS3AmazonConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyS3AmazonConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3Gcore added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3Gcore struct {
	// Config for the `s3_gcore` storage type.
	Config LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "s3_gcore".
	StorageType constant.S3Gcore `json:"storage_type" default:"s3_gcore"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetReplaceParamsBodyS3Gcore) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyS3Gcore) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyS3Gcore) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyS3Gcore) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyS3GcoreConfigS3GcoreBoundConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3GcoreConfigS3GcoreBoundConfig struct {
	// Name of a bucket in the selected storage.
	BucketName string            `json:"bucket_name" api:"required"`
	Directory  param.Opt[string] `json:"directory,omitzero"`
	// ID of your Gcore Object Storage. The storage must be active and of the Standard
	// type.
	StorageID param.Opt[int64] `json:"storage_id,omitzero"`
	// contains filtered or unexported fields
}

`storage_id` keeps its current value when omitted. To bind a target that is not bound yet, or one that uses another storage type, send both `storage_id` and `bucket_name`.

The property BucketName is required.

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigS3GcoreBoundConfig) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyS3GcoreConfigS3GcoreBoundConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3GcoreConfigS3GcoreConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3GcoreConfigS3GcoreConfig struct {
	Directory   param.Opt[string] `json:"directory,omitzero"`
	AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
	BucketName  param.Opt[string] `json:"bucket_name,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint        param.Opt[string] `json:"endpoint,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigS3GcoreConfig) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyS3GcoreConfigS3GcoreConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion struct {
	OfS3GcoreConfig      *LogsUploaderTargetReplaceParamsBodyS3GcoreConfigS3GcoreConfig      `json:",omitzero,inline"`
	OfS3GcoreBoundConfig *LogsUploaderTargetReplaceParamsBodyS3GcoreConfigS3GcoreBoundConfig `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion) GetAccessKeyID added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion) GetBucketName added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion) GetDirectory added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion) GetEndpoint added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion) GetRegion added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion) GetSecretAccessKey added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion) GetStorageID added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion) GetUsePathStyle added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodyS3GcoreConfigUnion) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3Oss added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3Oss struct {
	Config LogsUploaderTargetReplaceParamsBodyS3OssConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "s3_oss".
	StorageType constant.S3Oss `json:"storage_type" default:"s3_oss"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetReplaceParamsBodyS3Oss) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyS3Oss) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyS3Oss) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyS3Oss) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyS3OssConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3OssConfig struct {
	AccessKeyID     string            `json:"access_key_id" api:"required"`
	BucketName      string            `json:"bucket_name" api:"required"`
	SecretAccessKey string            `json:"secret_access_key" api:"required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	Region   param.Opt[string] `json:"region,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, SecretAccessKey are required.

func (LogsUploaderTargetReplaceParamsBodyS3OssConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyS3OssConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyS3OssConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3Other added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3Other struct {
	Config LogsUploaderTargetReplaceParamsBodyS3OtherConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "s3_other".
	StorageType constant.S3Other `json:"storage_type" default:"s3_other"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetReplaceParamsBodyS3Other) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyS3Other) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyS3Other) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyS3Other) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyS3OtherConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3OtherConfig struct {
	Directory   param.Opt[string] `json:"directory,omitzero"`
	AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
	BucketName  param.Opt[string] `json:"bucket_name,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint        param.Opt[string] `json:"endpoint,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetReplaceParamsBodyS3OtherConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyS3OtherConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyS3OtherConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3V1 added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3V1 struct {
	Config LogsUploaderTargetReplaceParamsBodyS3V1Config `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "s3_v1".
	StorageType constant.S3V1 `json:"storage_type" default:"s3_v1"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetReplaceParamsBodyS3V1) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyS3V1) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyS3V1) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyS3V1) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodyS3V1Config added in v0.60.0

type LogsUploaderTargetReplaceParamsBodyS3V1Config struct {
	Directory   param.Opt[string] `json:"directory,omitzero"`
	AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
	BucketName  param.Opt[string] `json:"bucket_name,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint        param.Opt[string] `json:"endpoint,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetReplaceParamsBodyS3V1Config) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodyS3V1Config) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodyS3V1Config) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodyS3V1Config) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodySftp added in v0.60.0

type LogsUploaderTargetReplaceParamsBodySftp struct {
	Config LogsUploaderTargetReplaceParamsBodySftpConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "sftp".
	StorageType constant.Sftp `json:"storage_type" default:"sftp"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetReplaceParamsBodySftp) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodySftp) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodySftp) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodySftp) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodySftpConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodySftpConfig struct {
	Directory      param.Opt[string] `json:"directory,omitzero"`
	KeyPassphrase  param.Opt[string] `json:"key_passphrase,omitzero"`
	Password       param.Opt[string] `json:"password,omitzero"`
	PrivateKey     param.Opt[string] `json:"private_key,omitzero"`
	Hostname       param.Opt[string] `json:"hostname,omitzero"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	User           param.Opt[string] `json:"user,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetReplaceParamsBodySftpConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodySftpConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodySftpConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodySftpConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodySls added in v0.60.0

type LogsUploaderTargetReplaceParamsBodySls struct {
	Config LogsUploaderTargetReplaceParamsBodySlsConfig `json:"config,omitzero" api:"required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Type of storage for logs.
	//
	// This field can be elided, and will marshal its zero value as "sls".
	StorageType constant.Sls `json:"storage_type" default:"sls"`
	// contains filtered or unexported fields
}

The properties Config, StorageType are required.

func (LogsUploaderTargetReplaceParamsBodySls) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodySls) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodySls) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodySls) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodySlsConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodySlsConfig struct {
	// SLS endpoint. Optional — derived from the region as `{region}.log.aliyuncs.com`
	// when omitted.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	// Optional SLS topic (0-128 characters).
	Topic param.Opt[string] `json:"topic,omitzero"`
	// SLS logstore name. 3-36 characters; lowercase letters, digits, hyphens, and
	// underscores.
	LogStore param.Opt[string] `json:"log_store,omitzero"`
	// SLS project name. 3-63 characters; lowercase letters, digits, and hyphens.
	Project param.Opt[string] `json:"project,omitzero"`
	// SLS region (e.g. `eu-central-1`).
	Region param.Opt[string]                                `json:"region,omitzero"`
	Auth   LogsUploaderTargetReplaceParamsBodySlsConfigAuth `json:"auth,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetReplaceParamsBodySlsConfig) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodySlsConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodySlsConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetReplaceParamsBodySlsConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsBodySlsConfigAuth added in v0.60.0

type LogsUploaderTargetReplaceParamsBodySlsConfigAuth struct {
	// Authentication credentials.
	Config LogsUploaderTargetReplaceParamsBodySlsConfigAuthConfig `json:"config,omitzero" api:"required"`
	// Authentication type.
	//
	// Any of "ak_sk".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetReplaceParamsBodySlsConfigAuth) MarshalJSON added in v0.60.0

func (r LogsUploaderTargetReplaceParamsBodySlsConfigAuth) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetReplaceParamsBodySlsConfigAuth) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetReplaceParamsBodySlsConfigAuthConfig added in v0.60.0

type LogsUploaderTargetReplaceParamsBodySlsConfigAuthConfig struct {
	// Alibaba access key ID.
	AccessKeyID string `json:"access_key_id" api:"required"`
	// Alibaba secret access key.
	SecretAccessKey string `json:"secret_access_key" api:"required"`
	// contains filtered or unexported fields
}

Authentication credentials.

The properties AccessKeyID, SecretAccessKey are required.

func (LogsUploaderTargetReplaceParamsBodySlsConfigAuthConfig) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetReplaceParamsBodySlsConfigAuthConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetS3Amazon added in v0.60.0

type LogsUploaderTargetS3Amazon struct {
	// Type of storage for logs.
	StorageType constant.S3Amazon `json:"storage_type" default:"s3_amazon"`
	ID          int64             `json:"id"`
	// Client that owns the target.
	ClientID int64                            `json:"client_id"`
	Config   LogsUploaderTargetS3AmazonConfig `json:"config"`
	// Time when logs uploader target was created.
	Created time.Time `json:"created" format:"date-time"`
	// Description of the target.
	Description string `json:"description"`
	// Name of the target.
	Name string `json:"name"`
	// List of logs uploader configs that use this target.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Validation status of the logs uploader target. Informs if the specified target
	// is reachable.
	Status LogsUploaderTargetS3AmazonStatus `json:"status"`
	// Time when logs uploader target was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetS3Amazon) RawJSON added in v0.60.0

func (r LogsUploaderTargetS3Amazon) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3Amazon) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3Amazon) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3AmazonConfig added in v0.60.0

type LogsUploaderTargetS3AmazonConfig struct {
	AccessKeyID string `json:"access_key_id"`
	BucketName  string `json:"bucket_name"`
	Directory   string `json:"directory" api:"nullable"`
	Region      string `json:"region"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccessKeyID respjson.Field
		BucketName  respjson.Field
		Directory   respjson.Field
		Region      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetS3AmazonConfig) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3AmazonConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3AmazonConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3AmazonStatus added in v0.60.0

type LogsUploaderTargetS3AmazonStatus struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader target. Informs if the specified target is reachable.

func (LogsUploaderTargetS3AmazonStatus) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3AmazonStatus) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3AmazonStatus) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3Gcore added in v0.60.0

type LogsUploaderTargetS3Gcore struct {
	// Type of storage for logs.
	StorageType constant.S3Gcore `json:"storage_type" default:"s3_gcore"`
	ID          int64            `json:"id"`
	// Client that owns the target.
	ClientID int64 `json:"client_id"`
	// Config for the `s3_gcore` storage type.
	Config LogsUploaderTargetS3GcoreConfigUnion `json:"config"`
	// Time when logs uploader target was created.
	Created time.Time `json:"created" format:"date-time"`
	// Description of the target.
	Description string `json:"description"`
	// Name of the target.
	Name string `json:"name"`
	// List of logs uploader configs that use this target.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Validation status of the logs uploader target. Informs if the specified target
	// is reachable.
	Status LogsUploaderTargetS3GcoreStatus `json:"status"`
	// Time when logs uploader target was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetS3Gcore) RawJSON added in v0.60.0

func (r LogsUploaderTargetS3Gcore) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3Gcore) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3Gcore) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3GcoreConfigS3GcoreBoundConfig added in v0.60.0

type LogsUploaderTargetS3GcoreConfigS3GcoreBoundConfig struct {
	BucketName string `json:"bucket_name" api:"required"`
	// ID of your Gcore Object Storage.
	StorageID int64  `json:"storage_id" api:"required"`
	Directory string `json:"directory" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BucketName  respjson.Field
		StorageID   respjson.Field
		Directory   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A target bound to your Gcore Object Storage. The CDN manages the connection, so its settings are not returned.

func (LogsUploaderTargetS3GcoreConfigS3GcoreBoundConfig) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3GcoreConfigS3GcoreBoundConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetS3GcoreConfigS3GcoreConfig added in v0.60.0

type LogsUploaderTargetS3GcoreConfigS3GcoreConfig struct {
	AccessKeyID  string `json:"access_key_id" api:"required"`
	BucketName   string `json:"bucket_name"`
	Directory    string `json:"directory" api:"nullable"`
	Endpoint     string `json:"endpoint"`
	Region       string `json:"region"`
	UsePathStyle bool   `json:"use_path_style"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccessKeyID  respjson.Field
		BucketName   respjson.Field
		Directory    respjson.Field
		Endpoint     respjson.Field
		Region       respjson.Field
		UsePathStyle respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetS3GcoreConfigS3GcoreConfig) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3GcoreConfigS3GcoreConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3GcoreConfigS3GcoreConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3GcoreConfigUnion added in v0.60.0

type LogsUploaderTargetS3GcoreConfigUnion struct {
	// This field is from variant [LogsUploaderTargetS3GcoreConfigS3GcoreConfig].
	AccessKeyID string `json:"access_key_id"`
	BucketName  string `json:"bucket_name"`
	Directory   string `json:"directory"`
	// This field is from variant [LogsUploaderTargetS3GcoreConfigS3GcoreConfig].
	Endpoint string `json:"endpoint"`
	// This field is from variant [LogsUploaderTargetS3GcoreConfigS3GcoreConfig].
	Region string `json:"region"`
	// This field is from variant [LogsUploaderTargetS3GcoreConfigS3GcoreConfig].
	UsePathStyle bool `json:"use_path_style"`
	// This field is from variant [LogsUploaderTargetS3GcoreConfigS3GcoreBoundConfig].
	StorageID int64 `json:"storage_id"`
	JSON      struct {
		AccessKeyID  respjson.Field
		BucketName   respjson.Field
		Directory    respjson.Field
		Endpoint     respjson.Field
		Region       respjson.Field
		UsePathStyle respjson.Field
		StorageID    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LogsUploaderTargetS3GcoreConfigUnion contains all possible properties and values from LogsUploaderTargetS3GcoreConfigS3GcoreConfig, LogsUploaderTargetS3GcoreConfigS3GcoreBoundConfig.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (LogsUploaderTargetS3GcoreConfigUnion) AsS3GcoreBoundConfig added in v0.60.0

func (LogsUploaderTargetS3GcoreConfigUnion) AsS3GcoreConfig added in v0.60.0

func (LogsUploaderTargetS3GcoreConfigUnion) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3GcoreConfigUnion) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3GcoreConfigUnion) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3GcoreStatus added in v0.60.0

type LogsUploaderTargetS3GcoreStatus struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader target. Informs if the specified target is reachable.

func (LogsUploaderTargetS3GcoreStatus) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3GcoreStatus) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3GcoreStatus) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3Oss added in v0.60.0

type LogsUploaderTargetS3Oss struct {
	// Type of storage for logs.
	StorageType constant.S3Oss `json:"storage_type" default:"s3_oss"`
	ID          int64          `json:"id"`
	// Client that owns the target.
	ClientID int64                         `json:"client_id"`
	Config   LogsUploaderTargetS3OssConfig `json:"config"`
	// Time when logs uploader target was created.
	Created time.Time `json:"created" format:"date-time"`
	// Description of the target.
	Description string `json:"description"`
	// Name of the target.
	Name string `json:"name"`
	// List of logs uploader configs that use this target.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Validation status of the logs uploader target. Informs if the specified target
	// is reachable.
	Status LogsUploaderTargetS3OssStatus `json:"status"`
	// Time when logs uploader target was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetS3Oss) RawJSON added in v0.60.0

func (r LogsUploaderTargetS3Oss) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3Oss) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3Oss) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3OssConfig added in v0.60.0

type LogsUploaderTargetS3OssConfig struct {
	AccessKeyID string `json:"access_key_id"`
	BucketName  string `json:"bucket_name"`
	Directory   string `json:"directory" api:"nullable"`
	Endpoint    string `json:"endpoint" api:"nullable"`
	Region      string `json:"region" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccessKeyID respjson.Field
		BucketName  respjson.Field
		Directory   respjson.Field
		Endpoint    respjson.Field
		Region      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetS3OssConfig) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3OssConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3OssConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3OssStatus added in v0.60.0

type LogsUploaderTargetS3OssStatus struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader target. Informs if the specified target is reachable.

func (LogsUploaderTargetS3OssStatus) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3OssStatus) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3OssStatus) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3Other added in v0.60.0

type LogsUploaderTargetS3Other struct {
	// Type of storage for logs.
	StorageType constant.S3Other `json:"storage_type" default:"s3_other"`
	ID          int64            `json:"id"`
	// Client that owns the target.
	ClientID int64                           `json:"client_id"`
	Config   LogsUploaderTargetS3OtherConfig `json:"config"`
	// Time when logs uploader target was created.
	Created time.Time `json:"created" format:"date-time"`
	// Description of the target.
	Description string `json:"description"`
	// Name of the target.
	Name string `json:"name"`
	// List of logs uploader configs that use this target.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Validation status of the logs uploader target. Informs if the specified target
	// is reachable.
	Status LogsUploaderTargetS3OtherStatus `json:"status"`
	// Time when logs uploader target was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetS3Other) RawJSON added in v0.60.0

func (r LogsUploaderTargetS3Other) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3Other) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3Other) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3OtherConfig added in v0.60.0

type LogsUploaderTargetS3OtherConfig struct {
	AccessKeyID  string `json:"access_key_id" api:"required"`
	BucketName   string `json:"bucket_name"`
	Directory    string `json:"directory" api:"nullable"`
	Endpoint     string `json:"endpoint"`
	Region       string `json:"region"`
	UsePathStyle bool   `json:"use_path_style"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccessKeyID  respjson.Field
		BucketName   respjson.Field
		Directory    respjson.Field
		Endpoint     respjson.Field
		Region       respjson.Field
		UsePathStyle respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetS3OtherConfig) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3OtherConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3OtherConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3OtherStatus added in v0.60.0

type LogsUploaderTargetS3OtherStatus struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader target. Informs if the specified target is reachable.

func (LogsUploaderTargetS3OtherStatus) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3OtherStatus) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3OtherStatus) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3V1 added in v0.60.0

type LogsUploaderTargetS3V1 struct {
	// Type of storage for logs.
	StorageType constant.S3V1 `json:"storage_type" default:"s3_v1"`
	ID          int64         `json:"id"`
	// Client that owns the target.
	ClientID int64                        `json:"client_id"`
	Config   LogsUploaderTargetS3V1Config `json:"config"`
	// Time when logs uploader target was created.
	Created time.Time `json:"created" format:"date-time"`
	// Description of the target.
	Description string `json:"description"`
	// Name of the target.
	Name string `json:"name"`
	// List of logs uploader configs that use this target.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Validation status of the logs uploader target. Informs if the specified target
	// is reachable.
	Status LogsUploaderTargetS3V1Status `json:"status"`
	// Time when logs uploader target was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetS3V1) RawJSON added in v0.60.0

func (r LogsUploaderTargetS3V1) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3V1) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3V1) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3V1Config added in v0.60.0

type LogsUploaderTargetS3V1Config struct {
	AccessKeyID  string `json:"access_key_id" api:"required"`
	BucketName   string `json:"bucket_name"`
	Directory    string `json:"directory" api:"nullable"`
	Endpoint     string `json:"endpoint"`
	Region       string `json:"region"`
	UsePathStyle bool   `json:"use_path_style"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccessKeyID  respjson.Field
		BucketName   respjson.Field
		Directory    respjson.Field
		Endpoint     respjson.Field
		Region       respjson.Field
		UsePathStyle respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetS3V1Config) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3V1Config) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3V1Config) UnmarshalJSON(data []byte) error

type LogsUploaderTargetS3V1Status added in v0.60.0

type LogsUploaderTargetS3V1Status struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader target. Informs if the specified target is reachable.

func (LogsUploaderTargetS3V1Status) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetS3V1Status) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetS3V1Status) UnmarshalJSON(data []byte) error

type LogsUploaderTargetService

type LogsUploaderTargetService struct {
	Options []option.RequestOption
}

Logs uploader targets define destinations for CDN log delivery, such as S3 buckets or SFTP servers, with associated authentication and configuration settings.

LogsUploaderTargetService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLogsUploaderTargetService method instead.

func NewLogsUploaderTargetService

func NewLogsUploaderTargetService(opts ...option.RequestOption) (r LogsUploaderTargetService)

NewLogsUploaderTargetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*LogsUploaderTargetService) Delete

func (r *LogsUploaderTargetService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)

Delete the logs uploader target from the system permanently.

Notes:

  • **Irreversibility**: This action is irreversible. Once deleted, the logs uploader target cannot be recovered.

func (*LogsUploaderTargetService) Get

Get information about logs uploader target.

func (*LogsUploaderTargetService) List

Get list of logs uploader targets.

func (*LogsUploaderTargetService) ListAutoPaging added in v0.51.0

Get list of logs uploader targets.

func (*LogsUploaderTargetService) New

Create logs uploader target.

func (*LogsUploaderTargetService) Replace

Change logs uploader target.

func (*LogsUploaderTargetService) Update

Change logs uploader target partially.

func (*LogsUploaderTargetService) Validate

Validate logs uploader target.

type LogsUploaderTargetSftp added in v0.60.0

type LogsUploaderTargetSftp struct {
	// Type of storage for logs.
	StorageType constant.Sftp `json:"storage_type" default:"sftp"`
	ID          int64         `json:"id"`
	// Client that owns the target.
	ClientID int64                        `json:"client_id"`
	Config   LogsUploaderTargetSftpConfig `json:"config"`
	// Time when logs uploader target was created.
	Created time.Time `json:"created" format:"date-time"`
	// Description of the target.
	Description string `json:"description"`
	// Name of the target.
	Name string `json:"name"`
	// List of logs uploader configs that use this target.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Validation status of the logs uploader target. Informs if the specified target
	// is reachable.
	Status LogsUploaderTargetSftpStatus `json:"status"`
	// Time when logs uploader target was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetSftp) RawJSON added in v0.60.0

func (r LogsUploaderTargetSftp) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetSftp) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetSftp) UnmarshalJSON(data []byte) error

type LogsUploaderTargetSftpConfig added in v0.60.0

type LogsUploaderTargetSftpConfig struct {
	Directory      string `json:"directory" api:"nullable"`
	Hostname       string `json:"hostname"`
	KeyPassphrase  string `json:"key_passphrase" api:"nullable"`
	Password       string `json:"password" api:"nullable"`
	PrivateKey     string `json:"private_key" api:"nullable"`
	TimeoutSeconds int64  `json:"timeout_seconds"`
	User           string `json:"user"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Directory      respjson.Field
		Hostname       respjson.Field
		KeyPassphrase  respjson.Field
		Password       respjson.Field
		PrivateKey     respjson.Field
		TimeoutSeconds respjson.Field
		User           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetSftpConfig) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetSftpConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetSftpConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetSftpStatus added in v0.60.0

type LogsUploaderTargetSftpStatus struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader target. Informs if the specified target is reachable.

func (LogsUploaderTargetSftpStatus) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetSftpStatus) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetSftpStatus) UnmarshalJSON(data []byte) error

type LogsUploaderTargetSls added in v0.60.0

type LogsUploaderTargetSls struct {
	// Type of storage for logs.
	StorageType constant.Sls `json:"storage_type" default:"sls"`
	ID          int64        `json:"id"`
	// Client that owns the target.
	ClientID int64                       `json:"client_id"`
	Config   LogsUploaderTargetSlsConfig `json:"config"`
	// Time when logs uploader target was created.
	Created time.Time `json:"created" format:"date-time"`
	// Description of the target.
	Description string `json:"description"`
	// Name of the target.
	Name string `json:"name"`
	// List of logs uploader configs that use this target.
	RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
	// Validation status of the logs uploader target. Informs if the specified target
	// is reachable.
	Status LogsUploaderTargetSlsStatus `json:"status"`
	// Time when logs uploader target was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetSls) RawJSON added in v0.60.0

func (r LogsUploaderTargetSls) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetSls) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetSls) UnmarshalJSON(data []byte) error

type LogsUploaderTargetSlsConfig added in v0.60.0

type LogsUploaderTargetSlsConfig struct {
	Auth LogsUploaderTargetSlsConfigAuth `json:"auth"`
	// SLS endpoint. Optional — derived from the region as `{region}.log.aliyuncs.com`
	// when omitted.
	Endpoint string `json:"endpoint" api:"nullable"`
	// SLS logstore name. 3-36 characters; lowercase letters, digits, hyphens, and
	// underscores.
	LogStore string `json:"log_store"`
	// SLS project name. 3-63 characters; lowercase letters, digits, and hyphens.
	Project string `json:"project"`
	// SLS region (e.g. `eu-central-1`).
	Region string `json:"region"`
	// Optional SLS topic (0-128 characters).
	Topic string `json:"topic" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Auth        respjson.Field
		Endpoint    respjson.Field
		LogStore    respjson.Field
		Project     respjson.Field
		Region      respjson.Field
		Topic       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetSlsConfig) RawJSON added in v0.60.0

func (r LogsUploaderTargetSlsConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetSlsConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetSlsConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetSlsConfigAuth added in v0.60.0

type LogsUploaderTargetSlsConfigAuth struct {
	// Authentication credentials. Secret fields are masked with '**\***'.
	Config LogsUploaderTargetSlsConfigAuthConfig `json:"config" api:"required"`
	// Authentication type.
	//
	// Any of "ak_sk".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Config      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetSlsConfigAuth) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetSlsConfigAuth) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetSlsConfigAuth) UnmarshalJSON(data []byte) error

type LogsUploaderTargetSlsConfigAuthConfig added in v0.60.0

type LogsUploaderTargetSlsConfigAuthConfig struct {
	// Alibaba access key ID.
	AccessKeyID string `json:"access_key_id"`
	// Masked secret value.
	SecretAccessKey string `json:"secret_access_key"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AccessKeyID     respjson.Field
		SecretAccessKey respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Authentication credentials. Secret fields are masked with '**\***'.

func (LogsUploaderTargetSlsConfigAuthConfig) RawJSON added in v0.60.0

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetSlsConfigAuthConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetSlsConfigAuthConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetSlsStatus added in v0.60.0

type LogsUploaderTargetSlsStatus struct {
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	LogsUploaderValidation
}

Validation status of the logs uploader target. Informs if the specified target is reachable.

func (LogsUploaderTargetSlsStatus) RawJSON added in v0.60.0

func (r LogsUploaderTargetSlsStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetSlsStatus) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetSlsStatus) UnmarshalJSON(data []byte) error

type LogsUploaderTargetUnion added in v0.60.0

type LogsUploaderTargetUnion struct {
	// Any of "s3_gcore", "s3_amazon", "s3_oss", "s3_other", "s3_v1", "ftp", "sftp",
	// "http", "azure_blob", "sls".
	StorageType string `json:"storage_type"`
	ID          int64  `json:"id"`
	ClientID    int64  `json:"client_id"`
	// This field is a union of [LogsUploaderTargetS3GcoreConfigUnion],
	// [LogsUploaderTargetS3AmazonConfig], [LogsUploaderTargetS3OssConfig],
	// [LogsUploaderTargetS3OtherConfig], [LogsUploaderTargetS3V1Config],
	// [LogsUploaderTargetFtpConfig], [LogsUploaderTargetSftpConfig],
	// [LogsUploaderTargetHTTPConfig], [LogsUploaderTargetAzureBlobConfig],
	// [LogsUploaderTargetSlsConfig]
	Config                 LogsUploaderTargetUnionConfig `json:"config"`
	Created                time.Time                     `json:"created"`
	Description            string                        `json:"description"`
	Name                   string                        `json:"name"`
	RelatedUploaderConfigs []int64                       `json:"related_uploader_configs"`
	// This field is a union of [LogsUploaderTargetS3GcoreStatus],
	// [LogsUploaderTargetS3AmazonStatus], [LogsUploaderTargetS3OssStatus],
	// [LogsUploaderTargetS3OtherStatus], [LogsUploaderTargetS3V1Status],
	// [LogsUploaderTargetFtpStatus], [LogsUploaderTargetSftpStatus],
	// [LogsUploaderTargetHTTPStatus], [LogsUploaderTargetAzureBlobStatus],
	// [LogsUploaderTargetSlsStatus]
	Status  LogsUploaderTargetUnionStatus `json:"status"`
	Updated time.Time                     `json:"updated"`
	JSON    struct {
		StorageType            respjson.Field
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		Updated                respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LogsUploaderTargetUnion contains all possible properties and values from LogsUploaderTargetS3Gcore, LogsUploaderTargetS3Amazon, LogsUploaderTargetS3Oss, LogsUploaderTargetS3Other, LogsUploaderTargetS3V1, LogsUploaderTargetFtp, LogsUploaderTargetSftp, LogsUploaderTargetHTTP, LogsUploaderTargetAzureBlob, LogsUploaderTargetSls.

Use the LogsUploaderTargetUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (LogsUploaderTargetUnion) AsAny added in v0.60.0

func (u LogsUploaderTargetUnion) AsAny() anyLogsUploaderTarget

Use the following switch statement to find the correct variant

switch variant := LogsUploaderTargetUnion.AsAny().(type) {
case cdn.LogsUploaderTargetS3Gcore:
case cdn.LogsUploaderTargetS3Amazon:
case cdn.LogsUploaderTargetS3Oss:
case cdn.LogsUploaderTargetS3Other:
case cdn.LogsUploaderTargetS3V1:
case cdn.LogsUploaderTargetFtp:
case cdn.LogsUploaderTargetSftp:
case cdn.LogsUploaderTargetHTTP:
case cdn.LogsUploaderTargetAzureBlob:
case cdn.LogsUploaderTargetSls:
default:
  fmt.Errorf("no variant present")
}

func (LogsUploaderTargetUnion) AsAzureBlob added in v0.60.0

func (LogsUploaderTargetUnion) AsFtp added in v0.60.0

func (LogsUploaderTargetUnion) AsHTTP added in v0.60.0

func (LogsUploaderTargetUnion) AsS3Amazon added in v0.60.0

func (LogsUploaderTargetUnion) AsS3Gcore added in v0.60.0

func (LogsUploaderTargetUnion) AsS3Oss added in v0.60.0

func (LogsUploaderTargetUnion) AsS3Other added in v0.60.0

func (LogsUploaderTargetUnion) AsS3V1 added in v0.60.0

func (LogsUploaderTargetUnion) AsSftp added in v0.60.0

func (LogsUploaderTargetUnion) AsSls added in v0.60.0

func (LogsUploaderTargetUnion) RawJSON added in v0.60.0

func (u LogsUploaderTargetUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetUnion) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetUnion) UnmarshalJSON(data []byte) error

type LogsUploaderTargetUnionConfig added in v0.60.0

type LogsUploaderTargetUnionConfig struct {
	AccessKeyID  string `json:"access_key_id"`
	BucketName   string `json:"bucket_name"`
	Directory    string `json:"directory"`
	Endpoint     string `json:"endpoint"`
	Region       string `json:"region"`
	UsePathStyle bool   `json:"use_path_style"`
	// This field is from variant [LogsUploaderTargetS3GcoreConfigUnion].
	StorageID      int64  `json:"storage_id"`
	Hostname       string `json:"hostname"`
	TimeoutSeconds int64  `json:"timeout_seconds"`
	User           string `json:"user"`
	// This field is from variant [LogsUploaderTargetSftpConfig].
	KeyPassphrase string `json:"key_passphrase"`
	// This field is from variant [LogsUploaderTargetSftpConfig].
	Password string `json:"password"`
	// This field is from variant [LogsUploaderTargetSftpConfig].
	PrivateKey string `json:"private_key"`
	// This field is from variant [LogsUploaderTargetHTTPConfig].
	Append LogsUploaderTargetHTTPConfigAppend `json:"append"`
	// This field is a union of [LogsUploaderTargetHTTPConfigAuth],
	// [LogsUploaderTargetAzureBlobConfigAuth], [LogsUploaderTargetSlsConfigAuth]
	Auth LogsUploaderTargetUnionConfigAuth `json:"auth"`
	// This field is from variant [LogsUploaderTargetHTTPConfig].
	ContentType string `json:"content_type"`
	// This field is from variant [LogsUploaderTargetHTTPConfig].
	Retry LogsUploaderTargetHTTPConfigRetry `json:"retry"`
	// This field is from variant [LogsUploaderTargetHTTPConfig].
	Upload LogsUploaderTargetHTTPConfigUpload `json:"upload"`
	// This field is from variant [LogsUploaderTargetAzureBlobConfig].
	AccountName string `json:"account_name"`
	// This field is from variant [LogsUploaderTargetAzureBlobConfig].
	ContainerName string `json:"container_name"`
	// This field is from variant [LogsUploaderTargetSlsConfig].
	LogStore string `json:"log_store"`
	// This field is from variant [LogsUploaderTargetSlsConfig].
	Project string `json:"project"`
	// This field is from variant [LogsUploaderTargetSlsConfig].
	Topic string `json:"topic"`
	JSON  struct {
		AccessKeyID    respjson.Field
		BucketName     respjson.Field
		Directory      respjson.Field
		Endpoint       respjson.Field
		Region         respjson.Field
		UsePathStyle   respjson.Field
		StorageID      respjson.Field
		Hostname       respjson.Field
		TimeoutSeconds respjson.Field
		User           respjson.Field
		KeyPassphrase  respjson.Field
		Password       respjson.Field
		PrivateKey     respjson.Field
		Append         respjson.Field
		Auth           respjson.Field
		ContentType    respjson.Field
		Retry          respjson.Field
		Upload         respjson.Field
		AccountName    respjson.Field
		ContainerName  respjson.Field
		LogStore       respjson.Field
		Project        respjson.Field
		Topic          respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LogsUploaderTargetUnionConfig is an implicit subunion of LogsUploaderTargetUnion. LogsUploaderTargetUnionConfig provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the LogsUploaderTargetUnion.

func (*LogsUploaderTargetUnionConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetUnionConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetUnionConfigAuth added in v0.60.0

type LogsUploaderTargetUnionConfigAuth struct {
	// This field is a union of [LogsUploaderTargetHTTPConfigAuthConfig],
	// [LogsUploaderTargetAzureBlobConfigAuthConfigUnion],
	// [LogsUploaderTargetSlsConfigAuthConfig]
	Config LogsUploaderTargetUnionConfigAuthConfig `json:"config"`
	Type   string                                  `json:"type"`
	JSON   struct {
		Config respjson.Field
		Type   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LogsUploaderTargetUnionConfigAuth is an implicit subunion of LogsUploaderTargetUnion. LogsUploaderTargetUnionConfigAuth provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the LogsUploaderTargetUnion.

func (*LogsUploaderTargetUnionConfigAuth) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetUnionConfigAuth) UnmarshalJSON(data []byte) error

type LogsUploaderTargetUnionConfigAuthConfig added in v0.60.0

type LogsUploaderTargetUnionConfigAuthConfig struct {
	Token string `json:"token"`
	// This field is from variant [LogsUploaderTargetHTTPConfigAuthConfig].
	HeaderName string `json:"header_name"`
	// This field is from variant [LogsUploaderTargetAzureBlobConfigAuthConfigUnion].
	AccountKey string `json:"account_key"`
	// This field is from variant [LogsUploaderTargetSlsConfigAuthConfig].
	AccessKeyID string `json:"access_key_id"`
	// This field is from variant [LogsUploaderTargetSlsConfigAuthConfig].
	SecretAccessKey string `json:"secret_access_key"`
	JSON            struct {
		Token           respjson.Field
		HeaderName      respjson.Field
		AccountKey      respjson.Field
		AccessKeyID     respjson.Field
		SecretAccessKey respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LogsUploaderTargetUnionConfigAuthConfig is an implicit subunion of LogsUploaderTargetUnion. LogsUploaderTargetUnionConfigAuthConfig provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the LogsUploaderTargetUnion.

func (*LogsUploaderTargetUnionConfigAuthConfig) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetUnionConfigAuthConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetUnionStatus added in v0.60.0

type LogsUploaderTargetUnionStatus struct {
	// This field will be present if the value is a [any] instead of an object.
	OfLogsUploaderTargetSlsStatus any `json:",inline"`
	// This field is from variant [LogsUploaderTargetS3GcoreStatus],
	// [LogsUploaderTargetS3AmazonStatus], [LogsUploaderTargetS3OssStatus],
	// [LogsUploaderTargetS3OtherStatus], [LogsUploaderTargetS3V1Status],
	// [LogsUploaderTargetFtpStatus], [LogsUploaderTargetSftpStatus],
	// [LogsUploaderTargetHTTPStatus], [LogsUploaderTargetAzureBlobStatus],
	// [LogsUploaderTargetSlsStatus].
	Code int64 `json:"code"`
	// This field is from variant [LogsUploaderTargetS3GcoreStatus],
	// [LogsUploaderTargetS3AmazonStatus], [LogsUploaderTargetS3OssStatus],
	// [LogsUploaderTargetS3OtherStatus], [LogsUploaderTargetS3V1Status],
	// [LogsUploaderTargetFtpStatus], [LogsUploaderTargetSftpStatus],
	// [LogsUploaderTargetHTTPStatus], [LogsUploaderTargetAzureBlobStatus],
	// [LogsUploaderTargetSlsStatus].
	Details string `json:"details"`
	// This field is from variant [LogsUploaderTargetS3GcoreStatus],
	// [LogsUploaderTargetS3AmazonStatus], [LogsUploaderTargetS3OssStatus],
	// [LogsUploaderTargetS3OtherStatus], [LogsUploaderTargetS3V1Status],
	// [LogsUploaderTargetFtpStatus], [LogsUploaderTargetSftpStatus],
	// [LogsUploaderTargetHTTPStatus], [LogsUploaderTargetAzureBlobStatus],
	// [LogsUploaderTargetSlsStatus].
	Status LogsUploaderValidationStatus `json:"status"`
	// This field is from variant [LogsUploaderTargetS3GcoreStatus],
	// [LogsUploaderTargetS3AmazonStatus], [LogsUploaderTargetS3OssStatus],
	// [LogsUploaderTargetS3OtherStatus], [LogsUploaderTargetS3V1Status],
	// [LogsUploaderTargetFtpStatus], [LogsUploaderTargetSftpStatus],
	// [LogsUploaderTargetHTTPStatus], [LogsUploaderTargetAzureBlobStatus],
	// [LogsUploaderTargetSlsStatus].
	Updated time.Time `json:"updated"`
	JSON    struct {
		OfLogsUploaderTargetSlsStatus respjson.Field
		Code                          respjson.Field
		Details                       respjson.Field
		Status                        respjson.Field
		Updated                       respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

LogsUploaderTargetUnionStatus is an implicit subunion of LogsUploaderTargetUnion. LogsUploaderTargetUnionStatus provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the LogsUploaderTargetUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfLogsUploaderTargetSlsStatus]

func (*LogsUploaderTargetUnionStatus) UnmarshalJSON added in v0.60.0

func (r *LogsUploaderTargetUnionStatus) UnmarshalJSON(data []byte) error

type LogsUploaderTargetUpdateParams

type LogsUploaderTargetUpdateParams struct {
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// Config for specific storage type.
	Config LogsUploaderTargetUpdateParamsConfigUnion `json:"config,omitzero"`
	// Type of storage for logs.
	//
	// Any of "s3_gcore", "s3_amazon", "s3_oss", "s3_other", "s3_v1", "ftp", "sftp",
	// "http", "azure_blob", "sls".
	StorageType LogsUploaderTargetUpdateParamsStorageType `json:"storage_type,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetUpdateParams) MarshalJSON

func (r LogsUploaderTargetUpdateParams) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParams) UnmarshalJSON

func (r *LogsUploaderTargetUpdateParams) UnmarshalJSON(data []byte) error

type LogsUploaderTargetUpdateParamsConfigAzureBlobConfig added in v0.38.0

type LogsUploaderTargetUpdateParamsConfigAzureBlobConfig struct {
	// Directory path within the container.
	Directory param.Opt[string] `json:"directory,omitzero"`
	// Custom Azure Blob Storage endpoint URL.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	// Azure Blob Storage account name.
	AccountName param.Opt[string] `json:"account_name,omitzero"`
	// Azure Blob Storage container name.
	ContainerName param.Opt[string]                                       `json:"container_name,omitzero"`
	Auth          LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuth `json:"auth,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetUpdateParamsConfigAzureBlobConfig) MarshalJSON added in v0.38.0

func (r LogsUploaderTargetUpdateParamsConfigAzureBlobConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigAzureBlobConfig) UnmarshalJSON added in v0.38.0

type LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuth added in v0.38.0

type LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuth struct {
	// Authentication credentials.
	Config LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigUnion `json:"config,omitzero" api:"required"`
	// Authentication type.
	//
	// Any of "shared_key", "sas_token".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuth) MarshalJSON added in v0.38.0

func (*LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuth) UnmarshalJSON added in v0.38.0

type LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigAccountKey added in v0.38.0

type LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigAccountKey struct {
	// Azure Blob Storage account key.
	AccountKey string `json:"account_key" api:"required"`
	// contains filtered or unexported fields
}

The property AccountKey is required.

func (LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigAccountKey) MarshalJSON added in v0.38.0

func (*LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigAccountKey) UnmarshalJSON added in v0.38.0

type LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigToken added in v0.38.0

type LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigToken struct {
	// Azure Blob Storage SAS token.
	Token string `json:"token" api:"required"`
	// contains filtered or unexported fields
}

The property Token is required.

func (LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigToken) MarshalJSON added in v0.38.0

func (*LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigToken) UnmarshalJSON added in v0.38.0

type LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigUnion added in v0.38.0

type LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigUnion struct {
	OfLogsUploaderTargetUpdatesConfigAzureBlobConfigAuthConfigAccountKey *LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigAccountKey `json:",omitzero,inline"`
	OfLogsUploaderTargetUpdatesConfigAzureBlobConfigAuthConfigToken      *LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigToken      `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (*LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigUnion) GetAccountKey added in v0.38.0

GetAccountKey returns the account key if the AccountKey variant is set

func (*LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigUnion) GetToken added in v0.38.0

GetToken returns the token if the Token variant is set

func (LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigUnion) MarshalJSON added in v0.38.0

func (*LogsUploaderTargetUpdateParamsConfigAzureBlobConfigAuthConfigUnion) UnmarshalJSON added in v0.38.0

type LogsUploaderTargetUpdateParamsConfigFtpConfig

type LogsUploaderTargetUpdateParamsConfigFtpConfig struct {
	Directory      param.Opt[string] `json:"directory,omitzero"`
	Hostname       param.Opt[string] `json:"hostname,omitzero"`
	Password       param.Opt[string] `json:"password,omitzero"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	User           param.Opt[string] `json:"user,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetUpdateParamsConfigFtpConfig) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigFtpConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigFtpConfig) UnmarshalJSON

func (r *LogsUploaderTargetUpdateParamsConfigFtpConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetUpdateParamsConfigHTTPConfig

type LogsUploaderTargetUpdateParamsConfigHTTPConfig struct {
	Upload LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload `json:"upload,omitzero" api:"required"`
	Append LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend `json:"append,omitzero"`
	Auth   LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth   `json:"auth,omitzero"`
	// Any of "json", "text".
	ContentType string                                              `json:"content_type,omitzero"`
	Retry       LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry `json:"retry,omitzero"`
	// contains filtered or unexported fields
}

The property Upload is required.

func (LogsUploaderTargetUpdateParamsConfigHTTPConfig) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigHTTPConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigHTTPConfig) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend

type LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend struct {
	URL            string            `json:"url" api:"required"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	UseCompression param.Opt[bool]   `json:"use_compression,omitzero"`
	Headers        map[string]string `json:"headers,omitzero"`
	// Any of "POST", "PUT".
	Method          string                                                               `json:"method,omitzero"`
	ResponseActions []LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction

type LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero" api:"required"`
	Description     param.Opt[string] `json:"description,omitzero"`
	MatchPayload    param.Opt[string] `json:"match_payload,omitzero"`
	MatchStatusCode param.Opt[int64]  `json:"match_status_code,omitzero"`
	// contains filtered or unexported fields
}

The property Action is required.

func (LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction) MarshalJSON

func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth

type LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth struct {
	Config LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig `json:"config,omitzero" api:"required"`
	// Any of "token".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig

type LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig struct {
	Token      string `json:"token" api:"required"`
	HeaderName string `json:"header_name" api:"required"`
	// contains filtered or unexported fields
}

The properties Token, HeaderName are required.

func (LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig) MarshalJSON

func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry

type LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry struct {
	URL            string            `json:"url" api:"required"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	UseCompression param.Opt[bool]   `json:"use_compression,omitzero"`
	Headers        map[string]string `json:"headers,omitzero"`
	// Any of "POST", "PUT".
	Method          string                                                              `json:"method,omitzero"`
	ResponseActions []LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction

type LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero" api:"required"`
	Description     param.Opt[string] `json:"description,omitzero"`
	MatchPayload    param.Opt[string] `json:"match_payload,omitzero"`
	MatchStatusCode param.Opt[int64]  `json:"match_status_code,omitzero"`
	// contains filtered or unexported fields
}

The property Action is required.

func (LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction) MarshalJSON

func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload

type LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload struct {
	URL            string            `json:"url" api:"required"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	UseCompression param.Opt[bool]   `json:"use_compression,omitzero"`
	Headers        map[string]string `json:"headers,omitzero"`
	// Any of "POST", "PUT".
	Method          string                                                               `json:"method,omitzero"`
	ResponseActions []LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction

type LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero" api:"required"`
	Description     param.Opt[string] `json:"description,omitzero"`
	MatchPayload    param.Opt[string] `json:"match_payload,omitzero"`
	MatchStatusCode param.Opt[int64]  `json:"match_status_code,omitzero"`
	// contains filtered or unexported fields
}

The property Action is required.

func (LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction) MarshalJSON

func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigS3AmazonConfig

type LogsUploaderTargetUpdateParamsConfigS3AmazonConfig struct {
	AccessKeyID     string            `json:"access_key_id" api:"required"`
	BucketName      string            `json:"bucket_name" api:"required"`
	Region          string            `json:"region" api:"required"`
	SecretAccessKey string            `json:"secret_access_key" api:"required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Region, SecretAccessKey are required.

func (LogsUploaderTargetUpdateParamsConfigS3AmazonConfig) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigS3AmazonConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigS3AmazonConfig) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigS3GcoreBoundConfig added in v0.60.0

type LogsUploaderTargetUpdateParamsConfigS3GcoreBoundConfig struct {
	Directory param.Opt[string] `json:"directory,omitzero"`
	// Name of a bucket in the selected storage.
	BucketName param.Opt[string] `json:"bucket_name,omitzero"`
	// ID of your Gcore Object Storage. The storage must be active and of the Standard
	// type.
	StorageID param.Opt[int64] `json:"storage_id,omitzero"`
	// contains filtered or unexported fields
}

Bind a target to your Gcore Object Storage, or change its bucket or storage. To bind a target that is not bound yet, send both `storage_id` and `bucket_name`, and set `storage_type` to `s3_gcore` if the target uses another storage type.

func (LogsUploaderTargetUpdateParamsConfigS3GcoreBoundConfig) MarshalJSON added in v0.60.0

func (*LogsUploaderTargetUpdateParamsConfigS3GcoreBoundConfig) UnmarshalJSON added in v0.60.0

type LogsUploaderTargetUpdateParamsConfigS3GcoreConfig

type LogsUploaderTargetUpdateParamsConfigS3GcoreConfig struct {
	Directory   param.Opt[string] `json:"directory,omitzero"`
	AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
	BucketName  param.Opt[string] `json:"bucket_name,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint        param.Opt[string] `json:"endpoint,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetUpdateParamsConfigS3GcoreConfig) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigS3GcoreConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigS3GcoreConfig) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigS3OssConfig

type LogsUploaderTargetUpdateParamsConfigS3OssConfig struct {
	AccessKeyID     string            `json:"access_key_id" api:"required"`
	BucketName      string            `json:"bucket_name" api:"required"`
	SecretAccessKey string            `json:"secret_access_key" api:"required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	Region   param.Opt[string] `json:"region,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, SecretAccessKey are required.

func (LogsUploaderTargetUpdateParamsConfigS3OssConfig) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigS3OssConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigS3OssConfig) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigS3OtherConfig

type LogsUploaderTargetUpdateParamsConfigS3OtherConfig struct {
	Directory   param.Opt[string] `json:"directory,omitzero"`
	AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
	BucketName  param.Opt[string] `json:"bucket_name,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint        param.Opt[string] `json:"endpoint,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetUpdateParamsConfigS3OtherConfig) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigS3OtherConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigS3OtherConfig) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigS3V1Config

type LogsUploaderTargetUpdateParamsConfigS3V1Config struct {
	Directory   param.Opt[string] `json:"directory,omitzero"`
	AccessKeyID param.Opt[string] `json:"access_key_id,omitzero"`
	BucketName  param.Opt[string] `json:"bucket_name,omitzero"`
	// S3 storage endpoint URL. Must be a public address: private and reserved IP
	// addresses, `localhost`, and hostnames that resolve to them are rejected.
	Endpoint        param.Opt[string] `json:"endpoint,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	SecretAccessKey param.Opt[string] `json:"secret_access_key,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetUpdateParamsConfigS3V1Config) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigS3V1Config) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigS3V1Config) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigSftpConfig

type LogsUploaderTargetUpdateParamsConfigSftpConfig struct {
	Directory      param.Opt[string] `json:"directory,omitzero"`
	KeyPassphrase  param.Opt[string] `json:"key_passphrase,omitzero"`
	Password       param.Opt[string] `json:"password,omitzero"`
	PrivateKey     param.Opt[string] `json:"private_key,omitzero"`
	Hostname       param.Opt[string] `json:"hostname,omitzero"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	User           param.Opt[string] `json:"user,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetUpdateParamsConfigSftpConfig) MarshalJSON

func (r LogsUploaderTargetUpdateParamsConfigSftpConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigSftpConfig) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigSlsConfig added in v0.50.0

type LogsUploaderTargetUpdateParamsConfigSlsConfig struct {
	// SLS endpoint. Optional — derived from the region as `{region}.log.aliyuncs.com`
	// when omitted.
	Endpoint param.Opt[string] `json:"endpoint,omitzero"`
	// Optional SLS topic (0-128 characters).
	Topic param.Opt[string] `json:"topic,omitzero"`
	// SLS logstore name. 3-36 characters; lowercase letters, digits, hyphens, and
	// underscores.
	LogStore param.Opt[string] `json:"log_store,omitzero"`
	// SLS project name. 3-63 characters; lowercase letters, digits, and hyphens.
	Project param.Opt[string] `json:"project,omitzero"`
	// SLS region (e.g. `eu-central-1`).
	Region param.Opt[string]                                 `json:"region,omitzero"`
	Auth   LogsUploaderTargetUpdateParamsConfigSlsConfigAuth `json:"auth,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetUpdateParamsConfigSlsConfig) MarshalJSON added in v0.50.0

func (r LogsUploaderTargetUpdateParamsConfigSlsConfig) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigSlsConfig) UnmarshalJSON added in v0.50.0

func (r *LogsUploaderTargetUpdateParamsConfigSlsConfig) UnmarshalJSON(data []byte) error

type LogsUploaderTargetUpdateParamsConfigSlsConfigAuth added in v0.50.0

type LogsUploaderTargetUpdateParamsConfigSlsConfigAuth struct {
	// Authentication credentials.
	Config LogsUploaderTargetUpdateParamsConfigSlsConfigAuthConfig `json:"config,omitzero" api:"required"`
	// Authentication type.
	//
	// Any of "ak_sk".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetUpdateParamsConfigSlsConfigAuth) MarshalJSON added in v0.50.0

func (r LogsUploaderTargetUpdateParamsConfigSlsConfigAuth) MarshalJSON() (data []byte, err error)

func (*LogsUploaderTargetUpdateParamsConfigSlsConfigAuth) UnmarshalJSON added in v0.50.0

type LogsUploaderTargetUpdateParamsConfigSlsConfigAuthConfig added in v0.50.0

type LogsUploaderTargetUpdateParamsConfigSlsConfigAuthConfig struct {
	// Alibaba access key ID.
	AccessKeyID string `json:"access_key_id" api:"required"`
	// Alibaba secret access key.
	SecretAccessKey string `json:"secret_access_key" api:"required"`
	// contains filtered or unexported fields
}

Authentication credentials.

The properties AccessKeyID, SecretAccessKey are required.

func (LogsUploaderTargetUpdateParamsConfigSlsConfigAuthConfig) MarshalJSON added in v0.50.0

func (*LogsUploaderTargetUpdateParamsConfigSlsConfigAuthConfig) UnmarshalJSON added in v0.50.0

type LogsUploaderTargetUpdateParamsConfigUnion

type LogsUploaderTargetUpdateParamsConfigUnion struct {
	OfS3GcoreConfig      *LogsUploaderTargetUpdateParamsConfigS3GcoreConfig      `json:",omitzero,inline"`
	OfS3GcoreBoundConfig *LogsUploaderTargetUpdateParamsConfigS3GcoreBoundConfig `json:",omitzero,inline"`
	OfS3AmazonConfig     *LogsUploaderTargetUpdateParamsConfigS3AmazonConfig     `json:",omitzero,inline"`
	OfS3OssConfig        *LogsUploaderTargetUpdateParamsConfigS3OssConfig        `json:",omitzero,inline"`
	OfS3OtherConfig      *LogsUploaderTargetUpdateParamsConfigS3OtherConfig      `json:",omitzero,inline"`
	OfS3V1Config         *LogsUploaderTargetUpdateParamsConfigS3V1Config         `json:",omitzero,inline"`
	OfFtpConfig          *LogsUploaderTargetUpdateParamsConfigFtpConfig          `json:",omitzero,inline"`
	OfSftpConfig         *LogsUploaderTargetUpdateParamsConfigSftpConfig         `json:",omitzero,inline"`
	OfHTTPConfig         *LogsUploaderTargetUpdateParamsConfigHTTPConfig         `json:",omitzero,inline"`
	OfAzureBlobConfig    *LogsUploaderTargetUpdateParamsConfigAzureBlobConfig    `json:",omitzero,inline"`
	OfSlsConfig          *LogsUploaderTargetUpdateParamsConfigSlsConfig          `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetAccessKeyID

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetAccountName added in v0.38.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetAppend

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetAuth

func (u LogsUploaderTargetUpdateParamsConfigUnion) GetAuth() (res logsUploaderTargetUpdateParamsConfigUnionAuth)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (LogsUploaderTargetUpdateParamsConfigUnion) GetBucketName

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetContainerName added in v0.38.0

func (u LogsUploaderTargetUpdateParamsConfigUnion) GetContainerName() *string

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetContentType

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetDirectory

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetEndpoint

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetHostname

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetKeyPassphrase

func (u LogsUploaderTargetUpdateParamsConfigUnion) GetKeyPassphrase() *string

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetLogStore added in v0.50.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetPassword

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetPrivateKey

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetProject added in v0.50.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetRegion

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetRetry

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetSecretAccessKey

func (u LogsUploaderTargetUpdateParamsConfigUnion) GetSecretAccessKey() *string

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetStorageID added in v0.60.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetTimeoutSeconds

func (u LogsUploaderTargetUpdateParamsConfigUnion) GetTimeoutSeconds() *int64

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetTopic added in v0.50.0

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetUpload

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetUsePathStyle

func (u LogsUploaderTargetUpdateParamsConfigUnion) GetUsePathStyle() *bool

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetUser

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) MarshalJSON

func (*LogsUploaderTargetUpdateParamsConfigUnion) UnmarshalJSON

func (u *LogsUploaderTargetUpdateParamsConfigUnion) UnmarshalJSON(data []byte) error

type LogsUploaderTargetUpdateParamsStorageType

type LogsUploaderTargetUpdateParamsStorageType string

Type of storage for logs.

const (
	LogsUploaderTargetUpdateParamsStorageTypeS3Gcore   LogsUploaderTargetUpdateParamsStorageType = "s3_gcore"
	LogsUploaderTargetUpdateParamsStorageTypeS3Amazon  LogsUploaderTargetUpdateParamsStorageType = "s3_amazon"
	LogsUploaderTargetUpdateParamsStorageTypeS3Oss     LogsUploaderTargetUpdateParamsStorageType = "s3_oss"
	LogsUploaderTargetUpdateParamsStorageTypeS3Other   LogsUploaderTargetUpdateParamsStorageType = "s3_other"
	LogsUploaderTargetUpdateParamsStorageTypeS3V1      LogsUploaderTargetUpdateParamsStorageType = "s3_v1"
	LogsUploaderTargetUpdateParamsStorageTypeFtp       LogsUploaderTargetUpdateParamsStorageType = "ftp"
	LogsUploaderTargetUpdateParamsStorageTypeSftp      LogsUploaderTargetUpdateParamsStorageType = "sftp"
	LogsUploaderTargetUpdateParamsStorageTypeHTTP      LogsUploaderTargetUpdateParamsStorageType = "http"
	LogsUploaderTargetUpdateParamsStorageTypeAzureBlob LogsUploaderTargetUpdateParamsStorageType = "azure_blob"
	LogsUploaderTargetUpdateParamsStorageTypeSls       LogsUploaderTargetUpdateParamsStorageType = "sls"
)

type LogsUploaderValidation

type LogsUploaderValidation struct {
	// Error code indicating the type of validation error.
	Code int64 `json:"code"`
	// Error message if the validation failed.
	Details string `json:"details"`
	// Status of the validation.
	//
	// Any of "in_progress", "successful", "failed".
	Status LogsUploaderValidationStatus `json:"status"`
	// Time when the validation status was updated.
	Updated time.Time `json:"updated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Details     respjson.Field
		Status      respjson.Field
		Updated     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderValidation) RawJSON

func (r LogsUploaderValidation) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderValidation) UnmarshalJSON

func (r *LogsUploaderValidation) UnmarshalJSON(data []byte) error

type LogsUploaderValidationStatus

type LogsUploaderValidationStatus string

Status of the validation.

const (
	LogsUploaderValidationStatusInProgress LogsUploaderValidationStatus = "in_progress"
	LogsUploaderValidationStatusSuccessful LogsUploaderValidationStatus = "successful"
	LogsUploaderValidationStatusFailed     LogsUploaderValidationStatus = "failed"
)

type MetricListParams

type MetricListParams struct {
	// Beginning period to fetch metrics (ISO 8601/RFC 3339 format, UTC.)
	//
	// Examples:
	//
	// - 2021-06-14T00:00:00Z
	// - 2021-06-14T00:00:00.000Z
	//
	// The total number of points, which is determined as the difference between "from"
	// and "to" divided by "granularity", cannot exceed 1440. Exception: "speed"
	// metrics are limited to 72 points.
	From string `json:"from" api:"required"`
	// Possible values:
	//
	//   - **`edge_bandwidth`** - Bandwidth from client to CDN (bit/s.)
	//   - **`edge_requests`** - Number of requests per interval (requests/s.)
	//   - **`edge_requests_total`** - Total number of requests per interval.
	//   - **`edge_status_1xx`** - Number of 1xx status codes from edge.
	//   - **`edge_status_200`** - Number of 200 status codes from edge.
	//   - **`edge_status_204`** - Number of 204 status codes from edge.
	//   - **`edge_status_206`** - Number of 206 status codes from edge.
	//   - **`edge_status_2xx`** - Number of 2xx status codes from edge.
	//   - **`edge_status_301`** - Number of 301 status codes from edge.
	//   - **`edge_status_302`** - Number of 302 status codes from edge.
	//   - **`edge_status_304`** - Number of 304 status codes from edge.
	//   - **`edge_status_3xx`** - Number of 3xx status codes from edge.
	//   - **`edge_status_400`** - Number of 400 status codes from edge.
	//   - **`edge_status_401`** - Number of 401 status codes from edge.
	//   - **`edge_status_403`** - Number of 403 status codes from edge.
	//   - **`edge_status_404`** - Number of 404 status codes from edge.
	//   - **`edge_status_416`** - Number of 416 status codes from edge.
	//   - **`edge_status_429`** - Number of 429 status codes from edge.
	//   - **`edge_status_4xx`** - Number of 4xx status codes from edge.
	//   - **`edge_status_500`** - Number of 500 status codes from edge.
	//   - **`edge_status_501`** - Number of 501 status codes from edge.
	//   - **`edge_status_502`** - Number of 502 status codes from edge.
	//   - **`edge_status_503`** - Number of 503 status codes from edge.
	//   - **`edge_status_504`** - Number of 504 status codes from edge.
	//   - **`edge_status_505`** - Number of 505 status codes from edge.
	//   - **`edge_status_5xx`** - Number of 5xx status codes from edge.
	//   - **`edge_hit_ratio`** - Percent of cache hits (0.0 - 1.0).
	//   - **`edge_hit_bytes`** - Number of bytes sent back when cache hits.
	//   - **`origin_bandwidth`** - Bandwidth from CDN to Origin (bit/s.)
	//   - **`origin_requests`** - Number of requests per interval (requests/s.)
	//   - **`origin_status_1xx`** - Number of 1xx status from origin.
	//   - **`origin_status_200`** - Number of 200 status from origin.
	//   - **`origin_status_204`** - Number of 204 status from origin.
	//   - **`origin_status_206`** - Number of 206 status from origin.
	//   - **`origin_status_2xx`** - Number of 2xx status from origin.
	//   - **`origin_status_301`** - Number of 301 status from origin.
	//   - **`origin_status_302`** - Number of 302 status from origin.
	//   - **`origin_status_304`** - Number of 304 status from origin.
	//   - **`origin_status_3xx`** - Number of 3xx status from origin.
	//   - **`origin_status_400`** - Number of 400 status from origin.
	//   - **`origin_status_401`** - Number of 401 status from origin.
	//   - **`origin_status_403`** - Number of 403 status from origin.
	//   - **`origin_status_404`** - Number of 404 status from origin.
	//   - **`origin_status_416`** - Number of 416 status from origin.
	//   - **`origin_status_429`** - Number of 426 status from origin.
	//   - **`origin_status_4xx`** - Number of 4xx status from origin.
	//   - **`origin_status_500`** - Number of 500 status from origin.
	//   - **`origin_status_501`** - Number of 501 status from origin.
	//   - **`origin_status_502`** - Number of 502 status from origin.
	//   - **`origin_status_503`** - Number of 503 status from origin.
	//   - **`origin_status_504`** - Number of 504 status from origin.
	//   - **`origin_status_505`** - Number of 505 status from origin.
	//   - **`origin_status_5xx`** - Number of 5xx status from origin.
	//   - **`edge_download_speed`** - Download speed from edge in KB/s (includes only
	//     requests that status was in the range [200, 300].)
	//   - **`origin_download_speed`** - Download speed from origin in KB/s (includes
	//     only requests that status was in the range [200, 300].)
	Metrics []string `json:"metrics,omitzero" api:"required"`
	// Specifies ending period to fetch metrics (ISO 8601/RFC 3339 format, UTC)
	//
	// Examples:
	//
	// - 2021-06-15T00:00:00Z
	// - 2021-06-15T00:00:00.000Z
	//
	// The total number of points, which is determined as the difference between "from"
	// and "to" divided by "granularity", cannot exceed 1440. Exception: "speed"
	// metrics are limited to 72 points.
	To string `json:"to" api:"required"`
	// Duration of the time blocks into which the data is divided. The value must
	// correspond to the ISO 8601 period format.
	//
	// Examples:
	//
	// - P1D
	// - PT5M
	//
	// Notes:
	//
	//   - The total number of points, which is determined as the difference between
	//     "from" and "to" divided by "granularity", cannot exceed 1440. Exception:
	//     "speed" metrics are limited to 72 points.
	//   - For "speed" metrics the value must be a multiple of 5.
	Granularity param.Opt[string] `json:"granularity,omitzero" format:"P(n)Y(n)M(n)DT(n)H(n)M)"`
	// Each item represents one filter statement.
	FilterBy []MetricListParamsFilterBy `json:"filter_by,omitzero"`
	// Output data grouping.
	//
	// Possible values:
	//
	//   - **resource** - Data is grouped by CDN resource.
	//   - **cname** - Data is grouped by common names.
	//   - **region** – Data is grouped by regions (continents.) Available for "speed"
	//     metrics only.
	//   - **isp** - Data is grouped by ISP names. Available for "speed" metrics only.
	GroupBy []string `json:"group_by,omitzero"`
	// contains filtered or unexported fields
}

func (MetricListParams) MarshalJSON

func (r MetricListParams) MarshalJSON() (data []byte, err error)

func (*MetricListParams) UnmarshalJSON

func (r *MetricListParams) UnmarshalJSON(data []byte) error

type MetricListParamsFilterBy

type MetricListParamsFilterBy struct {
	// Defines the parameters by that data can be filtered.
	//
	// Possible values:
	//
	//   - **resource** - Data is filtered by CDN resource ID.
	//   - **cname** - Data is filtered by common name.
	//   - **region** - Data is filtered by region (continent.) Available for "speed"
	//     metrics only.
	//   - **isp** - Data is filtered by ISP name. Available for "speed" metrics only.
	Field string `json:"field" api:"required"`
	// Comparison operator to be applied.
	//
	// Possible values:
	//
	// - **in** - 'IN' operator.
	// - **`not_in`** - 'NOT IN' operator.
	// - **gt** - '>' operator.
	// - **gte** - '>=' operator.
	// - **lt** - '<' operator.
	// - **lte** - '<=' operator.
	// - **eq** - '==' operator.
	// - **ne** - '!=' operator.
	// - **like** - 'LIKE' operator.
	// - **`not_like`** - 'NOT LIKE' operator.
	Op string `json:"op" api:"required"`
	// Contains one or more values to be compared against.
	Values []MetricListParamsFilterByValueUnion `json:"values,omitzero" api:"required"`
	// contains filtered or unexported fields
}

The properties Field, Op, Values are required.

func (MetricListParamsFilterBy) MarshalJSON

func (r MetricListParamsFilterBy) MarshalJSON() (data []byte, err error)

func (*MetricListParamsFilterBy) UnmarshalJSON

func (r *MetricListParamsFilterBy) UnmarshalJSON(data []byte) error

type MetricListParamsFilterByValueUnion

type MetricListParamsFilterByValueUnion struct {
	OfFloat  param.Opt[float64] `json:",omitzero,inline"`
	OfString param.Opt[string]  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MetricListParamsFilterByValueUnion) MarshalJSON

func (u MetricListParamsFilterByValueUnion) MarshalJSON() ([]byte, error)

func (*MetricListParamsFilterByValueUnion) UnmarshalJSON

func (u *MetricListParamsFilterByValueUnion) UnmarshalJSON(data []byte) error

type MetricService

type MetricService struct {
	Options []option.RequestOption
}

Consumption statistics is updated in near real-time as a standard practice. However, the frequency of updates can vary, but they are typically available within a 24-hour period. Exceptions, such as maintenance periods, may delay data beyond 24 hours until servers resume and fill in the missing statistics.

MetricService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMetricService method instead.

func NewMetricService

func NewMetricService(opts ...option.RequestOption) (r MetricService)

NewMetricService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MetricService) List

func (r *MetricService) List(ctx context.Context, body MetricListParams, opts ...option.RequestOption) (res *CDNMetrics, err error)

Get CDN metrics

type NetworkCapacity

type NetworkCapacity []NetworkCapacityItem

type NetworkCapacityItem

type NetworkCapacityItem struct {
	// Network capacity in Gbit/s.
	Capacity float64 `json:"capacity"`
	// Country name.
	Country string `json:"country"`
	// ISO country code.
	CountryCode string `json:"country_code"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Capacity    respjson.Field
		Country     respjson.Field
		CountryCode respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NetworkCapacityItem) RawJSON

func (r NetworkCapacityItem) RawJSON() string

Returns the unmodified JSON received from the API

func (*NetworkCapacityItem) UnmarshalJSON

func (r *NetworkCapacityItem) UnmarshalJSON(data []byte) error

type NetworkCapacityService

type NetworkCapacityService struct {
	Options []option.RequestOption
}

Consumption statistics is updated in near real-time as a standard practice. However, the frequency of updates can vary, but they are typically available within a 24-hour period. Exceptions, such as maintenance periods, may delay data beyond 24 hours until servers resume and fill in the missing statistics.

NetworkCapacityService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNetworkCapacityService method instead.

func NewNetworkCapacityService

func NewNetworkCapacityService(opts ...option.RequestOption) (r NetworkCapacityService)

NewNetworkCapacityService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*NetworkCapacityService) List

Get network capacity per country.

type OriginGroupListParams

type OriginGroupListParams struct {
	// Defines whether the origin group has related CDN resources.
	//
	// Possible values:
	//
	// - **true** – Origin group has related CDN resources.
	// - **false** – Origin group does not have related CDN resources.
	HasRelatedResources param.Opt[bool] `query:"has_related_resources,omitzero" json:"-"`
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Origin group name.
	Name param.Opt[string] `query:"name,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Origin sources (IP addresses or domains) in the origin group.
	Sources param.Opt[string] `query:"sources,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (OriginGroupListParams) URLQuery

func (r OriginGroupListParams) URLQuery() (v url.Values, err error)

URLQuery serializes OriginGroupListParams's query parameters as `url.Values`.

type OriginGroupNewParams

type OriginGroupNewParams struct {

	// This field is a request body variant, only one variant field can be set. Create
	// an origin group with host origins, or mixed host and S3 origins.
	OfNoneAuth *OriginGroupNewParamsBodyNoneAuth `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	OfAwsSignatureV4 *OriginGroupNewParamsBodyAwsSignatureV4 `json:",inline"`
	// contains filtered or unexported fields
}

func (OriginGroupNewParams) MarshalJSON

func (u OriginGroupNewParams) MarshalJSON() ([]byte, error)

func (*OriginGroupNewParams) UnmarshalJSON

func (r *OriginGroupNewParams) UnmarshalJSON(data []byte) error

type OriginGroupNewParamsBodyAwsSignatureV4 deprecated

type OriginGroupNewParamsBodyAwsSignatureV4 struct {
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	//
	// Credentials to access the private bucket.
	//
	// Deprecated: deprecated
	Auth OriginGroupNewParamsBodyAwsSignatureV4Auth `json:"auth,omitzero" api:"required"`
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	//
	// Authentication type.
	//
	// **awsSignatureV4** value is used for S3 storage.
	//
	// Deprecated: deprecated
	AuthType string `json:"auth_type" api:"required"`
	// Origin group name.
	Name string `json:"name" api:"required"`
	// Defines whether to use the next origin from the origin group if origin responds
	// with the cases specified in `proxy_next_upstream`. If you enable it, you must
	// specify cases in `proxy_next_upstream`.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	UseNext param.Opt[bool] `json:"use_next,omitzero"`
	// Defines cases when the request should be passed on to the next origin.
	//
	// Possible values:
	//
	//   - **error** - an error occurred while establishing a connection with the origin,
	//     passing a request to it, or reading the response header
	//   - **timeout** - a timeout has occurred while establishing a connection with the
	//     origin, passing a request to it, or reading the response header
	//   - **`invalid_header`** - a origin returned an empty or invalid response
	//   - **`http_403`** - a origin returned a response with the code 403
	//   - **`http_404`** - a origin returned a response with the code 404
	//   - **`http_429`** - a origin returned a response with the code 429
	//   - **`http_500`** - a origin returned a response with the code 500
	//   - **`http_502`** - a origin returned a response with the code 502
	//   - **`http_503`** - a origin returned a response with the code 503
	//   - **`http_504`** - a origin returned a response with the code 504
	ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
	// contains filtered or unexported fields
}

**Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead.

Deprecated: deprecated

The properties Auth, AuthType, Name are required.

func (OriginGroupNewParamsBodyAwsSignatureV4) MarshalJSON

func (r OriginGroupNewParamsBodyAwsSignatureV4) MarshalJSON() (data []byte, err error)

func (*OriginGroupNewParamsBodyAwsSignatureV4) UnmarshalJSON

func (r *OriginGroupNewParamsBodyAwsSignatureV4) UnmarshalJSON(data []byte) error

type OriginGroupNewParamsBodyAwsSignatureV4Auth deprecated

type OriginGroupNewParamsBodyAwsSignatureV4Auth struct {
	// Access key ID for the S3 account.
	//
	// Restrictions:
	//
	// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
	// - From 3 to 512 characters.
	S3AccessKeyID string `json:"s3_access_key_id" api:"required"`
	// S3 bucket name.
	S3BucketName string `json:"s3_bucket_name" api:"required"`
	// Secret access key for the S3 account.
	//
	// Restrictions:
	//
	//   - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
	//     underscores.
	//   - If "s3_type": amazon, length should be 40 characters.
	//   - If "s3_type": other, length should be from 16 to 255 characters.
	S3SecretAccessKey string `json:"s3_secret_access_key" api:"required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	// - **amazon** – AWS S3 storage.
	// - **other** – Other (not AWS) S3 compatible storage.
	S3Type string `json:"s3_type" api:"required"`
	// S3 storage region.
	//
	// The parameter is required, if "s3_type": amazon.
	S3Region param.Opt[string] `json:"s3_region,omitzero"`
	// S3 storage hostname.
	//
	// The parameter is required, if "s3_type": other.
	//
	// Must be a public address: private and reserved IP addresses, `localhost`, and
	// hostnames that resolve to them are rejected.
	S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
	// contains filtered or unexported fields
}

**Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead.

Credentials to access the private bucket.

Deprecated: deprecated

The properties S3AccessKeyID, S3BucketName, S3SecretAccessKey, S3Type are required.

func (OriginGroupNewParamsBodyAwsSignatureV4Auth) MarshalJSON

func (r OriginGroupNewParamsBodyAwsSignatureV4Auth) MarshalJSON() (data []byte, err error)

func (*OriginGroupNewParamsBodyAwsSignatureV4Auth) UnmarshalJSON

func (r *OriginGroupNewParamsBodyAwsSignatureV4Auth) UnmarshalJSON(data []byte) error

type OriginGroupNewParamsBodyNoneAuth

type OriginGroupNewParamsBodyNoneAuth struct {
	// Origin group name.
	Name    string                                        `json:"name" api:"required"`
	Sources []OriginGroupNewParamsBodyNoneAuthSourceUnion `json:"sources,omitzero" api:"required"`
	// **Deprecated.** No longer necessary. Defaults to `none`.
	//
	// Origin authentication type.
	//
	// Possible values:
	//
	// - **none** - Used for public origins.
	// - **awsSignatureV4** - Used for S3 storage.
	//
	// Deprecated: deprecated
	AuthType param.Opt[string] `json:"auth_type,omitzero"`
	// Defines whether to use the next origin from the origin group if origin responds
	// with the cases specified in `proxy_next_upstream`. If you enable it, you must
	// specify cases in `proxy_next_upstream`.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	UseNext param.Opt[bool] `json:"use_next,omitzero"`
	// Defines cases when the request should be passed on to the next origin.
	//
	// Possible values:
	//
	//   - **error** - an error occurred while establishing a connection with the origin,
	//     passing a request to it, or reading the response header
	//   - **timeout** - a timeout has occurred while establishing a connection with the
	//     origin, passing a request to it, or reading the response header
	//   - **`invalid_header`** - a origin returned an empty or invalid response
	//   - **`http_403`** - a origin returned a response with the code 403
	//   - **`http_404`** - a origin returned a response with the code 404
	//   - **`http_429`** - a origin returned a response with the code 429
	//   - **`http_500`** - a origin returned a response with the code 500
	//   - **`http_502`** - a origin returned a response with the code 502
	//   - **`http_503`** - a origin returned a response with the code 503
	//   - **`http_504`** - a origin returned a response with the code 504
	ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
	// contains filtered or unexported fields
}

Create an origin group with host origins, or mixed host and S3 origins.

The properties Name, Sources are required.

func (OriginGroupNewParamsBodyNoneAuth) MarshalJSON

func (r OriginGroupNewParamsBodyNoneAuth) MarshalJSON() (data []byte, err error)

func (*OriginGroupNewParamsBodyNoneAuth) UnmarshalJSON

func (r *OriginGroupNewParamsBodyNoneAuth) UnmarshalJSON(data []byte) error

type OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSource added in v0.46.0

type OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSource struct {
	// FastEdge application configuration. Required when `origin_type` is `fastedge`.
	Config OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSourceConfig `json:"config,omitzero" api:"required"`
	// Origin type. Present in responses for S3 and FastEdge sources.
	//
	// Possible values:
	//
	//   - **host** - A source server or endpoint from which content is fetched.
	//   - **s3** - S3 storage with either AWS v4 authentication or public access.
	//   - **fastedge** - A FastEdge application served directly from the local FastEdge
	//     runtime on the edge node, identified by `app_id`.
	//
	// Any of "host", "s3", "fastedge".
	OriginType string `json:"origin_type,omitzero" api:"required"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride param.Opt[string] `json:"host_header_override,omitzero"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup param.Opt[bool] `json:"backup,omitzero"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

The properties Config, OriginType are required.

func (OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSource) MarshalJSON added in v0.46.0

func (r OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSource) MarshalJSON() (data []byte, err error)

func (*OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSource) UnmarshalJSON added in v0.46.0

type OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSourceConfig added in v0.46.0

type OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSourceConfig struct {
	// ID of the FastEdge application served as origin (string, matching the existing
	// fastedge option's convention). The CDN dispatches requests to the local FastEdge
	// runtime on the edge node using this identifier. The application must be in your
	// account, be enabled, and have `wasi-http` API type.
	AppID string `json:"app_id" api:"required"`
	// contains filtered or unexported fields
}

FastEdge application configuration. Required when `origin_type` is `fastedge`.

The property AppID is required.

func (OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSourceConfig) MarshalJSON added in v0.46.0

func (*OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSourceConfig) UnmarshalJSON added in v0.46.0

type OriginGroupNewParamsBodyNoneAuthSourceHostSource added in v0.41.0

type OriginGroupNewParamsBodyNoneAuthSourceHostSource struct {
	// IP address or domain name of the origin and the port, if custom port is used.
	Source string `json:"source" api:"required"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride param.Opt[string] `json:"host_header_override,omitzero"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup param.Opt[bool] `json:"backup,omitzero"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

The property Source is required.

func (OriginGroupNewParamsBodyNoneAuthSourceHostSource) MarshalJSON added in v0.41.0

func (r OriginGroupNewParamsBodyNoneAuthSourceHostSource) MarshalJSON() (data []byte, err error)

func (*OriginGroupNewParamsBodyNoneAuthSourceHostSource) UnmarshalJSON added in v0.41.0

type OriginGroupNewParamsBodyNoneAuthSourceS3Source added in v0.41.0

type OriginGroupNewParamsBodyNoneAuthSourceS3Source struct {
	// S3 storage configuration. Required when `origin_type` is `s3`.
	//
	// To use your Gcore Object Storage as the origin, set `s3_type` to `gcore` and
	// send only `storage_id` and `s3_bucket_name`. The CDN configures the connection
	// for you, and the response returns only `s3_type`, `storage_id`, `s3_bucket_name`
	// and `s3_auth_type`. For such an origin:
	//
	//   - The CDN pulls content over HTTPS, regardless of the resource's
	//     `originProtocol`.
	//   - The CDN has read-only access to the bucket.
	//   - The CDN manages the Host header sent to the storage, so `host_header_override`
	//     is not accepted and is returned as `null`.
	Config OriginGroupNewParamsBodyNoneAuthSourceS3SourceConfig `json:"config,omitzero" api:"required"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride param.Opt[string] `json:"host_header_override,omitzero"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup param.Opt[bool] `json:"backup,omitzero"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Origin type. Present in responses for S3 and FastEdge sources.
	//
	// Possible values:
	//
	//   - **host** - A source server or endpoint from which content is fetched.
	//   - **s3** - S3 storage with either AWS v4 authentication or public access.
	//   - **fastedge** - A FastEdge application served directly from the local FastEdge
	//     runtime on the edge node, identified by `app_id`.
	//
	// Any of "host", "s3", "fastedge".
	OriginType string `json:"origin_type,omitzero"`
	// contains filtered or unexported fields
}

The property Config is required.

func (OriginGroupNewParamsBodyNoneAuthSourceS3Source) MarshalJSON added in v0.41.0

func (r OriginGroupNewParamsBodyNoneAuthSourceS3Source) MarshalJSON() (data []byte, err error)

func (*OriginGroupNewParamsBodyNoneAuthSourceS3Source) UnmarshalJSON added in v0.41.0

type OriginGroupNewParamsBodyNoneAuthSourceS3SourceConfig added in v0.41.0

type OriginGroupNewParamsBodyNoneAuthSourceS3SourceConfig struct {
	// S3 bucket name.
	//
	// If `s3_type` is `gcore`, the bucket must exist in the selected storage.
	S3BucketName string `json:"s3_bucket_name" api:"required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	//   - **amazon** - AWS S3 storage.
	//   - **other** - Other (not AWS) S3 compatible storage.
	//   - **gcore** - Your Gcore Object Storage. Select the storage and bucket, and the
	//     CDN configures the connection.
	//
	// Any of "amazon", "other", "gcore".
	S3Type string `json:"s3_type,omitzero" api:"required"`
	// S3 storage region.
	//
	// The parameter is required if `s3_type` is `amazon`. Not allowed if `s3_type` is
	// `gcore`: the CDN fills it and does not return it.
	S3Region param.Opt[string] `json:"s3_region,omitzero"`
	// S3 storage hostname.
	//
	// The parameter is required if `s3_type` is `other`. Not allowed if `s3_type` is
	// `gcore`: the CDN fills it and does not return it.
	//
	// Must be a public address: private and reserved IP addresses, `localhost`, and
	// hostnames that resolve to them are rejected.
	S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
	// Access key ID for the S3 account. Masked as `SECRET_VALUE` in responses.
	//
	// The parameter is required if `s3_type` is `amazon` or `other`. Not allowed if
	// `s3_type` is `gcore`: the CDN fills it and does not return it.
	//
	// Restrictions:
	//
	// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
	// - From 4 to 255 characters.
	S3AccessKeyID param.Opt[string] `json:"s3_access_key_id,omitzero"`
	// S3 authentication type.
	S3AuthType param.Opt[string] `json:"s3_auth_type,omitzero"`
	// Secret access key for the S3 account. Masked as `SECRET_VALUE` in responses.
	//
	// The parameter is required if `s3_type` is `amazon` or `other`. Not allowed if
	// `s3_type` is `gcore`: the CDN fills it and does not return it.
	//
	// Restrictions:
	//
	//   - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
	//     underscores.
	//   - From 16 to 255 characters.
	S3SecretAccessKey param.Opt[string] `json:"s3_secret_access_key,omitzero"`
	// ID of your Gcore Object Storage.
	//
	// The parameter is required if `s3_type` is `gcore`, and not allowed otherwise.
	// The storage must be active and of the Standard type.
	StorageID param.Opt[int64] `json:"storage_id,omitzero"`
	// contains filtered or unexported fields
}

S3 storage configuration. Required when `origin_type` is `s3`.

To use your Gcore Object Storage as the origin, set `s3_type` to `gcore` and send only `storage_id` and `s3_bucket_name`. The CDN configures the connection for you, and the response returns only `s3_type`, `storage_id`, `s3_bucket_name` and `s3_auth_type`. For such an origin:

  • The CDN pulls content over HTTPS, regardless of the resource's `originProtocol`.
  • The CDN has read-only access to the bucket.
  • The CDN manages the Host header sent to the storage, so `host_header_override` is not accepted and is returned as `null`.

The properties S3BucketName, S3Type are required.

func (OriginGroupNewParamsBodyNoneAuthSourceS3SourceConfig) MarshalJSON added in v0.41.0

func (r OriginGroupNewParamsBodyNoneAuthSourceS3SourceConfig) MarshalJSON() (data []byte, err error)

func (*OriginGroupNewParamsBodyNoneAuthSourceS3SourceConfig) UnmarshalJSON added in v0.41.0

type OriginGroupNewParamsBodyNoneAuthSourceUnion added in v0.41.0

type OriginGroupNewParamsBodyNoneAuthSourceUnion struct {
	OfHostSource     *OriginGroupNewParamsBodyNoneAuthSourceHostSource     `json:",omitzero,inline"`
	OfS3Source       *OriginGroupNewParamsBodyNoneAuthSourceS3Source       `json:",omitzero,inline"`
	OfFastEdgeSource *OriginGroupNewParamsBodyNoneAuthSourceFastEdgeSource `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (OriginGroupNewParamsBodyNoneAuthSourceUnion) GetBackup added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupNewParamsBodyNoneAuthSourceUnion) GetConfig added in v0.41.0

func (u OriginGroupNewParamsBodyNoneAuthSourceUnion) GetConfig() (res originGroupNewParamsBodyNoneAuthSourceUnionConfig)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (OriginGroupNewParamsBodyNoneAuthSourceUnion) GetEnabled added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupNewParamsBodyNoneAuthSourceUnion) GetHostHeaderOverride added in v0.41.0

func (u OriginGroupNewParamsBodyNoneAuthSourceUnion) GetHostHeaderOverride() *string

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupNewParamsBodyNoneAuthSourceUnion) GetOriginType added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupNewParamsBodyNoneAuthSourceUnion) GetSource added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupNewParamsBodyNoneAuthSourceUnion) MarshalJSON added in v0.41.0

func (*OriginGroupNewParamsBodyNoneAuthSourceUnion) UnmarshalJSON added in v0.41.0

func (u *OriginGroupNewParamsBodyNoneAuthSourceUnion) UnmarshalJSON(data []byte) error

type OriginGroupReplaceParams

type OriginGroupReplaceParams struct {

	// This field is a request body variant, only one variant field can be set.
	OfNoneAuth *OriginGroupReplaceParamsBodyNoneAuth `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	OfAwsSignatureV4 *OriginGroupReplaceParamsBodyAwsSignatureV4 `json:",inline"`
	// contains filtered or unexported fields
}

func (OriginGroupReplaceParams) MarshalJSON

func (u OriginGroupReplaceParams) MarshalJSON() ([]byte, error)

func (*OriginGroupReplaceParams) UnmarshalJSON

func (r *OriginGroupReplaceParams) UnmarshalJSON(data []byte) error

type OriginGroupReplaceParamsBodyAwsSignatureV4 deprecated

type OriginGroupReplaceParamsBodyAwsSignatureV4 struct {
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	//
	// Credentials to access the private bucket.
	//
	// Deprecated: deprecated
	Auth OriginGroupReplaceParamsBodyAwsSignatureV4Auth `json:"auth,omitzero" api:"required"`
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	//
	// Authentication type.
	//
	// **awsSignatureV4** value is used for S3 storage.
	//
	// Deprecated: deprecated
	AuthType string `json:"auth_type" api:"required"`
	// Origin group name.
	Name string `json:"name" api:"required"`
	// Defines whether to use the next origin from the origin group if origin responds
	// with the cases specified in `proxy_next_upstream`. If you enable it, you must
	// specify cases in `proxy_next_upstream`.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	UseNext bool `json:"use_next" api:"required"`
	// **Deprecated.** No longer necessary. Omit this field and the default origin path
	// behavior will be used.
	//
	// Origin path prefix.
	//
	// Deprecated: deprecated
	Path param.Opt[string] `json:"path,omitzero"`
	// Defines cases when the request should be passed on to the next origin.
	//
	// Possible values:
	//
	//   - **error** - an error occurred while establishing a connection with the origin,
	//     passing a request to it, or reading the response header
	//   - **timeout** - a timeout has occurred while establishing a connection with the
	//     origin, passing a request to it, or reading the response header
	//   - **`invalid_header`** - a origin returned an empty or invalid response
	//   - **`http_403`** - a origin returned a response with the code 403
	//   - **`http_404`** - a origin returned a response with the code 404
	//   - **`http_429`** - a origin returned a response with the code 429
	//   - **`http_500`** - a origin returned a response with the code 500
	//   - **`http_502`** - a origin returned a response with the code 502
	//   - **`http_503`** - a origin returned a response with the code 503
	//   - **`http_504`** - a origin returned a response with the code 504
	ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
	// contains filtered or unexported fields
}

**Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead.

Deprecated: deprecated

The properties Auth, AuthType, Name, UseNext are required.

func (OriginGroupReplaceParamsBodyAwsSignatureV4) MarshalJSON

func (r OriginGroupReplaceParamsBodyAwsSignatureV4) MarshalJSON() (data []byte, err error)

func (*OriginGroupReplaceParamsBodyAwsSignatureV4) UnmarshalJSON

func (r *OriginGroupReplaceParamsBodyAwsSignatureV4) UnmarshalJSON(data []byte) error

type OriginGroupReplaceParamsBodyAwsSignatureV4Auth deprecated

type OriginGroupReplaceParamsBodyAwsSignatureV4Auth struct {
	// Access key ID for the S3 account.
	//
	// Restrictions:
	//
	// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
	// - From 3 to 512 characters.
	S3AccessKeyID string `json:"s3_access_key_id" api:"required"`
	// S3 bucket name.
	S3BucketName string `json:"s3_bucket_name" api:"required"`
	// Secret access key for the S3 account.
	//
	// Restrictions:
	//
	//   - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
	//     underscores.
	//   - If "s3_type": amazon, length should be 40 characters.
	//   - If "s3_type": other, length should be from 16 to 255 characters.
	S3SecretAccessKey string `json:"s3_secret_access_key" api:"required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	// - **amazon** – AWS S3 storage.
	// - **other** – Other (not AWS) S3 compatible storage.
	S3Type string `json:"s3_type" api:"required"`
	// S3 storage region.
	//
	// The parameter is required, if "s3_type": amazon.
	S3Region param.Opt[string] `json:"s3_region,omitzero"`
	// S3 storage hostname.
	//
	// The parameter is required, if "s3_type": other.
	//
	// Must be a public address: private and reserved IP addresses, `localhost`, and
	// hostnames that resolve to them are rejected.
	S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
	// contains filtered or unexported fields
}

**Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead.

Credentials to access the private bucket.

Deprecated: deprecated

The properties S3AccessKeyID, S3BucketName, S3SecretAccessKey, S3Type are required.

func (OriginGroupReplaceParamsBodyAwsSignatureV4Auth) MarshalJSON

func (r OriginGroupReplaceParamsBodyAwsSignatureV4Auth) MarshalJSON() (data []byte, err error)

func (*OriginGroupReplaceParamsBodyAwsSignatureV4Auth) UnmarshalJSON

type OriginGroupReplaceParamsBodyNoneAuth

type OriginGroupReplaceParamsBodyNoneAuth struct {
	// Origin group name.
	Name    string                                            `json:"name" api:"required"`
	Sources []OriginGroupReplaceParamsBodyNoneAuthSourceUnion `json:"sources,omitzero" api:"required"`
	// Defines whether to use the next origin from the origin group if origin responds
	// with the cases specified in `proxy_next_upstream`. If you enable it, you must
	// specify cases in `proxy_next_upstream`.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	UseNext bool `json:"use_next" api:"required"`
	// **Deprecated.** No longer necessary. Defaults to `none`.
	//
	// Origin authentication type.
	//
	// Possible values:
	//
	// - **none** - Used for public origins.
	// - **awsSignatureV4** - Used for S3 storage.
	//
	// Deprecated: deprecated
	AuthType param.Opt[string] `json:"auth_type,omitzero"`
	// **Deprecated.** No longer necessary. Omit this field and the default origin path
	// behavior will be used.
	//
	// Origin path prefix.
	//
	// Deprecated: deprecated
	Path param.Opt[string] `json:"path,omitzero"`
	// Defines cases when the request should be passed on to the next origin.
	//
	// Possible values:
	//
	//   - **error** - an error occurred while establishing a connection with the origin,
	//     passing a request to it, or reading the response header
	//   - **timeout** - a timeout has occurred while establishing a connection with the
	//     origin, passing a request to it, or reading the response header
	//   - **`invalid_header`** - a origin returned an empty or invalid response
	//   - **`http_403`** - a origin returned a response with the code 403
	//   - **`http_404`** - a origin returned a response with the code 404
	//   - **`http_429`** - a origin returned a response with the code 429
	//   - **`http_500`** - a origin returned a response with the code 500
	//   - **`http_502`** - a origin returned a response with the code 502
	//   - **`http_503`** - a origin returned a response with the code 503
	//   - **`http_504`** - a origin returned a response with the code 504
	ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Sources, UseNext are required.

func (OriginGroupReplaceParamsBodyNoneAuth) MarshalJSON

func (r OriginGroupReplaceParamsBodyNoneAuth) MarshalJSON() (data []byte, err error)

func (*OriginGroupReplaceParamsBodyNoneAuth) UnmarshalJSON

func (r *OriginGroupReplaceParamsBodyNoneAuth) UnmarshalJSON(data []byte) error

type OriginGroupReplaceParamsBodyNoneAuthSourceFastEdgeSource added in v0.46.0

type OriginGroupReplaceParamsBodyNoneAuthSourceFastEdgeSource struct {
	// FastEdge application configuration. Required when `origin_type` is `fastedge`.
	Config OriginGroupReplaceParamsBodyNoneAuthSourceFastEdgeSourceConfig `json:"config,omitzero" api:"required"`
	// Origin type. Present in responses for S3 and FastEdge sources.
	//
	// Possible values:
	//
	//   - **host** - A source server or endpoint from which content is fetched.
	//   - **s3** - S3 storage with either AWS v4 authentication or public access.
	//   - **fastedge** - A FastEdge application served directly from the local FastEdge
	//     runtime on the edge node, identified by `app_id`.
	//
	// Any of "host", "s3", "fastedge".
	OriginType string `json:"origin_type,omitzero" api:"required"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride param.Opt[string] `json:"host_header_override,omitzero"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup param.Opt[bool] `json:"backup,omitzero"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

The properties Config, OriginType are required.

func (OriginGroupReplaceParamsBodyNoneAuthSourceFastEdgeSource) MarshalJSON added in v0.46.0

func (*OriginGroupReplaceParamsBodyNoneAuthSourceFastEdgeSource) UnmarshalJSON added in v0.46.0

type OriginGroupReplaceParamsBodyNoneAuthSourceFastEdgeSourceConfig added in v0.46.0

type OriginGroupReplaceParamsBodyNoneAuthSourceFastEdgeSourceConfig struct {
	// ID of the FastEdge application served as origin (string, matching the existing
	// fastedge option's convention). The CDN dispatches requests to the local FastEdge
	// runtime on the edge node using this identifier. The application must be in your
	// account, be enabled, and have `wasi-http` API type.
	AppID string `json:"app_id" api:"required"`
	// contains filtered or unexported fields
}

FastEdge application configuration. Required when `origin_type` is `fastedge`.

The property AppID is required.

func (OriginGroupReplaceParamsBodyNoneAuthSourceFastEdgeSourceConfig) MarshalJSON added in v0.46.0

func (*OriginGroupReplaceParamsBodyNoneAuthSourceFastEdgeSourceConfig) UnmarshalJSON added in v0.46.0

type OriginGroupReplaceParamsBodyNoneAuthSourceHostSource added in v0.41.0

type OriginGroupReplaceParamsBodyNoneAuthSourceHostSource struct {
	// IP address or domain name of the origin and the port, if custom port is used.
	Source string `json:"source" api:"required"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride param.Opt[string] `json:"host_header_override,omitzero"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup param.Opt[bool] `json:"backup,omitzero"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

The property Source is required.

func (OriginGroupReplaceParamsBodyNoneAuthSourceHostSource) MarshalJSON added in v0.41.0

func (r OriginGroupReplaceParamsBodyNoneAuthSourceHostSource) MarshalJSON() (data []byte, err error)

func (*OriginGroupReplaceParamsBodyNoneAuthSourceHostSource) UnmarshalJSON added in v0.41.0

type OriginGroupReplaceParamsBodyNoneAuthSourceS3Source added in v0.41.0

type OriginGroupReplaceParamsBodyNoneAuthSourceS3Source struct {
	// S3 storage configuration. Required when `origin_type` is `s3`.
	//
	// To use your Gcore Object Storage as the origin, set `s3_type` to `gcore` and
	// send only `storage_id` and `s3_bucket_name`. The CDN configures the connection
	// for you, and the response returns only `s3_type`, `storage_id`, `s3_bucket_name`
	// and `s3_auth_type`. For such an origin:
	//
	//   - The CDN pulls content over HTTPS, regardless of the resource's
	//     `originProtocol`.
	//   - The CDN has read-only access to the bucket.
	//   - The CDN manages the Host header sent to the storage, so `host_header_override`
	//     is not accepted and is returned as `null`.
	Config OriginGroupReplaceParamsBodyNoneAuthSourceS3SourceConfig `json:"config,omitzero" api:"required"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride param.Opt[string] `json:"host_header_override,omitzero"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup param.Opt[bool] `json:"backup,omitzero"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Origin type. Present in responses for S3 and FastEdge sources.
	//
	// Possible values:
	//
	//   - **host** - A source server or endpoint from which content is fetched.
	//   - **s3** - S3 storage with either AWS v4 authentication or public access.
	//   - **fastedge** - A FastEdge application served directly from the local FastEdge
	//     runtime on the edge node, identified by `app_id`.
	//
	// Any of "host", "s3", "fastedge".
	OriginType string `json:"origin_type,omitzero"`
	// contains filtered or unexported fields
}

The property Config is required.

func (OriginGroupReplaceParamsBodyNoneAuthSourceS3Source) MarshalJSON added in v0.41.0

func (r OriginGroupReplaceParamsBodyNoneAuthSourceS3Source) MarshalJSON() (data []byte, err error)

func (*OriginGroupReplaceParamsBodyNoneAuthSourceS3Source) UnmarshalJSON added in v0.41.0

type OriginGroupReplaceParamsBodyNoneAuthSourceS3SourceConfig added in v0.41.0

type OriginGroupReplaceParamsBodyNoneAuthSourceS3SourceConfig struct {
	// S3 bucket name.
	//
	// If `s3_type` is `gcore`, the bucket must exist in the selected storage.
	S3BucketName string `json:"s3_bucket_name" api:"required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	//   - **amazon** - AWS S3 storage.
	//   - **other** - Other (not AWS) S3 compatible storage.
	//   - **gcore** - Your Gcore Object Storage. Select the storage and bucket, and the
	//     CDN configures the connection.
	//
	// Any of "amazon", "other", "gcore".
	S3Type string `json:"s3_type,omitzero" api:"required"`
	// S3 storage region.
	//
	// The parameter is required if `s3_type` is `amazon`. Not allowed if `s3_type` is
	// `gcore`: the CDN fills it and does not return it.
	S3Region param.Opt[string] `json:"s3_region,omitzero"`
	// S3 storage hostname.
	//
	// The parameter is required if `s3_type` is `other`. Not allowed if `s3_type` is
	// `gcore`: the CDN fills it and does not return it.
	//
	// Must be a public address: private and reserved IP addresses, `localhost`, and
	// hostnames that resolve to them are rejected.
	S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
	// Access key ID for the S3 account. Masked as `SECRET_VALUE` in responses.
	//
	// The parameter is required if `s3_type` is `amazon` or `other`. Not allowed if
	// `s3_type` is `gcore`: the CDN fills it and does not return it.
	//
	// Restrictions:
	//
	// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
	// - From 4 to 255 characters.
	S3AccessKeyID param.Opt[string] `json:"s3_access_key_id,omitzero"`
	// S3 authentication type.
	S3AuthType param.Opt[string] `json:"s3_auth_type,omitzero"`
	// Secret access key for the S3 account. Masked as `SECRET_VALUE` in responses.
	//
	// The parameter is required if `s3_type` is `amazon` or `other`. Not allowed if
	// `s3_type` is `gcore`: the CDN fills it and does not return it.
	//
	// Restrictions:
	//
	//   - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
	//     underscores.
	//   - From 16 to 255 characters.
	S3SecretAccessKey param.Opt[string] `json:"s3_secret_access_key,omitzero"`
	// ID of your Gcore Object Storage.
	//
	// The parameter is required if `s3_type` is `gcore`, and not allowed otherwise.
	// The storage must be active and of the Standard type.
	StorageID param.Opt[int64] `json:"storage_id,omitzero"`
	// contains filtered or unexported fields
}

S3 storage configuration. Required when `origin_type` is `s3`.

To use your Gcore Object Storage as the origin, set `s3_type` to `gcore` and send only `storage_id` and `s3_bucket_name`. The CDN configures the connection for you, and the response returns only `s3_type`, `storage_id`, `s3_bucket_name` and `s3_auth_type`. For such an origin:

  • The CDN pulls content over HTTPS, regardless of the resource's `originProtocol`.
  • The CDN has read-only access to the bucket.
  • The CDN manages the Host header sent to the storage, so `host_header_override` is not accepted and is returned as `null`.

The properties S3BucketName, S3Type are required.

func (OriginGroupReplaceParamsBodyNoneAuthSourceS3SourceConfig) MarshalJSON added in v0.41.0

func (*OriginGroupReplaceParamsBodyNoneAuthSourceS3SourceConfig) UnmarshalJSON added in v0.41.0

type OriginGroupReplaceParamsBodyNoneAuthSourceUnion added in v0.41.0

type OriginGroupReplaceParamsBodyNoneAuthSourceUnion struct {
	OfHostSource     *OriginGroupReplaceParamsBodyNoneAuthSourceHostSource     `json:",omitzero,inline"`
	OfS3Source       *OriginGroupReplaceParamsBodyNoneAuthSourceS3Source       `json:",omitzero,inline"`
	OfFastEdgeSource *OriginGroupReplaceParamsBodyNoneAuthSourceFastEdgeSource `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (OriginGroupReplaceParamsBodyNoneAuthSourceUnion) GetBackup added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupReplaceParamsBodyNoneAuthSourceUnion) GetConfig added in v0.41.0

func (u OriginGroupReplaceParamsBodyNoneAuthSourceUnion) GetConfig() (res originGroupReplaceParamsBodyNoneAuthSourceUnionConfig)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (OriginGroupReplaceParamsBodyNoneAuthSourceUnion) GetEnabled added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupReplaceParamsBodyNoneAuthSourceUnion) GetHostHeaderOverride added in v0.41.0

func (u OriginGroupReplaceParamsBodyNoneAuthSourceUnion) GetHostHeaderOverride() *string

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupReplaceParamsBodyNoneAuthSourceUnion) GetOriginType added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupReplaceParamsBodyNoneAuthSourceUnion) GetSource added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupReplaceParamsBodyNoneAuthSourceUnion) MarshalJSON added in v0.41.0

func (*OriginGroupReplaceParamsBodyNoneAuthSourceUnion) UnmarshalJSON added in v0.41.0

type OriginGroupService

type OriginGroupService struct {
	Options []option.RequestOption
}

CDN origin groups aggregate one or more origin servers with failover and load balancing for content delivery.

OriginGroupService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewOriginGroupService method instead.

func NewOriginGroupService

func NewOriginGroupService(opts ...option.RequestOption) (r OriginGroupService)

NewOriginGroupService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*OriginGroupService) Delete

func (r *OriginGroupService) Delete(ctx context.Context, originGroupID int64, opts ...option.RequestOption) (err error)

Delete origin group

func (*OriginGroupService) Get

func (r *OriginGroupService) Get(ctx context.Context, originGroupID int64, opts ...option.RequestOption) (res *OriginGroupsUnion, err error)

Get origin group details

func (*OriginGroupService) List

Get all origin groups and related origin sources.

func (*OriginGroupService) ListAutoPaging added in v0.51.0

Get all origin groups and related origin sources.

func (*OriginGroupService) New

Create an origin group with one or more origin sources.

func (*OriginGroupService) Replace

func (r *OriginGroupService) Replace(ctx context.Context, originGroupID int64, body OriginGroupReplaceParams, opts ...option.RequestOption) (res *OriginGroupsUnion, err error)

Change origin group

func (*OriginGroupService) Update

func (r *OriginGroupService) Update(ctx context.Context, originGroupID int64, body OriginGroupUpdateParams, opts ...option.RequestOption) (res *OriginGroupsUnion, err error)

Change origin group

type OriginGroupUpdateParams

type OriginGroupUpdateParams struct {

	// This field is a request body variant, only one variant field can be set.
	OfNoneAuth *OriginGroupUpdateParamsBodyNoneAuth `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	OfAwsSignatureV4 *OriginGroupUpdateParamsBodyAwsSignatureV4 `json:",inline"`
	// contains filtered or unexported fields
}

func (OriginGroupUpdateParams) MarshalJSON

func (u OriginGroupUpdateParams) MarshalJSON() ([]byte, error)

func (*OriginGroupUpdateParams) UnmarshalJSON

func (r *OriginGroupUpdateParams) UnmarshalJSON(data []byte) error

type OriginGroupUpdateParamsBodyAwsSignatureV4 deprecated

type OriginGroupUpdateParamsBodyAwsSignatureV4 struct {
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	//
	// Authentication type.
	//
	// **awsSignatureV4** value is used for S3 storage.
	//
	// Deprecated: deprecated
	AuthType param.Opt[string] `json:"auth_type,omitzero"`
	// Origin group name.
	Name param.Opt[string] `json:"name,omitzero"`
	// **Deprecated.** No longer necessary. Omit this field and the default origin path
	// behavior will be used.
	//
	// Origin path prefix.
	//
	// Deprecated: deprecated
	Path param.Opt[string] `json:"path,omitzero"`
	// Defines whether to use the next origin from the origin group if origin responds
	// with the cases specified in `proxy_next_upstream`. If you enable it, you must
	// specify cases in `proxy_next_upstream`.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	UseNext param.Opt[bool] `json:"use_next,omitzero"`
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	//
	// Credentials to access the private bucket.
	//
	// Deprecated: deprecated
	Auth OriginGroupUpdateParamsBodyAwsSignatureV4Auth `json:"auth,omitzero"`
	// Defines cases when the request should be passed on to the next origin.
	//
	// Possible values:
	//
	//   - **error** - an error occurred while establishing a connection with the origin,
	//     passing a request to it, or reading the response header
	//   - **timeout** - a timeout has occurred while establishing a connection with the
	//     origin, passing a request to it, or reading the response header
	//   - **`invalid_header`** - a origin returned an empty or invalid response
	//   - **`http_403`** - a origin returned a response with the code 403
	//   - **`http_404`** - a origin returned a response with the code 404
	//   - **`http_429`** - a origin returned a response with the code 429
	//   - **`http_500`** - a origin returned a response with the code 500
	//   - **`http_502`** - a origin returned a response with the code 502
	//   - **`http_503`** - a origin returned a response with the code 503
	//   - **`http_504`** - a origin returned a response with the code 504
	ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
	// contains filtered or unexported fields
}

**Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead.

Deprecated: deprecated

func (OriginGroupUpdateParamsBodyAwsSignatureV4) MarshalJSON

func (r OriginGroupUpdateParamsBodyAwsSignatureV4) MarshalJSON() (data []byte, err error)

func (*OriginGroupUpdateParamsBodyAwsSignatureV4) UnmarshalJSON

func (r *OriginGroupUpdateParamsBodyAwsSignatureV4) UnmarshalJSON(data []byte) error

type OriginGroupUpdateParamsBodyAwsSignatureV4Auth deprecated

type OriginGroupUpdateParamsBodyAwsSignatureV4Auth struct {
	// Access key ID for the S3 account.
	//
	// Restrictions:
	//
	// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
	// - From 3 to 512 characters.
	S3AccessKeyID string `json:"s3_access_key_id" api:"required"`
	// S3 bucket name.
	S3BucketName string `json:"s3_bucket_name" api:"required"`
	// Secret access key for the S3 account.
	//
	// Restrictions:
	//
	//   - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
	//     underscores.
	//   - If "s3_type": amazon, length should be 40 characters.
	//   - If "s3_type": other, length should be from 16 to 255 characters.
	S3SecretAccessKey string `json:"s3_secret_access_key" api:"required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	// - **amazon** – AWS S3 storage.
	// - **other** – Other (not AWS) S3 compatible storage.
	S3Type string `json:"s3_type" api:"required"`
	// S3 storage region.
	//
	// The parameter is required, if "s3_type": amazon.
	S3Region param.Opt[string] `json:"s3_region,omitzero"`
	// S3 storage hostname.
	//
	// The parameter is required, if "s3_type": other.
	//
	// Must be a public address: private and reserved IP addresses, `localhost`, and
	// hostnames that resolve to them are rejected.
	S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
	// contains filtered or unexported fields
}

**Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead.

Credentials to access the private bucket.

Deprecated: deprecated

The properties S3AccessKeyID, S3BucketName, S3SecretAccessKey, S3Type are required.

func (OriginGroupUpdateParamsBodyAwsSignatureV4Auth) MarshalJSON

func (r OriginGroupUpdateParamsBodyAwsSignatureV4Auth) MarshalJSON() (data []byte, err error)

func (*OriginGroupUpdateParamsBodyAwsSignatureV4Auth) UnmarshalJSON

func (r *OriginGroupUpdateParamsBodyAwsSignatureV4Auth) UnmarshalJSON(data []byte) error

type OriginGroupUpdateParamsBodyNoneAuth

type OriginGroupUpdateParamsBodyNoneAuth struct {
	// Origin group name.
	Name string `json:"name" api:"required"`
	// **Deprecated.** No longer necessary. Defaults to `none`.
	//
	// Origin authentication type.
	//
	// Possible values:
	//
	// - **none** - Used for public origins.
	// - **awsSignatureV4** - Used for S3 storage.
	//
	// Deprecated: deprecated
	AuthType param.Opt[string] `json:"auth_type,omitzero"`
	// **Deprecated.** No longer necessary. Omit this field and the default origin path
	// behavior will be used.
	//
	// Origin path prefix.
	//
	// Deprecated: deprecated
	Path param.Opt[string] `json:"path,omitzero"`
	// Defines whether to use the next origin from the origin group if origin responds
	// with the cases specified in `proxy_next_upstream`. If you enable it, you must
	// specify cases in `proxy_next_upstream`.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	UseNext param.Opt[bool] `json:"use_next,omitzero"`
	// Defines cases when the request should be passed on to the next origin.
	//
	// Possible values:
	//
	//   - **error** - an error occurred while establishing a connection with the origin,
	//     passing a request to it, or reading the response header
	//   - **timeout** - a timeout has occurred while establishing a connection with the
	//     origin, passing a request to it, or reading the response header
	//   - **`invalid_header`** - a origin returned an empty or invalid response
	//   - **`http_403`** - a origin returned a response with the code 403
	//   - **`http_404`** - a origin returned a response with the code 404
	//   - **`http_429`** - a origin returned a response with the code 429
	//   - **`http_500`** - a origin returned a response with the code 500
	//   - **`http_502`** - a origin returned a response with the code 502
	//   - **`http_503`** - a origin returned a response with the code 503
	//   - **`http_504`** - a origin returned a response with the code 504
	ProxyNextUpstream []string                                         `json:"proxy_next_upstream,omitzero"`
	Sources           []OriginGroupUpdateParamsBodyNoneAuthSourceUnion `json:"sources,omitzero"`
	// contains filtered or unexported fields
}

The property Name is required.

func (OriginGroupUpdateParamsBodyNoneAuth) MarshalJSON

func (r OriginGroupUpdateParamsBodyNoneAuth) MarshalJSON() (data []byte, err error)

func (*OriginGroupUpdateParamsBodyNoneAuth) UnmarshalJSON

func (r *OriginGroupUpdateParamsBodyNoneAuth) UnmarshalJSON(data []byte) error

type OriginGroupUpdateParamsBodyNoneAuthSourceFastEdgeSource added in v0.46.0

type OriginGroupUpdateParamsBodyNoneAuthSourceFastEdgeSource struct {
	// FastEdge application configuration. Required when `origin_type` is `fastedge`.
	Config OriginGroupUpdateParamsBodyNoneAuthSourceFastEdgeSourceConfig `json:"config,omitzero" api:"required"`
	// Origin type. Present in responses for S3 and FastEdge sources.
	//
	// Possible values:
	//
	//   - **host** - A source server or endpoint from which content is fetched.
	//   - **s3** - S3 storage with either AWS v4 authentication or public access.
	//   - **fastedge** - A FastEdge application served directly from the local FastEdge
	//     runtime on the edge node, identified by `app_id`.
	//
	// Any of "host", "s3", "fastedge".
	OriginType string `json:"origin_type,omitzero" api:"required"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride param.Opt[string] `json:"host_header_override,omitzero"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup param.Opt[bool] `json:"backup,omitzero"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

The properties Config, OriginType are required.

func (OriginGroupUpdateParamsBodyNoneAuthSourceFastEdgeSource) MarshalJSON added in v0.46.0

func (*OriginGroupUpdateParamsBodyNoneAuthSourceFastEdgeSource) UnmarshalJSON added in v0.46.0

type OriginGroupUpdateParamsBodyNoneAuthSourceFastEdgeSourceConfig added in v0.46.0

type OriginGroupUpdateParamsBodyNoneAuthSourceFastEdgeSourceConfig struct {
	// ID of the FastEdge application served as origin (string, matching the existing
	// fastedge option's convention). The CDN dispatches requests to the local FastEdge
	// runtime on the edge node using this identifier. The application must be in your
	// account, be enabled, and have `wasi-http` API type.
	AppID string `json:"app_id" api:"required"`
	// contains filtered or unexported fields
}

FastEdge application configuration. Required when `origin_type` is `fastedge`.

The property AppID is required.

func (OriginGroupUpdateParamsBodyNoneAuthSourceFastEdgeSourceConfig) MarshalJSON added in v0.46.0

func (*OriginGroupUpdateParamsBodyNoneAuthSourceFastEdgeSourceConfig) UnmarshalJSON added in v0.46.0

type OriginGroupUpdateParamsBodyNoneAuthSourceHostSource added in v0.41.0

type OriginGroupUpdateParamsBodyNoneAuthSourceHostSource struct {
	// IP address or domain name of the origin and the port, if custom port is used.
	Source string `json:"source" api:"required"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride param.Opt[string] `json:"host_header_override,omitzero"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup param.Opt[bool] `json:"backup,omitzero"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

The property Source is required.

func (OriginGroupUpdateParamsBodyNoneAuthSourceHostSource) MarshalJSON added in v0.41.0

func (r OriginGroupUpdateParamsBodyNoneAuthSourceHostSource) MarshalJSON() (data []byte, err error)

func (*OriginGroupUpdateParamsBodyNoneAuthSourceHostSource) UnmarshalJSON added in v0.41.0

type OriginGroupUpdateParamsBodyNoneAuthSourceS3Source added in v0.41.0

type OriginGroupUpdateParamsBodyNoneAuthSourceS3Source struct {
	// S3 storage configuration. Required when `origin_type` is `s3`.
	//
	// To use your Gcore Object Storage as the origin, set `s3_type` to `gcore` and
	// send only `storage_id` and `s3_bucket_name`. The CDN configures the connection
	// for you, and the response returns only `s3_type`, `storage_id`, `s3_bucket_name`
	// and `s3_auth_type`. For such an origin:
	//
	//   - The CDN pulls content over HTTPS, regardless of the resource's
	//     `originProtocol`.
	//   - The CDN has read-only access to the bucket.
	//   - The CDN manages the Host header sent to the storage, so `host_header_override`
	//     is not accepted and is returned as `null`.
	Config OriginGroupUpdateParamsBodyNoneAuthSourceS3SourceConfig `json:"config,omitzero" api:"required"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride param.Opt[string] `json:"host_header_override,omitzero"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup param.Opt[bool] `json:"backup,omitzero"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Origin type. Present in responses for S3 and FastEdge sources.
	//
	// Possible values:
	//
	//   - **host** - A source server or endpoint from which content is fetched.
	//   - **s3** - S3 storage with either AWS v4 authentication or public access.
	//   - **fastedge** - A FastEdge application served directly from the local FastEdge
	//     runtime on the edge node, identified by `app_id`.
	//
	// Any of "host", "s3", "fastedge".
	OriginType string `json:"origin_type,omitzero"`
	// contains filtered or unexported fields
}

The property Config is required.

func (OriginGroupUpdateParamsBodyNoneAuthSourceS3Source) MarshalJSON added in v0.41.0

func (r OriginGroupUpdateParamsBodyNoneAuthSourceS3Source) MarshalJSON() (data []byte, err error)

func (*OriginGroupUpdateParamsBodyNoneAuthSourceS3Source) UnmarshalJSON added in v0.41.0

type OriginGroupUpdateParamsBodyNoneAuthSourceS3SourceConfig added in v0.41.0

type OriginGroupUpdateParamsBodyNoneAuthSourceS3SourceConfig struct {
	// S3 bucket name.
	//
	// If `s3_type` is `gcore`, the bucket must exist in the selected storage.
	S3BucketName string `json:"s3_bucket_name" api:"required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	//   - **amazon** - AWS S3 storage.
	//   - **other** - Other (not AWS) S3 compatible storage.
	//   - **gcore** - Your Gcore Object Storage. Select the storage and bucket, and the
	//     CDN configures the connection.
	//
	// Any of "amazon", "other", "gcore".
	S3Type string `json:"s3_type,omitzero" api:"required"`
	// S3 storage region.
	//
	// The parameter is required if `s3_type` is `amazon`. Not allowed if `s3_type` is
	// `gcore`: the CDN fills it and does not return it.
	S3Region param.Opt[string] `json:"s3_region,omitzero"`
	// S3 storage hostname.
	//
	// The parameter is required if `s3_type` is `other`. Not allowed if `s3_type` is
	// `gcore`: the CDN fills it and does not return it.
	//
	// Must be a public address: private and reserved IP addresses, `localhost`, and
	// hostnames that resolve to them are rejected.
	S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
	// Access key ID for the S3 account. Masked as `SECRET_VALUE` in responses.
	//
	// The parameter is required if `s3_type` is `amazon` or `other`. Not allowed if
	// `s3_type` is `gcore`: the CDN fills it and does not return it.
	//
	// Restrictions:
	//
	// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
	// - From 4 to 255 characters.
	S3AccessKeyID param.Opt[string] `json:"s3_access_key_id,omitzero"`
	// S3 authentication type.
	S3AuthType param.Opt[string] `json:"s3_auth_type,omitzero"`
	// Secret access key for the S3 account. Masked as `SECRET_VALUE` in responses.
	//
	// The parameter is required if `s3_type` is `amazon` or `other`. Not allowed if
	// `s3_type` is `gcore`: the CDN fills it and does not return it.
	//
	// Restrictions:
	//
	//   - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
	//     underscores.
	//   - From 16 to 255 characters.
	S3SecretAccessKey param.Opt[string] `json:"s3_secret_access_key,omitzero"`
	// ID of your Gcore Object Storage.
	//
	// The parameter is required if `s3_type` is `gcore`, and not allowed otherwise.
	// The storage must be active and of the Standard type.
	StorageID param.Opt[int64] `json:"storage_id,omitzero"`
	// contains filtered or unexported fields
}

S3 storage configuration. Required when `origin_type` is `s3`.

To use your Gcore Object Storage as the origin, set `s3_type` to `gcore` and send only `storage_id` and `s3_bucket_name`. The CDN configures the connection for you, and the response returns only `s3_type`, `storage_id`, `s3_bucket_name` and `s3_auth_type`. For such an origin:

  • The CDN pulls content over HTTPS, regardless of the resource's `originProtocol`.
  • The CDN has read-only access to the bucket.
  • The CDN manages the Host header sent to the storage, so `host_header_override` is not accepted and is returned as `null`.

The properties S3BucketName, S3Type are required.

func (OriginGroupUpdateParamsBodyNoneAuthSourceS3SourceConfig) MarshalJSON added in v0.41.0

func (*OriginGroupUpdateParamsBodyNoneAuthSourceS3SourceConfig) UnmarshalJSON added in v0.41.0

type OriginGroupUpdateParamsBodyNoneAuthSourceUnion added in v0.41.0

type OriginGroupUpdateParamsBodyNoneAuthSourceUnion struct {
	OfHostSource     *OriginGroupUpdateParamsBodyNoneAuthSourceHostSource     `json:",omitzero,inline"`
	OfS3Source       *OriginGroupUpdateParamsBodyNoneAuthSourceS3Source       `json:",omitzero,inline"`
	OfFastEdgeSource *OriginGroupUpdateParamsBodyNoneAuthSourceFastEdgeSource `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (OriginGroupUpdateParamsBodyNoneAuthSourceUnion) GetBackup added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupUpdateParamsBodyNoneAuthSourceUnion) GetConfig added in v0.41.0

func (u OriginGroupUpdateParamsBodyNoneAuthSourceUnion) GetConfig() (res originGroupUpdateParamsBodyNoneAuthSourceUnionConfig)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (OriginGroupUpdateParamsBodyNoneAuthSourceUnion) GetEnabled added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupUpdateParamsBodyNoneAuthSourceUnion) GetHostHeaderOverride added in v0.41.0

func (u OriginGroupUpdateParamsBodyNoneAuthSourceUnion) GetHostHeaderOverride() *string

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupUpdateParamsBodyNoneAuthSourceUnion) GetOriginType added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupUpdateParamsBodyNoneAuthSourceUnion) GetSource added in v0.41.0

Returns a pointer to the underlying variant's property, if present.

func (OriginGroupUpdateParamsBodyNoneAuthSourceUnion) MarshalJSON added in v0.41.0

func (*OriginGroupUpdateParamsBodyNoneAuthSourceUnion) UnmarshalJSON added in v0.41.0

type OriginGroupsAwsSignatureV4 deprecated

type OriginGroupsAwsSignatureV4 struct {
	// Origin group ID.
	ID int64 `json:"id" api:"required"`
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	//
	// Credentials to access the private bucket.
	//
	// Deprecated: deprecated
	Auth OriginGroupsAwsSignatureV4Auth `json:"auth" api:"required"`
	// **Deprecated.** To create S3 origins, configure them directly in sources with
	// `origin_type` and `config` instead.
	//
	// Authentication type.
	//
	// **awsSignatureV4** value is used for S3 storage.
	//
	// Deprecated: deprecated
	AuthType string `json:"auth_type" api:"required"`
	// Origin group name.
	Name string `json:"name" api:"required"`
	// Defines whether the origin group has related CDN resources.
	//
	// Possible values:
	//
	// - **true** - Origin group has related CDN resources.
	// - **false** - Origin group does not have related CDN resources.
	HasRelatedResources bool `json:"has_related_resources"`
	// **Deprecated.** No longer necessary. Omit this field and the default origin path
	// behavior will be used.
	//
	// Origin path prefix.
	//
	// Deprecated: deprecated
	Path string `json:"path"`
	// Defines cases when the request should be passed on to the next origin.
	//
	// Possible values:
	//
	//   - **error** - an error occurred while establishing a connection with the origin,
	//     passing a request to it, or reading the response header
	//   - **timeout** - a timeout has occurred while establishing a connection with the
	//     origin, passing a request to it, or reading the response header
	//   - **`invalid_header`** - a origin returned an empty or invalid response
	//   - **`http_403`** - a origin returned a response with the code 403
	//   - **`http_404`** - a origin returned a response with the code 404
	//   - **`http_429`** - a origin returned a response with the code 429
	//   - **`http_500`** - a origin returned a response with the code 500
	//   - **`http_502`** - a origin returned a response with the code 502
	//   - **`http_503`** - a origin returned a response with the code 503
	//   - **`http_504`** - a origin returned a response with the code 504
	ProxyNextUpstream []string `json:"proxy_next_upstream"`
	// Defines whether to use the next origin from the origin group if origin responds
	// with the cases specified in `proxy_next_upstream`. If you enable it, you must
	// specify cases in `proxy_next_upstream`.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	UseNext bool `json:"use_next"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		Auth                respjson.Field
		AuthType            respjson.Field
		Name                respjson.Field
		HasRelatedResources respjson.Field
		Path                respjson.Field
		ProxyNextUpstream   respjson.Field
		UseNext             respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead.

Deprecated: deprecated

func (OriginGroupsAwsSignatureV4) RawJSON

func (r OriginGroupsAwsSignatureV4) RawJSON() string

Returns the unmodified JSON received from the API

func (*OriginGroupsAwsSignatureV4) UnmarshalJSON

func (r *OriginGroupsAwsSignatureV4) UnmarshalJSON(data []byte) error

type OriginGroupsAwsSignatureV4Auth deprecated

type OriginGroupsAwsSignatureV4Auth struct {
	// Access key ID for the S3 account.
	//
	// Restrictions:
	//
	// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
	// - From 3 to 512 characters.
	S3AccessKeyID string `json:"s3_access_key_id" api:"required"`
	// S3 bucket name.
	S3BucketName string `json:"s3_bucket_name" api:"required"`
	// Secret access key for the S3 account.
	//
	// Restrictions:
	//
	//   - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
	//     underscores.
	//   - If "s3_type": amazon, length should be 40 characters.
	//   - If "s3_type": other, length should be from 16 to 255 characters.
	S3SecretAccessKey string `json:"s3_secret_access_key" api:"required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	// - **amazon** – AWS S3 storage.
	// - **other** – Other (not AWS) S3 compatible storage.
	S3Type string `json:"s3_type" api:"required"`
	// S3 storage region.
	//
	// The parameter is required, if "s3_type": amazon.
	S3Region string `json:"s3_region"`
	// S3 storage hostname.
	//
	// The parameter is required, if "s3_type": other.
	//
	// Must be a public address: private and reserved IP addresses, `localhost`, and
	// hostnames that resolve to them are rejected.
	S3StorageHostname string `json:"s3_storage_hostname"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		S3AccessKeyID     respjson.Field
		S3BucketName      respjson.Field
		S3SecretAccessKey respjson.Field
		S3Type            respjson.Field
		S3Region          respjson.Field
		S3StorageHostname respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Deprecated.** To create S3 origins, configure them directly in sources with `origin_type` and `config` instead.

Credentials to access the private bucket.

Deprecated: deprecated

func (OriginGroupsAwsSignatureV4Auth) RawJSON

Returns the unmodified JSON received from the API

func (*OriginGroupsAwsSignatureV4Auth) UnmarshalJSON

func (r *OriginGroupsAwsSignatureV4Auth) UnmarshalJSON(data []byte) error

type OriginGroupsList

type OriginGroupsList struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string              `json:"previous" api:"required"`
	Results  []OriginGroupsUnion `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OriginGroupsList) RawJSON added in v0.51.0

func (r OriginGroupsList) RawJSON() string

Returns the unmodified JSON received from the API

func (*OriginGroupsList) UnmarshalJSON added in v0.51.0

func (r *OriginGroupsList) UnmarshalJSON(data []byte) error

type OriginGroupsNoneAuth

type OriginGroupsNoneAuth struct {
	// Origin group ID.
	ID int64 `json:"id" api:"required"`
	// Origin group name.
	Name string `json:"name" api:"required"`
	// List of origin sources in the origin group. Each entry can be a host origin or
	// an S3 origin.
	//
	// Host origins have a `source` field with the hostname or IP. S3 origins have
	// `origin_type: s3` and a `config` object with S3 credentials or a Gcore Object
	// Storage binding. Both types can be mixed in the same origin group.
	Sources []OriginGroupsNoneAuthSourceUnion `json:"sources" api:"required"`
	// **Deprecated.** No longer necessary. Defaults to `none`.
	//
	// Origin authentication type.
	//
	// Possible values:
	//
	// - **none** - Used for public origins.
	// - **awsSignatureV4** - Used for S3 storage.
	//
	// Deprecated: deprecated
	AuthType string `json:"auth_type"`
	// Defines whether the origin group has related CDN resources.
	//
	// Possible values:
	//
	// - **true** - Origin group has related CDN resources.
	// - **false** - Origin group does not have related CDN resources.
	HasRelatedResources bool `json:"has_related_resources"`
	// **Deprecated.** No longer necessary. Omit this field and the default origin path
	// behavior will be used.
	//
	// Origin path prefix.
	//
	// Deprecated: deprecated
	Path string `json:"path"`
	// Defines cases when the request should be passed on to the next origin.
	//
	// Possible values:
	//
	//   - **error** - an error occurred while establishing a connection with the origin,
	//     passing a request to it, or reading the response header
	//   - **timeout** - a timeout has occurred while establishing a connection with the
	//     origin, passing a request to it, or reading the response header
	//   - **`invalid_header`** - a origin returned an empty or invalid response
	//   - **`http_403`** - a origin returned a response with the code 403
	//   - **`http_404`** - a origin returned a response with the code 404
	//   - **`http_429`** - a origin returned a response with the code 429
	//   - **`http_500`** - a origin returned a response with the code 500
	//   - **`http_502`** - a origin returned a response with the code 502
	//   - **`http_503`** - a origin returned a response with the code 503
	//   - **`http_504`** - a origin returned a response with the code 504
	ProxyNextUpstream []string `json:"proxy_next_upstream"`
	// Defines whether to use the next origin from the origin group if origin responds
	// with the cases specified in `proxy_next_upstream`. If you enable it, you must
	// specify cases in `proxy_next_upstream`.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	UseNext bool `json:"use_next"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		Name                respjson.Field
		Sources             respjson.Field
		AuthType            respjson.Field
		HasRelatedResources respjson.Field
		Path                respjson.Field
		ProxyNextUpstream   respjson.Field
		UseNext             respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Origin group with host origins, or mixed host and S3 origins using inline `origin_type` and `config` in sources.

func (OriginGroupsNoneAuth) RawJSON

func (r OriginGroupsNoneAuth) RawJSON() string

Returns the unmodified JSON received from the API

func (*OriginGroupsNoneAuth) UnmarshalJSON

func (r *OriginGroupsNoneAuth) UnmarshalJSON(data []byte) error

type OriginGroupsNoneAuthSourceFastEdgeSource added in v0.46.0

type OriginGroupsNoneAuthSourceFastEdgeSource struct {
	// FastEdge application configuration. Required when `origin_type` is `fastedge`.
	Config OriginGroupsNoneAuthSourceFastEdgeSourceConfig `json:"config" api:"required"`
	// Origin type. Present in responses for S3 and FastEdge sources.
	//
	// Possible values:
	//
	//   - **host** - A source server or endpoint from which content is fetched.
	//   - **s3** - S3 storage with either AWS v4 authentication or public access.
	//   - **fastedge** - A FastEdge application served directly from the local FastEdge
	//     runtime on the edge node, identified by `app_id`.
	//
	// Any of "host", "s3", "fastedge".
	OriginType string `json:"origin_type" api:"required"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup bool `json:"backup"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled bool `json:"enabled"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride string `json:"host_header_override" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Config             respjson.Field
		OriginType         respjson.Field
		Backup             respjson.Field
		Enabled            respjson.Field
		HostHeaderOverride respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A FastEdge application origin source.

func (OriginGroupsNoneAuthSourceFastEdgeSource) RawJSON added in v0.46.0

Returns the unmodified JSON received from the API

func (*OriginGroupsNoneAuthSourceFastEdgeSource) UnmarshalJSON added in v0.46.0

func (r *OriginGroupsNoneAuthSourceFastEdgeSource) UnmarshalJSON(data []byte) error

type OriginGroupsNoneAuthSourceFastEdgeSourceConfig added in v0.46.0

type OriginGroupsNoneAuthSourceFastEdgeSourceConfig struct {
	// ID of the FastEdge application served as origin (string, matching the existing
	// fastedge option's convention). The CDN dispatches requests to the local FastEdge
	// runtime on the edge node using this identifier. The application must be in your
	// account, be enabled, and have `wasi-http` API type.
	AppID string `json:"app_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FastEdge application configuration. Required when `origin_type` is `fastedge`.

func (OriginGroupsNoneAuthSourceFastEdgeSourceConfig) RawJSON added in v0.46.0

Returns the unmodified JSON received from the API

func (*OriginGroupsNoneAuthSourceFastEdgeSourceConfig) UnmarshalJSON added in v0.46.0

type OriginGroupsNoneAuthSourceHostSource added in v0.41.0

type OriginGroupsNoneAuthSourceHostSource struct {
	// IP address or domain name of the origin and the port, if custom port is used.
	Source string `json:"source" api:"required"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup bool `json:"backup"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled bool `json:"enabled"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride string `json:"host_header_override" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Source             respjson.Field
		Backup             respjson.Field
		Enabled            respjson.Field
		HostHeaderOverride respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A host origin source.

func (OriginGroupsNoneAuthSourceHostSource) RawJSON added in v0.41.0

Returns the unmodified JSON received from the API

func (*OriginGroupsNoneAuthSourceHostSource) UnmarshalJSON added in v0.41.0

func (r *OriginGroupsNoneAuthSourceHostSource) UnmarshalJSON(data []byte) error

type OriginGroupsNoneAuthSourceS3Source added in v0.41.0

type OriginGroupsNoneAuthSourceS3Source struct {
	// S3 storage configuration. Required when `origin_type` is `s3`.
	//
	// To use your Gcore Object Storage as the origin, set `s3_type` to `gcore` and
	// send only `storage_id` and `s3_bucket_name`. The CDN configures the connection
	// for you, and the response returns only `s3_type`, `storage_id`, `s3_bucket_name`
	// and `s3_auth_type`. For such an origin:
	//
	//   - The CDN pulls content over HTTPS, regardless of the resource's
	//     `originProtocol`.
	//   - The CDN has read-only access to the bucket.
	//   - The CDN manages the Host header sent to the storage, so `host_header_override`
	//     is not accepted and is returned as `null`.
	Config OriginGroupsNoneAuthSourceS3SourceConfig `json:"config" api:"required"`
	// Origin type. Present in responses for S3 and FastEdge sources.
	//
	// Possible values:
	//
	//   - **host** - A source server or endpoint from which content is fetched.
	//   - **s3** - S3 storage with either AWS v4 authentication or public access.
	//   - **fastedge** - A FastEdge application served directly from the local FastEdge
	//     runtime on the edge node, identified by `app_id`.
	//
	// Any of "host", "s3", "fastedge".
	OriginType string `json:"origin_type" api:"required"`
	// Defines whether the origin is a backup, meaning that it will not be used until
	// one of active origins become unavailable.
	//
	// Possible values:
	//
	// - **true** - Origin is a backup.
	// - **false** - Origin is not a backup.
	Backup bool `json:"backup"`
	// Enables or disables an origin source in the origin group.
	//
	// Possible values:
	//
	// - **true** - Origin is enabled and the CDN uses it to pull content.
	// - **false** - Origin is disabled and the CDN does not use it to pull content.
	//
	// Origin group must contain at least one enabled origin.
	Enabled bool `json:"enabled"`
	// Per-origin Host header override. When set, the CDN sends this value as the Host
	// header when requesting content from this origin instead of the default.
	//
	// Not accepted for an origin bound to a Gcore Object Storage (`s3_type` is
	// `gcore`): any non-null value is rejected, and the field is returned as `null`
	// for such origins.
	HostHeaderOverride string `json:"host_header_override" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Config             respjson.Field
		OriginType         respjson.Field
		Backup             respjson.Field
		Enabled            respjson.Field
		HostHeaderOverride respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An S3 origin source.

func (OriginGroupsNoneAuthSourceS3Source) RawJSON added in v0.41.0

Returns the unmodified JSON received from the API

func (*OriginGroupsNoneAuthSourceS3Source) UnmarshalJSON added in v0.41.0

func (r *OriginGroupsNoneAuthSourceS3Source) UnmarshalJSON(data []byte) error

type OriginGroupsNoneAuthSourceS3SourceConfig added in v0.41.0

type OriginGroupsNoneAuthSourceS3SourceConfig struct {
	// S3 bucket name.
	//
	// If `s3_type` is `gcore`, the bucket must exist in the selected storage.
	S3BucketName string `json:"s3_bucket_name" api:"required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	//   - **amazon** - AWS S3 storage.
	//   - **other** - Other (not AWS) S3 compatible storage.
	//   - **gcore** - Your Gcore Object Storage. Select the storage and bucket, and the
	//     CDN configures the connection.
	//
	// Any of "amazon", "other", "gcore".
	S3Type string `json:"s3_type" api:"required"`
	// Access key ID for the S3 account. Masked as `SECRET_VALUE` in responses.
	//
	// The parameter is required if `s3_type` is `amazon` or `other`. Not allowed if
	// `s3_type` is `gcore`: the CDN fills it and does not return it.
	//
	// Restrictions:
	//
	// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
	// - From 4 to 255 characters.
	S3AccessKeyID string `json:"s3_access_key_id"`
	// S3 authentication type.
	S3AuthType string `json:"s3_auth_type"`
	// S3 storage region.
	//
	// The parameter is required if `s3_type` is `amazon`. Not allowed if `s3_type` is
	// `gcore`: the CDN fills it and does not return it.
	S3Region string `json:"s3_region" api:"nullable"`
	// Secret access key for the S3 account. Masked as `SECRET_VALUE` in responses.
	//
	// The parameter is required if `s3_type` is `amazon` or `other`. Not allowed if
	// `s3_type` is `gcore`: the CDN fills it and does not return it.
	//
	// Restrictions:
	//
	//   - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
	//     underscores.
	//   - From 16 to 255 characters.
	S3SecretAccessKey string `json:"s3_secret_access_key"`
	// S3 storage hostname.
	//
	// The parameter is required if `s3_type` is `other`. Not allowed if `s3_type` is
	// `gcore`: the CDN fills it and does not return it.
	//
	// Must be a public address: private and reserved IP addresses, `localhost`, and
	// hostnames that resolve to them are rejected.
	S3StorageHostname string `json:"s3_storage_hostname" api:"nullable"`
	// ID of your Gcore Object Storage.
	//
	// The parameter is required if `s3_type` is `gcore`, and not allowed otherwise.
	// The storage must be active and of the Standard type.
	StorageID int64 `json:"storage_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		S3BucketName      respjson.Field
		S3Type            respjson.Field
		S3AccessKeyID     respjson.Field
		S3AuthType        respjson.Field
		S3Region          respjson.Field
		S3SecretAccessKey respjson.Field
		S3StorageHostname respjson.Field
		StorageID         respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

S3 storage configuration. Required when `origin_type` is `s3`.

To use your Gcore Object Storage as the origin, set `s3_type` to `gcore` and send only `storage_id` and `s3_bucket_name`. The CDN configures the connection for you, and the response returns only `s3_type`, `storage_id`, `s3_bucket_name` and `s3_auth_type`. For such an origin:

  • The CDN pulls content over HTTPS, regardless of the resource's `originProtocol`.
  • The CDN has read-only access to the bucket.
  • The CDN manages the Host header sent to the storage, so `host_header_override` is not accepted and is returned as `null`.

func (OriginGroupsNoneAuthSourceS3SourceConfig) RawJSON added in v0.41.0

Returns the unmodified JSON received from the API

func (*OriginGroupsNoneAuthSourceS3SourceConfig) UnmarshalJSON added in v0.41.0

func (r *OriginGroupsNoneAuthSourceS3SourceConfig) UnmarshalJSON(data []byte) error

type OriginGroupsNoneAuthSourceUnion added in v0.41.0

type OriginGroupsNoneAuthSourceUnion struct {
	// This field is from variant [OriginGroupsNoneAuthSourceHostSource].
	Source             string `json:"source"`
	Backup             bool   `json:"backup"`
	Enabled            bool   `json:"enabled"`
	HostHeaderOverride string `json:"host_header_override"`
	// This field is a union of [OriginGroupsNoneAuthSourceS3SourceConfig],
	// [OriginGroupsNoneAuthSourceFastEdgeSourceConfig]
	Config     OriginGroupsNoneAuthSourceUnionConfig `json:"config"`
	OriginType string                                `json:"origin_type"`
	JSON       struct {
		Source             respjson.Field
		Backup             respjson.Field
		Enabled            respjson.Field
		HostHeaderOverride respjson.Field
		Config             respjson.Field
		OriginType         respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

OriginGroupsNoneAuthSourceUnion contains all possible properties and values from OriginGroupsNoneAuthSourceHostSource, OriginGroupsNoneAuthSourceS3Source, OriginGroupsNoneAuthSourceFastEdgeSource.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (OriginGroupsNoneAuthSourceUnion) AsFastEdgeSource added in v0.46.0

func (OriginGroupsNoneAuthSourceUnion) AsHostSource added in v0.41.0

func (OriginGroupsNoneAuthSourceUnion) AsS3Source added in v0.41.0

func (OriginGroupsNoneAuthSourceUnion) RawJSON added in v0.41.0

Returns the unmodified JSON received from the API

func (*OriginGroupsNoneAuthSourceUnion) UnmarshalJSON added in v0.41.0

func (r *OriginGroupsNoneAuthSourceUnion) UnmarshalJSON(data []byte) error

type OriginGroupsNoneAuthSourceUnionConfig added in v0.46.0

type OriginGroupsNoneAuthSourceUnionConfig struct {
	// This field is from variant [OriginGroupsNoneAuthSourceS3SourceConfig].
	S3BucketName string `json:"s3_bucket_name"`
	// This field is from variant [OriginGroupsNoneAuthSourceS3SourceConfig].
	S3Type string `json:"s3_type"`
	// This field is from variant [OriginGroupsNoneAuthSourceS3SourceConfig].
	S3AccessKeyID string `json:"s3_access_key_id"`
	// This field is from variant [OriginGroupsNoneAuthSourceS3SourceConfig].
	S3AuthType string `json:"s3_auth_type"`
	// This field is from variant [OriginGroupsNoneAuthSourceS3SourceConfig].
	S3Region string `json:"s3_region"`
	// This field is from variant [OriginGroupsNoneAuthSourceS3SourceConfig].
	S3SecretAccessKey string `json:"s3_secret_access_key"`
	// This field is from variant [OriginGroupsNoneAuthSourceS3SourceConfig].
	S3StorageHostname string `json:"s3_storage_hostname"`
	// This field is from variant [OriginGroupsNoneAuthSourceS3SourceConfig].
	StorageID int64 `json:"storage_id"`
	// This field is from variant [OriginGroupsNoneAuthSourceFastEdgeSourceConfig].
	AppID string `json:"app_id"`
	JSON  struct {
		S3BucketName      respjson.Field
		S3Type            respjson.Field
		S3AccessKeyID     respjson.Field
		S3AuthType        respjson.Field
		S3Region          respjson.Field
		S3SecretAccessKey respjson.Field
		S3StorageHostname respjson.Field
		StorageID         respjson.Field
		AppID             respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

OriginGroupsNoneAuthSourceUnionConfig is an implicit subunion of OriginGroupsNoneAuthSourceUnion. OriginGroupsNoneAuthSourceUnionConfig provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the OriginGroupsNoneAuthSourceUnion.

func (*OriginGroupsNoneAuthSourceUnionConfig) UnmarshalJSON added in v0.46.0

func (r *OriginGroupsNoneAuthSourceUnionConfig) UnmarshalJSON(data []byte) error

type OriginGroupsUnion

type OriginGroupsUnion struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	// This field is from variant [OriginGroupsNoneAuth].
	Sources             []OriginGroupsNoneAuthSourceUnion `json:"sources"`
	AuthType            string                            `json:"auth_type"`
	HasRelatedResources bool                              `json:"has_related_resources"`
	Path                string                            `json:"path"`
	ProxyNextUpstream   []string                          `json:"proxy_next_upstream"`
	UseNext             bool                              `json:"use_next"`
	// This field is from variant [OriginGroupsAwsSignatureV4].
	Auth OriginGroupsAwsSignatureV4Auth `json:"auth"`
	JSON struct {
		ID                  respjson.Field
		Name                respjson.Field
		Sources             respjson.Field
		AuthType            respjson.Field
		HasRelatedResources respjson.Field
		Path                respjson.Field
		ProxyNextUpstream   respjson.Field
		UseNext             respjson.Field
		Auth                respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

OriginGroupsUnion contains all possible properties and values from OriginGroupsNoneAuth, OriginGroupsAwsSignatureV4.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (OriginGroupsUnion) AsAwsSignatureV4

func (u OriginGroupsUnion) AsAwsSignatureV4() (v OriginGroupsAwsSignatureV4)

func (OriginGroupsUnion) AsNoneAuth

func (u OriginGroupsUnion) AsNoneAuth() (v OriginGroupsNoneAuth)

func (OriginGroupsUnion) RawJSON

func (u OriginGroupsUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*OriginGroupsUnion) UnmarshalJSON

func (r *OriginGroupsUnion) UnmarshalJSON(data []byte) error

type OriginShielding

type OriginShielding struct {
	// Shielding location ID.
	//
	// If origin shielding is disabled, the parameter value is **null**.
	ShieldingPop int64 `json:"shielding_pop" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ShieldingPop respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OriginShielding) RawJSON

func (r OriginShielding) RawJSON() string

Returns the unmodified JSON received from the API

func (OriginShielding) ToParam

ToParam converts this OriginShielding to a OriginShieldingParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with OriginShieldingParam.Overrides()

func (*OriginShielding) UnmarshalJSON

func (r *OriginShielding) UnmarshalJSON(data []byte) error

type OriginShieldingParam

type OriginShieldingParam struct {
	// Shielding location ID.
	//
	// If origin shielding is disabled, the parameter value is **null**.
	ShieldingPop param.Opt[int64] `json:"shielding_pop,omitzero"`
	// contains filtered or unexported fields
}

func (OriginShieldingParam) MarshalJSON

func (r OriginShieldingParam) MarshalJSON() (data []byte, err error)

func (*OriginShieldingParam) UnmarshalJSON

func (r *OriginShieldingParam) UnmarshalJSON(data []byte) error

type OriginShieldingReplaced added in v0.28.0

type OriginShieldingReplaced = any

type PresetAppliedApplyParams added in v0.52.0

type PresetAppliedApplyParams struct {
	// ID of the object (CDN resource or rule, according to the preset `object_type`)
	// to apply the preset to.
	ObjectID int64 `json:"object_id" api:"required"`
	// contains filtered or unexported fields
}

func (PresetAppliedApplyParams) MarshalJSON added in v0.52.0

func (r PresetAppliedApplyParams) MarshalJSON() (data []byte, err error)

func (*PresetAppliedApplyParams) UnmarshalJSON added in v0.52.0

func (r *PresetAppliedApplyParams) UnmarshalJSON(data []byte) error

type PresetAppliedGetParams added in v0.56.0

type PresetAppliedGetParams struct {
	PresetID int64 `path:"preset_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type PresetAppliedGetRulePresetParams added in v0.52.0

type PresetAppliedGetRulePresetParams struct {
	ResourceID int64 `path:"resource_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type PresetAppliedService added in v0.52.0

type PresetAppliedService struct {
	Options []option.RequestOption
}

Applied presets represent the association between a preset and a CDN resource or rule. Use them to apply a preset to an object, list the objects a preset is applied to, unapply it, and inspect which object fields a preset manages.

PresetAppliedService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPresetAppliedService method instead.

func NewPresetAppliedService added in v0.52.0

func NewPresetAppliedService(opts ...option.RequestOption) (r PresetAppliedService)

NewPresetAppliedService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PresetAppliedService) Apply added in v0.52.0

Apply the preset to an object (CDN resource or rule, according to the preset `object_type`).

The preset settings are applied to the object, and the options included in the preset can no longer be edited on the object until the preset is unapplied.

func (*PresetAppliedService) Get added in v0.56.0

Get a single object the preset is applied to.

Returns `404` if the preset is not applied to the object, so you can use this endpoint to check whether the relationship exists.

func (*PresetAppliedService) GetObjects added in v0.52.0

func (r *PresetAppliedService) GetObjects(ctx context.Context, presetID int64, opts ...option.RequestOption) (res *AppliedPreset, err error)

Get the list of objects the preset is currently applied to.

func (*PresetAppliedService) GetResourcePreset added in v0.52.0

func (r *PresetAppliedService) GetResourcePreset(ctx context.Context, resourceID int64, opts ...option.RequestOption) (res *AppliedPresetFields, err error)

Get the preset applied to a CDN resource and the list of resource fields managed by the preset.

func (*PresetAppliedService) GetRulePreset added in v0.52.0

Get the preset applied to a rule and the list of rule fields managed by the preset.

func (*PresetAppliedService) Unapply added in v0.52.0

func (r *PresetAppliedService) Unapply(ctx context.Context, objectID int64, body PresetAppliedUnapplyParams, opts ...option.RequestOption) (err error)

Unapply the preset from the object. The options managed by the preset are removed from the object.

type PresetAppliedUnapplyParams added in v0.52.0

type PresetAppliedUnapplyParams struct {
	PresetID int64 `path:"preset_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type PresetDetail added in v0.52.0

type PresetDetail struct {
	// Preset ID.
	ID int64 `json:"id"`
	// Preset name.
	Name string `json:"name"`
	// Type of object the preset can be applied to.
	//
	// Possible values:
	//
	// - **CDNResource** - Preset is applied to a CDN resource.
	// - **Rule** - Preset is applied to a rule.
	//
	// Any of "CDNResource", "Rule".
	ObjectType PresetDetailObjectType `json:"object_type"`
	// CDN resource or rule settings that the preset applies to the target object,
	// including the **options** object.
	//
	// The available keys match the writable fields of the object type the preset
	// targets (`object_type`). Options included in the preset cannot be edited on the
	// object while the preset is applied.
	PresetSettings map[string]any `json:"preset_settings"`
	// Service the preset belongs to.
	//
	// Any of "cdn".
	Service PresetDetailService `json:"service"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Name           respjson.Field
		ObjectType     respjson.Field
		PresetSettings respjson.Field
		Service        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PresetDetail) RawJSON added in v0.52.0

func (r PresetDetail) RawJSON() string

Returns the unmodified JSON received from the API

func (*PresetDetail) UnmarshalJSON added in v0.52.0

func (r *PresetDetail) UnmarshalJSON(data []byte) error

type PresetDetailObjectType added in v0.52.0

type PresetDetailObjectType string

Type of object the preset can be applied to.

Possible values:

- **CDNResource** - Preset is applied to a CDN resource. - **Rule** - Preset is applied to a rule.

const (
	PresetDetailObjectTypeCDNResource PresetDetailObjectType = "CDNResource"
	PresetDetailObjectTypeRule        PresetDetailObjectType = "Rule"
)

type PresetDetailService added in v0.52.0

type PresetDetailService string

Service the preset belongs to.

const (
	PresetDetailServiceCDN PresetDetailService = "cdn"
)

type PresetListParams added in v0.52.0

type PresetListParams struct {
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (PresetListParams) URLQuery added in v0.52.0

func (r PresetListParams) URLQuery() (v url.Values, err error)

URLQuery serializes PresetListParams's query parameters as `url.Values`.

type PresetService added in v0.52.0

type PresetService struct {
	Options []option.RequestOption
	// Applied presets represent the association between a preset and a CDN resource or
	// rule. Use them to apply a preset to an object, list the objects a preset is
	// applied to, unapply it, and inspect which object fields a preset manages.
	Applied PresetAppliedService
}

CDN presets are predefined sets of CDN resource or rule settings that can be applied to an object in a single request, letting you configure caching, delivery, and security options consistently.

PresetService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPresetService method instead.

func NewPresetService added in v0.52.0

func NewPresetService(opts ...option.RequestOption) (r PresetService)

NewPresetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PresetService) Get added in v0.52.0

func (r *PresetService) Get(ctx context.Context, presetID int64, opts ...option.RequestOption) (res *PresetDetail, err error)

Get information about a preset.

func (*PresetService) List added in v0.52.0

Get the list of presets available to your account.

A preset is a predefined set of CDN resource or rule settings that can be applied to an object in one request.

func (*PresetService) ListAutoPaging added in v0.52.0

Get the list of presets available to your account.

A preset is a predefined set of CDN resource or rule settings that can be applied to an object in one request.

type PublicIPList

type PublicIPList struct {
	// List of IPv4 addresses.
	Addresses []string `json:"addresses"`
	// List of IPv6 addresses.
	AddressesV6 []string `json:"addresses_v6"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Addresses   respjson.Field
		AddressesV6 respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PublicIPList) RawJSON

func (r PublicIPList) RawJSON() string

Returns the unmodified JSON received from the API

func (*PublicIPList) UnmarshalJSON

func (r *PublicIPList) UnmarshalJSON(data []byte) error

type PublicNetworkList

type PublicNetworkList struct {
	// List of IPv4 networks.
	Addresses []string `json:"addresses"`
	// List of IPv6 networks.
	AddressesV6 []string `json:"addresses_v6"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Addresses   respjson.Field
		AddressesV6 respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PublicNetworkList) RawJSON

func (r PublicNetworkList) RawJSON() string

Returns the unmodified JSON received from the API

func (*PublicNetworkList) UnmarshalJSON

func (r *PublicNetworkList) UnmarshalJSON(data []byte) error

type PurgeStatus

type PurgeStatus struct {
	// Date and time when the purge was created (ISO 8601/RFC 3339 format, UTC).
	Created string `json:"created"`
	// Purge payload depends on purge type.
	//
	// Possible values:
	//
	// - **urls** - Purge by URL.
	// - **paths** - Purge by Pattern and purge All.
	Payload any `json:"payload"`
	// Purge ID.
	PurgeID int64 `json:"purge_id"`
	// Contains the name of the purge request type.
	//
	// Possible values:
	//
	// - **`purge_by_pattern`** - Purge by Pattern.
	// - **`purge_by_url`** - Purge by URL.
	// - **`purge_all`** - Purge All.
	PurgeType string              `json:"purge_type"`
	Resource  PurgeStatusResource `json:"resource"`
	// Purge status.
	//
	// Possible values:
	//
	// - **In progress** - Purge is in progress.
	// - **Successful** - Purge was successful.
	// - **Failed** - Purge failed.
	//
	// Any of "In progress", "Successful", "Failed".
	Status PurgeStatusStatus `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Created     respjson.Field
		Payload     respjson.Field
		PurgeID     respjson.Field
		PurgeType   respjson.Field
		Resource    respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PurgeStatus) RawJSON

func (r PurgeStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*PurgeStatus) UnmarshalJSON

func (r *PurgeStatus) UnmarshalJSON(data []byte) error

type PurgeStatusResource

type PurgeStatusResource struct {
	// Resource ID.
	ID int64 `json:"id"`
	// CNAME of the resource.
	Cname string `json:"cname"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Cname       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PurgeStatusResource) RawJSON

func (r PurgeStatusResource) RawJSON() string

Returns the unmodified JSON received from the API

func (*PurgeStatusResource) UnmarshalJSON

func (r *PurgeStatusResource) UnmarshalJSON(data []byte) error

type PurgeStatusStatus

type PurgeStatusStatus string

Purge status.

Possible values:

- **In progress** - Purge is in progress. - **Successful** - Purge was successful. - **Failed** - Purge failed.

const (
	PurgeStatusStatusInProgress PurgeStatusStatus = "In progress"
	PurgeStatusStatusSuccessful PurgeStatusStatus = "Successful"
	PurgeStatusStatusFailed     PurgeStatusStatus = "Failed"
)

type ResourceAggregatedStats

type ResourceAggregatedStats struct {
	// CDN resource ID for which statistics data is shown.
	Number1Example any `json:"1 (example)"`
	// 95 percentile bandwidth value
	Number95Percentile int64 `json:"95_percentile"`
	// Traffic in bytes from Backblaze origin.
	BackblazeBytes int64 `json:"backblaze_bytes"`
	// Formula: 1 - `upstream_bytes` / `sent_bytes`. We deduct the non-cached traffic
	// from the total traffic amount
	CacheHitTrafficRatio int64 `json:"cache_hit_traffic_ratio"`
	// Region by which statistics data is grouped.
	CisExample any `json:"cis (example)"`
	// Maximum bandwidth
	MaxBandwidth int64 `json:"max_bandwidth"`
	// Statistics parameters.
	Metrics any `json:"metrics"`
	// Minimum bandwidth
	MinBandwidth int64 `json:"min_bandwidth"`
	// Regions by which statistics data is grouped.
	Region any `json:"region"`
	// Number of requests to edge servers.
	Requests int64 `json:"requests"`
	// Resources IDs by which statistics data is grouped.
	Resource any `json:"resource"`
	// Statistics by content type. It returns a number of responses for content with
	// different MIME types.
	ResponseTypes any `json:"response_types"`
	// Number of 2xx response codes.
	Responses2xx int64 `json:"responses_2xx"`
	// Number of 3xx response codes.
	Responses3xx int64 `json:"responses_3xx"`
	// Number of 4xx response codes.
	Responses4xx int64 `json:"responses_4xx"`
	// Number of 5xx response codes.
	Responses5xx int64 `json:"responses_5xx"`
	// Number of responses with the header Cache: HIT.
	ResponsesHit int64 `json:"responses_hit"`
	// Number of responses with the header Cache: MISS.
	ResponsesMiss int64 `json:"responses_miss"`
	// Traffic in bytes from CDN servers to clients.
	SentBytes int64 `json:"sent_bytes"`
	// Upstream bytes and `sent_bytes` combined.
	TotalBytes int64 `json:"total_bytes"`
	// Traffic in bytes from the upstream to CDN servers.
	UpstreamBytes int64 `json:"upstream_bytes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Number1Example       respjson.Field
		Number95Percentile   respjson.Field
		BackblazeBytes       respjson.Field
		CacheHitTrafficRatio respjson.Field
		CisExample           respjson.Field
		MaxBandwidth         respjson.Field
		Metrics              respjson.Field
		MinBandwidth         respjson.Field
		Region               respjson.Field
		Requests             respjson.Field
		Resource             respjson.Field
		ResponseTypes        respjson.Field
		Responses2xx         respjson.Field
		Responses3xx         respjson.Field
		Responses4xx         respjson.Field
		Responses5xx         respjson.Field
		ResponsesHit         respjson.Field
		ResponsesMiss        respjson.Field
		SentBytes            respjson.Field
		TotalBytes           respjson.Field
		UpstreamBytes        respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ResourceAggregatedStats) RawJSON

func (r ResourceAggregatedStats) RawJSON() string

Returns the unmodified JSON received from the API

func (*ResourceAggregatedStats) UnmarshalJSON

func (r *ResourceAggregatedStats) UnmarshalJSON(data []byte) error

type ResourceUsageStats

type ResourceUsageStats struct {
	// ID of CDN resource for which statistics data is shown.
	Number1Example any `json:"1 (example)"`
	// BackBlaze bytes from Backblaze origin.
	//
	// Represented by two values:
	//
	// - 1543622400 — Time in the UNIX timestamp when statistics were received.
	// - 17329220573 — Bytes.
	BackblazeBytes []int64 `json:"backblaze_bytes"`
	// Types of statistics data.
	//
	// Possible values:
	//
	//   - **`upstream_bytes`** – Traffic in bytes from an origin server to CDN servers
	//     or to origin shielding when used.
	//   - **`sent_bytes`** – Traffic in bytes from CDN servers to clients.
	//   - **`shield_bytes`** – Traffic in bytes from origin shielding to CDN servers.
	//   - **`backblaze_bytes`** - Traffic in bytes from Backblaze origin.
	//   - **`total_bytes`** – `shield_bytes`, `upstream_bytes` and `sent_bytes`
	//     combined.
	//   - **`cdn_bytes`** – `sent_bytes` and `shield_bytes` combined.
	//   - **requests** – Number of requests to edge servers.
	//   - **`responses_2xx`** – Number of 2xx response codes.
	//   - **`responses_3xx`** – Number of 3xx response codes.
	//   - **`responses_4xx`** – Number of 4xx response codes.
	//   - **`responses_5xx`** – Number of 5xx response codes.
	//   - **`responses_hit`** – Number of responses with the header Cache: HIT.
	//   - **`responses_miss`** – Number of responses with the header Cache: MISS.
	//   - **`response_types`** – Statistics by content type. It returns a number of
	//     responses for content with different MIME types.
	//   - **`cache_hit_traffic_ratio`** – Formula: 1 - `upstream_bytes` / `sent_bytes`.
	//     We deduct the non-cached traffic from the total traffic amount.
	//   - **`cache_hit_requests_ratio`** – Formula: `responses_hit` / requests. The
	//     share of sending cached content.
	//   - **`shield_traffic_ratio`** – Formula: (`shield_bytes` - `upstream_bytes`) /
	//     `shield_bytes`. The efficiency of the Origin Shielding: how much more traffic
	//     is sent from the Origin Shielding than from the origin.
	//   - **`image_processed`** - Number of images transformed on the Image optimization
	//     service.
	//   - **`request_time`** - Time elapsed between the first bytes of a request were
	//     processed and logging after the last bytes were sent to a user.
	//   - **`upstream_response_time`** - Number of milliseconds it took to receive a
	//     response from an origin. If upstream `response_time_` contains several
	//     indications for one request (in case of more than 1 origin), we summarize
	//     them. In case of aggregating several queries, the average of this amount is
	//     calculated.
	//
	// Metrics **`upstream_response_time`** and **`request_time`** should be requested
	// separately from other metrics
	Metrics any `json:"metrics"`
	// Regions for which data is displayed.
	//
	// Possible values:
	//
	// - **na** – North America
	// - **eu** – Europe
	// - **cis** – Commonwealth of Independent States
	// - **asia** – Asia
	// - **au** – Australia
	// - **latam** – Latin America
	// - **me** – Middle East
	// - **africa** - Africa
	// - **sa** - South America
	Region any `json:"region"`
	// Resources IDs by which statistics data is grouped.
	Resource any `json:"resource"`
	// Bytes from CDN servers to the end-users.
	//
	// Represented by two values:
	//
	// - 1543622400 — Time in the UNIX timestamp when statistics were received.
	// - 17329220573 — Bytes.
	SentBytes []int64 `json:"sent_bytes"`
	// Upstream bytes and `sent_bytes` combined.
	//
	// Represented by two values:
	//
	// - 1543622400 — Time in the UNIX timestamp when statistics were received.
	// - 17329220573 — Bytes.
	TotalBytes []int64 `json:"total_bytes"`
	// Bytes from the upstream to the CDN servers.
	//
	// Represented by two values:
	//
	// - 1543622400 — Time in the UNIX timestamp when statistics were received.
	// - 17329220573 — Bytes.
	UpstreamBytes []int64 `json:"upstream_bytes"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Number1Example respjson.Field
		BackblazeBytes respjson.Field
		Metrics        respjson.Field
		Region         respjson.Field
		Resource       respjson.Field
		SentBytes      respjson.Field
		TotalBytes     respjson.Field
		UpstreamBytes  respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ResourceUsageStats) RawJSON

func (r ResourceUsageStats) RawJSON() string

Returns the unmodified JSON received from the API

func (*ResourceUsageStats) UnmarshalJSON

func (r *ResourceUsageStats) UnmarshalJSON(data []byte) error

type RuleTemplate

type RuleTemplate struct {
	// Rule template ID.
	ID int64 `json:"id"`
	// Client ID
	Client int64 `json:"client"`
	// Defines whether the template is a system template developed for common cases.
	// System templates are available to all customers.
	//
	// Possible values:
	//
	// - **true** - Template is a system template and cannot be changed by a user.
	// - **false** - Template is a custom template and can be changed by a user.
	Default bool `json:"default"`
	// Defines whether the template has been deleted.
	//
	// Possible values:
	//
	// - **true** - Template has been deleted.
	// - **false** - Template has not been deleted.
	Deleted bool `json:"deleted"`
	// Rule template name.
	Name string `json:"name"`
	// List of options that can be configured for the rule.
	//
	// In case of `null` value the option is not added to the rule. Option inherits its
	// value from the CDN resource settings.
	Options RuleTemplateOptions `json:"options"`
	// Sets a protocol other than the one specified in the CDN resource settings to
	// connect to the origin.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
	//   - **HTTP** - CDN servers connect to origin via HTTP protocol.
	//   - **MATCH** - Connection protocol is chosen automatically; in this case, content
	//     on origin source should be available for the CDN both through HTTP and HTTPS
	//     protocols.
	//   - **null** - `originProtocol` setting is inherited from the CDN resource
	//     settings.
	//
	// If an enabled origin among the origins this rule pulls from is bound to a Gcore
	// Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OverrideOriginProtocol RuleTemplateOverrideOriginProtocol `json:"overrideOriginProtocol" api:"nullable"`
	// Path to the file or folder for which the rule will be applied.
	//
	// The rule is applied if the requested URI matches the rule path.
	//
	// We add a leading forward slash to any rule path. Specify a path without a
	// forward slash.
	Rule string `json:"rule"`
	// Rule type.
	//
	// Possible values:
	//
	//   - **Type 0** - Regular expression. Must start with '^/' or '/'.
	//   - **Type 1** - Regular expression. Note that for this rule type we automatically
	//     add / to each rule pattern before your regular expression. This type is
	//     **legacy**, please use Type 0.
	RuleType int64 `json:"ruleType"`
	// Determines whether the rule is a template.
	Template bool `json:"template"`
	// Rule execution order: from lowest (1) to highest.
	//
	// If requested URI matches multiple rules, the one higher in the order of the
	// rules will be applied.
	Weight int64 `json:"weight"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                     respjson.Field
		Client                 respjson.Field
		Default                respjson.Field
		Deleted                respjson.Field
		Name                   respjson.Field
		Options                respjson.Field
		OverrideOriginProtocol respjson.Field
		Rule                   respjson.Field
		RuleType               respjson.Field
		Template               respjson.Field
		Weight                 respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RuleTemplate) RawJSON

func (r RuleTemplate) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplate) UnmarshalJSON

func (r *RuleTemplate) UnmarshalJSON(data []byte) error

type RuleTemplateList

type RuleTemplateList struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string         `json:"previous" api:"required"`
	Results  []RuleTemplate `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RuleTemplateList) RawJSON added in v0.51.0

func (r RuleTemplateList) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplateList) UnmarshalJSON added in v0.51.0

func (r *RuleTemplateList) UnmarshalJSON(data []byte) error

type RuleTemplateListParams added in v0.41.0

type RuleTemplateListParams struct {
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (RuleTemplateListParams) URLQuery added in v0.41.0

func (r RuleTemplateListParams) URLQuery() (v url.Values, err error)

URLQuery serializes RuleTemplateListParams's query parameters as `url.Values`.

type RuleTemplateNewParams

type RuleTemplateNewParams struct {
	// Path to the file or folder for which the rule will be applied.
	//
	// The rule is applied if the requested URI matches the rule path.
	//
	// We add a leading forward slash to any rule path. Specify a path without a
	// forward slash.
	Rule string `json:"rule" api:"required"`
	// Rule type.
	//
	// Possible values:
	//
	//   - **Type 0** - Regular expression. Must start with '^/' or '/'.
	//   - **Type 1** - Regular expression. Note that for this rule type we automatically
	//     add / to each rule pattern before your regular expression. This type is
	//     **legacy**, please use Type 0.
	RuleType int64 `json:"ruleType" api:"required"`
	// Rule template name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Rule execution order: from lowest (1) to highest.
	//
	// If requested URI matches multiple rules, the one higher in the order of the
	// rules will be applied.
	Weight param.Opt[int64] `json:"weight,omitzero"`
	// Sets a protocol other than the one specified in the CDN resource settings to
	// connect to the origin.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
	//   - **HTTP** - CDN servers connect to origin via HTTP protocol.
	//   - **MATCH** - Connection protocol is chosen automatically; in this case, content
	//     on origin source should be available for the CDN both through HTTP and HTTPS
	//     protocols.
	//   - **null** - `originProtocol` setting is inherited from the CDN resource
	//     settings.
	//
	// If an enabled origin among the origins this rule pulls from is bound to a Gcore
	// Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OverrideOriginProtocol RuleTemplateNewParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
	// List of options that can be configured for the rule.
	//
	// In case of `null` value the option is not added to the rule. Option inherits its
	// value from the CDN resource settings.
	Options RuleTemplateNewParamsOptions `json:"options,omitzero"`
	// contains filtered or unexported fields
}

func (RuleTemplateNewParams) MarshalJSON

func (r RuleTemplateNewParams) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParams) UnmarshalJSON

func (r *RuleTemplateNewParams) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptions

type RuleTemplateNewParamsOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods RuleTemplateNewParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression RuleTemplateNewParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings RuleTemplateNewParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders RuleTemplateNewParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors RuleTemplateNewParamsOptionsCors `json:"cors,omitzero"`
	// Enables control access to content for specified countries.
	CountryACL RuleTemplateNewParamsOptionsCountryACL `json:"country_acl,omitzero"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache RuleTemplateNewParamsOptionsDisableCache `json:"disable_cache,omitzero"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges RuleTemplateNewParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings RuleTemplateNewParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge RuleTemplateNewParamsOptionsFastedge `json:"fastedge,omitzero"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed RuleTemplateNewParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect RuleTemplateNewParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn RuleTemplateNewParamsOptionsForceReturn `json:"force_return,omitzero"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader RuleTemplateNewParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn RuleTemplateNewParamsOptionsGzipOn `json:"gzipOn,omitzero"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader RuleTemplateNewParamsOptionsHostHeader `json:"hostHeader,omitzero"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie RuleTemplateNewParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString RuleTemplateNewParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack RuleTemplateNewParamsOptionsImageStack `json:"image_stack,omitzero"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL RuleTemplateNewParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
	// Allows to control the download speed per connection.
	LimitBandwidth RuleTemplateNewParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey RuleTemplateNewParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet RuleTemplateNewParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout RuleTemplateNewParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout RuleTemplateNewParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist RuleTemplateNewParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist RuleTemplateNewParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding RuleTemplateNewParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL RuleTemplateNewParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite RuleTemplateNewParamsOptionsRewrite `json:"rewrite,omitzero"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey RuleTemplateNewParamsOptionsSecureKey `json:"secure_key,omitzero"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice RuleTemplateNewParamsOptionsSlice `json:"slice,omitzero"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni RuleTemplateNewParamsOptionsSni `json:"sni,omitzero"`
	// Serves stale cached content in case of origin unavailability.
	Stale RuleTemplateNewParamsOptionsStale `json:"stale,omitzero"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders RuleTemplateNewParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders RuleTemplateNewParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders RuleTemplateNewParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL RuleTemplateNewParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap RuleTemplateNewParamsOptionsWaap `json:"waap,omitzero"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets RuleTemplateNewParamsOptionsWebsockets `json:"websockets,omitzero"`
	// contains filtered or unexported fields
}

List of options that can be configured for the rule.

In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.

func (RuleTemplateNewParamsOptions) MarshalJSON

func (r RuleTemplateNewParamsOptions) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptions) UnmarshalJSON

func (r *RuleTemplateNewParamsOptions) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsAllowedHTTPMethods

type RuleTemplateNewParamsOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

HTTP methods allowed for content requests from the CDN.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsAllowedHTTPMethods) MarshalJSON

func (r RuleTemplateNewParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsAllowedHTTPMethods) UnmarshalJSON

type RuleTemplateNewParamsOptionsBrotliCompression

type RuleTemplateNewParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsBrotliCompression) MarshalJSON

func (r RuleTemplateNewParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsBrotliCompression) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsBrowserCacheSettings

type RuleTemplateNewParamsOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsBrowserCacheSettings) MarshalJSON

func (r RuleTemplateNewParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsBrowserCacheSettings) UnmarshalJSON

type RuleTemplateNewParamsOptionsCacheHTTPHeaders deprecated

type RuleTemplateNewParamsOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsCacheHTTPHeaders) MarshalJSON

func (r RuleTemplateNewParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsCors

type RuleTemplateNewParamsOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsCors) MarshalJSON

func (r RuleTemplateNewParamsOptionsCors) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsCors) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsCors) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsCountryACL

type RuleTemplateNewParamsOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Enables control access to content for specified countries.

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateNewParamsOptionsCountryACL) MarshalJSON

func (r RuleTemplateNewParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsCountryACL) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsCountryACL) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsDisableCache deprecated

type RuleTemplateNewParamsOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsDisableCache) MarshalJSON

func (r RuleTemplateNewParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsDisableCache) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsDisableCache) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsDisableProxyForceRanges

type RuleTemplateNewParamsOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows 206 responses regardless of the settings of an origin source.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsDisableProxyForceRanges) MarshalJSON

func (r RuleTemplateNewParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsDisableProxyForceRanges) UnmarshalJSON

type RuleTemplateNewParamsOptionsEdgeCacheSettings

type RuleTemplateNewParamsOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

The property Enabled is required.

func (RuleTemplateNewParamsOptionsEdgeCacheSettings) MarshalJSON

func (r RuleTemplateNewParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsEdgeCacheSettings) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsFastedge

type RuleTemplateNewParamsOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody RuleTemplateNewParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache RuleTemplateNewParamsOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody RuleTemplateNewParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

The property Enabled is required.

func (RuleTemplateNewParamsOptionsFastedge) MarshalJSON

func (r RuleTemplateNewParamsOptionsFastedge) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsFastedge) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsFastedge) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsFastedgeOnRequestBody

type RuleTemplateNewParamsOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

The property AppID is required.

func (RuleTemplateNewParamsOptionsFastedgeOnRequestBody) MarshalJSON

func (r RuleTemplateNewParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsFastedgeOnRequestBody) UnmarshalJSON

type RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders

type RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

The property AppID is required.

func (RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON

func (r RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON

type RuleTemplateNewParamsOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type RuleTemplateNewParamsOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

The property AppID is required.

func (RuleTemplateNewParamsOptionsFastedgeOnRequestHeadersAfterCache) MarshalJSON added in v0.50.0

func (*RuleTemplateNewParamsOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type RuleTemplateNewParamsOptionsFastedgeOnResponseBody

type RuleTemplateNewParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

The property AppID is required.

func (RuleTemplateNewParamsOptionsFastedgeOnResponseBody) MarshalJSON

func (r RuleTemplateNewParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsFastedgeOnResponseBody) UnmarshalJSON

type RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders

type RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

The property AppID is required.

func (RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders) MarshalJSON

func (*RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON

type RuleTemplateNewParamsOptionsFetchCompressed

type RuleTemplateNewParamsOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsFetchCompressed) MarshalJSON

func (r RuleTemplateNewParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsFetchCompressed) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsFollowOriginRedirect

type RuleTemplateNewParamsOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

The properties Codes, Enabled are required.

func (RuleTemplateNewParamsOptionsFollowOriginRedirect) MarshalJSON

func (r RuleTemplateNewParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsFollowOriginRedirect) UnmarshalJSON

type RuleTemplateNewParamsOptionsForceReturn

type RuleTemplateNewParamsOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval RuleTemplateNewParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
	// contains filtered or unexported fields
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

The properties Body, Code, Enabled are required.

func (RuleTemplateNewParamsOptionsForceReturn) MarshalJSON

func (r RuleTemplateNewParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsForceReturn) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsForceReturn) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsForceReturnTimeInterval

type RuleTemplateNewParamsOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
	// contains filtered or unexported fields
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

The properties EndTime, StartTime are required.

func (RuleTemplateNewParamsOptionsForceReturnTimeInterval) MarshalJSON

func (r RuleTemplateNewParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsForceReturnTimeInterval) UnmarshalJSON

type RuleTemplateNewParamsOptionsForwardHostHeader

type RuleTemplateNewParamsOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsForwardHostHeader) MarshalJSON

func (r RuleTemplateNewParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsForwardHostHeader) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsGzipOn

type RuleTemplateNewParamsOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsGzipOn) MarshalJSON

func (r RuleTemplateNewParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsGzipOn) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsGzipOn) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsHostHeader

type RuleTemplateNewParamsOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsHostHeader) MarshalJSON

func (r RuleTemplateNewParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsHostHeader) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsHostHeader) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsIPAddressACL

type RuleTemplateNewParamsOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateNewParamsOptionsIPAddressACL) MarshalJSON

func (r RuleTemplateNewParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsIPAddressACL) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsIgnoreCookie

type RuleTemplateNewParamsOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsIgnoreCookie) MarshalJSON

func (r RuleTemplateNewParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsIgnoreCookie) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsIgnoreQueryString

type RuleTemplateNewParamsOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsIgnoreQueryString) MarshalJSON

func (r RuleTemplateNewParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsIgnoreQueryString) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsImageStack

type RuleTemplateNewParamsOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality param.Opt[int64] `json:"quality,omitzero"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
	// contains filtered or unexported fields
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

The property Enabled is required.

func (RuleTemplateNewParamsOptionsImageStack) MarshalJSON

func (r RuleTemplateNewParamsOptionsImageStack) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsImageStack) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsImageStack) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsLimitBandwidth

type RuleTemplateNewParamsOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type,omitzero" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer param.Opt[int64] `json:"buffer,omitzero"`
	// Maximum download speed per connection.
	Speed param.Opt[int64] `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

Allows to control the download speed per connection.

The properties Enabled, LimitType are required.

func (RuleTemplateNewParamsOptionsLimitBandwidth) MarshalJSON

func (r RuleTemplateNewParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsLimitBandwidth) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsProxyCacheKey

type RuleTemplateNewParamsOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsProxyCacheKey) MarshalJSON

func (r RuleTemplateNewParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsProxyCacheKey) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsProxyCacheMethodsSet

type RuleTemplateNewParamsOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Caching for POST requests along with default GET and HEAD.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsProxyCacheMethodsSet) MarshalJSON

func (r RuleTemplateNewParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsProxyCacheMethodsSet) UnmarshalJSON

type RuleTemplateNewParamsOptionsProxyConnectTimeout

type RuleTemplateNewParamsOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for establishing a connection with the origin.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsProxyConnectTimeout) MarshalJSON

func (r RuleTemplateNewParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsProxyConnectTimeout) UnmarshalJSON

type RuleTemplateNewParamsOptionsProxyReadTimeout

type RuleTemplateNewParamsOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsProxyReadTimeout) MarshalJSON

func (r RuleTemplateNewParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsProxyReadTimeout) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsQueryParamsBlacklist

type RuleTemplateNewParamsOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsQueryParamsBlacklist) MarshalJSON

func (r RuleTemplateNewParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsQueryParamsBlacklist) UnmarshalJSON

type RuleTemplateNewParamsOptionsQueryParamsWhitelist

type RuleTemplateNewParamsOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsQueryParamsWhitelist) MarshalJSON

func (r RuleTemplateNewParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsQueryParamsWhitelist) UnmarshalJSON

type RuleTemplateNewParamsOptionsQueryStringForwarding

type RuleTemplateNewParamsOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types,omitzero" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
	// contains filtered or unexported fields
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.

func (RuleTemplateNewParamsOptionsQueryStringForwarding) MarshalJSON

func (r RuleTemplateNewParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsQueryStringForwarding) UnmarshalJSON

type RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP

type RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON

func (r RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON

type RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS

type RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON

func (r RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON

type RuleTemplateNewParamsOptionsReferrerACL

type RuleTemplateNewParamsOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specified domain names.

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateNewParamsOptionsReferrerACL) MarshalJSON

func (r RuleTemplateNewParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsReferrerACL) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy

type RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted,omitzero" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Hides HTTP headers from an origin server in the CDN response.

The properties Enabled, Excepted, Mode are required.

func (RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy) MarshalJSON

func (*RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON

type RuleTemplateNewParamsOptionsRewrite

type RuleTemplateNewParamsOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag,omitzero"`
	// contains filtered or unexported fields
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

The properties Body, Enabled are required.

func (RuleTemplateNewParamsOptionsRewrite) MarshalJSON

func (r RuleTemplateNewParamsOptionsRewrite) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsRewrite) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsRewrite) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsSecureKey

type RuleTemplateNewParamsOptionsSecureKey struct {
	// Key generated on your side that will be used for URL signing.
	Key param.Opt[string] `json:"key,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

The properties Enabled, Key are required.

func (RuleTemplateNewParamsOptionsSecureKey) MarshalJSON

func (r RuleTemplateNewParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsSecureKey) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsSecureKey) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsSlice

type RuleTemplateNewParamsOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsSlice) MarshalJSON

func (r RuleTemplateNewParamsOptionsSlice) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsSlice) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsSlice) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsSni

type RuleTemplateNewParamsOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type,omitzero"`
	// contains filtered or unexported fields
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

The properties CustomHostname, Enabled are required.

func (RuleTemplateNewParamsOptionsSni) MarshalJSON

func (r RuleTemplateNewParamsOptionsSni) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsSni) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsSni) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsStale

type RuleTemplateNewParamsOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Serves stale cached content in case of origin unavailability.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsStale) MarshalJSON

func (r RuleTemplateNewParamsOptionsStale) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsStale) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsStale) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsStaticHeaders deprecated

type RuleTemplateNewParamsOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsStaticHeaders) MarshalJSON

func (r RuleTemplateNewParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsStaticHeaders) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsStaticRequestHeaders

type RuleTemplateNewParamsOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsStaticRequestHeaders) MarshalJSON

func (r RuleTemplateNewParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsStaticRequestHeaders) UnmarshalJSON

type RuleTemplateNewParamsOptionsStaticResponseHeaders

type RuleTemplateNewParamsOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                                     `json:"enabled" api:"required"`
	Value   []RuleTemplateNewParamsOptionsStaticResponseHeadersValue `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers that a CDN server adds to a response.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsStaticResponseHeaders) MarshalJSON

func (r RuleTemplateNewParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsStaticResponseHeaders) UnmarshalJSON

type RuleTemplateNewParamsOptionsStaticResponseHeadersValue

type RuleTemplateNewParamsOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (RuleTemplateNewParamsOptionsStaticResponseHeadersValue) MarshalJSON

func (*RuleTemplateNewParamsOptionsStaticResponseHeadersValue) UnmarshalJSON

type RuleTemplateNewParamsOptionsUserAgentACL

type RuleTemplateNewParamsOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the content for specified User-Agents.

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateNewParamsOptionsUserAgentACL) MarshalJSON

func (r RuleTemplateNewParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsUserAgentACL) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsWaap

type RuleTemplateNewParamsOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows to enable WAAP (Web Application and API Protection).

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsWaap) MarshalJSON

func (r RuleTemplateNewParamsOptionsWaap) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsWaap) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsWaap) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOptionsWebsockets

type RuleTemplateNewParamsOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables or disables WebSockets connections to an origin server.

The properties Enabled, Value are required.

func (RuleTemplateNewParamsOptionsWebsockets) MarshalJSON

func (r RuleTemplateNewParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)

func (*RuleTemplateNewParamsOptionsWebsockets) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsWebsockets) UnmarshalJSON(data []byte) error

type RuleTemplateNewParamsOverrideOriginProtocol

type RuleTemplateNewParamsOverrideOriginProtocol string

Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.

Possible values:

  • **HTTPS** - CDN servers connect to origin via HTTPS protocol.
  • **HTTP** - CDN servers connect to origin via HTTP protocol.
  • **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
  • **null** - `originProtocol` setting is inherited from the CDN resource settings.

If an enabled origin among the origins this rule pulls from is bound to a Gcore Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.

const (
	RuleTemplateNewParamsOverrideOriginProtocolHTTPS RuleTemplateNewParamsOverrideOriginProtocol = "HTTPS"
	RuleTemplateNewParamsOverrideOriginProtocolHTTP  RuleTemplateNewParamsOverrideOriginProtocol = "HTTP"
	RuleTemplateNewParamsOverrideOriginProtocolMatch RuleTemplateNewParamsOverrideOriginProtocol = "MATCH"
)

type RuleTemplateOptions

type RuleTemplateOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods RuleTemplateOptionsAllowedHTTPMethods `json:"allowedHttpMethods" api:"nullable"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression RuleTemplateOptionsBrotliCompression `json:"brotli_compression" api:"nullable"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings RuleTemplateOptionsBrowserCacheSettings `json:"browser_cache_settings" api:"nullable"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders RuleTemplateOptionsCacheHTTPHeaders `json:"cache_http_headers" api:"nullable"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors RuleTemplateOptionsCors `json:"cors" api:"nullable"`
	// Enables control access to content for specified countries.
	CountryACL RuleTemplateOptionsCountryACL `json:"country_acl" api:"nullable"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache RuleTemplateOptionsDisableCache `json:"disable_cache" api:"nullable"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges RuleTemplateOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges" api:"nullable"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings RuleTemplateOptionsEdgeCacheSettings `json:"edge_cache_settings" api:"nullable"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge RuleTemplateOptionsFastedge `json:"fastedge" api:"nullable"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed RuleTemplateOptionsFetchCompressed `json:"fetch_compressed" api:"nullable"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect RuleTemplateOptionsFollowOriginRedirect `json:"follow_origin_redirect" api:"nullable"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn RuleTemplateOptionsForceReturn `json:"force_return" api:"nullable"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader RuleTemplateOptionsForwardHostHeader `json:"forward_host_header" api:"nullable"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn RuleTemplateOptionsGzipOn `json:"gzipOn" api:"nullable"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader RuleTemplateOptionsHostHeader `json:"hostHeader" api:"nullable"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie RuleTemplateOptionsIgnoreCookie `json:"ignore_cookie" api:"nullable"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString RuleTemplateOptionsIgnoreQueryString `json:"ignoreQueryString" api:"nullable"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack RuleTemplateOptionsImageStack `json:"image_stack" api:"nullable"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL RuleTemplateOptionsIPAddressACL `json:"ip_address_acl" api:"nullable"`
	// Allows to control the download speed per connection.
	LimitBandwidth RuleTemplateOptionsLimitBandwidth `json:"limit_bandwidth" api:"nullable"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey RuleTemplateOptionsProxyCacheKey `json:"proxy_cache_key" api:"nullable"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet RuleTemplateOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set" api:"nullable"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout RuleTemplateOptionsProxyConnectTimeout `json:"proxy_connect_timeout" api:"nullable"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout RuleTemplateOptionsProxyReadTimeout `json:"proxy_read_timeout" api:"nullable"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist RuleTemplateOptionsQueryParamsBlacklist `json:"query_params_blacklist" api:"nullable"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist RuleTemplateOptionsQueryParamsWhitelist `json:"query_params_whitelist" api:"nullable"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding RuleTemplateOptionsQueryStringForwarding `json:"query_string_forwarding" api:"nullable"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS RuleTemplateOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https" api:"nullable"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP RuleTemplateOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http" api:"nullable"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL RuleTemplateOptionsReferrerACL `json:"referrer_acl" api:"nullable"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy RuleTemplateOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy" api:"nullable"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite RuleTemplateOptionsRewrite `json:"rewrite" api:"nullable"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey RuleTemplateOptionsSecureKey `json:"secure_key" api:"nullable"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice RuleTemplateOptionsSlice `json:"slice" api:"nullable"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni RuleTemplateOptionsSni `json:"sni" api:"nullable"`
	// Serves stale cached content in case of origin unavailability.
	Stale RuleTemplateOptionsStale `json:"stale" api:"nullable"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders RuleTemplateOptionsStaticResponseHeaders `json:"static_response_headers" api:"nullable"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders RuleTemplateOptionsStaticHeaders `json:"staticHeaders" api:"nullable"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders RuleTemplateOptionsStaticRequestHeaders `json:"staticRequestHeaders" api:"nullable"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL RuleTemplateOptionsUserAgentACL `json:"user_agent_acl" api:"nullable"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap RuleTemplateOptionsWaap `json:"waap" api:"nullable"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets RuleTemplateOptionsWebsockets `json:"websockets" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowedHTTPMethods          respjson.Field
		BrotliCompression           respjson.Field
		BrowserCacheSettings        respjson.Field
		CacheHTTPHeaders            respjson.Field
		Cors                        respjson.Field
		CountryACL                  respjson.Field
		DisableCache                respjson.Field
		DisableProxyForceRanges     respjson.Field
		EdgeCacheSettings           respjson.Field
		Fastedge                    respjson.Field
		FetchCompressed             respjson.Field
		FollowOriginRedirect        respjson.Field
		ForceReturn                 respjson.Field
		ForwardHostHeader           respjson.Field
		GzipOn                      respjson.Field
		HostHeader                  respjson.Field
		IgnoreCookie                respjson.Field
		IgnoreQueryString           respjson.Field
		ImageStack                  respjson.Field
		IPAddressACL                respjson.Field
		LimitBandwidth              respjson.Field
		ProxyCacheKey               respjson.Field
		ProxyCacheMethodsSet        respjson.Field
		ProxyConnectTimeout         respjson.Field
		ProxyReadTimeout            respjson.Field
		QueryParamsBlacklist        respjson.Field
		QueryParamsWhitelist        respjson.Field
		QueryStringForwarding       respjson.Field
		RedirectHTTPToHTTPS         respjson.Field
		RedirectHTTPSToHTTP         respjson.Field
		ReferrerACL                 respjson.Field
		ResponseHeadersHidingPolicy respjson.Field
		Rewrite                     respjson.Field
		SecureKey                   respjson.Field
		Slice                       respjson.Field
		Sni                         respjson.Field
		Stale                       respjson.Field
		StaticResponseHeaders       respjson.Field
		StaticHeaders               respjson.Field
		StaticRequestHeaders        respjson.Field
		UserAgentACL                respjson.Field
		Waap                        respjson.Field
		Websockets                  respjson.Field
		ExtraFields                 map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of options that can be configured for the rule.

In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.

func (RuleTemplateOptions) RawJSON

func (r RuleTemplateOptions) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplateOptions) UnmarshalJSON

func (r *RuleTemplateOptions) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsAllowedHTTPMethods

type RuleTemplateOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

HTTP methods allowed for content requests from the CDN.

func (RuleTemplateOptionsAllowedHTTPMethods) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsAllowedHTTPMethods) UnmarshalJSON

func (r *RuleTemplateOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsBrotliCompression

type RuleTemplateOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

func (RuleTemplateOptionsBrotliCompression) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsBrotliCompression) UnmarshalJSON

func (r *RuleTemplateOptionsBrotliCompression) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsBrowserCacheSettings

type RuleTemplateOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

func (RuleTemplateOptionsBrowserCacheSettings) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsBrowserCacheSettings) UnmarshalJSON

func (r *RuleTemplateOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsCacheHTTPHeaders deprecated

type RuleTemplateOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

func (RuleTemplateOptionsCacheHTTPHeaders) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsCacheHTTPHeaders) UnmarshalJSON

func (r *RuleTemplateOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsCors

type RuleTemplateOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always bool `json:"always"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		Always      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

func (RuleTemplateOptionsCors) RawJSON

func (r RuleTemplateOptionsCors) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsCors) UnmarshalJSON

func (r *RuleTemplateOptionsCors) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsCountryACL

type RuleTemplateOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables control access to content for specified countries.

func (RuleTemplateOptionsCountryACL) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsCountryACL) UnmarshalJSON

func (r *RuleTemplateOptionsCountryACL) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsDisableCache deprecated

type RuleTemplateOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

func (RuleTemplateOptionsDisableCache) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsDisableCache) UnmarshalJSON

func (r *RuleTemplateOptionsDisableCache) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsDisableProxyForceRanges

type RuleTemplateOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows 206 responses regardless of the settings of an origin source.

func (RuleTemplateOptionsDisableProxyForceRanges) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsDisableProxyForceRanges) UnmarshalJSON

func (r *RuleTemplateOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsEdgeCacheSettings

type RuleTemplateOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values" format:"nginx time"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default string `json:"default" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" format:"nginx time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled      respjson.Field
		CustomValues respjson.Field
		Default      respjson.Field
		Value        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

func (RuleTemplateOptionsEdgeCacheSettings) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsEdgeCacheSettings) UnmarshalJSON

func (r *RuleTemplateOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsFastedge

type RuleTemplateOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody RuleTemplateOptionsFastedgeOnRequestBody `json:"on_request_body"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders RuleTemplateOptionsFastedgeOnRequestHeaders `json:"on_request_headers"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache RuleTemplateOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody RuleTemplateOptionsFastedgeOnResponseBody `json:"on_response_body"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders RuleTemplateOptionsFastedgeOnResponseHeaders `json:"on_response_headers"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled                    respjson.Field
		OnRequestBody              respjson.Field
		OnRequestHeaders           respjson.Field
		OnRequestHeadersAfterCache respjson.Field
		OnResponseBody             respjson.Field
		OnResponseHeaders          respjson.Field
		ExtraFields                map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

func (RuleTemplateOptionsFastedge) RawJSON

func (r RuleTemplateOptionsFastedge) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsFastedge) UnmarshalJSON

func (r *RuleTemplateOptionsFastedge) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsFastedgeOnRequestBody

type RuleTemplateOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

func (RuleTemplateOptionsFastedgeOnRequestBody) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsFastedgeOnRequestBody) UnmarshalJSON

func (r *RuleTemplateOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsFastedgeOnRequestHeaders

type RuleTemplateOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

func (RuleTemplateOptionsFastedgeOnRequestHeaders) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsFastedgeOnRequestHeaders) UnmarshalJSON

func (r *RuleTemplateOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type RuleTemplateOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

func (RuleTemplateOptionsFastedgeOnRequestHeadersAfterCache) RawJSON added in v0.50.0

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type RuleTemplateOptionsFastedgeOnResponseBody

type RuleTemplateOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

func (RuleTemplateOptionsFastedgeOnResponseBody) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsFastedgeOnResponseBody) UnmarshalJSON

func (r *RuleTemplateOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsFastedgeOnResponseHeaders

type RuleTemplateOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled bool `json:"enabled"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge bool `json:"execute_on_edge"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield bool `json:"execute_on_shield"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError bool `json:"interrupt_on_error"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AppID            respjson.Field
		Enabled          respjson.Field
		ExecuteOnEdge    respjson.Field
		ExecuteOnShield  respjson.Field
		InterruptOnError respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

func (RuleTemplateOptionsFastedgeOnResponseHeaders) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsFastedgeOnResponseHeaders) UnmarshalJSON

func (r *RuleTemplateOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsFetchCompressed

type RuleTemplateOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

func (RuleTemplateOptionsFetchCompressed) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsFetchCompressed) UnmarshalJSON

func (r *RuleTemplateOptionsFetchCompressed) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsFollowOriginRedirect

type RuleTemplateOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Codes       respjson.Field
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

func (RuleTemplateOptionsFollowOriginRedirect) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsFollowOriginRedirect) UnmarshalJSON

func (r *RuleTemplateOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsForceReturn

type RuleTemplateOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval RuleTemplateOptionsForceReturnTimeInterval `json:"time_interval" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Body         respjson.Field
		Code         respjson.Field
		Enabled      respjson.Field
		TimeInterval respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

func (RuleTemplateOptionsForceReturn) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsForceReturn) UnmarshalJSON

func (r *RuleTemplateOptionsForceReturn) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsForceReturnTimeInterval

type RuleTemplateOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone string `json:"time_zone" format:"timezone"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EndTime     respjson.Field
		StartTime   respjson.Field
		TimeZone    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

func (RuleTemplateOptionsForceReturnTimeInterval) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsForceReturnTimeInterval) UnmarshalJSON

func (r *RuleTemplateOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsForwardHostHeader

type RuleTemplateOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

func (RuleTemplateOptionsForwardHostHeader) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsForwardHostHeader) UnmarshalJSON

func (r *RuleTemplateOptionsForwardHostHeader) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsGzipOn

type RuleTemplateOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

func (RuleTemplateOptionsGzipOn) RawJSON

func (r RuleTemplateOptionsGzipOn) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsGzipOn) UnmarshalJSON

func (r *RuleTemplateOptionsGzipOn) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsHostHeader

type RuleTemplateOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

func (RuleTemplateOptionsHostHeader) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsHostHeader) UnmarshalJSON

func (r *RuleTemplateOptionsHostHeader) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsIPAddressACL

type RuleTemplateOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

func (RuleTemplateOptionsIPAddressACL) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsIPAddressACL) UnmarshalJSON

func (r *RuleTemplateOptionsIPAddressACL) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsIgnoreCookie

type RuleTemplateOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

func (RuleTemplateOptionsIgnoreCookie) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsIgnoreCookie) UnmarshalJSON

func (r *RuleTemplateOptionsIgnoreCookie) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsIgnoreQueryString

type RuleTemplateOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

func (RuleTemplateOptionsIgnoreQueryString) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsIgnoreQueryString) UnmarshalJSON

func (r *RuleTemplateOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsImageStack

type RuleTemplateOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled bool `json:"avif_enabled"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless bool `json:"png_lossless"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality int64 `json:"quality"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled bool `json:"webp_enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		AvifEnabled respjson.Field
		PngLossless respjson.Field
		Quality     respjson.Field
		WebpEnabled respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

func (RuleTemplateOptionsImageStack) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsImageStack) UnmarshalJSON

func (r *RuleTemplateOptionsImageStack) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsLimitBandwidth

type RuleTemplateOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer int64 `json:"buffer"`
	// Maximum download speed per connection.
	Speed int64 `json:"speed"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		LimitType   respjson.Field
		Buffer      respjson.Field
		Speed       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to control the download speed per connection.

func (RuleTemplateOptionsLimitBandwidth) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsLimitBandwidth) UnmarshalJSON

func (r *RuleTemplateOptionsLimitBandwidth) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsProxyCacheKey

type RuleTemplateOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

func (RuleTemplateOptionsProxyCacheKey) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsProxyCacheKey) UnmarshalJSON

func (r *RuleTemplateOptionsProxyCacheKey) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsProxyCacheMethodsSet

type RuleTemplateOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Caching for POST requests along with default GET and HEAD.

func (RuleTemplateOptionsProxyCacheMethodsSet) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsProxyCacheMethodsSet) UnmarshalJSON

func (r *RuleTemplateOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsProxyConnectTimeout

type RuleTemplateOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The time limit for establishing a connection with the origin.

func (RuleTemplateOptionsProxyConnectTimeout) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsProxyConnectTimeout) UnmarshalJSON

func (r *RuleTemplateOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsProxyReadTimeout

type RuleTemplateOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

func (RuleTemplateOptionsProxyReadTimeout) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsProxyReadTimeout) UnmarshalJSON

func (r *RuleTemplateOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsQueryParamsBlacklist

type RuleTemplateOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

func (RuleTemplateOptionsQueryParamsBlacklist) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsQueryParamsBlacklist) UnmarshalJSON

func (r *RuleTemplateOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsQueryParamsWhitelist

type RuleTemplateOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

func (RuleTemplateOptionsQueryParamsWhitelist) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsQueryParamsWhitelist) UnmarshalJSON

func (r *RuleTemplateOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsQueryStringForwarding

type RuleTemplateOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled              respjson.Field
		ForwardFromFileTypes respjson.Field
		ForwardToFileTypes   respjson.Field
		ForwardExceptKeys    respjson.Field
		ForwardOnlyKeys      respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

func (RuleTemplateOptionsQueryStringForwarding) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsQueryStringForwarding) UnmarshalJSON

func (r *RuleTemplateOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsRedirectHTTPSToHTTP

type RuleTemplateOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

func (RuleTemplateOptionsRedirectHTTPSToHTTP) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsRedirectHTTPSToHTTP) UnmarshalJSON

func (r *RuleTemplateOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsRedirectHTTPToHTTPS

type RuleTemplateOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

func (RuleTemplateOptionsRedirectHTTPToHTTPS) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsRedirectHTTPToHTTPS) UnmarshalJSON

func (r *RuleTemplateOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsReferrerACL

type RuleTemplateOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls access to the CDN resource content for specified domain names.

func (RuleTemplateOptionsReferrerACL) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsReferrerACL) UnmarshalJSON

func (r *RuleTemplateOptionsReferrerACL) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsResponseHeadersHidingPolicy

type RuleTemplateOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Excepted    respjson.Field
		Mode        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Hides HTTP headers from an origin server in the CDN response.

func (RuleTemplateOptionsResponseHeadersHidingPolicy) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsResponseHeadersHidingPolicy) UnmarshalJSON

type RuleTemplateOptionsRewrite

type RuleTemplateOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Body        respjson.Field
		Enabled     respjson.Field
		Flag        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

func (RuleTemplateOptionsRewrite) RawJSON

func (r RuleTemplateOptionsRewrite) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsRewrite) UnmarshalJSON

func (r *RuleTemplateOptionsRewrite) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsSecureKey

type RuleTemplateOptionsSecureKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key generated on your side that will be used for URL signing.
	Key string `json:"key" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Key         respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

func (RuleTemplateOptionsSecureKey) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsSecureKey) UnmarshalJSON

func (r *RuleTemplateOptionsSecureKey) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsSlice

type RuleTemplateOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

func (RuleTemplateOptionsSlice) RawJSON

func (r RuleTemplateOptionsSlice) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsSlice) UnmarshalJSON

func (r *RuleTemplateOptionsSlice) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsSni

type RuleTemplateOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CustomHostname respjson.Field
		Enabled        respjson.Field
		SniType        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

func (RuleTemplateOptionsSni) RawJSON

func (r RuleTemplateOptionsSni) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsSni) UnmarshalJSON

func (r *RuleTemplateOptionsSni) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsStale

type RuleTemplateOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Serves stale cached content in case of origin unavailability.

func (RuleTemplateOptionsStale) RawJSON

func (r RuleTemplateOptionsStale) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsStale) UnmarshalJSON

func (r *RuleTemplateOptionsStale) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsStaticHeaders deprecated

type RuleTemplateOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

func (RuleTemplateOptionsStaticHeaders) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsStaticHeaders) UnmarshalJSON

func (r *RuleTemplateOptionsStaticHeaders) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsStaticRequestHeaders

type RuleTemplateOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

func (RuleTemplateOptionsStaticRequestHeaders) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsStaticRequestHeaders) UnmarshalJSON

func (r *RuleTemplateOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsStaticResponseHeaders

type RuleTemplateOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                            `json:"enabled" api:"required"`
	Value   []RuleTemplateOptionsStaticResponseHeadersValue `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Custom HTTP Headers that a CDN server adds to a response.

func (RuleTemplateOptionsStaticResponseHeaders) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsStaticResponseHeaders) UnmarshalJSON

func (r *RuleTemplateOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsStaticResponseHeadersValue

type RuleTemplateOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always bool `json:"always"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Value       respjson.Field
		Always      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RuleTemplateOptionsStaticResponseHeadersValue) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsStaticResponseHeadersValue) UnmarshalJSON

func (r *RuleTemplateOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsUserAgentACL

type RuleTemplateOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled        respjson.Field
		ExceptedValues respjson.Field
		PolicyType     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls access to the content for specified User-Agents.

func (RuleTemplateOptionsUserAgentACL) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsUserAgentACL) UnmarshalJSON

func (r *RuleTemplateOptionsUserAgentACL) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsWaap

type RuleTemplateOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Allows to enable WAAP (Web Application and API Protection).

func (RuleTemplateOptionsWaap) RawJSON

func (r RuleTemplateOptionsWaap) RawJSON() string

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsWaap) UnmarshalJSON

func (r *RuleTemplateOptionsWaap) UnmarshalJSON(data []byte) error

type RuleTemplateOptionsWebsockets

type RuleTemplateOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Enables or disables WebSockets connections to an origin server.

func (RuleTemplateOptionsWebsockets) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsWebsockets) UnmarshalJSON

func (r *RuleTemplateOptionsWebsockets) UnmarshalJSON(data []byte) error

type RuleTemplateOverrideOriginProtocol

type RuleTemplateOverrideOriginProtocol string

Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.

Possible values:

  • **HTTPS** - CDN servers connect to origin via HTTPS protocol.
  • **HTTP** - CDN servers connect to origin via HTTP protocol.
  • **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
  • **null** - `originProtocol` setting is inherited from the CDN resource settings.

If an enabled origin among the origins this rule pulls from is bound to a Gcore Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.

const (
	RuleTemplateOverrideOriginProtocolHTTPS RuleTemplateOverrideOriginProtocol = "HTTPS"
	RuleTemplateOverrideOriginProtocolHTTP  RuleTemplateOverrideOriginProtocol = "HTTP"
	RuleTemplateOverrideOriginProtocolMatch RuleTemplateOverrideOriginProtocol = "MATCH"
)

type RuleTemplateReplaceParams

type RuleTemplateReplaceParams struct {
	// Path to the file or folder for which the rule will be applied.
	//
	// The rule is applied if the requested URI matches the rule path.
	//
	// We add a leading forward slash to any rule path. Specify a path without a
	// forward slash.
	Rule string `json:"rule" api:"required"`
	// Rule type.
	//
	// Possible values:
	//
	//   - **Type 0** - Regular expression. Must start with '^/' or '/'.
	//   - **Type 1** - Regular expression. Note that for this rule type we automatically
	//     add / to each rule pattern before your regular expression. This type is
	//     **legacy**, please use Type 0.
	RuleType int64 `json:"ruleType" api:"required"`
	// Rule template name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Rule execution order: from lowest (1) to highest.
	//
	// If requested URI matches multiple rules, the one higher in the order of the
	// rules will be applied.
	Weight param.Opt[int64] `json:"weight,omitzero"`
	// Sets a protocol other than the one specified in the CDN resource settings to
	// connect to the origin.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
	//   - **HTTP** - CDN servers connect to origin via HTTP protocol.
	//   - **MATCH** - Connection protocol is chosen automatically; in this case, content
	//     on origin source should be available for the CDN both through HTTP and HTTPS
	//     protocols.
	//   - **null** - `originProtocol` setting is inherited from the CDN resource
	//     settings.
	//
	// If an enabled origin among the origins this rule pulls from is bound to a Gcore
	// Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OverrideOriginProtocol RuleTemplateReplaceParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
	// List of options that can be configured for the rule.
	//
	// In case of `null` value the option is not added to the rule. Option inherits its
	// value from the CDN resource settings.
	Options RuleTemplateReplaceParamsOptions `json:"options,omitzero"`
	// contains filtered or unexported fields
}

func (RuleTemplateReplaceParams) MarshalJSON

func (r RuleTemplateReplaceParams) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParams) UnmarshalJSON

func (r *RuleTemplateReplaceParams) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptions

type RuleTemplateReplaceParamsOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods RuleTemplateReplaceParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression RuleTemplateReplaceParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings RuleTemplateReplaceParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders RuleTemplateReplaceParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors RuleTemplateReplaceParamsOptionsCors `json:"cors,omitzero"`
	// Enables control access to content for specified countries.
	CountryACL RuleTemplateReplaceParamsOptionsCountryACL `json:"country_acl,omitzero"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache RuleTemplateReplaceParamsOptionsDisableCache `json:"disable_cache,omitzero"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges RuleTemplateReplaceParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings RuleTemplateReplaceParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge RuleTemplateReplaceParamsOptionsFastedge `json:"fastedge,omitzero"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed RuleTemplateReplaceParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect RuleTemplateReplaceParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn RuleTemplateReplaceParamsOptionsForceReturn `json:"force_return,omitzero"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader RuleTemplateReplaceParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn RuleTemplateReplaceParamsOptionsGzipOn `json:"gzipOn,omitzero"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader RuleTemplateReplaceParamsOptionsHostHeader `json:"hostHeader,omitzero"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie RuleTemplateReplaceParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString RuleTemplateReplaceParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack RuleTemplateReplaceParamsOptionsImageStack `json:"image_stack,omitzero"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL RuleTemplateReplaceParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
	// Allows to control the download speed per connection.
	LimitBandwidth RuleTemplateReplaceParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey RuleTemplateReplaceParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout RuleTemplateReplaceParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout RuleTemplateReplaceParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist RuleTemplateReplaceParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist RuleTemplateReplaceParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding RuleTemplateReplaceParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL RuleTemplateReplaceParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite RuleTemplateReplaceParamsOptionsRewrite `json:"rewrite,omitzero"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey RuleTemplateReplaceParamsOptionsSecureKey `json:"secure_key,omitzero"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice RuleTemplateReplaceParamsOptionsSlice `json:"slice,omitzero"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni RuleTemplateReplaceParamsOptionsSni `json:"sni,omitzero"`
	// Serves stale cached content in case of origin unavailability.
	Stale RuleTemplateReplaceParamsOptionsStale `json:"stale,omitzero"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders RuleTemplateReplaceParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders RuleTemplateReplaceParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders RuleTemplateReplaceParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL RuleTemplateReplaceParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap RuleTemplateReplaceParamsOptionsWaap `json:"waap,omitzero"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets RuleTemplateReplaceParamsOptionsWebsockets `json:"websockets,omitzero"`
	// contains filtered or unexported fields
}

List of options that can be configured for the rule.

In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.

func (RuleTemplateReplaceParamsOptions) MarshalJSON

func (r RuleTemplateReplaceParamsOptions) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptions) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptions) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsAllowedHTTPMethods

type RuleTemplateReplaceParamsOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

HTTP methods allowed for content requests from the CDN.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsAllowedHTTPMethods) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsBrotliCompression

type RuleTemplateReplaceParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsBrotliCompression) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsBrotliCompression) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsBrowserCacheSettings

type RuleTemplateReplaceParamsOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsBrowserCacheSettings) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsBrowserCacheSettings) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsCacheHTTPHeaders deprecated

type RuleTemplateReplaceParamsOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsCacheHTTPHeaders) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsCors

type RuleTemplateReplaceParamsOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsCors) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsCors) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsCors) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsCors) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsCountryACL

type RuleTemplateReplaceParamsOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Enables control access to content for specified countries.

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateReplaceParamsOptionsCountryACL) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsCountryACL) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsCountryACL) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsDisableCache deprecated

type RuleTemplateReplaceParamsOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsDisableCache) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsDisableCache) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsDisableCache) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsDisableProxyForceRanges

type RuleTemplateReplaceParamsOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows 206 responses regardless of the settings of an origin source.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsDisableProxyForceRanges) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsDisableProxyForceRanges) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsEdgeCacheSettings

type RuleTemplateReplaceParamsOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

The property Enabled is required.

func (RuleTemplateReplaceParamsOptionsEdgeCacheSettings) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsEdgeCacheSettings) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsFastedge

type RuleTemplateReplaceParamsOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

The property Enabled is required.

func (RuleTemplateReplaceParamsOptionsFastedge) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsFastedge) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsFastedge) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsFastedge) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody

type RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

The property AppID is required.

func (RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders

type RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

The property AppID is required.

func (RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

The property AppID is required.

func (RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache) MarshalJSON added in v0.50.0

func (*RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody

type RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

The property AppID is required.

func (RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders

type RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

The property AppID is required.

func (RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsFetchCompressed

type RuleTemplateReplaceParamsOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsFetchCompressed) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsFetchCompressed) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsFollowOriginRedirect

type RuleTemplateReplaceParamsOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

The properties Codes, Enabled are required.

func (RuleTemplateReplaceParamsOptionsFollowOriginRedirect) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsFollowOriginRedirect) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsForceReturn

type RuleTemplateReplaceParamsOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval RuleTemplateReplaceParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
	// contains filtered or unexported fields
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

The properties Body, Code, Enabled are required.

func (RuleTemplateReplaceParamsOptionsForceReturn) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsForceReturn) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsForceReturn) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsForceReturnTimeInterval

type RuleTemplateReplaceParamsOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
	// contains filtered or unexported fields
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

The properties EndTime, StartTime are required.

func (RuleTemplateReplaceParamsOptionsForceReturnTimeInterval) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsForceReturnTimeInterval) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsForwardHostHeader

type RuleTemplateReplaceParamsOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsForwardHostHeader) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsForwardHostHeader) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsGzipOn

type RuleTemplateReplaceParamsOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsGzipOn) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsGzipOn) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsGzipOn) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsHostHeader

type RuleTemplateReplaceParamsOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsHostHeader) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsHostHeader) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsHostHeader) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsIPAddressACL

type RuleTemplateReplaceParamsOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateReplaceParamsOptionsIPAddressACL) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsIPAddressACL) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsIgnoreCookie

type RuleTemplateReplaceParamsOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsIgnoreCookie) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsIgnoreCookie) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsIgnoreQueryString

type RuleTemplateReplaceParamsOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsIgnoreQueryString) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsIgnoreQueryString) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsImageStack

type RuleTemplateReplaceParamsOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality param.Opt[int64] `json:"quality,omitzero"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
	// contains filtered or unexported fields
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

The property Enabled is required.

func (RuleTemplateReplaceParamsOptionsImageStack) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsImageStack) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsImageStack) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsImageStack) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsLimitBandwidth

type RuleTemplateReplaceParamsOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type,omitzero" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer param.Opt[int64] `json:"buffer,omitzero"`
	// Maximum download speed per connection.
	Speed param.Opt[int64] `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

Allows to control the download speed per connection.

The properties Enabled, LimitType are required.

func (RuleTemplateReplaceParamsOptionsLimitBandwidth) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsLimitBandwidth) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsProxyCacheKey

type RuleTemplateReplaceParamsOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsProxyCacheKey) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsProxyCacheKey) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet

type RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Caching for POST requests along with default GET and HEAD.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsProxyConnectTimeout

type RuleTemplateReplaceParamsOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for establishing a connection with the origin.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsProxyConnectTimeout) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsProxyConnectTimeout) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsProxyReadTimeout

type RuleTemplateReplaceParamsOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsProxyReadTimeout) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsProxyReadTimeout) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsQueryParamsBlacklist

type RuleTemplateReplaceParamsOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsQueryParamsBlacklist) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsQueryParamsWhitelist

type RuleTemplateReplaceParamsOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsQueryParamsWhitelist) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsQueryStringForwarding

type RuleTemplateReplaceParamsOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types,omitzero" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
	// contains filtered or unexported fields
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.

func (RuleTemplateReplaceParamsOptionsQueryStringForwarding) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsQueryStringForwarding) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP

type RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS

type RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsReferrerACL

type RuleTemplateReplaceParamsOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specified domain names.

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateReplaceParamsOptionsReferrerACL) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsReferrerACL) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy

type RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted,omitzero" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Hides HTTP headers from an origin server in the CDN response.

The properties Enabled, Excepted, Mode are required.

func (RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsRewrite

type RuleTemplateReplaceParamsOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag,omitzero"`
	// contains filtered or unexported fields
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

The properties Body, Enabled are required.

func (RuleTemplateReplaceParamsOptionsRewrite) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsRewrite) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsRewrite) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsRewrite) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsSecureKey

type RuleTemplateReplaceParamsOptionsSecureKey struct {
	// Key generated on your side that will be used for URL signing.
	Key param.Opt[string] `json:"key,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

The properties Enabled, Key are required.

func (RuleTemplateReplaceParamsOptionsSecureKey) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsSecureKey) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsSecureKey) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsSlice

type RuleTemplateReplaceParamsOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsSlice) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsSlice) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsSlice) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsSlice) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsSni

type RuleTemplateReplaceParamsOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type,omitzero"`
	// contains filtered or unexported fields
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

The properties CustomHostname, Enabled are required.

func (RuleTemplateReplaceParamsOptionsSni) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsSni) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsSni) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsSni) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsStale

type RuleTemplateReplaceParamsOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Serves stale cached content in case of origin unavailability.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsStale) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsStale) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsStale) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsStale) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsStaticHeaders deprecated

type RuleTemplateReplaceParamsOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsStaticHeaders) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsStaticHeaders) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsStaticRequestHeaders

type RuleTemplateReplaceParamsOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsStaticRequestHeaders) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsStaticRequestHeaders) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsStaticResponseHeaders

type RuleTemplateReplaceParamsOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                                         `json:"enabled" api:"required"`
	Value   []RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers that a CDN server adds to a response.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsStaticResponseHeaders) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsStaticResponseHeaders) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue

type RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsUserAgentACL

type RuleTemplateReplaceParamsOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the content for specified User-Agents.

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateReplaceParamsOptionsUserAgentACL) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsUserAgentACL) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsWaap

type RuleTemplateReplaceParamsOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows to enable WAAP (Web Application and API Protection).

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsWaap) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsWaap) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsWaap) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsWaap) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOptionsWebsockets

type RuleTemplateReplaceParamsOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables or disables WebSockets connections to an origin server.

The properties Enabled, Value are required.

func (RuleTemplateReplaceParamsOptionsWebsockets) MarshalJSON

func (r RuleTemplateReplaceParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)

func (*RuleTemplateReplaceParamsOptionsWebsockets) UnmarshalJSON

func (r *RuleTemplateReplaceParamsOptionsWebsockets) UnmarshalJSON(data []byte) error

type RuleTemplateReplaceParamsOverrideOriginProtocol

type RuleTemplateReplaceParamsOverrideOriginProtocol string

Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.

Possible values:

  • **HTTPS** - CDN servers connect to origin via HTTPS protocol.
  • **HTTP** - CDN servers connect to origin via HTTP protocol.
  • **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
  • **null** - `originProtocol` setting is inherited from the CDN resource settings.

If an enabled origin among the origins this rule pulls from is bound to a Gcore Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.

const (
	RuleTemplateReplaceParamsOverrideOriginProtocolHTTPS RuleTemplateReplaceParamsOverrideOriginProtocol = "HTTPS"
	RuleTemplateReplaceParamsOverrideOriginProtocolHTTP  RuleTemplateReplaceParamsOverrideOriginProtocol = "HTTP"
	RuleTemplateReplaceParamsOverrideOriginProtocolMatch RuleTemplateReplaceParamsOverrideOriginProtocol = "MATCH"
)

type RuleTemplateService

type RuleTemplateService struct {
	Options []option.RequestOption
}

CDN rule templates define reusable rule configurations that can be applied across multiple CDN resources for consistent caching, delivery, and security policies.

RuleTemplateService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRuleTemplateService method instead.

func NewRuleTemplateService

func NewRuleTemplateService(opts ...option.RequestOption) (r RuleTemplateService)

NewRuleTemplateService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RuleTemplateService) Delete

func (r *RuleTemplateService) Delete(ctx context.Context, ruleTemplateID int64, opts ...option.RequestOption) (err error)

Delete rule template

func (*RuleTemplateService) Get

func (r *RuleTemplateService) Get(ctx context.Context, ruleTemplateID int64, opts ...option.RequestOption) (res *RuleTemplate, err error)

Get rule template details

func (*RuleTemplateService) List

Get rule templates list

func (*RuleTemplateService) ListAutoPaging added in v0.41.0

Get rule templates list

func (*RuleTemplateService) New

Create rule template

func (*RuleTemplateService) Replace

func (r *RuleTemplateService) Replace(ctx context.Context, ruleTemplateID int64, body RuleTemplateReplaceParams, opts ...option.RequestOption) (res *RuleTemplate, err error)

Change rule template

func (*RuleTemplateService) Update

func (r *RuleTemplateService) Update(ctx context.Context, ruleTemplateID int64, body RuleTemplateUpdateParams, opts ...option.RequestOption) (res *RuleTemplate, err error)

Change rule template

type RuleTemplateUpdateParams

type RuleTemplateUpdateParams struct {
	// Rule template name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Path to the file or folder for which the rule will be applied.
	//
	// The rule is applied if the requested URI matches the rule path.
	//
	// We add a leading forward slash to any rule path. Specify a path without a
	// forward slash.
	Rule param.Opt[string] `json:"rule,omitzero"`
	// Rule type.
	//
	// Possible values:
	//
	//   - **Type 0** - Regular expression. Must start with '^/' or '/'.
	//   - **Type 1** - Regular expression. Note that for this rule type we automatically
	//     add / to each rule pattern before your regular expression. This type is
	//     **legacy**, please use Type 0.
	RuleType param.Opt[int64] `json:"ruleType,omitzero"`
	// Rule execution order: from lowest (1) to highest.
	//
	// If requested URI matches multiple rules, the one higher in the order of the
	// rules will be applied.
	Weight param.Opt[int64] `json:"weight,omitzero"`
	// Sets a protocol other than the one specified in the CDN resource settings to
	// connect to the origin.
	//
	// Possible values:
	//
	//   - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
	//   - **HTTP** - CDN servers connect to origin via HTTP protocol.
	//   - **MATCH** - Connection protocol is chosen automatically; in this case, content
	//     on origin source should be available for the CDN both through HTTP and HTTPS
	//     protocols.
	//   - **null** - `originProtocol` setting is inherited from the CDN resource
	//     settings.
	//
	// If an enabled origin among the origins this rule pulls from is bound to a Gcore
	// Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OverrideOriginProtocol RuleTemplateUpdateParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
	// List of options that can be configured for the rule.
	//
	// In case of `null` value the option is not added to the rule. Option inherits its
	// value from the CDN resource settings.
	Options RuleTemplateUpdateParamsOptions `json:"options,omitzero"`
	// contains filtered or unexported fields
}

func (RuleTemplateUpdateParams) MarshalJSON

func (r RuleTemplateUpdateParams) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParams) UnmarshalJSON

func (r *RuleTemplateUpdateParams) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptions

type RuleTemplateUpdateParamsOptions struct {
	// HTTP methods allowed for content requests from the CDN.
	AllowedHTTPMethods RuleTemplateUpdateParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
	// Compresses content with Brotli on the CDN side. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. CDN only supports "Brotli compression" when the "origin shielding" feature is
	//     activated.
	//  2. If a precache server is not active for a CDN resource, no compression occurs,
	//     even if the option is enabled.
	//  3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  4. `fetch_compressed` option in CDN resource settings overrides
	//     `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
	//     resource and want to enable `brotli_compression` in a rule, you must specify
	//     `fetch_compressed:false` in the rule.
	BrotliCompression RuleTemplateUpdateParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
	// Cache expiration time for users browsers in seconds.
	//
	// Cache expiration time is applied to the following response codes: 200, 201, 204,
	// 206, 301, 302, 303, 304, 307, 308.
	//
	// Responses with other codes will not be cached.
	BrowserCacheSettings RuleTemplateUpdateParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
	// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
	//
	// HTTP Headers that must be included in the response.
	//
	// Deprecated: deprecated
	CacheHTTPHeaders RuleTemplateUpdateParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
	// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
	//
	// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
	// to a response to a browser.
	Cors RuleTemplateUpdateParamsOptionsCors `json:"cors,omitzero"`
	// Enables control access to content for specified countries.
	CountryACL RuleTemplateUpdateParamsOptionsCountryACL `json:"country_acl,omitzero"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache RuleTemplateUpdateParamsOptionsDisableCache `json:"disable_cache,omitzero"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges RuleTemplateUpdateParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings RuleTemplateUpdateParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_headers_after_cache`,
	// `on_request_body`, `on_response_headers`, or `on_response_body` must be
	// specified.
	Fastedge RuleTemplateUpdateParamsOptionsFastedge `json:"fastedge,omitzero"`
	// Makes the CDN request compressed content from the origin.
	//
	// The origin server should support compression. CDN servers will not decompress
	// your content even if a user browser does not accept compression.
	//
	// Notes:
	//
	//  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
	//     `slice` options enabled.
	//  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
	//     you enable it in CDN resource and want to use `gzipON` and
	//     `brotli_compression` in a rule, you have to specify
	//     `"fetch_compressed": false` in the rule.
	FetchCompressed RuleTemplateUpdateParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
	// Enables redirection from origin. If the origin server returns a redirect, the
	// option allows the CDN to pull the requested content from the origin server that
	// was returned in the redirect.
	FollowOriginRedirect RuleTemplateUpdateParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
	// Applies custom HTTP response codes for CDN content.
	//
	// The following codes are reserved by our system and cannot be specified in this
	// option: 408, 444, 477, 494, 495, 496, 497, 499.
	ForceReturn RuleTemplateUpdateParamsOptionsForceReturn `json:"force_return,omitzero"`
	// Forwards the Host header from a end-user request to an origin server.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	ForwardHostHeader RuleTemplateUpdateParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
	// Compresses content with gzip on the CDN end. CDN servers will request only
	// uncompressed content from the origin.
	//
	// Notes:
	//
	//  1. Compression with gzip is not supported with `fetch_compressed` or `slice`
	//     options enabled.
	//  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
	//     rules. If you enable `fetch_compressed` in CDN resource and want to enable
	//     `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
	GzipOn RuleTemplateUpdateParamsOptionsGzipOn `json:"gzipOn,omitzero"`
	// Sets the Host header that CDN servers use when request content from an origin
	// server. Your server must be able to process requests with the chosen header.
	//
	// If the option is `null`, the Host Header value is equal to first CNAME.
	//
	// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
	HostHeader RuleTemplateUpdateParamsOptionsHostHeader `json:"hostHeader,omitzero"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie RuleTemplateUpdateParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
	// How a file with different query strings is cached: either as one object (option
	// is enabled) or as different objects (option is disabled.)
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	IgnoreQueryString RuleTemplateUpdateParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
	// Transforms JPG and PNG images (for example, resize or crop) and automatically
	// converts them to WebP or AVIF format.
	ImageStack RuleTemplateUpdateParamsOptionsImageStack `json:"image_stack,omitzero"`
	// Controls access to the CDN resource content for specific IP addresses.
	//
	// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
	// you have to independently monitor their relevance.
	//
	// We recommend you use a script for automatically update IP ACL.
	// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
	IPAddressACL RuleTemplateUpdateParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
	// Allows to control the download speed per connection.
	LimitBandwidth RuleTemplateUpdateParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
	// Allows you to modify your cache key. If omitted, the default value is
	// `$request_uri`.
	//
	// Combine the specified variables to create a key for caching.
	//
	//   - **$`http_x_cdn_real_host`** — the original `Host` header sent by the client.
	//     Useful for splitting cache across multiple aliases served by a single CDN
	//     resource.
	//   - **$`request_uri`** — the full original request URI including the query string
	//     (e.g., `/path?id=1`).
	//   - **$scheme** — the request scheme, either `http` or `https`.
	//   - **$uri** — the normalized request URI without the query string (e.g.,
	//     `/path`).
	//
	// **Warning**: Enabling and changing this option can invalidate your current cache
	// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
	// not work.
	ProxyCacheKey RuleTemplateUpdateParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout RuleTemplateUpdateParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
	// The time limit for receiving a partial response from the origin. If no response
	// is received within this time, the connection will be closed.
	//
	// **Note:** When used with a WebSocket connection, this option supports values
	// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
	ProxyReadTimeout RuleTemplateUpdateParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
	// Files with the specified query parameters are cached as one object, files with
	// other parameters are cached as different objects.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsBlacklist RuleTemplateUpdateParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
	// Files with the specified query parameters are cached as different objects, files
	// with other parameters are cached as one object.
	//
	// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
	// options cannot be enabled simultaneously.
	QueryParamsWhitelist RuleTemplateUpdateParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
	// The Query String Forwarding feature allows for the seamless transfer of
	// parameters embedded in playlist files to the corresponding media chunk files.
	// This functionality ensures that specific attributes, such as authentication
	// tokens or tracking information, are consistently passed along from the playlist
	// manifest to the individual media segments. This is particularly useful for
	// maintaining continuity in security, analytics, and any other parameter-based
	// operations across the entire media delivery workflow.
	QueryStringForwarding RuleTemplateUpdateParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
	// Enables redirect from HTTP to HTTPS.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPToHTTPS RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
	// Enables redirect from HTTPS to HTTP.
	//
	// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
	// simultaneously.
	RedirectHTTPSToHTTP RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL RuleTemplateUpdateParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
	// Changes and redirects requests from the CDN to the origin. It operates according
	// to the
	// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
	// configuration.
	Rewrite RuleTemplateUpdateParamsOptionsRewrite `json:"rewrite,omitzero"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey RuleTemplateUpdateParamsOptionsSecureKey `json:"secure_key,omitzero"`
	// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
	// part.) This reduces time to first byte.
	//
	// The option is based on the
	// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
	//
	// Notes:
	//
	//  1. Origin must support HTTP Range requests.
	//  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
	//     options enabled.
	Slice RuleTemplateUpdateParamsOptionsSlice `json:"slice,omitzero"`
	// The hostname that is added to SNI requests from CDN servers to the origin server
	// via HTTPS.
	//
	// SNI is generally only required if your origin uses shared hosting or does not
	// have a dedicated IP address. If the origin server presents multiple
	// certificates, SNI allows the origin server to know which certificate to use for
	// the connection.
	//
	// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
	Sni RuleTemplateUpdateParamsOptionsSni `json:"sni,omitzero"`
	// Serves stale cached content in case of origin unavailability.
	Stale RuleTemplateUpdateParamsOptionsStale `json:"stale,omitzero"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders RuleTemplateUpdateParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
	// **Legacy option**. Use the `static_response_headers` option instead.
	//
	// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
	// Headers can be specified. May contain a header with multiple values.
	//
	// Deprecated: deprecated
	StaticHeaders RuleTemplateUpdateParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
	// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
	// Headers can be specified.
	StaticRequestHeaders RuleTemplateUpdateParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL RuleTemplateUpdateParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap RuleTemplateUpdateParamsOptionsWaap `json:"waap,omitzero"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets RuleTemplateUpdateParamsOptionsWebsockets `json:"websockets,omitzero"`
	// contains filtered or unexported fields
}

List of options that can be configured for the rule.

In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.

func (RuleTemplateUpdateParamsOptions) MarshalJSON

func (r RuleTemplateUpdateParamsOptions) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptions) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptions) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsAllowedHTTPMethods

type RuleTemplateUpdateParamsOptionsAllowedHTTPMethods struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

HTTP methods allowed for content requests from the CDN.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsAllowedHTTPMethods) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsBrotliCompression

type RuleTemplateUpdateParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to select the content types you want to compress.
	//
	// `text/html` is a mandatory content type.
	//
	// Any of "application/javascript", "application/json",
	// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
	// "application/x-javascript", "application/xml", "application/xml+rss",
	// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
	// "text/plain", "text/xml".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.

Notes:

  1. CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
  2. If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
  3. `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
  4. `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsBrotliCompression) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsBrotliCompression) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsBrowserCacheSettings

type RuleTemplateUpdateParamsOptionsBrowserCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value" api:"required" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for users browsers in seconds.

Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.

Responses with other codes will not be cached.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsBrowserCacheSettings) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsBrowserCacheSettings) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsCacheHTTPHeaders deprecated

type RuleTemplateUpdateParamsOptionsCacheHTTPHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool     `json:"enabled" api:"required"`
	Value   []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `response_headers_hiding_policy` option instead.

HTTP Headers that must be included in the response.

Deprecated: deprecated

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsCacheHTTPHeaders) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsCors

type RuleTemplateUpdateParamsOptionsCors struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Value of the Access-Control-Allow-Origin header.
	//
	// Possible values:
	//
	//   - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
	//     uploaded for requests from any domain. `"value": ["*"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
	//     origin matches one of the listed domains** - Content will be uploaded only for
	//     requests from the domains specified in the field.
	//     `"value": ["example.com", "example.org"]`
	//   - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
	//     Content will be uploaded for requests from any domain, and the domain from
	//     which the request was sent will be added to the "Access-Control-Allow-Origin"
	//     header in the response. `"value": ["$http_origin"]`
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the Access-Control-Allow-Origin header should be added to a
	// response from CDN regardless of response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response regardless of response code.
	//   - **false** - Header will only be added to responses with codes: 200, 201, 204,
	//     206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

Enables or disables CORS (Cross-Origin Resource Sharing) header support.

CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsCors) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsCors) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsCors) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsCors) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsCountryACL

type RuleTemplateUpdateParamsOptionsCountryACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of countries according to ISO-3166-1.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of countries for which access is prohibited.
	// - **deny** - List of countries for which access is allowed.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"country-code"`
	// Defines the type of CDN resource access policy.
	//
	// Possible values:
	//
	//   - **allow** - Access is allowed for all the countries except for those specified
	//     in `excepted_values` field.
	//   - **deny** - Access is denied for all the countries except for those specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Enables control access to content for specified countries.

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateUpdateParamsOptionsCountryACL) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsCountryACL) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsCountryACL) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsDisableCache deprecated

type RuleTemplateUpdateParamsOptionsDisableCache struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `edge_cache_settings` option instead.

Allows the complete disabling of content caching.

Deprecated: deprecated

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsDisableCache) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsDisableCache) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsDisableCache) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsDisableProxyForceRanges

type RuleTemplateUpdateParamsOptionsDisableProxyForceRanges struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows 206 responses regardless of the settings of an origin source.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsDisableProxyForceRanges) MarshalJSON

func (*RuleTemplateUpdateParamsOptionsDisableProxyForceRanges) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsEdgeCacheSettings

type RuleTemplateUpdateParamsOptionsEdgeCacheSettings struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables content caching according to the origin cache settings.
	//
	// The value is applied to the following response codes 200, 201, 204, 206, 301,
	// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
	//
	// Responses with other codes will not be cached.
	//
	// The maximum duration is any equivalent to `1y`.
	Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
	// Caching time.
	//
	// The value is applied to the following response codes: 200, 206, 301, 302.
	// Responses with codes 4xx, 5xx will not be cached.
	//
	// Use `0s` to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
	// A MAP object representing the caching time in seconds for a response with a
	// specific response code.
	//
	// These settings have a higher priority than the `value` field.
	//
	// - Use `any` key to specify caching time for all response codes.
	// - Use `0s` value to disable caching for a specific response code.
	CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
	// contains filtered or unexported fields
}

Cache expiration time for CDN servers.

`value` and `default` fields cannot be used simultaneously.

The property Enabled is required.

func (RuleTemplateUpdateParamsOptionsEdgeCacheSettings) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsEdgeCacheSettings) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsFastedge

type RuleTemplateUpdateParamsOptionsFastedge struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Allows to configure FastEdge application that will be called to handle request
	// body as soon as CDN receives incoming HTTP request.
	OnRequestBody RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **before cache**.
	OnRequestHeaders RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
	// Allows to configure FastEdge application that will be called to handle request
	// headers as soon as CDN receives incoming HTTP request, **after cache**.
	OnRequestHeadersAfterCache RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache `json:"on_request_headers_after_cache,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// body before CDN sends the HTTP response.
	OnResponseBody RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
	// Allows to configure FastEdge application that will be called to handle response
	// headers before CDN sends the HTTP response.
	OnResponseHeaders RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge app to be called on different request/response phases.

Note: At least one of `on_request_headers`, `on_request_headers_after_cache`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.

The property Enabled is required.

func (RuleTemplateUpdateParamsOptionsFastedge) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsFastedge) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsFastedge) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsFastedge) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody

type RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.

The property AppID is required.

func (RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders

type RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **before cache**.

The property AppID is required.

func (RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON

func (*RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache added in v0.50.0

type RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request, **after cache**.

The property AppID is required.

func (RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache) MarshalJSON added in v0.50.0

func (*RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeadersAfterCache) UnmarshalJSON added in v0.50.0

type RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody

type RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.

The property AppID is required.

func (RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody) MarshalJSON

func (*RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders

type RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id" api:"required"`
	// Determines if the FastEdge application should be called whenever HTTP request
	// headers are received.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Determines if the request should be executed at the edge nodes.
	ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
	// Determines if the request should be executed at the shield nodes.
	ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
	// Determines if the request execution should be interrupted when an error occurs.
	InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
	// contains filtered or unexported fields
}

Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.

The property AppID is required.

func (RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders) MarshalJSON

func (*RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsFetchCompressed

type RuleTemplateUpdateParamsOptionsFetchCompressed struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Makes the CDN request compressed content from the origin.

The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.

Notes:

  1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
  2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsFetchCompressed) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsFetchCompressed) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsFollowOriginRedirect

type RuleTemplateUpdateParamsOptionsFollowOriginRedirect struct {
	// Redirect status code that the origin server returns.
	//
	// To serve up to date content to end users, you will need to purge the cache after
	// managing the option.
	//
	// Any of 301, 302, 303, 307, 308.
	Codes []int64 `json:"codes,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// contains filtered or unexported fields
}

Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.

The properties Codes, Enabled are required.

func (RuleTemplateUpdateParamsOptionsFollowOriginRedirect) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsFollowOriginRedirect) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsForceReturn

type RuleTemplateUpdateParamsOptionsForceReturn struct {
	// URL for redirection or text.
	Body string `json:"body" api:"required"`
	// Status code value.
	Code int64 `json:"code" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Controls the time at which a custom HTTP response code should be applied. By
	// default, a custom HTTP response code is applied at any time.
	TimeInterval RuleTemplateUpdateParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
	// contains filtered or unexported fields
}

Applies custom HTTP response codes for CDN content.

The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.

The properties Body, Code, Enabled are required.

func (RuleTemplateUpdateParamsOptionsForceReturn) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsForceReturn) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsForceReturn) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsForceReturnTimeInterval

type RuleTemplateUpdateParamsOptionsForceReturnTimeInterval struct {
	// Time until which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	EndTime string `json:"end_time" api:"required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time" api:"required"`
	// Time zone used to calculate time.
	TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
	// contains filtered or unexported fields
}

Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.

The properties EndTime, StartTime are required.

func (RuleTemplateUpdateParamsOptionsForceReturnTimeInterval) MarshalJSON

func (*RuleTemplateUpdateParamsOptionsForceReturnTimeInterval) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsForwardHostHeader

type RuleTemplateUpdateParamsOptionsForwardHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Forwards the Host header from a end-user request to an origin server.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsForwardHostHeader) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsForwardHostHeader) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsGzipOn

type RuleTemplateUpdateParamsOptionsGzipOn struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.

Notes:

  1. Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
  2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsGzipOn) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsGzipOn) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsGzipOn) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsHostHeader

type RuleTemplateUpdateParamsOptionsHostHeader struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Host Header value.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.

If the option is `null`, the Host Header value is equal to first CNAME.

`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsHostHeader) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsHostHeader) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsHostHeader) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsIPAddressACL

type RuleTemplateUpdateParamsOptionsIPAddressACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of IP addresses with a subnet mask.
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of IP addresses for which access is prohibited.
	// - **deny** - List of IP addresses for which access is allowed.
	//
	// Examples:
	//
	// - `192.0.2.10/32`
	// - `2001:db8::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"ipv4net or ipv6net"`
	// IP access policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
	//     field.
	//   - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
	//     field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specific IP addresses.

If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance.

We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateUpdateParamsOptionsIPAddressACL) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsIPAddressACL) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsIgnoreCookie

type RuleTemplateUpdateParamsOptionsIgnoreCookie struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	//   - **true** - Option is enabled, files with cookies are cached as one file.
	//   - **false** - Option is disabled, files with cookies are cached as different
	//     files.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Defines whether the files with the Set-Cookies header are cached as one file or as different ones.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsIgnoreCookie) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsIgnoreCookie) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsIgnoreQueryString

type RuleTemplateUpdateParamsOptionsIgnoreQueryString struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsIgnoreQueryString) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsIgnoreQueryString) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsImageStack

type RuleTemplateUpdateParamsOptionsImageStack struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
	AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
	// Enables or disables compression without quality loss for PNG format.
	PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
	// Defines quality settings for JPG and PNG images. The higher the value, the
	// better the image quality, and the larger the file size after conversion.
	Quality param.Opt[int64] `json:"quality,omitzero"`
	// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
	WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
	// contains filtered or unexported fields
}

Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.

The property Enabled is required.

func (RuleTemplateUpdateParamsOptionsImageStack) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsImageStack) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsImageStack) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsImageStack) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsLimitBandwidth

type RuleTemplateUpdateParamsOptionsLimitBandwidth struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Method of controlling the download speed per connection.
	//
	// Possible values:
	//
	//   - **static** - Use speed and buffer fields to set the download speed limit.
	//   - **dynamic** - Use query strings **speed** and **buffer** to set the download
	//     speed limit.
	//
	// # For example, when requesting content at the link
	//
	// “`
	// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
	// “`
	//
	// the download speed will be limited to 50kB/s after 500 kB.
	//
	// Any of "static", "dynamic".
	LimitType string `json:"limit_type,omitzero" api:"required"`
	// Amount of downloaded data after which the user will be rate limited.
	Buffer param.Opt[int64] `json:"buffer,omitzero"`
	// Maximum download speed per connection.
	Speed param.Opt[int64] `json:"speed,omitzero"`
	// contains filtered or unexported fields
}

Allows to control the download speed per connection.

The properties Enabled, LimitType are required.

func (RuleTemplateUpdateParamsOptionsLimitBandwidth) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsLimitBandwidth) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsProxyCacheKey

type RuleTemplateUpdateParamsOptionsProxyCacheKey struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Key for caching.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows you to modify your cache key. If omitted, the default value is `$request_uri`.

Combine the specified variables to create a key for caching.

  • **$`http_x_cdn_real_host`** — the original `Host` header sent by the client. Useful for splitting cache across multiple aliases served by a single CDN resource.
  • **$`request_uri`** — the full original request URI including the query string (e.g., `/path?id=1`).
  • **$scheme** — the request scheme, either `http` or `https`.
  • **$uri** — the normalized request URI without the query string (e.g., `/path`).

**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsProxyCacheKey) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsProxyCacheKey) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet

type RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Caching for POST requests along with default GET and HEAD.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsProxyConnectTimeout

type RuleTemplateUpdateParamsOptionsProxyConnectTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for establishing a connection with the origin.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsProxyConnectTimeout) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsProxyConnectTimeout) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsProxyReadTimeout

type RuleTemplateUpdateParamsOptionsProxyReadTimeout struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value" api:"required"`
	// contains filtered or unexported fields
}

The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.

**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsProxyReadTimeout) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsProxyReadTimeout) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsQueryParamsBlacklist

type RuleTemplateUpdateParamsOptionsQueryParamsBlacklist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsQueryParamsBlacklist) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsQueryParamsWhitelist

type RuleTemplateUpdateParamsOptionsQueryParamsWhitelist struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of query parameters.
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.

`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsQueryParamsWhitelist) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsQueryStringForwarding

type RuleTemplateUpdateParamsOptionsQueryStringForwarding struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// The `forward_from_files_types` field specifies the types of playlist files from
	// which parameters will be extracted and forwarded. This typically includes
	// formats that list multiple media chunk references, such as HLS and DASH
	// playlists. Parameters associated with these playlist files (like query strings
	// or headers) will be propagated to the chunks they reference.
	ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero" api:"required"`
	// The field specifies the types of media chunk files to which parameters,
	// extracted from playlist files, will be forwarded. These refer to the actual
	// segments of media content that are delivered to viewers. Ensuring the correct
	// parameters are forwarded to these files is crucial for maintaining the integrity
	// of the streaming session.
	ForwardToFileTypes []string `json:"forward_to_file_types,omitzero" api:"required"`
	// The `forward_except_keys` field provides a mechanism to exclude specific
	// parameters from being forwarded from playlist files to media chunk files. By
	// listing certain keys in this field, you can ensure that these parameters are
	// omitted during the forwarding process. This is particularly useful for
	// preventing sensitive or irrelevant information from being included in requests
	// for media chunks, thereby enhancing security and optimizing performance.
	ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
	// The `forward_only_keys` field allows for granular control over which specific
	// parameters are forwarded from playlist files to media chunk files. By specifying
	// certain keys, only those parameters will be propagated, ensuring that only
	// relevant information is passed along. This is particularly useful for security
	// and performance optimization, as it prevents unnecessary or sensitive data from
	// being included in requests for media chunks.
	ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
	// contains filtered or unexported fields
}

The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.

The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.

func (RuleTemplateUpdateParamsOptionsQueryStringForwarding) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsQueryStringForwarding) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP

type RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTPS to HTTP.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS

type RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables redirect from HTTP to HTTPS.

`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsReferrerACL

type RuleTemplateUpdateParamsOptionsReferrerACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of domain names or wildcard domains (without protocol: `http://` or
	// `https://`.)
	//
	// The meaning of the parameter depends on `policy_type` value:
	//
	// - **allow** - List of domain names for which access is prohibited.
	// - **deny** - List of IP domain names for which access is allowed.
	//
	// Examples:
	//
	// - `example.com`
	// - `*.example.com`
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"domain or wildcard"`
	// Policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//   - **deny** - Deny access to all domain names except the domain names specified
	//     in `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the CDN resource content for specified domain names.

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateUpdateParamsOptionsReferrerACL) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsReferrerACL) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy

type RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of HTTP headers.
	//
	// Parameter meaning depends on the value of the `mode` field:
	//
	//   - **show** - List of HTTP headers to hide from response.
	//   - **hide** - List of HTTP headers to include in response. Other HTTP headers
	//     will be hidden.
	//
	// The following headers are required and cannot be hidden from response:
	//
	// - `Connection`
	// - `Content-Length`
	// - `Content-Type`
	// - `Date`
	// - `Server`
	Excepted []string `json:"excepted,omitzero" api:"required" format:"http_header"`
	// How HTTP headers are hidden from the response.
	//
	// Possible values:
	//
	//   - **show** - Hide only HTTP headers listed in the `excepted` field.
	//   - **hide** - Hide all HTTP headers except headers listed in the "excepted"
	//     field.
	//
	// Any of "hide", "show".
	Mode string `json:"mode,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Hides HTTP headers from an origin server in the CDN response.

The properties Enabled, Excepted, Mode are required.

func (RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy) MarshalJSON

func (*RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsRewrite

type RuleTemplateUpdateParamsOptionsRewrite struct {
	// Path for the Rewrite option.
	//
	// Example:
	//
	// - `/(.*) /media/$1`
	Body string `json:"body" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Flag for the Rewrite option.
	//
	// Possible values:
	//
	//   - **last** - Stop processing the current set of `ngx_http_rewrite_module`
	//     directives and start a search for a new location matching changed URI.
	//   - **break** - Stop processing the current set of the Rewrite option.
	//   - **redirect** - Return a temporary redirect with the 302 code; used when a
	//     replacement string does not start with `http://`, `https://`, or `$scheme`.
	//   - **permanent** - Return a permanent redirect with the 301 code.
	//
	// Any of "break", "last", "redirect", "permanent".
	Flag string `json:"flag,omitzero"`
	// contains filtered or unexported fields
}

Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.

The properties Body, Enabled are required.

func (RuleTemplateUpdateParamsOptionsRewrite) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsRewrite) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsRewrite) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsRewrite) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsSecureKey

type RuleTemplateUpdateParamsOptionsSecureKey struct {
	// Key generated on your side that will be used for URL signing.
	Key param.Opt[string] `json:"key,omitzero" api:"required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Type of URL signing.
	//
	// Possible types:
	//
	// - **Type 0** - Includes end user IP to secure token generation.
	// - **Type 2** - Excludes end user IP from secure token generation.
	//
	// Any of 0, 2.
	Type int64 `json:"type,omitzero"`
	// contains filtered or unexported fields
}

Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.

The properties Enabled, Key are required.

func (RuleTemplateUpdateParamsOptionsSecureKey) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsSecureKey) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsSecureKey) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsSlice

type RuleTemplateUpdateParamsOptionsSlice struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.

The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.

Notes:

  1. Origin must support HTTP Range requests.
  2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsSlice) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsSlice) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsSlice) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsSlice) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsSni

type RuleTemplateUpdateParamsOptionsSni struct {
	// Custom SNI hostname.
	//
	// It is required if `sni_type` is set to custom.
	CustomHostname string `json:"custom_hostname" api:"required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// SNI (Server Name Indication) type.
	//
	// Possible values:
	//
	//   - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
	//     options. It has several possible combinations:
	//   - If the `hostHeader` option is enabled and specified, SNI hostname matches
	//     the Host header.
	//   - If the `forward_host_header` option is enabled and has true value, SNI
	//     hostname matches the Host header used in the request made to a CDN.
	//   - If the `hostHeader` and `forward_host_header` options are disabled, SNI
	//     hostname matches the primary CNAME.
	//   - **custom** - custom SNI hostname is in use.
	//
	// Any of "dynamic", "custom".
	SniType string `json:"sni_type,omitzero"`
	// contains filtered or unexported fields
}

The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.

SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.

The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.

The properties CustomHostname, Enabled are required.

func (RuleTemplateUpdateParamsOptionsSni) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsSni) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsSni) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsSni) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsStale

type RuleTemplateUpdateParamsOptionsStale struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Defines list of errors for which "Always online" option is applied.
	//
	// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
	// "http_503", "http_504", "invalid_header", "timeout", "updating".
	Value []string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Serves stale cached content in case of origin unavailability.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsStale) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsStale) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsStale) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsStale) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsStaticHeaders deprecated

type RuleTemplateUpdateParamsOptionsStaticHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value any `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

**Legacy option**. Use the `static_response_headers` option instead.

Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.

Deprecated: deprecated

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsStaticHeaders) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsStaticHeaders) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsStaticRequestHeaders

type RuleTemplateUpdateParamsOptionsStaticRequestHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// A MAP for static headers in a format of `header_name: header_value`.
	//
	// Restrictions:
	//
	//   - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
	//     numbers (0-9), dashes, and underscores.
	//   - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
	//     (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
	//     with a letter, number, asterisk or {.
	Value map[string]string `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsStaticRequestHeaders) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsStaticRequestHeaders) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsStaticResponseHeaders

type RuleTemplateUpdateParamsOptionsStaticResponseHeaders struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool                                                        `json:"enabled" api:"required"`
	Value   []RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Custom HTTP Headers that a CDN server adds to a response.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsStaticResponseHeaders) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsStaticResponseHeaders) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue

type RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue struct {
	// HTTP Header name.
	//
	// Restrictions:
	//
	// - Maximum 128 symbols.
	// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
	Name string `json:"name" api:"required"`
	// Header value.
	//
	// Restrictions:
	//
	//   - Maximum 512 symbols.
	//   - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
	//     /|\";:?.,><{}[]).
	//   - Must start with a letter, number, asterisk or {.
	//   - Multiple values can be added.
	Value []string `json:"value,omitzero" api:"required"`
	// Defines whether the header will be added to a response from CDN regardless of
	// response code.
	//
	// Possible values:
	//
	//   - **true** - Header will be added to a response from CDN regardless of response
	//     code.
	//   - **false** - Header will be added only to the following response codes: 200,
	//     201, 204, 206, 301, 302, 303, 304, 307, 308.
	Always param.Opt[bool] `json:"always,omitzero"`
	// contains filtered or unexported fields
}

The properties Name, Value are required.

func (RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue) MarshalJSON

func (*RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsUserAgentACL

type RuleTemplateUpdateParamsOptionsUserAgentACL struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// List of User-Agents that will be allowed/denied.
	//
	// The meaning of the parameter depends on `policy_type`:
	//
	// - **allow** - List of User-Agents for which access is prohibited.
	// - **deny** - List of User-Agents for which access is allowed.
	//
	// You can provide exact User-Agent strings or regular expressions. Regular
	// expressions must start with `~` (case-sensitive) or `~*` (case-insensitive).
	//
	// Use an empty string `""` to allow/deny access when the User-Agent header is
	// empty.
	ExceptedValues []string `json:"excepted_values,omitzero" api:"required" format:"user_agent"`
	// User-Agents policy type.
	//
	// Possible values:
	//
	//   - **allow** - Allow access for all User-Agents except specified in
	//     `excepted_values` field.
	//   - **deny** - Deny access for all User-Agents except specified in
	//     `excepted_values` field.
	//
	// Any of "allow", "deny".
	PolicyType string `json:"policy_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Controls access to the content for specified User-Agents.

The properties Enabled, ExceptedValues, PolicyType are required.

func (RuleTemplateUpdateParamsOptionsUserAgentACL) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsUserAgentACL) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsWaap

type RuleTemplateUpdateParamsOptionsWaap struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Allows to enable WAAP (Web Application and API Protection).

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsWaap) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsWaap) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsWaap) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsWaap) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOptionsWebsockets

type RuleTemplateUpdateParamsOptionsWebsockets struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled" api:"required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value" api:"required"`
	// contains filtered or unexported fields
}

Enables or disables WebSockets connections to an origin server.

The properties Enabled, Value are required.

func (RuleTemplateUpdateParamsOptionsWebsockets) MarshalJSON

func (r RuleTemplateUpdateParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)

func (*RuleTemplateUpdateParamsOptionsWebsockets) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsWebsockets) UnmarshalJSON(data []byte) error

type RuleTemplateUpdateParamsOverrideOriginProtocol

type RuleTemplateUpdateParamsOverrideOriginProtocol string

Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.

Possible values:

  • **HTTPS** - CDN servers connect to origin via HTTPS protocol.
  • **HTTP** - CDN servers connect to origin via HTTP protocol.
  • **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
  • **null** - `originProtocol` setting is inherited from the CDN resource settings.

If an enabled origin among the origins this rule pulls from is bound to a Gcore Object Storage (`s3_type` is `gcore`), HTTPS is used regardless of this setting.

const (
	RuleTemplateUpdateParamsOverrideOriginProtocolHTTPS RuleTemplateUpdateParamsOverrideOriginProtocol = "HTTPS"
	RuleTemplateUpdateParamsOverrideOriginProtocolHTTP  RuleTemplateUpdateParamsOverrideOriginProtocol = "HTTP"
	RuleTemplateUpdateParamsOverrideOriginProtocolMatch RuleTemplateUpdateParamsOverrideOriginProtocol = "MATCH"
)

type ShieldAggregatedStats

type ShieldAggregatedStats struct {
	// CDN resource ID for which statistics data is shown.
	Number1Example any `json:"1 (example)"`
	// Statistics parameters.
	Metrics any `json:"metrics"`
	// Resources IDs by which statistics data is grouped.
	Resource any `json:"resource"`
	// Number of CDN resources that used origin shielding.
	ShieldUsage string `json:"shield_usage"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Number1Example respjson.Field
		Metrics        respjson.Field
		Resource       respjson.Field
		ShieldUsage    respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ShieldAggregatedStats) RawJSON

func (r ShieldAggregatedStats) RawJSON() string

Returns the unmodified JSON received from the API

func (*ShieldAggregatedStats) UnmarshalJSON

func (r *ShieldAggregatedStats) UnmarshalJSON(data []byte) error

type ShieldingLocation added in v0.53.0

type ShieldingLocation struct {
	// Origin shielding location ID.
	ID int64 `json:"id"`
	// City of origin shielding location.
	City string `json:"city"`
	// Country of origin shielding location.
	Country string `json:"country"`
	// Name of origin shielding location datacenter.
	Datacenter string `json:"datacenter"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		City        respjson.Field
		Country     respjson.Field
		Datacenter  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ShieldingLocation) RawJSON added in v0.53.0

func (r ShieldingLocation) RawJSON() string

Returns the unmodified JSON received from the API

func (*ShieldingLocation) UnmarshalJSON added in v0.53.0

func (r *ShieldingLocation) UnmarshalJSON(data []byte) error

type ShieldingLocationList added in v0.53.0

type ShieldingLocationList struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string              `json:"previous" api:"required"`
	Results  []ShieldingLocation `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ShieldingLocationList) RawJSON added in v0.53.0

func (r ShieldingLocationList) RawJSON() string

Returns the unmodified JSON received from the API

func (*ShieldingLocationList) UnmarshalJSON added in v0.53.0

func (r *ShieldingLocationList) UnmarshalJSON(data []byte) error

type ShieldingLocationListParams added in v0.53.0

type ShieldingLocationListParams struct {
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ShieldingLocationListParams) URLQuery added in v0.53.0

func (r ShieldingLocationListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ShieldingLocationListParams's query parameters as `url.Values`.

type ShieldingLocationService added in v0.53.0

type ShieldingLocationService struct {
	Options []option.RequestOption
}

CDN origin shielding locations are the available shield (precache) points of presence that can be referenced when configuring origin shielding for a CDN resource.

ShieldingLocationService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewShieldingLocationService method instead.

func NewShieldingLocationService added in v0.53.0

func NewShieldingLocationService(opts ...option.RequestOption) (r ShieldingLocationService)

NewShieldingLocationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ShieldingLocationService) List added in v0.53.0

Get information about all origin shielding locations available in the account.

func (*ShieldingLocationService) ListAutoPaging added in v0.53.0

Get information about all origin shielding locations available in the account.

type SslCertificateUsage added in v0.58.0

type SslCertificateUsage struct {
	// Aliases that have this certificate attached, including one in the process of
	// issuance.
	Aliases []SslCertificateUsageAlias `json:"aliases" api:"required"`
	// CDN resources that have this certificate attached.
	Resources []SslCertificateUsageResource `json:"resources" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Aliases     respjson.Field
		Resources   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

List of CDN resources and aliases using this SSL certificate.

func (SslCertificateUsage) RawJSON added in v0.58.0

func (r SslCertificateUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*SslCertificateUsage) UnmarshalJSON added in v0.58.0

func (r *SslCertificateUsage) UnmarshalJSON(data []byte) error

type SslCertificateUsageAlias added in v0.58.0

type SslCertificateUsageAlias struct {
	// Alias ID.
	ID int64 `json:"id" api:"required"`
	// Alias hostname.
	Cname string `json:"cname" api:"required"`
	// Alias status.
	//
	// Possible values:
	//
	//   - `inactive` – The alias or its CDN resource is disabled; the alias is not
	//     served.
	//   - `pending` – The alias configuration has not reached the CDN yet.
	//   - `http_only` – The alias is served over HTTP only.
	//   - `active` – The alias is served over HTTP and HTTPS.
	//
	// Any of "inactive", "pending", "http_only", "active".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Cname       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SslCertificateUsageAlias) RawJSON added in v0.58.0

func (r SslCertificateUsageAlias) RawJSON() string

Returns the unmodified JSON received from the API

func (*SslCertificateUsageAlias) UnmarshalJSON added in v0.58.0

func (r *SslCertificateUsageAlias) UnmarshalJSON(data []byte) error

type SslCertificateUsageResource added in v0.58.0

type SslCertificateUsageResource struct {
	// CDN resource ID.
	ID int64 `json:"id" api:"required"`
	// CDN resource CNAME (primary hostname).
	Cname string `json:"cname" api:"required"`
	// CDN resource status.
	//
	// Possible values:
	//
	//   - **active** - CDN resource is active. Content is available to users.
	//   - **suspended** - CDN resource is suspended. Content is not available to users.
	//   - **processed** - CDN resource has recently been created and is currently being
	//     processed. It will take about fifteen minutes to propagate it to all
	//     locations.
	//   - **deleted** - CDN resource is deleted.
	//
	// Any of "active", "suspended", "processed", "deleted".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Cname       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SslCertificateUsageResource) RawJSON added in v0.58.0

func (r SslCertificateUsageResource) RawJSON() string

Returns the unmodified JSON received from the API

func (*SslCertificateUsageResource) UnmarshalJSON added in v0.58.0

func (r *SslCertificateUsageResource) UnmarshalJSON(data []byte) error

type SslDetail

type SslDetail struct {
	// SSL certificate ID.
	ID int64 `json:"id"`
	// How the SSL certificate was issued.
	//
	// Possible values:
	//
	// - **true** - Certificate was issued automatically.
	// - **false** - Certificate was added by a use.
	Automated bool `json:"automated"`
	// Name of the certification center issued the SSL certificate.
	CertIssuer string `json:"cert_issuer"`
	// Alternative domain names that the SSL certificate secures.
	CertSubjectAlt string `json:"cert_subject_alt"`
	// Domain name that the SSL certificate secures.
	CertSubjectCn string `json:"cert_subject_cn"`
	// Defines whether the certificate has been deleted. Parameter is **deprecated**.
	//
	// Possible values:
	//
	// - **true** - Certificate has been deleted.
	// - **false** - Certificate has not been deleted.
	Deleted bool `json:"deleted"`
	// Defines whether the SSL certificate is used by a CDN resource or an alias.
	//
	// Possible values:
	//
	// - **true** - Certificate is used by a CDN resource or an alias.
	// - **false** - Certificate is not used by a CDN resource or an alias.
	HasRelatedResources bool `json:"hasRelatedResources"`
	// SSL certificate name.
	Name string `json:"name"`
	// Parameter is **deprecated**.
	SslCertificateChain string `json:"sslCertificateChain"`
	// Date when certificate become untrusted (ISO 8601/RFC 3339 format, UTC.)
	ValidityNotAfter string `json:"validity_not_after"`
	// Date when certificate become valid (ISO 8601/RFC 3339 format, UTC.)
	ValidityNotBefore string `json:"validity_not_before"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		Automated           respjson.Field
		CertIssuer          respjson.Field
		CertSubjectAlt      respjson.Field
		CertSubjectCn       respjson.Field
		Deleted             respjson.Field
		HasRelatedResources respjson.Field
		Name                respjson.Field
		SslCertificateChain respjson.Field
		ValidityNotAfter    respjson.Field
		ValidityNotBefore   respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SslDetail) RawJSON

func (r SslDetail) RawJSON() string

Returns the unmodified JSON received from the API

func (*SslDetail) UnmarshalJSON

func (r *SslDetail) UnmarshalJSON(data []byte) error

type SslDetailList

type SslDetailList struct {
	// Total number of items.
	Count int64 `json:"count" api:"required"`
	// URL to the next page of results. Null if current page is the last one.
	Next string `json:"next" api:"required"`
	// URL to the previous page of results. Null if current page is the first one.
	Previous string      `json:"previous" api:"required"`
	Results  []SslDetail `json:"results" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		Next        respjson.Field
		Previous    respjson.Field
		Results     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SslDetailList) RawJSON added in v0.51.0

func (r SslDetailList) RawJSON() string

Returns the unmodified JSON received from the API

func (*SslDetailList) UnmarshalJSON added in v0.51.0

func (r *SslDetailList) UnmarshalJSON(data []byte) error

type SslRequestStatus

type SslRequestStatus struct {
	// ID of the attempt to issue a Let's Encrypt certificate.
	ID int64 `json:"id"`
	// Defines whether the Let's Encrypt certificate issuing process is active.
	//
	// Possible values:
	//
	// - `true` – Issuing process is active.
	// - `false` – Issuing process is completed.
	Active bool `json:"active"`
	// Number of attempts to issue the Let's Encrypt certificate.
	AttemptsCount int64 `json:"attempts_count"`
	// Date when the process of issuing a Let's Encrypt certificate was finished (ISO
	// 8601/RFC 3339 format, UTC).
	//
	// The field is `null` if the issuing process is not finished.
	Finished string `json:"finished" api:"nullable"`
	// Detailed information about last attempt to issue a Let's Encrypt certificate.
	//
	// The field is `null` until the first attempt of the issuing process has been
	// recorded.
	LatestStatus SslRequestStatusLatestStatus `json:"latest_status" api:"nullable"`
	// Time of the next scheduled attempt to issue the Let's Encrypt certificate (ISO
	// 8601/RFC 3339 format, UTC).
	NextAttemptTime string `json:"next_attempt_time" api:"nullable"`
	// CDN resource ID.
	Resource int64 `json:"resource"`
	// Date when the process of issuing a Let's Encrypt certificate was started (ISO
	// 8601/RFC 3339 format, UTC).
	Started string `json:"started"`
	// Detailed information about attempts to issue a Let's Encrypt certificate.
	Statuses []SslRequestStatusStatus `json:"statuses"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Active          respjson.Field
		AttemptsCount   respjson.Field
		Finished        respjson.Field
		LatestStatus    respjson.Field
		NextAttemptTime respjson.Field
		Resource        respjson.Field
		Started         respjson.Field
		Statuses        respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SslRequestStatus) RawJSON

func (r SslRequestStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*SslRequestStatus) UnmarshalJSON

func (r *SslRequestStatus) UnmarshalJSON(data []byte) error

type SslRequestStatusLatestStatus

type SslRequestStatusLatestStatus struct {
	// ID of the attempt to issue the Let's Encrypt certificate.
	ID int64 `json:"id"`
	// Date and time when the issuing attempt status was created (ISO 8601/RFC 3339
	// format, UTC).
	Created string `json:"created"`
	// Detailed description of the error that occurred when trying to issue a Let's
	// Encrypt certificate.
	Details string `json:"details"`
	// Brief description of the error that occurred when trying to issue a Let's
	// Encrypt certificate.
	Error string `json:"error"`
	// Date indicating when the certificate issuance limit will be lifted (ISO 8601/RFC
	// 3339 format, UTC).
	//
	// It is filled in only if error = RateLimited.
	RetryAfter string `json:"retry_after"`
	// Status of the attempt to issue the Let's Encrypt certificate.
	//
	// Possible values:
	//
	//   - `DONE` – Attempt is successful. Let's Encrypt certificate was issued.
	//   - `FAILED` – Attempt failed. Let's Encrypt certificate was not issued.
	//   - `CANCELLED` – Attempt is cancelled. Let's Encrypt certificate was not issued.
	//   - `FORBIDDEN` – Issuing of Let's Encrypt certificates is disabled for your
	//     account. Let's Encrypt certificate was not issued.
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		Details     respjson.Field
		Error       respjson.Field
		RetryAfter  respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detailed information about last attempt to issue a Let's Encrypt certificate.

The field is `null` until the first attempt of the issuing process has been recorded.

func (SslRequestStatusLatestStatus) RawJSON

Returns the unmodified JSON received from the API

func (*SslRequestStatusLatestStatus) UnmarshalJSON

func (r *SslRequestStatusLatestStatus) UnmarshalJSON(data []byte) error

type SslRequestStatusStatus

type SslRequestStatusStatus struct {
	// ID of the attempt to issue the Let's Encrypt certificate.
	ID int64 `json:"id"`
	// Date and time when the issuing attempt status was created (ISO 8601/RFC 3339
	// format, UTC).
	Created string `json:"created"`
	// Detailed description of the error that occurred when trying to issue a Let's
	// Encrypt certificate.
	Details string `json:"details"`
	// Brief description of the error that occurred when trying to issue a Let's
	// Encrypt certificate.
	Error string `json:"error"`
	// Date indicating when the certificate issuance limit will be lifted (ISO 8601/RFC
	// 3339 format, UTC).
	//
	// It is filled in only if error = RateLimited.
	RetryAfter string `json:"retry_after"`
	// Status of the attempt to issue the Let's Encrypt certificate.
	//
	// Possible values:
	//
	//   - `DONE` – Attempt is successful. Let's Encrypt certificate was issued.
	//   - `FAILED` – Attempt failed. Let's Encrypt certificate was not issued.
	//   - `CANCELLED` – Attempt is cancelled. Let's Encrypt certificate was not issued.
	//   - `FORBIDDEN` – Issuing of Let's Encrypt certificates is disabled for your
	//     account. Let's Encrypt certificate was not issued.
	Status string `json:"status"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Created     respjson.Field
		Details     respjson.Field
		Error       respjson.Field
		RetryAfter  respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SslRequestStatusStatus) RawJSON

func (r SslRequestStatusStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*SslRequestStatusStatus) UnmarshalJSON

func (r *SslRequestStatusStatus) UnmarshalJSON(data []byte) error

type StatisticGetAliasUsageAggregatedParams added in v0.58.0

type StatisticGetAliasUsageAggregatedParams struct {
	// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	From string `query:"from" api:"required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to" api:"required" json:"-"`
	// The way the parameters are arranged in the response.
	//
	// Possible values:
	//
	// - **true** – Flat structure is used.
	// - **false** – Embedded structure is used (default.)
	Flat param.Opt[bool] `query:"flat,omitzero" json:"-"`
	// Output data grouping.
	//
	// Possible value:
	//
	// - **resource** - Data is grouped by CDN resources.
	GroupBy param.Opt[string] `query:"group_by,omitzero" json:"-"`
	// CDN resources IDs by that statistics data is grouped.
	//
	// To request multiple values, use:
	//
	// - &resource=1&resource=2
	//
	// If CDN resource ID is not specified, data related to all CDN resources is
	// returned.
	Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (StatisticGetAliasUsageAggregatedParams) URLQuery added in v0.58.0

URLQuery serializes StatisticGetAliasUsageAggregatedParams's query parameters as `url.Values`.

type StatisticGetLogsUsageAggregatedParams

type StatisticGetLogsUsageAggregatedParams struct {
	// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	From string `query:"from" api:"required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to" api:"required" json:"-"`
	// The way the parameters are arranged in the response.
	//
	// Possible values:
	//
	// - **true** – Flat structure is used.
	// - **false** – Embedded structure is used (default.)
	Flat param.Opt[bool] `query:"flat,omitzero" json:"-"`
	// Output data grouping.
	//
	// Possible value:
	//
	// - **resource** - Data is grouped by CDN resources.
	GroupBy param.Opt[string] `query:"group_by,omitzero" json:"-"`
	// CDN resources IDs by that statistics data is grouped.
	//
	// To request multiple values, use:
	//
	// - &resource=1&resource=2
	//
	// If CDN resource ID is not specified, data related to all CDN resources is
	// returned.
	Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (StatisticGetLogsUsageAggregatedParams) URLQuery

func (r StatisticGetLogsUsageAggregatedParams) URLQuery() (v url.Values, err error)

URLQuery serializes StatisticGetLogsUsageAggregatedParams's query parameters as `url.Values`.

type StatisticGetLogsUsageSeriesParams

type StatisticGetLogsUsageSeriesParams struct {
	// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	From string `query:"from" api:"required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to" api:"required" json:"-"`
	// CDN resources IDs by that statistics data is grouped.
	//
	// To request multiple values, use:
	//
	// - &resource=1&resource=2
	//
	// If CDN resource ID is not specified, data related to all CDN resources is
	// returned.
	Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (StatisticGetLogsUsageSeriesParams) URLQuery

func (r StatisticGetLogsUsageSeriesParams) URLQuery() (v url.Values, err error)

URLQuery serializes StatisticGetLogsUsageSeriesParams's query parameters as `url.Values`.

type StatisticGetResourceUsageAggregatedParams

type StatisticGetResourceUsageAggregatedParams struct {
	// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	From string `query:"from" api:"required" json:"-"`
	// Types of statistics data.
	//
	// Possible values:
	//
	//   - **`upstream_bytes`** – Traffic in bytes from an origin server to CDN servers
	//     or to origin shielding when used.
	//   - **`sent_bytes`** – Traffic in bytes from CDN servers to clients.
	//   - **`shield_bytes`** – Traffic in bytes from origin shielding to CDN servers.
	//   - **`backblaze_bytes`** - Traffic in bytes from Backblaze origin.
	//   - **`total_bytes`** – `shield_bytes`, `upstream_bytes` and `sent_bytes`
	//     combined.
	//   - **`cdn_bytes`** – `sent_bytes` and `shield_bytes` combined.
	//   - **requests** – Number of requests to edge servers.
	//   - **`responses_2xx`** – Number of 2xx response codes.
	//   - **`responses_3xx`** – Number of 3xx response codes.
	//   - **`responses_4xx`** – Number of 4xx response codes.
	//   - **`responses_5xx`** – Number of 5xx response codes.
	//   - **`responses_hit`** – Number of responses with the header Cache: HIT.
	//   - **`responses_miss`** – Number of responses with the header Cache: MISS.
	//   - **`response_types`** – Statistics by content type. It returns a number of
	//     responses for content with different MIME types.
	//   - **`cache_hit_traffic_ratio`** – Formula: 1 - `upstream_bytes` / `sent_bytes`.
	//     We deduct the non-cached traffic from the total traffic amount.
	//   - **`cache_hit_requests_ratio`** – Formula: `responses_hit` / requests. The
	//     share of sending cached content.
	//   - **`shield_traffic_ratio`** – Formula: (`shield_bytes` - `upstream_bytes`) /
	//     `shield_bytes`. The efficiency of the Origin Shielding: how much more traffic
	//     is sent from the Origin Shielding than from the origin.
	//   - **`image_processed`** - Number of images transformed on the Image optimization
	//     service.
	//   - **`request_time`** - Time elapsed between the first bytes of a request were
	//     processed and logging after the last bytes were sent to a user.
	//   - **`upstream_response_time`** - Number of milliseconds it took to receive a
	//     response from an origin. If upstream `response_time_` contains several
	//     indications for one request (in case of more than 1 origin), we summarize
	//     them. In case of aggregating several queries, the average of this amount is
	//     calculated.
	//   - **`95_percentile`** - Represents the 95th percentile of network bandwidth
	//     usage in bytes per second. This means that 95% of the time, the network
	//     resource usage was below this value.
	//   - **`max_bandwidth`** - The maximum network bandwidth that was used during the
	//     selected time represented in bytes per second.
	//   - **`min_bandwidth`** - The minimum network bandwidth that was used during the
	//     selected time represented in bytes per second.
	//
	// Metrics **`upstream_response_time`** and **`request_time`** should be requested
	// separately from other metrics
	Metrics string `query:"metrics" api:"required" json:"-"`
	// Service name.
	//
	// Possible value:
	//
	// - CDN
	Service string `query:"service" api:"required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to" api:"required" json:"-"`
	// Names of countries for which data should be displayed. English short name from
	// [ISO 3166 standard][1] without the definite article ("the") should be used.
	//
	// To request multiple values, use:
	//
	// - &countries=france&countries=denmark
	//
	// [1]: https://www.iso.org/obp/ui/#search/code/
	Countries param.Opt[string] `query:"countries,omitzero" json:"-"`
	// The way the parameters are arranged in the response.
	//
	// Possible values:
	//
	// - **true** – Flat structure is used.
	// - **false** – Embedded structure is used (default.)
	Flat param.Opt[bool] `query:"flat,omitzero" json:"-"`
	// Output data grouping.
	//
	// Possible values:
	//
	//   - **resource** – Data is grouped by CDN resources IDs.
	//   - **region** – Data is grouped by regions of CDN edge servers.
	//   - **country** – Data is grouped by countries of CDN edge servers.
	//   - **vhost** – Data is grouped by resources CNAMEs.
	//   - **`client_country`** - Data is grouped by countries, based on end-users'
	//     location.
	//   - **protocol** - Data is grouped by http protocol version.
	//
	// To request multiple values, use:
	//
	// - &`group_by`=region&`group_by`=resource
	GroupBy param.Opt[string] `query:"group_by,omitzero" json:"-"`
	// Regions for which data is displayed.
	//
	// Possible values:
	//
	// - **na** – North America
	// - **eu** – Europe
	// - **cis** – Commonwealth of Independent States
	// - **asia** – Asia
	// - **au** – Australia
	// - **latam** – Latin America
	// - **me** – Middle East
	// - **africa** - Africa
	// - **sa** - South America
	Regions param.Opt[string] `query:"regions,omitzero" json:"-"`
	// CDN resources IDs by that statistics data is grouped.
	//
	// To request multiple values, use:
	//
	// - &resource=1&resource=2
	//
	// If CDN resource ID is not specified, data related to all CDN resources is
	// returned.
	Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (StatisticGetResourceUsageAggregatedParams) URLQuery

URLQuery serializes StatisticGetResourceUsageAggregatedParams's query parameters as `url.Values`.

type StatisticGetResourceUsageSeriesParams

type StatisticGetResourceUsageSeriesParams struct {
	// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	From string `query:"from" api:"required" json:"-"`
	// Duration of the time blocks into which the data will be divided.
	//
	// Possible values:
	//
	// - **1m** - available only for up to 1 month in the past.
	// - **5m**
	// - **15m**
	// - **1h**
	// - **1d**
	Granularity string `query:"granularity" api:"required" json:"-"`
	// Types of statistics data.
	//
	// Possible values:
	//
	//   - **`upstream_bytes`** – Traffic in bytes from an origin server to CDN servers
	//     or to origin shielding when used.
	//   - **`sent_bytes`** – Traffic in bytes from CDN servers to clients.
	//   - **`shield_bytes`** – Traffic in bytes from origin shielding to CDN servers.
	//   - **`backblaze_bytes`** - Traffic in bytes from Backblaze origin.
	//   - **`total_bytes`** – `shield_bytes`, `upstream_bytes` and `sent_bytes`
	//     combined.
	//   - **`cdn_bytes`** – `sent_bytes` and `shield_bytes` combined.
	//   - **requests** – Number of requests to edge servers.
	//   - **`responses_2xx`** – Number of 2xx response codes.
	//   - **`responses_3xx`** – Number of 3xx response codes.
	//   - **`responses_4xx`** – Number of 4xx response codes.
	//   - **`responses_5xx`** – Number of 5xx response codes.
	//   - **`responses_hit`** – Number of responses with the header Cache: HIT.
	//   - **`responses_miss`** – Number of responses with the header Cache: MISS.
	//   - **`response_types`** – Statistics by content type. It returns a number of
	//     responses for content with different MIME types.
	//   - **`cache_hit_traffic_ratio`** – Formula: 1 - `upstream_bytes` / `sent_bytes`.
	//     We deduct the non-cached traffic from the total traffic amount.
	//   - **`cache_hit_requests_ratio`** – Formula: `responses_hit` / requests. The
	//     share of sending cached content.
	//   - **`shield_traffic_ratio`** – Formula: (`shield_bytes` - `upstream_bytes`) /
	//     `shield_bytes`. The efficiency of the Origin Shielding: how much more traffic
	//     is sent from the Origin Shielding than from the origin.
	//   - **`image_processed`** - Number of images transformed on the Image optimization
	//     service.
	//   - **`request_time`** - Time elapsed between the first bytes of a request were
	//     processed and logging after the last bytes were sent to a user.
	//   - **`upstream_response_time`** - Number of milliseconds it took to receive a
	//     response from an origin. If upstream `response_time_` contains several
	//     indications for one request (in case of more than 1 origin), we summarize
	//     them. In case of aggregating several queries, the average of this amount is
	//     calculated.
	//
	// Metrics **`upstream_response_time`** and **`request_time`** should be requested
	// separately from other metrics
	Metrics string `query:"metrics" api:"required" json:"-"`
	// Service name.
	//
	// Possible value:
	//
	// - CDN
	Service string `query:"service" api:"required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to" api:"required" json:"-"`
	// Names of countries for which data should be displayed. English short name from
	// [ISO 3166 standard][1] without the definite article ("the") should be used.
	//
	// To request multiple values, use:
	//
	// - &countries=france&countries=denmark
	//
	// [1]: https://www.iso.org/obp/ui/#search/code/
	Countries param.Opt[string] `query:"countries,omitzero" json:"-"`
	// Output data grouping.
	//
	// Possible values:
	//
	//   - **resource** – Data is grouped by CDN resources IDs.
	//   - **region** – Data is grouped by regions of CDN edge servers.
	//   - **country** – Data is grouped by countries of CDN edge servers.
	//   - **vhost** – Data is grouped by resources CNAMEs.
	//   - **`client_country`** - Data is grouped by countries, based on end-users'
	//     location.
	//   - **protocol** - Data is grouped by http protocol version.
	//
	// To request multiple values, use:
	//
	// - &`group_by`=region&`group_by`=resource
	GroupBy param.Opt[string] `query:"group_by,omitzero" json:"-"`
	// Regions for which data is displayed.
	//
	// Possible values:
	//
	// - **na** – North America
	// - **eu** – Europe
	// - **cis** – Commonwealth of Independent States
	// - **asia** – Asia
	// - **au** – Australia
	// - **latam** – Latin America
	// - **me** – Middle East
	// - **africa** - Africa
	// - **sa** - South America
	Regions param.Opt[string] `query:"regions,omitzero" json:"-"`
	// CDN resources IDs by that statistics data is grouped.
	//
	// To request multiple values, use:
	//
	// - &resource=1&resource=2
	//
	// If CDN resource ID is not specified, data related to all CDN resources is
	// returned.
	Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (StatisticGetResourceUsageSeriesParams) URLQuery

func (r StatisticGetResourceUsageSeriesParams) URLQuery() (v url.Values, err error)

URLQuery serializes StatisticGetResourceUsageSeriesParams's query parameters as `url.Values`.

type StatisticGetShieldUsageAggregatedParams

type StatisticGetShieldUsageAggregatedParams struct {
	// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	From string `query:"from" api:"required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to" api:"required" json:"-"`
	// The way the parameters are arranged in the response.
	//
	// Possible values:
	//
	// - **true** – Flat structure is used.
	// - **false** – Embedded structure is used (default.)
	Flat param.Opt[bool] `query:"flat,omitzero" json:"-"`
	// Output data grouping.
	//
	// Possible value:
	//
	// - **resource** - Data is grouped by CDN resources.
	GroupBy param.Opt[string] `query:"group_by,omitzero" json:"-"`
	// CDN resources IDs by that statistics data is grouped.
	//
	// To request multiple values, use:
	//
	// - &resource=1&resource=2
	//
	// If CDN resource ID is not specified, data related to all CDN resources is
	// returned.
	Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (StatisticGetShieldUsageAggregatedParams) URLQuery

URLQuery serializes StatisticGetShieldUsageAggregatedParams's query parameters as `url.Values`.

type StatisticGetShieldUsageSeriesParams

type StatisticGetShieldUsageSeriesParams struct {
	// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	From string `query:"from" api:"required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to" api:"required" json:"-"`
	// CDN resources IDs by that statistics data is grouped.
	//
	// To request multiple values, use:
	//
	// - &resource=1&resource=2
	//
	// If CDN resource ID is not specified, data related to all CDN resources is
	// returned.
	Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (StatisticGetShieldUsageSeriesParams) URLQuery

func (r StatisticGetShieldUsageSeriesParams) URLQuery() (v url.Values, err error)

URLQuery serializes StatisticGetShieldUsageSeriesParams's query parameters as `url.Values`.

type StatisticService

type StatisticService struct {
	Options []option.RequestOption
}

Consumption statistics is updated in near real-time as a standard practice. However, the frequency of updates can vary, but they are typically available within a 24-hour period. Exceptions, such as maintenance periods, may delay data beyond 24 hours until servers resume and fill in the missing statistics.

StatisticService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewStatisticService method instead.

func NewStatisticService

func NewStatisticService(opts ...option.RequestOption) (r StatisticService)

NewStatisticService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*StatisticService) GetAliasUsageAggregated added in v0.58.0

func (r *StatisticService) GetAliasUsageAggregated(ctx context.Context, query StatisticGetAliasUsageAggregatedParams, opts ...option.RequestOption) (res *AliasAggregatedStats, err error)

Get the number of aliases in use.

Request URL parameters should be added as a query string after the endpoint.

The requested period is always expanded to whole calendar months, so a request for part of a month returns the count for its entire containing month.

func (*StatisticService) GetLogsUsageAggregated

func (r *StatisticService) GetLogsUsageAggregated(ctx context.Context, query StatisticGetLogsUsageAggregatedParams, opts ...option.RequestOption) (res *LogsAggregatedStats, err error)

Get the number of CDN resources that used Logs uploader.

Request URL parameters should be added as a query string after the endpoint.

func (*StatisticService) GetLogsUsageSeries

func (r *StatisticService) GetLogsUsageSeries(ctx context.Context, query StatisticGetLogsUsageSeriesParams, opts ...option.RequestOption) (res *UsageSeriesStats, err error)

Get Logs uploader usage statistics for up to 90 days starting today.

Request URL parameters should be added as a query string after the endpoint.

func (*StatisticService) GetResourceUsageAggregated

func (r *StatisticService) GetResourceUsageAggregated(ctx context.Context, query StatisticGetResourceUsageAggregatedParams, opts ...option.RequestOption) (res *ResourceAggregatedStats, err error)

Get aggregated CDN resources statistics.

Request URL parameters should be added as a query string after the endpoint.

Aggregated data does not include data for the last two hours.

func (*StatisticService) GetResourceUsageSeries

func (r *StatisticService) GetResourceUsageSeries(ctx context.Context, query StatisticGetResourceUsageSeriesParams, opts ...option.RequestOption) (res *ResourceUsageStats, err error)

Get CDN resources statistics for up to 365 days starting today.

func (*StatisticService) GetShieldUsageAggregated

func (r *StatisticService) GetShieldUsageAggregated(ctx context.Context, query StatisticGetShieldUsageAggregatedParams, opts ...option.RequestOption) (res *ShieldAggregatedStats, err error)

The number of CDN resources that use origin shielding.

Request URL parameters should be added as a query string after the endpoint.

func (*StatisticService) GetShieldUsageSeries

func (r *StatisticService) GetShieldUsageSeries(ctx context.Context, query StatisticGetShieldUsageSeriesParams, opts ...option.RequestOption) (res *UsageSeriesStats, err error)

Get origin shielding usage statistics for up to 365 days starting from today.

Request URL parameters should be added as a query string after the endpoint.

type TrustedCaCertificateListParams

type TrustedCaCertificateListParams struct {
	// How the certificate was issued.
	//
	// Possible values:
	//
	// - **true** – Certificate was issued automatically.
	// - **false** – Certificate was added by a user.
	Automated param.Opt[bool] `query:"automated,omitzero" json:"-"`
	// Maximum number of items to return in the response. Cannot exceed 1000.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Number of items to skip from the beginning of the list.
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// CDN resource ID for which the certificates are requested.
	ResourceID param.Opt[int64] `query:"resource_id,omitzero" json:"-"`
	// Date and time when the certificate become untrusted (ISO 8601/RFC 3339 format,
	// UTC.)
	//
	// Response will contain certificates valid until the specified time.
	ValidityNotAfterLte param.Opt[string] `query:"validity_not_after_lte,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (TrustedCaCertificateListParams) URLQuery

func (r TrustedCaCertificateListParams) URLQuery() (v url.Values, err error)

URLQuery serializes TrustedCaCertificateListParams's query parameters as `url.Values`.

type TrustedCaCertificateNewParams

type TrustedCaCertificateNewParams struct {
	// CA certificate name.
	//
	// It must be unique.
	Name string `json:"name" api:"required"`
	// Public part of the CA certificate.
	//
	// It must be in the PEM format.
	SslCertificate string `json:"sslCertificate" api:"required"`
	// contains filtered or unexported fields
}

func (TrustedCaCertificateNewParams) MarshalJSON

func (r TrustedCaCertificateNewParams) MarshalJSON() (data []byte, err error)

func (*TrustedCaCertificateNewParams) UnmarshalJSON

func (r *TrustedCaCertificateNewParams) UnmarshalJSON(data []byte) error

type TrustedCaCertificateReplaceParams

type TrustedCaCertificateReplaceParams struct {
	// CA certificate name.
	//
	// It must be unique.
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

func (TrustedCaCertificateReplaceParams) MarshalJSON

func (r TrustedCaCertificateReplaceParams) MarshalJSON() (data []byte, err error)

func (*TrustedCaCertificateReplaceParams) UnmarshalJSON

func (r *TrustedCaCertificateReplaceParams) UnmarshalJSON(data []byte) error

type TrustedCaCertificateService

type TrustedCaCertificateService struct {
	Options []option.RequestOption
}

Trusted CA certificates verify the authenticity of CDN origin servers during HTTPS connections.

TrustedCaCertificateService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTrustedCaCertificateService method instead.

func NewTrustedCaCertificateService

func NewTrustedCaCertificateService(opts ...option.RequestOption) (r TrustedCaCertificateService)

NewTrustedCaCertificateService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*TrustedCaCertificateService) Delete

func (r *TrustedCaCertificateService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)

Delete trusted CA certificate

func (*TrustedCaCertificateService) Get

Get trusted CA certificate details

func (*TrustedCaCertificateService) List

Get list of trusted CA certificates used to verify an origin.

func (*TrustedCaCertificateService) ListAutoPaging added in v0.51.0

Get list of trusted CA certificates used to verify an origin.

func (*TrustedCaCertificateService) New

Add a trusted CA certificate to verify an origin.

Enter all strings of the certificate in one string parameter. Each string should be separated by the "\n" symbol.

func (*TrustedCaCertificateService) Replace

Change trusted CA certificate

type UsageSeriesStat

type UsageSeriesStat struct {
	// Identifier of the paid feature usage record.
	ID int64 `json:"id"`
	// Date and time when paid feature was enabled (ISO 8601/RFC 3339 format, UTC.)
	ActiveFrom string `json:"active_from"`
	// Date and time when paid feature was disabled (ISO 8601/RFC 3339 format, UTC.)
	//
	// It returns **null** if the paid feature is enabled.
	ActiveTo string `json:"active_to" api:"nullable"`
	// Client ID.
	ClientID int64 `json:"client_id"`
	// CDN resource CNAME.
	Cname string `json:"cname"`
	// CDN resource ID.
	ResourceID int64 `json:"resource_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		ActiveFrom  respjson.Field
		ActiveTo    respjson.Field
		ClientID    respjson.Field
		Cname       respjson.Field
		ResourceID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UsageSeriesStat) RawJSON

func (r UsageSeriesStat) RawJSON() string

Returns the unmodified JSON received from the API

func (*UsageSeriesStat) UnmarshalJSON

func (r *UsageSeriesStat) UnmarshalJSON(data []byte) error

type UsageSeriesStats

type UsageSeriesStats []UsageSeriesStat

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL