user

package
v2.0.0-beta.8 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditLogListParams

type AuditLogListParams struct {
	// Finds a specific log by its ID.
	ID     param.Field[string]                   `query:"id"`
	Action param.Field[AuditLogListParamsAction] `query:"action"`
	Actor  param.Field[AuditLogListParamsActor]  `query:"actor"`
	// Limits the returned results to logs older than the specified date. This can be a
	// date string `2019-04-30` or an absolute timestamp that conforms to RFC3339.
	Before param.Field[time.Time] `query:"before" format:"date-time"`
	// Changes the direction of the chronological sorting.
	Direction param.Field[AuditLogListParamsDirection] `query:"direction"`
	// Indicates that this request is an export of logs in CSV format.
	Export param.Field[bool] `query:"export"`
	// Indicates whether or not to hide user level audit logs.
	HideUserLogs param.Field[bool] `query:"hide_user_logs"`
	// Defines which page of results to return.
	Page param.Field[float64] `query:"page"`
	// Sets the number of results to return per page.
	PerPage param.Field[float64] `query:"per_page"`
	// Limits the returned results to logs newer than the specified date. This can be a
	// date string `2019-04-30` or an absolute timestamp that conforms to RFC3339.
	Since param.Field[time.Time]              `query:"since" format:"date-time"`
	Zone  param.Field[AuditLogListParamsZone] `query:"zone"`
}

func (AuditLogListParams) URLQuery

func (r AuditLogListParams) URLQuery() (v url.Values)

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

type AuditLogListParamsAction

type AuditLogListParamsAction struct {
	// Filters by the action type.
	Type param.Field[string] `query:"type"`
}

func (AuditLogListParamsAction) URLQuery

func (r AuditLogListParamsAction) URLQuery() (v url.Values)

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

type AuditLogListParamsActor

type AuditLogListParamsActor struct {
	// Filters by the email address of the actor that made the change.
	Email param.Field[string] `query:"email" format:"email"`
	// Filters by the IP address of the request that made the change by specific IP
	// address or valid CIDR Range.
	IP param.Field[string] `query:"ip"`
}

func (AuditLogListParamsActor) URLQuery

func (r AuditLogListParamsActor) URLQuery() (v url.Values)

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

type AuditLogListParamsDirection

type AuditLogListParamsDirection string

Changes the direction of the chronological sorting.

const (
	AuditLogListParamsDirectionDesc AuditLogListParamsDirection = "desc"
	AuditLogListParamsDirectionAsc  AuditLogListParamsDirection = "asc"
)

type AuditLogListParamsZone

type AuditLogListParamsZone struct {
	// Filters by the name of the zone associated to the change.
	Name param.Field[string] `query:"name"`
}

func (AuditLogListParamsZone) URLQuery

func (r AuditLogListParamsZone) URLQuery() (v url.Values)

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

type AuditLogListResponse

type AuditLogListResponse struct {
	// A string that uniquely identifies the audit log.
	ID     string                     `json:"id"`
	Action AuditLogListResponseAction `json:"action"`
	Actor  AuditLogListResponseActor  `json:"actor"`
	// The source of the event.
	Interface string `json:"interface"`
	// An object which can lend more context to the action being logged. This is a
	// flexible value and varies between different actions.
	Metadata interface{} `json:"metadata"`
	// The new value of the resource that was modified.
	NewValue string `json:"newValue"`
	// The value of the resource before it was modified.
	OldValue string                       `json:"oldValue"`
	Owner    AuditLogListResponseOwner    `json:"owner"`
	Resource AuditLogListResponseResource `json:"resource"`
	// A UTC RFC3339 timestamp that specifies when the action being logged occured.
	When time.Time                `json:"when" format:"date-time"`
	JSON auditLogListResponseJSON `json:"-"`
}

func (*AuditLogListResponse) UnmarshalJSON

func (r *AuditLogListResponse) UnmarshalJSON(data []byte) (err error)

type AuditLogListResponseAction

type AuditLogListResponseAction struct {
	// A boolean that indicates if the action attempted was successful.
	Result bool `json:"result"`
	// A short string that describes the action that was performed.
	Type string                         `json:"type"`
	JSON auditLogListResponseActionJSON `json:"-"`
}

func (*AuditLogListResponseAction) UnmarshalJSON

func (r *AuditLogListResponseAction) UnmarshalJSON(data []byte) (err error)

type AuditLogListResponseActor

type AuditLogListResponseActor struct {
	// The ID of the actor that performed the action. If a user performed the action,
	// this will be their User ID.
	ID string `json:"id"`
	// The email of the user that performed the action.
	Email string `json:"email" format:"email"`
	// The IP address of the request that performed the action.
	IP string `json:"ip"`
	// The type of actor, whether a User, Cloudflare Admin, or an Automated System.
	Type AuditLogListResponseActorType `json:"type"`
	JSON auditLogListResponseActorJSON `json:"-"`
}

func (*AuditLogListResponseActor) UnmarshalJSON

func (r *AuditLogListResponseActor) UnmarshalJSON(data []byte) (err error)

type AuditLogListResponseActorType

type AuditLogListResponseActorType string

The type of actor, whether a User, Cloudflare Admin, or an Automated System.

const (
	AuditLogListResponseActorTypeUser       AuditLogListResponseActorType = "user"
	AuditLogListResponseActorTypeAdmin      AuditLogListResponseActorType = "admin"
	AuditLogListResponseActorTypeCloudflare AuditLogListResponseActorType = "Cloudflare"
)

type AuditLogListResponseOwner

type AuditLogListResponseOwner struct {
	// Identifier
	ID   string                        `json:"id"`
	JSON auditLogListResponseOwnerJSON `json:"-"`
}

func (*AuditLogListResponseOwner) UnmarshalJSON

func (r *AuditLogListResponseOwner) UnmarshalJSON(data []byte) (err error)

type AuditLogListResponseResource

type AuditLogListResponseResource struct {
	// An identifier for the resource that was affected by the action.
	ID string `json:"id"`
	// A short string that describes the resource that was affected by the action.
	Type string                           `json:"type"`
	JSON auditLogListResponseResourceJSON `json:"-"`
}

func (*AuditLogListResponseResource) UnmarshalJSON

func (r *AuditLogListResponseResource) UnmarshalJSON(data []byte) (err error)

type AuditLogService

type AuditLogService struct {
	Options []option.RequestOption
}

AuditLogService contains methods and other services that help with interacting with the cloudflare 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) List

Gets a list of audit logs for a user account. Can be filtered by who made the change, on which zone, and the timeframe of the change.

func (*AuditLogService) ListAutoPaging

Gets a list of audit logs for a user account. Can be filtered by who made the change, on which zone, and the timeframe of the change.

type BillSubsAPIBillingHistory

type BillSubsAPIBillingHistory struct {
	// Billing item identifier tag.
	ID string `json:"id,required"`
	// The billing item action.
	Action string `json:"action,required"`
	// The amount associated with this billing item.
	Amount float64 `json:"amount,required"`
	// The monetary unit in which pricing information is displayed.
	Currency string `json:"currency,required"`
	// The billing item description.
	Description string `json:"description,required"`
	// When the billing item was created.
	OccurredAt time.Time `json:"occurred_at,required" format:"date-time"`
	// The billing item type.
	Type string                        `json:"type,required"`
	Zone BillSubsAPIBillingHistoryZone `json:"zone,required"`
	JSON billSubsAPIBillingHistoryJSON `json:"-"`
}

func (*BillSubsAPIBillingHistory) UnmarshalJSON

func (r *BillSubsAPIBillingHistory) UnmarshalJSON(data []byte) (err error)

type BillSubsAPIBillingHistoryZone

type BillSubsAPIBillingHistoryZone struct {
	Name interface{}                       `json:"name"`
	JSON billSubsAPIBillingHistoryZoneJSON `json:"-"`
}

func (*BillSubsAPIBillingHistoryZone) UnmarshalJSON

func (r *BillSubsAPIBillingHistoryZone) UnmarshalJSON(data []byte) (err error)

type BillingHistoryGetParams

type BillingHistoryGetParams struct {
	// Field to order billing history by.
	Order param.Field[BillingHistoryGetParamsOrder] `query:"order"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// Number of items per page.
	PerPage param.Field[float64] `query:"per_page"`
}

func (BillingHistoryGetParams) URLQuery

func (r BillingHistoryGetParams) URLQuery() (v url.Values)

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

type BillingHistoryGetParamsOrder

type BillingHistoryGetParamsOrder string

Field to order billing history by.

const (
	BillingHistoryGetParamsOrderType      BillingHistoryGetParamsOrder = "type"
	BillingHistoryGetParamsOrderOccuredAt BillingHistoryGetParamsOrder = "occured_at"
	BillingHistoryGetParamsOrderAction    BillingHistoryGetParamsOrder = "action"
)

type BillingHistoryGetResponseEnvelope

type BillingHistoryGetResponseEnvelope struct {
	Errors   []BillingHistoryGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []BillingHistoryGetResponseEnvelopeMessages `json:"messages,required"`
	Result   []BillSubsAPIBillingHistory                 `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    BillingHistoryGetResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo BillingHistoryGetResponseEnvelopeResultInfo `json:"result_info"`
	JSON       billingHistoryGetResponseEnvelopeJSON       `json:"-"`
}

func (*BillingHistoryGetResponseEnvelope) UnmarshalJSON

func (r *BillingHistoryGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type BillingHistoryGetResponseEnvelopeErrors

type BillingHistoryGetResponseEnvelopeErrors struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    billingHistoryGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*BillingHistoryGetResponseEnvelopeErrors) UnmarshalJSON

func (r *BillingHistoryGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type BillingHistoryGetResponseEnvelopeMessages

type BillingHistoryGetResponseEnvelopeMessages struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    billingHistoryGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*BillingHistoryGetResponseEnvelopeMessages) UnmarshalJSON

func (r *BillingHistoryGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type BillingHistoryGetResponseEnvelopeResultInfo

type BillingHistoryGetResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                         `json:"total_count"`
	JSON       billingHistoryGetResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*BillingHistoryGetResponseEnvelopeResultInfo) UnmarshalJSON

func (r *BillingHistoryGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type BillingHistoryGetResponseEnvelopeSuccess

type BillingHistoryGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	BillingHistoryGetResponseEnvelopeSuccessTrue BillingHistoryGetResponseEnvelopeSuccess = true
)

type BillingHistoryService

type BillingHistoryService struct {
	Options []option.RequestOption
}

BillingHistoryService contains methods and other services that help with interacting with the cloudflare 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 NewBillingHistoryService method instead.

func NewBillingHistoryService

func NewBillingHistoryService(opts ...option.RequestOption) (r *BillingHistoryService)

NewBillingHistoryService 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 (*BillingHistoryService) Get

Accesses your billing history object.

type BillingProfileGetResponse

type BillingProfileGetResponse interface {
	ImplementsUserBillingProfileGetResponse()
}

Union satisfied by user.BillingProfileGetResponseUnknown or shared.UnionString.

type BillingProfileGetResponseEnvelope

type BillingProfileGetResponseEnvelope struct {
	Errors   []BillingProfileGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []BillingProfileGetResponseEnvelopeMessages `json:"messages,required"`
	Result   BillingProfileGetResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success BillingProfileGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    billingProfileGetResponseEnvelopeJSON    `json:"-"`
}

func (*BillingProfileGetResponseEnvelope) UnmarshalJSON

func (r *BillingProfileGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type BillingProfileGetResponseEnvelopeErrors

type BillingProfileGetResponseEnvelopeErrors struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    billingProfileGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*BillingProfileGetResponseEnvelopeErrors) UnmarshalJSON

func (r *BillingProfileGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type BillingProfileGetResponseEnvelopeMessages

type BillingProfileGetResponseEnvelopeMessages struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    billingProfileGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*BillingProfileGetResponseEnvelopeMessages) UnmarshalJSON

func (r *BillingProfileGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type BillingProfileGetResponseEnvelopeSuccess

type BillingProfileGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	BillingProfileGetResponseEnvelopeSuccessTrue BillingProfileGetResponseEnvelopeSuccess = true
)

type BillingProfileService

type BillingProfileService struct {
	Options []option.RequestOption
}

BillingProfileService contains methods and other services that help with interacting with the cloudflare 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 NewBillingProfileService method instead.

func NewBillingProfileService

func NewBillingProfileService(opts ...option.RequestOption) (r *BillingProfileService)

NewBillingProfileService 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 (*BillingProfileService) Get

Accesses your billing profile object.

type BillingService

type BillingService struct {
	Options []option.RequestOption
	History *BillingHistoryService
	Profile *BillingProfileService
}

BillingService contains methods and other services that help with interacting with the cloudflare 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 NewBillingService method instead.

func NewBillingService

func NewBillingService(opts ...option.RequestOption) (r *BillingService)

NewBillingService 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 Error

type Error = apierror.Error

type FirewallAccessRuleDeleteResponse

type FirewallAccessRuleDeleteResponse struct {
	// The unique identifier of the IP Access rule.
	ID   string                               `json:"id"`
	JSON firewallAccessRuleDeleteResponseJSON `json:"-"`
}

func (*FirewallAccessRuleDeleteResponse) UnmarshalJSON

func (r *FirewallAccessRuleDeleteResponse) UnmarshalJSON(data []byte) (err error)

type FirewallAccessRuleDeleteResponseEnvelope

type FirewallAccessRuleDeleteResponseEnvelope struct {
	Errors   []FirewallAccessRuleDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []FirewallAccessRuleDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   FirewallAccessRuleDeleteResponse                   `json:"result,required,nullable"`
	// Whether the API call was successful
	Success FirewallAccessRuleDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    firewallAccessRuleDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*FirewallAccessRuleDeleteResponseEnvelope) UnmarshalJSON

