Documentation ¶
Index ¶
- type Error
- type ListBulkOperationGetResponse
- type ListBulkOperationGetResponseEnvelope
- type ListBulkOperationGetResponseEnvelopeErrors
- type ListBulkOperationGetResponseEnvelopeMessages
- type ListBulkOperationGetResponseEnvelopeSuccess
- type ListBulkOperationService
- type ListDeleteParams
- type ListDeleteResponse
- type ListDeleteResponseEnvelope
- type ListDeleteResponseEnvelopeErrors
- type ListDeleteResponseEnvelopeMessages
- type ListDeleteResponseEnvelopeSuccess
- type ListGetParams
- type ListGetResponse
- type ListGetResponseEnvelope
- type ListGetResponseEnvelopeErrors
- type ListGetResponseEnvelopeMessages
- type ListGetResponseEnvelopeSuccess
- type ListItemDeleteParams
- type ListItemDeleteParamsItem
- type ListItemDeleteResponse
- type ListItemDeleteResponseEnvelope
- type ListItemDeleteResponseEnvelopeErrors
- type ListItemDeleteResponseEnvelopeMessages
- type ListItemDeleteResponseEnvelopeSuccess
- type ListItemGetResponse
- type ListItemGetResponseEnvelope
- type ListItemGetResponseEnvelopeErrors
- type ListItemGetResponseEnvelopeMessages
- type ListItemGetResponseEnvelopeSuccess
- type ListItemGetResponseListsItemHostname
- type ListItemGetResponseListsItemRedirect
- type ListItemGetResponseListsItemRedirectStatusCode
- type ListItemListParams
- type ListItemListResponse
- type ListItemNewParams
- type ListItemNewParamsBody
- type ListItemNewParamsBodyHostname
- type ListItemNewParamsBodyRedirect
- type ListItemNewParamsBodyRedirectStatusCode
- type ListItemNewResponse
- type ListItemNewResponseEnvelope
- type ListItemNewResponseEnvelopeErrors
- type ListItemNewResponseEnvelopeMessages
- type ListItemNewResponseEnvelopeSuccess
- type ListItemService
- func (r *ListItemService) Delete(ctx context.Context, listID string, params ListItemDeleteParams, ...) (res *ListItemDeleteResponse, err error)
- func (r *ListItemService) Get(ctx context.Context, accountIdentifier string, listID string, itemID string, ...) (res *ListItemGetResponse, err error)
- func (r *ListItemService) List(ctx context.Context, listID string, params ListItemListParams, ...) (res *shared.CursorPagination[ListItemListResponse], err error)
- func (r *ListItemService) ListAutoPaging(ctx context.Context, listID string, params ListItemListParams, ...) *shared.CursorPaginationAutoPager[ListItemListResponse]
- func (r *ListItemService) New(ctx context.Context, listID string, params ListItemNewParams, ...) (res *ListItemNewResponse, err error)
- func (r *ListItemService) Update(ctx context.Context, listID string, params ListItemUpdateParams, ...) (res *ListItemUpdateResponse, err error)
- type ListItemUpdateParams
- type ListItemUpdateParamsBody
- type ListItemUpdateParamsBodyHostname
- type ListItemUpdateParamsBodyRedirect
- type ListItemUpdateParamsBodyRedirectStatusCode
- type ListItemUpdateResponse
- type ListItemUpdateResponseEnvelope
- type ListItemUpdateResponseEnvelopeErrors
- type ListItemUpdateResponseEnvelopeMessages
- type ListItemUpdateResponseEnvelopeSuccess
- type ListListParams
- type ListListResponseEnvelope
- type ListListResponseEnvelopeErrors
- type ListListResponseEnvelopeMessages
- type ListListResponseEnvelopeSuccess
- type ListNewParams
- type ListNewParamsKind
- type ListNewResponse
- type ListNewResponseEnvelope
- type ListNewResponseEnvelopeErrors
- type ListNewResponseEnvelopeMessages
- type ListNewResponseEnvelopeSuccess
- type ListService
- func (r *ListService) Delete(ctx context.Context, listID string, body ListDeleteParams, ...) (res *ListDeleteResponse, err error)
- func (r *ListService) Get(ctx context.Context, listID string, query ListGetParams, ...) (res *ListsList, err error)
- func (r *ListService) List(ctx context.Context, query ListListParams, opts ...option.RequestOption) (res *[]ListsList, err error)
- func (r *ListService) New(ctx context.Context, params ListNewParams, opts ...option.RequestOption) (res *ListsList, err error)
- func (r *ListService) Update(ctx context.Context, listID string, params ListUpdateParams, ...) (res *ListsList, err error)
- type ListUpdateParams
- type ListUpdateResponse
- type ListUpdateResponseEnvelope
- type ListUpdateResponseEnvelopeErrors
- type ListUpdateResponseEnvelopeMessages
- type ListUpdateResponseEnvelopeSuccess
- type ListsList
- type ListsListKind
- type RuleService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ListBulkOperationGetResponse ¶
type ListBulkOperationGetResponse = interface{}
type ListBulkOperationGetResponseEnvelope ¶
type ListBulkOperationGetResponseEnvelope struct { Errors []ListBulkOperationGetResponseEnvelopeErrors `json:"errors,required"` Messages []ListBulkOperationGetResponseEnvelopeMessages `json:"messages,required"` Result []ListBulkOperationGetResponse `json:"result,required,nullable"` // Whether the API call was successful Success ListBulkOperationGetResponseEnvelopeSuccess `json:"success,required"` JSON listBulkOperationGetResponseEnvelopeJSON `json:"-"` }
func (*ListBulkOperationGetResponseEnvelope) UnmarshalJSON ¶
func (r *ListBulkOperationGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ListBulkOperationGetResponseEnvelopeErrors ¶
type ListBulkOperationGetResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listBulkOperationGetResponseEnvelopeErrorsJSON `json:"-"` }
func (*ListBulkOperationGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ListBulkOperationGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ListBulkOperationGetResponseEnvelopeMessages ¶
type ListBulkOperationGetResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listBulkOperationGetResponseEnvelopeMessagesJSON `json:"-"` }
func (*ListBulkOperationGetResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *ListBulkOperationGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type ListBulkOperationGetResponseEnvelopeSuccess ¶
type ListBulkOperationGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ListBulkOperationGetResponseEnvelopeSuccessTrue ListBulkOperationGetResponseEnvelopeSuccess = true
)
type ListBulkOperationService ¶
type ListBulkOperationService struct {
Options []option.RequestOption
}
ListBulkOperationService 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 NewListBulkOperationService method instead.
func NewListBulkOperationService ¶
func NewListBulkOperationService(opts ...option.RequestOption) (r *ListBulkOperationService)
NewListBulkOperationService 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 (*ListBulkOperationService) Get ¶
func (r *ListBulkOperationService) Get(ctx context.Context, accountIdentifier string, operationID string, opts ...option.RequestOption) (res *[]ListBulkOperationGetResponse, err error)
Gets the current status of an asynchronous operation on a list.
The `status` property can have one of the following values: `pending`, `running`, `completed`, or `failed`. If the status is `failed`, the `error` property will contain a message describing the error.
type ListDeleteParams ¶
type ListDeleteResponse ¶
type ListDeleteResponse struct { // The unique ID of the item in the List. ID string `json:"id"` JSON listDeleteResponseJSON `json:"-"` }
func (*ListDeleteResponse) UnmarshalJSON ¶
func (r *ListDeleteResponse) UnmarshalJSON(data []byte) (err error)
type ListDeleteResponseEnvelope ¶
type ListDeleteResponseEnvelope struct { Errors []ListDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []ListDeleteResponseEnvelopeMessages `json:"messages,required"` Result ListDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful Success ListDeleteResponseEnvelopeSuccess `json:"success,required"` JSON listDeleteResponseEnvelopeJSON `json:"-"` }
func (*ListDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *ListDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ListDeleteResponseEnvelopeErrors ¶
type ListDeleteResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listDeleteResponseEnvelopeErrorsJSON `json:"-"` }
func (*ListDeleteResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ListDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ListDeleteResponseEnvelopeMessages ¶
type ListDeleteResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listDeleteResponseEnvelopeMessagesJSON `json:"-"` }
func (*ListDeleteResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *ListDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type ListDeleteResponseEnvelopeSuccess ¶
type ListDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ListDeleteResponseEnvelopeSuccessTrue ListDeleteResponseEnvelopeSuccess = true
)
type ListGetParams ¶
type ListGetResponse ¶
type ListGetResponse = interface{}
type ListGetResponseEnvelope ¶
type ListGetResponseEnvelope struct { Errors []ListGetResponseEnvelopeErrors `json:"errors,required"` Messages []ListGetResponseEnvelopeMessages `json:"messages,required"` Result ListsList `json:"result,required,nullable"` // Whether the API call was successful Success ListGetResponseEnvelopeSuccess `json:"success,required"` JSON listGetResponseEnvelopeJSON `json:"-"` }
func (*ListGetResponseEnvelope) UnmarshalJSON ¶
func (r *ListGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ListGetResponseEnvelopeErrors ¶
type ListGetResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listGetResponseEnvelopeErrorsJSON `json:"-"` }
func (*ListGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ListGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ListGetResponseEnvelopeMessages ¶
type ListGetResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listGetResponseEnvelopeMessagesJSON `json:"-"` }
func (*ListGetResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *ListGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type ListGetResponseEnvelopeSuccess ¶
type ListGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ListGetResponseEnvelopeSuccessTrue ListGetResponseEnvelopeSuccess = true
)
type ListItemDeleteParams ¶
type ListItemDeleteParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` Items param.Field[[]ListItemDeleteParamsItem] `json:"items"` }
func (ListItemDeleteParams) MarshalJSON ¶
func (r ListItemDeleteParams) MarshalJSON() (data []byte, err error)
type ListItemDeleteParamsItem ¶
type ListItemDeleteParamsItem struct { // The unique ID of the item in the List. ID param.Field[string] `json:"id"` }
func (ListItemDeleteParamsItem) MarshalJSON ¶
func (r ListItemDeleteParamsItem) MarshalJSON() (data []byte, err error)
type ListItemDeleteResponse ¶
type ListItemDeleteResponse struct { // The unique operation ID of the asynchronous action. OperationID string `json:"operation_id"` JSON listItemDeleteResponseJSON `json:"-"` }
func (*ListItemDeleteResponse) UnmarshalJSON ¶
func (r *ListItemDeleteResponse) UnmarshalJSON(data []byte) (err error)
type ListItemDeleteResponseEnvelope ¶
type ListItemDeleteResponseEnvelope struct { Errors []ListItemDeleteResponseEnvelopeErrors `json:"errors,required"` Messages []ListItemDeleteResponseEnvelopeMessages `json:"messages,required"` Result ListItemDeleteResponse `json:"result,required,nullable"` // Whether the API call was successful Success ListItemDeleteResponseEnvelopeSuccess `json:"success,required"` JSON listItemDeleteResponseEnvelopeJSON `json:"-"` }
func (*ListItemDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *ListItemDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ListItemDeleteResponseEnvelopeErrors ¶
type ListItemDeleteResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listItemDeleteResponseEnvelopeErrorsJSON `json:"-"` }
func (*ListItemDeleteResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ListItemDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ListItemDeleteResponseEnvelopeMessages ¶
type ListItemDeleteResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listItemDeleteResponseEnvelopeMessagesJSON `json:"-"` }
func (*ListItemDeleteResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *ListItemDeleteResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type ListItemDeleteResponseEnvelopeSuccess ¶
type ListItemDeleteResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ListItemDeleteResponseEnvelopeSuccessTrue ListItemDeleteResponseEnvelopeSuccess = true
)
type ListItemGetResponse ¶
type ListItemGetResponse interface {
ImplementsRulesListItemGetResponse()
}
An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a maximum of /64.
Union satisfied by shared.UnionString, rules.ListItemGetResponseListsItemRedirect, rules.ListItemGetResponseListsItemHostname or shared.UnionInt.
type ListItemGetResponseEnvelope ¶
type ListItemGetResponseEnvelope struct { Errors []ListItemGetResponseEnvelopeErrors `json:"errors,required"` Messages []ListItemGetResponseEnvelopeMessages `json:"messages,required"` // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a // maximum of /64. Result ListItemGetResponse `json:"result,required,nullable"` // Whether the API call was successful Success ListItemGetResponseEnvelopeSuccess `json:"success,required"` JSON listItemGetResponseEnvelopeJSON `json:"-"` }
func (*ListItemGetResponseEnvelope) UnmarshalJSON ¶
func (r *ListItemGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ListItemGetResponseEnvelopeErrors ¶
type ListItemGetResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listItemGetResponseEnvelopeErrorsJSON `json:"-"` }
func (*ListItemGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ListItemGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ListItemGetResponseEnvelopeMessages ¶
type ListItemGetResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listItemGetResponseEnvelopeMessagesJSON `json:"-"` }
func (*ListItemGetResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *ListItemGetResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type ListItemGetResponseEnvelopeSuccess ¶
type ListItemGetResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ListItemGetResponseEnvelopeSuccessTrue ListItemGetResponseEnvelopeSuccess = true
)
type ListItemGetResponseListsItemHostname ¶
type ListItemGetResponseListsItemHostname struct { URLHostname string `json:"url_hostname,required"` JSON listItemGetResponseListsItemHostnameJSON `json:"-"` }
Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (\*), and the hyphen (-).
func (ListItemGetResponseListsItemHostname) ImplementsRulesListItemGetResponse ¶
func (r ListItemGetResponseListsItemHostname) ImplementsRulesListItemGetResponse()
func (*ListItemGetResponseListsItemHostname) UnmarshalJSON ¶
func (r *ListItemGetResponseListsItemHostname) UnmarshalJSON(data []byte) (err error)
type ListItemGetResponseListsItemRedirect ¶
type ListItemGetResponseListsItemRedirect struct { SourceURL string `json:"source_url,required"` TargetURL string `json:"target_url,required"` IncludeSubdomains bool `json:"include_subdomains"` PreservePathSuffix bool `json:"preserve_path_suffix"` PreserveQueryString bool `json:"preserve_query_string"` StatusCode ListItemGetResponseListsItemRedirectStatusCode `json:"status_code"` SubpathMatching bool `json:"subpath_matching"` JSON listItemGetResponseListsItemRedirectJSON `json:"-"` }
The definition of the redirect.
func (ListItemGetResponseListsItemRedirect) ImplementsRulesListItemGetResponse ¶
func (r ListItemGetResponseListsItemRedirect) ImplementsRulesListItemGetResponse()
func (*ListItemGetResponseListsItemRedirect) UnmarshalJSON ¶
func (r *ListItemGetResponseListsItemRedirect) UnmarshalJSON(data []byte) (err error)
type ListItemGetResponseListsItemRedirectStatusCode ¶
type ListItemGetResponseListsItemRedirectStatusCode int64
const ( ListItemGetResponseListsItemRedirectStatusCode301 ListItemGetResponseListsItemRedirectStatusCode = 301 ListItemGetResponseListsItemRedirectStatusCode302 ListItemGetResponseListsItemRedirectStatusCode = 302 ListItemGetResponseListsItemRedirectStatusCode307 ListItemGetResponseListsItemRedirectStatusCode = 307 ListItemGetResponseListsItemRedirectStatusCode308 ListItemGetResponseListsItemRedirectStatusCode = 308 )
type ListItemListParams ¶
type ListItemListParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` // The pagination cursor. An opaque string token indicating the position from which // to continue when requesting the next/previous set of records. Cursor values are // provided under `result_info.cursors` in the response. You should make no // assumptions about a cursor's content or length. Cursor param.Field[string] `query:"cursor"` // Amount of results to include in each paginated response. A non-negative 32 bit // integer. PerPage param.Field[int64] `query:"per_page"` // A search query to filter returned items. Its meaning depends on the list type: // IP addresses must start with the provided string, hostnames and bulk redirects // must contain the string, and ASNs must match the string exactly. Search param.Field[string] `query:"search"` }
func (ListItemListParams) URLQuery ¶
func (r ListItemListParams) URLQuery() (v url.Values)
URLQuery serializes ListItemListParams's query parameters as `url.Values`.
type ListItemListResponse ¶
type ListItemListResponse = interface{}
type ListItemNewParams ¶
type ListItemNewParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` Body param.Field[[]ListItemNewParamsBody] `json:"body,required"` }
func (ListItemNewParams) MarshalJSON ¶
func (r ListItemNewParams) MarshalJSON() (data []byte, err error)
type ListItemNewParamsBody ¶
type ListItemNewParamsBody struct { // A non-negative 32 bit integer ASN param.Field[int64] `json:"asn"` // An informative summary of the list item. Comment param.Field[string] `json:"comment"` // Valid characters for hostnames are ASCII(7) letters from a to z, the digits from // 0 to 9, wildcards (\*), and the hyphen (-). Hostname param.Field[ListItemNewParamsBodyHostname] `json:"hostname"` // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a // maximum of /64. IP param.Field[string] `json:"ip"` // The definition of the redirect. Redirect param.Field[ListItemNewParamsBodyRedirect] `json:"redirect"` }
func (ListItemNewParamsBody) MarshalJSON ¶
func (r ListItemNewParamsBody) MarshalJSON() (data []byte, err error)
type ListItemNewParamsBodyHostname ¶
type ListItemNewParamsBodyHostname struct {
URLHostname param.Field[string] `json:"url_hostname,required"`
}
Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (\*), and the hyphen (-).
func (ListItemNewParamsBodyHostname) MarshalJSON ¶
func (r ListItemNewParamsBodyHostname) MarshalJSON() (data []byte, err error)
type ListItemNewParamsBodyRedirect ¶
type ListItemNewParamsBodyRedirect struct { SourceURL param.Field[string] `json:"source_url,required"` TargetURL param.Field[string] `json:"target_url,required"` IncludeSubdomains param.Field[bool] `json:"include_subdomains"` PreservePathSuffix param.Field[bool] `json:"preserve_path_suffix"` PreserveQueryString param.Field[bool] `json:"preserve_query_string"` StatusCode param.Field[ListItemNewParamsBodyRedirectStatusCode] `json:"status_code"` SubpathMatching param.Field[bool] `json:"subpath_matching"` }
The definition of the redirect.
func (ListItemNewParamsBodyRedirect) MarshalJSON ¶
func (r ListItemNewParamsBodyRedirect) MarshalJSON() (data []byte, err error)
type ListItemNewParamsBodyRedirectStatusCode ¶
type ListItemNewParamsBodyRedirectStatusCode int64
const ( ListItemNewParamsBodyRedirectStatusCode301 ListItemNewParamsBodyRedirectStatusCode = 301 ListItemNewParamsBodyRedirectStatusCode302 ListItemNewParamsBodyRedirectStatusCode = 302 ListItemNewParamsBodyRedirectStatusCode307 ListItemNewParamsBodyRedirectStatusCode = 307 ListItemNewParamsBodyRedirectStatusCode308 ListItemNewParamsBodyRedirectStatusCode = 308 )
type ListItemNewResponse ¶
type ListItemNewResponse struct { // The unique operation ID of the asynchronous action. OperationID string `json:"operation_id"` JSON listItemNewResponseJSON `json:"-"` }
func (*ListItemNewResponse) UnmarshalJSON ¶
func (r *ListItemNewResponse) UnmarshalJSON(data []byte) (err error)
type ListItemNewResponseEnvelope ¶
type ListItemNewResponseEnvelope struct { Errors []ListItemNewResponseEnvelopeErrors `json:"errors,required"` Messages []ListItemNewResponseEnvelopeMessages `json:"messages,required"` Result ListItemNewResponse `json:"result,required,nullable"` // Whether the API call was successful Success ListItemNewResponseEnvelopeSuccess `json:"success,required"` JSON listItemNewResponseEnvelopeJSON `json:"-"` }
func (*ListItemNewResponseEnvelope) UnmarshalJSON ¶
func (r *ListItemNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ListItemNewResponseEnvelopeErrors ¶
type ListItemNewResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listItemNewResponseEnvelopeErrorsJSON `json:"-"` }
func (*ListItemNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ListItemNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ListItemNewResponseEnvelopeMessages ¶
type ListItemNewResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listItemNewResponseEnvelopeMessagesJSON `json:"-"` }
func (*ListItemNewResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *ListItemNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type ListItemNewResponseEnvelopeSuccess ¶
type ListItemNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ListItemNewResponseEnvelopeSuccessTrue ListItemNewResponseEnvelopeSuccess = true
)
type ListItemService ¶
type ListItemService struct {
Options []option.RequestOption
}
ListItemService 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 NewListItemService method instead.
func NewListItemService ¶
func NewListItemService(opts ...option.RequestOption) (r *ListItemService)
NewListItemService 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 (*ListItemService) Delete ¶
func (r *ListItemService) Delete(ctx context.Context, listID string, params ListItemDeleteParams, opts ...option.RequestOption) (res *ListItemDeleteResponse, err error)
Removes one or more items from a list.
This operation is asynchronous. To get current the operation status, invoke the [Get bulk operation status](/operations/lists-get-bulk-operation-status) endpoint with the returned `operation_id`.
func (*ListItemService) Get ¶
func (r *ListItemService) Get(ctx context.Context, accountIdentifier string, listID string, itemID string, opts ...option.RequestOption) (res *ListItemGetResponse, err error)
Fetches a list item in the list.
func (*ListItemService) List ¶
func (r *ListItemService) List(ctx context.Context, listID string, params ListItemListParams, opts ...option.RequestOption) (res *shared.CursorPagination[ListItemListResponse], err error)
Fetches all the items in the list.
func (*ListItemService) ListAutoPaging ¶
func (r *ListItemService) ListAutoPaging(ctx context.Context, listID string, params ListItemListParams, opts ...option.RequestOption) *shared.CursorPaginationAutoPager[ListItemListResponse]
Fetches all the items in the list.
func (*ListItemService) New ¶
func (r *ListItemService) New(ctx context.Context, listID string, params ListItemNewParams, opts ...option.RequestOption) (res *ListItemNewResponse, err error)
Appends new items to the list.
This operation is asynchronous. To get current the operation status, invoke the [Get bulk operation status](/operations/lists-get-bulk-operation-status) endpoint with the returned `operation_id`.
func (*ListItemService) Update ¶
func (r *ListItemService) Update(ctx context.Context, listID string, params ListItemUpdateParams, opts ...option.RequestOption) (res *ListItemUpdateResponse, err error)
Removes all existing items from the list and adds the provided items to the list.
This operation is asynchronous. To get current the operation status, invoke the [Get bulk operation status](/operations/lists-get-bulk-operation-status) endpoint with the returned `operation_id`.
type ListItemUpdateParams ¶
type ListItemUpdateParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` Body param.Field[[]ListItemUpdateParamsBody] `json:"body,required"` }
func (ListItemUpdateParams) MarshalJSON ¶
func (r ListItemUpdateParams) MarshalJSON() (data []byte, err error)
type ListItemUpdateParamsBody ¶
type ListItemUpdateParamsBody struct { // A non-negative 32 bit integer ASN param.Field[int64] `json:"asn"` // An informative summary of the list item. Comment param.Field[string] `json:"comment"` // Valid characters for hostnames are ASCII(7) letters from a to z, the digits from // 0 to 9, wildcards (\*), and the hyphen (-). Hostname param.Field[ListItemUpdateParamsBodyHostname] `json:"hostname"` // An IPv4 address, an IPv4 CIDR, or an IPv6 CIDR. IPv6 CIDRs are limited to a // maximum of /64. IP param.Field[string] `json:"ip"` // The definition of the redirect. Redirect param.Field[ListItemUpdateParamsBodyRedirect] `json:"redirect"` }
func (ListItemUpdateParamsBody) MarshalJSON ¶
func (r ListItemUpdateParamsBody) MarshalJSON() (data []byte, err error)
type ListItemUpdateParamsBodyHostname ¶
type ListItemUpdateParamsBodyHostname struct {
URLHostname param.Field[string] `json:"url_hostname,required"`
}
Valid characters for hostnames are ASCII(7) letters from a to z, the digits from 0 to 9, wildcards (\*), and the hyphen (-).
func (ListItemUpdateParamsBodyHostname) MarshalJSON ¶
func (r ListItemUpdateParamsBodyHostname) MarshalJSON() (data []byte, err error)
type ListItemUpdateParamsBodyRedirect ¶
type ListItemUpdateParamsBodyRedirect struct { SourceURL param.Field[string] `json:"source_url,required"` TargetURL param.Field[string] `json:"target_url,required"` IncludeSubdomains param.Field[bool] `json:"include_subdomains"` PreservePathSuffix param.Field[bool] `json:"preserve_path_suffix"` PreserveQueryString param.Field[bool] `json:"preserve_query_string"` StatusCode param.Field[ListItemUpdateParamsBodyRedirectStatusCode] `json:"status_code"` SubpathMatching param.Field[bool] `json:"subpath_matching"` }
The definition of the redirect.
func (ListItemUpdateParamsBodyRedirect) MarshalJSON ¶
func (r ListItemUpdateParamsBodyRedirect) MarshalJSON() (data []byte, err error)
type ListItemUpdateParamsBodyRedirectStatusCode ¶
type ListItemUpdateParamsBodyRedirectStatusCode int64
const ( ListItemUpdateParamsBodyRedirectStatusCode301 ListItemUpdateParamsBodyRedirectStatusCode = 301 ListItemUpdateParamsBodyRedirectStatusCode302 ListItemUpdateParamsBodyRedirectStatusCode = 302 ListItemUpdateParamsBodyRedirectStatusCode307 ListItemUpdateParamsBodyRedirectStatusCode = 307 ListItemUpdateParamsBodyRedirectStatusCode308 ListItemUpdateParamsBodyRedirectStatusCode = 308 )
type ListItemUpdateResponse ¶
type ListItemUpdateResponse struct { // The unique operation ID of the asynchronous action. OperationID string `json:"operation_id"` JSON listItemUpdateResponseJSON `json:"-"` }
func (*ListItemUpdateResponse) UnmarshalJSON ¶
func (r *ListItemUpdateResponse) UnmarshalJSON(data []byte) (err error)
type ListItemUpdateResponseEnvelope ¶
type ListItemUpdateResponseEnvelope struct { Errors []ListItemUpdateResponseEnvelopeErrors `json:"errors,required"` Messages []ListItemUpdateResponseEnvelopeMessages `json:"messages,required"` Result ListItemUpdateResponse `json:"result,required,nullable"` // Whether the API call was successful Success ListItemUpdateResponseEnvelopeSuccess `json:"success,required"` JSON listItemUpdateResponseEnvelopeJSON `json:"-"` }
func (*ListItemUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *ListItemUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ListItemUpdateResponseEnvelopeErrors ¶
type ListItemUpdateResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listItemUpdateResponseEnvelopeErrorsJSON `json:"-"` }
func (*ListItemUpdateResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ListItemUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ListItemUpdateResponseEnvelopeMessages ¶
type ListItemUpdateResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listItemUpdateResponseEnvelopeMessagesJSON `json:"-"` }
func (*ListItemUpdateResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *ListItemUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type ListItemUpdateResponseEnvelopeSuccess ¶
type ListItemUpdateResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ListItemUpdateResponseEnvelopeSuccessTrue ListItemUpdateResponseEnvelopeSuccess = true
)
type ListListParams ¶
type ListListResponseEnvelope ¶
type ListListResponseEnvelope struct { Errors []ListListResponseEnvelopeErrors `json:"errors,required"` Messages []ListListResponseEnvelopeMessages `json:"messages,required"` Result []ListsList `json:"result,required,nullable"` // Whether the API call was successful Success ListListResponseEnvelopeSuccess `json:"success,required"` JSON listListResponseEnvelopeJSON `json:"-"` }
func (*ListListResponseEnvelope) UnmarshalJSON ¶
func (r *ListListResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ListListResponseEnvelopeErrors ¶
type ListListResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listListResponseEnvelopeErrorsJSON `json:"-"` }
func (*ListListResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ListListResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ListListResponseEnvelopeMessages ¶
type ListListResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listListResponseEnvelopeMessagesJSON `json:"-"` }
func (*ListListResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *ListListResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type ListListResponseEnvelopeSuccess ¶
type ListListResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ListListResponseEnvelopeSuccessTrue ListListResponseEnvelopeSuccess = true
)
type ListNewParams ¶
type ListNewParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` // The type of the list. Each type supports specific list items (IP addresses, // ASNs, hostnames or redirects). Kind param.Field[ListNewParamsKind] `json:"kind,required"` // An informative name for the list. Use this name in filter and rule expressions. Name param.Field[string] `json:"name,required"` // An informative summary of the list. Description param.Field[string] `json:"description"` }
func (ListNewParams) MarshalJSON ¶
func (r ListNewParams) MarshalJSON() (data []byte, err error)
type ListNewParamsKind ¶
type ListNewParamsKind string
The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).
const ( ListNewParamsKindIP ListNewParamsKind = "ip" ListNewParamsKindRedirect ListNewParamsKind = "redirect" ListNewParamsKindHostname ListNewParamsKind = "hostname" ListNewParamsKindASN ListNewParamsKind = "asn" )
type ListNewResponse ¶
type ListNewResponse = interface{}
type ListNewResponseEnvelope ¶
type ListNewResponseEnvelope struct { Errors []ListNewResponseEnvelopeErrors `json:"errors,required"` Messages []ListNewResponseEnvelopeMessages `json:"messages,required"` Result ListsList `json:"result,required,nullable"` // Whether the API call was successful Success ListNewResponseEnvelopeSuccess `json:"success,required"` JSON listNewResponseEnvelopeJSON `json:"-"` }
func (*ListNewResponseEnvelope) UnmarshalJSON ¶
func (r *ListNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ListNewResponseEnvelopeErrors ¶
type ListNewResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listNewResponseEnvelopeErrorsJSON `json:"-"` }
func (*ListNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ListNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ListNewResponseEnvelopeMessages ¶
type ListNewResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listNewResponseEnvelopeMessagesJSON `json:"-"` }
func (*ListNewResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *ListNewResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type ListNewResponseEnvelopeSuccess ¶
type ListNewResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ListNewResponseEnvelopeSuccessTrue ListNewResponseEnvelopeSuccess = true
)
type ListService ¶
type ListService struct { Options []option.RequestOption BulkOperations *ListBulkOperationService Items *ListItemService }
ListService 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 NewListService method instead.
func NewListService ¶
func NewListService(opts ...option.RequestOption) (r *ListService)
NewListService 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 (*ListService) Delete ¶
func (r *ListService) Delete(ctx context.Context, listID string, body ListDeleteParams, opts ...option.RequestOption) (res *ListDeleteResponse, err error)
Deletes a specific list and all its items.
func (*ListService) Get ¶
func (r *ListService) Get(ctx context.Context, listID string, query ListGetParams, opts ...option.RequestOption) (res *ListsList, err error)
Fetches the details of a list.
func (*ListService) List ¶
func (r *ListService) List(ctx context.Context, query ListListParams, opts ...option.RequestOption) (res *[]ListsList, err error)
Fetches all lists in the account.
func (*ListService) New ¶
func (r *ListService) New(ctx context.Context, params ListNewParams, opts ...option.RequestOption) (res *ListsList, err error)
Creates a new list of the specified type.
func (*ListService) Update ¶
func (r *ListService) Update(ctx context.Context, listID string, params ListUpdateParams, opts ...option.RequestOption) (res *ListsList, err error)
Updates the description of a list.
type ListUpdateParams ¶
type ListUpdateParams struct { // Identifier AccountID param.Field[string] `path:"account_id,required"` // An informative summary of the list. Description param.Field[string] `json:"description"` }
func (ListUpdateParams) MarshalJSON ¶
func (r ListUpdateParams) MarshalJSON() (data []byte, err error)
type ListUpdateResponse ¶
type ListUpdateResponse = interface{}
type ListUpdateResponseEnvelope ¶
type ListUpdateResponseEnvelope struct { Errors []ListUpdateResponseEnvelopeErrors `json:"errors,required"` Messages []ListUpdateResponseEnvelopeMessages `json:"messages,required"` Result ListsList `json:"result,required,nullable"` // Whether the API call was successful Success ListUpdateResponseEnvelopeSuccess `json:"success,required"` JSON listUpdateResponseEnvelopeJSON `json:"-"` }
func (*ListUpdateResponseEnvelope) UnmarshalJSON ¶
func (r *ListUpdateResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ListUpdateResponseEnvelopeErrors ¶
type ListUpdateResponseEnvelopeErrors struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listUpdateResponseEnvelopeErrorsJSON `json:"-"` }
func (*ListUpdateResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ListUpdateResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ListUpdateResponseEnvelopeMessages ¶
type ListUpdateResponseEnvelopeMessages struct { Code int64 `json:"code,required"` Message string `json:"message,required"` JSON listUpdateResponseEnvelopeMessagesJSON `json:"-"` }
func (*ListUpdateResponseEnvelopeMessages) UnmarshalJSON ¶
func (r *ListUpdateResponseEnvelopeMessages) UnmarshalJSON(data []byte) (err error)
type ListUpdateResponseEnvelopeSuccess ¶
type ListUpdateResponseEnvelopeSuccess bool
Whether the API call was successful
const (
ListUpdateResponseEnvelopeSuccessTrue ListUpdateResponseEnvelopeSuccess = true
)
type ListsList ¶
type ListsList struct { // The unique ID of the list. ID string `json:"id"` // The RFC 3339 timestamp of when the list was created. CreatedOn string `json:"created_on"` // An informative summary of the list. Description string `json:"description"` // The type of the list. Each type supports specific list items (IP addresses, // ASNs, hostnames or redirects). Kind ListsListKind `json:"kind"` // The RFC 3339 timestamp of when the list was last modified. ModifiedOn string `json:"modified_on"` // An informative name for the list. Use this name in filter and rule expressions. Name string `json:"name"` // The number of items in the list. NumItems float64 `json:"num_items"` // The number of [filters](/operations/filters-list-filters) referencing the list. NumReferencingFilters float64 `json:"num_referencing_filters"` JSON listsListJSON `json:"-"` }
func (*ListsList) UnmarshalJSON ¶
type ListsListKind ¶
type ListsListKind string
The type of the list. Each type supports specific list items (IP addresses, ASNs, hostnames or redirects).
const ( ListsListKindIP ListsListKind = "ip" ListsListKindRedirect ListsListKind = "redirect" ListsListKindHostname ListsListKind = "hostname" ListsListKindASN ListsListKind = "asn" )
type RuleService ¶
type RuleService struct { Options []option.RequestOption Lists *ListService }
RuleService 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 NewRuleService method instead.
func NewRuleService ¶
func NewRuleService(opts ...option.RequestOption) (r *RuleService)
NewRuleService 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.