cdn

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlibabaRegion added in v0.17.0

type AlibabaRegion 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 (AlibabaRegion) RawJSON added in v0.17.0

func (r AlibabaRegion) RawJSON() string

Returns the unmodified JSON received from the API

func (*AlibabaRegion) UnmarshalJSON added in v0.17.0

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

type AlibabaRegions added in v0.17.0

type AlibabaRegions []AlibabaRegion

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
}

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 AwsRegion added in v0.17.0

type AwsRegion 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 (AwsRegion) RawJSON added in v0.17.0

func (r AwsRegion) RawJSON() string

Returns the unmodified JSON received from the API

func (*AwsRegion) UnmarshalJSON added in v0.17.0

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

type AwsRegions added in v0.17.0

type AwsRegions []AwsRegion

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 origins that can be added to the origin group on your tariff
	// plan.
	OriginsInGroupLimit int64 `json:"origins_in_group_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"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		OriginsInGroupLimit respjson.Field
		ResourcesLimit      respjson.Field
		RulesLimit          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 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"`
	// Contains meta-information.
	Meta CDNLogEntryMeta `json:"meta"`
	// 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"`
	// 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 is from variant [CDNMetricsGroups].
	Group CDNMetricsValues `json:"group"`
	JSON  struct {
		OfCDNMetricsValues respjson.Field
		Group              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]

func (CDNMetricsDataUnion) AsCDNMetricsGroups added in v0.31.0

func (u CDNMetricsDataUnion) AsCDNMetricsGroups() (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 struct {
	// List of requested metrics sorted by timestamp in ascending order.
	Group CDNMetricsValues `json:"group"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Group       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CDNMetricsGroups) RawJSON added in v0.31.0

func (r CDNMetricsGroups) RawJSON() string

Returns the unmodified JSON received from the API

func (*CDNMetricsGroups) UnmarshalJSON added in v0.31.0

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

type CDNMetricsValue added in v0.31.0

type CDNMetricsValue struct {
	// Metrics value.
	Metric float64 `json:"metric"`
	// Start timestamp of interval.
	Timestamp int64 `json:"timestamp"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Metric      respjson.Field
		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 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,nullable"`
	// CDN resource name.
	Name string `json:"name,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.
	//
	// You can use either the `origin` or `originGroup` parameter in the request.
	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.
	//
	// 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,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,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,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,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,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,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,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,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 []CDNResource

type CDNResourceListParams added in v0.31.0

type CDNResourceListParams struct {
	// 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:"-"`
	// 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:"-"`
	// 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:"-"`
	// Origin group ID.
	OriginGroup param.Opt[int64] `query:"originGroup,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 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:"-"`
	// 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 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,required"`
	// IP address or domain name of the origin and the port, if custom port is used.
	//
	// You can use either the `origin` or `originGroup` parameter in the request.
	Origin string `json:"origin,required"`
	// Origin group ID with which the CDN resource is associated.
	//
	// You can use either the `origin` or `originGroup` parameter in the request.
	OriginGroup int64 `json:"originGroup,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"`
	// 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"`
	// Defines whether the associated WAAP Domain is identified as an API Domain.
	//
	// Possible values:
	//
	// - **true** - The associated WAAP Domain is designated as an API Domain.
	// - **false** - The associated WAAP Domain is not designated as an API Domain.
	WaapAPIDomainEnabled param.Opt[bool] `json:"waap_api_domain_enabled,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.
	//
	// 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"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection CDNResourceNewParamsOptionsBotProtection `json:"bot_protection,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_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"`
	// 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"`
	// 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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter CDNResourceNewParamsOptionsRequestLimiter `json:"request_limiter,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.
	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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero,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 CDNResourceNewParamsOptionsBotProtection added in v0.31.0

type CDNResourceNewParamsOptionsBotProtection struct {
	// Controls the bot challenge module state.
	BotChallenge CDNResourceNewParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// contains filtered or unexported fields
}

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

The properties BotChallenge, Enabled are required.

func (CDNResourceNewParamsOptionsBotProtection) MarshalJSON added in v0.31.0

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

func (*CDNResourceNewParamsOptionsBotProtection) UnmarshalJSON added in v0.31.0

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

type CDNResourceNewParamsOptionsBotProtectionBotChallenge added in v0.31.0

type CDNResourceNewParamsOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Controls the bot challenge module state.

func (CDNResourceNewParamsOptionsBotProtectionBotChallenge) MarshalJSON added in v0.31.0

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

func (*CDNResourceNewParamsOptionsBotProtectionBotChallenge) UnmarshalJSON added in v0.31.0

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,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,omitzero,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders CDNResourceNewParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,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_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,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,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.

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 CDNResourceNewParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceNewParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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 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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 CDNResourceNewParamsOptionsRequestLimiter added in v0.31.0

type CDNResourceNewParamsOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate int64 `json:"rate,required"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit,omitzero"`
	// contains filtered or unexported fields
}

Option allows to limit the amount of HTTP requests.

The properties Enabled, Rate are required.

func (CDNResourceNewParamsOptionsRequestLimiter) MarshalJSON added in v0.31.0

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

func (*CDNResourceNewParamsOptionsRequestLimiter) UnmarshalJSON added in v0.31.0

func (r *CDNResourceNewParamsOptionsRequestLimiter) 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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []CDNResourceNewParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,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,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,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 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,required"`
	// List of SSL/TLS protocol versions (case sensitive).
	//
	// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
	Value []string `json:"value,omitzero,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.

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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - RSA Let's Encrypt certificate.
	// - **false** - ECDSA Let's Encrypt certificate.
	Value bool `json:"value,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.

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,nullable"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection CDNResourceOptionsBotProtection `json:"bot_protection,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,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,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,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,nullable"`
	// Enables control access to content for specified countries.
	CountryACL CDNResourceOptionsCountryACL `json:"country_acl,nullable"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache CDNResourceOptionsDisableCache `json:"disable_cache,nullable"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges CDNResourceOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,nullable"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings CDNResourceOptionsEdgeCacheSettings `json:"edge_cache_settings,nullable"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_body`,
	// `on_response_headers`, or `on_response_body` must be specified.
	Fastedge CDNResourceOptionsFastedge `json:"fastedge,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,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,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,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,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,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,nullable"`
	// Enables HTTP/3 protocol for content delivery.
	//
	// `http3_enabled` option works only with `"sslEnabled": true`.
	Http3Enabled CDNResourceOptionsHttp3Enabled `json:"http3_enabled,nullable"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie CDNResourceOptionsIgnoreCookie `json:"ignore_cookie,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,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,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,nullable"`
	// Allows to control the download speed per connection.
	LimitBandwidth CDNResourceOptionsLimitBandwidth `json:"limit_bandwidth,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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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,nullable"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet CDNResourceOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,nullable"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout CDNResourceOptionsProxyConnectTimeout `json:"proxy_connect_timeout,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,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,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,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,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,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,nullable"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL CDNResourceOptionsReferrerACL `json:"referrer_acl,nullable"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter CDNResourceOptionsRequestLimiter `json:"request_limiter,nullable"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy CDNResourceOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,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,nullable"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey CDNResourceOptionsSecureKey `json:"secure_key,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,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,nullable"`
	// Serves stale cached content in case of origin unavailability.
	Stale CDNResourceOptionsStale `json:"stale,nullable"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders CDNResourceOptionsStaticResponseHeaders `json:"static_response_headers,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,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,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.
	TlsVersions CDNResourceOptionsTlsVersions `json:"tls_versions,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,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,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,nullable"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL CDNResourceOptionsUserAgentACL `json:"user_agent_acl,nullable"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap CDNResourceOptionsWaap `json:"waap,nullable"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets CDNResourceOptionsWebsockets `json:"websockets,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowedHTTPMethods          respjson.Field
		BotProtection               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
		Http3Enabled                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
		RequestLimiter              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
		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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,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 CDNResourceOptionsBotProtection added in v0.31.0

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

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

func (CDNResourceOptionsBotProtection) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsBotProtection) UnmarshalJSON added in v0.31.0

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

type CDNResourceOptionsBotProtectionBotChallenge added in v0.31.0

type CDNResourceOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls the bot challenge module state.

func (CDNResourceOptionsBotProtectionBotChallenge) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsBotProtectionBotChallenge) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsBotProtectionBotChallenge) 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,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders CDNResourceOptionsFastedgeOnRequestHeaders `json:"on_request_headers"`
	// 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
		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_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,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,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.

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 CDNResourceOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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 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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 CDNResourceOptionsRequestLimiter added in v0.31.0

type CDNResourceOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate  int64 `json:"rate,required"`
	Burst int64 `json:"burst"`
	Delay int64 `json:"delay"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Rate        respjson.Field
		Burst       respjson.Field
		Delay       respjson.Field
		RateUnit    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Option allows to limit the amount of HTTP requests.

func (CDNResourceOptionsRequestLimiter) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceOptionsRequestLimiter) UnmarshalJSON added in v0.31.0

func (r *CDNResourceOptionsRequestLimiter) 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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Key generated on your side that will be used for URL signing.
	Key string `json:"key,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []CDNResourceOptionsStaticResponseHeadersValue `json:"value,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,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,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 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,required"`
	// List of SSL/TLS protocol versions (case sensitive).
	//
	// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
	Value []string `json:"value,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.

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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - RSA Let's Encrypt certificate.
	// - **false** - ECDSA Let's Encrypt certificate.
	Value bool `json:"value,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.

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,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.
	//
	// You can use either the `origin` or `originGroup` parameter in the request.
	OriginGroup int64 `json:"originGroup,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"`
	// Defines whether the associated WAAP Domain is identified as an API Domain.
	//
	// Possible values:
	//
	// - **true** - The associated WAAP Domain is designated as an API Domain.
	// - **false** - The associated WAAP Domain is not designated as an API Domain.
	WaapAPIDomainEnabled param.Opt[bool] `json:"waap_api_domain_enabled,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.
	//
	// 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"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection CDNResourceReplaceParamsOptionsBotProtection `json:"bot_protection,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_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"`
	// 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"`
	// 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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter CDNResourceReplaceParamsOptionsRequestLimiter `json:"request_limiter,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.
	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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero,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 CDNResourceReplaceParamsOptionsBotProtection added in v0.31.0

type CDNResourceReplaceParamsOptionsBotProtection struct {
	// Controls the bot challenge module state.
	BotChallenge CDNResourceReplaceParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// contains filtered or unexported fields
}

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

The properties BotChallenge, Enabled are required.

func (CDNResourceReplaceParamsOptionsBotProtection) MarshalJSON added in v0.31.0

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

func (*CDNResourceReplaceParamsOptionsBotProtection) UnmarshalJSON added in v0.31.0

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

type CDNResourceReplaceParamsOptionsBotProtectionBotChallenge added in v0.31.0

type CDNResourceReplaceParamsOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Controls the bot challenge module state.

func (CDNResourceReplaceParamsOptionsBotProtectionBotChallenge) MarshalJSON added in v0.31.0

func (*CDNResourceReplaceParamsOptionsBotProtectionBotChallenge) 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,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,omitzero,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders CDNResourceReplaceParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,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_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,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,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.

The property AppID is required.

func (CDNResourceReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceReplaceParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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 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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 CDNResourceReplaceParamsOptionsRequestLimiter added in v0.31.0

type CDNResourceReplaceParamsOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate int64 `json:"rate,required"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit,omitzero"`
	// contains filtered or unexported fields
}

Option allows to limit the amount of HTTP requests.

The properties Enabled, Rate are required.

func (CDNResourceReplaceParamsOptionsRequestLimiter) MarshalJSON added in v0.31.0

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

func (*CDNResourceReplaceParamsOptionsRequestLimiter) UnmarshalJSON added in v0.31.0

func (r *CDNResourceReplaceParamsOptionsRequestLimiter) 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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []CDNResourceReplaceParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,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,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,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 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,required"`
	// List of SSL/TLS protocol versions (case sensitive).
	//
	// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
	Value []string `json:"value,omitzero,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.

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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - RSA Let's Encrypt certificate.
	// - **false** - ECDSA Let's Encrypt certificate.
	Value bool `json:"value,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.

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,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.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OverrideOriginProtocol CDNResourceRuleOverrideOriginProtocol `json:"overrideOriginProtocol,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,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,required" json:"-"`
	// contains filtered or unexported fields
}

type CDNResourceRuleGetParams added in v0.31.0

type CDNResourceRuleGetParams struct {
	ResourceID int64 `path:"resource_id,required" json:"-"`
	// contains filtered or unexported fields
}

type CDNResourceRuleNewParams added in v0.31.0

type CDNResourceRuleNewParams struct {
	// Rule name.
	Name string `json:"name,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,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,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.
	//
	// 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"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection CDNResourceRuleNewParamsOptionsBotProtection `json:"bot_protection,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_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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter CDNResourceRuleNewParamsOptionsRequestLimiter `json:"request_limiter,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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero,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 CDNResourceRuleNewParamsOptionsBotProtection added in v0.31.0

type CDNResourceRuleNewParamsOptionsBotProtection struct {
	// Controls the bot challenge module state.
	BotChallenge CDNResourceRuleNewParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// contains filtered or unexported fields
}

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

The properties BotChallenge, Enabled are required.

func (CDNResourceRuleNewParamsOptionsBotProtection) MarshalJSON added in v0.31.0

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

func (*CDNResourceRuleNewParamsOptionsBotProtection) UnmarshalJSON added in v0.31.0

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

type CDNResourceRuleNewParamsOptionsBotProtectionBotChallenge added in v0.31.0

type CDNResourceRuleNewParamsOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Controls the bot challenge module state.

func (CDNResourceRuleNewParamsOptionsBotProtectionBotChallenge) MarshalJSON added in v0.31.0

func (*CDNResourceRuleNewParamsOptionsBotProtectionBotChallenge) 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,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,omitzero,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,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_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,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,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.

The property AppID is required.

func (CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceRuleNewParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 CDNResourceRuleNewParamsOptionsRequestLimiter added in v0.31.0

type CDNResourceRuleNewParamsOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate int64 `json:"rate,required"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit,omitzero"`
	// contains filtered or unexported fields
}

Option allows to limit the amount of HTTP requests.

The properties Enabled, Rate are required.

func (CDNResourceRuleNewParamsOptionsRequestLimiter) MarshalJSON added in v0.31.0

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

func (*CDNResourceRuleNewParamsOptionsRequestLimiter) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleNewParamsOptionsRequestLimiter) 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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []CDNResourceRuleNewParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,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,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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.
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,nullable"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection CDNResourceRuleOptionsBotProtection `json:"bot_protection,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,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,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,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,nullable"`
	// Enables control access to content for specified countries.
	CountryACL CDNResourceRuleOptionsCountryACL `json:"country_acl,nullable"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache CDNResourceRuleOptionsDisableCache `json:"disable_cache,nullable"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges CDNResourceRuleOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,nullable"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings CDNResourceRuleOptionsEdgeCacheSettings `json:"edge_cache_settings,nullable"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_body`,
	// `on_response_headers`, or `on_response_body` must be specified.
	Fastedge CDNResourceRuleOptionsFastedge `json:"fastedge,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,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,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,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,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,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,nullable"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie CDNResourceRuleOptionsIgnoreCookie `json:"ignore_cookie,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,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,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,nullable"`
	// Allows to control the download speed per connection.
	LimitBandwidth CDNResourceRuleOptionsLimitBandwidth `json:"limit_bandwidth,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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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,nullable"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet CDNResourceRuleOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,nullable"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout CDNResourceRuleOptionsProxyConnectTimeout `json:"proxy_connect_timeout,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,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,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,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,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,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,nullable"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL CDNResourceRuleOptionsReferrerACL `json:"referrer_acl,nullable"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter CDNResourceRuleOptionsRequestLimiter `json:"request_limiter,nullable"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy CDNResourceRuleOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,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,nullable"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey CDNResourceRuleOptionsSecureKey `json:"secure_key,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,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,nullable"`
	// Serves stale cached content in case of origin unavailability.
	Stale CDNResourceRuleOptionsStale `json:"stale,nullable"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders CDNResourceRuleOptionsStaticResponseHeaders `json:"static_response_headers,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,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,nullable"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL CDNResourceRuleOptionsUserAgentACL `json:"user_agent_acl,nullable"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap CDNResourceRuleOptionsWaap `json:"waap,nullable"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets CDNResourceRuleOptionsWebsockets `json:"websockets,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowedHTTPMethods          respjson.Field
		BotProtection               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
		RequestLimiter              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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,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 CDNResourceRuleOptionsBotProtection added in v0.31.0

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

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

func (CDNResourceRuleOptionsBotProtection) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsBotProtection) UnmarshalJSON added in v0.31.0

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

type CDNResourceRuleOptionsBotProtectionBotChallenge added in v0.31.0

type CDNResourceRuleOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls the bot challenge module state.

func (CDNResourceRuleOptionsBotProtectionBotChallenge) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsBotProtectionBotChallenge) UnmarshalJSON added in v0.31.0

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,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders CDNResourceRuleOptionsFastedgeOnRequestHeaders `json:"on_request_headers"`
	// 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
		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_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,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,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.

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 CDNResourceRuleOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceRuleOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 CDNResourceRuleOptionsRequestLimiter added in v0.31.0

type CDNResourceRuleOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate  int64 `json:"rate,required"`
	Burst int64 `json:"burst"`
	Delay int64 `json:"delay"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Rate        respjson.Field
		Burst       respjson.Field
		Delay       respjson.Field
		RateUnit    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Option allows to limit the amount of HTTP requests.

func (CDNResourceRuleOptionsRequestLimiter) RawJSON added in v0.31.0

Returns the unmodified JSON received from the API

func (*CDNResourceRuleOptionsRequestLimiter) UnmarshalJSON added in v0.31.0

func (r *CDNResourceRuleOptionsRequestLimiter) 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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Key generated on your side that will be used for URL signing.
	Key string `json:"key,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []CDNResourceRuleOptionsStaticResponseHeadersValue `json:"value,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,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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.
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,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,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,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.
	//
	// 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"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection CDNResourceRuleReplaceParamsOptionsBotProtection `json:"bot_protection,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_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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter CDNResourceRuleReplaceParamsOptionsRequestLimiter `json:"request_limiter,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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero,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 CDNResourceRuleReplaceParamsOptionsBotProtection added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsBotProtection struct {
	// Controls the bot challenge module state.
	BotChallenge CDNResourceRuleReplaceParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// contains filtered or unexported fields
}

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

The properties BotChallenge, Enabled are required.

func (CDNResourceRuleReplaceParamsOptionsBotProtection) MarshalJSON added in v0.31.0

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

func (*CDNResourceRuleReplaceParamsOptionsBotProtection) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsBotProtectionBotChallenge added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Controls the bot challenge module state.

func (CDNResourceRuleReplaceParamsOptionsBotProtectionBotChallenge) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsBotProtectionBotChallenge) 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,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,omitzero,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,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_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,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,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.

The property AppID is required.

func (CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 CDNResourceRuleReplaceParamsOptionsRequestLimiter added in v0.31.0

type CDNResourceRuleReplaceParamsOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate int64 `json:"rate,required"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit,omitzero"`
	// contains filtered or unexported fields
}

Option allows to limit the amount of HTTP requests.

The properties Enabled, Rate are required.

func (CDNResourceRuleReplaceParamsOptionsRequestLimiter) MarshalJSON added in v0.31.0

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

func (*CDNResourceRuleReplaceParamsOptionsRequestLimiter) 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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []CDNResourceRuleReplaceParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,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,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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.
const (
	CDNResourceRuleReplaceParamsOverrideOriginProtocolHTTPS CDNResourceRuleReplaceParamsOverrideOriginProtocol = "HTTPS"
	CDNResourceRuleReplaceParamsOverrideOriginProtocolHTTP  CDNResourceRuleReplaceParamsOverrideOriginProtocol = "HTTP"
	CDNResourceRuleReplaceParamsOverrideOriginProtocolMatch CDNResourceRuleReplaceParamsOverrideOriginProtocol = "MATCH"
)

type CDNResourceRuleService added in v0.31.0

type CDNResourceRuleService struct {
	Options []option.RequestOption
}

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

func (r *CDNResourceRuleService) List(ctx context.Context, resourceID int64, opts ...option.RequestOption) (res *[]CDNResourceRule, err error)

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,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.
	//
	// 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"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection CDNResourceRuleUpdateParamsOptionsBotProtection `json:"bot_protection,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_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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter CDNResourceRuleUpdateParamsOptionsRequestLimiter `json:"request_limiter,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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero,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 CDNResourceRuleUpdateParamsOptionsBotProtection added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsBotProtection struct {
	// Controls the bot challenge module state.
	BotChallenge CDNResourceRuleUpdateParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// contains filtered or unexported fields
}

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

The properties BotChallenge, Enabled are required.

func (CDNResourceRuleUpdateParamsOptionsBotProtection) MarshalJSON added in v0.31.0

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

func (*CDNResourceRuleUpdateParamsOptionsBotProtection) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsBotProtectionBotChallenge added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Controls the bot challenge module state.

func (CDNResourceRuleUpdateParamsOptionsBotProtectionBotChallenge) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsBotProtectionBotChallenge) 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,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,omitzero,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,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_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,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,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.

The property AppID is required.

func (CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 CDNResourceRuleUpdateParamsOptionsRequestLimiter added in v0.31.0

type CDNResourceRuleUpdateParamsOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate int64 `json:"rate,required"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit,omitzero"`
	// contains filtered or unexported fields
}

Option allows to limit the amount of HTTP requests.

The properties Enabled, Rate are required.

func (CDNResourceRuleUpdateParamsOptionsRequestLimiter) MarshalJSON added in v0.31.0

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

func (*CDNResourceRuleUpdateParamsOptionsRequestLimiter) UnmarshalJSON added in v0.31.0

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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []CDNResourceRuleUpdateParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,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,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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.
const (
	CDNResourceRuleUpdateParamsOverrideOriginProtocolHTTPS CDNResourceRuleUpdateParamsOverrideOriginProtocol = "HTTPS"
	CDNResourceRuleUpdateParamsOverrideOriginProtocolHTTP  CDNResourceRuleUpdateParamsOverrideOriginProtocol = "HTTP"
	CDNResourceRuleUpdateParamsOverrideOriginProtocolMatch CDNResourceRuleUpdateParamsOverrideOriginProtocol = "MATCH"
)

type CDNResourceService added in v0.31.0

type CDNResourceService struct {
	Options []option.RequestOption
	Shield  CDNResourceShieldService
	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) 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) 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
}

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.
	//
	// You can use either the `origin` or `originGroup` parameter in the request.
	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.
	//
	// 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"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection CDNResourceUpdateParamsOptionsBotProtection `json:"bot_protection,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_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"`
	// 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"`
	// 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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter CDNResourceUpdateParamsOptionsRequestLimiter `json:"request_limiter,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.
	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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero,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 CDNResourceUpdateParamsOptionsBotProtection added in v0.31.0

type CDNResourceUpdateParamsOptionsBotProtection struct {
	// Controls the bot challenge module state.
	BotChallenge CDNResourceUpdateParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// contains filtered or unexported fields
}

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

The properties BotChallenge, Enabled are required.

func (CDNResourceUpdateParamsOptionsBotProtection) MarshalJSON added in v0.31.0

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

func (*CDNResourceUpdateParamsOptionsBotProtection) UnmarshalJSON added in v0.31.0

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

type CDNResourceUpdateParamsOptionsBotProtectionBotChallenge added in v0.31.0

type CDNResourceUpdateParamsOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Controls the bot challenge module state.

func (CDNResourceUpdateParamsOptionsBotProtectionBotChallenge) MarshalJSON added in v0.31.0

func (*CDNResourceUpdateParamsOptionsBotProtectionBotChallenge) 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,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,omitzero,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders CDNResourceUpdateParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,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_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,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,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.

The property AppID is required.

func (CDNResourceUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON added in v0.31.0

func (*CDNResourceUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedgeOnResponseBody added in v0.31.0

type CDNResourceUpdateParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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 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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 CDNResourceUpdateParamsOptionsRequestLimiter added in v0.31.0

type CDNResourceUpdateParamsOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate int64 `json:"rate,required"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit,omitzero"`
	// contains filtered or unexported fields
}

Option allows to limit the amount of HTTP requests.

The properties Enabled, Rate are required.

func (CDNResourceUpdateParamsOptionsRequestLimiter) MarshalJSON added in v0.31.0

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

func (*CDNResourceUpdateParamsOptionsRequestLimiter) UnmarshalJSON added in v0.31.0

func (r *CDNResourceUpdateParamsOptionsRequestLimiter) 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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []CDNResourceUpdateParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,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,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,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 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,required"`
	// List of SSL/TLS protocol versions (case sensitive).
	//
	// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
	Value []string `json:"value,omitzero,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.

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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - RSA Let's Encrypt certificate.
	// - **false** - ECDSA Let's Encrypt certificate.
	Value bool `json:"value,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.

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
	Shields               ShieldService
	OriginGroups          OriginGroupService
	RuleTemplates         RuleTemplateService
	Certificates          CertificateService
	TrustedCaCertificates TrustedCaCertificateService
	AuditLogs             AuditLogService
	Logs                  LogService
	LogsUploader          LogsUploaderService
	Statistics            StatisticService
	NetworkCapacity       NetworkCapacityService
	Metrics               MetricService
	IPRanges              IPRangeService
}

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

func (r *CDNService) ListAlibabaRegions(ctx context.Context, opts ...option.RequestOption) (res *AlibabaRegions, err error)

Get the list of Alibaba Cloud regions.

func (*CDNService) ListAwsRegions added in v0.31.0

func (r *CDNService) ListAwsRegions(ctx context.Context, opts ...option.RequestOption) (res *AwsRegions, err error)

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 *[]PurgeStatus, err error)

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 []CaCertificate

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:"-"`
	// 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,required"`
	// SSL certificate name. It must be unique.
	Name string `json:"name,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,required"`
	// Public part of the SSL certificate.
	//
	// All chain of the SSL certificate should be added.
	SslCertificate string `json:"sslCertificate,required"`
	// Private key of the SSL certificate.
	SslPrivateKey string `json:"sslPrivateKey,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,required"`
	// Public part of the SSL certificate.
	//
	// All chain of the SSL certificate should be added.
	SslCertificate string `json:"sslCertificate,required"`
	// Private key of the SSL certificate.
	SslPrivateKey string `json:"sslPrivateKey,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
}

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) List

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 Error

type Error = apierror.Error

type IPRangeListIPsParams added in v0.18.0

type IPRangeListIPsParams struct {
	// Optional format override. When set, this takes precedence over the `Accept`
	// header.
	//
	// Any of "json", "plain".
	Format IPRangeListIPsParamsFormat `query:"format,omitzero" json:"-"`
	// Any of "application/json", "text/plain".
	Accept IPRangeListIPsParamsAccept `header:"Accept,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (IPRangeListIPsParams) URLQuery added in v0.18.0

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

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

type IPRangeListIPsParamsAccept added in v0.18.0

type IPRangeListIPsParamsAccept string
const (
	IPRangeListIPsParamsAcceptApplicationJson IPRangeListIPsParamsAccept = "application/json"
	IPRangeListIPsParamsAcceptTextPlain       IPRangeListIPsParamsAccept = "text/plain"
)

type IPRangeListIPsParamsFormat added in v0.18.0

type IPRangeListIPsParamsFormat string

Optional format override. When set, this takes precedence over the `Accept` header.

const (
	IPRangeListIPsParamsFormatJson  IPRangeListIPsParamsFormat = "json"
	IPRangeListIPsParamsFormatPlain IPRangeListIPsParamsFormat = "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.

func (*IPRangeService) ListIPs

func (r *IPRangeService) ListIPs(ctx context.Context, params IPRangeListIPsParams, 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,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,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,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,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,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
}

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 []LogsUploaderConfig

type LogsUploaderConfigListParams

type LogsUploaderConfigListParams struct {
	// 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,required"`
	// ID of the policy that should be assigned to given config.
	Policy int64 `json:"policy,required"`
	// ID of the target to which logs should be uploaded.
	Target int64 `json:"target,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,required"`
	// ID of the policy that should be assigned to given config.
	Policy int64 `json:"policy,required"`
	// ID of the target to which logs should be uploaded.
	Target int64 `json:"target,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
}

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) 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"`
	// Field delimiter for logs.
	FieldDelimiter string `json:"field_delimiter"`
	// Field separator for logs.
	FieldSeparator string `json:"field_separator"`
	// List of fields to include in logs.
	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"`
	// 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,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
		FieldDelimiter          respjson.Field
		FieldSeparator          respjson.Field
		Fields                  respjson.Field
		FileNameTemplate        respjson.Field
		FormatType              respjson.Field
		IncludeEmptyLogs        respjson.Field
		IncludeShieldLogs       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 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 []LogsUploaderPolicy

type LogsUploaderPolicyListParams

type LogsUploaderPolicyListParams struct {
	// 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"`
	// 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"`
	// List of fields to include in logs.
	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 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"`
	// 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"`
	// List of fields to include in logs.
	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 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
}

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) ListFields

func (r *LogsUploaderPolicyService) ListFields(ctx context.Context, opts ...option.RequestOption) (res *[]string, err error)

Get list of available fields for logs uploader policy.

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"`
	// 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"`
	// List of fields to include in logs.
	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 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
	Policies LogsUploaderPolicyService
	Targets  LogsUploaderTargetService
	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 LogsUploaderTarget

type LogsUploaderTarget struct {
	ID int64 `json:"id"`
	// Client that owns the target.
	ClientID int64 `json:"client_id"`
	// Config for specific storage type.
	Config LogsUploaderTargetConfigUnion `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 LogsUploaderTargetStatus `json:"status"`
	// Type of storage for logs.
	//
	// Any of "s3_gcore", "s3_amazon", "s3_oss", "s3_other", "s3_v1", "ftp", "sftp",
	// "http".
	StorageType LogsUploaderTargetStorageType `json:"storage_type"`
	// 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 {
		ID                     respjson.Field
		ClientID               respjson.Field
		Config                 respjson.Field
		Created                respjson.Field
		Description            respjson.Field
		Name                   respjson.Field
		RelatedUploaderConfigs respjson.Field
		Status                 respjson.Field
		StorageType            respjson.Field
		Updated                respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTarget) RawJSON

func (r LogsUploaderTarget) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTarget) UnmarshalJSON

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

type LogsUploaderTargetConfigFtpConfig

type LogsUploaderTargetConfigFtpConfig struct {
	Directory      string `json:"directory,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 (LogsUploaderTargetConfigFtpConfig) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigFtpConfig) UnmarshalJSON

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

type LogsUploaderTargetConfigHTTPConfig

type LogsUploaderTargetConfigHTTPConfig struct {
	Append LogsUploaderTargetConfigHTTPConfigAppend `json:"append"`
	Auth   LogsUploaderTargetConfigHTTPConfigAuth   `json:"auth"`
	// Any of "json", "text".
	ContentType string                                   `json:"content_type"`
	Retry       LogsUploaderTargetConfigHTTPConfigRetry  `json:"retry"`
	Upload      LogsUploaderTargetConfigHTTPConfigUpload `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 (LogsUploaderTargetConfigHTTPConfig) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigHTTPConfig) UnmarshalJSON

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

type LogsUploaderTargetConfigHTTPConfigAppend

type LogsUploaderTargetConfigHTTPConfigAppend struct {
	Headers map[string]string `json:"headers"`
	// Any of "POST", "PUT".
	Method          string                                                   `json:"method"`
	ResponseActions []LogsUploaderTargetConfigHTTPConfigAppendResponseAction `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 (LogsUploaderTargetConfigHTTPConfigAppend) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigHTTPConfigAppend) UnmarshalJSON

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

type LogsUploaderTargetConfigHTTPConfigAppendResponseAction

type LogsUploaderTargetConfigHTTPConfigAppendResponseAction 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 (LogsUploaderTargetConfigHTTPConfigAppendResponseAction) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigHTTPConfigAppendResponseAction) UnmarshalJSON

type LogsUploaderTargetConfigHTTPConfigAuth

type LogsUploaderTargetConfigHTTPConfigAuth struct {
	Config LogsUploaderTargetConfigHTTPConfigAuthConfig `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 (LogsUploaderTargetConfigHTTPConfigAuth) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigHTTPConfigAuth) UnmarshalJSON

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

type LogsUploaderTargetConfigHTTPConfigAuthConfig

type LogsUploaderTargetConfigHTTPConfigAuthConfig 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 (LogsUploaderTargetConfigHTTPConfigAuthConfig) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigHTTPConfigAuthConfig) UnmarshalJSON

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

type LogsUploaderTargetConfigHTTPConfigRetry

type LogsUploaderTargetConfigHTTPConfigRetry struct {
	Headers map[string]string `json:"headers"`
	// Any of "POST", "PUT".
	Method          string                                                  `json:"method"`
	ResponseActions []LogsUploaderTargetConfigHTTPConfigRetryResponseAction `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 (LogsUploaderTargetConfigHTTPConfigRetry) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigHTTPConfigRetry) UnmarshalJSON

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

type LogsUploaderTargetConfigHTTPConfigRetryResponseAction

type LogsUploaderTargetConfigHTTPConfigRetryResponseAction 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 (LogsUploaderTargetConfigHTTPConfigRetryResponseAction) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigHTTPConfigRetryResponseAction) UnmarshalJSON

type LogsUploaderTargetConfigHTTPConfigUpload

type LogsUploaderTargetConfigHTTPConfigUpload struct {
	Headers map[string]string `json:"headers"`
	// Any of "POST", "PUT".
	Method          string                                                   `json:"method"`
	ResponseActions []LogsUploaderTargetConfigHTTPConfigUploadResponseAction `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 (LogsUploaderTargetConfigHTTPConfigUpload) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigHTTPConfigUpload) UnmarshalJSON

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

type LogsUploaderTargetConfigHTTPConfigUploadResponseAction

type LogsUploaderTargetConfigHTTPConfigUploadResponseAction 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 (LogsUploaderTargetConfigHTTPConfigUploadResponseAction) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigHTTPConfigUploadResponseAction) UnmarshalJSON

type LogsUploaderTargetConfigObject

type LogsUploaderTargetConfigObject struct {
	AccessKeyID string `json:"access_key_id"`
	BucketName  string `json:"bucket_name"`
	Directory   string `json:"directory,nullable"`
	Region      string `json:"region,nullable"`
	// 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 (LogsUploaderTargetConfigObject) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigObject) UnmarshalJSON

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

type LogsUploaderTargetConfigS3AmazonConfig

type LogsUploaderTargetConfigS3AmazonConfig struct {
	AccessKeyID string `json:"access_key_id"`
	BucketName  string `json:"bucket_name"`
	Directory   string `json:"directory,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 (LogsUploaderTargetConfigS3AmazonConfig) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigS3AmazonConfig) UnmarshalJSON

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

type LogsUploaderTargetConfigS3GcoreConfig

type LogsUploaderTargetConfigS3GcoreConfig struct {
	AccessKeyID  string `json:"access_key_id"`
	BucketName   string `json:"bucket_name"`
	Directory    string `json:"directory,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 (LogsUploaderTargetConfigS3GcoreConfig) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigS3GcoreConfig) UnmarshalJSON

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

type LogsUploaderTargetConfigSftpConfig

type LogsUploaderTargetConfigSftpConfig struct {
	Hostname       string `json:"hostname,required"`
	User           string `json:"user,required"`
	Directory      string `json:"directory,nullable"`
	KeyPassphrase  string `json:"key_passphrase,nullable"`
	Password       string `json:"password,nullable"`
	PrivateKey     string `json:"private_key,nullable"`
	TimeoutSeconds int64  `json:"timeout_seconds"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hostname       respjson.Field
		User           respjson.Field
		Directory      respjson.Field
		KeyPassphrase  respjson.Field
		Password       respjson.Field
		PrivateKey     respjson.Field
		TimeoutSeconds respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogsUploaderTargetConfigSftpConfig) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigSftpConfig) UnmarshalJSON

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

type LogsUploaderTargetConfigUnion

type LogsUploaderTargetConfigUnion struct {
	AccessKeyID string `json:"access_key_id"`
	BucketName  string `json:"bucket_name"`
	Directory   string `json:"directory"`
	// This field is from variant [LogsUploaderTargetConfigS3GcoreConfig].
	Endpoint string `json:"endpoint"`
	Region   string `json:"region"`
	// This field is from variant [LogsUploaderTargetConfigS3GcoreConfig].
	UsePathStyle   bool   `json:"use_path_style"`
	Hostname       string `json:"hostname"`
	TimeoutSeconds int64  `json:"timeout_seconds"`
	User           string `json:"user"`
	// This field is from variant [LogsUploaderTargetConfigSftpConfig].
	KeyPassphrase string `json:"key_passphrase"`
	// This field is from variant [LogsUploaderTargetConfigSftpConfig].
	Password string `json:"password"`
	// This field is from variant [LogsUploaderTargetConfigSftpConfig].
	PrivateKey string `json:"private_key"`
	// This field is from variant [LogsUploaderTargetConfigHTTPConfig].
	Append LogsUploaderTargetConfigHTTPConfigAppend `json:"append"`
	// This field is from variant [LogsUploaderTargetConfigHTTPConfig].
	Auth LogsUploaderTargetConfigHTTPConfigAuth `json:"auth"`
	// This field is from variant [LogsUploaderTargetConfigHTTPConfig].
	ContentType string `json:"content_type"`
	// This field is from variant [LogsUploaderTargetConfigHTTPConfig].
	Retry LogsUploaderTargetConfigHTTPConfigRetry `json:"retry"`
	// This field is from variant [LogsUploaderTargetConfigHTTPConfig].
	Upload LogsUploaderTargetConfigHTTPConfigUpload `json:"upload"`
	JSON   struct {
		AccessKeyID    respjson.Field
		BucketName     respjson.Field
		Directory      respjson.Field
		Endpoint       respjson.Field
		Region         respjson.Field
		UsePathStyle   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
		// contains filtered or unexported fields
	} `json:"-"`
}

LogsUploaderTargetConfigUnion contains all possible properties and values from LogsUploaderTargetConfigS3GcoreConfig, LogsUploaderTargetConfigS3AmazonConfig, LogsUploaderTargetConfigObject, LogsUploaderTargetConfigS3GcoreConfig, LogsUploaderTargetConfigS3GcoreConfig, LogsUploaderTargetConfigFtpConfig, LogsUploaderTargetConfigSftpConfig, LogsUploaderTargetConfigHTTPConfig.

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

func (LogsUploaderTargetConfigUnion) AsFtpConfig

func (LogsUploaderTargetConfigUnion) AsHTTPConfig

func (LogsUploaderTargetConfigUnion) AsLogsUploaderTargetConfigObject

func (u LogsUploaderTargetConfigUnion) AsLogsUploaderTargetConfigObject() (v LogsUploaderTargetConfigObject)

func (LogsUploaderTargetConfigUnion) AsLogsUploaderTargetConfigS3GcoreConfig

func (u LogsUploaderTargetConfigUnion) AsLogsUploaderTargetConfigS3GcoreConfig() (v LogsUploaderTargetConfigS3GcoreConfig)

func (LogsUploaderTargetConfigUnion) AsS3AmazonConfig

func (LogsUploaderTargetConfigUnion) AsS3GcoreConfig

func (LogsUploaderTargetConfigUnion) AsSftpConfig

func (LogsUploaderTargetConfigUnion) AsVariant2

func (LogsUploaderTargetConfigUnion) RawJSON

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetConfigUnion) UnmarshalJSON

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

type LogsUploaderTargetList

type LogsUploaderTargetList []LogsUploaderTarget

type LogsUploaderTargetListParams

type LogsUploaderTargetListParams struct {
	// 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 {
	// Config for specific storage type.
	Config LogsUploaderTargetNewParamsConfigUnion `json:"config,omitzero,required"`
	// Type of storage for logs.
	//
	// Any of "s3_gcore", "s3_amazon", "s3_oss", "s3_other", "s3_v1", "ftp", "sftp",
	// "http".
	StorageType LogsUploaderTargetNewParamsStorageType `json:"storage_type,omitzero,required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetNewParams) MarshalJSON

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

func (*LogsUploaderTargetNewParams) UnmarshalJSON

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

type LogsUploaderTargetNewParamsConfigFtpConfig

type LogsUploaderTargetNewParamsConfigFtpConfig struct {
	Hostname       string            `json:"hostname,required"`
	Password       string            `json:"password,required"`
	User           string            `json:"user,required"`
	Directory      param.Opt[string] `json:"directory,omitzero"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	// contains filtered or unexported fields
}

The properties Hostname, Password, User are required.

func (LogsUploaderTargetNewParamsConfigFtpConfig) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigFtpConfig) UnmarshalJSON

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

type LogsUploaderTargetNewParamsConfigHTTPConfig

type LogsUploaderTargetNewParamsConfigHTTPConfig struct {
	Upload LogsUploaderTargetNewParamsConfigHTTPConfigUpload `json:"upload,omitzero,required"`
	Append LogsUploaderTargetNewParamsConfigHTTPConfigAppend `json:"append,omitzero"`
	Auth   LogsUploaderTargetNewParamsConfigHTTPConfigAuth   `json:"auth,omitzero"`
	// Any of "json", "text".
	ContentType string                                           `json:"content_type,omitzero"`
	Retry       LogsUploaderTargetNewParamsConfigHTTPConfigRetry `json:"retry,omitzero"`
	// contains filtered or unexported fields
}

The property Upload is required.

func (LogsUploaderTargetNewParamsConfigHTTPConfig) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigHTTPConfig) UnmarshalJSON

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

type LogsUploaderTargetNewParamsConfigHTTPConfigAppend

type LogsUploaderTargetNewParamsConfigHTTPConfigAppend struct {
	URL            string            `json:"url,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 []LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetNewParamsConfigHTTPConfigAppend) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigHTTPConfigAppend) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction

type LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero,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 (LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction) MarshalJSON

func (*LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigHTTPConfigAuth

type LogsUploaderTargetNewParamsConfigHTTPConfigAuth struct {
	Config LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig `json:"config,omitzero,required"`
	// Any of "token".
	Type string `json:"type,omitzero,required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetNewParamsConfigHTTPConfigAuth) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigHTTPConfigAuth) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig

type LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig struct {
	Token      string `json:"token,required"`
	HeaderName string `json:"header_name,required"`
	// contains filtered or unexported fields
}

The properties Token, HeaderName are required.

func (LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig) MarshalJSON

func (*LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigHTTPConfigRetry

type LogsUploaderTargetNewParamsConfigHTTPConfigRetry struct {
	URL            string            `json:"url,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 []LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetNewParamsConfigHTTPConfigRetry) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigHTTPConfigRetry) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction

type LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero,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 (LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction) MarshalJSON

func (*LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigHTTPConfigUpload

type LogsUploaderTargetNewParamsConfigHTTPConfigUpload struct {
	URL            string            `json:"url,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 []LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetNewParamsConfigHTTPConfigUpload) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigHTTPConfigUpload) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction

type LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero,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 (LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction) MarshalJSON

func (*LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigS3AmazonConfig

type LogsUploaderTargetNewParamsConfigS3AmazonConfig struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Region, SecretAccessKey are required.

func (LogsUploaderTargetNewParamsConfigS3AmazonConfig) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigS3AmazonConfig) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigS3GcoreConfig

type LogsUploaderTargetNewParamsConfigS3GcoreConfig struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Endpoint        string            `json:"endpoint,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.

func (LogsUploaderTargetNewParamsConfigS3GcoreConfig) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigS3GcoreConfig) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigS3OssConfig

type LogsUploaderTargetNewParamsConfigS3OssConfig struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, SecretAccessKey are required.

func (LogsUploaderTargetNewParamsConfigS3OssConfig) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigS3OssConfig) UnmarshalJSON

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

type LogsUploaderTargetNewParamsConfigS3OtherConfig

type LogsUploaderTargetNewParamsConfigS3OtherConfig struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Endpoint        string            `json:"endpoint,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.

func (LogsUploaderTargetNewParamsConfigS3OtherConfig) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigS3OtherConfig) UnmarshalJSON

type LogsUploaderTargetNewParamsConfigS3V1Config

type LogsUploaderTargetNewParamsConfigS3V1Config struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Endpoint        string            `json:"endpoint,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.

func (LogsUploaderTargetNewParamsConfigS3V1Config) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigS3V1Config) UnmarshalJSON

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

type LogsUploaderTargetNewParamsConfigSftpConfig

type LogsUploaderTargetNewParamsConfigSftpConfig struct {
	Hostname       string            `json:"hostname,required"`
	User           string            `json:"user,required"`
	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"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	// contains filtered or unexported fields
}

The properties Hostname, User are required.

func (LogsUploaderTargetNewParamsConfigSftpConfig) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigSftpConfig) UnmarshalJSON

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

type LogsUploaderTargetNewParamsConfigUnion

type LogsUploaderTargetNewParamsConfigUnion struct {
	OfS3GcoreConfig  *LogsUploaderTargetNewParamsConfigS3GcoreConfig  `json:",omitzero,inline"`
	OfS3AmazonConfig *LogsUploaderTargetNewParamsConfigS3AmazonConfig `json:",omitzero,inline"`
	OfS3OssConfig    *LogsUploaderTargetNewParamsConfigS3OssConfig    `json:",omitzero,inline"`
	OfS3OtherConfig  *LogsUploaderTargetNewParamsConfigS3OtherConfig  `json:",omitzero,inline"`
	OfS3V1Config     *LogsUploaderTargetNewParamsConfigS3V1Config     `json:",omitzero,inline"`
	OfFtpConfig      *LogsUploaderTargetNewParamsConfigFtpConfig      `json:",omitzero,inline"`
	OfSftpConfig     *LogsUploaderTargetNewParamsConfigSftpConfig     `json:",omitzero,inline"`
	OfHTTPConfig     *LogsUploaderTargetNewParamsConfigHTTPConfig     `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 (LogsUploaderTargetNewParamsConfigUnion) GetAccessKeyID

func (u LogsUploaderTargetNewParamsConfigUnion) GetAccessKeyID() *string

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetAppend

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetAuth

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetBucketName

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetContentType

func (u LogsUploaderTargetNewParamsConfigUnion) GetContentType() *string

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetDirectory

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetEndpoint

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetHostname

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetKeyPassphrase

func (u LogsUploaderTargetNewParamsConfigUnion) GetKeyPassphrase() *string

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetPassword

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetPrivateKey

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetRegion

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetRetry

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetSecretAccessKey

func (u LogsUploaderTargetNewParamsConfigUnion) GetSecretAccessKey() *string

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetTimeoutSeconds

func (u LogsUploaderTargetNewParamsConfigUnion) GetTimeoutSeconds() *int64

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetUpload

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetUsePathStyle

func (u LogsUploaderTargetNewParamsConfigUnion) GetUsePathStyle() *bool

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) GetUser

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetNewParamsConfigUnion) MarshalJSON

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

func (*LogsUploaderTargetNewParamsConfigUnion) UnmarshalJSON

func (u *LogsUploaderTargetNewParamsConfigUnion) UnmarshalJSON(data []byte) error

type LogsUploaderTargetNewParamsStorageType

type LogsUploaderTargetNewParamsStorageType string

Type of storage for logs.

const (
	LogsUploaderTargetNewParamsStorageTypeS3Gcore  LogsUploaderTargetNewParamsStorageType = "s3_gcore"
	LogsUploaderTargetNewParamsStorageTypeS3Amazon LogsUploaderTargetNewParamsStorageType = "s3_amazon"
	LogsUploaderTargetNewParamsStorageTypeS3Oss    LogsUploaderTargetNewParamsStorageType = "s3_oss"
	LogsUploaderTargetNewParamsStorageTypeS3Other  LogsUploaderTargetNewParamsStorageType = "s3_other"
	LogsUploaderTargetNewParamsStorageTypeS3V1     LogsUploaderTargetNewParamsStorageType = "s3_v1"
	LogsUploaderTargetNewParamsStorageTypeFtp      LogsUploaderTargetNewParamsStorageType = "ftp"
	LogsUploaderTargetNewParamsStorageTypeSftp     LogsUploaderTargetNewParamsStorageType = "sftp"
	LogsUploaderTargetNewParamsStorageTypeHTTP     LogsUploaderTargetNewParamsStorageType = "http"
)

type LogsUploaderTargetReplaceParams

type LogsUploaderTargetReplaceParams struct {
	// Config for specific storage type.
	Config LogsUploaderTargetReplaceParamsConfigUnion `json:"config,omitzero,required"`
	// Type of storage for logs.
	//
	// Any of "s3_gcore", "s3_amazon", "s3_oss", "s3_other", "s3_v1", "ftp", "sftp",
	// "http".
	StorageType LogsUploaderTargetReplaceParamsStorageType `json:"storage_type,omitzero,required"`
	// Description of the target.
	Description param.Opt[string] `json:"description,omitzero"`
	// Name of the target.
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

func (LogsUploaderTargetReplaceParams) MarshalJSON

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

func (*LogsUploaderTargetReplaceParams) UnmarshalJSON

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

type LogsUploaderTargetReplaceParamsConfigFtpConfig

type LogsUploaderTargetReplaceParamsConfigFtpConfig struct {
	Hostname       string            `json:"hostname,required"`
	Password       string            `json:"password,required"`
	User           string            `json:"user,required"`
	Directory      param.Opt[string] `json:"directory,omitzero"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	// contains filtered or unexported fields
}

The properties Hostname, Password, User are required.

func (LogsUploaderTargetReplaceParamsConfigFtpConfig) MarshalJSON

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

func (*LogsUploaderTargetReplaceParamsConfigFtpConfig) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigHTTPConfig

type LogsUploaderTargetReplaceParamsConfigHTTPConfig struct {
	Upload LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload `json:"upload,omitzero,required"`
	Append LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend `json:"append,omitzero"`
	Auth   LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth   `json:"auth,omitzero"`
	// Any of "json", "text".
	ContentType string                                               `json:"content_type,omitzero"`
	Retry       LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry `json:"retry,omitzero"`
	// contains filtered or unexported fields
}

The property Upload is required.

func (LogsUploaderTargetReplaceParamsConfigHTTPConfig) MarshalJSON

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

func (*LogsUploaderTargetReplaceParamsConfigHTTPConfig) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend

type LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend struct {
	URL            string            `json:"url,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 []LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend) MarshalJSON

func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction

type LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero,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 (LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction) MarshalJSON

func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth

type LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth struct {
	Config LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig `json:"config,omitzero,required"`
	// Any of "token".
	Type string `json:"type,omitzero,required"`
	// contains filtered or unexported fields
}

The properties Config, Type are required.

func (LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth) MarshalJSON

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

func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig

type LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig struct {
	Token      string `json:"token,required"`
	HeaderName string `json:"header_name,required"`
	// contains filtered or unexported fields
}

The properties Token, HeaderName are required.

func (LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig) MarshalJSON

func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry

type LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry struct {
	URL            string            `json:"url,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 []LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry) MarshalJSON

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

func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction

type LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero,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 (LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction) MarshalJSON

func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload

type LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload struct {
	URL            string            `json:"url,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 []LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction `json:"response_actions,omitzero"`
	// contains filtered or unexported fields
}

The property URL is required.

func (LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload) MarshalJSON

func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction

type LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction struct {
	// Any of "drop", "retry", "append".
	Action          string            `json:"action,omitzero,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 (LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction) MarshalJSON

func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigS3AmazonConfig

type LogsUploaderTargetReplaceParamsConfigS3AmazonConfig struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Region, SecretAccessKey are required.

func (LogsUploaderTargetReplaceParamsConfigS3AmazonConfig) MarshalJSON

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

func (*LogsUploaderTargetReplaceParamsConfigS3AmazonConfig) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigS3GcoreConfig

type LogsUploaderTargetReplaceParamsConfigS3GcoreConfig struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Endpoint        string            `json:"endpoint,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.

func (LogsUploaderTargetReplaceParamsConfigS3GcoreConfig) MarshalJSON

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

func (*LogsUploaderTargetReplaceParamsConfigS3GcoreConfig) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigS3OssConfig

type LogsUploaderTargetReplaceParamsConfigS3OssConfig struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	Region          param.Opt[string] `json:"region,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, SecretAccessKey are required.

func (LogsUploaderTargetReplaceParamsConfigS3OssConfig) MarshalJSON

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

func (*LogsUploaderTargetReplaceParamsConfigS3OssConfig) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigS3OtherConfig

type LogsUploaderTargetReplaceParamsConfigS3OtherConfig struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Endpoint        string            `json:"endpoint,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.

func (LogsUploaderTargetReplaceParamsConfigS3OtherConfig) MarshalJSON

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

func (*LogsUploaderTargetReplaceParamsConfigS3OtherConfig) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigS3V1Config

type LogsUploaderTargetReplaceParamsConfigS3V1Config struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Endpoint        string            `json:"endpoint,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.

func (LogsUploaderTargetReplaceParamsConfigS3V1Config) MarshalJSON

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

func (*LogsUploaderTargetReplaceParamsConfigS3V1Config) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigSftpConfig

type LogsUploaderTargetReplaceParamsConfigSftpConfig struct {
	Hostname       string            `json:"hostname,required"`
	User           string            `json:"user,required"`
	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"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	// contains filtered or unexported fields
}

The properties Hostname, User are required.

func (LogsUploaderTargetReplaceParamsConfigSftpConfig) MarshalJSON

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

func (*LogsUploaderTargetReplaceParamsConfigSftpConfig) UnmarshalJSON

type LogsUploaderTargetReplaceParamsConfigUnion

type LogsUploaderTargetReplaceParamsConfigUnion struct {
	OfS3GcoreConfig  *LogsUploaderTargetReplaceParamsConfigS3GcoreConfig  `json:",omitzero,inline"`
	OfS3AmazonConfig *LogsUploaderTargetReplaceParamsConfigS3AmazonConfig `json:",omitzero,inline"`
	OfS3OssConfig    *LogsUploaderTargetReplaceParamsConfigS3OssConfig    `json:",omitzero,inline"`
	OfS3OtherConfig  *LogsUploaderTargetReplaceParamsConfigS3OtherConfig  `json:",omitzero,inline"`
	OfS3V1Config     *LogsUploaderTargetReplaceParamsConfigS3V1Config     `json:",omitzero,inline"`
	OfFtpConfig      *LogsUploaderTargetReplaceParamsConfigFtpConfig      `json:",omitzero,inline"`
	OfSftpConfig     *LogsUploaderTargetReplaceParamsConfigSftpConfig     `json:",omitzero,inline"`
	OfHTTPConfig     *LogsUploaderTargetReplaceParamsConfigHTTPConfig     `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 (LogsUploaderTargetReplaceParamsConfigUnion) GetAccessKeyID

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetAppend

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetAuth

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetBucketName

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetContentType

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetDirectory

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetEndpoint

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetHostname

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetKeyPassphrase

func (u LogsUploaderTargetReplaceParamsConfigUnion) GetKeyPassphrase() *string

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetPassword

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetPrivateKey

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetRegion

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetRetry

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetSecretAccessKey

func (u LogsUploaderTargetReplaceParamsConfigUnion) GetSecretAccessKey() *string

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetTimeoutSeconds

func (u LogsUploaderTargetReplaceParamsConfigUnion) GetTimeoutSeconds() *int64

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetUpload

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetUsePathStyle

func (u LogsUploaderTargetReplaceParamsConfigUnion) GetUsePathStyle() *bool

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) GetUser

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetReplaceParamsConfigUnion) MarshalJSON

func (*LogsUploaderTargetReplaceParamsConfigUnion) UnmarshalJSON

func (u *LogsUploaderTargetReplaceParamsConfigUnion) UnmarshalJSON(data []byte) error

type LogsUploaderTargetReplaceParamsStorageType

type LogsUploaderTargetReplaceParamsStorageType string

Type of storage for logs.

const (
	LogsUploaderTargetReplaceParamsStorageTypeS3Gcore  LogsUploaderTargetReplaceParamsStorageType = "s3_gcore"
	LogsUploaderTargetReplaceParamsStorageTypeS3Amazon LogsUploaderTargetReplaceParamsStorageType = "s3_amazon"
	LogsUploaderTargetReplaceParamsStorageTypeS3Oss    LogsUploaderTargetReplaceParamsStorageType = "s3_oss"
	LogsUploaderTargetReplaceParamsStorageTypeS3Other  LogsUploaderTargetReplaceParamsStorageType = "s3_other"
	LogsUploaderTargetReplaceParamsStorageTypeS3V1     LogsUploaderTargetReplaceParamsStorageType = "s3_v1"
	LogsUploaderTargetReplaceParamsStorageTypeFtp      LogsUploaderTargetReplaceParamsStorageType = "ftp"
	LogsUploaderTargetReplaceParamsStorageTypeSftp     LogsUploaderTargetReplaceParamsStorageType = "sftp"
	LogsUploaderTargetReplaceParamsStorageTypeHTTP     LogsUploaderTargetReplaceParamsStorageType = "http"
)

type LogsUploaderTargetService

type LogsUploaderTargetService struct {
	Options []option.RequestOption
}

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) 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 LogsUploaderTargetStatus

type LogsUploaderTargetStatus 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 (LogsUploaderTargetStatus) RawJSON

func (r LogsUploaderTargetStatus) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogsUploaderTargetStatus) UnmarshalJSON

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

type LogsUploaderTargetStorageType

type LogsUploaderTargetStorageType string

Type of storage for logs.

const (
	LogsUploaderTargetStorageTypeS3Gcore  LogsUploaderTargetStorageType = "s3_gcore"
	LogsUploaderTargetStorageTypeS3Amazon LogsUploaderTargetStorageType = "s3_amazon"
	LogsUploaderTargetStorageTypeS3Oss    LogsUploaderTargetStorageType = "s3_oss"
	LogsUploaderTargetStorageTypeS3Other  LogsUploaderTargetStorageType = "s3_other"
	LogsUploaderTargetStorageTypeS3V1     LogsUploaderTargetStorageType = "s3_v1"
	LogsUploaderTargetStorageTypeFtp      LogsUploaderTargetStorageType = "ftp"
	LogsUploaderTargetStorageTypeSftp     LogsUploaderTargetStorageType = "sftp"
	LogsUploaderTargetStorageTypeHTTP     LogsUploaderTargetStorageType = "http"
)

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".
	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 LogsUploaderTargetUpdateParamsConfigFtpConfig

type LogsUploaderTargetUpdateParamsConfigFtpConfig struct {
	Hostname       string            `json:"hostname,required"`
	Password       string            `json:"password,required"`
	User           string            `json:"user,required"`
	Directory      param.Opt[string] `json:"directory,omitzero"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	// contains filtered or unexported fields
}

The properties Hostname, Password, User are required.

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,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,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,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,required"`
	// Any of "token".
	Type string `json:"type,omitzero,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,required"`
	HeaderName string `json:"header_name,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,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,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,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,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,required"`
	BucketName      string            `json:"bucket_name,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,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 LogsUploaderTargetUpdateParamsConfigS3GcoreConfig

type LogsUploaderTargetUpdateParamsConfigS3GcoreConfig struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Endpoint        string            `json:"endpoint,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.

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,required"`
	BucketName      string            `json:"bucket_name,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,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 {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Endpoint        string            `json:"endpoint,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.

func (LogsUploaderTargetUpdateParamsConfigS3OtherConfig) MarshalJSON

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

func (*LogsUploaderTargetUpdateParamsConfigS3OtherConfig) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigS3V1Config

type LogsUploaderTargetUpdateParamsConfigS3V1Config struct {
	AccessKeyID     string            `json:"access_key_id,required"`
	BucketName      string            `json:"bucket_name,required"`
	Endpoint        string            `json:"endpoint,required"`
	Region          string            `json:"region,required"`
	SecretAccessKey string            `json:"secret_access_key,required"`
	Directory       param.Opt[string] `json:"directory,omitzero"`
	UsePathStyle    param.Opt[bool]   `json:"use_path_style,omitzero"`
	// contains filtered or unexported fields
}

The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.

func (LogsUploaderTargetUpdateParamsConfigS3V1Config) MarshalJSON

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

func (*LogsUploaderTargetUpdateParamsConfigS3V1Config) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigSftpConfig

type LogsUploaderTargetUpdateParamsConfigSftpConfig struct {
	Hostname       string            `json:"hostname,required"`
	User           string            `json:"user,required"`
	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"`
	TimeoutSeconds param.Opt[int64]  `json:"timeout_seconds,omitzero"`
	// contains filtered or unexported fields
}

The properties Hostname, User are required.

func (LogsUploaderTargetUpdateParamsConfigSftpConfig) MarshalJSON

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

func (*LogsUploaderTargetUpdateParamsConfigSftpConfig) UnmarshalJSON

type LogsUploaderTargetUpdateParamsConfigUnion

type LogsUploaderTargetUpdateParamsConfigUnion struct {
	OfS3GcoreConfig  *LogsUploaderTargetUpdateParamsConfigS3GcoreConfig  `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"`
	// 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) GetAppend

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetAuth

Returns a pointer to the underlying variant's property, if present.

func (LogsUploaderTargetUpdateParamsConfigUnion) GetBucketName

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) 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) 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) GetTimeoutSeconds

func (u LogsUploaderTargetUpdateParamsConfigUnion) GetTimeoutSeconds() *int64

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"
)

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,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,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,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,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,required"`
	// Contains one or more values to be compared against.
	Values []MetricListParamsFilterByValueUnion `json:"values,omitzero,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
}

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
}

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:"-"`
	// Origin group name.
	Name param.Opt[string] `query:"name,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.
	OfNoneAuth *OriginGroupNewParamsBodyNoneAuth `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	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

type OriginGroupNewParamsBodyAwsSignatureV4 struct {
	// Credentials to access the private bucket.
	Auth OriginGroupNewParamsBodyAwsSignatureV4Auth `json:"auth,omitzero,required"`
	// Authentication type.
	//
	// **awsSignatureV4** value is used for S3 storage.
	AuthType string `json:"auth_type,required"`
	// Origin group name.
	Name string `json:"name,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
}

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

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,required"`
	// S3 bucket name.
	//
	// Restrictions:
	//
	// - Maximum 128 characters.
	S3BucketName string `json:"s3_bucket_name,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,required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	// - **amazon** – AWS S3 storage.
	// - **other** – Other (not AWS) S3 compatible storage.
	S3Type string `json:"s3_type,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.
	S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
	// contains filtered or unexported fields
}

Credentials to access the private bucket.

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,required"`
	// List of origin sources in the origin group.
	Sources []OriginGroupNewParamsBodyNoneAuthSource `json:"sources,omitzero,required"`
	// Origin authentication type.
	//
	// Possible values:
	//
	// - **none** - Used for public origins.
	// - **awsSignatureV4** - Used for S3 storage.
	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
}

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 OriginGroupNewParamsBodyNoneAuthSource

type OriginGroupNewParamsBodyNoneAuthSource struct {
	// 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"`
	// IP address or domain name of the origin and the port, if custom port is used.
	Source param.Opt[string] `json:"source,omitzero"`
	// contains filtered or unexported fields
}

func (OriginGroupNewParamsBodyNoneAuthSource) MarshalJSON

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

func (*OriginGroupNewParamsBodyNoneAuthSource) UnmarshalJSON

func (r *OriginGroupNewParamsBodyNoneAuthSource) 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.
	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

type OriginGroupReplaceParamsBodyAwsSignatureV4 struct {
	// Credentials to access the private bucket.
	Auth OriginGroupReplaceParamsBodyAwsSignatureV4Auth `json:"auth,omitzero,required"`
	// Authentication type.
	//
	// **awsSignatureV4** value is used for S3 storage.
	AuthType string `json:"auth_type,required"`
	// Origin group name.
	Name string `json:"name,required"`
	// Parameter is **deprecated**.
	Path string `json:"path,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,required"`
	// 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 Auth, AuthType, Name, Path, 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

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,required"`
	// S3 bucket name.
	//
	// Restrictions:
	//
	// - Maximum 128 characters.
	S3BucketName string `json:"s3_bucket_name,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,required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	// - **amazon** – AWS S3 storage.
	// - **other** – Other (not AWS) S3 compatible storage.
	S3Type string `json:"s3_type,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.
	S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
	// contains filtered or unexported fields
}

Credentials to access the private bucket.

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 authentication type.
	//
	// Possible values:
	//
	// - **none** - Used for public origins.
	// - **awsSignatureV4** - Used for S3 storage.
	AuthType string `json:"auth_type,required"`
	// Origin group name.
	Name string `json:"name,required"`
	// Parameter is **deprecated**.
	Path string `json:"path,required"`
	// List of origin sources in the origin group.
	Sources []OriginGroupReplaceParamsBodyNoneAuthSource `json:"sources,omitzero,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,required"`
	// 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 AuthType, Name, Path, 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 OriginGroupReplaceParamsBodyNoneAuthSource

type OriginGroupReplaceParamsBodyNoneAuthSource struct {
	// 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"`
	// IP address or domain name of the origin and the port, if custom port is used.
	Source param.Opt[string] `json:"source,omitzero"`
	// contains filtered or unexported fields
}

func (OriginGroupReplaceParamsBodyNoneAuthSource) MarshalJSON

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

func (*OriginGroupReplaceParamsBodyNoneAuthSource) UnmarshalJSON

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

type OriginGroupService

type OriginGroupService struct {
	Options []option.RequestOption
}

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) 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.
	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

type OriginGroupUpdateParamsBodyAwsSignatureV4 struct {
	// Authentication type.
	//
	// **awsSignatureV4** value is used for S3 storage.
	AuthType param.Opt[string] `json:"auth_type,omitzero"`
	// Origin group name.
	Name param.Opt[string] `json:"name,omitzero"`
	// Parameter is **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"`
	// Credentials to access the private bucket.
	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
}

func (OriginGroupUpdateParamsBodyAwsSignatureV4) MarshalJSON

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

func (*OriginGroupUpdateParamsBodyAwsSignatureV4) UnmarshalJSON

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

type OriginGroupUpdateParamsBodyAwsSignatureV4Auth

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,required"`
	// S3 bucket name.
	//
	// Restrictions:
	//
	// - Maximum 128 characters.
	S3BucketName string `json:"s3_bucket_name,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,required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	// - **amazon** – AWS S3 storage.
	// - **other** – Other (not AWS) S3 compatible storage.
	S3Type string `json:"s3_type,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.
	S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
	// contains filtered or unexported fields
}

Credentials to access the private bucket.

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,required"`
	// Origin authentication type.
	//
	// Possible values:
	//
	// - **none** - Used for public origins.
	// - **awsSignatureV4** - Used for S3 storage.
	AuthType param.Opt[string] `json:"auth_type,omitzero"`
	// Parameter is **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"`
	// List of origin sources in the origin group.
	Sources []OriginGroupUpdateParamsBodyNoneAuthSource `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 OriginGroupUpdateParamsBodyNoneAuthSource

type OriginGroupUpdateParamsBodyNoneAuthSource struct {
	// 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"`
	// IP address or domain name of the origin and the port, if custom port is used.
	Source param.Opt[string] `json:"source,omitzero"`
	// contains filtered or unexported fields
}

func (OriginGroupUpdateParamsBodyNoneAuthSource) MarshalJSON

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

func (*OriginGroupUpdateParamsBodyNoneAuthSource) UnmarshalJSON

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

type OriginGroupsAwsSignatureV4

type OriginGroupsAwsSignatureV4 struct {
	// Origin group ID.
	ID int64 `json:"id"`
	// Credentials to access the private bucket.
	Auth OriginGroupsAwsSignatureV4Auth `json:"auth"`
	// Authentication type.
	//
	// **awsSignatureV4** value is used for S3 storage.
	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"`
	// Origin group name.
	Name string `json:"name"`
	// Parameter is **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
		HasRelatedResources respjson.Field
		Name                respjson.Field
		Path                respjson.Field
		ProxyNextUpstream   respjson.Field
		UseNext             respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

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

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,required"`
	// S3 bucket name.
	//
	// Restrictions:
	//
	// - Maximum 128 characters.
	S3BucketName string `json:"s3_bucket_name,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,required"`
	// Storage type compatible with S3.
	//
	// Possible values:
	//
	// - **amazon** – AWS S3 storage.
	// - **other** – Other (not AWS) S3 compatible storage.
	S3Type string `json:"s3_type,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.
	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:"-"`
}

Credentials to access the private bucket.

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 []OriginGroupsUnion

type OriginGroupsNoneAuth

type OriginGroupsNoneAuth struct {
	// Origin group ID.
	ID int64 `json:"id"`
	// Origin authentication type.
	//
	// Possible values:
	//
	// - **none** - Used for public origins.
	// - **awsSignatureV4** - Used for S3 storage.
	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"`
	// Origin group name.
	Name string `json:"name"`
	// Parameter is **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"`
	// List of origin sources in the origin group.
	Sources []OriginGroupsNoneAuthSource `json:"sources"`
	// 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
		AuthType            respjson.Field
		HasRelatedResources respjson.Field
		Name                respjson.Field
		Path                respjson.Field
		ProxyNextUpstream   respjson.Field
		Sources             respjson.Field
		UseNext             respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

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 OriginGroupsNoneAuthSource

type OriginGroupsNoneAuthSource struct {
	// 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"`
	// IP address or domain name of the origin and the port, if custom port is used.
	Source string `json:"source"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Backup      respjson.Field
		Enabled     respjson.Field
		Source      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (OriginGroupsNoneAuthSource) RawJSON

func (r OriginGroupsNoneAuthSource) RawJSON() string

Returns the unmodified JSON received from the API

func (*OriginGroupsNoneAuthSource) UnmarshalJSON

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

type OriginGroupsUnion

type OriginGroupsUnion struct {
	ID                  int64    `json:"id"`
	AuthType            string   `json:"auth_type"`
	HasRelatedResources bool     `json:"has_related_resources"`
	Name                string   `json:"name"`
	Path                string   `json:"path"`
	ProxyNextUpstream   []string `json:"proxy_next_upstream"`
	// This field is from variant [OriginGroupsNoneAuth].
	Sources []OriginGroupsNoneAuthSource `json:"sources"`
	UseNext bool                         `json:"use_next"`
	// This field is from variant [OriginGroupsAwsSignatureV4].
	Auth OriginGroupsAwsSignatureV4Auth `json:"auth"`
	JSON struct {
		ID                  respjson.Field
		AuthType            respjson.Field
		HasRelatedResources respjson.Field
		Name                respjson.Field
		Path                respjson.Field
		ProxyNextUpstream   respjson.Field
		Sources             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,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 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.
	//
	// Any of "HTTPS", "HTTP", "MATCH".
	OverrideOriginProtocol RuleTemplateOverrideOriginProtocol `json:"overrideOriginProtocol,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 []RuleTemplate

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,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,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.
	//
	// 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"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection RuleTemplateNewParamsOptionsBotProtection `json:"bot_protection,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_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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter RuleTemplateNewParamsOptionsRequestLimiter `json:"request_limiter,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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero,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 RuleTemplateNewParamsOptionsBotProtection

type RuleTemplateNewParamsOptionsBotProtection struct {
	// Controls the bot challenge module state.
	BotChallenge RuleTemplateNewParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// contains filtered or unexported fields
}

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

The properties BotChallenge, Enabled are required.

func (RuleTemplateNewParamsOptionsBotProtection) MarshalJSON

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

func (*RuleTemplateNewParamsOptionsBotProtection) UnmarshalJSON

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

type RuleTemplateNewParamsOptionsBotProtectionBotChallenge

type RuleTemplateNewParamsOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Controls the bot challenge module state.

func (RuleTemplateNewParamsOptionsBotProtectionBotChallenge) MarshalJSON

func (*RuleTemplateNewParamsOptionsBotProtectionBotChallenge) UnmarshalJSON

type RuleTemplateNewParamsOptionsBrotliCompression

type RuleTemplateNewParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,omitzero,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,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_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,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,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.

The property AppID is required.

func (RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON

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

func (*RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON

type RuleTemplateNewParamsOptionsFastedgeOnResponseBody

type RuleTemplateNewParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 RuleTemplateNewParamsOptionsRequestLimiter

type RuleTemplateNewParamsOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate int64 `json:"rate,required"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit,omitzero"`
	// contains filtered or unexported fields
}

Option allows to limit the amount of HTTP requests.

The properties Enabled, Rate are required.

func (RuleTemplateNewParamsOptionsRequestLimiter) MarshalJSON

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

func (*RuleTemplateNewParamsOptionsRequestLimiter) UnmarshalJSON

func (r *RuleTemplateNewParamsOptionsRequestLimiter) 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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []RuleTemplateNewParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,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,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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.
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,nullable"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection RuleTemplateOptionsBotProtection `json:"bot_protection,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,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,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,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,nullable"`
	// Enables control access to content for specified countries.
	CountryACL RuleTemplateOptionsCountryACL `json:"country_acl,nullable"`
	// **Legacy option**. Use the `edge_cache_settings` option instead.
	//
	// Allows the complete disabling of content caching.
	//
	// Deprecated: deprecated
	DisableCache RuleTemplateOptionsDisableCache `json:"disable_cache,nullable"`
	// Allows 206 responses regardless of the settings of an origin source.
	DisableProxyForceRanges RuleTemplateOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,nullable"`
	// Cache expiration time for CDN servers.
	//
	// `value` and `default` fields cannot be used simultaneously.
	EdgeCacheSettings RuleTemplateOptionsEdgeCacheSettings `json:"edge_cache_settings,nullable"`
	// Allows to configure FastEdge app to be called on different request/response
	// phases.
	//
	// Note: At least one of `on_request_headers`, `on_request_body`,
	// `on_response_headers`, or `on_response_body` must be specified.
	Fastedge RuleTemplateOptionsFastedge `json:"fastedge,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,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,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,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,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,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,nullable"`
	// Defines whether the files with the Set-Cookies header are cached as one file or
	// as different ones.
	IgnoreCookie RuleTemplateOptionsIgnoreCookie `json:"ignore_cookie,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,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,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,nullable"`
	// Allows to control the download speed per connection.
	LimitBandwidth RuleTemplateOptionsLimitBandwidth `json:"limit_bandwidth,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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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,nullable"`
	// Caching for POST requests along with default GET and HEAD.
	ProxyCacheMethodsSet RuleTemplateOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,nullable"`
	// The time limit for establishing a connection with the origin.
	ProxyConnectTimeout RuleTemplateOptionsProxyConnectTimeout `json:"proxy_connect_timeout,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,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,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,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,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,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,nullable"`
	// Controls access to the CDN resource content for specified domain names.
	ReferrerACL RuleTemplateOptionsReferrerACL `json:"referrer_acl,nullable"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter RuleTemplateOptionsRequestLimiter `json:"request_limiter,nullable"`
	// Hides HTTP headers from an origin server in the CDN response.
	ResponseHeadersHidingPolicy RuleTemplateOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,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,nullable"`
	// Configures access with tokenized URLs. This makes impossible to access content
	// without a valid (unexpired) token.
	SecureKey RuleTemplateOptionsSecureKey `json:"secure_key,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,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,nullable"`
	// Serves stale cached content in case of origin unavailability.
	Stale RuleTemplateOptionsStale `json:"stale,nullable"`
	// Custom HTTP Headers that a CDN server adds to a response.
	StaticResponseHeaders RuleTemplateOptionsStaticResponseHeaders `json:"static_response_headers,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,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,nullable"`
	// Controls access to the content for specified User-Agents.
	UserAgentACL RuleTemplateOptionsUserAgentACL `json:"user_agent_acl,nullable"`
	// Allows to enable WAAP (Web Application and API Protection).
	Waap RuleTemplateOptionsWaap `json:"waap,nullable"`
	// Enables or disables WebSockets connections to an origin server.
	Websockets RuleTemplateOptionsWebsockets `json:"websockets,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowedHTTPMethods          respjson.Field
		BotProtection               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
		RequestLimiter              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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,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 RuleTemplateOptionsBotProtection

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

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

func (RuleTemplateOptionsBotProtection) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsBotProtection) UnmarshalJSON

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

type RuleTemplateOptionsBotProtectionBotChallenge

type RuleTemplateOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled bool `json:"enabled"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Controls the bot challenge module state.

func (RuleTemplateOptionsBotProtectionBotChallenge) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsBotProtectionBotChallenge) UnmarshalJSON

func (r *RuleTemplateOptionsBotProtectionBotChallenge) 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,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders RuleTemplateOptionsFastedgeOnRequestHeaders `json:"on_request_headers"`
	// 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
		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_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,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,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.

func (RuleTemplateOptionsFastedgeOnRequestHeaders) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsFastedgeOnRequestHeaders) UnmarshalJSON

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

type RuleTemplateOptionsFastedgeOnResponseBody

type RuleTemplateOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 RuleTemplateOptionsRequestLimiter

type RuleTemplateOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate  int64 `json:"rate,required"`
	Burst int64 `json:"burst"`
	Delay int64 `json:"delay"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Enabled     respjson.Field
		Rate        respjson.Field
		Burst       respjson.Field
		Delay       respjson.Field
		RateUnit    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Option allows to limit the amount of HTTP requests.

func (RuleTemplateOptionsRequestLimiter) RawJSON

Returns the unmodified JSON received from the API

func (*RuleTemplateOptionsRequestLimiter) UnmarshalJSON

func (r *RuleTemplateOptionsRequestLimiter) 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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Key generated on your side that will be used for URL signing.
	Key string `json:"key,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []RuleTemplateOptionsStaticResponseHeadersValue `json:"value,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,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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.
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,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,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.
	//
	// 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"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection RuleTemplateReplaceParamsOptionsBotProtection `json:"bot_protection,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_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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter RuleTemplateReplaceParamsOptionsRequestLimiter `json:"request_limiter,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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero,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 RuleTemplateReplaceParamsOptionsBotProtection

type RuleTemplateReplaceParamsOptionsBotProtection struct {
	// Controls the bot challenge module state.
	BotChallenge RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// contains filtered or unexported fields
}

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

The properties BotChallenge, Enabled are required.

func (RuleTemplateReplaceParamsOptionsBotProtection) MarshalJSON

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

func (*RuleTemplateReplaceParamsOptionsBotProtection) UnmarshalJSON

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

type RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge

type RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Controls the bot challenge module state.

func (RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsBrotliCompression

type RuleTemplateReplaceParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,omitzero,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,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_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,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,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.

The property AppID is required.

func (RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON

func (*RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody

type RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 RuleTemplateReplaceParamsOptionsRequestLimiter

type RuleTemplateReplaceParamsOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate int64 `json:"rate,required"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit,omitzero"`
	// contains filtered or unexported fields
}

Option allows to limit the amount of HTTP requests.

The properties Enabled, Rate are required.

func (RuleTemplateReplaceParamsOptionsRequestLimiter) MarshalJSON

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

func (*RuleTemplateReplaceParamsOptionsRequestLimiter) UnmarshalJSON

type RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy

type RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,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,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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.
const (
	RuleTemplateReplaceParamsOverrideOriginProtocolHTTPS RuleTemplateReplaceParamsOverrideOriginProtocol = "HTTPS"
	RuleTemplateReplaceParamsOverrideOriginProtocolHTTP  RuleTemplateReplaceParamsOverrideOriginProtocol = "HTTP"
	RuleTemplateReplaceParamsOverrideOriginProtocolMatch RuleTemplateReplaceParamsOverrideOriginProtocol = "MATCH"
)

type RuleTemplateService

type RuleTemplateService struct {
	Options []option.RequestOption
}

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

func (r *RuleTemplateService) List(ctx context.Context, opts ...option.RequestOption) (res *RuleTemplateList, err error)

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.
	//
	// 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"`
	// Allows to prevent online services from overloading and ensure your business
	// workflow running smoothly.
	BotProtection RuleTemplateUpdateParamsOptionsBotProtection `json:"bot_protection,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_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.
	//
	// - **$`request_uri`**
	// - **$scheme**
	// - **$uri**
	//
	// **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"`
	// Option allows to limit the amount of HTTP requests.
	RequestLimiter RuleTemplateUpdateParamsOptionsRequestLimiter `json:"request_limiter,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,required"`
	// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
	Value []string `json:"value,omitzero,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 RuleTemplateUpdateParamsOptionsBotProtection

type RuleTemplateUpdateParamsOptionsBotProtection struct {
	// Controls the bot challenge module state.
	BotChallenge RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// contains filtered or unexported fields
}

Allows to prevent online services from overloading and ensure your business workflow running smoothly.

The properties BotChallenge, Enabled are required.

func (RuleTemplateUpdateParamsOptionsBotProtection) MarshalJSON

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

func (*RuleTemplateUpdateParamsOptionsBotProtection) UnmarshalJSON

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

type RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge

type RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge struct {
	// Possible values:
	//
	// - **true** - Bot challenge is enabled.
	// - **false** - Bot challenge is disabled.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// contains filtered or unexported fields
}

Controls the bot challenge module state.

func (RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge) MarshalJSON

func (*RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsBrotliCompression

type RuleTemplateUpdateParamsOptionsBrotliCompression struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,required"`
	// Set the cache expiration time to '0s' to disable caching.
	//
	// The maximum duration is any equivalent to `1y`.
	Value string `json:"value,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,required"`
	Value   []string `json:"value,omitzero,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,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": ["domain.com", "second.dom.com"]`
	//   - **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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - content caching is disabled.
	// - **false** - content caching is enabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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.
	OnRequestHeaders RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,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_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,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,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.

The property AppID is required.

func (RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON

func (*RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON

type RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody

type RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody struct {
	// The ID of the application in FastEdge.
	AppID string `json:"app_id,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Status code value.
	Code int64 `json:"code,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Time from which a custom HTTP response code should be applied. Indicated in
	// 24-hour format.
	StartTime string `json:"start_time,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Host Header value.
	Value string `json:"value,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,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.168.3.2/32`
	// - `2a03:d000:2980:7::8/128`
	ExceptedValues []string `json:"excepted_values,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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,required"`
	// Key for caching.
	Value string `json:"value,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.

- **$`request_uri`** - **$scheme** - **$uri**

**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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 5s**.
	Value string `json:"value,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,required"`
	// Timeout value in seconds.
	//
	// Supported range: **1s - 30s**.
	Value string `json:"value,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,required"`
	// List of query parameters.
	Value []string `json:"value,omitzero,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,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,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,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 RuleTemplateUpdateParamsOptionsRequestLimiter

type RuleTemplateUpdateParamsOptionsRequestLimiter struct {
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,required"`
	// Maximum request rate.
	Rate int64 `json:"rate,required"`
	// Units of measurement for the `rate` field.
	//
	// Possible values:
	//
	// - **r/s** - Requests per second.
	// - **r/m** - Requests per minute.
	//
	// If the rate is less than one request per second, it is specified in request per
	// minute (r/m.)
	//
	// Any of "r/s", "r/m".
	RateUnit string `json:"rate_unit,omitzero"`
	// contains filtered or unexported fields
}

Option allows to limit the amount of HTTP requests.

The properties Enabled, Rate are required.

func (RuleTemplateUpdateParamsOptionsRequestLimiter) MarshalJSON

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

func (*RuleTemplateUpdateParamsOptionsRequestLimiter) UnmarshalJSON

func (r *RuleTemplateUpdateParamsOptionsRequestLimiter) 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,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,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,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required" format:"domain"`
	// Controls the option state.
	//
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Enabled bool `json:"enabled,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,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,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,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,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,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,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,required"`
	Value   []RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,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,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,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,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,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,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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,required"`
	// Possible values:
	//
	// - **true** - Option is enabled.
	// - **false** - Option is disabled.
	Value bool `json:"value,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.
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 ShieldListResponse

type ShieldListResponse 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 (ShieldListResponse) RawJSON

func (r ShieldListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ShieldListResponse) UnmarshalJSON

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

type ShieldService

type ShieldService struct {
	Options []option.RequestOption
}

ShieldService 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 NewShieldService method instead.

func NewShieldService

func NewShieldService(opts ...option.RequestOption) (r ShieldService)

NewShieldService 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 (*ShieldService) List

func (r *ShieldService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ShieldListResponse, err error)

Get information about all origin shielding locations available in the account.

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.
	//
	// Possible values:
	//
	// - **true** - Certificate is used by a CDN resource.
	// - **false** - Certificate is not used by a CDN resource.
	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 []SslDetail

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"`
	// Detailed information about last attempt to issue a Let's Encrypt certificate.
	LatestStatus SslRequestStatusLatestStatus `json:"latest_status"`
	// 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,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 canceled. 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.

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 canceled. 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 StatisticGetLogsUsageAggregatedParams

type StatisticGetLogsUsageAggregatedParams struct {
	// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	From string `query:"from,required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to,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,required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to,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,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,required" json:"-"`
	// Service name.
	//
	// Possible value:
	//
	// - CDN
	Service string `query:"service,required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to,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.
	//
	// 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,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,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,required" json:"-"`
	// Service name.
	//
	// Possible value:
	//
	// - CDN
	Service string `query:"service,required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to,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.
	//
	// 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,required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to,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,required" json:"-"`
	// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
	To string `query:"to,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
}

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) 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:"-"`
	// 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,required"`
	// Public part of the CA certificate.
	//
	// It must be in the PEM format.
	SslCertificate string `json:"sslCertificate,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,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
}

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) 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 {
	// 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,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 {
		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