func (r *FirewallAccessRuleDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type FirewallAccessRuleDeleteResponseEnvelopeErrors

type FirewallAccessRuleDeleteResponseEnvelopeErrors struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    firewallAccessRuleDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*FirewallAccessRuleDeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *FirewallAccessRuleDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type FirewallAccessRuleDeleteResponseEnvelopeMessages

type FirewallAccessRuleDeleteResponseEnvelopeMessages struct {
	Code    int64                                                `json:"code,required"`
	Message string                                               `json:"message,required"`
	JSON    firewallAccessRuleDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*FirewallAccessRuleDeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *FirewallAccessRuleDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type FirewallAccessRuleDeleteResponseEnvelopeSuccess

type FirewallAccessRuleDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	FirewallAccessRuleDeleteResponseEnvelopeSuccessTrue FirewallAccessRuleDeleteResponseEnvelopeSuccess = true
)

type FirewallAccessRuleEditParams

type FirewallAccessRuleEditParams struct {
	// The action to apply to a matched request.
	Mode param.Field[FirewallAccessRuleEditParamsMode] `json:"mode"`
	// An informative summary of the rule, typically used as a reminder or explanation.
	Notes param.Field[string] `json:"notes"`
}

func (FirewallAccessRuleEditParams) MarshalJSON

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

type FirewallAccessRuleEditParamsMode

type FirewallAccessRuleEditParamsMode string

The action to apply to a matched request.

const (
	FirewallAccessRuleEditParamsModeBlock            FirewallAccessRuleEditParamsMode = "block"
	FirewallAccessRuleEditParamsModeChallenge        FirewallAccessRuleEditParamsMode = "challenge"
	FirewallAccessRuleEditParamsModeWhitelist        FirewallAccessRuleEditParamsMode = "whitelist"
	FirewallAccessRuleEditParamsModeJsChallenge      FirewallAccessRuleEditParamsMode = "js_challenge"
	FirewallAccessRuleEditParamsModeManagedChallenge FirewallAccessRuleEditParamsMode = "managed_challenge"
)

type FirewallAccessRuleEditResponseEnvelope

type FirewallAccessRuleEditResponseEnvelope struct {
	Errors   []FirewallAccessRuleEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []FirewallAccessRuleEditResponseEnvelopeMessages `json:"messages,required"`
	Result   LegacyJhsRule                                    `json:"result,required,nullable"`
	// Whether the API call was successful
	Success FirewallAccessRuleEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    firewallAccessRuleEditResponseEnvelopeJSON    `json:"-"`
}

func (*FirewallAccessRuleEditResponseEnvelope) UnmarshalJSON

func (r *FirewallAccessRuleEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type FirewallAccessRuleEditResponseEnvelopeErrors

type FirewallAccessRuleEditResponseEnvelopeErrors struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    firewallAccessRuleEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*FirewallAccessRuleEditResponseEnvelopeErrors) UnmarshalJSON

func (r *FirewallAccessRuleEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type FirewallAccessRuleEditResponseEnvelopeMessages

type FirewallAccessRuleEditResponseEnvelopeMessages struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    firewallAccessRuleEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*FirewallAccessRuleEditResponseEnvelopeMessages) UnmarshalJSON

func (r *FirewallAccessRuleEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type FirewallAccessRuleEditResponseEnvelopeSuccess

type FirewallAccessRuleEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	FirewallAccessRuleEditResponseEnvelopeSuccessTrue FirewallAccessRuleEditResponseEnvelopeSuccess = true
)

type FirewallAccessRuleListParams

type FirewallAccessRuleListParams struct {
	// The direction used to sort returned rules.
	Direction     param.Field[FirewallAccessRuleListParamsDirection]     `query:"direction"`
	EgsPagination param.Field[FirewallAccessRuleListParamsEgsPagination] `query:"egs-pagination"`
	Filters       param.Field[FirewallAccessRuleListParamsFilters]       `query:"filters"`
	// The field used to sort returned rules.
	Order param.Field[FirewallAccessRuleListParamsOrder] `query:"order"`
	// Requested page within paginated list of results.
	Page param.Field[float64] `query:"page"`
	// Maximum number of results requested.
	PerPage param.Field[float64] `query:"per_page"`
}

func (FirewallAccessRuleListParams) URLQuery

func (r FirewallAccessRuleListParams) URLQuery() (v url.Values)

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

type FirewallAccessRuleListParamsDirection

type FirewallAccessRuleListParamsDirection string

The direction used to sort returned rules.

const (
	FirewallAccessRuleListParamsDirectionAsc  FirewallAccessRuleListParamsDirection = "asc"
	FirewallAccessRuleListParamsDirectionDesc FirewallAccessRuleListParamsDirection = "desc"
)

type FirewallAccessRuleListParamsEgsPagination

type FirewallAccessRuleListParamsEgsPagination struct {
	Json param.Field[FirewallAccessRuleListParamsEgsPaginationJson] `query:"json"`
}

func (FirewallAccessRuleListParamsEgsPagination) URLQuery

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

type FirewallAccessRuleListParamsEgsPaginationJson

type FirewallAccessRuleListParamsEgsPaginationJson struct {
	// The page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// The maximum number of results per page. You can only set the value to `1` or to
	// a multiple of 5 such as `5`, `10`, `15`, or `20`.
	PerPage param.Field[float64] `query:"per_page"`
}

func (FirewallAccessRuleListParamsEgsPaginationJson) URLQuery

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

type FirewallAccessRuleListParamsFilters

type FirewallAccessRuleListParamsFilters struct {
	// The target to search in existing rules.
	ConfigurationTarget param.Field[FirewallAccessRuleListParamsFiltersConfigurationTarget] `query:"configuration.target"`
	// The target value to search for in existing rules: an IP address, an IP address
	// range, or a country code, depending on the provided `configuration.target`.
	// Notes: You can search for a single IPv4 address, an IP address range with a
	// subnet of '/16' or '/24', or a two-letter ISO-3166-1 alpha-2 country code.
	ConfigurationValue param.Field[string] `query:"configuration.value"`
	// When set to `all`, all the search requirements must match. When set to `any`,
	// only one of the search requirements has to match.
	Match param.Field[FirewallAccessRuleListParamsFiltersMatch] `query:"match"`
	// The action to apply to a matched request.
	Mode param.Field[FirewallAccessRuleListParamsFiltersMode] `query:"mode"`
	// The string to search for in the notes of existing IP Access rules. Notes: For
	// example, the string 'attack' would match IP Access rules with notes 'Attack
	// 26/02' and 'Attack 27/02'. The search is case insensitive.
	Notes param.Field[string] `query:"notes"`
}

func (FirewallAccessRuleListParamsFilters) URLQuery

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

type FirewallAccessRuleListParamsFiltersConfigurationTarget

type FirewallAccessRuleListParamsFiltersConfigurationTarget string

The target to search in existing rules.

const (
	FirewallAccessRuleListParamsFiltersConfigurationTargetIP      FirewallAccessRuleListParamsFiltersConfigurationTarget = "ip"
	FirewallAccessRuleListParamsFiltersConfigurationTargetIPRange FirewallAccessRuleListParamsFiltersConfigurationTarget = "ip_range"
	FirewallAccessRuleListParamsFiltersConfigurationTargetASN     FirewallAccessRuleListParamsFiltersConfigurationTarget = "asn"
	FirewallAccessRuleListParamsFiltersConfigurationTargetCountry FirewallAccessRuleListParamsFiltersConfigurationTarget = "country"
)

type FirewallAccessRuleListParamsFiltersMatch

type FirewallAccessRuleListParamsFiltersMatch string

When set to `all`, all the search requirements must match. When set to `any`, only one of the search requirements has to match.

const (
	FirewallAccessRuleListParamsFiltersMatchAny FirewallAccessRuleListParamsFiltersMatch = "any"
	FirewallAccessRuleListParamsFiltersMatchAll FirewallAccessRuleListParamsFiltersMatch = "all"
)

type FirewallAccessRuleListParamsFiltersMode

type FirewallAccessRuleListParamsFiltersMode string

The action to apply to a matched request.

const (
	FirewallAccessRuleListParamsFiltersModeBlock            FirewallAccessRuleListParamsFiltersMode = "block"
	FirewallAccessRuleListParamsFiltersModeChallenge        FirewallAccessRuleListParamsFiltersMode = "challenge"
	FirewallAccessRuleListParamsFiltersModeWhitelist        FirewallAccessRuleListParamsFiltersMode = "whitelist"
	FirewallAccessRuleListParamsFiltersModeJsChallenge      FirewallAccessRuleListParamsFiltersMode = "js_challenge"
	FirewallAccessRuleListParamsFiltersModeManagedChallenge FirewallAccessRuleListParamsFiltersMode = "managed_challenge"
)

type FirewallAccessRuleListParamsOrder

type FirewallAccessRuleListParamsOrder string

The field used to sort returned rules.

const (
	FirewallAccessRuleListParamsOrderConfigurationTarget FirewallAccessRuleListParamsOrder = "configuration.target"
	FirewallAccessRuleListParamsOrderConfigurationValue  FirewallAccessRuleListParamsOrder = "configuration.value"
	FirewallAccessRuleListParamsOrderMode                FirewallAccessRuleListParamsOrder = "mode"
)

type FirewallAccessRuleNewParams

type FirewallAccessRuleNewParams struct {
	// The rule configuration.
	Configuration param.Field[FirewallAccessRuleNewParamsConfiguration] `json:"configuration,required"`
	// The action to apply to a matched request.
	Mode param.Field[FirewallAccessRuleNewParamsMode] `json:"mode,required"`
	// An informative summary of the rule, typically used as a reminder or explanation.
	Notes param.Field[string] `json:"notes"`
}

func (FirewallAccessRuleNewParams) MarshalJSON

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

type FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfiguration

type FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfiguration struct {
	// The configuration target. You must set the target to `asn` when specifying an
	// Autonomous System Number (ASN) in the rule.
	Target param.Field[FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTarget] `json:"target"`
	// The AS number to match.
	Value param.Field[string] `json:"value"`
}

func (FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfiguration) MarshalJSON

type FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTarget

type FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTarget string

The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule.

const (
	FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTargetASN FirewallAccessRuleNewParamsConfigurationLegacyJhsASNConfigurationTarget = "asn"
)

type FirewallAccessRuleNewParamsConfigurationLegacyJhsCIDRConfiguration

type FirewallAccessRuleNewParamsConfigurationLegacyJhsCIDRConfiguration struct {
	// The configuration target. You must set the target to `ip_range` when specifying
	// an IP address range in the rule.
	Target param.Field[FirewallAccessRuleNewParamsConfigurationLegacyJhsCIDRConfigurationTarget] `json:"target"`
	// The IP address range to match. You can only use prefix lengths `/16` and `/24`
	// for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges.
	Value param.Field[string] `json:"value"`
}

func (FirewallAccessRuleNewParamsConfigurationLegacyJhsCIDRConfiguration) MarshalJSON

type FirewallAccessRuleNewParamsConfigurationLegacyJhsCIDRConfigurationTarget

type FirewallAccessRuleNewParamsConfigurationLegacyJhsCIDRConfigurationTarget string

The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule.

const (
	FirewallAccessRuleNewParamsConfigurationLegacyJhsCIDRConfigurationTargetIPRange FirewallAccessRuleNewParamsConfigurationLegacyJhsCIDRConfigurationTarget = "ip_range"
)

type FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration

type FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration struct {
	// The configuration target. You must set the target to `country` when specifying a
	// country code in the rule.
	Target param.Field[FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget] `json:"target"`
	// The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to
	// [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country).
	Value param.Field[string] `json:"value"`
}

func (FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfiguration) MarshalJSON

type FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget

type FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget string

The configuration target. You must set the target to `country` when specifying a country code in the rule.

const (
	FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTargetCountry FirewallAccessRuleNewParamsConfigurationLegacyJhsCountryConfigurationTarget = "country"
)

type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfiguration

type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfiguration struct {
	// The configuration target. You must set the target to `ip` when specifying an IP
	// address in the rule.
	Target param.Field[FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget] `json:"target"`
	// The IP address to match. This address will be compared to the IP address of
	// incoming requests.
	Value param.Field[string] `json:"value"`
}

func (FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfiguration) MarshalJSON

type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget

type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget string

The configuration target. You must set the target to `ip` when specifying an IP address in the rule.

const (
	FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTargetIP FirewallAccessRuleNewParamsConfigurationLegacyJhsIPConfigurationTarget = "ip"
)

type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration

type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration struct {
	// The configuration target. You must set the target to `ip6` when specifying an
	// IPv6 address in the rule.
	Target param.Field[FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget] `json:"target"`
	// The IPv6 address to match.
	Value param.Field[string] `json:"value"`
}

func (FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6Configuration) MarshalJSON

type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget

type FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget string

The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule.

const (
	FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTargetIp6 FirewallAccessRuleNewParamsConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6"
)

type FirewallAccessRuleNewParamsMode

type FirewallAccessRuleNewParamsMode string

The action to apply to a matched request.

const (
	FirewallAccessRuleNewParamsModeBlock            FirewallAccessRuleNewParamsMode = "block"
	FirewallAccessRuleNewParamsModeChallenge        FirewallAccessRuleNewParamsMode = "challenge"
	FirewallAccessRuleNewParamsModeWhitelist        FirewallAccessRuleNewParamsMode = "whitelist"
	FirewallAccessRuleNewParamsModeJsChallenge      FirewallAccessRuleNewParamsMode = "js_challenge"
	FirewallAccessRuleNewParamsModeManagedChallenge FirewallAccessRuleNewParamsMode = "managed_challenge"
)

type FirewallAccessRuleNewResponseEnvelope

type FirewallAccessRuleNewResponseEnvelope struct {
	Errors   []FirewallAccessRuleNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []FirewallAccessRuleNewResponseEnvelopeMessages `json:"messages,required"`
	Result   LegacyJhsRule                                   `json:"result,required,nullable"`
	// Whether the API call was successful
	Success FirewallAccessRuleNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    firewallAccessRuleNewResponseEnvelopeJSON    `json:"-"`
}

func (*FirewallAccessRuleNewResponseEnvelope) UnmarshalJSON

func (r *FirewallAccessRuleNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type FirewallAccessRuleNewResponseEnvelopeErrors

type FirewallAccessRuleNewResponseEnvelopeErrors struct {
	Code    int64                                           `json:"code,required"`
	Message string                                          `json:"message,required"`
	JSON    firewallAccessRuleNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*FirewallAccessRuleNewResponseEnvelopeErrors) UnmarshalJSON

func (r *FirewallAccessRuleNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type FirewallAccessRuleNewResponseEnvelopeMessages

type FirewallAccessRuleNewResponseEnvelopeMessages struct {
	Code    int64                                             `json:"code,required"`
	Message string                                            `json:"message,required"`
	JSON    firewallAccessRuleNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*FirewallAccessRuleNewResponseEnvelopeMessages) UnmarshalJSON

func (r *FirewallAccessRuleNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type FirewallAccessRuleNewResponseEnvelopeSuccess

type FirewallAccessRuleNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	FirewallAccessRuleNewResponseEnvelopeSuccessTrue FirewallAccessRuleNewResponseEnvelopeSuccess = true
)

type FirewallAccessRuleService

type FirewallAccessRuleService struct {
	Options []option.RequestOption
}

FirewallAccessRuleService contains methods and other services that help with interacting with the cloudflare 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 NewFirewallAccessRuleService method instead.

func NewFirewallAccessRuleService

func NewFirewallAccessRuleService(opts ...option.RequestOption) (r *FirewallAccessRuleService)

NewFirewallAccessRuleService 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 (*FirewallAccessRuleService) Delete

Deletes an IP Access rule at the user level.

Note: Deleting a user-level rule will affect all zones owned by the user.

func (*FirewallAccessRuleService) Edit

Updates an IP Access rule defined at the user level. You can only update the rule action (`mode` parameter) and notes.

func (*FirewallAccessRuleService) List

Fetches IP Access rules of the user. You can filter the results using several optional parameters.

func (*FirewallAccessRuleService) ListAutoPaging

Fetches IP Access rules of the user. You can filter the results using several optional parameters.

func (*FirewallAccessRuleService) New

Creates a new IP Access rule for all zones owned by the current user.

Note: To create an IP Access rule that applies to a specific zone, refer to the [IP Access rules for a zone](#ip-access-rules-for-a-zone) endpoints.

type FirewallService

type FirewallService struct {
	Options     []option.RequestOption
	AccessRules *FirewallAccessRuleService
}

FirewallService contains methods and other services that help with interacting with the cloudflare 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 NewFirewallService method instead.

func NewFirewallService

func NewFirewallService(opts ...option.RequestOption) (r *FirewallService)

NewFirewallService 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 IamOrganization

type IamOrganization struct {
	// Identifier
	ID string `json:"id"`
	// Organization name.
	Name string `json:"name"`
	// Access permissions for this User.
	Permissions []string `json:"permissions"`
	// List of roles that a user has within an organization.
	Roles []string `json:"roles"`
	// Whether the user is a member of the organization or has an inivitation pending.
	Status IamOrganizationStatus `json:"status"`
	JSON   iamOrganizationJSON   `json:"-"`
}

func (*IamOrganization) UnmarshalJSON

func (r *IamOrganization) UnmarshalJSON(data []byte) (err error)

type IamOrganizationStatus

type IamOrganizationStatus string

Whether the user is a member of the organization or has an inivitation pending.

const (
	IamOrganizationStatusMember  IamOrganizationStatus = "member"
	IamOrganizationStatusInvited IamOrganizationStatus = "invited"
)

type IamValue

type IamValue = string

type InviteEditParams

type InviteEditParams struct {
	// Status of your response to the invitation (rejected or accepted).
	Status param.Field[InviteEditParamsStatus] `json:"status,required"`
}

func (InviteEditParams) MarshalJSON

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

type InviteEditParamsStatus

type InviteEditParamsStatus string

Status of your response to the invitation (rejected or accepted).

const (
	InviteEditParamsStatusAccepted InviteEditParamsStatus = "accepted"
	InviteEditParamsStatusRejected InviteEditParamsStatus = "rejected"
)

type InviteEditResponse added in v2.3.0

type InviteEditResponse interface {
	ImplementsUserInviteEditResponse()
}

Union satisfied by user.InviteEditResponseUnknown or shared.UnionString.

type InviteEditResponseEnvelope

type InviteEditResponseEnvelope struct {
	Errors   []InviteEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []InviteEditResponseEnvelopeMessages `json:"messages,required"`
	Result   InviteEditResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success InviteEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    inviteEditResponseEnvelopeJSON    `json:"-"`
}

func (*InviteEditResponseEnvelope) UnmarshalJSON

func (r *InviteEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type InviteEditResponseEnvelopeErrors

type InviteEditResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    inviteEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*InviteEditResponseEnvelopeErrors) UnmarshalJSON

func (r *InviteEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type InviteEditResponseEnvelopeMessages

type InviteEditResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    inviteEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*InviteEditResponseEnvelopeMessages) UnmarshalJSON

func (r *InviteEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type InviteEditResponseEnvelopeSuccess

type InviteEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	InviteEditResponseEnvelopeSuccessTrue InviteEditResponseEnvelopeSuccess = true
)

type InviteGetResponse added in v2.3.0

type InviteGetResponse interface {
	ImplementsUserInviteGetResponse()
}

Union satisfied by user.InviteGetResponseUnknown or shared.UnionString.

type InviteGetResponseEnvelope

type InviteGetResponseEnvelope struct {
	Errors   []InviteGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []InviteGetResponseEnvelopeMessages `json:"messages,required"`
	Result   InviteGetResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success InviteGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    inviteGetResponseEnvelopeJSON    `json:"-"`
}

func (*InviteGetResponseEnvelope) UnmarshalJSON

func (r *InviteGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type InviteGetResponseEnvelopeErrors

type InviteGetResponseEnvelopeErrors struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    inviteGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*InviteGetResponseEnvelopeErrors) UnmarshalJSON

func (r *InviteGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type InviteGetResponseEnvelopeMessages

type InviteGetResponseEnvelopeMessages struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    inviteGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*InviteGetResponseEnvelopeMessages) UnmarshalJSON

func (r *InviteGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type InviteGetResponseEnvelopeSuccess

type InviteGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	InviteGetResponseEnvelopeSuccessTrue InviteGetResponseEnvelopeSuccess = true
)

type InviteListResponse

type InviteListResponse struct {
	// ID of the user to add to the organization.
	InvitedMemberID string `json:"invited_member_id,required,nullable"`
	// ID of the organization the user will be added to.
	OrganizationID string `json:"organization_id,required"`
	// Invite identifier tag.
	ID string `json:"id"`
	// When the invite is no longer active.
	ExpiresOn time.Time `json:"expires_on" format:"date-time"`
	// The email address of the user who created the invite.
	InvitedBy string `json:"invited_by"`
	// Email address of the user to add to the organization.
	InvitedMemberEmail string `json:"invited_member_email"`
	// When the invite was sent.
	InvitedOn time.Time `json:"invited_on" format:"date-time"`
	// Organization name.
	OrganizationName string `json:"organization_name"`
	// Roles to be assigned to this user.
	Roles []accounts.IamSchemasRole `json:"roles"`
	// Current status of the invitation.
	Status InviteListResponseStatus `json:"status"`
	JSON   inviteListResponseJSON   `json:"-"`
}

func (*InviteListResponse) UnmarshalJSON

func (r *InviteListResponse) UnmarshalJSON(data []byte) (err error)

type InviteListResponseEnvelope

type InviteListResponseEnvelope struct {
	Errors   []InviteListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []InviteListResponseEnvelopeMessages `json:"messages,required"`
	Result   []InviteListResponse                 `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    InviteListResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo InviteListResponseEnvelopeResultInfo `json:"result_info"`
	JSON       inviteListResponseEnvelopeJSON       `json:"-"`
}

func (*InviteListResponseEnvelope) UnmarshalJSON

func (r *InviteListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type InviteListResponseEnvelopeErrors

type InviteListResponseEnvelopeErrors struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    inviteListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*InviteListResponseEnvelopeErrors) UnmarshalJSON

func (r *InviteListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type InviteListResponseEnvelopeMessages

type InviteListResponseEnvelopeMessages struct {
	Code    int64                                  `json:"code,required"`
	Message string                                 `json:"message,required"`
	JSON    inviteListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*InviteListResponseEnvelopeMessages) UnmarshalJSON

func (r *InviteListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type InviteListResponseEnvelopeResultInfo

type InviteListResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                  `json:"total_count"`
	JSON       inviteListResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*InviteListResponseEnvelopeResultInfo) UnmarshalJSON

func (r *InviteListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type InviteListResponseEnvelopeSuccess

type InviteListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	InviteListResponseEnvelopeSuccessTrue InviteListResponseEnvelopeSuccess = true
)

type InviteListResponseStatus

type InviteListResponseStatus string

Current status of the invitation.

const (
	InviteListResponseStatusPending  InviteListResponseStatus = "pending"
	InviteListResponseStatusAccepted InviteListResponseStatus = "accepted"
	InviteListResponseStatusRejected InviteListResponseStatus = "rejected"
	InviteListResponseStatusExpired  InviteListResponseStatus = "expired"
)

type InviteService

type InviteService struct {
	Options []option.RequestOption
}

InviteService contains methods and other services that help with interacting with the cloudflare 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 NewInviteService method instead.

func NewInviteService

func NewInviteService(opts ...option.RequestOption) (r *InviteService)

NewInviteService 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 (*InviteService) Edit

func (r *InviteService) Edit(ctx context.Context, inviteID string, body InviteEditParams, opts ...option.RequestOption) (res *InviteEditResponse, err error)

Responds to an invitation.

func (*InviteService) Get

func (r *InviteService) Get(ctx context.Context, inviteID string, opts ...option.RequestOption) (res *InviteGetResponse, err error)

Gets the details of an invitation.

func (*InviteService) List

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

Lists all invitations associated with my user.

type LegacyJhsRule

type LegacyJhsRule struct {
	// The unique identifier of the IP Access rule.
	ID string `json:"id,required"`
	// The available actions that a rule can apply to a matched request.
	AllowedModes []LegacyJhsRuleAllowedMode `json:"allowed_modes,required"`
	// The rule configuration.
	Configuration LegacyJhsRuleConfiguration `json:"configuration,required"`
	// The action to apply to a matched request.
	Mode LegacyJhsRuleMode `json:"mode,required"`
	// The timestamp of when the rule was created.
	CreatedOn time.Time `json:"created_on" format:"date-time"`
	// The timestamp of when the rule was last modified.
	ModifiedOn time.Time `json:"modified_on" format:"date-time"`
	// An informative summary of the rule, typically used as a reminder or explanation.
	Notes string            `json:"notes"`
	JSON  legacyJhsRuleJSON `json:"-"`
}

func (*LegacyJhsRule) UnmarshalJSON

func (r *LegacyJhsRule) UnmarshalJSON(data []byte) (err error)

type LegacyJhsRuleAllowedMode

type LegacyJhsRuleAllowedMode string

The action to apply to a matched request.

const (
	LegacyJhsRuleAllowedModeBlock            LegacyJhsRuleAllowedMode = "block"
	LegacyJhsRuleAllowedModeChallenge        LegacyJhsRuleAllowedMode = "challenge"
	LegacyJhsRuleAllowedModeWhitelist        LegacyJhsRuleAllowedMode = "whitelist"
	LegacyJhsRuleAllowedModeJsChallenge      LegacyJhsRuleAllowedMode = "js_challenge"
	LegacyJhsRuleAllowedModeManagedChallenge LegacyJhsRuleAllowedMode = "managed_challenge"
)

type LegacyJhsRuleConfigurationLegacyJhsASNConfiguration

type LegacyJhsRuleConfigurationLegacyJhsASNConfiguration struct {
	// The configuration target. You must set the target to `asn` when specifying an
	// Autonomous System Number (ASN) in the rule.
	Target LegacyJhsRuleConfigurationLegacyJhsASNConfigurationTarget `json:"target"`
	// The AS number to match.
	Value string                                                  `json:"value"`
	JSON  legacyJhsRuleConfigurationLegacyJhsASNConfigurationJSON `json:"-"`
}

func (*LegacyJhsRuleConfigurationLegacyJhsASNConfiguration) UnmarshalJSON

func (r *LegacyJhsRuleConfigurationLegacyJhsASNConfiguration) UnmarshalJSON(data []byte) (err error)

type LegacyJhsRuleConfigurationLegacyJhsASNConfigurationTarget

type LegacyJhsRuleConfigurationLegacyJhsASNConfigurationTarget string

The configuration target. You must set the target to `asn` when specifying an Autonomous System Number (ASN) in the rule.

const (
	LegacyJhsRuleConfigurationLegacyJhsASNConfigurationTargetASN LegacyJhsRuleConfigurationLegacyJhsASNConfigurationTarget = "asn"
)

type LegacyJhsRuleConfigurationLegacyJhsCIDRConfiguration

type LegacyJhsRuleConfigurationLegacyJhsCIDRConfiguration struct {
	// The configuration target. You must set the target to `ip_range` when specifying
	// an IP address range in the rule.
	Target LegacyJhsRuleConfigurationLegacyJhsCIDRConfigurationTarget `json:"target"`
	// The IP address range to match. You can only use prefix lengths `/16` and `/24`
	// for IPv4 ranges, and prefix lengths `/32`, `/48`, and `/64` for IPv6 ranges.
	Value string                                                   `json:"value"`
	JSON  legacyJhsRuleConfigurationLegacyJhsCIDRConfigurationJSON `json:"-"`
}

func (*LegacyJhsRuleConfigurationLegacyJhsCIDRConfiguration) UnmarshalJSON

func (r *LegacyJhsRuleConfigurationLegacyJhsCIDRConfiguration) UnmarshalJSON(data []byte) (err error)

type LegacyJhsRuleConfigurationLegacyJhsCIDRConfigurationTarget

type LegacyJhsRuleConfigurationLegacyJhsCIDRConfigurationTarget string

The configuration target. You must set the target to `ip_range` when specifying an IP address range in the rule.

const (
	LegacyJhsRuleConfigurationLegacyJhsCIDRConfigurationTargetIPRange LegacyJhsRuleConfigurationLegacyJhsCIDRConfigurationTarget = "ip_range"
)

type LegacyJhsRuleConfigurationLegacyJhsCountryConfiguration

type LegacyJhsRuleConfigurationLegacyJhsCountryConfiguration struct {
	// The configuration target. You must set the target to `country` when specifying a
	// country code in the rule.
	Target LegacyJhsRuleConfigurationLegacyJhsCountryConfigurationTarget `json:"target"`
	// The two-letter ISO-3166-1 alpha-2 code to match. For more information, refer to
	// [IP Access rules: Parameters](https://developers.cloudflare.com/waf/tools/ip-access-rules/parameters/#country).
	Value string                                                      `json:"value"`
	JSON  legacyJhsRuleConfigurationLegacyJhsCountryConfigurationJSON `json:"-"`
}

func (*LegacyJhsRuleConfigurationLegacyJhsCountryConfiguration) UnmarshalJSON

type LegacyJhsRuleConfigurationLegacyJhsCountryConfigurationTarget

type LegacyJhsRuleConfigurationLegacyJhsCountryConfigurationTarget string

The configuration target. You must set the target to `country` when specifying a country code in the rule.

const (
	LegacyJhsRuleConfigurationLegacyJhsCountryConfigurationTargetCountry LegacyJhsRuleConfigurationLegacyJhsCountryConfigurationTarget = "country"
)

type LegacyJhsRuleConfigurationLegacyJhsIPConfiguration

type LegacyJhsRuleConfigurationLegacyJhsIPConfiguration struct {
	// The configuration target. You must set the target to `ip` when specifying an IP
	// address in the rule.
	Target LegacyJhsRuleConfigurationLegacyJhsIPConfigurationTarget `json:"target"`
	// The IP address to match. This address will be compared to the IP address of
	// incoming requests.
	Value string                                                 `json:"value"`
	JSON  legacyJhsRuleConfigurationLegacyJhsIPConfigurationJSON `json:"-"`
}

func (*LegacyJhsRuleConfigurationLegacyJhsIPConfiguration) UnmarshalJSON

func (r *LegacyJhsRuleConfigurationLegacyJhsIPConfiguration) UnmarshalJSON(data []byte) (err error)

type LegacyJhsRuleConfigurationLegacyJhsIPConfigurationTarget

type LegacyJhsRuleConfigurationLegacyJhsIPConfigurationTarget string

The configuration target. You must set the target to `ip` when specifying an IP address in the rule.

const (
	LegacyJhsRuleConfigurationLegacyJhsIPConfigurationTargetIP LegacyJhsRuleConfigurationLegacyJhsIPConfigurationTarget = "ip"
)

type LegacyJhsRuleConfigurationLegacyJhsIPV6Configuration

type LegacyJhsRuleConfigurationLegacyJhsIPV6Configuration struct {
	// The configuration target. You must set the target to `ip6` when specifying an
	// IPv6 address in the rule.
	Target LegacyJhsRuleConfigurationLegacyJhsIPV6ConfigurationTarget `json:"target"`
	// The IPv6 address to match.
	Value string                                                   `json:"value"`
	JSON  legacyJhsRuleConfigurationLegacyJhsIPV6ConfigurationJSON `json:"-"`
}

func (*LegacyJhsRuleConfigurationLegacyJhsIPV6Configuration) UnmarshalJSON

func (r *LegacyJhsRuleConfigurationLegacyJhsIPV6Configuration) UnmarshalJSON(data []byte) (err error)

type LegacyJhsRuleConfigurationLegacyJhsIPV6ConfigurationTarget

type LegacyJhsRuleConfigurationLegacyJhsIPV6ConfigurationTarget string

The configuration target. You must set the target to `ip6` when specifying an IPv6 address in the rule.

const (
	LegacyJhsRuleConfigurationLegacyJhsIPV6ConfigurationTargetIp6 LegacyJhsRuleConfigurationLegacyJhsIPV6ConfigurationTarget = "ip6"
)

type LegacyJhsRuleMode

type LegacyJhsRuleMode string

The action to apply to a matched request.

const (
	LegacyJhsRuleModeBlock            LegacyJhsRuleMode = "block"
	LegacyJhsRuleModeChallenge        LegacyJhsRuleMode = "challenge"
	LegacyJhsRuleModeWhitelist        LegacyJhsRuleMode = "whitelist"
	LegacyJhsRuleModeJsChallenge      LegacyJhsRuleMode = "js_challenge"
	LegacyJhsRuleModeManagedChallenge LegacyJhsRuleMode = "managed_challenge"
)

type LoadBalancerAnalyticsEventListParams

type LoadBalancerAnalyticsEventListParams struct {
	// If true, filter events where the origin status is healthy. If false, filter
	// events where the origin status is unhealthy.
	OriginHealthy param.Field[bool] `query:"origin_healthy"`
	// The name for the origin to filter.
	OriginName param.Field[string] `query:"origin_name"`
	// If true, filter events where the pool status is healthy. If false, filter events
	// where the pool status is unhealthy.
	PoolHealthy param.Field[bool]   `query:"pool_healthy"`
	PoolID      param.Field[string] `query:"pool_id"`
	// The name for the pool to filter.
	PoolName param.Field[string] `query:"pool_name"`
	// Start date and time of requesting data period in the ISO8601 format.
	Since param.Field[time.Time] `query:"since" format:"date-time"`
	// End date and time of requesting data period in the ISO8601 format.
	Until param.Field[time.Time] `query:"until" format:"date-time"`
}

func (LoadBalancerAnalyticsEventListParams) URLQuery

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

type LoadBalancerAnalyticsEventListResponseEnvelope

type LoadBalancerAnalyticsEventListResponseEnvelope struct {
	Errors   []LoadBalancerAnalyticsEventListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerAnalyticsEventListResponseEnvelopeMessages `json:"messages,required"`
	Result   []LoadBalancingAnalytics                                 `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    LoadBalancerAnalyticsEventListResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo LoadBalancerAnalyticsEventListResponseEnvelopeResultInfo `json:"result_info"`
	JSON       loadBalancerAnalyticsEventListResponseEnvelopeJSON       `json:"-"`
}

func (*LoadBalancerAnalyticsEventListResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerAnalyticsEventListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerAnalyticsEventListResponseEnvelopeErrors

type LoadBalancerAnalyticsEventListResponseEnvelopeErrors struct {
	Code    int64                                                    `json:"code,required"`
	Message string                                                   `json:"message,required"`
	JSON    loadBalancerAnalyticsEventListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerAnalyticsEventListResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerAnalyticsEventListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerAnalyticsEventListResponseEnvelopeMessages

type LoadBalancerAnalyticsEventListResponseEnvelopeMessages struct {
	Code    int64                                                      `json:"code,required"`
	Message string                                                     `json:"message,required"`
	JSON    loadBalancerAnalyticsEventListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerAnalyticsEventListResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerAnalyticsEventListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerAnalyticsEventListResponseEnvelopeResultInfo

type LoadBalancerAnalyticsEventListResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                                      `json:"total_count"`
	JSON       loadBalancerAnalyticsEventListResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*LoadBalancerAnalyticsEventListResponseEnvelopeResultInfo) UnmarshalJSON

type LoadBalancerAnalyticsEventListResponseEnvelopeSuccess

type LoadBalancerAnalyticsEventListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerAnalyticsEventListResponseEnvelopeSuccessTrue LoadBalancerAnalyticsEventListResponseEnvelopeSuccess = true
)

type LoadBalancerAnalyticsEventService

type LoadBalancerAnalyticsEventService struct {
	Options []option.RequestOption
}

LoadBalancerAnalyticsEventService contains methods and other services that help with interacting with the cloudflare 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 NewLoadBalancerAnalyticsEventService method instead.

func NewLoadBalancerAnalyticsEventService

func NewLoadBalancerAnalyticsEventService(opts ...option.RequestOption) (r *LoadBalancerAnalyticsEventService)

NewLoadBalancerAnalyticsEventService 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 (*LoadBalancerAnalyticsEventService) List

List origin health changes.

type LoadBalancerAnalyticsService

type LoadBalancerAnalyticsService struct {
	Options []option.RequestOption
	Events  *LoadBalancerAnalyticsEventService
}

LoadBalancerAnalyticsService contains methods and other services that help with interacting with the cloudflare 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 NewLoadBalancerAnalyticsService method instead.

func NewLoadBalancerAnalyticsService

func NewLoadBalancerAnalyticsService(opts ...option.RequestOption) (r *LoadBalancerAnalyticsService)

NewLoadBalancerAnalyticsService 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 LoadBalancerMonitorDeleteResponse

type LoadBalancerMonitorDeleteResponse struct {
	ID   string                                `json:"id"`
	JSON loadBalancerMonitorDeleteResponseJSON `json:"-"`
}

func (*LoadBalancerMonitorDeleteResponse) UnmarshalJSON

func (r *LoadBalancerMonitorDeleteResponse) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorDeleteResponseEnvelope

type LoadBalancerMonitorDeleteResponseEnvelope struct {
	Errors   []LoadBalancerMonitorDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerMonitorDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancerMonitorDeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerMonitorDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerMonitorDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerMonitorDeleteResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerMonitorDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorDeleteResponseEnvelopeErrors

type LoadBalancerMonitorDeleteResponseEnvelopeErrors struct {
	Code    int64                                               `json:"code,required"`
	Message string                                              `json:"message,required"`
	JSON    loadBalancerMonitorDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerMonitorDeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerMonitorDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorDeleteResponseEnvelopeMessages

type LoadBalancerMonitorDeleteResponseEnvelopeMessages struct {
	Code    int64                                                 `json:"code,required"`
	Message string                                                `json:"message,required"`
	JSON    loadBalancerMonitorDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerMonitorDeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerMonitorDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorDeleteResponseEnvelopeSuccess

type LoadBalancerMonitorDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerMonitorDeleteResponseEnvelopeSuccessTrue LoadBalancerMonitorDeleteResponseEnvelopeSuccess = true
)

type LoadBalancerMonitorEditParams

type LoadBalancerMonitorEditParams struct {
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes param.Field[string] `json:"expected_codes,required"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects param.Field[bool] `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header param.Field[interface{}] `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method param.Field[string] `json:"method"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path param.Field[string] `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port param.Field[int64] `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone param.Field[string] `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries param.Field[int64] `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout param.Field[int64] `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type param.Field[LoadBalancerMonitorEditParamsType] `json:"type"`
}

func (LoadBalancerMonitorEditParams) MarshalJSON

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

type LoadBalancerMonitorEditParamsType

type LoadBalancerMonitorEditParamsType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	LoadBalancerMonitorEditParamsTypeHTTP     LoadBalancerMonitorEditParamsType = "http"
	LoadBalancerMonitorEditParamsTypeHTTPS    LoadBalancerMonitorEditParamsType = "https"
	LoadBalancerMonitorEditParamsTypeTcp      LoadBalancerMonitorEditParamsType = "tcp"
	LoadBalancerMonitorEditParamsTypeUdpIcmp  LoadBalancerMonitorEditParamsType = "udp_icmp"
	LoadBalancerMonitorEditParamsTypeIcmpPing LoadBalancerMonitorEditParamsType = "icmp_ping"
	LoadBalancerMonitorEditParamsTypeSmtp     LoadBalancerMonitorEditParamsType = "smtp"
)

type LoadBalancerMonitorEditResponseEnvelope

type LoadBalancerMonitorEditResponseEnvelope struct {
	Errors   []LoadBalancerMonitorEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerMonitorEditResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancingMonitor                              `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerMonitorEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerMonitorEditResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerMonitorEditResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerMonitorEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorEditResponseEnvelopeErrors

type LoadBalancerMonitorEditResponseEnvelopeErrors struct {
	Code    int64                                             `json:"code,required"`
	Message string                                            `json:"message,required"`
	JSON    loadBalancerMonitorEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerMonitorEditResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerMonitorEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorEditResponseEnvelopeMessages

type LoadBalancerMonitorEditResponseEnvelopeMessages struct {
	Code    int64                                               `json:"code,required"`
	Message string                                              `json:"message,required"`
	JSON    loadBalancerMonitorEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerMonitorEditResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerMonitorEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorEditResponseEnvelopeSuccess

type LoadBalancerMonitorEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerMonitorEditResponseEnvelopeSuccessTrue LoadBalancerMonitorEditResponseEnvelopeSuccess = true
)

type LoadBalancerMonitorGetResponseEnvelope

type LoadBalancerMonitorGetResponseEnvelope struct {
	Errors   []LoadBalancerMonitorGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerMonitorGetResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancingMonitor                             `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerMonitorGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerMonitorGetResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerMonitorGetResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerMonitorGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorGetResponseEnvelopeErrors

type LoadBalancerMonitorGetResponseEnvelopeErrors struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    loadBalancerMonitorGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerMonitorGetResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerMonitorGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorGetResponseEnvelopeMessages

type LoadBalancerMonitorGetResponseEnvelopeMessages struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    loadBalancerMonitorGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerMonitorGetResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerMonitorGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorGetResponseEnvelopeSuccess

type LoadBalancerMonitorGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerMonitorGetResponseEnvelopeSuccessTrue LoadBalancerMonitorGetResponseEnvelopeSuccess = true
)

type LoadBalancerMonitorListResponseEnvelope

type LoadBalancerMonitorListResponseEnvelope struct {
	Errors   []LoadBalancerMonitorListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerMonitorListResponseEnvelopeMessages `json:"messages,required"`
	Result   []LoadBalancingMonitor                            `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    LoadBalancerMonitorListResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo LoadBalancerMonitorListResponseEnvelopeResultInfo `json:"result_info"`
	JSON       loadBalancerMonitorListResponseEnvelopeJSON       `json:"-"`
}

func (*LoadBalancerMonitorListResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerMonitorListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorListResponseEnvelopeErrors

type LoadBalancerMonitorListResponseEnvelopeErrors struct {
	Code    int64                                             `json:"code,required"`
	Message string                                            `json:"message,required"`
	JSON    loadBalancerMonitorListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerMonitorListResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerMonitorListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorListResponseEnvelopeMessages

type LoadBalancerMonitorListResponseEnvelopeMessages struct {
	Code    int64                                               `json:"code,required"`
	Message string                                              `json:"message,required"`
	JSON    loadBalancerMonitorListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerMonitorListResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerMonitorListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorListResponseEnvelopeResultInfo

type LoadBalancerMonitorListResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                               `json:"total_count"`
	JSON       loadBalancerMonitorListResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*LoadBalancerMonitorListResponseEnvelopeResultInfo) UnmarshalJSON

func (r *LoadBalancerMonitorListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorListResponseEnvelopeSuccess

type LoadBalancerMonitorListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerMonitorListResponseEnvelopeSuccessTrue LoadBalancerMonitorListResponseEnvelopeSuccess = true
)

type LoadBalancerMonitorNewParams

type LoadBalancerMonitorNewParams struct {
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes param.Field[string] `json:"expected_codes,required"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects param.Field[bool] `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header param.Field[interface{}] `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method param.Field[string] `json:"method"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path param.Field[string] `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port param.Field[int64] `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone param.Field[string] `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries param.Field[int64] `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout param.Field[int64] `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type param.Field[LoadBalancerMonitorNewParamsType] `json:"type"`
}

func (LoadBalancerMonitorNewParams) MarshalJSON

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

type LoadBalancerMonitorNewParamsType

type LoadBalancerMonitorNewParamsType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	LoadBalancerMonitorNewParamsTypeHTTP     LoadBalancerMonitorNewParamsType = "http"
	LoadBalancerMonitorNewParamsTypeHTTPS    LoadBalancerMonitorNewParamsType = "https"
	LoadBalancerMonitorNewParamsTypeTcp      LoadBalancerMonitorNewParamsType = "tcp"
	LoadBalancerMonitorNewParamsTypeUdpIcmp  LoadBalancerMonitorNewParamsType = "udp_icmp"
	LoadBalancerMonitorNewParamsTypeIcmpPing LoadBalancerMonitorNewParamsType = "icmp_ping"
	LoadBalancerMonitorNewParamsTypeSmtp     LoadBalancerMonitorNewParamsType = "smtp"
)

type LoadBalancerMonitorNewResponseEnvelope

type LoadBalancerMonitorNewResponseEnvelope struct {
	Errors   []LoadBalancerMonitorNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerMonitorNewResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancingMonitor                             `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerMonitorNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerMonitorNewResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerMonitorNewResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerMonitorNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorNewResponseEnvelopeErrors

type LoadBalancerMonitorNewResponseEnvelopeErrors struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    loadBalancerMonitorNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerMonitorNewResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerMonitorNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorNewResponseEnvelopeMessages

type LoadBalancerMonitorNewResponseEnvelopeMessages struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    loadBalancerMonitorNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerMonitorNewResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerMonitorNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorNewResponseEnvelopeSuccess

type LoadBalancerMonitorNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerMonitorNewResponseEnvelopeSuccessTrue LoadBalancerMonitorNewResponseEnvelopeSuccess = true
)

type LoadBalancerMonitorPreviewParams

type LoadBalancerMonitorPreviewParams struct {
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes param.Field[string] `json:"expected_codes,required"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects param.Field[bool] `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header param.Field[interface{}] `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method param.Field[string] `json:"method"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path param.Field[string] `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port param.Field[int64] `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone param.Field[string] `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries param.Field[int64] `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout param.Field[int64] `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type param.Field[LoadBalancerMonitorPreviewParamsType] `json:"type"`
}

func (LoadBalancerMonitorPreviewParams) MarshalJSON

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

type LoadBalancerMonitorPreviewParamsType

type LoadBalancerMonitorPreviewParamsType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	LoadBalancerMonitorPreviewParamsTypeHTTP     LoadBalancerMonitorPreviewParamsType = "http"
	LoadBalancerMonitorPreviewParamsTypeHTTPS    LoadBalancerMonitorPreviewParamsType = "https"
	LoadBalancerMonitorPreviewParamsTypeTcp      LoadBalancerMonitorPreviewParamsType = "tcp"
	LoadBalancerMonitorPreviewParamsTypeUdpIcmp  LoadBalancerMonitorPreviewParamsType = "udp_icmp"
	LoadBalancerMonitorPreviewParamsTypeIcmpPing LoadBalancerMonitorPreviewParamsType = "icmp_ping"
	LoadBalancerMonitorPreviewParamsTypeSmtp     LoadBalancerMonitorPreviewParamsType = "smtp"
)

type LoadBalancerMonitorPreviewResponse

type LoadBalancerMonitorPreviewResponse struct {
	// Monitored pool IDs mapped to their respective names.
	Pools     map[string]string                      `json:"pools"`
	PreviewID string                                 `json:"preview_id"`
	JSON      loadBalancerMonitorPreviewResponseJSON `json:"-"`
}

func (*LoadBalancerMonitorPreviewResponse) UnmarshalJSON

func (r *LoadBalancerMonitorPreviewResponse) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorPreviewResponseEnvelope

type LoadBalancerMonitorPreviewResponseEnvelope struct {
	Errors   []LoadBalancerMonitorPreviewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerMonitorPreviewResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancerMonitorPreviewResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerMonitorPreviewResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerMonitorPreviewResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerMonitorPreviewResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerMonitorPreviewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorPreviewResponseEnvelopeErrors

type LoadBalancerMonitorPreviewResponseEnvelopeErrors struct {
	Code    int64                                                `json:"code,required"`
	Message string                                               `json:"message,required"`
	JSON    loadBalancerMonitorPreviewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerMonitorPreviewResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerMonitorPreviewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorPreviewResponseEnvelopeMessages

type LoadBalancerMonitorPreviewResponseEnvelopeMessages struct {
	Code    int64                                                  `json:"code,required"`
	Message string                                                 `json:"message,required"`
	JSON    loadBalancerMonitorPreviewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerMonitorPreviewResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerMonitorPreviewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorPreviewResponseEnvelopeSuccess

type LoadBalancerMonitorPreviewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerMonitorPreviewResponseEnvelopeSuccessTrue LoadBalancerMonitorPreviewResponseEnvelopeSuccess = true
)

type LoadBalancerMonitorReferencesResponse

type LoadBalancerMonitorReferencesResponse struct {
	ReferenceType LoadBalancerMonitorReferencesResponseReferenceType `json:"reference_type"`
	ResourceID    string                                             `json:"resource_id"`
	ResourceName  string                                             `json:"resource_name"`
	ResourceType  string                                             `json:"resource_type"`
	JSON          loadBalancerMonitorReferencesResponseJSON          `json:"-"`
}

func (*LoadBalancerMonitorReferencesResponse) UnmarshalJSON

func (r *LoadBalancerMonitorReferencesResponse) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorReferencesResponseEnvelope

type LoadBalancerMonitorReferencesResponseEnvelope struct {
	Errors   []LoadBalancerMonitorReferencesResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerMonitorReferencesResponseEnvelopeMessages `json:"messages,required"`
	// List of resources that reference a given monitor.
	Result []LoadBalancerMonitorReferencesResponse `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    LoadBalancerMonitorReferencesResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo LoadBalancerMonitorReferencesResponseEnvelopeResultInfo `json:"result_info"`
	JSON       loadBalancerMonitorReferencesResponseEnvelopeJSON       `json:"-"`
}

func (*LoadBalancerMonitorReferencesResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerMonitorReferencesResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorReferencesResponseEnvelopeErrors

type LoadBalancerMonitorReferencesResponseEnvelopeErrors struct {
	Code    int64                                                   `json:"code,required"`
	Message string                                                  `json:"message,required"`
	JSON    loadBalancerMonitorReferencesResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerMonitorReferencesResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerMonitorReferencesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorReferencesResponseEnvelopeMessages

type LoadBalancerMonitorReferencesResponseEnvelopeMessages struct {
	Code    int64                                                     `json:"code,required"`
	Message string                                                    `json:"message,required"`
	JSON    loadBalancerMonitorReferencesResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerMonitorReferencesResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerMonitorReferencesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorReferencesResponseEnvelopeResultInfo

type LoadBalancerMonitorReferencesResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                                     `json:"total_count"`
	JSON       loadBalancerMonitorReferencesResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*LoadBalancerMonitorReferencesResponseEnvelopeResultInfo) UnmarshalJSON

type LoadBalancerMonitorReferencesResponseEnvelopeSuccess

type LoadBalancerMonitorReferencesResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerMonitorReferencesResponseEnvelopeSuccessTrue LoadBalancerMonitorReferencesResponseEnvelopeSuccess = true
)

type LoadBalancerMonitorReferencesResponseReferenceType

type LoadBalancerMonitorReferencesResponseReferenceType string
const (
	LoadBalancerMonitorReferencesResponseReferenceTypeStar     LoadBalancerMonitorReferencesResponseReferenceType = "*"
	LoadBalancerMonitorReferencesResponseReferenceTypeReferral LoadBalancerMonitorReferencesResponseReferenceType = "referral"
	LoadBalancerMonitorReferencesResponseReferenceTypeReferrer LoadBalancerMonitorReferencesResponseReferenceType = "referrer"
)

type LoadBalancerMonitorService

type LoadBalancerMonitorService struct {
	Options []option.RequestOption
}

LoadBalancerMonitorService contains methods and other services that help with interacting with the cloudflare 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 NewLoadBalancerMonitorService method instead.

func NewLoadBalancerMonitorService

func NewLoadBalancerMonitorService(opts ...option.RequestOption) (r *LoadBalancerMonitorService)

NewLoadBalancerMonitorService 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 (*LoadBalancerMonitorService) Delete

Delete a configured monitor.

func (*LoadBalancerMonitorService) Edit

Apply changes to an existing monitor, overwriting the supplied properties.

func (*LoadBalancerMonitorService) Get

func (r *LoadBalancerMonitorService) Get(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *LoadBalancingMonitor, err error)

List a single configured monitor for a user.

func (*LoadBalancerMonitorService) List

List configured monitors for a user.

func (*LoadBalancerMonitorService) New

Create a configured monitor.

func (*LoadBalancerMonitorService) Preview

Preview pools using the specified monitor with provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.

func (*LoadBalancerMonitorService) References

Get the list of resources that reference the provided monitor.

func (*LoadBalancerMonitorService) Update

Modify a configured monitor.

type LoadBalancerMonitorUpdateParams

type LoadBalancerMonitorUpdateParams struct {
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes param.Field[string] `json:"expected_codes,required"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects param.Field[bool] `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header param.Field[interface{}] `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method param.Field[string] `json:"method"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path param.Field[string] `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port param.Field[int64] `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone param.Field[string] `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries param.Field[int64] `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout param.Field[int64] `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type param.Field[LoadBalancerMonitorUpdateParamsType] `json:"type"`
}

func (LoadBalancerMonitorUpdateParams) MarshalJSON

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

type LoadBalancerMonitorUpdateParamsType

type LoadBalancerMonitorUpdateParamsType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	LoadBalancerMonitorUpdateParamsTypeHTTP     LoadBalancerMonitorUpdateParamsType = "http"
	LoadBalancerMonitorUpdateParamsTypeHTTPS    LoadBalancerMonitorUpdateParamsType = "https"
	LoadBalancerMonitorUpdateParamsTypeTcp      LoadBalancerMonitorUpdateParamsType = "tcp"
	LoadBalancerMonitorUpdateParamsTypeUdpIcmp  LoadBalancerMonitorUpdateParamsType = "udp_icmp"
	LoadBalancerMonitorUpdateParamsTypeIcmpPing LoadBalancerMonitorUpdateParamsType = "icmp_ping"
	LoadBalancerMonitorUpdateParamsTypeSmtp     LoadBalancerMonitorUpdateParamsType = "smtp"
)

type LoadBalancerMonitorUpdateResponseEnvelope

type LoadBalancerMonitorUpdateResponseEnvelope struct {
	Errors   []LoadBalancerMonitorUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerMonitorUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancingMonitor                                `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerMonitorUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerMonitorUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerMonitorUpdateResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerMonitorUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorUpdateResponseEnvelopeErrors

type LoadBalancerMonitorUpdateResponseEnvelopeErrors struct {
	Code    int64                                               `json:"code,required"`
	Message string                                              `json:"message,required"`
	JSON    loadBalancerMonitorUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerMonitorUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerMonitorUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorUpdateResponseEnvelopeMessages

type LoadBalancerMonitorUpdateResponseEnvelopeMessages struct {
	Code    int64                                                 `json:"code,required"`
	Message string                                                `json:"message,required"`
	JSON    loadBalancerMonitorUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerMonitorUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerMonitorUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerMonitorUpdateResponseEnvelopeSuccess

type LoadBalancerMonitorUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerMonitorUpdateResponseEnvelopeSuccessTrue LoadBalancerMonitorUpdateResponseEnvelopeSuccess = true
)

type LoadBalancerPoolDeleteResponse

type LoadBalancerPoolDeleteResponse struct {
	ID   string                             `json:"id"`
	JSON loadBalancerPoolDeleteResponseJSON `json:"-"`
}

func (*LoadBalancerPoolDeleteResponse) UnmarshalJSON

func (r *LoadBalancerPoolDeleteResponse) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolDeleteResponseEnvelope

type LoadBalancerPoolDeleteResponseEnvelope struct {
	Errors   []LoadBalancerPoolDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerPoolDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancerPoolDeleteResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerPoolDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerPoolDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerPoolDeleteResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerPoolDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolDeleteResponseEnvelopeErrors

type LoadBalancerPoolDeleteResponseEnvelopeErrors struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    loadBalancerPoolDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerPoolDeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerPoolDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolDeleteResponseEnvelopeMessages

type LoadBalancerPoolDeleteResponseEnvelopeMessages struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    loadBalancerPoolDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerPoolDeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerPoolDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolDeleteResponseEnvelopeSuccess

type LoadBalancerPoolDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerPoolDeleteResponseEnvelopeSuccessTrue LoadBalancerPoolDeleteResponseEnvelopeSuccess = true
)

type LoadBalancerPoolEditParams

type LoadBalancerPoolEditParams struct {
	// A list of regions from which to run health checks. Null means every Cloudflare
	// data center.
	CheckRegions param.Field[[]LoadBalancerPoolEditParamsCheckRegion] `json:"check_regions"`
	// A human-readable description of the pool.
	Description param.Field[string] `json:"description"`
	// Whether to enable (the default) or disable this pool. Disabled pools will not
	// receive traffic and are excluded from health checks. Disabling a pool will cause
	// any load balancers using it to failover to the next pool (if any).
	Enabled param.Field[bool] `json:"enabled"`
	// The latitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, longitude must also be set.
	Latitude param.Field[float64] `json:"latitude"`
	// Configures load shedding policies and percentages for the pool.
	LoadShedding param.Field[LoadBalancerPoolEditParamsLoadShedding] `json:"load_shedding"`
	// The longitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, latitude must also be set.
	Longitude param.Field[float64] `json:"longitude"`
	// The minimum number of origins that must be healthy for this pool to serve
	// traffic. If the number of healthy origins falls below this number, the pool will
	// be marked unhealthy and will failover to the next available pool.
	MinimumOrigins param.Field[int64] `json:"minimum_origins"`
	// The ID of the Monitor to use for checking the health of origins within this
	// pool.
	Monitor param.Field[interface{}] `json:"monitor"`
	// A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
	// underscores are allowed.
	Name param.Field[string] `json:"name"`
	// This field is now deprecated. It has been moved to Cloudflare's Centralized
	// Notification service
	// https://developers.cloudflare.com/fundamentals/notifications/. The email address
	// to send health status notifications to. This can be an individual mailbox or a
	// mailing list. Multiple emails can be supplied as a comma delimited list.
	NotificationEmail param.Field[string] `json:"notification_email"`
	// Filter pool and origin health notifications by resource type or health status.
	// Use null to reset.
	NotificationFilter param.Field[LoadBalancerPoolEditParamsNotificationFilter] `json:"notification_filter"`
	// Configures origin steering for the pool. Controls how origins are selected for
	// new sessions and traffic without session affinity.
	OriginSteering param.Field[LoadBalancerPoolEditParamsOriginSteering] `json:"origin_steering"`
	// The list of origins within this pool. Traffic directed at this pool is balanced
	// across all currently healthy origins, provided the pool itself is healthy.
	Origins param.Field[[]LoadBalancerPoolEditParamsOrigin] `json:"origins"`
}

func (LoadBalancerPoolEditParams) MarshalJSON

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

type LoadBalancerPoolEditParamsCheckRegion

type LoadBalancerPoolEditParamsCheckRegion string

WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (ENTERPRISE customers only).

const (
	LoadBalancerPoolEditParamsCheckRegionWnam       LoadBalancerPoolEditParamsCheckRegion = "WNAM"
	LoadBalancerPoolEditParamsCheckRegionEnam       LoadBalancerPoolEditParamsCheckRegion = "ENAM"
	LoadBalancerPoolEditParamsCheckRegionWeu        LoadBalancerPoolEditParamsCheckRegion = "WEU"
	LoadBalancerPoolEditParamsCheckRegionEeu        LoadBalancerPoolEditParamsCheckRegion = "EEU"
	LoadBalancerPoolEditParamsCheckRegionNsam       LoadBalancerPoolEditParamsCheckRegion = "NSAM"
	LoadBalancerPoolEditParamsCheckRegionSsam       LoadBalancerPoolEditParamsCheckRegion = "SSAM"
	LoadBalancerPoolEditParamsCheckRegionOc         LoadBalancerPoolEditParamsCheckRegion = "OC"
	LoadBalancerPoolEditParamsCheckRegionMe         LoadBalancerPoolEditParamsCheckRegion = "ME"
	LoadBalancerPoolEditParamsCheckRegionNaf        LoadBalancerPoolEditParamsCheckRegion = "NAF"
	LoadBalancerPoolEditParamsCheckRegionSaf        LoadBalancerPoolEditParamsCheckRegion = "SAF"
	LoadBalancerPoolEditParamsCheckRegionSas        LoadBalancerPoolEditParamsCheckRegion = "SAS"
	LoadBalancerPoolEditParamsCheckRegionSeas       LoadBalancerPoolEditParamsCheckRegion = "SEAS"
	LoadBalancerPoolEditParamsCheckRegionNeas       LoadBalancerPoolEditParamsCheckRegion = "NEAS"
	LoadBalancerPoolEditParamsCheckRegionAllRegions LoadBalancerPoolEditParamsCheckRegion = "ALL_REGIONS"
)

type LoadBalancerPoolEditParamsLoadShedding

type LoadBalancerPoolEditParamsLoadShedding struct {
	// The percent of traffic to shed from the pool, according to the default policy.
	// Applies to new sessions and traffic without session affinity.
	DefaultPercent param.Field[float64] `json:"default_percent"`
	// The default policy to use when load shedding. A random policy randomly sheds a
	// given percent of requests. A hash policy computes a hash over the
	// CF-Connecting-IP address and sheds all requests originating from a percent of
	// IPs.
	DefaultPolicy param.Field[LoadBalancerPoolEditParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
	// The percent of existing sessions to shed from the pool, according to the session
	// policy.
	SessionPercent param.Field[float64] `json:"session_percent"`
	// Only the hash policy is supported for existing sessions (to avoid exponential
	// decay).
	SessionPolicy param.Field[LoadBalancerPoolEditParamsLoadSheddingSessionPolicy] `json:"session_policy"`
}

Configures load shedding policies and percentages for the pool.

func (LoadBalancerPoolEditParamsLoadShedding) MarshalJSON

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

type LoadBalancerPoolEditParamsLoadSheddingDefaultPolicy

type LoadBalancerPoolEditParamsLoadSheddingDefaultPolicy string

The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.

const (
	LoadBalancerPoolEditParamsLoadSheddingDefaultPolicyRandom LoadBalancerPoolEditParamsLoadSheddingDefaultPolicy = "random"
	LoadBalancerPoolEditParamsLoadSheddingDefaultPolicyHash   LoadBalancerPoolEditParamsLoadSheddingDefaultPolicy = "hash"
)

type LoadBalancerPoolEditParamsLoadSheddingSessionPolicy

type LoadBalancerPoolEditParamsLoadSheddingSessionPolicy string

Only the hash policy is supported for existing sessions (to avoid exponential decay).

const (
	LoadBalancerPoolEditParamsLoadSheddingSessionPolicyHash LoadBalancerPoolEditParamsLoadSheddingSessionPolicy = "hash"
)

type LoadBalancerPoolEditParamsNotificationFilter

type LoadBalancerPoolEditParamsNotificationFilter struct {
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Origin param.Field[LoadBalancerPoolEditParamsNotificationFilterOrigin] `json:"origin"`
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Pool param.Field[LoadBalancerPoolEditParamsNotificationFilterPool] `json:"pool"`
}

Filter pool and origin health notifications by resource type or health status. Use null to reset.

func (LoadBalancerPoolEditParamsNotificationFilter) MarshalJSON

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

type LoadBalancerPoolEditParamsNotificationFilterOrigin

type LoadBalancerPoolEditParamsNotificationFilterOrigin struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (LoadBalancerPoolEditParamsNotificationFilterOrigin) MarshalJSON

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

type LoadBalancerPoolEditParamsNotificationFilterPool

type LoadBalancerPoolEditParamsNotificationFilterPool struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (LoadBalancerPoolEditParamsNotificationFilterPool) MarshalJSON

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

type LoadBalancerPoolEditParamsOrigin

type LoadBalancerPoolEditParamsOrigin struct {
	// The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
	// hostname. Hostnames entered here should resolve directly to the origin, and not
	// be a hostname proxied by Cloudflare. To set an internal/reserved address,
	// virtual_network_id must also be set.
	Address param.Field[string] `json:"address"`
	// Whether to enable (the default) this origin within the pool. Disabled origins
	// will not receive traffic and are excluded from health checks. The origin will
	// only be disabled for the current pool.
	Enabled param.Field[bool] `json:"enabled"`
	// The request header is used to pass additional information with an HTTP request.
	// Currently supported header is 'Host'.
	Header param.Field[LoadBalancerPoolEditParamsOriginsHeader] `json:"header"`
	// A human-identifiable name for the origin.
	Name param.Field[string] `json:"name"`
	// The virtual network subnet ID the origin belongs in. Virtual network must also
	// belong to the account.
	VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
	// The weight of this origin relative to other origins in the pool. Based on the
	// configured weight the total traffic is distributed among origins within the
	// pool.
	//
	//   - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
	//     origin's outstanding requests.
	//   - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
	//     open connections.
	Weight param.Field[float64] `json:"weight"`
}

func (LoadBalancerPoolEditParamsOrigin) MarshalJSON

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

type LoadBalancerPoolEditParamsOriginSteering

type LoadBalancerPoolEditParamsOriginSteering struct {
	// The type of origin steering policy to use.
	//
	//   - `"random"`: Select an origin randomly.
	//   - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
	//     address.
	//   - `"least_outstanding_requests"`: Select an origin by taking into consideration
	//     origin weights, as well as each origin's number of outstanding requests.
	//     Origins with more pending requests are weighted proportionately less relative
	//     to others.
	//   - `"least_connections"`: Select an origin by taking into consideration origin
	//     weights, as well as each origin's number of open connections. Origins with
	//     more open connections are weighted proportionately less relative to others.
	//     Supported for HTTP/1 and HTTP/2 connections.
	Policy param.Field[LoadBalancerPoolEditParamsOriginSteeringPolicy] `json:"policy"`
}

Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.

func (LoadBalancerPoolEditParamsOriginSteering) MarshalJSON

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

type LoadBalancerPoolEditParamsOriginSteeringPolicy

type LoadBalancerPoolEditParamsOriginSteeringPolicy string

The type of origin steering policy to use.

  • `"random"`: Select an origin randomly.
  • `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.
  • `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.
const (
	LoadBalancerPoolEditParamsOriginSteeringPolicyRandom                   LoadBalancerPoolEditParamsOriginSteeringPolicy = "random"
	LoadBalancerPoolEditParamsOriginSteeringPolicyHash                     LoadBalancerPoolEditParamsOriginSteeringPolicy = "hash"
	LoadBalancerPoolEditParamsOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolEditParamsOriginSteeringPolicy = "least_outstanding_requests"
	LoadBalancerPoolEditParamsOriginSteeringPolicyLeastConnections         LoadBalancerPoolEditParamsOriginSteeringPolicy = "least_connections"
)

type LoadBalancerPoolEditParamsOriginsHeader

type LoadBalancerPoolEditParamsOriginsHeader struct {
	// The 'Host' header allows to override the hostname set in the HTTP request.
	// Current support is 1 'Host' header override per origin.
	Host param.Field[[]string] `json:"Host"`
}

The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.

func (LoadBalancerPoolEditParamsOriginsHeader) MarshalJSON

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

type LoadBalancerPoolEditResponseEnvelope

type LoadBalancerPoolEditResponseEnvelope struct {
	Errors   []LoadBalancerPoolEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerPoolEditResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancingPool                              `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerPoolEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerPoolEditResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerPoolEditResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerPoolEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolEditResponseEnvelopeErrors

type LoadBalancerPoolEditResponseEnvelopeErrors struct {
	Code    int64                                          `json:"code,required"`
	Message string                                         `json:"message,required"`
	JSON    loadBalancerPoolEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerPoolEditResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerPoolEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolEditResponseEnvelopeMessages

type LoadBalancerPoolEditResponseEnvelopeMessages struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    loadBalancerPoolEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerPoolEditResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerPoolEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolEditResponseEnvelopeSuccess

type LoadBalancerPoolEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerPoolEditResponseEnvelopeSuccessTrue LoadBalancerPoolEditResponseEnvelopeSuccess = true
)

type LoadBalancerPoolGetResponseEnvelope

type LoadBalancerPoolGetResponseEnvelope struct {
	Errors   []LoadBalancerPoolGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerPoolGetResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancingPool                             `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerPoolGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerPoolGetResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerPoolGetResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerPoolGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolGetResponseEnvelopeErrors

type LoadBalancerPoolGetResponseEnvelopeErrors struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    loadBalancerPoolGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerPoolGetResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerPoolGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolGetResponseEnvelopeMessages

type LoadBalancerPoolGetResponseEnvelopeMessages struct {
	Code    int64                                           `json:"code,required"`
	Message string                                          `json:"message,required"`
	JSON    loadBalancerPoolGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerPoolGetResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerPoolGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolGetResponseEnvelopeSuccess

type LoadBalancerPoolGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerPoolGetResponseEnvelopeSuccessTrue LoadBalancerPoolGetResponseEnvelopeSuccess = true
)

type LoadBalancerPoolHealthResponse

type LoadBalancerPoolHealthResponse interface {
	ImplementsUserLoadBalancerPoolHealthResponse()
}

A list of regions from which to run health checks. Null means every Cloudflare data center.

Union satisfied by user.LoadBalancerPoolHealthResponseUnknown or shared.UnionString.

type LoadBalancerPoolHealthResponseEnvelope

type LoadBalancerPoolHealthResponseEnvelope struct {
	Errors   []LoadBalancerPoolHealthResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerPoolHealthResponseEnvelopeMessages `json:"messages,required"`
	// A list of regions from which to run health checks. Null means every Cloudflare
	// data center.
	Result LoadBalancerPoolHealthResponse `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerPoolHealthResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerPoolHealthResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerPoolHealthResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerPoolHealthResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolHealthResponseEnvelopeErrors

type LoadBalancerPoolHealthResponseEnvelopeErrors struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    loadBalancerPoolHealthResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerPoolHealthResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerPoolHealthResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolHealthResponseEnvelopeMessages

type LoadBalancerPoolHealthResponseEnvelopeMessages struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    loadBalancerPoolHealthResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerPoolHealthResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerPoolHealthResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolHealthResponseEnvelopeSuccess

type LoadBalancerPoolHealthResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerPoolHealthResponseEnvelopeSuccessTrue LoadBalancerPoolHealthResponseEnvelopeSuccess = true
)

type LoadBalancerPoolListParams

type LoadBalancerPoolListParams struct {
	// The ID of the Monitor to use for checking the health of origins within this
	// pool.
	Monitor param.Field[interface{}] `query:"monitor"`
}

func (LoadBalancerPoolListParams) URLQuery

func (r LoadBalancerPoolListParams) URLQuery() (v url.Values)

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

type LoadBalancerPoolListResponseEnvelope

type LoadBalancerPoolListResponseEnvelope struct {
	Errors   []LoadBalancerPoolListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerPoolListResponseEnvelopeMessages `json:"messages,required"`
	Result   []LoadBalancingPool                            `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    LoadBalancerPoolListResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo LoadBalancerPoolListResponseEnvelopeResultInfo `json:"result_info"`
	JSON       loadBalancerPoolListResponseEnvelopeJSON       `json:"-"`
}

func (*LoadBalancerPoolListResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerPoolListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolListResponseEnvelopeErrors

type LoadBalancerPoolListResponseEnvelopeErrors struct {
	Code    int64                                          `json:"code,required"`
	Message string                                         `json:"message,required"`
	JSON    loadBalancerPoolListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerPoolListResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerPoolListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolListResponseEnvelopeMessages

type LoadBalancerPoolListResponseEnvelopeMessages struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    loadBalancerPoolListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerPoolListResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerPoolListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolListResponseEnvelopeResultInfo

type LoadBalancerPoolListResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                            `json:"total_count"`
	JSON       loadBalancerPoolListResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*LoadBalancerPoolListResponseEnvelopeResultInfo) UnmarshalJSON

func (r *LoadBalancerPoolListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolListResponseEnvelopeSuccess

type LoadBalancerPoolListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerPoolListResponseEnvelopeSuccessTrue LoadBalancerPoolListResponseEnvelopeSuccess = true
)

type LoadBalancerPoolNewParams

type LoadBalancerPoolNewParams struct {
	// A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
	// underscores are allowed.
	Name param.Field[string] `json:"name,required"`
	// The list of origins within this pool. Traffic directed at this pool is balanced
	// across all currently healthy origins, provided the pool itself is healthy.
	Origins param.Field[[]LoadBalancerPoolNewParamsOrigin] `json:"origins,required"`
	// A list of regions from which to run health checks. Null means every Cloudflare
	// data center.
	CheckRegions param.Field[[]LoadBalancerPoolNewParamsCheckRegion] `json:"check_regions"`
	// A human-readable description of the pool.
	Description param.Field[string] `json:"description"`
	// Whether to enable (the default) or disable this pool. Disabled pools will not
	// receive traffic and are excluded from health checks. Disabling a pool will cause
	// any load balancers using it to failover to the next pool (if any).
	Enabled param.Field[bool] `json:"enabled"`
	// The latitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, longitude must also be set.
	Latitude param.Field[float64] `json:"latitude"`
	// Configures load shedding policies and percentages for the pool.
	LoadShedding param.Field[LoadBalancerPoolNewParamsLoadShedding] `json:"load_shedding"`
	// The longitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, latitude must also be set.
	Longitude param.Field[float64] `json:"longitude"`
	// The minimum number of origins that must be healthy for this pool to serve
	// traffic. If the number of healthy origins falls below this number, the pool will
	// be marked unhealthy and will failover to the next available pool.
	MinimumOrigins param.Field[int64] `json:"minimum_origins"`
	// The ID of the Monitor to use for checking the health of origins within this
	// pool.
	Monitor param.Field[interface{}] `json:"monitor"`
	// This field is now deprecated. It has been moved to Cloudflare's Centralized
	// Notification service
	// https://developers.cloudflare.com/fundamentals/notifications/. The email address
	// to send health status notifications to. This can be an individual mailbox or a
	// mailing list. Multiple emails can be supplied as a comma delimited list.
	NotificationEmail param.Field[string] `json:"notification_email"`
	// Filter pool and origin health notifications by resource type or health status.
	// Use null to reset.
	NotificationFilter param.Field[LoadBalancerPoolNewParamsNotificationFilter] `json:"notification_filter"`
	// Configures origin steering for the pool. Controls how origins are selected for
	// new sessions and traffic without session affinity.
	OriginSteering param.Field[LoadBalancerPoolNewParamsOriginSteering] `json:"origin_steering"`
}

func (LoadBalancerPoolNewParams) MarshalJSON

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

type LoadBalancerPoolNewParamsCheckRegion

type LoadBalancerPoolNewParamsCheckRegion string

WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (ENTERPRISE customers only).

const (
	LoadBalancerPoolNewParamsCheckRegionWnam       LoadBalancerPoolNewParamsCheckRegion = "WNAM"
	LoadBalancerPoolNewParamsCheckRegionEnam       LoadBalancerPoolNewParamsCheckRegion = "ENAM"
	LoadBalancerPoolNewParamsCheckRegionWeu        LoadBalancerPoolNewParamsCheckRegion = "WEU"
	LoadBalancerPoolNewParamsCheckRegionEeu        LoadBalancerPoolNewParamsCheckRegion = "EEU"
	LoadBalancerPoolNewParamsCheckRegionNsam       LoadBalancerPoolNewParamsCheckRegion = "NSAM"
	LoadBalancerPoolNewParamsCheckRegionSsam       LoadBalancerPoolNewParamsCheckRegion = "SSAM"
	LoadBalancerPoolNewParamsCheckRegionOc         LoadBalancerPoolNewParamsCheckRegion = "OC"
	LoadBalancerPoolNewParamsCheckRegionMe         LoadBalancerPoolNewParamsCheckRegion = "ME"
	LoadBalancerPoolNewParamsCheckRegionNaf        LoadBalancerPoolNewParamsCheckRegion = "NAF"
	LoadBalancerPoolNewParamsCheckRegionSaf        LoadBalancerPoolNewParamsCheckRegion = "SAF"
	LoadBalancerPoolNewParamsCheckRegionSas        LoadBalancerPoolNewParamsCheckRegion = "SAS"
	LoadBalancerPoolNewParamsCheckRegionSeas       LoadBalancerPoolNewParamsCheckRegion = "SEAS"
	LoadBalancerPoolNewParamsCheckRegionNeas       LoadBalancerPoolNewParamsCheckRegion = "NEAS"
	LoadBalancerPoolNewParamsCheckRegionAllRegions LoadBalancerPoolNewParamsCheckRegion = "ALL_REGIONS"
)

type LoadBalancerPoolNewParamsLoadShedding

type LoadBalancerPoolNewParamsLoadShedding struct {
	// The percent of traffic to shed from the pool, according to the default policy.
	// Applies to new sessions and traffic without session affinity.
	DefaultPercent param.Field[float64] `json:"default_percent"`
	// The default policy to use when load shedding. A random policy randomly sheds a
	// given percent of requests. A hash policy computes a hash over the
	// CF-Connecting-IP address and sheds all requests originating from a percent of
	// IPs.
	DefaultPolicy param.Field[LoadBalancerPoolNewParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
	// The percent of existing sessions to shed from the pool, according to the session
	// policy.
	SessionPercent param.Field[float64] `json:"session_percent"`
	// Only the hash policy is supported for existing sessions (to avoid exponential
	// decay).
	SessionPolicy param.Field[LoadBalancerPoolNewParamsLoadSheddingSessionPolicy] `json:"session_policy"`
}

Configures load shedding policies and percentages for the pool.

func (LoadBalancerPoolNewParamsLoadShedding) MarshalJSON

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

type LoadBalancerPoolNewParamsLoadSheddingDefaultPolicy

type LoadBalancerPoolNewParamsLoadSheddingDefaultPolicy string

The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.

const (
	LoadBalancerPoolNewParamsLoadSheddingDefaultPolicyRandom LoadBalancerPoolNewParamsLoadSheddingDefaultPolicy = "random"
	LoadBalancerPoolNewParamsLoadSheddingDefaultPolicyHash   LoadBalancerPoolNewParamsLoadSheddingDefaultPolicy = "hash"
)

type LoadBalancerPoolNewParamsLoadSheddingSessionPolicy

type LoadBalancerPoolNewParamsLoadSheddingSessionPolicy string

Only the hash policy is supported for existing sessions (to avoid exponential decay).

const (
	LoadBalancerPoolNewParamsLoadSheddingSessionPolicyHash LoadBalancerPoolNewParamsLoadSheddingSessionPolicy = "hash"
)

type LoadBalancerPoolNewParamsNotificationFilter

type LoadBalancerPoolNewParamsNotificationFilter struct {
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Origin param.Field[LoadBalancerPoolNewParamsNotificationFilterOrigin] `json:"origin"`
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Pool param.Field[LoadBalancerPoolNewParamsNotificationFilterPool] `json:"pool"`
}

Filter pool and origin health notifications by resource type or health status. Use null to reset.

func (LoadBalancerPoolNewParamsNotificationFilter) MarshalJSON

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

type LoadBalancerPoolNewParamsNotificationFilterOrigin

type LoadBalancerPoolNewParamsNotificationFilterOrigin struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (LoadBalancerPoolNewParamsNotificationFilterOrigin) MarshalJSON

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

type LoadBalancerPoolNewParamsNotificationFilterPool

type LoadBalancerPoolNewParamsNotificationFilterPool struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (LoadBalancerPoolNewParamsNotificationFilterPool) MarshalJSON

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

type LoadBalancerPoolNewParamsOrigin

type LoadBalancerPoolNewParamsOrigin struct {
	// The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
	// hostname. Hostnames entered here should resolve directly to the origin, and not
	// be a hostname proxied by Cloudflare. To set an internal/reserved address,
	// virtual_network_id must also be set.
	Address param.Field[string] `json:"address"`
	// Whether to enable (the default) this origin within the pool. Disabled origins
	// will not receive traffic and are excluded from health checks. The origin will
	// only be disabled for the current pool.
	Enabled param.Field[bool] `json:"enabled"`
	// The request header is used to pass additional information with an HTTP request.
	// Currently supported header is 'Host'.
	Header param.Field[LoadBalancerPoolNewParamsOriginsHeader] `json:"header"`
	// A human-identifiable name for the origin.
	Name param.Field[string] `json:"name"`
	// The virtual network subnet ID the origin belongs in. Virtual network must also
	// belong to the account.
	VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
	// The weight of this origin relative to other origins in the pool. Based on the
	// configured weight the total traffic is distributed among origins within the
	// pool.
	//
	//   - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
	//     origin's outstanding requests.
	//   - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
	//     open connections.
	Weight param.Field[float64] `json:"weight"`
}

func (LoadBalancerPoolNewParamsOrigin) MarshalJSON

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

type LoadBalancerPoolNewParamsOriginSteering

type LoadBalancerPoolNewParamsOriginSteering struct {
	// The type of origin steering policy to use.
	//
	//   - `"random"`: Select an origin randomly.
	//   - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
	//     address.
	//   - `"least_outstanding_requests"`: Select an origin by taking into consideration
	//     origin weights, as well as each origin's number of outstanding requests.
	//     Origins with more pending requests are weighted proportionately less relative
	//     to others.
	//   - `"least_connections"`: Select an origin by taking into consideration origin
	//     weights, as well as each origin's number of open connections. Origins with
	//     more open connections are weighted proportionately less relative to others.
	//     Supported for HTTP/1 and HTTP/2 connections.
	Policy param.Field[LoadBalancerPoolNewParamsOriginSteeringPolicy] `json:"policy"`
}

Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.

func (LoadBalancerPoolNewParamsOriginSteering) MarshalJSON

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

type LoadBalancerPoolNewParamsOriginSteeringPolicy

type LoadBalancerPoolNewParamsOriginSteeringPolicy string

The type of origin steering policy to use.

  • `"random"`: Select an origin randomly.
  • `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.
  • `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.
const (
	LoadBalancerPoolNewParamsOriginSteeringPolicyRandom                   LoadBalancerPoolNewParamsOriginSteeringPolicy = "random"
	LoadBalancerPoolNewParamsOriginSteeringPolicyHash                     LoadBalancerPoolNewParamsOriginSteeringPolicy = "hash"
	LoadBalancerPoolNewParamsOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolNewParamsOriginSteeringPolicy = "least_outstanding_requests"
	LoadBalancerPoolNewParamsOriginSteeringPolicyLeastConnections         LoadBalancerPoolNewParamsOriginSteeringPolicy = "least_connections"
)

type LoadBalancerPoolNewParamsOriginsHeader

type LoadBalancerPoolNewParamsOriginsHeader struct {
	// The 'Host' header allows to override the hostname set in the HTTP request.
	// Current support is 1 'Host' header override per origin.
	Host param.Field[[]string] `json:"Host"`
}

The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.

func (LoadBalancerPoolNewParamsOriginsHeader) MarshalJSON

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

type LoadBalancerPoolNewResponseEnvelope

type LoadBalancerPoolNewResponseEnvelope struct {
	Errors   []LoadBalancerPoolNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerPoolNewResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancingPool                             `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerPoolNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerPoolNewResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerPoolNewResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerPoolNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolNewResponseEnvelopeErrors

type LoadBalancerPoolNewResponseEnvelopeErrors struct {
	Code    int64                                         `json:"code,required"`
	Message string                                        `json:"message,required"`
	JSON    loadBalancerPoolNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerPoolNewResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerPoolNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolNewResponseEnvelopeMessages

type LoadBalancerPoolNewResponseEnvelopeMessages struct {
	Code    int64                                           `json:"code,required"`
	Message string                                          `json:"message,required"`
	JSON    loadBalancerPoolNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerPoolNewResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerPoolNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolNewResponseEnvelopeSuccess

type LoadBalancerPoolNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerPoolNewResponseEnvelopeSuccessTrue LoadBalancerPoolNewResponseEnvelopeSuccess = true
)

type LoadBalancerPoolPreviewParams

type LoadBalancerPoolPreviewParams struct {
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes param.Field[string] `json:"expected_codes,required"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure param.Field[bool] `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown param.Field[int64] `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp param.Field[int64] `json:"consecutive_up"`
	// Object description.
	Description param.Field[string] `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody param.Field[string] `json:"expected_body"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects param.Field[bool] `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header param.Field[interface{}] `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval param.Field[int64] `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method param.Field[string] `json:"method"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path param.Field[string] `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port param.Field[int64] `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone param.Field[string] `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries param.Field[int64] `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout param.Field[int64] `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type param.Field[LoadBalancerPoolPreviewParamsType] `json:"type"`
}

func (LoadBalancerPoolPreviewParams) MarshalJSON

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

type LoadBalancerPoolPreviewParamsType

type LoadBalancerPoolPreviewParamsType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	LoadBalancerPoolPreviewParamsTypeHTTP     LoadBalancerPoolPreviewParamsType = "http"
	LoadBalancerPoolPreviewParamsTypeHTTPS    LoadBalancerPoolPreviewParamsType = "https"
	LoadBalancerPoolPreviewParamsTypeTcp      LoadBalancerPoolPreviewParamsType = "tcp"
	LoadBalancerPoolPreviewParamsTypeUdpIcmp  LoadBalancerPoolPreviewParamsType = "udp_icmp"
	LoadBalancerPoolPreviewParamsTypeIcmpPing LoadBalancerPoolPreviewParamsType = "icmp_ping"
	LoadBalancerPoolPreviewParamsTypeSmtp     LoadBalancerPoolPreviewParamsType = "smtp"
)

type LoadBalancerPoolPreviewResponse

type LoadBalancerPoolPreviewResponse struct {
	// Monitored pool IDs mapped to their respective names.
	Pools     map[string]string                   `json:"pools"`
	PreviewID string                              `json:"preview_id"`
	JSON      loadBalancerPoolPreviewResponseJSON `json:"-"`
}

func (*LoadBalancerPoolPreviewResponse) UnmarshalJSON

func (r *LoadBalancerPoolPreviewResponse) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolPreviewResponseEnvelope

type LoadBalancerPoolPreviewResponseEnvelope struct {
	Errors   []LoadBalancerPoolPreviewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerPoolPreviewResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancerPoolPreviewResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerPoolPreviewResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerPoolPreviewResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerPoolPreviewResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerPoolPreviewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolPreviewResponseEnvelopeErrors

type LoadBalancerPoolPreviewResponseEnvelopeErrors struct {
	Code    int64                                             `json:"code,required"`
	Message string                                            `json:"message,required"`
	JSON    loadBalancerPoolPreviewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerPoolPreviewResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerPoolPreviewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolPreviewResponseEnvelopeMessages

type LoadBalancerPoolPreviewResponseEnvelopeMessages struct {
	Code    int64                                               `json:"code,required"`
	Message string                                              `json:"message,required"`
	JSON    loadBalancerPoolPreviewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerPoolPreviewResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerPoolPreviewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolPreviewResponseEnvelopeSuccess

type LoadBalancerPoolPreviewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerPoolPreviewResponseEnvelopeSuccessTrue LoadBalancerPoolPreviewResponseEnvelopeSuccess = true
)

type LoadBalancerPoolReferencesResponse

type LoadBalancerPoolReferencesResponse struct {
	ReferenceType LoadBalancerPoolReferencesResponseReferenceType `json:"reference_type"`
	ResourceID    string                                          `json:"resource_id"`
	ResourceName  string                                          `json:"resource_name"`
	ResourceType  string                                          `json:"resource_type"`
	JSON          loadBalancerPoolReferencesResponseJSON          `json:"-"`
}

func (*LoadBalancerPoolReferencesResponse) UnmarshalJSON

func (r *LoadBalancerPoolReferencesResponse) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolReferencesResponseEnvelope

type LoadBalancerPoolReferencesResponseEnvelope struct {
	Errors   []LoadBalancerPoolReferencesResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerPoolReferencesResponseEnvelopeMessages `json:"messages,required"`
	// List of resources that reference a given pool.
	Result []LoadBalancerPoolReferencesResponse `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    LoadBalancerPoolReferencesResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo LoadBalancerPoolReferencesResponseEnvelopeResultInfo `json:"result_info"`
	JSON       loadBalancerPoolReferencesResponseEnvelopeJSON       `json:"-"`
}

func (*LoadBalancerPoolReferencesResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerPoolReferencesResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolReferencesResponseEnvelopeErrors

type LoadBalancerPoolReferencesResponseEnvelopeErrors struct {
	Code    int64                                                `json:"code,required"`
	Message string                                               `json:"message,required"`
	JSON    loadBalancerPoolReferencesResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerPoolReferencesResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerPoolReferencesResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolReferencesResponseEnvelopeMessages

type LoadBalancerPoolReferencesResponseEnvelopeMessages struct {
	Code    int64                                                  `json:"code,required"`
	Message string                                                 `json:"message,required"`
	JSON    loadBalancerPoolReferencesResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerPoolReferencesResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerPoolReferencesResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolReferencesResponseEnvelopeResultInfo

type LoadBalancerPoolReferencesResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                                  `json:"total_count"`
	JSON       loadBalancerPoolReferencesResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*LoadBalancerPoolReferencesResponseEnvelopeResultInfo) UnmarshalJSON

func (r *LoadBalancerPoolReferencesResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolReferencesResponseEnvelopeSuccess

type LoadBalancerPoolReferencesResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerPoolReferencesResponseEnvelopeSuccessTrue LoadBalancerPoolReferencesResponseEnvelopeSuccess = true
)

type LoadBalancerPoolReferencesResponseReferenceType

type LoadBalancerPoolReferencesResponseReferenceType string
const (
	LoadBalancerPoolReferencesResponseReferenceTypeStar     LoadBalancerPoolReferencesResponseReferenceType = "*"
	LoadBalancerPoolReferencesResponseReferenceTypeReferral LoadBalancerPoolReferencesResponseReferenceType = "referral"
	LoadBalancerPoolReferencesResponseReferenceTypeReferrer LoadBalancerPoolReferencesResponseReferenceType = "referrer"
)

type LoadBalancerPoolService

type LoadBalancerPoolService struct {
	Options []option.RequestOption
}

LoadBalancerPoolService contains methods and other services that help with interacting with the cloudflare 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 NewLoadBalancerPoolService method instead.

func NewLoadBalancerPoolService

func NewLoadBalancerPoolService(opts ...option.RequestOption) (r *LoadBalancerPoolService)

NewLoadBalancerPoolService 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 (*LoadBalancerPoolService) Delete

Delete a configured pool.

func (*LoadBalancerPoolService) Edit

Apply changes to an existing pool, overwriting the supplied properties.

func (*LoadBalancerPoolService) Get

func (r *LoadBalancerPoolService) Get(ctx context.Context, poolID string, opts ...option.RequestOption) (res *LoadBalancingPool, err error)

Fetch a single configured pool.

func (*LoadBalancerPoolService) Health

Fetch the latest pool health status for a single pool.

func (*LoadBalancerPoolService) List

List configured pools.

func (*LoadBalancerPoolService) New

Create a new pool.

func (*LoadBalancerPoolService) Preview

Preview pool health using provided monitor details. The returned preview_id can be used in the preview endpoint to retrieve the results.

func (*LoadBalancerPoolService) References

Get the list of resources that reference the provided pool.

func (*LoadBalancerPoolService) Update

Modify a configured pool.

type LoadBalancerPoolUpdateParams

type LoadBalancerPoolUpdateParams struct {
	// A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
	// underscores are allowed.
	Name param.Field[string] `json:"name,required"`
	// The list of origins within this pool. Traffic directed at this pool is balanced
	// across all currently healthy origins, provided the pool itself is healthy.
	Origins param.Field[[]LoadBalancerPoolUpdateParamsOrigin] `json:"origins,required"`
	// A list of regions from which to run health checks. Null means every Cloudflare
	// data center.
	CheckRegions param.Field[[]LoadBalancerPoolUpdateParamsCheckRegion] `json:"check_regions"`
	// A human-readable description of the pool.
	Description param.Field[string] `json:"description"`
	// Whether to enable (the default) or disable this pool. Disabled pools will not
	// receive traffic and are excluded from health checks. Disabling a pool will cause
	// any load balancers using it to failover to the next pool (if any).
	Enabled param.Field[bool] `json:"enabled"`
	// The latitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, longitude must also be set.
	Latitude param.Field[float64] `json:"latitude"`
	// Configures load shedding policies and percentages for the pool.
	LoadShedding param.Field[LoadBalancerPoolUpdateParamsLoadShedding] `json:"load_shedding"`
	// The longitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, latitude must also be set.
	Longitude param.Field[float64] `json:"longitude"`
	// The minimum number of origins that must be healthy for this pool to serve
	// traffic. If the number of healthy origins falls below this number, the pool will
	// be marked unhealthy and will failover to the next available pool.
	MinimumOrigins param.Field[int64] `json:"minimum_origins"`
	// The ID of the Monitor to use for checking the health of origins within this
	// pool.
	Monitor param.Field[interface{}] `json:"monitor"`
	// This field is now deprecated. It has been moved to Cloudflare's Centralized
	// Notification service
	// https://developers.cloudflare.com/fundamentals/notifications/. The email address
	// to send health status notifications to. This can be an individual mailbox or a
	// mailing list. Multiple emails can be supplied as a comma delimited list.
	NotificationEmail param.Field[string] `json:"notification_email"`
	// Filter pool and origin health notifications by resource type or health status.
	// Use null to reset.
	NotificationFilter param.Field[LoadBalancerPoolUpdateParamsNotificationFilter] `json:"notification_filter"`
	// Configures origin steering for the pool. Controls how origins are selected for
	// new sessions and traffic without session affinity.
	OriginSteering param.Field[LoadBalancerPoolUpdateParamsOriginSteering] `json:"origin_steering"`
}

func (LoadBalancerPoolUpdateParams) MarshalJSON

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

type LoadBalancerPoolUpdateParamsCheckRegion

type LoadBalancerPoolUpdateParamsCheckRegion string

WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (ENTERPRISE customers only).

const (
	LoadBalancerPoolUpdateParamsCheckRegionWnam       LoadBalancerPoolUpdateParamsCheckRegion = "WNAM"
	LoadBalancerPoolUpdateParamsCheckRegionEnam       LoadBalancerPoolUpdateParamsCheckRegion = "ENAM"
	LoadBalancerPoolUpdateParamsCheckRegionWeu        LoadBalancerPoolUpdateParamsCheckRegion = "WEU"
	LoadBalancerPoolUpdateParamsCheckRegionEeu        LoadBalancerPoolUpdateParamsCheckRegion = "EEU"
	LoadBalancerPoolUpdateParamsCheckRegionNsam       LoadBalancerPoolUpdateParamsCheckRegion = "NSAM"
	LoadBalancerPoolUpdateParamsCheckRegionSsam       LoadBalancerPoolUpdateParamsCheckRegion = "SSAM"
	LoadBalancerPoolUpdateParamsCheckRegionOc         LoadBalancerPoolUpdateParamsCheckRegion = "OC"
	LoadBalancerPoolUpdateParamsCheckRegionMe         LoadBalancerPoolUpdateParamsCheckRegion = "ME"
	LoadBalancerPoolUpdateParamsCheckRegionNaf        LoadBalancerPoolUpdateParamsCheckRegion = "NAF"
	LoadBalancerPoolUpdateParamsCheckRegionSaf        LoadBalancerPoolUpdateParamsCheckRegion = "SAF"
	LoadBalancerPoolUpdateParamsCheckRegionSas        LoadBalancerPoolUpdateParamsCheckRegion = "SAS"
	LoadBalancerPoolUpdateParamsCheckRegionSeas       LoadBalancerPoolUpdateParamsCheckRegion = "SEAS"
	LoadBalancerPoolUpdateParamsCheckRegionNeas       LoadBalancerPoolUpdateParamsCheckRegion = "NEAS"
	LoadBalancerPoolUpdateParamsCheckRegionAllRegions LoadBalancerPoolUpdateParamsCheckRegion = "ALL_REGIONS"
)

type LoadBalancerPoolUpdateParamsLoadShedding

type LoadBalancerPoolUpdateParamsLoadShedding struct {
	// The percent of traffic to shed from the pool, according to the default policy.
	// Applies to new sessions and traffic without session affinity.
	DefaultPercent param.Field[float64] `json:"default_percent"`
	// The default policy to use when load shedding. A random policy randomly sheds a
	// given percent of requests. A hash policy computes a hash over the
	// CF-Connecting-IP address and sheds all requests originating from a percent of
	// IPs.
	DefaultPolicy param.Field[LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicy] `json:"default_policy"`
	// The percent of existing sessions to shed from the pool, according to the session
	// policy.
	SessionPercent param.Field[float64] `json:"session_percent"`
	// Only the hash policy is supported for existing sessions (to avoid exponential
	// decay).
	SessionPolicy param.Field[LoadBalancerPoolUpdateParamsLoadSheddingSessionPolicy] `json:"session_policy"`
}

Configures load shedding policies and percentages for the pool.

func (LoadBalancerPoolUpdateParamsLoadShedding) MarshalJSON

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

type LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicy

type LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicy string

The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.

const (
	LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicyRandom LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicy = "random"
	LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicyHash   LoadBalancerPoolUpdateParamsLoadSheddingDefaultPolicy = "hash"
)

type LoadBalancerPoolUpdateParamsLoadSheddingSessionPolicy

type LoadBalancerPoolUpdateParamsLoadSheddingSessionPolicy string

Only the hash policy is supported for existing sessions (to avoid exponential decay).

const (
	LoadBalancerPoolUpdateParamsLoadSheddingSessionPolicyHash LoadBalancerPoolUpdateParamsLoadSheddingSessionPolicy = "hash"
)

type LoadBalancerPoolUpdateParamsNotificationFilter

type LoadBalancerPoolUpdateParamsNotificationFilter struct {
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Origin param.Field[LoadBalancerPoolUpdateParamsNotificationFilterOrigin] `json:"origin"`
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Pool param.Field[LoadBalancerPoolUpdateParamsNotificationFilterPool] `json:"pool"`
}

Filter pool and origin health notifications by resource type or health status. Use null to reset.

func (LoadBalancerPoolUpdateParamsNotificationFilter) MarshalJSON

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

type LoadBalancerPoolUpdateParamsNotificationFilterOrigin

type LoadBalancerPoolUpdateParamsNotificationFilterOrigin struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (LoadBalancerPoolUpdateParamsNotificationFilterOrigin) MarshalJSON

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

type LoadBalancerPoolUpdateParamsNotificationFilterPool

type LoadBalancerPoolUpdateParamsNotificationFilterPool struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable param.Field[bool] `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy param.Field[bool] `json:"healthy"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (LoadBalancerPoolUpdateParamsNotificationFilterPool) MarshalJSON

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

type LoadBalancerPoolUpdateParamsOrigin

type LoadBalancerPoolUpdateParamsOrigin struct {
	// The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
	// hostname. Hostnames entered here should resolve directly to the origin, and not
	// be a hostname proxied by Cloudflare. To set an internal/reserved address,
	// virtual_network_id must also be set.
	Address param.Field[string] `json:"address"`
	// Whether to enable (the default) this origin within the pool. Disabled origins
	// will not receive traffic and are excluded from health checks. The origin will
	// only be disabled for the current pool.
	Enabled param.Field[bool] `json:"enabled"`
	// The request header is used to pass additional information with an HTTP request.
	// Currently supported header is 'Host'.
	Header param.Field[LoadBalancerPoolUpdateParamsOriginsHeader] `json:"header"`
	// A human-identifiable name for the origin.
	Name param.Field[string] `json:"name"`
	// The virtual network subnet ID the origin belongs in. Virtual network must also
	// belong to the account.
	VirtualNetworkID param.Field[string] `json:"virtual_network_id"`
	// The weight of this origin relative to other origins in the pool. Based on the
	// configured weight the total traffic is distributed among origins within the
	// pool.
	//
	//   - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
	//     origin's outstanding requests.
	//   - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
	//     open connections.
	Weight param.Field[float64] `json:"weight"`
}

func (LoadBalancerPoolUpdateParamsOrigin) MarshalJSON

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

type LoadBalancerPoolUpdateParamsOriginSteering

type LoadBalancerPoolUpdateParamsOriginSteering struct {
	// The type of origin steering policy to use.
	//
	//   - `"random"`: Select an origin randomly.
	//   - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
	//     address.
	//   - `"least_outstanding_requests"`: Select an origin by taking into consideration
	//     origin weights, as well as each origin's number of outstanding requests.
	//     Origins with more pending requests are weighted proportionately less relative
	//     to others.
	//   - `"least_connections"`: Select an origin by taking into consideration origin
	//     weights, as well as each origin's number of open connections. Origins with
	//     more open connections are weighted proportionately less relative to others.
	//     Supported for HTTP/1 and HTTP/2 connections.
	Policy param.Field[LoadBalancerPoolUpdateParamsOriginSteeringPolicy] `json:"policy"`
}

Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.

func (LoadBalancerPoolUpdateParamsOriginSteering) MarshalJSON

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

type LoadBalancerPoolUpdateParamsOriginSteeringPolicy

type LoadBalancerPoolUpdateParamsOriginSteeringPolicy string

The type of origin steering policy to use.

  • `"random"`: Select an origin randomly.
  • `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.
  • `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.
const (
	LoadBalancerPoolUpdateParamsOriginSteeringPolicyRandom                   LoadBalancerPoolUpdateParamsOriginSteeringPolicy = "random"
	LoadBalancerPoolUpdateParamsOriginSteeringPolicyHash                     LoadBalancerPoolUpdateParamsOriginSteeringPolicy = "hash"
	LoadBalancerPoolUpdateParamsOriginSteeringPolicyLeastOutstandingRequests LoadBalancerPoolUpdateParamsOriginSteeringPolicy = "least_outstanding_requests"
	LoadBalancerPoolUpdateParamsOriginSteeringPolicyLeastConnections         LoadBalancerPoolUpdateParamsOriginSteeringPolicy = "least_connections"
)

type LoadBalancerPoolUpdateParamsOriginsHeader

type LoadBalancerPoolUpdateParamsOriginsHeader struct {
	// The 'Host' header allows to override the hostname set in the HTTP request.
	// Current support is 1 'Host' header override per origin.
	Host param.Field[[]string] `json:"Host"`
}

The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.

func (LoadBalancerPoolUpdateParamsOriginsHeader) MarshalJSON

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

type LoadBalancerPoolUpdateResponseEnvelope

type LoadBalancerPoolUpdateResponseEnvelope struct {
	Errors   []LoadBalancerPoolUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerPoolUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   LoadBalancingPool                                `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerPoolUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerPoolUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerPoolUpdateResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerPoolUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolUpdateResponseEnvelopeErrors

type LoadBalancerPoolUpdateResponseEnvelopeErrors struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    loadBalancerPoolUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerPoolUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerPoolUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolUpdateResponseEnvelopeMessages

type LoadBalancerPoolUpdateResponseEnvelopeMessages struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    loadBalancerPoolUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerPoolUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerPoolUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPoolUpdateResponseEnvelopeSuccess

type LoadBalancerPoolUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerPoolUpdateResponseEnvelopeSuccessTrue LoadBalancerPoolUpdateResponseEnvelopeSuccess = true
)

type LoadBalancerPreviewGetResponseEnvelope

type LoadBalancerPreviewGetResponseEnvelope struct {
	Errors   []LoadBalancerPreviewGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []LoadBalancerPreviewGetResponseEnvelopeMessages `json:"messages,required"`
	// Resulting health data from a preview operation.
	Result LoadBalancingPreviewResult `json:"result,required"`
	// Whether the API call was successful
	Success LoadBalancerPreviewGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    loadBalancerPreviewGetResponseEnvelopeJSON    `json:"-"`
}

func (*LoadBalancerPreviewGetResponseEnvelope) UnmarshalJSON

func (r *LoadBalancerPreviewGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPreviewGetResponseEnvelopeErrors

type LoadBalancerPreviewGetResponseEnvelopeErrors struct {
	Code    int64                                            `json:"code,required"`
	Message string                                           `json:"message,required"`
	JSON    loadBalancerPreviewGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*LoadBalancerPreviewGetResponseEnvelopeErrors) UnmarshalJSON

func (r *LoadBalancerPreviewGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPreviewGetResponseEnvelopeMessages

type LoadBalancerPreviewGetResponseEnvelopeMessages struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    loadBalancerPreviewGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*LoadBalancerPreviewGetResponseEnvelopeMessages) UnmarshalJSON

func (r *LoadBalancerPreviewGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type LoadBalancerPreviewGetResponseEnvelopeSuccess

type LoadBalancerPreviewGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	LoadBalancerPreviewGetResponseEnvelopeSuccessTrue LoadBalancerPreviewGetResponseEnvelopeSuccess = true
)

type LoadBalancerPreviewService

type LoadBalancerPreviewService struct {
	Options []option.RequestOption
}

LoadBalancerPreviewService contains methods and other services that help with interacting with the cloudflare 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 NewLoadBalancerPreviewService method instead.

func NewLoadBalancerPreviewService

func NewLoadBalancerPreviewService(opts ...option.RequestOption) (r *LoadBalancerPreviewService)

NewLoadBalancerPreviewService 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 (*LoadBalancerPreviewService) Get

func (r *LoadBalancerPreviewService) Get(ctx context.Context, previewID interface{}, opts ...option.RequestOption) (res *LoadBalancingPreviewResult, err error)

Get the result of a previous preview operation using the provided preview_id.

type LoadBalancerService

type LoadBalancerService struct {
	Options   []option.RequestOption
	Monitors  *LoadBalancerMonitorService
	Pools     *LoadBalancerPoolService
	Preview   *LoadBalancerPreviewService
	Analytics *LoadBalancerAnalyticsService
}

LoadBalancerService contains methods and other services that help with interacting with the cloudflare 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 NewLoadBalancerService method instead.

func NewLoadBalancerService

func NewLoadBalancerService(opts ...option.RequestOption) (r *LoadBalancerService)

NewLoadBalancerService 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 LoadBalancingAnalytics

type LoadBalancingAnalytics struct {
	ID        int64                      `json:"id"`
	Origins   []interface{}              `json:"origins"`
	Pool      interface{}                `json:"pool"`
	Timestamp time.Time                  `json:"timestamp" format:"date-time"`
	JSON      loadBalancingAnalyticsJSON `json:"-"`
}

func (*LoadBalancingAnalytics) UnmarshalJSON

func (r *LoadBalancingAnalytics) UnmarshalJSON(data []byte) (err error)

type LoadBalancingMonitor

type LoadBalancingMonitor struct {
	ID string `json:"id"`
	// Do not validate the certificate when monitor use HTTPS. This parameter is
	// currently only valid for HTTP and HTTPS monitors.
	AllowInsecure bool `json:"allow_insecure"`
	// To be marked unhealthy the monitored origin must fail this healthcheck N
	// consecutive times.
	ConsecutiveDown int64 `json:"consecutive_down"`
	// To be marked healthy the monitored origin must pass this healthcheck N
	// consecutive times.
	ConsecutiveUp int64     `json:"consecutive_up"`
	CreatedOn     time.Time `json:"created_on" format:"date-time"`
	// Object description.
	Description string `json:"description"`
	// A case-insensitive sub-string to look for in the response body. If this string
	// is not found, the origin will be marked as unhealthy. This parameter is only
	// valid for HTTP and HTTPS monitors.
	ExpectedBody string `json:"expected_body"`
	// The expected HTTP response code or code range of the health check. This
	// parameter is only valid for HTTP and HTTPS monitors.
	ExpectedCodes string `json:"expected_codes"`
	// Follow redirects if returned by the origin. This parameter is only valid for
	// HTTP and HTTPS monitors.
	FollowRedirects bool `json:"follow_redirects"`
	// The HTTP request headers to send in the health check. It is recommended you set
	// a Host header by default. The User-Agent header cannot be overridden. This
	// parameter is only valid for HTTP and HTTPS monitors.
	Header interface{} `json:"header"`
	// The interval between each health check. Shorter intervals may improve failover
	// time, but will increase load on the origins as we check from multiple locations.
	Interval int64 `json:"interval"`
	// The method to use for the health check. This defaults to 'GET' for HTTP/HTTPS
	// based checks and 'connection_established' for TCP based health checks.
	Method     string    `json:"method"`
	ModifiedOn time.Time `json:"modified_on" format:"date-time"`
	// The endpoint path you want to conduct a health check against. This parameter is
	// only valid for HTTP and HTTPS monitors.
	Path string `json:"path"`
	// The port number to connect to for the health check. Required for TCP, UDP, and
	// SMTP checks. HTTP and HTTPS checks should only define the port when using a
	// non-standard port (HTTP: default 80, HTTPS: default 443).
	Port int64 `json:"port"`
	// Assign this monitor to emulate the specified zone while probing. This parameter
	// is only valid for HTTP and HTTPS monitors.
	ProbeZone string `json:"probe_zone"`
	// The number of retries to attempt in case of a timeout before marking the origin
	// as unhealthy. Retries are attempted immediately.
	Retries int64 `json:"retries"`
	// The timeout (in seconds) before marking the health check as failed.
	Timeout int64 `json:"timeout"`
	// The protocol to use for the health check. Currently supported protocols are
	// 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.
	Type LoadBalancingMonitorType `json:"type"`
	JSON loadBalancingMonitorJSON `json:"-"`
}

func (*LoadBalancingMonitor) UnmarshalJSON

func (r *LoadBalancingMonitor) UnmarshalJSON(data []byte) (err error)

type LoadBalancingMonitorType

type LoadBalancingMonitorType string

The protocol to use for the health check. Currently supported protocols are 'HTTP','HTTPS', 'TCP', 'ICMP-PING', 'UDP-ICMP', and 'SMTP'.

const (
	LoadBalancingMonitorTypeHTTP     LoadBalancingMonitorType = "http"
	LoadBalancingMonitorTypeHTTPS    LoadBalancingMonitorType = "https"
	LoadBalancingMonitorTypeTcp      LoadBalancingMonitorType = "tcp"
	LoadBalancingMonitorTypeUdpIcmp  LoadBalancingMonitorType = "udp_icmp"
	LoadBalancingMonitorTypeIcmpPing LoadBalancingMonitorType = "icmp_ping"
	LoadBalancingMonitorTypeSmtp     LoadBalancingMonitorType = "smtp"
)

type LoadBalancingPool

type LoadBalancingPool struct {
	ID string `json:"id"`
	// A list of regions from which to run health checks. Null means every Cloudflare
	// data center.
	CheckRegions []LoadBalancingPoolCheckRegion `json:"check_regions,nullable"`
	CreatedOn    time.Time                      `json:"created_on" format:"date-time"`
	// A human-readable description of the pool.
	Description string `json:"description"`
	// This field shows up only if the pool is disabled. This field is set with the
	// time the pool was disabled at.
	DisabledAt time.Time `json:"disabled_at" format:"date-time"`
	// Whether to enable (the default) or disable this pool. Disabled pools will not
	// receive traffic and are excluded from health checks. Disabling a pool will cause
	// any load balancers using it to failover to the next pool (if any).
	Enabled bool `json:"enabled"`
	// The latitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, longitude must also be set.
	Latitude float64 `json:"latitude"`
	// Configures load shedding policies and percentages for the pool.
	LoadShedding LoadBalancingPoolLoadShedding `json:"load_shedding"`
	// The longitude of the data center containing the origins used in this pool in
	// decimal degrees. If this is set, latitude must also be set.
	Longitude float64 `json:"longitude"`
	// The minimum number of origins that must be healthy for this pool to serve
	// traffic. If the number of healthy origins falls below this number, the pool will
	// be marked unhealthy and will failover to the next available pool.
	MinimumOrigins int64     `json:"minimum_origins"`
	ModifiedOn     time.Time `json:"modified_on" format:"date-time"`
	// The ID of the Monitor to use for checking the health of origins within this
	// pool.
	Monitor interface{} `json:"monitor"`
	// A short name (tag) for the pool. Only alphanumeric characters, hyphens, and
	// underscores are allowed.
	Name string `json:"name"`
	// This field is now deprecated. It has been moved to Cloudflare's Centralized
	// Notification service
	// https://developers.cloudflare.com/fundamentals/notifications/. The email address
	// to send health status notifications to. This can be an individual mailbox or a
	// mailing list. Multiple emails can be supplied as a comma delimited list.
	NotificationEmail string `json:"notification_email"`
	// Filter pool and origin health notifications by resource type or health status.
	// Use null to reset.
	NotificationFilter LoadBalancingPoolNotificationFilter `json:"notification_filter,nullable"`
	// Configures origin steering for the pool. Controls how origins are selected for
	// new sessions and traffic without session affinity.
	OriginSteering LoadBalancingPoolOriginSteering `json:"origin_steering"`
	// The list of origins within this pool. Traffic directed at this pool is balanced
	// across all currently healthy origins, provided the pool itself is healthy.
	Origins []LoadBalancingPoolOrigin `json:"origins"`
	JSON    loadBalancingPoolJSON     `json:"-"`
}

func (*LoadBalancingPool) UnmarshalJSON

func (r *LoadBalancingPool) UnmarshalJSON(data []byte) (err error)

type LoadBalancingPoolCheckRegion

type LoadBalancingPoolCheckRegion string

WNAM: Western North America, ENAM: Eastern North America, WEU: Western Europe, EEU: Eastern Europe, NSAM: Northern South America, SSAM: Southern South America, OC: Oceania, ME: Middle East, NAF: North Africa, SAF: South Africa, SAS: Southern Asia, SEAS: South East Asia, NEAS: North East Asia, ALL_REGIONS: all regions (ENTERPRISE customers only).

const (
	LoadBalancingPoolCheckRegionWnam       LoadBalancingPoolCheckRegion = "WNAM"
	LoadBalancingPoolCheckRegionEnam       LoadBalancingPoolCheckRegion = "ENAM"
	LoadBalancingPoolCheckRegionWeu        LoadBalancingPoolCheckRegion = "WEU"
	LoadBalancingPoolCheckRegionEeu        LoadBalancingPoolCheckRegion = "EEU"
	LoadBalancingPoolCheckRegionNsam       LoadBalancingPoolCheckRegion = "NSAM"
	LoadBalancingPoolCheckRegionSsam       LoadBalancingPoolCheckRegion = "SSAM"
	LoadBalancingPoolCheckRegionOc         LoadBalancingPoolCheckRegion = "OC"
	LoadBalancingPoolCheckRegionMe         LoadBalancingPoolCheckRegion = "ME"
	LoadBalancingPoolCheckRegionNaf        LoadBalancingPoolCheckRegion = "NAF"
	LoadBalancingPoolCheckRegionSaf        LoadBalancingPoolCheckRegion = "SAF"
	LoadBalancingPoolCheckRegionSas        LoadBalancingPoolCheckRegion = "SAS"
	LoadBalancingPoolCheckRegionSeas       LoadBalancingPoolCheckRegion = "SEAS"
	LoadBalancingPoolCheckRegionNeas       LoadBalancingPoolCheckRegion = "NEAS"
	LoadBalancingPoolCheckRegionAllRegions LoadBalancingPoolCheckRegion = "ALL_REGIONS"
)

type LoadBalancingPoolLoadShedding

type LoadBalancingPoolLoadShedding struct {
	// The percent of traffic to shed from the pool, according to the default policy.
	// Applies to new sessions and traffic without session affinity.
	DefaultPercent float64 `json:"default_percent"`
	// The default policy to use when load shedding. A random policy randomly sheds a
	// given percent of requests. A hash policy computes a hash over the
	// CF-Connecting-IP address and sheds all requests originating from a percent of
	// IPs.
	DefaultPolicy LoadBalancingPoolLoadSheddingDefaultPolicy `json:"default_policy"`
	// The percent of existing sessions to shed from the pool, according to the session
	// policy.
	SessionPercent float64 `json:"session_percent"`
	// Only the hash policy is supported for existing sessions (to avoid exponential
	// decay).
	SessionPolicy LoadBalancingPoolLoadSheddingSessionPolicy `json:"session_policy"`
	JSON          loadBalancingPoolLoadSheddingJSON          `json:"-"`
}

Configures load shedding policies and percentages for the pool.

func (*LoadBalancingPoolLoadShedding) UnmarshalJSON

func (r *LoadBalancingPoolLoadShedding) UnmarshalJSON(data []byte) (err error)

type LoadBalancingPoolLoadSheddingDefaultPolicy

type LoadBalancingPoolLoadSheddingDefaultPolicy string

The default policy to use when load shedding. A random policy randomly sheds a given percent of requests. A hash policy computes a hash over the CF-Connecting-IP address and sheds all requests originating from a percent of IPs.

const (
	LoadBalancingPoolLoadSheddingDefaultPolicyRandom LoadBalancingPoolLoadSheddingDefaultPolicy = "random"
	LoadBalancingPoolLoadSheddingDefaultPolicyHash   LoadBalancingPoolLoadSheddingDefaultPolicy = "hash"
)

type LoadBalancingPoolLoadSheddingSessionPolicy

type LoadBalancingPoolLoadSheddingSessionPolicy string

Only the hash policy is supported for existing sessions (to avoid exponential decay).

const (
	LoadBalancingPoolLoadSheddingSessionPolicyHash LoadBalancingPoolLoadSheddingSessionPolicy = "hash"
)

type LoadBalancingPoolNotificationFilter

type LoadBalancingPoolNotificationFilter struct {
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Origin LoadBalancingPoolNotificationFilterOrigin `json:"origin,nullable"`
	// Filter options for a particular resource type (pool or origin). Use null to
	// reset.
	Pool LoadBalancingPoolNotificationFilterPool `json:"pool,nullable"`
	JSON loadBalancingPoolNotificationFilterJSON `json:"-"`
}

Filter pool and origin health notifications by resource type or health status. Use null to reset.

func (*LoadBalancingPoolNotificationFilter) UnmarshalJSON

func (r *LoadBalancingPoolNotificationFilter) UnmarshalJSON(data []byte) (err error)

type LoadBalancingPoolNotificationFilterOrigin

type LoadBalancingPoolNotificationFilterOrigin struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable bool `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy bool                                          `json:"healthy,nullable"`
	JSON    loadBalancingPoolNotificationFilterOriginJSON `json:"-"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (*LoadBalancingPoolNotificationFilterOrigin) UnmarshalJSON

func (r *LoadBalancingPoolNotificationFilterOrigin) UnmarshalJSON(data []byte) (err error)

type LoadBalancingPoolNotificationFilterPool

type LoadBalancingPoolNotificationFilterPool struct {
	// If set true, disable notifications for this type of resource (pool or origin).
	Disable bool `json:"disable"`
	// If present, send notifications only for this health status (e.g. false for only
	// DOWN events). Use null to reset (all events).
	Healthy bool                                        `json:"healthy,nullable"`
	JSON    loadBalancingPoolNotificationFilterPoolJSON `json:"-"`
}

Filter options for a particular resource type (pool or origin). Use null to reset.

func (*LoadBalancingPoolNotificationFilterPool) UnmarshalJSON

func (r *LoadBalancingPoolNotificationFilterPool) UnmarshalJSON(data []byte) (err error)

type LoadBalancingPoolOrigin

type LoadBalancingPoolOrigin struct {
	// The IP address (IPv4 or IPv6) of the origin, or its publicly addressable
	// hostname. Hostnames entered here should resolve directly to the origin, and not
	// be a hostname proxied by Cloudflare. To set an internal/reserved address,
	// virtual_network_id must also be set.
	Address string `json:"address"`
	// This field shows up only if the origin is disabled. This field is set with the
	// time the origin was disabled.
	DisabledAt time.Time `json:"disabled_at" format:"date-time"`
	// Whether to enable (the default) this origin within the pool. Disabled origins
	// will not receive traffic and are excluded from health checks. The origin will
	// only be disabled for the current pool.
	Enabled bool `json:"enabled"`
	// The request header is used to pass additional information with an HTTP request.
	// Currently supported header is 'Host'.
	Header LoadBalancingPoolOriginsHeader `json:"header"`
	// A human-identifiable name for the origin.
	Name string `json:"name"`
	// The virtual network subnet ID the origin belongs in. Virtual network must also
	// belong to the account.
	VirtualNetworkID string `json:"virtual_network_id"`
	// The weight of this origin relative to other origins in the pool. Based on the
	// configured weight the total traffic is distributed among origins within the
	// pool.
	//
	//   - `origin_steering.policy="least_outstanding_requests"`: Use weight to scale the
	//     origin's outstanding requests.
	//   - `origin_steering.policy="least_connections"`: Use weight to scale the origin's
	//     open connections.
	Weight float64                     `json:"weight"`
	JSON   loadBalancingPoolOriginJSON `json:"-"`
}

func (*LoadBalancingPoolOrigin) UnmarshalJSON

func (r *LoadBalancingPoolOrigin) UnmarshalJSON(data []byte) (err error)

type LoadBalancingPoolOriginSteering

type LoadBalancingPoolOriginSteering struct {
	// The type of origin steering policy to use.
	//
	//   - `"random"`: Select an origin randomly.
	//   - `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP
	//     address.
	//   - `"least_outstanding_requests"`: Select an origin by taking into consideration
	//     origin weights, as well as each origin's number of outstanding requests.
	//     Origins with more pending requests are weighted proportionately less relative
	//     to others.
	//   - `"least_connections"`: Select an origin by taking into consideration origin
	//     weights, as well as each origin's number of open connections. Origins with
	//     more open connections are weighted proportionately less relative to others.
	//     Supported for HTTP/1 and HTTP/2 connections.
	Policy LoadBalancingPoolOriginSteeringPolicy `json:"policy"`
	JSON   loadBalancingPoolOriginSteeringJSON   `json:"-"`
}

Configures origin steering for the pool. Controls how origins are selected for new sessions and traffic without session affinity.

func (*LoadBalancingPoolOriginSteering) UnmarshalJSON

func (r *LoadBalancingPoolOriginSteering) UnmarshalJSON(data []byte) (err error)

type LoadBalancingPoolOriginSteeringPolicy

type LoadBalancingPoolOriginSteeringPolicy string

The type of origin steering policy to use.

  • `"random"`: Select an origin randomly.
  • `"hash"`: Select an origin by computing a hash over the CF-Connecting-IP address.
  • `"least_outstanding_requests"`: Select an origin by taking into consideration origin weights, as well as each origin's number of outstanding requests. Origins with more pending requests are weighted proportionately less relative to others.
  • `"least_connections"`: Select an origin by taking into consideration origin weights, as well as each origin's number of open connections. Origins with more open connections are weighted proportionately less relative to others. Supported for HTTP/1 and HTTP/2 connections.
const (
	LoadBalancingPoolOriginSteeringPolicyRandom                   LoadBalancingPoolOriginSteeringPolicy = "random"
	LoadBalancingPoolOriginSteeringPolicyHash                     LoadBalancingPoolOriginSteeringPolicy = "hash"
	LoadBalancingPoolOriginSteeringPolicyLeastOutstandingRequests LoadBalancingPoolOriginSteeringPolicy = "least_outstanding_requests"
	LoadBalancingPoolOriginSteeringPolicyLeastConnections         LoadBalancingPoolOriginSteeringPolicy = "least_connections"
)

type LoadBalancingPoolOriginsHeader

type LoadBalancingPoolOriginsHeader struct {
	// The 'Host' header allows to override the hostname set in the HTTP request.
	// Current support is 1 'Host' header override per origin.
	Host []string                           `json:"Host"`
	JSON loadBalancingPoolOriginsHeaderJSON `json:"-"`
}

The request header is used to pass additional information with an HTTP request. Currently supported header is 'Host'.

func (*LoadBalancingPoolOriginsHeader) UnmarshalJSON

func (r *LoadBalancingPoolOriginsHeader) UnmarshalJSON(data []byte) (err error)

type LoadBalancingPreviewResult

type LoadBalancingPreviewResult map[string]LoadBalancingPreviewResultItem

type LoadBalancingPreviewResultItem

type LoadBalancingPreviewResultItem struct {
	Healthy bool                                          `json:"healthy"`
	Origins []map[string]LoadBalancingPreviewResultOrigin `json:"origins"`
	JSON    loadBalancingPreviewResultItemJSON            `json:"-"`
}

func (*LoadBalancingPreviewResultItem) UnmarshalJSON

func (r *LoadBalancingPreviewResultItem) UnmarshalJSON(data []byte) (err error)

type LoadBalancingPreviewResultOrigin

type LoadBalancingPreviewResultOrigin struct {
	FailureReason string                               `json:"failure_reason"`
	Healthy       bool                                 `json:"healthy"`
	ResponseCode  float64                              `json:"response_code"`
	RTT           string                               `json:"rtt"`
	JSON          loadBalancingPreviewResultOriginJSON `json:"-"`
}

The origin ipv4/ipv6 address or domain name mapped to it's health data.

func (*LoadBalancingPreviewResultOrigin) UnmarshalJSON

func (r *LoadBalancingPreviewResultOrigin) UnmarshalJSON(data []byte) (err error)

type OrganizationDeleteResponse

type OrganizationDeleteResponse struct {
	// Identifier
	ID   string                         `json:"id"`
	JSON organizationDeleteResponseJSON `json:"-"`
}

func (*OrganizationDeleteResponse) UnmarshalJSON

func (r *OrganizationDeleteResponse) UnmarshalJSON(data []byte) (err error)

type OrganizationGetResponse added in v2.3.0

type OrganizationGetResponse interface {
	ImplementsUserOrganizationGetResponse()
}

Union satisfied by user.OrganizationGetResponseUnknown or shared.UnionString.

type OrganizationGetResponseEnvelope

type OrganizationGetResponseEnvelope struct {
	Errors   []OrganizationGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []OrganizationGetResponseEnvelopeMessages `json:"messages,required"`
	Result   OrganizationGetResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success OrganizationGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    organizationGetResponseEnvelopeJSON    `json:"-"`
}

func (*OrganizationGetResponseEnvelope) UnmarshalJSON

func (r *OrganizationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type OrganizationGetResponseEnvelopeErrors

type OrganizationGetResponseEnvelopeErrors struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    organizationGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*OrganizationGetResponseEnvelopeErrors) UnmarshalJSON

func (r *OrganizationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type OrganizationGetResponseEnvelopeMessages

type OrganizationGetResponseEnvelopeMessages struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    organizationGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*OrganizationGetResponseEnvelopeMessages) UnmarshalJSON

func (r *OrganizationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type OrganizationGetResponseEnvelopeSuccess

type OrganizationGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	OrganizationGetResponseEnvelopeSuccessTrue OrganizationGetResponseEnvelopeSuccess = true
)

type OrganizationListParams

type OrganizationListParams struct {
	// Direction to order organizations.
	Direction param.Field[OrganizationListParamsDirection] `query:"direction"`
	// Whether to match all search requirements or at least one (any).
	Match param.Field[OrganizationListParamsMatch] `query:"match"`
	// Organization name.
	Name param.Field[string] `query:"name"`
	// Field to order organizations by.
	Order param.Field[OrganizationListParamsOrder] `query:"order"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// Number of organizations per page.
	PerPage param.Field[float64] `query:"per_page"`
	// Whether the user is a member of the organization or has an inivitation pending.
	Status param.Field[OrganizationListParamsStatus] `query:"status"`
}

func (OrganizationListParams) URLQuery

func (r OrganizationListParams) URLQuery() (v url.Values)

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

type OrganizationListParamsDirection

type OrganizationListParamsDirection string

Direction to order organizations.

const (
	OrganizationListParamsDirectionAsc  OrganizationListParamsDirection = "asc"
	OrganizationListParamsDirectionDesc OrganizationListParamsDirection = "desc"
)

type OrganizationListParamsMatch

type OrganizationListParamsMatch string

Whether to match all search requirements or at least one (any).

const (
	OrganizationListParamsMatchAny OrganizationListParamsMatch = "any"
	OrganizationListParamsMatchAll OrganizationListParamsMatch = "all"
)

type OrganizationListParamsOrder

type OrganizationListParamsOrder string

Field to order organizations by.

const (
	OrganizationListParamsOrderID     OrganizationListParamsOrder = "id"
	OrganizationListParamsOrderName   OrganizationListParamsOrder = "name"
	OrganizationListParamsOrderStatus OrganizationListParamsOrder = "status"
)

type OrganizationListParamsStatus

type OrganizationListParamsStatus string

Whether the user is a member of the organization or has an inivitation pending.

const (
	OrganizationListParamsStatusMember  OrganizationListParamsStatus = "member"
	OrganizationListParamsStatusInvited OrganizationListParamsStatus = "invited"
)

type OrganizationService

type OrganizationService struct {
	Options []option.RequestOption
}

OrganizationService contains methods and other services that help with interacting with the cloudflare 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 NewOrganizationService method instead.

func NewOrganizationService

func NewOrganizationService(opts ...option.RequestOption) (r *OrganizationService)

NewOrganizationService 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 (*OrganizationService) Delete

func (r *OrganizationService) Delete(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *OrganizationDeleteResponse, err error)

Removes association to an organization.

func (*OrganizationService) Get

func (r *OrganizationService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *OrganizationGetResponse, err error)

Gets a specific organization the user is associated with.

func (*OrganizationService) List

Lists organizations the user is associated with.

func (*OrganizationService) ListAutoPaging

Lists organizations the user is associated with.

type SubscriptionDeleteResponse

type SubscriptionDeleteResponse struct {
	// Subscription identifier tag.
	SubscriptionID string                         `json:"subscription_id"`
	JSON           subscriptionDeleteResponseJSON `json:"-"`
}

func (*SubscriptionDeleteResponse) UnmarshalJSON

func (r *SubscriptionDeleteResponse) UnmarshalJSON(data []byte) (err error)

type SubscriptionEditParams

type SubscriptionEditParams struct {
	App param.Field[SubscriptionEditParamsApp] `json:"app"`
	// The list of add-ons subscribed to.
	ComponentValues param.Field[[]SubscriptionEditParamsComponentValue] `json:"component_values"`
	// How often the subscription is renewed automatically.
	Frequency param.Field[SubscriptionEditParamsFrequency] `json:"frequency"`
	// The rate plan applied to the subscription.
	RatePlan param.Field[SubscriptionEditParamsRatePlan] `json:"rate_plan"`
	// A simple zone object. May have null properties if not a zone subscription.
	Zone param.Field[SubscriptionEditParamsZone] `json:"zone"`
}

func (SubscriptionEditParams) MarshalJSON

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

type SubscriptionEditParamsApp

type SubscriptionEditParamsApp struct {
	// app install id.
	InstallID param.Field[string] `json:"install_id"`
}

func (SubscriptionEditParamsApp) MarshalJSON

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

type SubscriptionEditParamsComponentValue

type SubscriptionEditParamsComponentValue struct {
	// The default amount assigned.
	Default param.Field[float64] `json:"default"`
	// The name of the component value.
	Name param.Field[string] `json:"name"`
	// The unit price for the component value.
	Price param.Field[float64] `json:"price"`
	// The amount of the component value assigned.
	Value param.Field[float64] `json:"value"`
}

A component value for a subscription.

func (SubscriptionEditParamsComponentValue) MarshalJSON

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

type SubscriptionEditParamsFrequency

type SubscriptionEditParamsFrequency string

How often the subscription is renewed automatically.

const (
	SubscriptionEditParamsFrequencyWeekly    SubscriptionEditParamsFrequency = "weekly"
	SubscriptionEditParamsFrequencyMonthly   SubscriptionEditParamsFrequency = "monthly"
	SubscriptionEditParamsFrequencyQuarterly SubscriptionEditParamsFrequency = "quarterly"
	SubscriptionEditParamsFrequencyYearly    SubscriptionEditParamsFrequency = "yearly"
)

type SubscriptionEditParamsRatePlan

type SubscriptionEditParamsRatePlan struct {
	// The ID of the rate plan.
	ID param.Field[interface{}] `json:"id"`
	// The currency applied to the rate plan subscription.
	Currency param.Field[string] `json:"currency"`
	// Whether this rate plan is managed externally from Cloudflare.
	ExternallyManaged param.Field[bool] `json:"externally_managed"`
	// Whether a rate plan is enterprise-based (or newly adopted term contract).
	IsContract param.Field[bool] `json:"is_contract"`
	// The full name of the rate plan.
	PublicName param.Field[string] `json:"public_name"`
	// The scope that this rate plan applies to.
	Scope param.Field[string] `json:"scope"`
	// The list of sets this rate plan applies to.
	Sets param.Field[[]string] `json:"sets"`
}

The rate plan applied to the subscription.

func (SubscriptionEditParamsRatePlan) MarshalJSON

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

type SubscriptionEditParamsZone

type SubscriptionEditParamsZone struct {
}

A simple zone object. May have null properties if not a zone subscription.

func (SubscriptionEditParamsZone) MarshalJSON

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

type SubscriptionEditResponse

type SubscriptionEditResponse interface {
	ImplementsUserSubscriptionEditResponse()
}

Union satisfied by user.SubscriptionEditResponseUnknown or shared.UnionString.

type SubscriptionEditResponseEnvelope

type SubscriptionEditResponseEnvelope struct {
	Errors   []SubscriptionEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []SubscriptionEditResponseEnvelopeMessages `json:"messages,required"`
	Result   SubscriptionEditResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success SubscriptionEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    subscriptionEditResponseEnvelopeJSON    `json:"-"`
}

func (*SubscriptionEditResponseEnvelope) UnmarshalJSON

func (r *SubscriptionEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type SubscriptionEditResponseEnvelopeErrors

type SubscriptionEditResponseEnvelopeErrors struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    subscriptionEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*SubscriptionEditResponseEnvelopeErrors) UnmarshalJSON

func (r *SubscriptionEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type SubscriptionEditResponseEnvelopeMessages

type SubscriptionEditResponseEnvelopeMessages struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    subscriptionEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*SubscriptionEditResponseEnvelopeMessages) UnmarshalJSON

func (r *SubscriptionEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type SubscriptionEditResponseEnvelopeSuccess

type SubscriptionEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SubscriptionEditResponseEnvelopeSuccessTrue SubscriptionEditResponseEnvelopeSuccess = true
)

type SubscriptionGetResponse

type SubscriptionGetResponse struct {
	// Subscription identifier tag.
	ID  string                     `json:"id"`
	App SubscriptionGetResponseApp `json:"app"`
	// The list of add-ons subscribed to.
	ComponentValues []SubscriptionGetResponseComponentValue `json:"component_values"`
	// The monetary unit in which pricing information is displayed.
	Currency string `json:"currency"`
	// The end of the current period and also when the next billing is due.
	CurrentPeriodEnd time.Time `json:"current_period_end" format:"date-time"`
	// When the current billing period started. May match initial_period_start if this
	// is the first period.
	CurrentPeriodStart time.Time `json:"current_period_start" format:"date-time"`
	// How often the subscription is renewed automatically.
	Frequency SubscriptionGetResponseFrequency `json:"frequency"`
	// The price of the subscription that will be billed, in US dollars.
	Price float64 `json:"price"`
	// The rate plan applied to the subscription.
	RatePlan SubscriptionGetResponseRatePlan `json:"rate_plan"`
	// The state that the subscription is in.
	State SubscriptionGetResponseState `json:"state"`
	// A simple zone object. May have null properties if not a zone subscription.
	Zone SubscriptionGetResponseZone `json:"zone"`
	JSON subscriptionGetResponseJSON `json:"-"`
}

func (*SubscriptionGetResponse) UnmarshalJSON

func (r *SubscriptionGetResponse) UnmarshalJSON(data []byte) (err error)

type SubscriptionGetResponseApp

type SubscriptionGetResponseApp struct {
	// app install id.
	InstallID string                         `json:"install_id"`
	JSON      subscriptionGetResponseAppJSON `json:"-"`
}

func (*SubscriptionGetResponseApp) UnmarshalJSON

func (r *SubscriptionGetResponseApp) UnmarshalJSON(data []byte) (err error)

type SubscriptionGetResponseComponentValue

type SubscriptionGetResponseComponentValue struct {
	// The default amount assigned.
	Default float64 `json:"default"`
	// The name of the component value.
	Name string `json:"name"`
	// The unit price for the component value.
	Price float64 `json:"price"`
	// The amount of the component value assigned.
	Value float64                                   `json:"value"`
	JSON  subscriptionGetResponseComponentValueJSON `json:"-"`
}

A component value for a subscription.

func (*SubscriptionGetResponseComponentValue) UnmarshalJSON

func (r *SubscriptionGetResponseComponentValue) UnmarshalJSON(data []byte) (err error)

type SubscriptionGetResponseEnvelope

type SubscriptionGetResponseEnvelope struct {
	Errors   []SubscriptionGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []SubscriptionGetResponseEnvelopeMessages `json:"messages,required"`
	Result   []SubscriptionGetResponse                 `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    SubscriptionGetResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo SubscriptionGetResponseEnvelopeResultInfo `json:"result_info"`
	JSON       subscriptionGetResponseEnvelopeJSON       `json:"-"`
}

func (*SubscriptionGetResponseEnvelope) UnmarshalJSON

func (r *SubscriptionGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type SubscriptionGetResponseEnvelopeErrors

type SubscriptionGetResponseEnvelopeErrors struct {
	Code    int64                                     `json:"code,required"`
	Message string                                    `json:"message,required"`
	JSON    subscriptionGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*SubscriptionGetResponseEnvelopeErrors) UnmarshalJSON

func (r *SubscriptionGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type SubscriptionGetResponseEnvelopeMessages

type SubscriptionGetResponseEnvelopeMessages struct {
	Code    int64                                       `json:"code,required"`
	Message string                                      `json:"message,required"`
	JSON    subscriptionGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*SubscriptionGetResponseEnvelopeMessages) UnmarshalJSON

func (r *SubscriptionGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type SubscriptionGetResponseEnvelopeResultInfo

type SubscriptionGetResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                       `json:"total_count"`
	JSON       subscriptionGetResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*SubscriptionGetResponseEnvelopeResultInfo) UnmarshalJSON

func (r *SubscriptionGetResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type SubscriptionGetResponseEnvelopeSuccess

type SubscriptionGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SubscriptionGetResponseEnvelopeSuccessTrue SubscriptionGetResponseEnvelopeSuccess = true
)

type SubscriptionGetResponseFrequency

type SubscriptionGetResponseFrequency string

How often the subscription is renewed automatically.

const (
	SubscriptionGetResponseFrequencyWeekly    SubscriptionGetResponseFrequency = "weekly"
	SubscriptionGetResponseFrequencyMonthly   SubscriptionGetResponseFrequency = "monthly"
	SubscriptionGetResponseFrequencyQuarterly SubscriptionGetResponseFrequency = "quarterly"
	SubscriptionGetResponseFrequencyYearly    SubscriptionGetResponseFrequency = "yearly"
)

type SubscriptionGetResponseRatePlan

type SubscriptionGetResponseRatePlan struct {
	// The ID of the rate plan.
	ID interface{} `json:"id"`
	// The currency applied to the rate plan subscription.
	Currency string `json:"currency"`
	// Whether this rate plan is managed externally from Cloudflare.
	ExternallyManaged bool `json:"externally_managed"`
	// Whether a rate plan is enterprise-based (or newly adopted term contract).
	IsContract bool `json:"is_contract"`
	// The full name of the rate plan.
	PublicName string `json:"public_name"`
	// The scope that this rate plan applies to.
	Scope string `json:"scope"`
	// The list of sets this rate plan applies to.
	Sets []string                            `json:"sets"`
	JSON subscriptionGetResponseRatePlanJSON `json:"-"`
}

The rate plan applied to the subscription.

func (*SubscriptionGetResponseRatePlan) UnmarshalJSON

func (r *SubscriptionGetResponseRatePlan) UnmarshalJSON(data []byte) (err error)

type SubscriptionGetResponseState

type SubscriptionGetResponseState string

The state that the subscription is in.

const (
	SubscriptionGetResponseStateTrial           SubscriptionGetResponseState = "Trial"
	SubscriptionGetResponseStateProvisioned     SubscriptionGetResponseState = "Provisioned"
	SubscriptionGetResponseStatePaid            SubscriptionGetResponseState = "Paid"
	SubscriptionGetResponseStateAwaitingPayment SubscriptionGetResponseState = "AwaitingPayment"
	SubscriptionGetResponseStateCancelled       SubscriptionGetResponseState = "Cancelled"
	SubscriptionGetResponseStateFailed          SubscriptionGetResponseState = "Failed"
	SubscriptionGetResponseStateExpired         SubscriptionGetResponseState = "Expired"
)

type SubscriptionGetResponseZone

type SubscriptionGetResponseZone struct {
	// Identifier
	ID string `json:"id"`
	// The domain name
	Name string                          `json:"name"`
	JSON subscriptionGetResponseZoneJSON `json:"-"`
}

A simple zone object. May have null properties if not a zone subscription.

func (*SubscriptionGetResponseZone) UnmarshalJSON

func (r *SubscriptionGetResponseZone) UnmarshalJSON(data []byte) (err error)

type SubscriptionService

type SubscriptionService struct {
	Options []option.RequestOption
}

SubscriptionService contains methods and other services that help with interacting with the cloudflare 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 NewSubscriptionService method instead.

func NewSubscriptionService

func NewSubscriptionService(opts ...option.RequestOption) (r *SubscriptionService)

NewSubscriptionService 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 (*SubscriptionService) Delete

func (r *SubscriptionService) Delete(ctx context.Context, identifier string, opts ...option.RequestOption) (res *SubscriptionDeleteResponse, err error)

Deletes a user's subscription.

func (*SubscriptionService) Edit

Updates zone subscriptions, either plan or add-ons.

func (*SubscriptionService) Get

Lists all of a user's subscriptions.

func (*SubscriptionService) Update

Updates a user's subscriptions.

type SubscriptionUpdateParams

type SubscriptionUpdateParams struct {
	App param.Field[SubscriptionUpdateParamsApp] `json:"app"`
	// The list of add-ons subscribed to.
	ComponentValues param.Field[[]SubscriptionUpdateParamsComponentValue] `json:"component_values"`
	// How often the subscription is renewed automatically.
	Frequency param.Field[SubscriptionUpdateParamsFrequency] `json:"frequency"`
	// The rate plan applied to the subscription.
	RatePlan param.Field[SubscriptionUpdateParamsRatePlan] `json:"rate_plan"`
	// A simple zone object. May have null properties if not a zone subscription.
	Zone param.Field[SubscriptionUpdateParamsZone] `json:"zone"`
}

func (SubscriptionUpdateParams) MarshalJSON

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

type SubscriptionUpdateParamsApp

type SubscriptionUpdateParamsApp struct {
	// app install id.
	InstallID param.Field[string] `json:"install_id"`
}

func (SubscriptionUpdateParamsApp) MarshalJSON

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

type SubscriptionUpdateParamsComponentValue

type SubscriptionUpdateParamsComponentValue struct {
	// The default amount assigned.
	Default param.Field[float64] `json:"default"`
	// The name of the component value.
	Name param.Field[string] `json:"name"`
	// The unit price for the component value.
	Price param.Field[float64] `json:"price"`
	// The amount of the component value assigned.
	Value param.Field[float64] `json:"value"`
}

A component value for a subscription.

func (SubscriptionUpdateParamsComponentValue) MarshalJSON

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

type SubscriptionUpdateParamsFrequency

type SubscriptionUpdateParamsFrequency string

How often the subscription is renewed automatically.

const (
	SubscriptionUpdateParamsFrequencyWeekly    SubscriptionUpdateParamsFrequency = "weekly"
	SubscriptionUpdateParamsFrequencyMonthly   SubscriptionUpdateParamsFrequency = "monthly"
	SubscriptionUpdateParamsFrequencyQuarterly SubscriptionUpdateParamsFrequency = "quarterly"
	SubscriptionUpdateParamsFrequencyYearly    SubscriptionUpdateParamsFrequency = "yearly"
)

type SubscriptionUpdateParamsRatePlan

type SubscriptionUpdateParamsRatePlan struct {
	// The ID of the rate plan.
	ID param.Field[interface{}] `json:"id"`
	// The currency applied to the rate plan subscription.
	Currency param.Field[string] `json:"currency"`
	// Whether this rate plan is managed externally from Cloudflare.
	ExternallyManaged param.Field[bool] `json:"externally_managed"`
	// Whether a rate plan is enterprise-based (or newly adopted term contract).
	IsContract param.Field[bool] `json:"is_contract"`
	// The full name of the rate plan.
	PublicName param.Field[string] `json:"public_name"`
	// The scope that this rate plan applies to.
	Scope param.Field[string] `json:"scope"`
	// The list of sets this rate plan applies to.
	Sets param.Field[[]string] `json:"sets"`
}

The rate plan applied to the subscription.

func (SubscriptionUpdateParamsRatePlan) MarshalJSON

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

type SubscriptionUpdateParamsZone

type SubscriptionUpdateParamsZone struct {
}

A simple zone object. May have null properties if not a zone subscription.

func (SubscriptionUpdateParamsZone) MarshalJSON

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

type SubscriptionUpdateResponse

type SubscriptionUpdateResponse interface {
	ImplementsUserSubscriptionUpdateResponse()
}

Union satisfied by user.SubscriptionUpdateResponseUnknown or shared.UnionString.

type SubscriptionUpdateResponseEnvelope

type SubscriptionUpdateResponseEnvelope struct {
	Errors   []SubscriptionUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []SubscriptionUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   SubscriptionUpdateResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success SubscriptionUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    subscriptionUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*SubscriptionUpdateResponseEnvelope) UnmarshalJSON

func (r *SubscriptionUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type SubscriptionUpdateResponseEnvelopeErrors

type SubscriptionUpdateResponseEnvelopeErrors struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    subscriptionUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*SubscriptionUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *SubscriptionUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type SubscriptionUpdateResponseEnvelopeMessages

type SubscriptionUpdateResponseEnvelopeMessages struct {
	Code    int64                                          `json:"code,required"`
	Message string                                         `json:"message,required"`
	JSON    subscriptionUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*SubscriptionUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *SubscriptionUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type SubscriptionUpdateResponseEnvelopeSuccess

type SubscriptionUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	SubscriptionUpdateResponseEnvelopeSuccessTrue SubscriptionUpdateResponseEnvelopeSuccess = true
)

type TokenDeleteResponse

type TokenDeleteResponse struct {
	// Identifier
	ID   string                  `json:"id,required"`
	JSON tokenDeleteResponseJSON `json:"-"`
}

func (*TokenDeleteResponse) UnmarshalJSON

func (r *TokenDeleteResponse) UnmarshalJSON(data []byte) (err error)

type TokenDeleteResponseEnvelope

type TokenDeleteResponseEnvelope struct {
	Errors   []TokenDeleteResponseEnvelopeErrors   `json:"errors,required"`
	Messages []TokenDeleteResponseEnvelopeMessages `json:"messages,required"`
	Result   TokenDeleteResponse                   `json:"result,required,nullable"`
	// Whether the API call was successful
	Success TokenDeleteResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenDeleteResponseEnvelopeJSON    `json:"-"`
}

func (*TokenDeleteResponseEnvelope) UnmarshalJSON

func (r *TokenDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type TokenDeleteResponseEnvelopeErrors

type TokenDeleteResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    tokenDeleteResponseEnvelopeErrorsJSON `json:"-"`
}

func (*TokenDeleteResponseEnvelopeErrors) UnmarshalJSON

func (r *TokenDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type TokenDeleteResponseEnvelopeMessages

type TokenDeleteResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    tokenDeleteResponseEnvelopeMessagesJSON `json:"-"`
}

func (*TokenDeleteResponseEnvelopeMessages) UnmarshalJSON

func (r *TokenDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type TokenDeleteResponseEnvelopeSuccess

type TokenDeleteResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenDeleteResponseEnvelopeSuccessTrue TokenDeleteResponseEnvelopeSuccess = true
)

type TokenGetResponse added in v2.3.0

type TokenGetResponse interface {
	ImplementsUserTokenGetResponse()
}

Union satisfied by user.TokenGetResponseUnknown or shared.UnionString.

type TokenGetResponseEnvelope

type TokenGetResponseEnvelope struct {
	Errors   []TokenGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []TokenGetResponseEnvelopeMessages `json:"messages,required"`
	Result   TokenGetResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success TokenGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenGetResponseEnvelopeJSON    `json:"-"`
}

func (*TokenGetResponseEnvelope) UnmarshalJSON

func (r *TokenGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type TokenGetResponseEnvelopeErrors

type TokenGetResponseEnvelopeErrors struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    tokenGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*TokenGetResponseEnvelopeErrors) UnmarshalJSON

func (r *TokenGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type TokenGetResponseEnvelopeMessages

type TokenGetResponseEnvelopeMessages struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    tokenGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*TokenGetResponseEnvelopeMessages) UnmarshalJSON

func (r *TokenGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type TokenGetResponseEnvelopeSuccess

type TokenGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenGetResponseEnvelopeSuccessTrue TokenGetResponseEnvelopeSuccess = true
)

type TokenListParams

type TokenListParams struct {
	// Direction to order results.
	Direction param.Field[TokenListParamsDirection] `query:"direction"`
	// Page number of paginated results.
	Page param.Field[float64] `query:"page"`
	// Maximum number of results per page.
	PerPage param.Field[float64] `query:"per_page"`
}

func (TokenListParams) URLQuery

func (r TokenListParams) URLQuery() (v url.Values)

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

type TokenListParamsDirection

type TokenListParamsDirection string

Direction to order results.

const (
	TokenListParamsDirectionAsc  TokenListParamsDirection = "asc"
	TokenListParamsDirectionDesc TokenListParamsDirection = "desc"
)

type TokenListResponse

type TokenListResponse = interface{}

type TokenNewParams

type TokenNewParams struct {
	// Token name.
	Name param.Field[string] `json:"name,required"`
	// List of access policies assigned to the token.
	Policies  param.Field[[]TokenNewParamsPolicy]  `json:"policies,required"`
	Condition param.Field[TokenNewParamsCondition] `json:"condition"`
	// The expiration time on or after which the JWT MUST NOT be accepted for
	// processing.
	ExpiresOn param.Field[time.Time] `json:"expires_on" format:"date-time"`
	// The time before which the token MUST NOT be accepted for processing.
	NotBefore param.Field[time.Time] `json:"not_before" format:"date-time"`
}

func (TokenNewParams) MarshalJSON

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

type TokenNewParamsCondition

type TokenNewParamsCondition struct {
	// Client IP restrictions.
	RequestIP param.Field[TokenNewParamsConditionRequestIP] `json:"request_ip"`
}

func (TokenNewParamsCondition) MarshalJSON

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

type TokenNewParamsConditionRequestIP

type TokenNewParamsConditionRequestIP struct {
	// List of IPv4/IPv6 CIDR addresses.
	In param.Field[[]string] `json:"in"`
	// List of IPv4/IPv6 CIDR addresses.
	NotIn param.Field[[]string] `json:"not_in"`
}

Client IP restrictions.

func (TokenNewParamsConditionRequestIP) MarshalJSON

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

type TokenNewParamsPoliciesEffect

type TokenNewParamsPoliciesEffect string

Allow or deny operations against the resources.

const (
	TokenNewParamsPoliciesEffectAllow TokenNewParamsPoliciesEffect = "allow"
	TokenNewParamsPoliciesEffectDeny  TokenNewParamsPoliciesEffect = "deny"
)

type TokenNewParamsPoliciesPermissionGroup

type TokenNewParamsPoliciesPermissionGroup struct {
}

A named group of permissions that map to a group of operations against resources.

func (TokenNewParamsPoliciesPermissionGroup) MarshalJSON

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

type TokenNewParamsPolicy

type TokenNewParamsPolicy struct {
	// Allow or deny operations against the resources.
	Effect param.Field[TokenNewParamsPoliciesEffect] `json:"effect,required"`
	// A set of permission groups that are specified to the policy.
	PermissionGroups param.Field[[]TokenNewParamsPoliciesPermissionGroup] `json:"permission_groups,required"`
	// A list of resource names that the policy applies to.
	Resources param.Field[interface{}] `json:"resources,required"`
}

func (TokenNewParamsPolicy) MarshalJSON

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

type TokenNewResponse

type TokenNewResponse struct {
	// The token value.
	Value IamValue             `json:"value"`
	JSON  tokenNewResponseJSON `json:"-"`
}

func (*TokenNewResponse) UnmarshalJSON

func (r *TokenNewResponse) UnmarshalJSON(data []byte) (err error)

type TokenNewResponseEnvelope

type TokenNewResponseEnvelope struct {
	Errors   []TokenNewResponseEnvelopeErrors   `json:"errors,required"`
	Messages []TokenNewResponseEnvelopeMessages `json:"messages,required"`
	Result   TokenNewResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success TokenNewResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenNewResponseEnvelopeJSON    `json:"-"`
}

func (*TokenNewResponseEnvelope) UnmarshalJSON

func (r *TokenNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type TokenNewResponseEnvelopeErrors

type TokenNewResponseEnvelopeErrors struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    tokenNewResponseEnvelopeErrorsJSON `json:"-"`
}

func (*TokenNewResponseEnvelopeErrors) UnmarshalJSON

func (r *TokenNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type TokenNewResponseEnvelopeMessages

type TokenNewResponseEnvelopeMessages struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    tokenNewResponseEnvelopeMessagesJSON `json:"-"`
}

func (*TokenNewResponseEnvelopeMessages) UnmarshalJSON

func (r *TokenNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type TokenNewResponseEnvelopeSuccess

type TokenNewResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenNewResponseEnvelopeSuccessTrue TokenNewResponseEnvelopeSuccess = true
)

type TokenPermissionGroupListResponse

type TokenPermissionGroupListResponse = interface{}

type TokenPermissionGroupListResponseEnvelope

type TokenPermissionGroupListResponseEnvelope struct {
	Errors   []TokenPermissionGroupListResponseEnvelopeErrors   `json:"errors,required"`
	Messages []TokenPermissionGroupListResponseEnvelopeMessages `json:"messages,required"`
	Result   []TokenPermissionGroupListResponse                 `json:"result,required,nullable"`
	// Whether the API call was successful
	Success    TokenPermissionGroupListResponseEnvelopeSuccess    `json:"success,required"`
	ResultInfo TokenPermissionGroupListResponseEnvelopeResultInfo `json:"result_info"`
	JSON       tokenPermissionGroupListResponseEnvelopeJSON       `json:"-"`
}

func (*TokenPermissionGroupListResponseEnvelope) UnmarshalJSON

func (r *TokenPermissionGroupListResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type TokenPermissionGroupListResponseEnvelopeErrors

type TokenPermissionGroupListResponseEnvelopeErrors struct {
	Code    int64                                              `json:"code,required"`
	Message string                                             `json:"message,required"`
	JSON    tokenPermissionGroupListResponseEnvelopeErrorsJSON `json:"-"`
}

func (*TokenPermissionGroupListResponseEnvelopeErrors) UnmarshalJSON

func (r *TokenPermissionGroupListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type TokenPermissionGroupListResponseEnvelopeMessages

type TokenPermissionGroupListResponseEnvelopeMessages struct {
	Code    int64                                                `json:"code,required"`
	Message string                                               `json:"message,required"`
	JSON    tokenPermissionGroupListResponseEnvelopeMessagesJSON `json:"-"`
}

func (*TokenPermissionGroupListResponseEnvelopeMessages) UnmarshalJSON

func (r *TokenPermissionGroupListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type TokenPermissionGroupListResponseEnvelopeResultInfo

type TokenPermissionGroupListResponseEnvelopeResultInfo struct {
	// Total number of results for the requested service
	Count float64 `json:"count"`
	// Current page within paginated list of results
	Page float64 `json:"page"`
	// Number of results per page of results
	PerPage float64 `json:"per_page"`
	// Total results available without any search parameters
	TotalCount float64                                                `json:"total_count"`
	JSON       tokenPermissionGroupListResponseEnvelopeResultInfoJSON `json:"-"`
}

func (*TokenPermissionGroupListResponseEnvelopeResultInfo) UnmarshalJSON

func (r *TokenPermissionGroupListResponseEnvelopeResultInfo) UnmarshalJSON(data []byte) (err error)

type TokenPermissionGroupListResponseEnvelopeSuccess

type TokenPermissionGroupListResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenPermissionGroupListResponseEnvelopeSuccessTrue TokenPermissionGroupListResponseEnvelopeSuccess = true
)

type TokenPermissionGroupService

type TokenPermissionGroupService struct {
	Options []option.RequestOption
}

TokenPermissionGroupService contains methods and other services that help with interacting with the cloudflare 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 NewTokenPermissionGroupService method instead.

func NewTokenPermissionGroupService

func NewTokenPermissionGroupService(opts ...option.RequestOption) (r *TokenPermissionGroupService)

NewTokenPermissionGroupService 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 (*TokenPermissionGroupService) List

Find all available permission groups.

type TokenService

type TokenService struct {
	Options          []option.RequestOption
	PermissionGroups *TokenPermissionGroupService
	Value            *TokenValueService
}

TokenService contains methods and other services that help with interacting with the cloudflare 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 NewTokenService method instead.

func NewTokenService

func NewTokenService(opts ...option.RequestOption) (r *TokenService)

NewTokenService 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 (*TokenService) Delete

func (r *TokenService) Delete(ctx context.Context, tokenID interface{}, opts ...option.RequestOption) (res *TokenDeleteResponse, err error)

Destroy a token.

func (*TokenService) Get

func (r *TokenService) Get(ctx context.Context, tokenID interface{}, opts ...option.RequestOption) (res *TokenGetResponse, err error)

Get information about a specific token.

func (*TokenService) List

List all access tokens you created.

func (*TokenService) ListAutoPaging

List all access tokens you created.

func (*TokenService) New

func (r *TokenService) New(ctx context.Context, body TokenNewParams, opts ...option.RequestOption) (res *TokenNewResponse, err error)

Create a new access token.

func (*TokenService) Update

func (r *TokenService) Update(ctx context.Context, tokenID interface{}, body TokenUpdateParams, opts ...option.RequestOption) (res *TokenUpdateResponse, err error)

Update an existing token.

func (*TokenService) Verify

func (r *TokenService) Verify(ctx context.Context, opts ...option.RequestOption) (res *TokenVerifyResponse, err error)

Test whether a token works.

type TokenUpdateParams

type TokenUpdateParams struct {
	// Token name.
	Name param.Field[string] `json:"name,required"`
	// List of access policies assigned to the token.
	Policies param.Field[[]TokenUpdateParamsPolicy] `json:"policies,required"`
	// Status of the token.
	Status    param.Field[TokenUpdateParamsStatus]    `json:"status,required"`
	Condition param.Field[TokenUpdateParamsCondition] `json:"condition"`
	// The expiration time on or after which the JWT MUST NOT be accepted for
	// processing.
	ExpiresOn param.Field[time.Time] `json:"expires_on" format:"date-time"`
	// The time before which the token MUST NOT be accepted for processing.
	NotBefore param.Field[time.Time] `json:"not_before" format:"date-time"`
}

func (TokenUpdateParams) MarshalJSON

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

type TokenUpdateParamsCondition

type TokenUpdateParamsCondition struct {
	// Client IP restrictions.
	RequestIP param.Field[TokenUpdateParamsConditionRequestIP] `json:"request_ip"`
}

func (TokenUpdateParamsCondition) MarshalJSON

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

type TokenUpdateParamsConditionRequestIP

type TokenUpdateParamsConditionRequestIP struct {
	// List of IPv4/IPv6 CIDR addresses.
	In param.Field[[]string] `json:"in"`
	// List of IPv4/IPv6 CIDR addresses.
	NotIn param.Field[[]string] `json:"not_in"`
}

Client IP restrictions.

func (TokenUpdateParamsConditionRequestIP) MarshalJSON

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

type TokenUpdateParamsPoliciesEffect

type TokenUpdateParamsPoliciesEffect string

Allow or deny operations against the resources.

const (
	TokenUpdateParamsPoliciesEffectAllow TokenUpdateParamsPoliciesEffect = "allow"
	TokenUpdateParamsPoliciesEffectDeny  TokenUpdateParamsPoliciesEffect = "deny"
)

type TokenUpdateParamsPoliciesPermissionGroup

type TokenUpdateParamsPoliciesPermissionGroup struct {
}

A named group of permissions that map to a group of operations against resources.

func (TokenUpdateParamsPoliciesPermissionGroup) MarshalJSON

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

type TokenUpdateParamsPolicy

type TokenUpdateParamsPolicy struct {
	// Allow or deny operations against the resources.
	Effect param.Field[TokenUpdateParamsPoliciesEffect] `json:"effect,required"`
	// A set of permission groups that are specified to the policy.
	PermissionGroups param.Field[[]TokenUpdateParamsPoliciesPermissionGroup] `json:"permission_groups,required"`
	// A list of resource names that the policy applies to.
	Resources param.Field[interface{}] `json:"resources,required"`
}

func (TokenUpdateParamsPolicy) MarshalJSON

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

type TokenUpdateParamsStatus

type TokenUpdateParamsStatus string

Status of the token.

const (
	TokenUpdateParamsStatusActive   TokenUpdateParamsStatus = "active"
	TokenUpdateParamsStatusDisabled TokenUpdateParamsStatus = "disabled"
	TokenUpdateParamsStatusExpired  TokenUpdateParamsStatus = "expired"
)

type TokenUpdateResponse added in v2.3.0

type TokenUpdateResponse interface {
	ImplementsUserTokenUpdateResponse()
}

Union satisfied by user.TokenUpdateResponseUnknown or shared.UnionString.

type TokenUpdateResponseEnvelope

type TokenUpdateResponseEnvelope struct {
	Errors   []TokenUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []TokenUpdateResponseEnvelopeMessages `json:"messages,required"`
	Result   TokenUpdateResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success TokenUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*TokenUpdateResponseEnvelope) UnmarshalJSON

func (r *TokenUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type TokenUpdateResponseEnvelopeErrors

type TokenUpdateResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    tokenUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*TokenUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *TokenUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type TokenUpdateResponseEnvelopeMessages

type TokenUpdateResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    tokenUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*TokenUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *TokenUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type TokenUpdateResponseEnvelopeSuccess

type TokenUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenUpdateResponseEnvelopeSuccessTrue TokenUpdateResponseEnvelopeSuccess = true
)

type TokenValueService

type TokenValueService struct {
	Options []option.RequestOption
}

TokenValueService contains methods and other services that help with interacting with the cloudflare 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 NewTokenValueService method instead.

func NewTokenValueService

func NewTokenValueService(opts ...option.RequestOption) (r *TokenValueService)

NewTokenValueService 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 (*TokenValueService) Update

func (r *TokenValueService) Update(ctx context.Context, tokenID interface{}, body TokenValueUpdateParams, opts ...option.RequestOption) (res *IamValue, err error)

Roll the token secret.

type TokenValueUpdateParams

type TokenValueUpdateParams struct {
	Body param.Field[interface{}] `json:"body,required"`
}

func (TokenValueUpdateParams) MarshalJSON

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

type TokenValueUpdateResponseEnvelope

type TokenValueUpdateResponseEnvelope struct {
	Errors   []TokenValueUpdateResponseEnvelopeErrors   `json:"errors,required"`
	Messages []TokenValueUpdateResponseEnvelopeMessages `json:"messages,required"`
	// The token value.
	Result IamValue `json:"result,required"`
	// Whether the API call was successful
	Success TokenValueUpdateResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenValueUpdateResponseEnvelopeJSON    `json:"-"`
}

func (*TokenValueUpdateResponseEnvelope) UnmarshalJSON

func (r *TokenValueUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type TokenValueUpdateResponseEnvelopeErrors

type TokenValueUpdateResponseEnvelopeErrors struct {
	Code    int64                                      `json:"code,required"`
	Message string                                     `json:"message,required"`
	JSON    tokenValueUpdateResponseEnvelopeErrorsJSON `json:"-"`
}

func (*TokenValueUpdateResponseEnvelopeErrors) UnmarshalJSON

func (r *TokenValueUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type TokenValueUpdateResponseEnvelopeMessages

type TokenValueUpdateResponseEnvelopeMessages struct {
	Code    int64                                        `json:"code,required"`
	Message string                                       `json:"message,required"`
	JSON    tokenValueUpdateResponseEnvelopeMessagesJSON `json:"-"`
}

func (*TokenValueUpdateResponseEnvelopeMessages) UnmarshalJSON

func (r *TokenValueUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type TokenValueUpdateResponseEnvelopeSuccess

type TokenValueUpdateResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenValueUpdateResponseEnvelopeSuccessTrue TokenValueUpdateResponseEnvelopeSuccess = true
)

type TokenVerifyResponse

type TokenVerifyResponse struct {
	// Token identifier tag.
	ID string `json:"id,required"`
	// Status of the token.
	Status TokenVerifyResponseStatus `json:"status,required"`
	// The expiration time on or after which the JWT MUST NOT be accepted for
	// processing.
	ExpiresOn time.Time `json:"expires_on" format:"date-time"`
	// The time before which the token MUST NOT be accepted for processing.
	NotBefore time.Time               `json:"not_before" format:"date-time"`
	JSON      tokenVerifyResponseJSON `json:"-"`
}

func (*TokenVerifyResponse) UnmarshalJSON

func (r *TokenVerifyResponse) UnmarshalJSON(data []byte) (err error)

type TokenVerifyResponseEnvelope

type TokenVerifyResponseEnvelope struct {
	Errors   []TokenVerifyResponseEnvelopeErrors   `json:"errors,required"`
	Messages []TokenVerifyResponseEnvelopeMessages `json:"messages,required"`
	Result   TokenVerifyResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success TokenVerifyResponseEnvelopeSuccess `json:"success,required"`
	JSON    tokenVerifyResponseEnvelopeJSON    `json:"-"`
}

func (*TokenVerifyResponseEnvelope) UnmarshalJSON

func (r *TokenVerifyResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type TokenVerifyResponseEnvelopeErrors

type TokenVerifyResponseEnvelopeErrors struct {
	Code    int64                                 `json:"code,required"`
	Message string                                `json:"message,required"`
	JSON    tokenVerifyResponseEnvelopeErrorsJSON `json:"-"`
}

func (*TokenVerifyResponseEnvelopeErrors) UnmarshalJSON

func (r *TokenVerifyResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type TokenVerifyResponseEnvelopeMessages

type TokenVerifyResponseEnvelopeMessages struct {
	Code    int64                                   `json:"code,required"`
	Message string                                  `json:"message,required"`
	JSON    tokenVerifyResponseEnvelopeMessagesJSON `json:"-"`
}

func (*TokenVerifyResponseEnvelopeMessages) UnmarshalJSON

func (r *TokenVerifyResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type TokenVerifyResponseEnvelopeSuccess

type TokenVerifyResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	TokenVerifyResponseEnvelopeSuccessTrue TokenVerifyResponseEnvelopeSuccess = true
)

type TokenVerifyResponseStatus

type TokenVerifyResponseStatus string

Status of the token.

const (
	TokenVerifyResponseStatusActive   TokenVerifyResponseStatus = "active"
	TokenVerifyResponseStatusDisabled TokenVerifyResponseStatus = "disabled"
	TokenVerifyResponseStatusExpired  TokenVerifyResponseStatus = "expired"
)

type UserEditParams

type UserEditParams struct {
	// The country in which the user lives.
	Country param.Field[string] `json:"country"`
	// User's first name
	FirstName param.Field[string] `json:"first_name"`
	// User's last name
	LastName param.Field[string] `json:"last_name"`
	// User's telephone number
	Telephone param.Field[string] `json:"telephone"`
	// The zipcode or postal code where the user lives.
	Zipcode param.Field[string] `json:"zipcode"`
}

func (UserEditParams) MarshalJSON

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

type UserEditResponse added in v2.3.0

type UserEditResponse interface {
	ImplementsUserUserEditResponse()
}

Union satisfied by user.UserEditResponseUnknown or shared.UnionString.

type UserEditResponseEnvelope

type UserEditResponseEnvelope struct {
	Errors   []UserEditResponseEnvelopeErrors   `json:"errors,required"`
	Messages []UserEditResponseEnvelopeMessages `json:"messages,required"`
	Result   UserEditResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success UserEditResponseEnvelopeSuccess `json:"success,required"`
	JSON    userEditResponseEnvelopeJSON    `json:"-"`
}

func (*UserEditResponseEnvelope) UnmarshalJSON

func (r *UserEditResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type UserEditResponseEnvelopeErrors

type UserEditResponseEnvelopeErrors struct {
	Code    int64                              `json:"code,required"`
	Message string                             `json:"message,required"`
	JSON    userEditResponseEnvelopeErrorsJSON `json:"-"`
}

func (*UserEditResponseEnvelopeErrors) UnmarshalJSON

func (r *UserEditResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type UserEditResponseEnvelopeMessages

type UserEditResponseEnvelopeMessages struct {
	Code    int64                                `json:"code,required"`
	Message string                               `json:"message,required"`
	JSON    userEditResponseEnvelopeMessagesJSON `json:"-"`
}

func (*UserEditResponseEnvelopeMessages) UnmarshalJSON

func (r *UserEditResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type UserEditResponseEnvelopeSuccess

type UserEditResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	UserEditResponseEnvelopeSuccessTrue UserEditResponseEnvelopeSuccess = true
)

type UserGetResponse added in v2.3.0

type UserGetResponse interface {
	ImplementsUserUserGetResponse()
}

Union satisfied by user.UserGetResponseUnknown or shared.UnionString.

type UserGetResponseEnvelope

type UserGetResponseEnvelope struct {
	Errors   []UserGetResponseEnvelopeErrors   `json:"errors,required"`
	Messages []UserGetResponseEnvelopeMessages `json:"messages,required"`
	Result   UserGetResponse                   `json:"result,required"`
	// Whether the API call was successful
	Success UserGetResponseEnvelopeSuccess `json:"success,required"`
	JSON    userGetResponseEnvelopeJSON    `json:"-"`
}

func (*UserGetResponseEnvelope) UnmarshalJSON

func (r *UserGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)

type UserGetResponseEnvelopeErrors

type UserGetResponseEnvelopeErrors struct {
	Code    int64                             `json:"code,required"`
	Message string                            `json:"message,required"`
	JSON    userGetResponseEnvelopeErrorsJSON `json:"-"`
}

func (*UserGetResponseEnvelopeErrors) UnmarshalJSON

func (r *UserGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)

type UserGetResponseEnvelopeMessages

type UserGetResponseEnvelopeMessages struct {
	Code    int64                               `json:"code,required"`
	Message string                              `json:"message,required"`
	JSON    userGetResponseEnvelopeMessagesJSON `json:"-"`
}

func (*UserGetResponseEnvelopeMessages) UnmarshalJSON

func (r *UserGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)

type UserGetResponseEnvelopeSuccess

type UserGetResponseEnvelopeSuccess bool

Whether the API call was successful

const (
	UserGetResponseEnvelopeSuccessTrue UserGetResponseEnvelopeSuccess = true
)

type UserService

type UserService struct {
	Options       []option.RequestOption
	AuditLogs     *AuditLogService
	Billing       *BillingService
	Firewall      *FirewallService
	Invites       *InviteService
	LoadBalancers *LoadBalancerService
	Organizations *OrganizationService
	Subscriptions *SubscriptionService
	Tokens        *TokenService
}

UserService contains methods and other services that help with interacting with the cloudflare 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 NewUserService method instead.

func NewUserService

func NewUserService(opts ...option.RequestOption) (r *UserService)

NewUserService 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 (*UserService) Edit

func (r *UserService) Edit(ctx context.Context, body UserEditParams, opts ...option.RequestOption) (res *UserEditResponse, err error)

Edit part of your user details.

func (*UserService) Get

func (r *UserService) Get(ctx context.Context, opts ...option.RequestOption) (res *UserGetResponse, err error)

User Details

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL