Documentation
¶
Index ¶
- Constants
- type ASN
- type ASNParam
- type AccessibilityTreeNewParams
- type AccessibilityTreeNewParamsAddScriptTag
- type AccessibilityTreeNewParamsAddStyleTag
- type AccessibilityTreeNewParamsAllowResourceType
- type AccessibilityTreeNewParamsAuthenticate
- type AccessibilityTreeNewParamsCookie
- type AccessibilityTreeNewParamsCookiesPriority
- type AccessibilityTreeNewParamsCookiesSameSite
- type AccessibilityTreeNewParamsCookiesSourceScheme
- type AccessibilityTreeNewParamsGotoOptions
- type AccessibilityTreeNewParamsGotoOptionsWaitUntilArray
- type AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItem
- type AccessibilityTreeNewParamsGotoOptionsWaitUntilString
- type AccessibilityTreeNewParamsGotoOptionsWaitUntilUnion
- type AccessibilityTreeNewParamsRejectResourceType
- type AccessibilityTreeNewParamsViewport
- type AccessibilityTreeNewParamsWaitForSelector
- type AccessibilityTreeNewParamsWaitForSelectorHidden
- type AccessibilityTreeNewParamsWaitForSelectorVisible
- type AccessibilityTreeNewResponse
- type AccessibilityTreeNewResponseAccessibilityTree
- type AccessibilityTreeNewResponseAccessibilityTreeCheckedString
- type AccessibilityTreeNewResponseAccessibilityTreeCheckedUnion
- type AccessibilityTreeNewResponseAccessibilityTreePressedString
- type AccessibilityTreeNewResponseAccessibilityTreePressedUnion
- type AccessibilityTreeNewResponseAccessibilityTreeValueUnion
- type AccessibilityTreeNewResponseEnvelope
- type AccessibilityTreeNewResponseEnvelopeErrors
- type AccessibilityTreeNewResponseEnvelopeMeta
- type AccessibilityTreeService
- type AuditLog
- type AuditLogAction
- type AuditLogActor
- type AuditLogActorType
- type AuditLogOwner
- type AuditLogResource
- type BrowserRenderingService
- type CertificateCA
- type CertificateRequestType
- type CloudflareTunnel
- type CloudflareTunnelConfigSrc
- type CloudflareTunnelConnection
- type CloudflareTunnelStatus
- type CloudflareTunnelTunType
- type ContentNewParams
- type ContentNewParamsAddScriptTag
- type ContentNewParamsAddStyleTag
- type ContentNewParamsAllowResourceType
- type ContentNewParamsAuthenticate
- type ContentNewParamsCookie
- type ContentNewParamsCookiesPriority
- type ContentNewParamsCookiesSameSite
- type ContentNewParamsCookiesSourceScheme
- type ContentNewParamsGotoOptions
- type ContentNewParamsGotoOptionsWaitUntilArray
- type ContentNewParamsGotoOptionsWaitUntilArrayItem
- type ContentNewParamsGotoOptionsWaitUntilString
- type ContentNewParamsGotoOptionsWaitUntilUnion
- type ContentNewParamsRejectResourceType
- type ContentNewParamsViewport
- type ContentNewParamsWaitForSelector
- type ContentNewParamsWaitForSelectorHidden
- type ContentNewParamsWaitForSelectorVisible
- type ContentNewResponseEnvelope
- type ContentNewResponseEnvelopeErrors
- type ContentNewResponseEnvelopeMeta
- type ContentService
- type CrawlDeleteParams
- type CrawlDeleteResponse
- type CrawlDeleteResponseEnvelope
- type CrawlDeleteResponseEnvelopeErrors
- type CrawlGetParams
- type CrawlGetParamsStatus
- type CrawlGetResponse
- type CrawlGetResponseEnvelope
- type CrawlGetResponseEnvelopeErrors
- type CrawlGetResponseRecord
- type CrawlGetResponseRecordsMetadata
- type CrawlGetResponseRecordsStatus
- type CrawlNewParams
- type CrawlNewParamsBody
- type CrawlNewParamsBodyObject
- type CrawlNewParamsBodyObjectAddScriptTag
- type CrawlNewParamsBodyObjectAddStyleTag
- type CrawlNewParamsBodyObjectAllowResourceType
- type CrawlNewParamsBodyObjectAuthenticate
- type CrawlNewParamsBodyObjectCookie
- type CrawlNewParamsBodyObjectCookiesPriority
- type CrawlNewParamsBodyObjectCookiesSameSite
- type CrawlNewParamsBodyObjectCookiesSourceScheme
- type CrawlNewParamsBodyObjectCrawlPurpose
- type CrawlNewParamsBodyObjectFormat
- type CrawlNewParamsBodyObjectGotoOptions
- type CrawlNewParamsBodyObjectGotoOptionsWaitUntilArray
- type CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItem
- type CrawlNewParamsBodyObjectGotoOptionsWaitUntilString
- type CrawlNewParamsBodyObjectGotoOptionsWaitUntilUnion
- type CrawlNewParamsBodyObjectJsonOptions
- type CrawlNewParamsBodyObjectJsonOptionsCustomAI
- type CrawlNewParamsBodyObjectJsonOptionsResponseFormat
- type CrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaArray
- type CrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaUnion
- type CrawlNewParamsBodyObjectOptions
- type CrawlNewParamsBodyObjectRejectResourceType
- type CrawlNewParamsBodyObjectRender
- type CrawlNewParamsBodyObjectSource
- type CrawlNewParamsBodyObjectViewport
- type CrawlNewParamsBodyObjectWaitForSelector
- type CrawlNewParamsBodyObjectWaitForSelectorHidden
- type CrawlNewParamsBodyObjectWaitForSelectorVisible
- type CrawlNewParamsBodyRender
- type CrawlNewParamsBodySource
- type CrawlNewParamsBodyUnion
- type CrawlNewResponseEnvelope
- type CrawlNewResponseEnvelopeErrors
- type CrawlService
- func (r *CrawlService) Delete(ctx context.Context, jobID string, body CrawlDeleteParams, ...) (res *CrawlDeleteResponse, err error)
- func (r *CrawlService) Get(ctx context.Context, jobID string, params CrawlGetParams, ...) (res *CrawlGetResponse, err error)
- func (r *CrawlService) New(ctx context.Context, params CrawlNewParams, opts ...option.RequestOption) (res *string, err error)
- type DevtoolBrowserConnectParams
- type DevtoolBrowserDeleteParams
- type DevtoolBrowserDeleteResponse
- type DevtoolBrowserDeleteResponseStatus
- type DevtoolBrowserLaunchParams
- type DevtoolBrowserNewParams
- type DevtoolBrowserNewResponse
- type DevtoolBrowserPageGetParams
- type DevtoolBrowserPageService
- type DevtoolBrowserProtocolParams
- type DevtoolBrowserProtocolResponse
- type DevtoolBrowserProtocolResponseDomain
- type DevtoolBrowserProtocolResponseVersion
- type DevtoolBrowserService
- func (r *DevtoolBrowserService) Connect(ctx context.Context, sessionID string, params DevtoolBrowserConnectParams, ...) (err error)
- func (r *DevtoolBrowserService) Delete(ctx context.Context, sessionID string, body DevtoolBrowserDeleteParams, ...) (res *DevtoolBrowserDeleteResponse, err error)
- func (r *DevtoolBrowserService) Launch(ctx context.Context, params DevtoolBrowserLaunchParams, ...) (err error)
- func (r *DevtoolBrowserService) New(ctx context.Context, params DevtoolBrowserNewParams, ...) (res *DevtoolBrowserNewResponse, err error)
- func (r *DevtoolBrowserService) Protocol(ctx context.Context, sessionID string, query DevtoolBrowserProtocolParams, ...) (res *DevtoolBrowserProtocolResponse, err error)
- func (r *DevtoolBrowserService) Version(ctx context.Context, sessionID string, query DevtoolBrowserVersionParams, ...) (res *DevtoolBrowserVersionResponse, err error)
- type DevtoolBrowserTargetActivateParams
- type DevtoolBrowserTargetActivateResponse
- type DevtoolBrowserTargetCloseParams
- type DevtoolBrowserTargetCloseResponse
- type DevtoolBrowserTargetGetParams
- type DevtoolBrowserTargetGetResponse
- type DevtoolBrowserTargetListParams
- type DevtoolBrowserTargetListResponse
- type DevtoolBrowserTargetNewParams
- type DevtoolBrowserTargetNewResponse
- type DevtoolBrowserTargetService
- func (r *DevtoolBrowserTargetService) Activate(ctx context.Context, sessionID string, targetID string, ...) (res *DevtoolBrowserTargetActivateResponse, err error)
- func (r *DevtoolBrowserTargetService) Close(ctx context.Context, sessionID string, targetID string, ...) (res *DevtoolBrowserTargetCloseResponse, err error)
- func (r *DevtoolBrowserTargetService) Get(ctx context.Context, sessionID string, targetID string, ...) (res *DevtoolBrowserTargetGetResponse, err error)
- func (r *DevtoolBrowserTargetService) List(ctx context.Context, sessionID string, params DevtoolBrowserTargetListParams, ...) (res *[]DevtoolBrowserTargetListResponse, err error)
- func (r *DevtoolBrowserTargetService) New(ctx context.Context, sessionID string, params DevtoolBrowserTargetNewParams, ...) (res *DevtoolBrowserTargetNewResponse, err error)
- type DevtoolBrowserVersionParams
- type DevtoolBrowserVersionResponse
- type DevtoolService
- type DevtoolSessionGetParams
- type DevtoolSessionGetResponse
- type DevtoolSessionListParams
- type DevtoolSessionListResponse
- type DevtoolSessionService
- type Error
- type ErrorData
- type ErrorDataSource
- type JsonNewParams
- type JsonNewParamsAddScriptTag
- type JsonNewParamsAddStyleTag
- type JsonNewParamsAllowResourceType
- type JsonNewParamsAuthenticate
- type JsonNewParamsCookie
- type JsonNewParamsCookiesPriority
- type JsonNewParamsCookiesSameSite
- type JsonNewParamsCookiesSourceScheme
- type JsonNewParamsCustomAI
- type JsonNewParamsGotoOptions
- type JsonNewParamsGotoOptionsWaitUntilArray
- type JsonNewParamsGotoOptionsWaitUntilArrayItem
- type JsonNewParamsGotoOptionsWaitUntilString
- type JsonNewParamsGotoOptionsWaitUntilUnion
- type JsonNewParamsRejectResourceType
- type JsonNewParamsResponseFormat
- type JsonNewParamsResponseFormatJsonSchemaArray
- type JsonNewParamsResponseFormatJsonSchemaUnion
- type JsonNewParamsViewport
- type JsonNewParamsWaitForSelector
- type JsonNewParamsWaitForSelectorHidden
- type JsonNewParamsWaitForSelectorVisible
- type JsonNewResponse
- type JsonNewResponseEnvelope
- type JsonNewResponseEnvelopeErrors
- type JsonService
- type LinkNewParams
- type LinkNewParamsAddScriptTag
- type LinkNewParamsAddStyleTag
- type LinkNewParamsAllowResourceType
- type LinkNewParamsAuthenticate
- type LinkNewParamsCookie
- type LinkNewParamsCookiesPriority
- type LinkNewParamsCookiesSameSite
- type LinkNewParamsCookiesSourceScheme
- type LinkNewParamsGotoOptions
- type LinkNewParamsGotoOptionsWaitUntilArray
- type LinkNewParamsGotoOptionsWaitUntilArrayItem
- type LinkNewParamsGotoOptionsWaitUntilString
- type LinkNewParamsGotoOptionsWaitUntilUnion
- type LinkNewParamsRejectResourceType
- type LinkNewParamsViewport
- type LinkNewParamsWaitForSelector
- type LinkNewParamsWaitForSelectorHidden
- type LinkNewParamsWaitForSelectorVisible
- type LinkNewResponseEnvelope
- type LinkNewResponseEnvelopeErrors
- type LinkService
- type MarkdownNewParams
- type MarkdownNewParamsAddScriptTag
- type MarkdownNewParamsAddStyleTag
- type MarkdownNewParamsAllowResourceType
- type MarkdownNewParamsAuthenticate
- type MarkdownNewParamsCookie
- type MarkdownNewParamsCookiesPriority
- type MarkdownNewParamsCookiesSameSite
- type MarkdownNewParamsCookiesSourceScheme
- type MarkdownNewParamsGotoOptions
- type MarkdownNewParamsGotoOptionsWaitUntilArray
- type MarkdownNewParamsGotoOptionsWaitUntilArrayItem
- type MarkdownNewParamsGotoOptionsWaitUntilString
- type MarkdownNewParamsGotoOptionsWaitUntilUnion
- type MarkdownNewParamsRejectResourceType
- type MarkdownNewParamsViewport
- type MarkdownNewParamsWaitForSelector
- type MarkdownNewParamsWaitForSelectorHidden
- type MarkdownNewParamsWaitForSelectorVisible
- type MarkdownNewResponseEnvelope
- type MarkdownNewResponseEnvelopeErrors
- type MarkdownService
- type Member
- type MemberPoliciesAccess
- type MemberPoliciesPermissionGroup
- type MemberPoliciesPermissionGroupsMeta
- type MemberPoliciesResourceGroup
- type MemberPoliciesResourceGroupsMeta
- type MemberPoliciesResourceGroupsScope
- type MemberPoliciesResourceGroupsScopeObject
- type MemberPolicy
- type MemberStatus
- type MemberUser
- type PDFNewParams
- type PDFNewParamsAddScriptTag
- type PDFNewParamsAddStyleTag
- type PDFNewParamsAllowResourceType
- type PDFNewParamsAuthenticate
- type PDFNewParamsCookie
- type PDFNewParamsCookiesPriority
- type PDFNewParamsCookiesSameSite
- type PDFNewParamsCookiesSourceScheme
- type PDFNewParamsGotoOptions
- type PDFNewParamsGotoOptionsWaitUntilArray
- type PDFNewParamsGotoOptionsWaitUntilArrayItem
- type PDFNewParamsGotoOptionsWaitUntilString
- type PDFNewParamsGotoOptionsWaitUntilUnion
- type PDFNewParamsPDFOptions
- type PDFNewParamsPDFOptionsFormat
- type PDFNewParamsPDFOptionsHeightUnion
- type PDFNewParamsPDFOptionsMargin
- type PDFNewParamsPDFOptionsMarginBottomUnion
- type PDFNewParamsPDFOptionsMarginLeftUnion
- type PDFNewParamsPDFOptionsMarginRightUnion
- type PDFNewParamsPDFOptionsMarginTopUnion
- type PDFNewParamsPDFOptionsWidthUnion
- type PDFNewParamsRejectResourceType
- type PDFNewParamsViewport
- type PDFNewParamsWaitForSelector
- type PDFNewParamsWaitForSelectorHidden
- type PDFNewParamsWaitForSelectorVisible
- type PDFService
- type Permission
- type PermissionGrant
- type PermissionGrantParam
- type RatePlan
- type RatePlanID
- type RatePlanParam
- type ResponseInfo
- type ResponseInfoSource
- type Role
- type RoleParam
- type RolePermissions
- type RolePermissionsParam
- type ScrapeNewParams
- type ScrapeNewParamsAddScriptTag
- type ScrapeNewParamsAddStyleTag
- type ScrapeNewParamsAllowResourceType
- type ScrapeNewParamsAuthenticate
- type ScrapeNewParamsCookie
- type ScrapeNewParamsCookiesPriority
- type ScrapeNewParamsCookiesSameSite
- type ScrapeNewParamsCookiesSourceScheme
- type ScrapeNewParamsElement
- type ScrapeNewParamsGotoOptions
- type ScrapeNewParamsGotoOptionsWaitUntilArray
- type ScrapeNewParamsGotoOptionsWaitUntilArrayItem
- type ScrapeNewParamsGotoOptionsWaitUntilString
- type ScrapeNewParamsGotoOptionsWaitUntilUnion
- type ScrapeNewParamsRejectResourceType
- type ScrapeNewParamsViewport
- type ScrapeNewParamsWaitForSelector
- type ScrapeNewParamsWaitForSelectorHidden
- type ScrapeNewParamsWaitForSelectorVisible
- type ScrapeNewResponse
- type ScrapeNewResponseEnvelope
- type ScrapeNewResponseEnvelopeErrors
- type ScrapeNewResponseResults
- type ScrapeNewResponseResultsAttribute
- type ScrapeService
- type ScreenshotNewParams
- type ScreenshotNewParamsAddScriptTag
- type ScreenshotNewParamsAddStyleTag
- type ScreenshotNewParamsAllowResourceType
- type ScreenshotNewParamsAuthenticate
- type ScreenshotNewParamsCookie
- type ScreenshotNewParamsCookiesPriority
- type ScreenshotNewParamsCookiesSameSite
- type ScreenshotNewParamsCookiesSourceScheme
- type ScreenshotNewParamsGotoOptions
- type ScreenshotNewParamsGotoOptionsWaitUntilArray
- type ScreenshotNewParamsGotoOptionsWaitUntilArrayItem
- type ScreenshotNewParamsGotoOptionsWaitUntilString
- type ScreenshotNewParamsGotoOptionsWaitUntilUnion
- type ScreenshotNewParamsRejectResourceType
- type ScreenshotNewParamsScreenshotOptions
- type ScreenshotNewParamsScreenshotOptionsClip
- type ScreenshotNewParamsScreenshotOptionsEncoding
- type ScreenshotNewParamsScreenshotOptionsType
- type ScreenshotNewParamsViewport
- type ScreenshotNewParamsWaitForSelector
- type ScreenshotNewParamsWaitForSelectorHidden
- type ScreenshotNewParamsWaitForSelectorVisible
- type ScreenshotNewResponse
- type ScreenshotNewResponseError
- type ScreenshotService
- type SnapshotNewParams
- type SnapshotNewParamsAddScriptTag
- type SnapshotNewParamsAddStyleTag
- type SnapshotNewParamsAllowResourceType
- type SnapshotNewParamsAuthenticate
- type SnapshotNewParamsCookie
- type SnapshotNewParamsCookiesPriority
- type SnapshotNewParamsCookiesSameSite
- type SnapshotNewParamsCookiesSourceScheme
- type SnapshotNewParamsFormat
- type SnapshotNewParamsGotoOptions
- type SnapshotNewParamsGotoOptionsWaitUntilArray
- type SnapshotNewParamsGotoOptionsWaitUntilArrayItem
- type SnapshotNewParamsGotoOptionsWaitUntilString
- type SnapshotNewParamsGotoOptionsWaitUntilUnion
- type SnapshotNewParamsRejectResourceType
- type SnapshotNewParamsScreenshotOptions
- type SnapshotNewParamsScreenshotOptionsClip
- type SnapshotNewParamsScreenshotOptionsType
- type SnapshotNewParamsViewport
- type SnapshotNewParamsWaitForSelector
- type SnapshotNewParamsWaitForSelectorHidden
- type SnapshotNewParamsWaitForSelectorVisible
- type SnapshotNewResponse
- type SnapshotNewResponseAccessibilityTree
- type SnapshotNewResponseAccessibilityTreeCheckedString
- type SnapshotNewResponseAccessibilityTreeCheckedUnion
- type SnapshotNewResponseAccessibilityTreePressedString
- type SnapshotNewResponseAccessibilityTreePressedUnion
- type SnapshotNewResponseAccessibilityTreeValueUnion
- type SnapshotNewResponseEnvelope
- type SnapshotNewResponseEnvelopeErrors
- type SnapshotNewResponseEnvelopeMeta
- type SnapshotService
- type SortDirection
- type Subscription
- type SubscriptionFrequency
- type SubscriptionParam
- type SubscriptionState
- type Token
- type TokenCondition
- type TokenConditionCIDRList
- type TokenConditionCIDRListParam
- type TokenConditionParam
- type TokenConditionRequestIP
- type TokenConditionRequestIPParam
- type TokenParam
- type TokenPolicy
- type TokenPolicyEffect
- type TokenPolicyParam
- type TokenPolicyPermissionGroup
- type TokenPolicyPermissionGroupParam
- type TokenPolicyPermissionGroupsMeta
- type TokenPolicyPermissionGroupsMetaParam
- type TokenPolicyResourcesIAMResourcesTypeObjectNested
- type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam
- type TokenPolicyResourcesIAMResourcesTypeObjectString
- type TokenPolicyResourcesIAMResourcesTypeObjectStringParam
- type TokenPolicyResourcesUnion
- type TokenPolicyResourcesUnionParam
- type TokenStatus
- type TokenValue
Constants ¶
const AuditLogActorTypeAdmin = shared.AuditLogActorTypeAdmin
This is an alias to an internal value.
const AuditLogActorTypeCloudflare = shared.AuditLogActorTypeCloudflare
This is an alias to an internal value.
const AuditLogActorTypeUser = shared.AuditLogActorTypeUser
This is an alias to an internal value.
const CertificateCADigicert = shared.CertificateCADigicert
This is an alias to an internal value.
const CertificateCAGoogle = shared.CertificateCAGoogle
This is an alias to an internal value.
const CertificateCALetsEncrypt = shared.CertificateCALetsEncrypt
This is an alias to an internal value.
const CertificateCASSLCom = shared.CertificateCASSLCom
This is an alias to an internal value.
const CertificateRequestTypeKeylessCertificate = shared.CertificateRequestTypeKeylessCertificate
This is an alias to an internal value.
const CertificateRequestTypeOriginECC = shared.CertificateRequestTypeOriginECC
This is an alias to an internal value.
const CertificateRequestTypeOriginRSA = shared.CertificateRequestTypeOriginRSA
This is an alias to an internal value.
const CloudflareTunnelConfigSrcCloudflare = shared.CloudflareTunnelConfigSrcCloudflare
This is an alias to an internal value.
const CloudflareTunnelConfigSrcLocal = shared.CloudflareTunnelConfigSrcLocal
This is an alias to an internal value.
const CloudflareTunnelStatusDegraded = shared.CloudflareTunnelStatusDegraded
This is an alias to an internal value.
const CloudflareTunnelStatusDown = shared.CloudflareTunnelStatusDown
This is an alias to an internal value.
const CloudflareTunnelStatusHealthy = shared.CloudflareTunnelStatusHealthy
This is an alias to an internal value.
const CloudflareTunnelStatusInactive = shared.CloudflareTunnelStatusInactive
This is an alias to an internal value.
const CloudflareTunnelTunTypeCNI = shared.CloudflareTunnelTunTypeCNI
This is an alias to an internal value.
const CloudflareTunnelTunTypeCfdTunnel = shared.CloudflareTunnelTunTypeCfdTunnel
This is an alias to an internal value.
const CloudflareTunnelTunTypeGRE = shared.CloudflareTunnelTunTypeGRE
This is an alias to an internal value.
const CloudflareTunnelTunTypeIPSec = shared.CloudflareTunnelTunTypeIPSec
This is an alias to an internal value.
const CloudflareTunnelTunTypeMagic = shared.CloudflareTunnelTunTypeMagic
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARP = shared.CloudflareTunnelTunTypeWARP
This is an alias to an internal value.
const CloudflareTunnelTunTypeWARPConnector = shared.CloudflareTunnelTunTypeWARPConnector
This is an alias to an internal value.
const MemberPoliciesAccessAllow = shared.MemberPoliciesAccessAllow
This is an alias to an internal value.
const MemberPoliciesAccessDeny = shared.MemberPoliciesAccessDeny
This is an alias to an internal value.
const MemberStatusAccepted = shared.MemberStatusAccepted
This is an alias to an internal value.
const MemberStatusPending = shared.MemberStatusPending
This is an alias to an internal value.
const RatePlanIDBusiness = shared.RatePlanIDBusiness
This is an alias to an internal value.
const RatePlanIDEnterprise = shared.RatePlanIDEnterprise
This is an alias to an internal value.
const RatePlanIDFree = shared.RatePlanIDFree
This is an alias to an internal value.
const RatePlanIDLite = shared.RatePlanIDLite
This is an alias to an internal value.
const RatePlanIDPartnersBusiness = shared.RatePlanIDPartnersBusiness
This is an alias to an internal value.
const RatePlanIDPartnersEnterprise = shared.RatePlanIDPartnersEnterprise
This is an alias to an internal value.
const RatePlanIDPartnersFree = shared.RatePlanIDPartnersFree
This is an alias to an internal value.
const RatePlanIDPartnersPro = shared.RatePlanIDPartnersPro
This is an alias to an internal value.
const RatePlanIDPro = shared.RatePlanIDPro
This is an alias to an internal value.
const RatePlanIDProPlus = shared.RatePlanIDProPlus
This is an alias to an internal value.
const SortDirectionAsc = shared.SortDirectionAsc
This is an alias to an internal value.
const SortDirectionDesc = shared.SortDirectionDesc
This is an alias to an internal value.
const SubscriptionFrequencyMonthly = shared.SubscriptionFrequencyMonthly
This is an alias to an internal value.
const SubscriptionFrequencyQuarterly = shared.SubscriptionFrequencyQuarterly
This is an alias to an internal value.
const SubscriptionFrequencyWeekly = shared.SubscriptionFrequencyWeekly
This is an alias to an internal value.
const SubscriptionFrequencyYearly = shared.SubscriptionFrequencyYearly
This is an alias to an internal value.
const SubscriptionStateAwaitingPayment = shared.SubscriptionStateAwaitingPayment
This is an alias to an internal value.
const SubscriptionStateCancelled = shared.SubscriptionStateCancelled
This is an alias to an internal value.
const SubscriptionStateExpired = shared.SubscriptionStateExpired
This is an alias to an internal value.
const SubscriptionStateFailed = shared.SubscriptionStateFailed
This is an alias to an internal value.
const SubscriptionStatePaid = shared.SubscriptionStatePaid
This is an alias to an internal value.
const SubscriptionStateProvisioned = shared.SubscriptionStateProvisioned
This is an alias to an internal value.
const SubscriptionStateTrial = shared.SubscriptionStateTrial
This is an alias to an internal value.
const TokenPolicyEffectAllow = shared.TokenPolicyEffectAllow
This is an alias to an internal value.
const TokenPolicyEffectDeny = shared.TokenPolicyEffectDeny
This is an alias to an internal value.
const TokenStatusActive = shared.TokenStatusActive
This is an alias to an internal value.
const TokenStatusDisabled = shared.TokenStatusDisabled
This is an alias to an internal value.
const TokenStatusExpired = shared.TokenStatusExpired
This is an alias to an internal value.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessibilityTreeNewParams ¶ added in v7.7.0
type AccessibilityTreeNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]AccessibilityTreeNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]AccessibilityTreeNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]AccessibilityTreeNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[AccessibilityTreeNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]AccessibilityTreeNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[AccessibilityTreeNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
InterestingOnly param.Field[bool] `json:"interestingOnly"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]AccessibilityTreeNewParamsRejectResourceType] `json:"rejectResourceTypes"`
Root param.Field[string] `json:"root"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[AccessibilityTreeNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[AccessibilityTreeNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (AccessibilityTreeNewParams) MarshalJSON ¶ added in v7.7.0
func (r AccessibilityTreeNewParams) MarshalJSON() (data []byte, err error)
func (AccessibilityTreeNewParams) URLQuery ¶ added in v7.7.0
func (r AccessibilityTreeNewParams) URLQuery() (v url.Values)
URLQuery serializes AccessibilityTreeNewParams's query parameters as `url.Values`.
type AccessibilityTreeNewParamsAddScriptTag ¶ added in v7.8.0
type AccessibilityTreeNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (AccessibilityTreeNewParamsAddScriptTag) MarshalJSON ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type AccessibilityTreeNewParamsAddStyleTag ¶ added in v7.8.0
type AccessibilityTreeNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (AccessibilityTreeNewParamsAddStyleTag) MarshalJSON ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type AccessibilityTreeNewParamsAllowResourceType ¶ added in v7.8.0
type AccessibilityTreeNewParamsAllowResourceType string
const ( AccessibilityTreeNewParamsAllowResourceTypeDocument AccessibilityTreeNewParamsAllowResourceType = "document" AccessibilityTreeNewParamsAllowResourceTypeStylesheet AccessibilityTreeNewParamsAllowResourceType = "stylesheet" AccessibilityTreeNewParamsAllowResourceTypeImage AccessibilityTreeNewParamsAllowResourceType = "image" AccessibilityTreeNewParamsAllowResourceTypeMedia AccessibilityTreeNewParamsAllowResourceType = "media" AccessibilityTreeNewParamsAllowResourceTypeFont AccessibilityTreeNewParamsAllowResourceType = "font" AccessibilityTreeNewParamsAllowResourceTypeScript AccessibilityTreeNewParamsAllowResourceType = "script" AccessibilityTreeNewParamsAllowResourceTypeTexttrack AccessibilityTreeNewParamsAllowResourceType = "texttrack" AccessibilityTreeNewParamsAllowResourceTypeXHR AccessibilityTreeNewParamsAllowResourceType = "xhr" AccessibilityTreeNewParamsAllowResourceTypeFetch AccessibilityTreeNewParamsAllowResourceType = "fetch" AccessibilityTreeNewParamsAllowResourceTypePrefetch AccessibilityTreeNewParamsAllowResourceType = "prefetch" AccessibilityTreeNewParamsAllowResourceTypeEventsource AccessibilityTreeNewParamsAllowResourceType = "eventsource" AccessibilityTreeNewParamsAllowResourceTypeWebsocket AccessibilityTreeNewParamsAllowResourceType = "websocket" AccessibilityTreeNewParamsAllowResourceTypeManifest AccessibilityTreeNewParamsAllowResourceType = "manifest" AccessibilityTreeNewParamsAllowResourceTypeSignedexchange AccessibilityTreeNewParamsAllowResourceType = "signedexchange" AccessibilityTreeNewParamsAllowResourceTypePing AccessibilityTreeNewParamsAllowResourceType = "ping" AccessibilityTreeNewParamsAllowResourceTypeCspviolationreport AccessibilityTreeNewParamsAllowResourceType = "cspviolationreport" AccessibilityTreeNewParamsAllowResourceTypePreflight AccessibilityTreeNewParamsAllowResourceType = "preflight" AccessibilityTreeNewParamsAllowResourceTypeOther AccessibilityTreeNewParamsAllowResourceType = "other" )
func (AccessibilityTreeNewParamsAllowResourceType) IsKnown ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsAllowResourceType) IsKnown() bool
type AccessibilityTreeNewParamsAuthenticate ¶ added in v7.8.0
type AccessibilityTreeNewParamsAuthenticate struct {
Password param.Field[string] `json:"password" api:"required"`
Username param.Field[string] `json:"username" api:"required"`
}
Provide credentials for HTTP authentication.
func (AccessibilityTreeNewParamsAuthenticate) MarshalJSON ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type AccessibilityTreeNewParamsCookie ¶ added in v7.8.0
type AccessibilityTreeNewParamsCookie struct {
// Cookie name.
Name param.Field[string] `json:"name" api:"required"`
Value param.Field[string] `json:"value" api:"required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[AccessibilityTreeNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[AccessibilityTreeNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[AccessibilityTreeNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (AccessibilityTreeNewParamsCookie) MarshalJSON ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsCookie) MarshalJSON() (data []byte, err error)
type AccessibilityTreeNewParamsCookiesPriority ¶ added in v7.8.0
type AccessibilityTreeNewParamsCookiesPriority string
const ( AccessibilityTreeNewParamsCookiesPriorityLow AccessibilityTreeNewParamsCookiesPriority = "Low" AccessibilityTreeNewParamsCookiesPriorityMedium AccessibilityTreeNewParamsCookiesPriority = "Medium" AccessibilityTreeNewParamsCookiesPriorityHigh AccessibilityTreeNewParamsCookiesPriority = "High" )
func (AccessibilityTreeNewParamsCookiesPriority) IsKnown ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsCookiesPriority) IsKnown() bool
type AccessibilityTreeNewParamsCookiesSameSite ¶ added in v7.8.0
type AccessibilityTreeNewParamsCookiesSameSite string
const ( AccessibilityTreeNewParamsCookiesSameSiteStrict AccessibilityTreeNewParamsCookiesSameSite = "Strict" AccessibilityTreeNewParamsCookiesSameSiteLax AccessibilityTreeNewParamsCookiesSameSite = "Lax" AccessibilityTreeNewParamsCookiesSameSiteNone AccessibilityTreeNewParamsCookiesSameSite = "None" )
func (AccessibilityTreeNewParamsCookiesSameSite) IsKnown ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsCookiesSameSite) IsKnown() bool
type AccessibilityTreeNewParamsCookiesSourceScheme ¶ added in v7.8.0
type AccessibilityTreeNewParamsCookiesSourceScheme string
const ( AccessibilityTreeNewParamsCookiesSourceSchemeUnset AccessibilityTreeNewParamsCookiesSourceScheme = "Unset" AccessibilityTreeNewParamsCookiesSourceSchemeNonSecure AccessibilityTreeNewParamsCookiesSourceScheme = "NonSecure" AccessibilityTreeNewParamsCookiesSourceSchemeSecure AccessibilityTreeNewParamsCookiesSourceScheme = "Secure" )
func (AccessibilityTreeNewParamsCookiesSourceScheme) IsKnown ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsCookiesSourceScheme) IsKnown() bool
type AccessibilityTreeNewParamsGotoOptions ¶ added in v7.8.0
type AccessibilityTreeNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[AccessibilityTreeNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (AccessibilityTreeNewParamsGotoOptions) MarshalJSON ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type AccessibilityTreeNewParamsGotoOptionsWaitUntilArray ¶ added in v7.8.0
type AccessibilityTreeNewParamsGotoOptionsWaitUntilArray []AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItem
type AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItem ¶ added in v7.8.0
type AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItem string
const ( AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItemLoad AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItem = "load" AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type AccessibilityTreeNewParamsGotoOptionsWaitUntilString ¶ added in v7.8.0
type AccessibilityTreeNewParamsGotoOptionsWaitUntilString string
const ( AccessibilityTreeNewParamsGotoOptionsWaitUntilStringLoad AccessibilityTreeNewParamsGotoOptionsWaitUntilString = "load" AccessibilityTreeNewParamsGotoOptionsWaitUntilStringDomcontentloaded AccessibilityTreeNewParamsGotoOptionsWaitUntilString = "domcontentloaded" AccessibilityTreeNewParamsGotoOptionsWaitUntilStringNetworkidle0 AccessibilityTreeNewParamsGotoOptionsWaitUntilString = "networkidle0" AccessibilityTreeNewParamsGotoOptionsWaitUntilStringNetworkidle2 AccessibilityTreeNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (AccessibilityTreeNewParamsGotoOptionsWaitUntilString) IsKnown ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type AccessibilityTreeNewParamsGotoOptionsWaitUntilUnion ¶ added in v7.8.0
type AccessibilityTreeNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.AccessibilityTreeNewParamsGotoOptionsWaitUntilString, browser_rendering.AccessibilityTreeNewParamsGotoOptionsWaitUntilArray.
type AccessibilityTreeNewParamsRejectResourceType ¶ added in v7.8.0
type AccessibilityTreeNewParamsRejectResourceType string
const ( AccessibilityTreeNewParamsRejectResourceTypeDocument AccessibilityTreeNewParamsRejectResourceType = "document" AccessibilityTreeNewParamsRejectResourceTypeStylesheet AccessibilityTreeNewParamsRejectResourceType = "stylesheet" AccessibilityTreeNewParamsRejectResourceTypeImage AccessibilityTreeNewParamsRejectResourceType = "image" AccessibilityTreeNewParamsRejectResourceTypeMedia AccessibilityTreeNewParamsRejectResourceType = "media" AccessibilityTreeNewParamsRejectResourceTypeFont AccessibilityTreeNewParamsRejectResourceType = "font" AccessibilityTreeNewParamsRejectResourceTypeScript AccessibilityTreeNewParamsRejectResourceType = "script" AccessibilityTreeNewParamsRejectResourceTypeTexttrack AccessibilityTreeNewParamsRejectResourceType = "texttrack" AccessibilityTreeNewParamsRejectResourceTypeXHR AccessibilityTreeNewParamsRejectResourceType = "xhr" AccessibilityTreeNewParamsRejectResourceTypeFetch AccessibilityTreeNewParamsRejectResourceType = "fetch" AccessibilityTreeNewParamsRejectResourceTypePrefetch AccessibilityTreeNewParamsRejectResourceType = "prefetch" AccessibilityTreeNewParamsRejectResourceTypeEventsource AccessibilityTreeNewParamsRejectResourceType = "eventsource" AccessibilityTreeNewParamsRejectResourceTypeWebsocket AccessibilityTreeNewParamsRejectResourceType = "websocket" AccessibilityTreeNewParamsRejectResourceTypeManifest AccessibilityTreeNewParamsRejectResourceType = "manifest" AccessibilityTreeNewParamsRejectResourceTypeSignedexchange AccessibilityTreeNewParamsRejectResourceType = "signedexchange" AccessibilityTreeNewParamsRejectResourceTypePing AccessibilityTreeNewParamsRejectResourceType = "ping" AccessibilityTreeNewParamsRejectResourceTypeCspviolationreport AccessibilityTreeNewParamsRejectResourceType = "cspviolationreport" AccessibilityTreeNewParamsRejectResourceTypePreflight AccessibilityTreeNewParamsRejectResourceType = "preflight" AccessibilityTreeNewParamsRejectResourceTypeOther AccessibilityTreeNewParamsRejectResourceType = "other" )
func (AccessibilityTreeNewParamsRejectResourceType) IsKnown ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsRejectResourceType) IsKnown() bool
type AccessibilityTreeNewParamsViewport ¶ added in v7.8.0
type AccessibilityTreeNewParamsViewport struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (AccessibilityTreeNewParamsViewport) MarshalJSON ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsViewport) MarshalJSON() (data []byte, err error)
type AccessibilityTreeNewParamsWaitForSelector ¶ added in v7.8.0
type AccessibilityTreeNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector" api:"required"`
Hidden param.Field[AccessibilityTreeNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[AccessibilityTreeNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (AccessibilityTreeNewParamsWaitForSelector) MarshalJSON ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type AccessibilityTreeNewParamsWaitForSelectorHidden ¶ added in v7.8.0
type AccessibilityTreeNewParamsWaitForSelectorHidden bool
const (
AccessibilityTreeNewParamsWaitForSelectorHiddenTrue AccessibilityTreeNewParamsWaitForSelectorHidden = true
)
func (AccessibilityTreeNewParamsWaitForSelectorHidden) IsKnown ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsWaitForSelectorHidden) IsKnown() bool
type AccessibilityTreeNewParamsWaitForSelectorVisible ¶ added in v7.8.0
type AccessibilityTreeNewParamsWaitForSelectorVisible bool
const (
AccessibilityTreeNewParamsWaitForSelectorVisibleTrue AccessibilityTreeNewParamsWaitForSelectorVisible = true
)
func (AccessibilityTreeNewParamsWaitForSelectorVisible) IsKnown ¶ added in v7.8.0
func (r AccessibilityTreeNewParamsWaitForSelectorVisible) IsKnown() bool
type AccessibilityTreeNewResponse ¶ added in v7.7.0
type AccessibilityTreeNewResponse struct {
// Accessibility tree node
AccessibilityTree AccessibilityTreeNewResponseAccessibilityTree `json:"accessibilityTree" api:"required,nullable"`
JSON accessibilityTreeNewResponseJSON `json:"-"`
}
func (*AccessibilityTreeNewResponse) UnmarshalJSON ¶ added in v7.7.0
func (r *AccessibilityTreeNewResponse) UnmarshalJSON(data []byte) (err error)
type AccessibilityTreeNewResponseAccessibilityTree ¶ added in v7.7.0
type AccessibilityTreeNewResponseAccessibilityTree struct {
Role string `json:"role" api:"required"`
Autocomplete string `json:"autocomplete"`
Checked AccessibilityTreeNewResponseAccessibilityTreeCheckedUnion `json:"checked"`
Children []interface{} `json:"children"`
Description string `json:"description"`
Disabled bool `json:"disabled"`
Expanded bool `json:"expanded"`
Focused bool `json:"focused"`
Haspopup string `json:"haspopup"`
Invalid string `json:"invalid"`
Keyshortcuts string `json:"keyshortcuts"`
Level float64 `json:"level"`
Modal bool `json:"modal"`
Multiline bool `json:"multiline"`
Multiselectable bool `json:"multiselectable"`
Name string `json:"name"`
Orientation string `json:"orientation"`
Pressed AccessibilityTreeNewResponseAccessibilityTreePressedUnion `json:"pressed"`
Readonly bool `json:"readonly"`
Required bool `json:"required"`
Roledescription string `json:"roledescription"`
Selected bool `json:"selected"`
Value AccessibilityTreeNewResponseAccessibilityTreeValueUnion `json:"value"`
Valuemax float64 `json:"valuemax"`
Valuemin float64 `json:"valuemin"`
Valuetext string `json:"valuetext"`
JSON accessibilityTreeNewResponseAccessibilityTreeJSON `json:"-"`
}
Accessibility tree node
func (*AccessibilityTreeNewResponseAccessibilityTree) UnmarshalJSON ¶ added in v7.7.0
func (r *AccessibilityTreeNewResponseAccessibilityTree) UnmarshalJSON(data []byte) (err error)
type AccessibilityTreeNewResponseAccessibilityTreeCheckedString ¶ added in v7.7.0
type AccessibilityTreeNewResponseAccessibilityTreeCheckedString string
const (
AccessibilityTreeNewResponseAccessibilityTreeCheckedStringMixed AccessibilityTreeNewResponseAccessibilityTreeCheckedString = "mixed"
)
func (AccessibilityTreeNewResponseAccessibilityTreeCheckedString) ImplementsAccessibilityTreeNewResponseAccessibilityTreeCheckedUnion ¶ added in v7.7.0
func (r AccessibilityTreeNewResponseAccessibilityTreeCheckedString) ImplementsAccessibilityTreeNewResponseAccessibilityTreeCheckedUnion()
func (AccessibilityTreeNewResponseAccessibilityTreeCheckedString) IsKnown ¶ added in v7.7.0
func (r AccessibilityTreeNewResponseAccessibilityTreeCheckedString) IsKnown() bool
type AccessibilityTreeNewResponseAccessibilityTreeCheckedUnion ¶ added in v7.7.0
type AccessibilityTreeNewResponseAccessibilityTreeCheckedUnion interface {
ImplementsAccessibilityTreeNewResponseAccessibilityTreeCheckedUnion()
}
Union satisfied by shared.UnionBool or AccessibilityTreeNewResponseAccessibilityTreeCheckedString.
type AccessibilityTreeNewResponseAccessibilityTreePressedString ¶ added in v7.7.0
type AccessibilityTreeNewResponseAccessibilityTreePressedString string
const (
AccessibilityTreeNewResponseAccessibilityTreePressedStringMixed AccessibilityTreeNewResponseAccessibilityTreePressedString = "mixed"
)
func (AccessibilityTreeNewResponseAccessibilityTreePressedString) ImplementsAccessibilityTreeNewResponseAccessibilityTreePressedUnion ¶ added in v7.7.0
func (r AccessibilityTreeNewResponseAccessibilityTreePressedString) ImplementsAccessibilityTreeNewResponseAccessibilityTreePressedUnion()
func (AccessibilityTreeNewResponseAccessibilityTreePressedString) IsKnown ¶ added in v7.7.0
func (r AccessibilityTreeNewResponseAccessibilityTreePressedString) IsKnown() bool
type AccessibilityTreeNewResponseAccessibilityTreePressedUnion ¶ added in v7.7.0
type AccessibilityTreeNewResponseAccessibilityTreePressedUnion interface {
ImplementsAccessibilityTreeNewResponseAccessibilityTreePressedUnion()
}
Union satisfied by shared.UnionBool or AccessibilityTreeNewResponseAccessibilityTreePressedString.
type AccessibilityTreeNewResponseAccessibilityTreeValueUnion ¶ added in v7.7.0
type AccessibilityTreeNewResponseAccessibilityTreeValueUnion interface {
ImplementsAccessibilityTreeNewResponseAccessibilityTreeValueUnion()
}
Union satisfied by shared.UnionString or shared.UnionFloat.
type AccessibilityTreeNewResponseEnvelope ¶ added in v7.7.0
type AccessibilityTreeNewResponseEnvelope struct {
Meta AccessibilityTreeNewResponseEnvelopeMeta `json:"meta" api:"required"`
Result AccessibilityTreeNewResponse `json:"result" api:"required"`
// Response status.
Success bool `json:"success" api:"required"`
Errors []AccessibilityTreeNewResponseEnvelopeErrors `json:"errors"`
JSON accessibilityTreeNewResponseEnvelopeJSON `json:"-"`
}
func (*AccessibilityTreeNewResponseEnvelope) UnmarshalJSON ¶ added in v7.7.0
func (r *AccessibilityTreeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type AccessibilityTreeNewResponseEnvelopeErrors ¶ added in v7.7.0
type AccessibilityTreeNewResponseEnvelopeErrors struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON accessibilityTreeNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*AccessibilityTreeNewResponseEnvelopeErrors) UnmarshalJSON ¶ added in v7.7.0
func (r *AccessibilityTreeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type AccessibilityTreeNewResponseEnvelopeMeta ¶ added in v7.7.0
type AccessibilityTreeNewResponseEnvelopeMeta struct {
Status float64 `json:"status"`
Title string `json:"title"`
JSON accessibilityTreeNewResponseEnvelopeMetaJSON `json:"-"`
}
func (*AccessibilityTreeNewResponseEnvelopeMeta) UnmarshalJSON ¶ added in v7.7.0
func (r *AccessibilityTreeNewResponseEnvelopeMeta) UnmarshalJSON(data []byte) (err error)
type AccessibilityTreeService ¶ added in v7.7.0
type AccessibilityTreeService struct {
Options []option.RequestOption
}
AccessibilityTreeService 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 NewAccessibilityTreeService method instead.
func NewAccessibilityTreeService ¶ added in v7.7.0
func NewAccessibilityTreeService(opts ...option.RequestOption) (r *AccessibilityTreeService)
NewAccessibilityTreeService 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 (*AccessibilityTreeService) New ¶ added in v7.7.0
func (r *AccessibilityTreeService) New(ctx context.Context, params AccessibilityTreeNewParams, opts ...option.RequestOption) (res *AccessibilityTreeNewResponse, err error)
Returns the page's accessibility tree. Use `interestingOnly` to only return semantically meaningful nodes; use `root` to scope the tree to a CSS-selector-anchored subtree. Control page loading with `gotoOptions` and `waitFor*` options.
type AuditLogAction ¶
type AuditLogAction = shared.AuditLogAction
This is an alias to an internal type.
type AuditLogActor ¶
type AuditLogActor = shared.AuditLogActor
This is an alias to an internal type.
type AuditLogActorType ¶
type AuditLogActorType = shared.AuditLogActorType
The type of actor, whether a User, Cloudflare Admin, or an Automated System.
This is an alias to an internal type.
type AuditLogOwner ¶
type AuditLogOwner = shared.AuditLogOwner
This is an alias to an internal type.
type AuditLogResource ¶
type AuditLogResource = shared.AuditLogResource
This is an alias to an internal type.
type BrowserRenderingService ¶
type BrowserRenderingService struct {
Options []option.RequestOption
Content *ContentService
PDF *PDFService
Scrape *ScrapeService
Screenshot *ScreenshotService
Snapshot *SnapshotService
Json *JsonService
Links *LinkService
Markdown *MarkdownService
AccessibilityTree *AccessibilityTreeService
Crawl *CrawlService
Devtools *DevtoolService
}
BrowserRenderingService 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 NewBrowserRenderingService method instead.
func NewBrowserRenderingService ¶
func NewBrowserRenderingService(opts ...option.RequestOption) (r *BrowserRenderingService)
NewBrowserRenderingService 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 CertificateCA ¶
type CertificateCA = shared.CertificateCA
The Certificate Authority that will issue the certificate.
This is an alias to an internal type.
type CertificateRequestType ¶
type CertificateRequestType = shared.CertificateRequestType
Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa), or "keyless-certificate" (for Keyless SSL servers).
This is an alias to an internal type.
type CloudflareTunnel ¶
type CloudflareTunnel = shared.CloudflareTunnel
A Cloudflare Tunnel that connects your origin to Cloudflare's edge.
This is an alias to an internal type.
type CloudflareTunnelConfigSrc ¶
type CloudflareTunnelConfigSrc = shared.CloudflareTunnelConfigSrc
Indicates if this is a locally or remotely configured tunnel. If `local`, manage the tunnel using a YAML file on the origin machine. If `cloudflare`, manage the tunnel on the Zero Trust dashboard.
This is an alias to an internal type.
type CloudflareTunnelConnection ¶
type CloudflareTunnelConnection = shared.CloudflareTunnelConnection
This is an alias to an internal type.
type CloudflareTunnelStatus ¶
type CloudflareTunnelStatus = shared.CloudflareTunnelStatus
The status of the tunnel. Valid values are `inactive` (tunnel has never been run), `degraded` (tunnel is active and able to serve traffic but in an unhealthy state), `healthy` (tunnel is active and able to serve traffic), or `down` (tunnel can not serve traffic as it has no connections to the Cloudflare Edge).
This is an alias to an internal type.
type CloudflareTunnelTunType ¶
type CloudflareTunnelTunType = shared.CloudflareTunnelTunType
The type of tunnel.
This is an alias to an internal type.
type ContentNewParams ¶
type ContentNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]ContentNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]ContentNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]ContentNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[ContentNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]ContentNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[ContentNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]ContentNewParamsRejectResourceType] `json:"rejectResourceTypes"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[ContentNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[ContentNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (ContentNewParams) MarshalJSON ¶
func (r ContentNewParams) MarshalJSON() (data []byte, err error)
func (ContentNewParams) URLQuery ¶
func (r ContentNewParams) URLQuery() (v url.Values)
URLQuery serializes ContentNewParams's query parameters as `url.Values`.
type ContentNewParamsAddScriptTag ¶ added in v7.8.0
type ContentNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (ContentNewParamsAddScriptTag) MarshalJSON ¶ added in v7.8.0
func (r ContentNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type ContentNewParamsAddStyleTag ¶ added in v7.8.0
type ContentNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (ContentNewParamsAddStyleTag) MarshalJSON ¶ added in v7.8.0
func (r ContentNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type ContentNewParamsAllowResourceType ¶ added in v7.8.0
type ContentNewParamsAllowResourceType string
const ( ContentNewParamsAllowResourceTypeDocument ContentNewParamsAllowResourceType = "document" ContentNewParamsAllowResourceTypeStylesheet ContentNewParamsAllowResourceType = "stylesheet" ContentNewParamsAllowResourceTypeImage ContentNewParamsAllowResourceType = "image" ContentNewParamsAllowResourceTypeMedia ContentNewParamsAllowResourceType = "media" ContentNewParamsAllowResourceTypeFont ContentNewParamsAllowResourceType = "font" ContentNewParamsAllowResourceTypeScript ContentNewParamsAllowResourceType = "script" ContentNewParamsAllowResourceTypeTexttrack ContentNewParamsAllowResourceType = "texttrack" ContentNewParamsAllowResourceTypeXHR ContentNewParamsAllowResourceType = "xhr" ContentNewParamsAllowResourceTypeFetch ContentNewParamsAllowResourceType = "fetch" ContentNewParamsAllowResourceTypePrefetch ContentNewParamsAllowResourceType = "prefetch" ContentNewParamsAllowResourceTypeEventsource ContentNewParamsAllowResourceType = "eventsource" ContentNewParamsAllowResourceTypeWebsocket ContentNewParamsAllowResourceType = "websocket" ContentNewParamsAllowResourceTypeManifest ContentNewParamsAllowResourceType = "manifest" ContentNewParamsAllowResourceTypeSignedexchange ContentNewParamsAllowResourceType = "signedexchange" ContentNewParamsAllowResourceTypePing ContentNewParamsAllowResourceType = "ping" ContentNewParamsAllowResourceTypeCspviolationreport ContentNewParamsAllowResourceType = "cspviolationreport" ContentNewParamsAllowResourceTypePreflight ContentNewParamsAllowResourceType = "preflight" ContentNewParamsAllowResourceTypeOther ContentNewParamsAllowResourceType = "other" )
func (ContentNewParamsAllowResourceType) IsKnown ¶ added in v7.8.0
func (r ContentNewParamsAllowResourceType) IsKnown() bool
type ContentNewParamsAuthenticate ¶ added in v7.8.0
type ContentNewParamsAuthenticate struct {
Password param.Field[string] `json:"password" api:"required"`
Username param.Field[string] `json:"username" api:"required"`
}
Provide credentials for HTTP authentication.
func (ContentNewParamsAuthenticate) MarshalJSON ¶ added in v7.8.0
func (r ContentNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type ContentNewParamsCookie ¶ added in v7.8.0
type ContentNewParamsCookie struct {
// Cookie name.
Name param.Field[string] `json:"name" api:"required"`
Value param.Field[string] `json:"value" api:"required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[ContentNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[ContentNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[ContentNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (ContentNewParamsCookie) MarshalJSON ¶ added in v7.8.0
func (r ContentNewParamsCookie) MarshalJSON() (data []byte, err error)
type ContentNewParamsCookiesPriority ¶ added in v7.8.0
type ContentNewParamsCookiesPriority string
const ( ContentNewParamsCookiesPriorityLow ContentNewParamsCookiesPriority = "Low" ContentNewParamsCookiesPriorityMedium ContentNewParamsCookiesPriority = "Medium" ContentNewParamsCookiesPriorityHigh ContentNewParamsCookiesPriority = "High" )
func (ContentNewParamsCookiesPriority) IsKnown ¶ added in v7.8.0
func (r ContentNewParamsCookiesPriority) IsKnown() bool
type ContentNewParamsCookiesSameSite ¶ added in v7.8.0
type ContentNewParamsCookiesSameSite string
const ( ContentNewParamsCookiesSameSiteStrict ContentNewParamsCookiesSameSite = "Strict" ContentNewParamsCookiesSameSiteLax ContentNewParamsCookiesSameSite = "Lax" ContentNewParamsCookiesSameSiteNone ContentNewParamsCookiesSameSite = "None" )
func (ContentNewParamsCookiesSameSite) IsKnown ¶ added in v7.8.0
func (r ContentNewParamsCookiesSameSite) IsKnown() bool
type ContentNewParamsCookiesSourceScheme ¶ added in v7.8.0
type ContentNewParamsCookiesSourceScheme string
const ( ContentNewParamsCookiesSourceSchemeUnset ContentNewParamsCookiesSourceScheme = "Unset" ContentNewParamsCookiesSourceSchemeNonSecure ContentNewParamsCookiesSourceScheme = "NonSecure" ContentNewParamsCookiesSourceSchemeSecure ContentNewParamsCookiesSourceScheme = "Secure" )
func (ContentNewParamsCookiesSourceScheme) IsKnown ¶ added in v7.8.0
func (r ContentNewParamsCookiesSourceScheme) IsKnown() bool
type ContentNewParamsGotoOptions ¶ added in v7.8.0
type ContentNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[ContentNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (ContentNewParamsGotoOptions) MarshalJSON ¶ added in v7.8.0
func (r ContentNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type ContentNewParamsGotoOptionsWaitUntilArray ¶ added in v7.8.0
type ContentNewParamsGotoOptionsWaitUntilArray []ContentNewParamsGotoOptionsWaitUntilArrayItem
type ContentNewParamsGotoOptionsWaitUntilArrayItem ¶ added in v7.8.0
type ContentNewParamsGotoOptionsWaitUntilArrayItem string
const ( ContentNewParamsGotoOptionsWaitUntilArrayItemLoad ContentNewParamsGotoOptionsWaitUntilArrayItem = "load" ContentNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded ContentNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" ContentNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 ContentNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" ContentNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 ContentNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (ContentNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶ added in v7.8.0
func (r ContentNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type ContentNewParamsGotoOptionsWaitUntilString ¶ added in v7.8.0
type ContentNewParamsGotoOptionsWaitUntilString string
const ( ContentNewParamsGotoOptionsWaitUntilStringLoad ContentNewParamsGotoOptionsWaitUntilString = "load" ContentNewParamsGotoOptionsWaitUntilStringDomcontentloaded ContentNewParamsGotoOptionsWaitUntilString = "domcontentloaded" ContentNewParamsGotoOptionsWaitUntilStringNetworkidle0 ContentNewParamsGotoOptionsWaitUntilString = "networkidle0" ContentNewParamsGotoOptionsWaitUntilStringNetworkidle2 ContentNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (ContentNewParamsGotoOptionsWaitUntilString) IsKnown ¶ added in v7.8.0
func (r ContentNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type ContentNewParamsGotoOptionsWaitUntilUnion ¶ added in v7.8.0
type ContentNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.ContentNewParamsGotoOptionsWaitUntilString, browser_rendering.ContentNewParamsGotoOptionsWaitUntilArray.
type ContentNewParamsRejectResourceType ¶ added in v7.8.0
type ContentNewParamsRejectResourceType string
const ( ContentNewParamsRejectResourceTypeDocument ContentNewParamsRejectResourceType = "document" ContentNewParamsRejectResourceTypeStylesheet ContentNewParamsRejectResourceType = "stylesheet" ContentNewParamsRejectResourceTypeImage ContentNewParamsRejectResourceType = "image" ContentNewParamsRejectResourceTypeMedia ContentNewParamsRejectResourceType = "media" ContentNewParamsRejectResourceTypeFont ContentNewParamsRejectResourceType = "font" ContentNewParamsRejectResourceTypeScript ContentNewParamsRejectResourceType = "script" ContentNewParamsRejectResourceTypeTexttrack ContentNewParamsRejectResourceType = "texttrack" ContentNewParamsRejectResourceTypeXHR ContentNewParamsRejectResourceType = "xhr" ContentNewParamsRejectResourceTypeFetch ContentNewParamsRejectResourceType = "fetch" ContentNewParamsRejectResourceTypePrefetch ContentNewParamsRejectResourceType = "prefetch" ContentNewParamsRejectResourceTypeEventsource ContentNewParamsRejectResourceType = "eventsource" ContentNewParamsRejectResourceTypeWebsocket ContentNewParamsRejectResourceType = "websocket" ContentNewParamsRejectResourceTypeManifest ContentNewParamsRejectResourceType = "manifest" ContentNewParamsRejectResourceTypeSignedexchange ContentNewParamsRejectResourceType = "signedexchange" ContentNewParamsRejectResourceTypePing ContentNewParamsRejectResourceType = "ping" ContentNewParamsRejectResourceTypeCspviolationreport ContentNewParamsRejectResourceType = "cspviolationreport" ContentNewParamsRejectResourceTypePreflight ContentNewParamsRejectResourceType = "preflight" ContentNewParamsRejectResourceTypeOther ContentNewParamsRejectResourceType = "other" )
func (ContentNewParamsRejectResourceType) IsKnown ¶ added in v7.8.0
func (r ContentNewParamsRejectResourceType) IsKnown() bool
type ContentNewParamsViewport ¶ added in v7.8.0
type ContentNewParamsViewport struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (ContentNewParamsViewport) MarshalJSON ¶ added in v7.8.0
func (r ContentNewParamsViewport) MarshalJSON() (data []byte, err error)
type ContentNewParamsWaitForSelector ¶ added in v7.8.0
type ContentNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector" api:"required"`
Hidden param.Field[ContentNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[ContentNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (ContentNewParamsWaitForSelector) MarshalJSON ¶ added in v7.8.0
func (r ContentNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type ContentNewParamsWaitForSelectorHidden ¶ added in v7.8.0
type ContentNewParamsWaitForSelectorHidden bool
const (
ContentNewParamsWaitForSelectorHiddenTrue ContentNewParamsWaitForSelectorHidden = true
)
func (ContentNewParamsWaitForSelectorHidden) IsKnown ¶ added in v7.8.0
func (r ContentNewParamsWaitForSelectorHidden) IsKnown() bool
type ContentNewParamsWaitForSelectorVisible ¶ added in v7.8.0
type ContentNewParamsWaitForSelectorVisible bool
const (
ContentNewParamsWaitForSelectorVisibleTrue ContentNewParamsWaitForSelectorVisible = true
)
func (ContentNewParamsWaitForSelectorVisible) IsKnown ¶ added in v7.8.0
func (r ContentNewParamsWaitForSelectorVisible) IsKnown() bool
type ContentNewResponseEnvelope ¶
type ContentNewResponseEnvelope struct {
Meta ContentNewResponseEnvelopeMeta `json:"meta" api:"required"`
// Response status.
Success bool `json:"success" api:"required"`
Errors []ContentNewResponseEnvelopeErrors `json:"errors"`
// HTML content.
Result string `json:"result"`
JSON contentNewResponseEnvelopeJSON `json:"-"`
}
func (*ContentNewResponseEnvelope) UnmarshalJSON ¶
func (r *ContentNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ContentNewResponseEnvelopeErrors ¶
type ContentNewResponseEnvelopeErrors struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON contentNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*ContentNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ContentNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ContentNewResponseEnvelopeMeta ¶
type ContentNewResponseEnvelopeMeta struct {
Status float64 `json:"status"`
Title string `json:"title"`
JSON contentNewResponseEnvelopeMetaJSON `json:"-"`
}
func (*ContentNewResponseEnvelopeMeta) UnmarshalJSON ¶
func (r *ContentNewResponseEnvelopeMeta) UnmarshalJSON(data []byte) (err error)
type ContentService ¶
type ContentService struct {
Options []option.RequestOption
}
ContentService 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 NewContentService method instead.
func NewContentService ¶
func NewContentService(opts ...option.RequestOption) (r *ContentService)
NewContentService 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 (*ContentService) New ¶
func (r *ContentService) New(ctx context.Context, params ContentNewParams, opts ...option.RequestOption) (res *string, err error)
Fetches rendered HTML content from provided URL or HTML. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.
type CrawlDeleteParams ¶
type CrawlDeleteResponse ¶
type CrawlDeleteResponse struct {
// The ID of the cancelled job.
JobID string `json:"job_id" api:"required"`
// Cancellation confirmation message.
Message string `json:"message" api:"required"`
JSON crawlDeleteResponseJSON `json:"-"`
}
func (*CrawlDeleteResponse) UnmarshalJSON ¶
func (r *CrawlDeleteResponse) UnmarshalJSON(data []byte) (err error)
type CrawlDeleteResponseEnvelope ¶
type CrawlDeleteResponseEnvelope struct {
Result CrawlDeleteResponse `json:"result" api:"required"`
// Response status.
Success bool `json:"success" api:"required"`
Errors []CrawlDeleteResponseEnvelopeErrors `json:"errors"`
JSON crawlDeleteResponseEnvelopeJSON `json:"-"`
}
func (*CrawlDeleteResponseEnvelope) UnmarshalJSON ¶
func (r *CrawlDeleteResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type CrawlDeleteResponseEnvelopeErrors ¶
type CrawlDeleteResponseEnvelopeErrors struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON crawlDeleteResponseEnvelopeErrorsJSON `json:"-"`
}
func (*CrawlDeleteResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *CrawlDeleteResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type CrawlGetParams ¶
type CrawlGetParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// Cursor for pagination.
Cursor param.Field[float64] `query:"cursor"`
// Limit for pagination.
Limit param.Field[float64] `query:"limit"`
// Filter by URL status.
Status param.Field[CrawlGetParamsStatus] `query:"status"`
}
func (CrawlGetParams) URLQuery ¶
func (r CrawlGetParams) URLQuery() (v url.Values)
URLQuery serializes CrawlGetParams's query parameters as `url.Values`.
type CrawlGetParamsStatus ¶
type CrawlGetParamsStatus string
Filter by URL status.
const ( CrawlGetParamsStatusQueued CrawlGetParamsStatus = "queued" CrawlGetParamsStatusErrored CrawlGetParamsStatus = "errored" CrawlGetParamsStatusCompleted CrawlGetParamsStatus = "completed" CrawlGetParamsStatusDisallowed CrawlGetParamsStatus = "disallowed" CrawlGetParamsStatusSkipped CrawlGetParamsStatus = "skipped" CrawlGetParamsStatusCancelled CrawlGetParamsStatus = "cancelled" )
func (CrawlGetParamsStatus) IsKnown ¶
func (r CrawlGetParamsStatus) IsKnown() bool
type CrawlGetResponse ¶
type CrawlGetResponse struct {
// Crawl job ID.
ID string `json:"id" api:"required"`
// Total seconds spent in browser so far.
BrowserSecondsUsed float64 `json:"browserSecondsUsed" api:"required"`
// Total number of URLs that have been crawled so far.
Finished float64 `json:"finished" api:"required"`
// List of crawl job records.
Records []CrawlGetResponseRecord `json:"records" api:"required"`
// Total number of URLs that were skipped due to include/exclude/subdomain filters.
// Skipped URLs are included in records but are not counted toward total/finished.
Skipped float64 `json:"skipped" api:"required"`
// Current crawl job status.
Status string `json:"status" api:"required"`
// Total current number of URLs in the crawl job.
Total float64 `json:"total" api:"required"`
// Cursor for pagination.
Cursor string `json:"cursor"`
JSON crawlGetResponseJSON `json:"-"`
}
func (*CrawlGetResponse) UnmarshalJSON ¶
func (r *CrawlGetResponse) UnmarshalJSON(data []byte) (err error)
type CrawlGetResponseEnvelope ¶
type CrawlGetResponseEnvelope struct {
Result CrawlGetResponse `json:"result" api:"required"`
// Response status.
Success bool `json:"success" api:"required"`
Errors []CrawlGetResponseEnvelopeErrors `json:"errors"`
JSON crawlGetResponseEnvelopeJSON `json:"-"`
}
func (*CrawlGetResponseEnvelope) UnmarshalJSON ¶
func (r *CrawlGetResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type CrawlGetResponseEnvelopeErrors ¶
type CrawlGetResponseEnvelopeErrors struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON crawlGetResponseEnvelopeErrorsJSON `json:"-"`
}
func (*CrawlGetResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *CrawlGetResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type CrawlGetResponseRecord ¶
type CrawlGetResponseRecord struct {
Metadata CrawlGetResponseRecordsMetadata `json:"metadata" api:"required"`
// Current status of the crawled URL.
Status CrawlGetResponseRecordsStatus `json:"status" api:"required"`
// Crawled URL.
URL string `json:"url" api:"required"`
// HTML content of the crawled URL.
HTML string `json:"html"`
// JSON of the content of the crawled URL.
Json map[string]interface{} `json:"json"`
// Markdown of the content of the crawled URL.
Markdown string `json:"markdown"`
JSON crawlGetResponseRecordJSON `json:"-"`
}
func (*CrawlGetResponseRecord) UnmarshalJSON ¶
func (r *CrawlGetResponseRecord) UnmarshalJSON(data []byte) (err error)
type CrawlGetResponseRecordsMetadata ¶
type CrawlGetResponseRecordsMetadata struct {
// HTTP status code of the crawled page.
Status float64 `json:"status" api:"required"`
// Final URL of the crawled page.
URL string `json:"url" api:"required"`
// Title of the crawled page.
Title string `json:"title"`
JSON crawlGetResponseRecordsMetadataJSON `json:"-"`
}
func (*CrawlGetResponseRecordsMetadata) UnmarshalJSON ¶
func (r *CrawlGetResponseRecordsMetadata) UnmarshalJSON(data []byte) (err error)
type CrawlGetResponseRecordsStatus ¶
type CrawlGetResponseRecordsStatus string
Current status of the crawled URL.
const ( CrawlGetResponseRecordsStatusQueued CrawlGetResponseRecordsStatus = "queued" CrawlGetResponseRecordsStatusErrored CrawlGetResponseRecordsStatus = "errored" CrawlGetResponseRecordsStatusCompleted CrawlGetResponseRecordsStatus = "completed" CrawlGetResponseRecordsStatusDisallowed CrawlGetResponseRecordsStatus = "disallowed" CrawlGetResponseRecordsStatusSkipped CrawlGetResponseRecordsStatus = "skipped" CrawlGetResponseRecordsStatusCancelled CrawlGetResponseRecordsStatus = "cancelled" )
func (CrawlGetResponseRecordsStatus) IsKnown ¶
func (r CrawlGetResponseRecordsStatus) IsKnown() bool
type CrawlNewParams ¶
type CrawlNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
Body CrawlNewParamsBodyUnion `json:"body" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
}
func (CrawlNewParams) MarshalJSON ¶
func (r CrawlNewParams) MarshalJSON() (data []byte, err error)
func (CrawlNewParams) URLQuery ¶
func (r CrawlNewParams) URLQuery() (v url.Values)
URLQuery serializes CrawlNewParams's query parameters as `url.Values`.
type CrawlNewParamsBody ¶
type CrawlNewParamsBody struct {
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" api:"required" format:"uri"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
AddScriptTag param.Field[interface{}] `json:"addScriptTag"`
AddStyleTag param.Field[interface{}] `json:"addStyleTag"`
AllowRequestPattern param.Field[interface{}] `json:"allowRequestPattern"`
AllowResourceTypes param.Field[interface{}] `json:"allowResourceTypes"`
Authenticate param.Field[interface{}] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
Cookies param.Field[interface{}] `json:"cookies"`
CrawlPurposes param.Field[interface{}] `json:"crawlPurposes"`
// Maximum number of levels deep the crawler will traverse from the starting URL.
Depth param.Field[float64] `json:"depth"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
Formats param.Field[interface{}] `json:"formats"`
GotoOptions param.Field[interface{}] `json:"gotoOptions"`
JsonOptions param.Field[interface{}] `json:"jsonOptions"`
// Maximum number of URLs to crawl.
Limit param.Field[float64] `json:"limit"`
// Maximum age of a resource that can be returned from cache in seconds. Default is
// 1 day.
MaxAge param.Field[float64] `json:"maxAge"`
// Unix timestamp (seconds since epoch) indicating to only crawl pages that were
// modified since this time. For sitemap URLs with a lastmod field, this is
// compared directly. For other URLs, the crawler will use If-Modified-Since header
// when fetching. URLs without modification information (no lastmod in sitemap and
// no Last-Modified header support) will be crawled. Note: This works in
// conjunction with maxAge - both filters must pass for a cached resource to be
// used. Must be within the last year and not in the future.
ModifiedSince param.Field[int64] `json:"modifiedSince"`
Options param.Field[interface{}] `json:"options"`
RejectRequestPattern param.Field[interface{}] `json:"rejectRequestPattern"`
RejectResourceTypes param.Field[interface{}] `json:"rejectResourceTypes"`
// Whether to render the page or fetch static content. True by default.
Render param.Field[CrawlNewParamsBodyRender] `json:"render"`
SetExtraHTTPHeaders param.Field[interface{}] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// Source of links to crawl. 'sitemaps' - only crawl URLs from sitemaps, 'links' -
// only crawl URLs scraped from pages, 'all' - crawl both sitemap and scraped links
// (default).
Source param.Field[CrawlNewParamsBodySource] `json:"source"`
Viewport param.Field[interface{}] `json:"viewport"`
WaitForSelector param.Field[interface{}] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (CrawlNewParamsBody) MarshalJSON ¶
func (r CrawlNewParamsBody) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObject ¶
type CrawlNewParamsBodyObject struct {
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" api:"required" format:"uri"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]CrawlNewParamsBodyObjectAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]CrawlNewParamsBodyObjectAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]CrawlNewParamsBodyObjectAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[CrawlNewParamsBodyObjectAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]CrawlNewParamsBodyObjectCookie] `json:"cookies"`
// List of crawl purposes to respect Content-Signal directives in robots.txt.
// Allowed values: 'search', 'ai-input', 'ai-train'. Learn more:
// https://contentsignals.org/. Default: ['search', 'ai-input', 'ai-train'].
CrawlPurposes param.Field[[]CrawlNewParamsBodyObjectCrawlPurpose] `json:"crawlPurposes"`
// Maximum number of levels deep the crawler will traverse from the starting URL.
Depth param.Field[float64] `json:"depth"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Formats to return. Default is `html`.
Formats param.Field[[]CrawlNewParamsBodyObjectFormat] `json:"formats"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[CrawlNewParamsBodyObjectGotoOptions] `json:"gotoOptions"`
// Options for JSON extraction.
JsonOptions param.Field[CrawlNewParamsBodyObjectJsonOptions] `json:"jsonOptions"`
// Maximum number of URLs to crawl.
Limit param.Field[float64] `json:"limit"`
// Maximum age of a resource that can be returned from cache in seconds. Default is
// 1 day.
MaxAge param.Field[float64] `json:"maxAge"`
// Unix timestamp (seconds since epoch) indicating to only crawl pages that were
// modified since this time. For sitemap URLs with a lastmod field, this is
// compared directly. For other URLs, the crawler will use If-Modified-Since header
// when fetching. URLs without modification information (no lastmod in sitemap and
// no Last-Modified header support) will be crawled. Note: This works in
// conjunction with maxAge - both filters must pass for a cached resource to be
// used. Must be within the last year and not in the future.
ModifiedSince param.Field[int64] `json:"modifiedSince"`
// Additional options for the crawler.
Options param.Field[CrawlNewParamsBodyObjectOptions] `json:"options"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]CrawlNewParamsBodyObjectRejectResourceType] `json:"rejectResourceTypes"`
// Whether to render the page or fetch static content. True by default.
Render param.Field[CrawlNewParamsBodyObjectRender] `json:"render"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// Source of links to crawl. 'sitemaps' - only crawl URLs from sitemaps, 'links' -
// only crawl URLs scraped from pages, 'all' - crawl both sitemap and scraped links
// (default).
Source param.Field[CrawlNewParamsBodyObjectSource] `json:"source"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[CrawlNewParamsBodyObjectViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[CrawlNewParamsBodyObjectWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (CrawlNewParamsBodyObject) MarshalJSON ¶
func (r CrawlNewParamsBodyObject) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectAddScriptTag ¶
type CrawlNewParamsBodyObjectAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (CrawlNewParamsBodyObjectAddScriptTag) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectAddScriptTag) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectAddStyleTag ¶
type CrawlNewParamsBodyObjectAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (CrawlNewParamsBodyObjectAddStyleTag) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectAddStyleTag) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectAllowResourceType ¶
type CrawlNewParamsBodyObjectAllowResourceType string
const ( CrawlNewParamsBodyObjectAllowResourceTypeDocument CrawlNewParamsBodyObjectAllowResourceType = "document" CrawlNewParamsBodyObjectAllowResourceTypeStylesheet CrawlNewParamsBodyObjectAllowResourceType = "stylesheet" CrawlNewParamsBodyObjectAllowResourceTypeImage CrawlNewParamsBodyObjectAllowResourceType = "image" CrawlNewParamsBodyObjectAllowResourceTypeMedia CrawlNewParamsBodyObjectAllowResourceType = "media" CrawlNewParamsBodyObjectAllowResourceTypeFont CrawlNewParamsBodyObjectAllowResourceType = "font" CrawlNewParamsBodyObjectAllowResourceTypeScript CrawlNewParamsBodyObjectAllowResourceType = "script" CrawlNewParamsBodyObjectAllowResourceTypeTexttrack CrawlNewParamsBodyObjectAllowResourceType = "texttrack" CrawlNewParamsBodyObjectAllowResourceTypeXHR CrawlNewParamsBodyObjectAllowResourceType = "xhr" CrawlNewParamsBodyObjectAllowResourceTypeFetch CrawlNewParamsBodyObjectAllowResourceType = "fetch" CrawlNewParamsBodyObjectAllowResourceTypePrefetch CrawlNewParamsBodyObjectAllowResourceType = "prefetch" CrawlNewParamsBodyObjectAllowResourceTypeEventsource CrawlNewParamsBodyObjectAllowResourceType = "eventsource" CrawlNewParamsBodyObjectAllowResourceTypeWebsocket CrawlNewParamsBodyObjectAllowResourceType = "websocket" CrawlNewParamsBodyObjectAllowResourceTypeManifest CrawlNewParamsBodyObjectAllowResourceType = "manifest" CrawlNewParamsBodyObjectAllowResourceTypeSignedexchange CrawlNewParamsBodyObjectAllowResourceType = "signedexchange" CrawlNewParamsBodyObjectAllowResourceTypePing CrawlNewParamsBodyObjectAllowResourceType = "ping" CrawlNewParamsBodyObjectAllowResourceTypeCspviolationreport CrawlNewParamsBodyObjectAllowResourceType = "cspviolationreport" CrawlNewParamsBodyObjectAllowResourceTypePreflight CrawlNewParamsBodyObjectAllowResourceType = "preflight" CrawlNewParamsBodyObjectAllowResourceTypeOther CrawlNewParamsBodyObjectAllowResourceType = "other" )
func (CrawlNewParamsBodyObjectAllowResourceType) IsKnown ¶
func (r CrawlNewParamsBodyObjectAllowResourceType) IsKnown() bool
type CrawlNewParamsBodyObjectAuthenticate ¶
type CrawlNewParamsBodyObjectAuthenticate struct {
Password param.Field[string] `json:"password" api:"required"`
Username param.Field[string] `json:"username" api:"required"`
}
Provide credentials for HTTP authentication.
func (CrawlNewParamsBodyObjectAuthenticate) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectAuthenticate) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectCookie ¶
type CrawlNewParamsBodyObjectCookie struct {
// Cookie name.
Name param.Field[string] `json:"name" api:"required"`
Value param.Field[string] `json:"value" api:"required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[CrawlNewParamsBodyObjectCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[CrawlNewParamsBodyObjectCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[CrawlNewParamsBodyObjectCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (CrawlNewParamsBodyObjectCookie) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectCookie) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectCookiesPriority ¶
type CrawlNewParamsBodyObjectCookiesPriority string
const ( CrawlNewParamsBodyObjectCookiesPriorityLow CrawlNewParamsBodyObjectCookiesPriority = "Low" CrawlNewParamsBodyObjectCookiesPriorityMedium CrawlNewParamsBodyObjectCookiesPriority = "Medium" CrawlNewParamsBodyObjectCookiesPriorityHigh CrawlNewParamsBodyObjectCookiesPriority = "High" )
func (CrawlNewParamsBodyObjectCookiesPriority) IsKnown ¶
func (r CrawlNewParamsBodyObjectCookiesPriority) IsKnown() bool
type CrawlNewParamsBodyObjectCookiesSameSite ¶
type CrawlNewParamsBodyObjectCookiesSameSite string
const ( CrawlNewParamsBodyObjectCookiesSameSiteStrict CrawlNewParamsBodyObjectCookiesSameSite = "Strict" CrawlNewParamsBodyObjectCookiesSameSiteLax CrawlNewParamsBodyObjectCookiesSameSite = "Lax" CrawlNewParamsBodyObjectCookiesSameSiteNone CrawlNewParamsBodyObjectCookiesSameSite = "None" )
func (CrawlNewParamsBodyObjectCookiesSameSite) IsKnown ¶
func (r CrawlNewParamsBodyObjectCookiesSameSite) IsKnown() bool
type CrawlNewParamsBodyObjectCookiesSourceScheme ¶
type CrawlNewParamsBodyObjectCookiesSourceScheme string
const ( CrawlNewParamsBodyObjectCookiesSourceSchemeUnset CrawlNewParamsBodyObjectCookiesSourceScheme = "Unset" CrawlNewParamsBodyObjectCookiesSourceSchemeNonSecure CrawlNewParamsBodyObjectCookiesSourceScheme = "NonSecure" CrawlNewParamsBodyObjectCookiesSourceSchemeSecure CrawlNewParamsBodyObjectCookiesSourceScheme = "Secure" )
func (CrawlNewParamsBodyObjectCookiesSourceScheme) IsKnown ¶
func (r CrawlNewParamsBodyObjectCookiesSourceScheme) IsKnown() bool
type CrawlNewParamsBodyObjectCrawlPurpose ¶
type CrawlNewParamsBodyObjectCrawlPurpose string
const ( CrawlNewParamsBodyObjectCrawlPurposeSearch CrawlNewParamsBodyObjectCrawlPurpose = "search" CrawlNewParamsBodyObjectCrawlPurposeAIInput CrawlNewParamsBodyObjectCrawlPurpose = "ai-input" CrawlNewParamsBodyObjectCrawlPurposeAITrain CrawlNewParamsBodyObjectCrawlPurpose = "ai-train" )
func (CrawlNewParamsBodyObjectCrawlPurpose) IsKnown ¶
func (r CrawlNewParamsBodyObjectCrawlPurpose) IsKnown() bool
type CrawlNewParamsBodyObjectFormat ¶
type CrawlNewParamsBodyObjectFormat string
const ( CrawlNewParamsBodyObjectFormatHTML CrawlNewParamsBodyObjectFormat = "html" CrawlNewParamsBodyObjectFormatMarkdown CrawlNewParamsBodyObjectFormat = "markdown" CrawlNewParamsBodyObjectFormatJson CrawlNewParamsBodyObjectFormat = "json" )
func (CrawlNewParamsBodyObjectFormat) IsKnown ¶
func (r CrawlNewParamsBodyObjectFormat) IsKnown() bool
type CrawlNewParamsBodyObjectGotoOptions ¶
type CrawlNewParamsBodyObjectGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[CrawlNewParamsBodyObjectGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (CrawlNewParamsBodyObjectGotoOptions) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectGotoOptions) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectGotoOptionsWaitUntilArray ¶
type CrawlNewParamsBodyObjectGotoOptionsWaitUntilArray []CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItem
type CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItem ¶
type CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItem string
const ( CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItemLoad CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItem = "load" CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItemDomcontentloaded CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItem = "domcontentloaded" CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItemNetworkidle0 CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItem = "networkidle0" CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItemNetworkidle2 CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItem) IsKnown ¶
func (r CrawlNewParamsBodyObjectGotoOptionsWaitUntilArrayItem) IsKnown() bool
type CrawlNewParamsBodyObjectGotoOptionsWaitUntilString ¶
type CrawlNewParamsBodyObjectGotoOptionsWaitUntilString string
const ( CrawlNewParamsBodyObjectGotoOptionsWaitUntilStringLoad CrawlNewParamsBodyObjectGotoOptionsWaitUntilString = "load" CrawlNewParamsBodyObjectGotoOptionsWaitUntilStringDomcontentloaded CrawlNewParamsBodyObjectGotoOptionsWaitUntilString = "domcontentloaded" CrawlNewParamsBodyObjectGotoOptionsWaitUntilStringNetworkidle0 CrawlNewParamsBodyObjectGotoOptionsWaitUntilString = "networkidle0" CrawlNewParamsBodyObjectGotoOptionsWaitUntilStringNetworkidle2 CrawlNewParamsBodyObjectGotoOptionsWaitUntilString = "networkidle2" )
func (CrawlNewParamsBodyObjectGotoOptionsWaitUntilString) IsKnown ¶
func (r CrawlNewParamsBodyObjectGotoOptionsWaitUntilString) IsKnown() bool
type CrawlNewParamsBodyObjectGotoOptionsWaitUntilUnion ¶
type CrawlNewParamsBodyObjectGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.CrawlNewParamsBodyObjectGotoOptionsWaitUntilString, browser_rendering.CrawlNewParamsBodyObjectGotoOptionsWaitUntilArray.
type CrawlNewParamsBodyObjectJsonOptions ¶
type CrawlNewParamsBodyObjectJsonOptions struct {
// Optional list of custom AI models to use for the request. The models will be
// tried in the order provided, and in case a model returns an error, the next one
// will be used as fallback.
CustomAI param.Field[[]CrawlNewParamsBodyObjectJsonOptionsCustomAI] `json:"custom_ai"`
Prompt param.Field[string] `json:"prompt"`
ResponseFormat param.Field[CrawlNewParamsBodyObjectJsonOptionsResponseFormat] `json:"response_format"`
}
Options for JSON extraction.
func (CrawlNewParamsBodyObjectJsonOptions) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectJsonOptions) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectJsonOptionsCustomAI ¶
type CrawlNewParamsBodyObjectJsonOptionsCustomAI struct {
// AI model to use for the request. Must be formed as `<provider>/<model_name>`,
// e.g. `workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast`.
Model param.Field[string] `json:"model" api:"required"`
// Authorization token for the AI model: `Bearer <token>`. Not needed for
// workers-ai models.
Authorization param.Field[string] `json:"authorization"`
}
func (CrawlNewParamsBodyObjectJsonOptionsCustomAI) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectJsonOptionsCustomAI) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectJsonOptionsResponseFormat ¶
type CrawlNewParamsBodyObjectJsonOptionsResponseFormat struct {
Type param.Field[string] `json:"type" api:"required"`
// Schema for the response format. More information here:
// https://developers.cloudflare.com/workers-ai/json-mode/
JsonSchema param.Field[map[string]CrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaUnion] `json:"json_schema"`
}
func (CrawlNewParamsBodyObjectJsonOptionsResponseFormat) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectJsonOptionsResponseFormat) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaArray ¶
type CrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaArray []string
func (CrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaArray) ImplementsCrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaUnion ¶
func (r CrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaArray) ImplementsCrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaUnion()
type CrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaUnion ¶
type CrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaUnion interface {
ImplementsCrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat, shared.UnionBool, browser_rendering.CrawlNewParamsBodyObjectJsonOptionsResponseFormatJsonSchemaArray.
Use [Raw()] to specify an arbitrary value for this param
type CrawlNewParamsBodyObjectOptions ¶
type CrawlNewParamsBodyObjectOptions struct {
// Exclude links matching the provided wildcard patterns in the crawl job. Example:
// 'https://example.com/privacy/**'.
ExcludePatterns param.Field[[]string] `json:"excludePatterns"`
// Include external links in the crawl job. If set to true, includeSubdomains is
// ignored.
IncludeExternalLinks param.Field[bool] `json:"includeExternalLinks"`
// Include only links matching the provided wildcard patterns in the crawl job.
// Include patterns are evaluated before exclude patterns. URLs that match any of
// the specified include patterns will be included in the crawl job. Example:
// 'https://example.com/blog/**'.
IncludePatterns param.Field[[]string] `json:"includePatterns"`
// Include links to subdomains in the crawl job. This option is ignored if
// includeExternalLinks is true.
IncludeSubdomains param.Field[bool] `json:"includeSubdomains"`
}
Additional options for the crawler.
func (CrawlNewParamsBodyObjectOptions) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectOptions) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectRejectResourceType ¶
type CrawlNewParamsBodyObjectRejectResourceType string
const ( CrawlNewParamsBodyObjectRejectResourceTypeDocument CrawlNewParamsBodyObjectRejectResourceType = "document" CrawlNewParamsBodyObjectRejectResourceTypeStylesheet CrawlNewParamsBodyObjectRejectResourceType = "stylesheet" CrawlNewParamsBodyObjectRejectResourceTypeImage CrawlNewParamsBodyObjectRejectResourceType = "image" CrawlNewParamsBodyObjectRejectResourceTypeMedia CrawlNewParamsBodyObjectRejectResourceType = "media" CrawlNewParamsBodyObjectRejectResourceTypeFont CrawlNewParamsBodyObjectRejectResourceType = "font" CrawlNewParamsBodyObjectRejectResourceTypeScript CrawlNewParamsBodyObjectRejectResourceType = "script" CrawlNewParamsBodyObjectRejectResourceTypeTexttrack CrawlNewParamsBodyObjectRejectResourceType = "texttrack" CrawlNewParamsBodyObjectRejectResourceTypeXHR CrawlNewParamsBodyObjectRejectResourceType = "xhr" CrawlNewParamsBodyObjectRejectResourceTypeFetch CrawlNewParamsBodyObjectRejectResourceType = "fetch" CrawlNewParamsBodyObjectRejectResourceTypePrefetch CrawlNewParamsBodyObjectRejectResourceType = "prefetch" CrawlNewParamsBodyObjectRejectResourceTypeEventsource CrawlNewParamsBodyObjectRejectResourceType = "eventsource" CrawlNewParamsBodyObjectRejectResourceTypeWebsocket CrawlNewParamsBodyObjectRejectResourceType = "websocket" CrawlNewParamsBodyObjectRejectResourceTypeManifest CrawlNewParamsBodyObjectRejectResourceType = "manifest" CrawlNewParamsBodyObjectRejectResourceTypeSignedexchange CrawlNewParamsBodyObjectRejectResourceType = "signedexchange" CrawlNewParamsBodyObjectRejectResourceTypePing CrawlNewParamsBodyObjectRejectResourceType = "ping" CrawlNewParamsBodyObjectRejectResourceTypeCspviolationreport CrawlNewParamsBodyObjectRejectResourceType = "cspviolationreport" CrawlNewParamsBodyObjectRejectResourceTypePreflight CrawlNewParamsBodyObjectRejectResourceType = "preflight" CrawlNewParamsBodyObjectRejectResourceTypeOther CrawlNewParamsBodyObjectRejectResourceType = "other" )
func (CrawlNewParamsBodyObjectRejectResourceType) IsKnown ¶
func (r CrawlNewParamsBodyObjectRejectResourceType) IsKnown() bool
type CrawlNewParamsBodyObjectRender ¶
type CrawlNewParamsBodyObjectRender bool
Whether to render the page or fetch static content. True by default.
const (
CrawlNewParamsBodyObjectRenderTrue CrawlNewParamsBodyObjectRender = true
)
func (CrawlNewParamsBodyObjectRender) IsKnown ¶
func (r CrawlNewParamsBodyObjectRender) IsKnown() bool
type CrawlNewParamsBodyObjectSource ¶
type CrawlNewParamsBodyObjectSource string
Source of links to crawl. 'sitemaps' - only crawl URLs from sitemaps, 'links' - only crawl URLs scraped from pages, 'all' - crawl both sitemap and scraped links (default).
const ( CrawlNewParamsBodyObjectSourceSitemaps CrawlNewParamsBodyObjectSource = "sitemaps" CrawlNewParamsBodyObjectSourceLinks CrawlNewParamsBodyObjectSource = "links" CrawlNewParamsBodyObjectSourceAll CrawlNewParamsBodyObjectSource = "all" )
func (CrawlNewParamsBodyObjectSource) IsKnown ¶
func (r CrawlNewParamsBodyObjectSource) IsKnown() bool
type CrawlNewParamsBodyObjectViewport ¶
type CrawlNewParamsBodyObjectViewport struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (CrawlNewParamsBodyObjectViewport) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectViewport) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectWaitForSelector ¶
type CrawlNewParamsBodyObjectWaitForSelector struct {
Selector param.Field[string] `json:"selector" api:"required"`
Hidden param.Field[CrawlNewParamsBodyObjectWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[CrawlNewParamsBodyObjectWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (CrawlNewParamsBodyObjectWaitForSelector) MarshalJSON ¶
func (r CrawlNewParamsBodyObjectWaitForSelector) MarshalJSON() (data []byte, err error)
type CrawlNewParamsBodyObjectWaitForSelectorHidden ¶
type CrawlNewParamsBodyObjectWaitForSelectorHidden bool
const (
CrawlNewParamsBodyObjectWaitForSelectorHiddenTrue CrawlNewParamsBodyObjectWaitForSelectorHidden = true
)
func (CrawlNewParamsBodyObjectWaitForSelectorHidden) IsKnown ¶
func (r CrawlNewParamsBodyObjectWaitForSelectorHidden) IsKnown() bool
type CrawlNewParamsBodyObjectWaitForSelectorVisible ¶
type CrawlNewParamsBodyObjectWaitForSelectorVisible bool
const (
CrawlNewParamsBodyObjectWaitForSelectorVisibleTrue CrawlNewParamsBodyObjectWaitForSelectorVisible = true
)
func (CrawlNewParamsBodyObjectWaitForSelectorVisible) IsKnown ¶
func (r CrawlNewParamsBodyObjectWaitForSelectorVisible) IsKnown() bool
type CrawlNewParamsBodyRender ¶
type CrawlNewParamsBodyRender bool
Whether to render the page or fetch static content. True by default.
const ( CrawlNewParamsBodyRenderTrue CrawlNewParamsBodyRender = true CrawlNewParamsBodyRenderFalse CrawlNewParamsBodyRender = false )
func (CrawlNewParamsBodyRender) IsKnown ¶
func (r CrawlNewParamsBodyRender) IsKnown() bool
type CrawlNewParamsBodySource ¶
type CrawlNewParamsBodySource string
Source of links to crawl. 'sitemaps' - only crawl URLs from sitemaps, 'links' - only crawl URLs scraped from pages, 'all' - crawl both sitemap and scraped links (default).
const ( CrawlNewParamsBodySourceSitemaps CrawlNewParamsBodySource = "sitemaps" CrawlNewParamsBodySourceLinks CrawlNewParamsBodySource = "links" CrawlNewParamsBodySourceAll CrawlNewParamsBodySource = "all" )
func (CrawlNewParamsBodySource) IsKnown ¶
func (r CrawlNewParamsBodySource) IsKnown() bool
type CrawlNewParamsBodyUnion ¶
type CrawlNewParamsBodyUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.CrawlNewParamsBodyObject, browser_rendering.CrawlNewParamsBodyObject, CrawlNewParamsBody.
type CrawlNewResponseEnvelope ¶
type CrawlNewResponseEnvelope struct {
// Crawl job ID.
Result string `json:"result" api:"required"`
// Response status.
Success bool `json:"success" api:"required"`
Errors []CrawlNewResponseEnvelopeErrors `json:"errors"`
JSON crawlNewResponseEnvelopeJSON `json:"-"`
}
func (*CrawlNewResponseEnvelope) UnmarshalJSON ¶
func (r *CrawlNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type CrawlNewResponseEnvelopeErrors ¶
type CrawlNewResponseEnvelopeErrors struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON crawlNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*CrawlNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *CrawlNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type CrawlService ¶
type CrawlService struct {
Options []option.RequestOption
}
CrawlService 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 NewCrawlService method instead.
func NewCrawlService ¶
func NewCrawlService(opts ...option.RequestOption) (r *CrawlService)
NewCrawlService 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 (*CrawlService) Delete ¶
func (r *CrawlService) Delete(ctx context.Context, jobID string, body CrawlDeleteParams, opts ...option.RequestOption) (res *CrawlDeleteResponse, err error)
Cancels an ongoing crawl job by setting its status to cancelled and stopping all queued URLs.
func (*CrawlService) Get ¶
func (r *CrawlService) Get(ctx context.Context, jobID string, params CrawlGetParams, opts ...option.RequestOption) (res *CrawlGetResponse, err error)
Returns the result of a crawl job.
func (*CrawlService) New ¶
func (r *CrawlService) New(ctx context.Context, params CrawlNewParams, opts ...option.RequestOption) (res *string, err error)
Starts a crawl job for the provided URL and its children. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.
type DevtoolBrowserConnectParams ¶
type DevtoolBrowserConnectParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Keep-alive time in ms (only valid when acquiring new session).
KeepAlive param.Field[float64] `query:"keep_alive"`
// Use experimental browser.
Lab param.Field[bool] `query:"lab"`
Recording param.Field[bool] `query:"recording"`
}
func (DevtoolBrowserConnectParams) URLQuery ¶
func (r DevtoolBrowserConnectParams) URLQuery() (v url.Values)
URLQuery serializes DevtoolBrowserConnectParams's query parameters as `url.Values`.
type DevtoolBrowserDeleteResponse ¶
type DevtoolBrowserDeleteResponse struct {
Status DevtoolBrowserDeleteResponseStatus `json:"status" api:"required"`
JSON devtoolBrowserDeleteResponseJSON `json:"-"`
}
func (*DevtoolBrowserDeleteResponse) UnmarshalJSON ¶
func (r *DevtoolBrowserDeleteResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolBrowserDeleteResponseStatus ¶
type DevtoolBrowserDeleteResponseStatus string
const ( DevtoolBrowserDeleteResponseStatusClosing DevtoolBrowserDeleteResponseStatus = "closing" DevtoolBrowserDeleteResponseStatusClosed DevtoolBrowserDeleteResponseStatus = "closed" )
func (DevtoolBrowserDeleteResponseStatus) IsKnown ¶
func (r DevtoolBrowserDeleteResponseStatus) IsKnown() bool
type DevtoolBrowserLaunchParams ¶
type DevtoolBrowserLaunchParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Keep-alive time in ms (only valid when acquiring new session).
KeepAlive param.Field[float64] `query:"keep_alive"`
// Use experimental browser.
Lab param.Field[bool] `query:"lab"`
Recording param.Field[bool] `query:"recording"`
}
func (DevtoolBrowserLaunchParams) URLQuery ¶
func (r DevtoolBrowserLaunchParams) URLQuery() (v url.Values)
URLQuery serializes DevtoolBrowserLaunchParams's query parameters as `url.Values`.
type DevtoolBrowserNewParams ¶
type DevtoolBrowserNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Keep-alive time in milliseconds.
KeepAlive param.Field[float64] `query:"keep_alive"`
// Use experimental browser.
Lab param.Field[bool] `query:"lab"`
// How long the live view URL remains valid, in milliseconds (max 60 minutes). Only
// used when targets is true.
LiveViewURLExpiresInMs param.Field[float64] `query:"liveViewUrlExpiresInMs"`
Recording param.Field[bool] `query:"recording"`
// Include browser targets in response.
Targets param.Field[bool] `query:"targets"`
}
func (DevtoolBrowserNewParams) URLQuery ¶
func (r DevtoolBrowserNewParams) URLQuery() (v url.Values)
URLQuery serializes DevtoolBrowserNewParams's query parameters as `url.Values`.
type DevtoolBrowserNewResponse ¶
type DevtoolBrowserNewResponse struct {
// Browser session ID.
SessionID string `json:"sessionId" api:"required"`
// WebSocket URL for the session.
WebSocketDebuggerURL string `json:"webSocketDebuggerUrl"`
JSON devtoolBrowserNewResponseJSON `json:"-"`
}
func (*DevtoolBrowserNewResponse) UnmarshalJSON ¶
func (r *DevtoolBrowserNewResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolBrowserPageService ¶
type DevtoolBrowserPageService struct {
Options []option.RequestOption
}
DevtoolBrowserPageService 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 NewDevtoolBrowserPageService method instead.
func NewDevtoolBrowserPageService ¶
func NewDevtoolBrowserPageService(opts ...option.RequestOption) (r *DevtoolBrowserPageService)
NewDevtoolBrowserPageService 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 (*DevtoolBrowserPageService) Get ¶
func (r *DevtoolBrowserPageService) Get(ctx context.Context, sessionID string, targetID string, query DevtoolBrowserPageGetParams, opts ...option.RequestOption) (err error)
Establishes a WebSocket connection to a specific Chrome DevTools target or page.
type DevtoolBrowserProtocolResponse ¶
type DevtoolBrowserProtocolResponse struct {
// List of protocol domains.
Domains []DevtoolBrowserProtocolResponseDomain `json:"domains" api:"required"`
// Protocol version.
Version DevtoolBrowserProtocolResponseVersion `json:"version"`
JSON devtoolBrowserProtocolResponseJSON `json:"-"`
}
func (*DevtoolBrowserProtocolResponse) UnmarshalJSON ¶
func (r *DevtoolBrowserProtocolResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolBrowserProtocolResponseDomain ¶
type DevtoolBrowserProtocolResponseDomain struct {
// Domain name.
Domain string `json:"domain" api:"required"`
// Available commands.
Commands []map[string]interface{} `json:"commands"`
// Domain dependencies.
Dependencies []string `json:"dependencies"`
// Available events.
Events []map[string]interface{} `json:"events"`
// Whether this domain is experimental.
Experimental bool `json:"experimental"`
// Type definitions.
Types []map[string]interface{} `json:"types"`
JSON devtoolBrowserProtocolResponseDomainJSON `json:"-"`
}
func (*DevtoolBrowserProtocolResponseDomain) UnmarshalJSON ¶
func (r *DevtoolBrowserProtocolResponseDomain) UnmarshalJSON(data []byte) (err error)
type DevtoolBrowserProtocolResponseVersion ¶
type DevtoolBrowserProtocolResponseVersion struct {
// Major version.
Major string `json:"major" api:"required"`
// Minor version.
Minor string `json:"minor" api:"required"`
JSON devtoolBrowserProtocolResponseVersionJSON `json:"-"`
}
Protocol version.
func (*DevtoolBrowserProtocolResponseVersion) UnmarshalJSON ¶
func (r *DevtoolBrowserProtocolResponseVersion) UnmarshalJSON(data []byte) (err error)
type DevtoolBrowserService ¶
type DevtoolBrowserService struct {
Options []option.RequestOption
Page *DevtoolBrowserPageService
Targets *DevtoolBrowserTargetService
}
DevtoolBrowserService 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 NewDevtoolBrowserService method instead.
func NewDevtoolBrowserService ¶
func NewDevtoolBrowserService(opts ...option.RequestOption) (r *DevtoolBrowserService)
NewDevtoolBrowserService 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 (*DevtoolBrowserService) Connect ¶
func (r *DevtoolBrowserService) Connect(ctx context.Context, sessionID string, params DevtoolBrowserConnectParams, opts ...option.RequestOption) (err error)
Establishes a WebSocket connection to an existing browser session.
func (*DevtoolBrowserService) Delete ¶
func (r *DevtoolBrowserService) Delete(ctx context.Context, sessionID string, body DevtoolBrowserDeleteParams, opts ...option.RequestOption) (res *DevtoolBrowserDeleteResponse, err error)
Closes an existing browser session.
func (*DevtoolBrowserService) Launch ¶
func (r *DevtoolBrowserService) Launch(ctx context.Context, params DevtoolBrowserLaunchParams, opts ...option.RequestOption) (err error)
Acquires and establishes a WebSocket connection to a browser session.
func (*DevtoolBrowserService) New ¶
func (r *DevtoolBrowserService) New(ctx context.Context, params DevtoolBrowserNewParams, opts ...option.RequestOption) (res *DevtoolBrowserNewResponse, err error)
Acquires a browser and returns its session ID and websocket URL.
func (*DevtoolBrowserService) Protocol ¶
func (r *DevtoolBrowserService) Protocol(ctx context.Context, sessionID string, query DevtoolBrowserProtocolParams, opts ...option.RequestOption) (res *DevtoolBrowserProtocolResponse, err error)
Returns the complete Chrome DevTools Protocol schema including all domains, commands, events, and types. This schema describes the entire CDP API surface.
func (*DevtoolBrowserService) Version ¶
func (r *DevtoolBrowserService) Version(ctx context.Context, sessionID string, query DevtoolBrowserVersionParams, opts ...option.RequestOption) (res *DevtoolBrowserVersionResponse, err error)
Get browser version metadata.
type DevtoolBrowserTargetActivateResponse ¶
type DevtoolBrowserTargetActivateResponse struct {
// Target activated.
Message string `json:"message" api:"required"`
JSON devtoolBrowserTargetActivateResponseJSON `json:"-"`
}
func (*DevtoolBrowserTargetActivateResponse) UnmarshalJSON ¶
func (r *DevtoolBrowserTargetActivateResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolBrowserTargetCloseResponse ¶
type DevtoolBrowserTargetCloseResponse struct {
// Target is closing.
Message string `json:"message" api:"required"`
JSON devtoolBrowserTargetCloseResponseJSON `json:"-"`
}
func (*DevtoolBrowserTargetCloseResponse) UnmarshalJSON ¶
func (r *DevtoolBrowserTargetCloseResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolBrowserTargetGetResponse ¶
type DevtoolBrowserTargetGetResponse struct {
// Target ID.
ID string `json:"id" api:"required"`
// Target type (page, background_page, worker, etc.).
Type string `json:"type" api:"required"`
// URL of the target.
URL string `json:"url" api:"required"`
// Target description.
Description string `json:"description"`
// DevTools frontend URL.
DevtoolsFrontendURL string `json:"devtoolsFrontendUrl"`
// Title of the target.
Title string `json:"title"`
// WebSocket URL for debugging this target.
WebSocketDebuggerURL string `json:"webSocketDebuggerUrl"`
JSON devtoolBrowserTargetGetResponseJSON `json:"-"`
}
func (*DevtoolBrowserTargetGetResponse) UnmarshalJSON ¶
func (r *DevtoolBrowserTargetGetResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolBrowserTargetListParams ¶
type DevtoolBrowserTargetListParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// How long the live view URLs remain valid, in milliseconds (max 60 minutes)
LiveViewURLExpiresInMs param.Field[float64] `query:"liveViewUrlExpiresInMs"`
}
func (DevtoolBrowserTargetListParams) URLQuery ¶ added in v7.7.0
func (r DevtoolBrowserTargetListParams) URLQuery() (v url.Values)
URLQuery serializes DevtoolBrowserTargetListParams's query parameters as `url.Values`.
type DevtoolBrowserTargetListResponse ¶
type DevtoolBrowserTargetListResponse struct {
// Target ID.
ID string `json:"id" api:"required"`
// Target type (page, background_page, worker, etc.).
Type string `json:"type" api:"required"`
// URL of the target.
URL string `json:"url" api:"required"`
// Target description.
Description string `json:"description"`
// DevTools frontend URL.
DevtoolsFrontendURL string `json:"devtoolsFrontendUrl"`
// Title of the target.
Title string `json:"title"`
// WebSocket URL for debugging this target.
WebSocketDebuggerURL string `json:"webSocketDebuggerUrl"`
JSON devtoolBrowserTargetListResponseJSON `json:"-"`
}
func (*DevtoolBrowserTargetListResponse) UnmarshalJSON ¶
func (r *DevtoolBrowserTargetListResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolBrowserTargetNewParams ¶
type DevtoolBrowserTargetNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// How long the live view URL remains valid, in milliseconds (max 60 minutes)
LiveViewURLExpiresInMs param.Field[float64] `query:"liveViewUrlExpiresInMs"`
URL param.Field[string] `query:"url" format:"uri"`
}
func (DevtoolBrowserTargetNewParams) URLQuery ¶
func (r DevtoolBrowserTargetNewParams) URLQuery() (v url.Values)
URLQuery serializes DevtoolBrowserTargetNewParams's query parameters as `url.Values`.
type DevtoolBrowserTargetNewResponse ¶
type DevtoolBrowserTargetNewResponse struct {
// Target ID.
ID string `json:"id" api:"required"`
// Target type (page, background_page, worker, etc.).
Type string `json:"type" api:"required"`
// URL of the target.
URL string `json:"url" api:"required"`
// Target description.
Description string `json:"description"`
// DevTools frontend URL.
DevtoolsFrontendURL string `json:"devtoolsFrontendUrl"`
// Title of the target.
Title string `json:"title"`
// WebSocket URL for debugging this target.
WebSocketDebuggerURL string `json:"webSocketDebuggerUrl"`
JSON devtoolBrowserTargetNewResponseJSON `json:"-"`
}
func (*DevtoolBrowserTargetNewResponse) UnmarshalJSON ¶
func (r *DevtoolBrowserTargetNewResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolBrowserTargetService ¶
type DevtoolBrowserTargetService struct {
Options []option.RequestOption
}
DevtoolBrowserTargetService 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 NewDevtoolBrowserTargetService method instead.
func NewDevtoolBrowserTargetService ¶
func NewDevtoolBrowserTargetService(opts ...option.RequestOption) (r *DevtoolBrowserTargetService)
NewDevtoolBrowserTargetService 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 (*DevtoolBrowserTargetService) Activate ¶
func (r *DevtoolBrowserTargetService) Activate(ctx context.Context, sessionID string, targetID string, query DevtoolBrowserTargetActivateParams, opts ...option.RequestOption) (res *DevtoolBrowserTargetActivateResponse, err error)
Activates (brings to front) a specific browser target by its ID.
func (*DevtoolBrowserTargetService) Close ¶
func (r *DevtoolBrowserTargetService) Close(ctx context.Context, sessionID string, targetID string, query DevtoolBrowserTargetCloseParams, opts ...option.RequestOption) (res *DevtoolBrowserTargetCloseResponse, err error)
Closes a specific browser target (tab, page, etc.) by its ID. Returns 'Target is closing' on success or an error if the target is not found.
func (*DevtoolBrowserTargetService) Get ¶
func (r *DevtoolBrowserTargetService) Get(ctx context.Context, sessionID string, targetID string, query DevtoolBrowserTargetGetParams, opts ...option.RequestOption) (res *DevtoolBrowserTargetGetResponse, err error)
Returns the debuggable target with the given ID.
func (*DevtoolBrowserTargetService) List ¶
func (r *DevtoolBrowserTargetService) List(ctx context.Context, sessionID string, params DevtoolBrowserTargetListParams, opts ...option.RequestOption) (res *[]DevtoolBrowserTargetListResponse, err error)
Returns a list of all debuggable targets including tabs, pages, service workers, and other browser contexts.
func (*DevtoolBrowserTargetService) New ¶
func (r *DevtoolBrowserTargetService) New(ctx context.Context, sessionID string, params DevtoolBrowserTargetNewParams, opts ...option.RequestOption) (res *DevtoolBrowserTargetNewResponse, err error)
Opens a new tab in the browser. Optionally specify a URL to navigate to.
type DevtoolBrowserVersionResponse ¶
type DevtoolBrowserVersionResponse struct {
// Browser name and version.
Browser string `json:"Browser" api:"required"`
// Chrome DevTools Protocol version.
ProtocolVersion string `json:"Protocol-Version" api:"required"`
// User agent string.
UserAgent string `json:"User-Agent" api:"required"`
// V8 JavaScript engine version.
V8Version string `json:"V8-Version" api:"required"`
// WebKit version.
WebKitVersion string `json:"WebKit-Version" api:"required"`
// WebSocket URL for debugging the browser.
WebSocketDebuggerURL string `json:"webSocketDebuggerUrl" api:"required"`
JSON devtoolBrowserVersionResponseJSON `json:"-"`
}
func (*DevtoolBrowserVersionResponse) UnmarshalJSON ¶
func (r *DevtoolBrowserVersionResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolService ¶
type DevtoolService struct {
Options []option.RequestOption
Session *DevtoolSessionService
Browser *DevtoolBrowserService
}
DevtoolService 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 NewDevtoolService method instead.
func NewDevtoolService ¶
func NewDevtoolService(opts ...option.RequestOption) (r *DevtoolService)
NewDevtoolService 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 DevtoolSessionGetParams ¶
type DevtoolSessionGetResponse ¶
type DevtoolSessionGetResponse struct {
// Session ID.
SessionID string `json:"sessionId" api:"required" format:"uuid"`
// Reason for session closure.
CloseReason string `json:"closeReason"`
// Human-readable close reason.
CloseReasonText string `json:"closeReasonText"`
// Connection end time.
ConnectionEndTime float64 `json:"connectionEndTime"`
// Connection ID.
ConnectionID string `json:"connectionId"`
// Connection start time.
ConnectionStartTime float64 `json:"connectionStartTime"`
// DevTools frontend URL.
DevtoolsFrontendURL string `json:"devtoolsFrontendUrl"`
// Session end time.
EndTime float64 `json:"endTime"`
// Last updated timestamp.
LastUpdated float64 `json:"lastUpdated"`
// Session start time.
StartTime float64 `json:"startTime"`
// WebSocket URL for debugging this target.
WebSocketDebuggerURL string `json:"webSocketDebuggerUrl"`
JSON devtoolSessionGetResponseJSON `json:"-"`
}
func (*DevtoolSessionGetResponse) UnmarshalJSON ¶
func (r *DevtoolSessionGetResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolSessionListParams ¶
type DevtoolSessionListParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
Limit param.Field[float64] `query:"limit"`
Offset param.Field[float64] `query:"offset"`
}
func (DevtoolSessionListParams) URLQuery ¶
func (r DevtoolSessionListParams) URLQuery() (v url.Values)
URLQuery serializes DevtoolSessionListParams's query parameters as `url.Values`.
type DevtoolSessionListResponse ¶
type DevtoolSessionListResponse struct {
// Session ID.
SessionID string `json:"sessionId" api:"required" format:"uuid"`
// Reason for session closure.
CloseReason string `json:"closeReason"`
// Human-readable close reason.
CloseReasonText string `json:"closeReasonText"`
// Connection end time.
ConnectionEndTime float64 `json:"connectionEndTime"`
// Connection ID.
ConnectionID string `json:"connectionId"`
// Connection start time.
ConnectionStartTime float64 `json:"connectionStartTime"`
// DevTools frontend URL.
DevtoolsFrontendURL string `json:"devtoolsFrontendUrl"`
// Session end time.
EndTime float64 `json:"endTime"`
// Last updated timestamp.
LastUpdated float64 `json:"lastUpdated"`
// Session start time.
StartTime float64 `json:"startTime"`
// WebSocket URL for debugging this target.
WebSocketDebuggerURL string `json:"webSocketDebuggerUrl"`
JSON devtoolSessionListResponseJSON `json:"-"`
}
func (*DevtoolSessionListResponse) UnmarshalJSON ¶
func (r *DevtoolSessionListResponse) UnmarshalJSON(data []byte) (err error)
type DevtoolSessionService ¶
type DevtoolSessionService struct {
Options []option.RequestOption
}
DevtoolSessionService 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 NewDevtoolSessionService method instead.
func NewDevtoolSessionService ¶
func NewDevtoolSessionService(opts ...option.RequestOption) (r *DevtoolSessionService)
NewDevtoolSessionService 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 (*DevtoolSessionService) Get ¶
func (r *DevtoolSessionService) Get(ctx context.Context, sessionID string, query DevtoolSessionGetParams, opts ...option.RequestOption) (res *DevtoolSessionGetResponse, err error)
Get details for a specific browser session.
func (*DevtoolSessionService) List ¶
func (r *DevtoolSessionService) List(ctx context.Context, params DevtoolSessionListParams, opts ...option.RequestOption) (res *[]DevtoolSessionListResponse, err error)
List active browser sessions.
type ErrorDataSource ¶
type ErrorDataSource = shared.ErrorDataSource
This is an alias to an internal type.
type JsonNewParams ¶
type JsonNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]JsonNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]JsonNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]JsonNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[JsonNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]JsonNewParamsCookie] `json:"cookies"`
// Optional list of custom AI models to use for the request. The models will be
// tried in the order provided, and in case a model returns an error, the next one
// will be used as fallback.
CustomAI param.Field[[]JsonNewParamsCustomAI] `json:"custom_ai"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[JsonNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
Prompt param.Field[string] `json:"prompt"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]JsonNewParamsRejectResourceType] `json:"rejectResourceTypes"`
ResponseFormat param.Field[JsonNewParamsResponseFormat] `json:"response_format"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[JsonNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[JsonNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (JsonNewParams) MarshalJSON ¶
func (r JsonNewParams) MarshalJSON() (data []byte, err error)
func (JsonNewParams) URLQuery ¶
func (r JsonNewParams) URLQuery() (v url.Values)
URLQuery serializes JsonNewParams's query parameters as `url.Values`.
type JsonNewParamsAddScriptTag ¶ added in v7.8.0
type JsonNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (JsonNewParamsAddScriptTag) MarshalJSON ¶ added in v7.8.0
func (r JsonNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type JsonNewParamsAddStyleTag ¶ added in v7.8.0
type JsonNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (JsonNewParamsAddStyleTag) MarshalJSON ¶ added in v7.8.0
func (r JsonNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type JsonNewParamsAllowResourceType ¶ added in v7.8.0
type JsonNewParamsAllowResourceType string
const ( JsonNewParamsAllowResourceTypeDocument JsonNewParamsAllowResourceType = "document" JsonNewParamsAllowResourceTypeStylesheet JsonNewParamsAllowResourceType = "stylesheet" JsonNewParamsAllowResourceTypeImage JsonNewParamsAllowResourceType = "image" JsonNewParamsAllowResourceTypeMedia JsonNewParamsAllowResourceType = "media" JsonNewParamsAllowResourceTypeFont JsonNewParamsAllowResourceType = "font" JsonNewParamsAllowResourceTypeScript JsonNewParamsAllowResourceType = "script" JsonNewParamsAllowResourceTypeTexttrack JsonNewParamsAllowResourceType = "texttrack" JsonNewParamsAllowResourceTypeXHR JsonNewParamsAllowResourceType = "xhr" JsonNewParamsAllowResourceTypeFetch JsonNewParamsAllowResourceType = "fetch" JsonNewParamsAllowResourceTypePrefetch JsonNewParamsAllowResourceType = "prefetch" JsonNewParamsAllowResourceTypeEventsource JsonNewParamsAllowResourceType = "eventsource" JsonNewParamsAllowResourceTypeWebsocket JsonNewParamsAllowResourceType = "websocket" JsonNewParamsAllowResourceTypeManifest JsonNewParamsAllowResourceType = "manifest" JsonNewParamsAllowResourceTypeSignedexchange JsonNewParamsAllowResourceType = "signedexchange" JsonNewParamsAllowResourceTypePing JsonNewParamsAllowResourceType = "ping" JsonNewParamsAllowResourceTypeCspviolationreport JsonNewParamsAllowResourceType = "cspviolationreport" JsonNewParamsAllowResourceTypePreflight JsonNewParamsAllowResourceType = "preflight" JsonNewParamsAllowResourceTypeOther JsonNewParamsAllowResourceType = "other" )
func (JsonNewParamsAllowResourceType) IsKnown ¶ added in v7.8.0
func (r JsonNewParamsAllowResourceType) IsKnown() bool
type JsonNewParamsAuthenticate ¶ added in v7.8.0
type JsonNewParamsAuthenticate struct {
Password param.Field[string] `json:"password" api:"required"`
Username param.Field[string] `json:"username" api:"required"`
}
Provide credentials for HTTP authentication.
func (JsonNewParamsAuthenticate) MarshalJSON ¶ added in v7.8.0
func (r JsonNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type JsonNewParamsCookie ¶ added in v7.8.0
type JsonNewParamsCookie struct {
// Cookie name.
Name param.Field[string] `json:"name" api:"required"`
Value param.Field[string] `json:"value" api:"required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[JsonNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[JsonNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[JsonNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (JsonNewParamsCookie) MarshalJSON ¶ added in v7.8.0
func (r JsonNewParamsCookie) MarshalJSON() (data []byte, err error)
type JsonNewParamsCookiesPriority ¶ added in v7.8.0
type JsonNewParamsCookiesPriority string
const ( JsonNewParamsCookiesPriorityLow JsonNewParamsCookiesPriority = "Low" JsonNewParamsCookiesPriorityMedium JsonNewParamsCookiesPriority = "Medium" JsonNewParamsCookiesPriorityHigh JsonNewParamsCookiesPriority = "High" )
func (JsonNewParamsCookiesPriority) IsKnown ¶ added in v7.8.0
func (r JsonNewParamsCookiesPriority) IsKnown() bool
type JsonNewParamsCookiesSameSite ¶ added in v7.8.0
type JsonNewParamsCookiesSameSite string
const ( JsonNewParamsCookiesSameSiteStrict JsonNewParamsCookiesSameSite = "Strict" JsonNewParamsCookiesSameSiteLax JsonNewParamsCookiesSameSite = "Lax" JsonNewParamsCookiesSameSiteNone JsonNewParamsCookiesSameSite = "None" )
func (JsonNewParamsCookiesSameSite) IsKnown ¶ added in v7.8.0
func (r JsonNewParamsCookiesSameSite) IsKnown() bool
type JsonNewParamsCookiesSourceScheme ¶ added in v7.8.0
type JsonNewParamsCookiesSourceScheme string
const ( JsonNewParamsCookiesSourceSchemeUnset JsonNewParamsCookiesSourceScheme = "Unset" JsonNewParamsCookiesSourceSchemeNonSecure JsonNewParamsCookiesSourceScheme = "NonSecure" JsonNewParamsCookiesSourceSchemeSecure JsonNewParamsCookiesSourceScheme = "Secure" )
func (JsonNewParamsCookiesSourceScheme) IsKnown ¶ added in v7.8.0
func (r JsonNewParamsCookiesSourceScheme) IsKnown() bool
type JsonNewParamsCustomAI ¶ added in v7.8.0
type JsonNewParamsCustomAI struct {
// AI model to use for the request. Must be formed as `<provider>/<model_name>`,
// e.g. `workers-ai/@cf/meta/llama-3.3-70b-instruct-fp8-fast`.
Model param.Field[string] `json:"model" api:"required"`
// Authorization token for the AI model: `Bearer <token>`. Not needed for
// workers-ai models.
Authorization param.Field[string] `json:"authorization"`
}
func (JsonNewParamsCustomAI) MarshalJSON ¶ added in v7.8.0
func (r JsonNewParamsCustomAI) MarshalJSON() (data []byte, err error)
type JsonNewParamsGotoOptions ¶ added in v7.8.0
type JsonNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[JsonNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (JsonNewParamsGotoOptions) MarshalJSON ¶ added in v7.8.0
func (r JsonNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type JsonNewParamsGotoOptionsWaitUntilArray ¶ added in v7.8.0
type JsonNewParamsGotoOptionsWaitUntilArray []JsonNewParamsGotoOptionsWaitUntilArrayItem
type JsonNewParamsGotoOptionsWaitUntilArrayItem ¶ added in v7.8.0
type JsonNewParamsGotoOptionsWaitUntilArrayItem string
const ( JsonNewParamsGotoOptionsWaitUntilArrayItemLoad JsonNewParamsGotoOptionsWaitUntilArrayItem = "load" JsonNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded JsonNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" JsonNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 JsonNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" JsonNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 JsonNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (JsonNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶ added in v7.8.0
func (r JsonNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type JsonNewParamsGotoOptionsWaitUntilString ¶ added in v7.8.0
type JsonNewParamsGotoOptionsWaitUntilString string
const ( JsonNewParamsGotoOptionsWaitUntilStringLoad JsonNewParamsGotoOptionsWaitUntilString = "load" JsonNewParamsGotoOptionsWaitUntilStringDomcontentloaded JsonNewParamsGotoOptionsWaitUntilString = "domcontentloaded" JsonNewParamsGotoOptionsWaitUntilStringNetworkidle0 JsonNewParamsGotoOptionsWaitUntilString = "networkidle0" JsonNewParamsGotoOptionsWaitUntilStringNetworkidle2 JsonNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (JsonNewParamsGotoOptionsWaitUntilString) IsKnown ¶ added in v7.8.0
func (r JsonNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type JsonNewParamsGotoOptionsWaitUntilUnion ¶ added in v7.8.0
type JsonNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.JsonNewParamsGotoOptionsWaitUntilString, browser_rendering.JsonNewParamsGotoOptionsWaitUntilArray.
type JsonNewParamsRejectResourceType ¶ added in v7.8.0
type JsonNewParamsRejectResourceType string
const ( JsonNewParamsRejectResourceTypeDocument JsonNewParamsRejectResourceType = "document" JsonNewParamsRejectResourceTypeStylesheet JsonNewParamsRejectResourceType = "stylesheet" JsonNewParamsRejectResourceTypeImage JsonNewParamsRejectResourceType = "image" JsonNewParamsRejectResourceTypeMedia JsonNewParamsRejectResourceType = "media" JsonNewParamsRejectResourceTypeFont JsonNewParamsRejectResourceType = "font" JsonNewParamsRejectResourceTypeScript JsonNewParamsRejectResourceType = "script" JsonNewParamsRejectResourceTypeTexttrack JsonNewParamsRejectResourceType = "texttrack" JsonNewParamsRejectResourceTypeXHR JsonNewParamsRejectResourceType = "xhr" JsonNewParamsRejectResourceTypeFetch JsonNewParamsRejectResourceType = "fetch" JsonNewParamsRejectResourceTypePrefetch JsonNewParamsRejectResourceType = "prefetch" JsonNewParamsRejectResourceTypeEventsource JsonNewParamsRejectResourceType = "eventsource" JsonNewParamsRejectResourceTypeWebsocket JsonNewParamsRejectResourceType = "websocket" JsonNewParamsRejectResourceTypeManifest JsonNewParamsRejectResourceType = "manifest" JsonNewParamsRejectResourceTypeSignedexchange JsonNewParamsRejectResourceType = "signedexchange" JsonNewParamsRejectResourceTypePing JsonNewParamsRejectResourceType = "ping" JsonNewParamsRejectResourceTypeCspviolationreport JsonNewParamsRejectResourceType = "cspviolationreport" JsonNewParamsRejectResourceTypePreflight JsonNewParamsRejectResourceType = "preflight" JsonNewParamsRejectResourceTypeOther JsonNewParamsRejectResourceType = "other" )
func (JsonNewParamsRejectResourceType) IsKnown ¶ added in v7.8.0
func (r JsonNewParamsRejectResourceType) IsKnown() bool
type JsonNewParamsResponseFormat ¶ added in v7.8.0
type JsonNewParamsResponseFormat struct {
Type param.Field[string] `json:"type" api:"required"`
// Schema for the response format. More information here:
// https://developers.cloudflare.com/workers-ai/json-mode/
JsonSchema param.Field[map[string]JsonNewParamsResponseFormatJsonSchemaUnion] `json:"json_schema"`
}
func (JsonNewParamsResponseFormat) MarshalJSON ¶ added in v7.8.0
func (r JsonNewParamsResponseFormat) MarshalJSON() (data []byte, err error)
type JsonNewParamsResponseFormatJsonSchemaArray ¶ added in v7.8.0
type JsonNewParamsResponseFormatJsonSchemaArray []string
func (JsonNewParamsResponseFormatJsonSchemaArray) ImplementsJsonNewParamsResponseFormatJsonSchemaUnion ¶ added in v7.8.0
func (r JsonNewParamsResponseFormatJsonSchemaArray) ImplementsJsonNewParamsResponseFormatJsonSchemaUnion()
type JsonNewParamsResponseFormatJsonSchemaUnion ¶ added in v7.8.0
type JsonNewParamsResponseFormatJsonSchemaUnion interface {
ImplementsJsonNewParamsResponseFormatJsonSchemaUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat, shared.UnionBool, browser_rendering.JsonNewParamsResponseFormatJsonSchemaArray.
Use [Raw()] to specify an arbitrary value for this param
type JsonNewParamsViewport ¶ added in v7.8.0
type JsonNewParamsViewport struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (JsonNewParamsViewport) MarshalJSON ¶ added in v7.8.0
func (r JsonNewParamsViewport) MarshalJSON() (data []byte, err error)
type JsonNewParamsWaitForSelector ¶ added in v7.8.0
type JsonNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector" api:"required"`
Hidden param.Field[JsonNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[JsonNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (JsonNewParamsWaitForSelector) MarshalJSON ¶ added in v7.8.0
func (r JsonNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type JsonNewParamsWaitForSelectorHidden ¶ added in v7.8.0
type JsonNewParamsWaitForSelectorHidden bool
const (
JsonNewParamsWaitForSelectorHiddenTrue JsonNewParamsWaitForSelectorHidden = true
)
func (JsonNewParamsWaitForSelectorHidden) IsKnown ¶ added in v7.8.0
func (r JsonNewParamsWaitForSelectorHidden) IsKnown() bool
type JsonNewParamsWaitForSelectorVisible ¶ added in v7.8.0
type JsonNewParamsWaitForSelectorVisible bool
const (
JsonNewParamsWaitForSelectorVisibleTrue JsonNewParamsWaitForSelectorVisible = true
)
func (JsonNewParamsWaitForSelectorVisible) IsKnown ¶ added in v7.8.0
func (r JsonNewParamsWaitForSelectorVisible) IsKnown() bool
type JsonNewResponse ¶
type JsonNewResponse map[string]interface{}
type JsonNewResponseEnvelope ¶
type JsonNewResponseEnvelope struct {
Result JsonNewResponse `json:"result" api:"required"`
// Response status.
Success bool `json:"success" api:"required"`
Errors []JsonNewResponseEnvelopeErrors `json:"errors"`
JSON jsonNewResponseEnvelopeJSON `json:"-"`
}
func (*JsonNewResponseEnvelope) UnmarshalJSON ¶
func (r *JsonNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type JsonNewResponseEnvelopeErrors ¶
type JsonNewResponseEnvelopeErrors struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON jsonNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*JsonNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *JsonNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type JsonService ¶
type JsonService struct {
Options []option.RequestOption
}
JsonService 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 NewJsonService method instead.
func NewJsonService ¶
func NewJsonService(opts ...option.RequestOption) (r *JsonService)
NewJsonService 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 (*JsonService) New ¶
func (r *JsonService) New(ctx context.Context, params JsonNewParams, opts ...option.RequestOption) (res *JsonNewResponse, err error)
Gets json from a webpage from a provided URL or HTML. Pass `prompt` or `schema` in the body. Control page loading with `gotoOptions` and `waitFor*` options.
type LinkNewParams ¶
type LinkNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]LinkNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]LinkNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]LinkNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[LinkNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]LinkNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
ExcludeExternalLinks param.Field[bool] `json:"excludeExternalLinks"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[LinkNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]LinkNewParamsRejectResourceType] `json:"rejectResourceTypes"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[LinkNewParamsViewport] `json:"viewport"`
VisibleLinksOnly param.Field[bool] `json:"visibleLinksOnly"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[LinkNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (LinkNewParams) MarshalJSON ¶
func (r LinkNewParams) MarshalJSON() (data []byte, err error)
func (LinkNewParams) URLQuery ¶
func (r LinkNewParams) URLQuery() (v url.Values)
URLQuery serializes LinkNewParams's query parameters as `url.Values`.
type LinkNewParamsAddScriptTag ¶ added in v7.8.0
type LinkNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (LinkNewParamsAddScriptTag) MarshalJSON ¶ added in v7.8.0
func (r LinkNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type LinkNewParamsAddStyleTag ¶ added in v7.8.0
type LinkNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (LinkNewParamsAddStyleTag) MarshalJSON ¶ added in v7.8.0
func (r LinkNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type LinkNewParamsAllowResourceType ¶ added in v7.8.0
type LinkNewParamsAllowResourceType string
const ( LinkNewParamsAllowResourceTypeDocument LinkNewParamsAllowResourceType = "document" LinkNewParamsAllowResourceTypeStylesheet LinkNewParamsAllowResourceType = "stylesheet" LinkNewParamsAllowResourceTypeImage LinkNewParamsAllowResourceType = "image" LinkNewParamsAllowResourceTypeMedia LinkNewParamsAllowResourceType = "media" LinkNewParamsAllowResourceTypeFont LinkNewParamsAllowResourceType = "font" LinkNewParamsAllowResourceTypeScript LinkNewParamsAllowResourceType = "script" LinkNewParamsAllowResourceTypeTexttrack LinkNewParamsAllowResourceType = "texttrack" LinkNewParamsAllowResourceTypeXHR LinkNewParamsAllowResourceType = "xhr" LinkNewParamsAllowResourceTypeFetch LinkNewParamsAllowResourceType = "fetch" LinkNewParamsAllowResourceTypePrefetch LinkNewParamsAllowResourceType = "prefetch" LinkNewParamsAllowResourceTypeEventsource LinkNewParamsAllowResourceType = "eventsource" LinkNewParamsAllowResourceTypeWebsocket LinkNewParamsAllowResourceType = "websocket" LinkNewParamsAllowResourceTypeManifest LinkNewParamsAllowResourceType = "manifest" LinkNewParamsAllowResourceTypeSignedexchange LinkNewParamsAllowResourceType = "signedexchange" LinkNewParamsAllowResourceTypePing LinkNewParamsAllowResourceType = "ping" LinkNewParamsAllowResourceTypeCspviolationreport LinkNewParamsAllowResourceType = "cspviolationreport" LinkNewParamsAllowResourceTypePreflight LinkNewParamsAllowResourceType = "preflight" LinkNewParamsAllowResourceTypeOther LinkNewParamsAllowResourceType = "other" )
func (LinkNewParamsAllowResourceType) IsKnown ¶ added in v7.8.0
func (r LinkNewParamsAllowResourceType) IsKnown() bool
type LinkNewParamsAuthenticate ¶ added in v7.8.0
type LinkNewParamsAuthenticate struct {
Password param.Field[string] `json:"password" api:"required"`
Username param.Field[string] `json:"username" api:"required"`
}
Provide credentials for HTTP authentication.
func (LinkNewParamsAuthenticate) MarshalJSON ¶ added in v7.8.0
func (r LinkNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type LinkNewParamsCookie ¶ added in v7.8.0
type LinkNewParamsCookie struct {
// Cookie name.
Name param.Field[string] `json:"name" api:"required"`
Value param.Field[string] `json:"value" api:"required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[LinkNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[LinkNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[LinkNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (LinkNewParamsCookie) MarshalJSON ¶ added in v7.8.0
func (r LinkNewParamsCookie) MarshalJSON() (data []byte, err error)
type LinkNewParamsCookiesPriority ¶ added in v7.8.0
type LinkNewParamsCookiesPriority string
const ( LinkNewParamsCookiesPriorityLow LinkNewParamsCookiesPriority = "Low" LinkNewParamsCookiesPriorityMedium LinkNewParamsCookiesPriority = "Medium" LinkNewParamsCookiesPriorityHigh LinkNewParamsCookiesPriority = "High" )
func (LinkNewParamsCookiesPriority) IsKnown ¶ added in v7.8.0
func (r LinkNewParamsCookiesPriority) IsKnown() bool
type LinkNewParamsCookiesSameSite ¶ added in v7.8.0
type LinkNewParamsCookiesSameSite string
const ( LinkNewParamsCookiesSameSiteStrict LinkNewParamsCookiesSameSite = "Strict" LinkNewParamsCookiesSameSiteLax LinkNewParamsCookiesSameSite = "Lax" LinkNewParamsCookiesSameSiteNone LinkNewParamsCookiesSameSite = "None" )
func (LinkNewParamsCookiesSameSite) IsKnown ¶ added in v7.8.0
func (r LinkNewParamsCookiesSameSite) IsKnown() bool
type LinkNewParamsCookiesSourceScheme ¶ added in v7.8.0
type LinkNewParamsCookiesSourceScheme string
const ( LinkNewParamsCookiesSourceSchemeUnset LinkNewParamsCookiesSourceScheme = "Unset" LinkNewParamsCookiesSourceSchemeNonSecure LinkNewParamsCookiesSourceScheme = "NonSecure" LinkNewParamsCookiesSourceSchemeSecure LinkNewParamsCookiesSourceScheme = "Secure" )
func (LinkNewParamsCookiesSourceScheme) IsKnown ¶ added in v7.8.0
func (r LinkNewParamsCookiesSourceScheme) IsKnown() bool
type LinkNewParamsGotoOptions ¶ added in v7.8.0
type LinkNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[LinkNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (LinkNewParamsGotoOptions) MarshalJSON ¶ added in v7.8.0
func (r LinkNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type LinkNewParamsGotoOptionsWaitUntilArray ¶ added in v7.8.0
type LinkNewParamsGotoOptionsWaitUntilArray []LinkNewParamsGotoOptionsWaitUntilArrayItem
type LinkNewParamsGotoOptionsWaitUntilArrayItem ¶ added in v7.8.0
type LinkNewParamsGotoOptionsWaitUntilArrayItem string
const ( LinkNewParamsGotoOptionsWaitUntilArrayItemLoad LinkNewParamsGotoOptionsWaitUntilArrayItem = "load" LinkNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded LinkNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" LinkNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 LinkNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" LinkNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 LinkNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (LinkNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶ added in v7.8.0
func (r LinkNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type LinkNewParamsGotoOptionsWaitUntilString ¶ added in v7.8.0
type LinkNewParamsGotoOptionsWaitUntilString string
const ( LinkNewParamsGotoOptionsWaitUntilStringLoad LinkNewParamsGotoOptionsWaitUntilString = "load" LinkNewParamsGotoOptionsWaitUntilStringDomcontentloaded LinkNewParamsGotoOptionsWaitUntilString = "domcontentloaded" LinkNewParamsGotoOptionsWaitUntilStringNetworkidle0 LinkNewParamsGotoOptionsWaitUntilString = "networkidle0" LinkNewParamsGotoOptionsWaitUntilStringNetworkidle2 LinkNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (LinkNewParamsGotoOptionsWaitUntilString) IsKnown ¶ added in v7.8.0
func (r LinkNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type LinkNewParamsGotoOptionsWaitUntilUnion ¶ added in v7.8.0
type LinkNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.LinkNewParamsGotoOptionsWaitUntilString, browser_rendering.LinkNewParamsGotoOptionsWaitUntilArray.
type LinkNewParamsRejectResourceType ¶ added in v7.8.0
type LinkNewParamsRejectResourceType string
const ( LinkNewParamsRejectResourceTypeDocument LinkNewParamsRejectResourceType = "document" LinkNewParamsRejectResourceTypeStylesheet LinkNewParamsRejectResourceType = "stylesheet" LinkNewParamsRejectResourceTypeImage LinkNewParamsRejectResourceType = "image" LinkNewParamsRejectResourceTypeMedia LinkNewParamsRejectResourceType = "media" LinkNewParamsRejectResourceTypeFont LinkNewParamsRejectResourceType = "font" LinkNewParamsRejectResourceTypeScript LinkNewParamsRejectResourceType = "script" LinkNewParamsRejectResourceTypeTexttrack LinkNewParamsRejectResourceType = "texttrack" LinkNewParamsRejectResourceTypeXHR LinkNewParamsRejectResourceType = "xhr" LinkNewParamsRejectResourceTypeFetch LinkNewParamsRejectResourceType = "fetch" LinkNewParamsRejectResourceTypePrefetch LinkNewParamsRejectResourceType = "prefetch" LinkNewParamsRejectResourceTypeEventsource LinkNewParamsRejectResourceType = "eventsource" LinkNewParamsRejectResourceTypeWebsocket LinkNewParamsRejectResourceType = "websocket" LinkNewParamsRejectResourceTypeManifest LinkNewParamsRejectResourceType = "manifest" LinkNewParamsRejectResourceTypeSignedexchange LinkNewParamsRejectResourceType = "signedexchange" LinkNewParamsRejectResourceTypePing LinkNewParamsRejectResourceType = "ping" LinkNewParamsRejectResourceTypeCspviolationreport LinkNewParamsRejectResourceType = "cspviolationreport" LinkNewParamsRejectResourceTypePreflight LinkNewParamsRejectResourceType = "preflight" LinkNewParamsRejectResourceTypeOther LinkNewParamsRejectResourceType = "other" )
func (LinkNewParamsRejectResourceType) IsKnown ¶ added in v7.8.0
func (r LinkNewParamsRejectResourceType) IsKnown() bool
type LinkNewParamsViewport ¶ added in v7.8.0
type LinkNewParamsViewport struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (LinkNewParamsViewport) MarshalJSON ¶ added in v7.8.0
func (r LinkNewParamsViewport) MarshalJSON() (data []byte, err error)
type LinkNewParamsWaitForSelector ¶ added in v7.8.0
type LinkNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector" api:"required"`
Hidden param.Field[LinkNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[LinkNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (LinkNewParamsWaitForSelector) MarshalJSON ¶ added in v7.8.0
func (r LinkNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type LinkNewParamsWaitForSelectorHidden ¶ added in v7.8.0
type LinkNewParamsWaitForSelectorHidden bool
const (
LinkNewParamsWaitForSelectorHiddenTrue LinkNewParamsWaitForSelectorHidden = true
)
func (LinkNewParamsWaitForSelectorHidden) IsKnown ¶ added in v7.8.0
func (r LinkNewParamsWaitForSelectorHidden) IsKnown() bool
type LinkNewParamsWaitForSelectorVisible ¶ added in v7.8.0
type LinkNewParamsWaitForSelectorVisible bool
const (
LinkNewParamsWaitForSelectorVisibleTrue LinkNewParamsWaitForSelectorVisible = true
)
func (LinkNewParamsWaitForSelectorVisible) IsKnown ¶ added in v7.8.0
func (r LinkNewParamsWaitForSelectorVisible) IsKnown() bool
type LinkNewResponseEnvelope ¶
type LinkNewResponseEnvelope struct {
Result []string `json:"result" api:"required"`
// Response status.
Success bool `json:"success" api:"required"`
Errors []LinkNewResponseEnvelopeErrors `json:"errors"`
JSON linkNewResponseEnvelopeJSON `json:"-"`
}
func (*LinkNewResponseEnvelope) UnmarshalJSON ¶
func (r *LinkNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type LinkNewResponseEnvelopeErrors ¶
type LinkNewResponseEnvelopeErrors struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON linkNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*LinkNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *LinkNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type LinkService ¶
type LinkService struct {
Options []option.RequestOption
}
LinkService 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 NewLinkService method instead.
func NewLinkService ¶
func NewLinkService(opts ...option.RequestOption) (r *LinkService)
NewLinkService 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 (*LinkService) New ¶
func (r *LinkService) New(ctx context.Context, params LinkNewParams, opts ...option.RequestOption) (res *[]string, err error)
Get links from a web page.
type MarkdownNewParams ¶
type MarkdownNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]MarkdownNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]MarkdownNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]MarkdownNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[MarkdownNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]MarkdownNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[MarkdownNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]MarkdownNewParamsRejectResourceType] `json:"rejectResourceTypes"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[MarkdownNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[MarkdownNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (MarkdownNewParams) MarshalJSON ¶
func (r MarkdownNewParams) MarshalJSON() (data []byte, err error)
func (MarkdownNewParams) URLQuery ¶
func (r MarkdownNewParams) URLQuery() (v url.Values)
URLQuery serializes MarkdownNewParams's query parameters as `url.Values`.
type MarkdownNewParamsAddScriptTag ¶ added in v7.8.0
type MarkdownNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (MarkdownNewParamsAddScriptTag) MarshalJSON ¶ added in v7.8.0
func (r MarkdownNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsAddStyleTag ¶ added in v7.8.0
type MarkdownNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (MarkdownNewParamsAddStyleTag) MarshalJSON ¶ added in v7.8.0
func (r MarkdownNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsAllowResourceType ¶ added in v7.8.0
type MarkdownNewParamsAllowResourceType string
const ( MarkdownNewParamsAllowResourceTypeDocument MarkdownNewParamsAllowResourceType = "document" MarkdownNewParamsAllowResourceTypeStylesheet MarkdownNewParamsAllowResourceType = "stylesheet" MarkdownNewParamsAllowResourceTypeImage MarkdownNewParamsAllowResourceType = "image" MarkdownNewParamsAllowResourceTypeMedia MarkdownNewParamsAllowResourceType = "media" MarkdownNewParamsAllowResourceTypeFont MarkdownNewParamsAllowResourceType = "font" MarkdownNewParamsAllowResourceTypeScript MarkdownNewParamsAllowResourceType = "script" MarkdownNewParamsAllowResourceTypeTexttrack MarkdownNewParamsAllowResourceType = "texttrack" MarkdownNewParamsAllowResourceTypeXHR MarkdownNewParamsAllowResourceType = "xhr" MarkdownNewParamsAllowResourceTypeFetch MarkdownNewParamsAllowResourceType = "fetch" MarkdownNewParamsAllowResourceTypePrefetch MarkdownNewParamsAllowResourceType = "prefetch" MarkdownNewParamsAllowResourceTypeEventsource MarkdownNewParamsAllowResourceType = "eventsource" MarkdownNewParamsAllowResourceTypeWebsocket MarkdownNewParamsAllowResourceType = "websocket" MarkdownNewParamsAllowResourceTypeManifest MarkdownNewParamsAllowResourceType = "manifest" MarkdownNewParamsAllowResourceTypeSignedexchange MarkdownNewParamsAllowResourceType = "signedexchange" MarkdownNewParamsAllowResourceTypePing MarkdownNewParamsAllowResourceType = "ping" MarkdownNewParamsAllowResourceTypeCspviolationreport MarkdownNewParamsAllowResourceType = "cspviolationreport" MarkdownNewParamsAllowResourceTypePreflight MarkdownNewParamsAllowResourceType = "preflight" MarkdownNewParamsAllowResourceTypeOther MarkdownNewParamsAllowResourceType = "other" )
func (MarkdownNewParamsAllowResourceType) IsKnown ¶ added in v7.8.0
func (r MarkdownNewParamsAllowResourceType) IsKnown() bool
type MarkdownNewParamsAuthenticate ¶ added in v7.8.0
type MarkdownNewParamsAuthenticate struct {
Password param.Field[string] `json:"password" api:"required"`
Username param.Field[string] `json:"username" api:"required"`
}
Provide credentials for HTTP authentication.
func (MarkdownNewParamsAuthenticate) MarshalJSON ¶ added in v7.8.0
func (r MarkdownNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsCookie ¶ added in v7.8.0
type MarkdownNewParamsCookie struct {
// Cookie name.
Name param.Field[string] `json:"name" api:"required"`
Value param.Field[string] `json:"value" api:"required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[MarkdownNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[MarkdownNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[MarkdownNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (MarkdownNewParamsCookie) MarshalJSON ¶ added in v7.8.0
func (r MarkdownNewParamsCookie) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsCookiesPriority ¶ added in v7.8.0
type MarkdownNewParamsCookiesPriority string
const ( MarkdownNewParamsCookiesPriorityLow MarkdownNewParamsCookiesPriority = "Low" MarkdownNewParamsCookiesPriorityMedium MarkdownNewParamsCookiesPriority = "Medium" MarkdownNewParamsCookiesPriorityHigh MarkdownNewParamsCookiesPriority = "High" )
func (MarkdownNewParamsCookiesPriority) IsKnown ¶ added in v7.8.0
func (r MarkdownNewParamsCookiesPriority) IsKnown() bool
type MarkdownNewParamsCookiesSameSite ¶ added in v7.8.0
type MarkdownNewParamsCookiesSameSite string
const ( MarkdownNewParamsCookiesSameSiteStrict MarkdownNewParamsCookiesSameSite = "Strict" MarkdownNewParamsCookiesSameSiteLax MarkdownNewParamsCookiesSameSite = "Lax" MarkdownNewParamsCookiesSameSiteNone MarkdownNewParamsCookiesSameSite = "None" )
func (MarkdownNewParamsCookiesSameSite) IsKnown ¶ added in v7.8.0
func (r MarkdownNewParamsCookiesSameSite) IsKnown() bool
type MarkdownNewParamsCookiesSourceScheme ¶ added in v7.8.0
type MarkdownNewParamsCookiesSourceScheme string
const ( MarkdownNewParamsCookiesSourceSchemeUnset MarkdownNewParamsCookiesSourceScheme = "Unset" MarkdownNewParamsCookiesSourceSchemeNonSecure MarkdownNewParamsCookiesSourceScheme = "NonSecure" MarkdownNewParamsCookiesSourceSchemeSecure MarkdownNewParamsCookiesSourceScheme = "Secure" )
func (MarkdownNewParamsCookiesSourceScheme) IsKnown ¶ added in v7.8.0
func (r MarkdownNewParamsCookiesSourceScheme) IsKnown() bool
type MarkdownNewParamsGotoOptions ¶ added in v7.8.0
type MarkdownNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[MarkdownNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (MarkdownNewParamsGotoOptions) MarshalJSON ¶ added in v7.8.0
func (r MarkdownNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsGotoOptionsWaitUntilArray ¶ added in v7.8.0
type MarkdownNewParamsGotoOptionsWaitUntilArray []MarkdownNewParamsGotoOptionsWaitUntilArrayItem
type MarkdownNewParamsGotoOptionsWaitUntilArrayItem ¶ added in v7.8.0
type MarkdownNewParamsGotoOptionsWaitUntilArrayItem string
const ( MarkdownNewParamsGotoOptionsWaitUntilArrayItemLoad MarkdownNewParamsGotoOptionsWaitUntilArrayItem = "load" MarkdownNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded MarkdownNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" MarkdownNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 MarkdownNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" MarkdownNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 MarkdownNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (MarkdownNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶ added in v7.8.0
func (r MarkdownNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type MarkdownNewParamsGotoOptionsWaitUntilString ¶ added in v7.8.0
type MarkdownNewParamsGotoOptionsWaitUntilString string
const ( MarkdownNewParamsGotoOptionsWaitUntilStringLoad MarkdownNewParamsGotoOptionsWaitUntilString = "load" MarkdownNewParamsGotoOptionsWaitUntilStringDomcontentloaded MarkdownNewParamsGotoOptionsWaitUntilString = "domcontentloaded" MarkdownNewParamsGotoOptionsWaitUntilStringNetworkidle0 MarkdownNewParamsGotoOptionsWaitUntilString = "networkidle0" MarkdownNewParamsGotoOptionsWaitUntilStringNetworkidle2 MarkdownNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (MarkdownNewParamsGotoOptionsWaitUntilString) IsKnown ¶ added in v7.8.0
func (r MarkdownNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type MarkdownNewParamsGotoOptionsWaitUntilUnion ¶ added in v7.8.0
type MarkdownNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.MarkdownNewParamsGotoOptionsWaitUntilString, browser_rendering.MarkdownNewParamsGotoOptionsWaitUntilArray.
type MarkdownNewParamsRejectResourceType ¶ added in v7.8.0
type MarkdownNewParamsRejectResourceType string
const ( MarkdownNewParamsRejectResourceTypeDocument MarkdownNewParamsRejectResourceType = "document" MarkdownNewParamsRejectResourceTypeStylesheet MarkdownNewParamsRejectResourceType = "stylesheet" MarkdownNewParamsRejectResourceTypeImage MarkdownNewParamsRejectResourceType = "image" MarkdownNewParamsRejectResourceTypeMedia MarkdownNewParamsRejectResourceType = "media" MarkdownNewParamsRejectResourceTypeFont MarkdownNewParamsRejectResourceType = "font" MarkdownNewParamsRejectResourceTypeScript MarkdownNewParamsRejectResourceType = "script" MarkdownNewParamsRejectResourceTypeTexttrack MarkdownNewParamsRejectResourceType = "texttrack" MarkdownNewParamsRejectResourceTypeXHR MarkdownNewParamsRejectResourceType = "xhr" MarkdownNewParamsRejectResourceTypeFetch MarkdownNewParamsRejectResourceType = "fetch" MarkdownNewParamsRejectResourceTypePrefetch MarkdownNewParamsRejectResourceType = "prefetch" MarkdownNewParamsRejectResourceTypeEventsource MarkdownNewParamsRejectResourceType = "eventsource" MarkdownNewParamsRejectResourceTypeWebsocket MarkdownNewParamsRejectResourceType = "websocket" MarkdownNewParamsRejectResourceTypeManifest MarkdownNewParamsRejectResourceType = "manifest" MarkdownNewParamsRejectResourceTypeSignedexchange MarkdownNewParamsRejectResourceType = "signedexchange" MarkdownNewParamsRejectResourceTypePing MarkdownNewParamsRejectResourceType = "ping" MarkdownNewParamsRejectResourceTypeCspviolationreport MarkdownNewParamsRejectResourceType = "cspviolationreport" MarkdownNewParamsRejectResourceTypePreflight MarkdownNewParamsRejectResourceType = "preflight" MarkdownNewParamsRejectResourceTypeOther MarkdownNewParamsRejectResourceType = "other" )
func (MarkdownNewParamsRejectResourceType) IsKnown ¶ added in v7.8.0
func (r MarkdownNewParamsRejectResourceType) IsKnown() bool
type MarkdownNewParamsViewport ¶ added in v7.8.0
type MarkdownNewParamsViewport struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (MarkdownNewParamsViewport) MarshalJSON ¶ added in v7.8.0
func (r MarkdownNewParamsViewport) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsWaitForSelector ¶ added in v7.8.0
type MarkdownNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector" api:"required"`
Hidden param.Field[MarkdownNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[MarkdownNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (MarkdownNewParamsWaitForSelector) MarshalJSON ¶ added in v7.8.0
func (r MarkdownNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type MarkdownNewParamsWaitForSelectorHidden ¶ added in v7.8.0
type MarkdownNewParamsWaitForSelectorHidden bool
const (
MarkdownNewParamsWaitForSelectorHiddenTrue MarkdownNewParamsWaitForSelectorHidden = true
)
func (MarkdownNewParamsWaitForSelectorHidden) IsKnown ¶ added in v7.8.0
func (r MarkdownNewParamsWaitForSelectorHidden) IsKnown() bool
type MarkdownNewParamsWaitForSelectorVisible ¶ added in v7.8.0
type MarkdownNewParamsWaitForSelectorVisible bool
const (
MarkdownNewParamsWaitForSelectorVisibleTrue MarkdownNewParamsWaitForSelectorVisible = true
)
func (MarkdownNewParamsWaitForSelectorVisible) IsKnown ¶ added in v7.8.0
func (r MarkdownNewParamsWaitForSelectorVisible) IsKnown() bool
type MarkdownNewResponseEnvelope ¶
type MarkdownNewResponseEnvelope struct {
// Response status.
Success bool `json:"success" api:"required"`
Errors []MarkdownNewResponseEnvelopeErrors `json:"errors"`
// Markdown content.
Result string `json:"result"`
JSON markdownNewResponseEnvelopeJSON `json:"-"`
}
func (*MarkdownNewResponseEnvelope) UnmarshalJSON ¶
func (r *MarkdownNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type MarkdownNewResponseEnvelopeErrors ¶
type MarkdownNewResponseEnvelopeErrors struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON markdownNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*MarkdownNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *MarkdownNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type MarkdownService ¶
type MarkdownService struct {
Options []option.RequestOption
}
MarkdownService 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 NewMarkdownService method instead.
func NewMarkdownService ¶
func NewMarkdownService(opts ...option.RequestOption) (r *MarkdownService)
NewMarkdownService 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 (*MarkdownService) New ¶
func (r *MarkdownService) New(ctx context.Context, params MarkdownNewParams, opts ...option.RequestOption) (res *string, err error)
Gets markdown of a webpage from provided URL or HTML. Control page loading with `gotoOptions` and `waitFor*` options.
type MemberPoliciesAccess ¶
type MemberPoliciesAccess = shared.MemberPoliciesAccess
Allow or deny operations against the resources.
This is an alias to an internal type.
type MemberPoliciesPermissionGroup ¶
type MemberPoliciesPermissionGroup = shared.MemberPoliciesPermissionGroup
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type MemberPoliciesPermissionGroupsMeta ¶
type MemberPoliciesPermissionGroupsMeta = shared.MemberPoliciesPermissionGroupsMeta
Attributes associated to the permission group.
This is an alias to an internal type.
type MemberPoliciesResourceGroup ¶
type MemberPoliciesResourceGroup = shared.MemberPoliciesResourceGroup
A group of scoped resources.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsMeta ¶
type MemberPoliciesResourceGroupsMeta = shared.MemberPoliciesResourceGroupsMeta
Attributes associated to the resource group.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsScope ¶
type MemberPoliciesResourceGroupsScope = shared.MemberPoliciesResourceGroupsScope
A scope is a combination of scope objects which provides additional context.
This is an alias to an internal type.
type MemberPoliciesResourceGroupsScopeObject ¶
type MemberPoliciesResourceGroupsScopeObject = shared.MemberPoliciesResourceGroupsScopeObject
A scope object represents any resource that can have actions applied against invite.
This is an alias to an internal type.
type MemberStatus ¶
type MemberStatus = shared.MemberStatus
A member's status in the account.
This is an alias to an internal type.
type MemberUser ¶
type MemberUser = shared.MemberUser
Details of the user associated to the membership.
This is an alias to an internal type.
type PDFNewParams ¶
type PDFNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]PDFNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]PDFNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]PDFNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[PDFNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]PDFNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[PDFNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Check [options](https://pptr.dev/api/puppeteer.pdfoptions).
PDFOptions param.Field[PDFNewParamsPDFOptions] `json:"pdfOptions"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]PDFNewParamsRejectResourceType] `json:"rejectResourceTypes"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[PDFNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[PDFNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (PDFNewParams) MarshalJSON ¶
func (r PDFNewParams) MarshalJSON() (data []byte, err error)
func (PDFNewParams) URLQuery ¶
func (r PDFNewParams) URLQuery() (v url.Values)
URLQuery serializes PDFNewParams's query parameters as `url.Values`.
type PDFNewParamsAddScriptTag ¶ added in v7.8.0
type PDFNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (PDFNewParamsAddScriptTag) MarshalJSON ¶ added in v7.8.0
func (r PDFNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type PDFNewParamsAddStyleTag ¶ added in v7.8.0
type PDFNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (PDFNewParamsAddStyleTag) MarshalJSON ¶ added in v7.8.0
func (r PDFNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type PDFNewParamsAllowResourceType ¶ added in v7.8.0
type PDFNewParamsAllowResourceType string
const ( PDFNewParamsAllowResourceTypeDocument PDFNewParamsAllowResourceType = "document" PDFNewParamsAllowResourceTypeStylesheet PDFNewParamsAllowResourceType = "stylesheet" PDFNewParamsAllowResourceTypeImage PDFNewParamsAllowResourceType = "image" PDFNewParamsAllowResourceTypeMedia PDFNewParamsAllowResourceType = "media" PDFNewParamsAllowResourceTypeFont PDFNewParamsAllowResourceType = "font" PDFNewParamsAllowResourceTypeScript PDFNewParamsAllowResourceType = "script" PDFNewParamsAllowResourceTypeTexttrack PDFNewParamsAllowResourceType = "texttrack" PDFNewParamsAllowResourceTypeXHR PDFNewParamsAllowResourceType = "xhr" PDFNewParamsAllowResourceTypeFetch PDFNewParamsAllowResourceType = "fetch" PDFNewParamsAllowResourceTypePrefetch PDFNewParamsAllowResourceType = "prefetch" PDFNewParamsAllowResourceTypeEventsource PDFNewParamsAllowResourceType = "eventsource" PDFNewParamsAllowResourceTypeWebsocket PDFNewParamsAllowResourceType = "websocket" PDFNewParamsAllowResourceTypeManifest PDFNewParamsAllowResourceType = "manifest" PDFNewParamsAllowResourceTypeSignedexchange PDFNewParamsAllowResourceType = "signedexchange" PDFNewParamsAllowResourceTypePing PDFNewParamsAllowResourceType = "ping" PDFNewParamsAllowResourceTypeCspviolationreport PDFNewParamsAllowResourceType = "cspviolationreport" PDFNewParamsAllowResourceTypePreflight PDFNewParamsAllowResourceType = "preflight" PDFNewParamsAllowResourceTypeOther PDFNewParamsAllowResourceType = "other" )
func (PDFNewParamsAllowResourceType) IsKnown ¶ added in v7.8.0
func (r PDFNewParamsAllowResourceType) IsKnown() bool
type PDFNewParamsAuthenticate ¶ added in v7.8.0
type PDFNewParamsAuthenticate struct {
Password param.Field[string] `json:"password" api:"required"`
Username param.Field[string] `json:"username" api:"required"`
}
Provide credentials for HTTP authentication.
func (PDFNewParamsAuthenticate) MarshalJSON ¶ added in v7.8.0
func (r PDFNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type PDFNewParamsCookie ¶ added in v7.8.0
type PDFNewParamsCookie struct {
// Cookie name.
Name param.Field[string] `json:"name" api:"required"`
Value param.Field[string] `json:"value" api:"required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[PDFNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[PDFNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[PDFNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (PDFNewParamsCookie) MarshalJSON ¶ added in v7.8.0
func (r PDFNewParamsCookie) MarshalJSON() (data []byte, err error)
type PDFNewParamsCookiesPriority ¶ added in v7.8.0
type PDFNewParamsCookiesPriority string
const ( PDFNewParamsCookiesPriorityLow PDFNewParamsCookiesPriority = "Low" PDFNewParamsCookiesPriorityMedium PDFNewParamsCookiesPriority = "Medium" PDFNewParamsCookiesPriorityHigh PDFNewParamsCookiesPriority = "High" )
func (PDFNewParamsCookiesPriority) IsKnown ¶ added in v7.8.0
func (r PDFNewParamsCookiesPriority) IsKnown() bool
type PDFNewParamsCookiesSameSite ¶ added in v7.8.0
type PDFNewParamsCookiesSameSite string
const ( PDFNewParamsCookiesSameSiteStrict PDFNewParamsCookiesSameSite = "Strict" PDFNewParamsCookiesSameSiteLax PDFNewParamsCookiesSameSite = "Lax" PDFNewParamsCookiesSameSiteNone PDFNewParamsCookiesSameSite = "None" )
func (PDFNewParamsCookiesSameSite) IsKnown ¶ added in v7.8.0
func (r PDFNewParamsCookiesSameSite) IsKnown() bool
type PDFNewParamsCookiesSourceScheme ¶ added in v7.8.0
type PDFNewParamsCookiesSourceScheme string
const ( PDFNewParamsCookiesSourceSchemeUnset PDFNewParamsCookiesSourceScheme = "Unset" PDFNewParamsCookiesSourceSchemeNonSecure PDFNewParamsCookiesSourceScheme = "NonSecure" PDFNewParamsCookiesSourceSchemeSecure PDFNewParamsCookiesSourceScheme = "Secure" )
func (PDFNewParamsCookiesSourceScheme) IsKnown ¶ added in v7.8.0
func (r PDFNewParamsCookiesSourceScheme) IsKnown() bool
type PDFNewParamsGotoOptions ¶ added in v7.8.0
type PDFNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[PDFNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (PDFNewParamsGotoOptions) MarshalJSON ¶ added in v7.8.0
func (r PDFNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type PDFNewParamsGotoOptionsWaitUntilArray ¶ added in v7.8.0
type PDFNewParamsGotoOptionsWaitUntilArray []PDFNewParamsGotoOptionsWaitUntilArrayItem
type PDFNewParamsGotoOptionsWaitUntilArrayItem ¶ added in v7.8.0
type PDFNewParamsGotoOptionsWaitUntilArrayItem string
const ( PDFNewParamsGotoOptionsWaitUntilArrayItemLoad PDFNewParamsGotoOptionsWaitUntilArrayItem = "load" PDFNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded PDFNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" PDFNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 PDFNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" PDFNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 PDFNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (PDFNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶ added in v7.8.0
func (r PDFNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type PDFNewParamsGotoOptionsWaitUntilString ¶ added in v7.8.0
type PDFNewParamsGotoOptionsWaitUntilString string
const ( PDFNewParamsGotoOptionsWaitUntilStringLoad PDFNewParamsGotoOptionsWaitUntilString = "load" PDFNewParamsGotoOptionsWaitUntilStringDomcontentloaded PDFNewParamsGotoOptionsWaitUntilString = "domcontentloaded" PDFNewParamsGotoOptionsWaitUntilStringNetworkidle0 PDFNewParamsGotoOptionsWaitUntilString = "networkidle0" PDFNewParamsGotoOptionsWaitUntilStringNetworkidle2 PDFNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (PDFNewParamsGotoOptionsWaitUntilString) IsKnown ¶ added in v7.8.0
func (r PDFNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type PDFNewParamsGotoOptionsWaitUntilUnion ¶ added in v7.8.0
type PDFNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.PDFNewParamsGotoOptionsWaitUntilString, browser_rendering.PDFNewParamsGotoOptionsWaitUntilArray.
type PDFNewParamsPDFOptions ¶ added in v7.8.0
type PDFNewParamsPDFOptions struct {
DisplayHeaderFooter param.Field[bool] `json:"displayHeaderFooter"`
FooterTemplate param.Field[string] `json:"footerTemplate"`
// Paper format. Takes priority over width and height if set.
Format param.Field[PDFNewParamsPDFOptionsFormat] `json:"format"`
// HTML template for the print header.
HeaderTemplate param.Field[string] `json:"headerTemplate"`
// Sets the height of paper. Can be a number or string with unit.
Height param.Field[PDFNewParamsPDFOptionsHeightUnion] `json:"height"`
// Whether to print in landscape orientation.
Landscape param.Field[bool] `json:"landscape"`
// Set the PDF margins. Useful when setting header and footer.
Margin param.Field[PDFNewParamsPDFOptionsMargin] `json:"margin"`
// Hides default white background and allows generating pdfs with transparency.
OmitBackground param.Field[bool] `json:"omitBackground"`
// Generate document outline.
Outline param.Field[bool] `json:"outline"`
// Paper ranges to print, e.g. '1-5, 8, 11-13'.
PageRanges param.Field[string] `json:"pageRanges"`
// Give CSS @page size priority over other size declarations.
PreferCSSPageSize param.Field[bool] `json:"preferCSSPageSize"`
// Set to true to print background graphics.
PrintBackground param.Field[bool] `json:"printBackground"`
// Scales the rendering of the web page. Amount must be between 0.1 and 2.
Scale param.Field[float64] `json:"scale"`
// Generate tagged (accessible) PDF.
Tagged param.Field[bool] `json:"tagged"`
// Timeout in milliseconds.
Timeout param.Field[float64] `json:"timeout"`
// Sets the width of paper. Can be a number or string with unit.
Width param.Field[PDFNewParamsPDFOptionsWidthUnion] `json:"width"`
}
Check [options](https://pptr.dev/api/puppeteer.pdfoptions).
func (PDFNewParamsPDFOptions) MarshalJSON ¶ added in v7.8.0
func (r PDFNewParamsPDFOptions) MarshalJSON() (data []byte, err error)
type PDFNewParamsPDFOptionsFormat ¶ added in v7.8.0
type PDFNewParamsPDFOptionsFormat string
Paper format. Takes priority over width and height if set.
const ( PDFNewParamsPDFOptionsFormatLetter PDFNewParamsPDFOptionsFormat = "letter" PDFNewParamsPDFOptionsFormatLegal PDFNewParamsPDFOptionsFormat = "legal" PDFNewParamsPDFOptionsFormatTabloid PDFNewParamsPDFOptionsFormat = "tabloid" PDFNewParamsPDFOptionsFormatLedger PDFNewParamsPDFOptionsFormat = "ledger" PDFNewParamsPDFOptionsFormatA0 PDFNewParamsPDFOptionsFormat = "a0" PDFNewParamsPDFOptionsFormatA1 PDFNewParamsPDFOptionsFormat = "a1" PDFNewParamsPDFOptionsFormatA2 PDFNewParamsPDFOptionsFormat = "a2" PDFNewParamsPDFOptionsFormatA3 PDFNewParamsPDFOptionsFormat = "a3" PDFNewParamsPDFOptionsFormatA4 PDFNewParamsPDFOptionsFormat = "a4" PDFNewParamsPDFOptionsFormatA5 PDFNewParamsPDFOptionsFormat = "a5" PDFNewParamsPDFOptionsFormatA6 PDFNewParamsPDFOptionsFormat = "a6" )
func (PDFNewParamsPDFOptionsFormat) IsKnown ¶ added in v7.8.0
func (r PDFNewParamsPDFOptionsFormat) IsKnown() bool
type PDFNewParamsPDFOptionsHeightUnion ¶ added in v7.8.0
type PDFNewParamsPDFOptionsHeightUnion interface {
ImplementsPDFNewParamsPDFOptionsHeightUnion()
}
Sets the height of paper. Can be a number or string with unit.
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsPDFOptionsMargin ¶ added in v7.8.0
type PDFNewParamsPDFOptionsMargin struct {
Bottom param.Field[PDFNewParamsPDFOptionsMarginBottomUnion] `json:"bottom"`
Left param.Field[PDFNewParamsPDFOptionsMarginLeftUnion] `json:"left"`
Right param.Field[PDFNewParamsPDFOptionsMarginRightUnion] `json:"right"`
Top param.Field[PDFNewParamsPDFOptionsMarginTopUnion] `json:"top"`
}
Set the PDF margins. Useful when setting header and footer.
func (PDFNewParamsPDFOptionsMargin) MarshalJSON ¶ added in v7.8.0
func (r PDFNewParamsPDFOptionsMargin) MarshalJSON() (data []byte, err error)
type PDFNewParamsPDFOptionsMarginBottomUnion ¶ added in v7.8.0
type PDFNewParamsPDFOptionsMarginBottomUnion interface {
ImplementsPDFNewParamsPDFOptionsMarginBottomUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsPDFOptionsMarginLeftUnion ¶ added in v7.8.0
type PDFNewParamsPDFOptionsMarginLeftUnion interface {
ImplementsPDFNewParamsPDFOptionsMarginLeftUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsPDFOptionsMarginRightUnion ¶ added in v7.8.0
type PDFNewParamsPDFOptionsMarginRightUnion interface {
ImplementsPDFNewParamsPDFOptionsMarginRightUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsPDFOptionsMarginTopUnion ¶ added in v7.8.0
type PDFNewParamsPDFOptionsMarginTopUnion interface {
ImplementsPDFNewParamsPDFOptionsMarginTopUnion()
}
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsPDFOptionsWidthUnion ¶ added in v7.8.0
type PDFNewParamsPDFOptionsWidthUnion interface {
ImplementsPDFNewParamsPDFOptionsWidthUnion()
}
Sets the width of paper. Can be a number or string with unit.
Satisfied by shared.UnionString, shared.UnionFloat.
type PDFNewParamsRejectResourceType ¶ added in v7.8.0
type PDFNewParamsRejectResourceType string
const ( PDFNewParamsRejectResourceTypeDocument PDFNewParamsRejectResourceType = "document" PDFNewParamsRejectResourceTypeStylesheet PDFNewParamsRejectResourceType = "stylesheet" PDFNewParamsRejectResourceTypeImage PDFNewParamsRejectResourceType = "image" PDFNewParamsRejectResourceTypeMedia PDFNewParamsRejectResourceType = "media" PDFNewParamsRejectResourceTypeFont PDFNewParamsRejectResourceType = "font" PDFNewParamsRejectResourceTypeScript PDFNewParamsRejectResourceType = "script" PDFNewParamsRejectResourceTypeTexttrack PDFNewParamsRejectResourceType = "texttrack" PDFNewParamsRejectResourceTypeXHR PDFNewParamsRejectResourceType = "xhr" PDFNewParamsRejectResourceTypeFetch PDFNewParamsRejectResourceType = "fetch" PDFNewParamsRejectResourceTypePrefetch PDFNewParamsRejectResourceType = "prefetch" PDFNewParamsRejectResourceTypeEventsource PDFNewParamsRejectResourceType = "eventsource" PDFNewParamsRejectResourceTypeWebsocket PDFNewParamsRejectResourceType = "websocket" PDFNewParamsRejectResourceTypeManifest PDFNewParamsRejectResourceType = "manifest" PDFNewParamsRejectResourceTypeSignedexchange PDFNewParamsRejectResourceType = "signedexchange" PDFNewParamsRejectResourceTypePing PDFNewParamsRejectResourceType = "ping" PDFNewParamsRejectResourceTypeCspviolationreport PDFNewParamsRejectResourceType = "cspviolationreport" PDFNewParamsRejectResourceTypePreflight PDFNewParamsRejectResourceType = "preflight" PDFNewParamsRejectResourceTypeOther PDFNewParamsRejectResourceType = "other" )
func (PDFNewParamsRejectResourceType) IsKnown ¶ added in v7.8.0
func (r PDFNewParamsRejectResourceType) IsKnown() bool
type PDFNewParamsViewport ¶ added in v7.8.0
type PDFNewParamsViewport struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (PDFNewParamsViewport) MarshalJSON ¶ added in v7.8.0
func (r PDFNewParamsViewport) MarshalJSON() (data []byte, err error)
type PDFNewParamsWaitForSelector ¶ added in v7.8.0
type PDFNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector" api:"required"`
Hidden param.Field[PDFNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[PDFNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (PDFNewParamsWaitForSelector) MarshalJSON ¶ added in v7.8.0
func (r PDFNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type PDFNewParamsWaitForSelectorHidden ¶ added in v7.8.0
type PDFNewParamsWaitForSelectorHidden bool
const (
PDFNewParamsWaitForSelectorHiddenTrue PDFNewParamsWaitForSelectorHidden = true
)
func (PDFNewParamsWaitForSelectorHidden) IsKnown ¶ added in v7.8.0
func (r PDFNewParamsWaitForSelectorHidden) IsKnown() bool
type PDFNewParamsWaitForSelectorVisible ¶ added in v7.8.0
type PDFNewParamsWaitForSelectorVisible bool
const (
PDFNewParamsWaitForSelectorVisibleTrue PDFNewParamsWaitForSelectorVisible = true
)
func (PDFNewParamsWaitForSelectorVisible) IsKnown ¶ added in v7.8.0
func (r PDFNewParamsWaitForSelectorVisible) IsKnown() bool
type PDFService ¶
type PDFService struct {
Options []option.RequestOption
}
PDFService 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 NewPDFService method instead.
func NewPDFService ¶
func NewPDFService(opts ...option.RequestOption) (r *PDFService)
NewPDFService 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 (*PDFService) New ¶
func (r *PDFService) New(ctx context.Context, params PDFNewParams, opts ...option.RequestOption) (res *http.Response, err error)
Fetches rendered PDF from provided URL or HTML. Check available options like `gotoOptions` and `waitFor*` to control page load behaviour.
type PermissionGrant ¶
type PermissionGrant = shared.PermissionGrant
This is an alias to an internal type.
type PermissionGrantParam ¶
type PermissionGrantParam = shared.PermissionGrantParam
This is an alias to an internal type.
type RatePlanID ¶
type RatePlanID = shared.RatePlanID
The ID of the rate plan.
This is an alias to an internal type.
type RatePlanParam ¶
type RatePlanParam = shared.RatePlanParam
The rate plan applied to the subscription.
This is an alias to an internal type.
type ResponseInfoSource ¶
type ResponseInfoSource = shared.ResponseInfoSource
This is an alias to an internal type.
type RolePermissions ¶
type RolePermissions = shared.RolePermissions
This is an alias to an internal type.
type RolePermissionsParam ¶
type RolePermissionsParam = shared.RolePermissionsParam
This is an alias to an internal type.
type ScrapeNewParams ¶
type ScrapeNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]ScrapeNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]ScrapeNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]ScrapeNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[ScrapeNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]ScrapeNewParamsCookie] `json:"cookies"`
Elements param.Field[[]ScrapeNewParamsElement] `json:"elements"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[ScrapeNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]ScrapeNewParamsRejectResourceType] `json:"rejectResourceTypes"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[ScrapeNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[ScrapeNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (ScrapeNewParams) MarshalJSON ¶
func (r ScrapeNewParams) MarshalJSON() (data []byte, err error)
func (ScrapeNewParams) URLQuery ¶
func (r ScrapeNewParams) URLQuery() (v url.Values)
URLQuery serializes ScrapeNewParams's query parameters as `url.Values`.
type ScrapeNewParamsAddScriptTag ¶ added in v7.8.0
type ScrapeNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (ScrapeNewParamsAddScriptTag) MarshalJSON ¶ added in v7.8.0
func (r ScrapeNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsAddStyleTag ¶ added in v7.8.0
type ScrapeNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (ScrapeNewParamsAddStyleTag) MarshalJSON ¶ added in v7.8.0
func (r ScrapeNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsAllowResourceType ¶ added in v7.8.0
type ScrapeNewParamsAllowResourceType string
const ( ScrapeNewParamsAllowResourceTypeDocument ScrapeNewParamsAllowResourceType = "document" ScrapeNewParamsAllowResourceTypeStylesheet ScrapeNewParamsAllowResourceType = "stylesheet" ScrapeNewParamsAllowResourceTypeImage ScrapeNewParamsAllowResourceType = "image" ScrapeNewParamsAllowResourceTypeMedia ScrapeNewParamsAllowResourceType = "media" ScrapeNewParamsAllowResourceTypeFont ScrapeNewParamsAllowResourceType = "font" ScrapeNewParamsAllowResourceTypeScript ScrapeNewParamsAllowResourceType = "script" ScrapeNewParamsAllowResourceTypeTexttrack ScrapeNewParamsAllowResourceType = "texttrack" ScrapeNewParamsAllowResourceTypeXHR ScrapeNewParamsAllowResourceType = "xhr" ScrapeNewParamsAllowResourceTypeFetch ScrapeNewParamsAllowResourceType = "fetch" ScrapeNewParamsAllowResourceTypePrefetch ScrapeNewParamsAllowResourceType = "prefetch" ScrapeNewParamsAllowResourceTypeEventsource ScrapeNewParamsAllowResourceType = "eventsource" ScrapeNewParamsAllowResourceTypeWebsocket ScrapeNewParamsAllowResourceType = "websocket" ScrapeNewParamsAllowResourceTypeManifest ScrapeNewParamsAllowResourceType = "manifest" ScrapeNewParamsAllowResourceTypeSignedexchange ScrapeNewParamsAllowResourceType = "signedexchange" ScrapeNewParamsAllowResourceTypePing ScrapeNewParamsAllowResourceType = "ping" ScrapeNewParamsAllowResourceTypeCspviolationreport ScrapeNewParamsAllowResourceType = "cspviolationreport" ScrapeNewParamsAllowResourceTypePreflight ScrapeNewParamsAllowResourceType = "preflight" ScrapeNewParamsAllowResourceTypeOther ScrapeNewParamsAllowResourceType = "other" )
func (ScrapeNewParamsAllowResourceType) IsKnown ¶ added in v7.8.0
func (r ScrapeNewParamsAllowResourceType) IsKnown() bool
type ScrapeNewParamsAuthenticate ¶ added in v7.8.0
type ScrapeNewParamsAuthenticate struct {
Password param.Field[string] `json:"password" api:"required"`
Username param.Field[string] `json:"username" api:"required"`
}
Provide credentials for HTTP authentication.
func (ScrapeNewParamsAuthenticate) MarshalJSON ¶ added in v7.8.0
func (r ScrapeNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsCookie ¶ added in v7.8.0
type ScrapeNewParamsCookie struct {
// Cookie name.
Name param.Field[string] `json:"name" api:"required"`
Value param.Field[string] `json:"value" api:"required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[ScrapeNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[ScrapeNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[ScrapeNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (ScrapeNewParamsCookie) MarshalJSON ¶ added in v7.8.0
func (r ScrapeNewParamsCookie) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsCookiesPriority ¶ added in v7.8.0
type ScrapeNewParamsCookiesPriority string
const ( ScrapeNewParamsCookiesPriorityLow ScrapeNewParamsCookiesPriority = "Low" ScrapeNewParamsCookiesPriorityMedium ScrapeNewParamsCookiesPriority = "Medium" ScrapeNewParamsCookiesPriorityHigh ScrapeNewParamsCookiesPriority = "High" )
func (ScrapeNewParamsCookiesPriority) IsKnown ¶ added in v7.8.0
func (r ScrapeNewParamsCookiesPriority) IsKnown() bool
type ScrapeNewParamsCookiesSameSite ¶ added in v7.8.0
type ScrapeNewParamsCookiesSameSite string
const ( ScrapeNewParamsCookiesSameSiteStrict ScrapeNewParamsCookiesSameSite = "Strict" ScrapeNewParamsCookiesSameSiteLax ScrapeNewParamsCookiesSameSite = "Lax" ScrapeNewParamsCookiesSameSiteNone ScrapeNewParamsCookiesSameSite = "None" )
func (ScrapeNewParamsCookiesSameSite) IsKnown ¶ added in v7.8.0
func (r ScrapeNewParamsCookiesSameSite) IsKnown() bool
type ScrapeNewParamsCookiesSourceScheme ¶ added in v7.8.0
type ScrapeNewParamsCookiesSourceScheme string
const ( ScrapeNewParamsCookiesSourceSchemeUnset ScrapeNewParamsCookiesSourceScheme = "Unset" ScrapeNewParamsCookiesSourceSchemeNonSecure ScrapeNewParamsCookiesSourceScheme = "NonSecure" ScrapeNewParamsCookiesSourceSchemeSecure ScrapeNewParamsCookiesSourceScheme = "Secure" )
func (ScrapeNewParamsCookiesSourceScheme) IsKnown ¶ added in v7.8.0
func (r ScrapeNewParamsCookiesSourceScheme) IsKnown() bool
type ScrapeNewParamsElement ¶ added in v7.8.0
type ScrapeNewParamsElement struct {
Selector param.Field[string] `json:"selector" api:"required"`
}
func (ScrapeNewParamsElement) MarshalJSON ¶ added in v7.8.0
func (r ScrapeNewParamsElement) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsGotoOptions ¶ added in v7.8.0
type ScrapeNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[ScrapeNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (ScrapeNewParamsGotoOptions) MarshalJSON ¶ added in v7.8.0
func (r ScrapeNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsGotoOptionsWaitUntilArray ¶ added in v7.8.0
type ScrapeNewParamsGotoOptionsWaitUntilArray []ScrapeNewParamsGotoOptionsWaitUntilArrayItem
type ScrapeNewParamsGotoOptionsWaitUntilArrayItem ¶ added in v7.8.0
type ScrapeNewParamsGotoOptionsWaitUntilArrayItem string
const ( ScrapeNewParamsGotoOptionsWaitUntilArrayItemLoad ScrapeNewParamsGotoOptionsWaitUntilArrayItem = "load" ScrapeNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded ScrapeNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" ScrapeNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 ScrapeNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" ScrapeNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 ScrapeNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (ScrapeNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶ added in v7.8.0
func (r ScrapeNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type ScrapeNewParamsGotoOptionsWaitUntilString ¶ added in v7.8.0
type ScrapeNewParamsGotoOptionsWaitUntilString string
const ( ScrapeNewParamsGotoOptionsWaitUntilStringLoad ScrapeNewParamsGotoOptionsWaitUntilString = "load" ScrapeNewParamsGotoOptionsWaitUntilStringDomcontentloaded ScrapeNewParamsGotoOptionsWaitUntilString = "domcontentloaded" ScrapeNewParamsGotoOptionsWaitUntilStringNetworkidle0 ScrapeNewParamsGotoOptionsWaitUntilString = "networkidle0" ScrapeNewParamsGotoOptionsWaitUntilStringNetworkidle2 ScrapeNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (ScrapeNewParamsGotoOptionsWaitUntilString) IsKnown ¶ added in v7.8.0
func (r ScrapeNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type ScrapeNewParamsGotoOptionsWaitUntilUnion ¶ added in v7.8.0
type ScrapeNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.ScrapeNewParamsGotoOptionsWaitUntilString, browser_rendering.ScrapeNewParamsGotoOptionsWaitUntilArray.
type ScrapeNewParamsRejectResourceType ¶ added in v7.8.0
type ScrapeNewParamsRejectResourceType string
const ( ScrapeNewParamsRejectResourceTypeDocument ScrapeNewParamsRejectResourceType = "document" ScrapeNewParamsRejectResourceTypeStylesheet ScrapeNewParamsRejectResourceType = "stylesheet" ScrapeNewParamsRejectResourceTypeImage ScrapeNewParamsRejectResourceType = "image" ScrapeNewParamsRejectResourceTypeMedia ScrapeNewParamsRejectResourceType = "media" ScrapeNewParamsRejectResourceTypeFont ScrapeNewParamsRejectResourceType = "font" ScrapeNewParamsRejectResourceTypeScript ScrapeNewParamsRejectResourceType = "script" ScrapeNewParamsRejectResourceTypeTexttrack ScrapeNewParamsRejectResourceType = "texttrack" ScrapeNewParamsRejectResourceTypeXHR ScrapeNewParamsRejectResourceType = "xhr" ScrapeNewParamsRejectResourceTypeFetch ScrapeNewParamsRejectResourceType = "fetch" ScrapeNewParamsRejectResourceTypePrefetch ScrapeNewParamsRejectResourceType = "prefetch" ScrapeNewParamsRejectResourceTypeEventsource ScrapeNewParamsRejectResourceType = "eventsource" ScrapeNewParamsRejectResourceTypeWebsocket ScrapeNewParamsRejectResourceType = "websocket" ScrapeNewParamsRejectResourceTypeManifest ScrapeNewParamsRejectResourceType = "manifest" ScrapeNewParamsRejectResourceTypeSignedexchange ScrapeNewParamsRejectResourceType = "signedexchange" ScrapeNewParamsRejectResourceTypePing ScrapeNewParamsRejectResourceType = "ping" ScrapeNewParamsRejectResourceTypeCspviolationreport ScrapeNewParamsRejectResourceType = "cspviolationreport" ScrapeNewParamsRejectResourceTypePreflight ScrapeNewParamsRejectResourceType = "preflight" ScrapeNewParamsRejectResourceTypeOther ScrapeNewParamsRejectResourceType = "other" )
func (ScrapeNewParamsRejectResourceType) IsKnown ¶ added in v7.8.0
func (r ScrapeNewParamsRejectResourceType) IsKnown() bool
type ScrapeNewParamsViewport ¶ added in v7.8.0
type ScrapeNewParamsViewport struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (ScrapeNewParamsViewport) MarshalJSON ¶ added in v7.8.0
func (r ScrapeNewParamsViewport) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsWaitForSelector ¶ added in v7.8.0
type ScrapeNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector" api:"required"`
Hidden param.Field[ScrapeNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[ScrapeNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (ScrapeNewParamsWaitForSelector) MarshalJSON ¶ added in v7.8.0
func (r ScrapeNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type ScrapeNewParamsWaitForSelectorHidden ¶ added in v7.8.0
type ScrapeNewParamsWaitForSelectorHidden bool
const (
ScrapeNewParamsWaitForSelectorHiddenTrue ScrapeNewParamsWaitForSelectorHidden = true
)
func (ScrapeNewParamsWaitForSelectorHidden) IsKnown ¶ added in v7.8.0
func (r ScrapeNewParamsWaitForSelectorHidden) IsKnown() bool
type ScrapeNewParamsWaitForSelectorVisible ¶ added in v7.8.0
type ScrapeNewParamsWaitForSelectorVisible bool
const (
ScrapeNewParamsWaitForSelectorVisibleTrue ScrapeNewParamsWaitForSelectorVisible = true
)
func (ScrapeNewParamsWaitForSelectorVisible) IsKnown ¶ added in v7.8.0
func (r ScrapeNewParamsWaitForSelectorVisible) IsKnown() bool
type ScrapeNewResponse ¶
type ScrapeNewResponse struct {
Results ScrapeNewResponseResults `json:"results" api:"required"`
// Selector.
Selector string `json:"selector" api:"required"`
JSON scrapeNewResponseJSON `json:"-"`
}
func (*ScrapeNewResponse) UnmarshalJSON ¶
func (r *ScrapeNewResponse) UnmarshalJSON(data []byte) (err error)
type ScrapeNewResponseEnvelope ¶
type ScrapeNewResponseEnvelope struct {
Result []ScrapeNewResponse `json:"result" api:"required"`
// Response status.
Success bool `json:"success" api:"required"`
Errors []ScrapeNewResponseEnvelopeErrors `json:"errors"`
JSON scrapeNewResponseEnvelopeJSON `json:"-"`
}
func (*ScrapeNewResponseEnvelope) UnmarshalJSON ¶
func (r *ScrapeNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type ScrapeNewResponseEnvelopeErrors ¶
type ScrapeNewResponseEnvelopeErrors struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON scrapeNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*ScrapeNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *ScrapeNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type ScrapeNewResponseResults ¶
type ScrapeNewResponseResults struct {
Attributes []ScrapeNewResponseResultsAttribute `json:"attributes" api:"required"`
// Element height.
Height float64 `json:"height" api:"required"`
// HTML content.
HTML string `json:"html" api:"required"`
// Element left.
Left float64 `json:"left" api:"required"`
// Text content.
Text string `json:"text" api:"required"`
// Element top.
Top float64 `json:"top" api:"required"`
// Element width.
Width float64 `json:"width" api:"required"`
JSON scrapeNewResponseResultsJSON `json:"-"`
}
func (*ScrapeNewResponseResults) UnmarshalJSON ¶
func (r *ScrapeNewResponseResults) UnmarshalJSON(data []byte) (err error)
type ScrapeNewResponseResultsAttribute ¶
type ScrapeNewResponseResultsAttribute struct {
// Attribute name.
Name string `json:"name" api:"required"`
// Attribute value.
Value string `json:"value" api:"required"`
JSON scrapeNewResponseResultsAttributeJSON `json:"-"`
}
func (*ScrapeNewResponseResultsAttribute) UnmarshalJSON ¶
func (r *ScrapeNewResponseResultsAttribute) UnmarshalJSON(data []byte) (err error)
type ScrapeService ¶
type ScrapeService struct {
Options []option.RequestOption
}
ScrapeService 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 NewScrapeService method instead.
func NewScrapeService ¶
func NewScrapeService(opts ...option.RequestOption) (r *ScrapeService)
NewScrapeService 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 (*ScrapeService) New ¶
func (r *ScrapeService) New(ctx context.Context, params ScrapeNewParams, opts ...option.RequestOption) (res *[]ScrapeNewResponse, err error)
Get meta attributes like height, width, text and others of selected elements.
type ScreenshotNewParams ¶
type ScreenshotNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]ScreenshotNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]ScreenshotNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]ScreenshotNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[ScreenshotNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]ScreenshotNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[ScreenshotNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]ScreenshotNewParamsRejectResourceType] `json:"rejectResourceTypes"`
// Check [options](https://pptr.dev/api/puppeteer.screenshotoptions).
ScreenshotOptions param.Field[ScreenshotNewParamsScreenshotOptions] `json:"screenshotOptions"`
ScrollPage param.Field[bool] `json:"scrollPage"`
Selector param.Field[string] `json:"selector"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[ScreenshotNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[ScreenshotNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (ScreenshotNewParams) MarshalJSON ¶
func (r ScreenshotNewParams) MarshalJSON() (data []byte, err error)
func (ScreenshotNewParams) URLQuery ¶
func (r ScreenshotNewParams) URLQuery() (v url.Values)
URLQuery serializes ScreenshotNewParams's query parameters as `url.Values`.
type ScreenshotNewParamsAddScriptTag ¶ added in v7.8.0
type ScreenshotNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (ScreenshotNewParamsAddScriptTag) MarshalJSON ¶ added in v7.8.0
func (r ScreenshotNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsAddStyleTag ¶ added in v7.8.0
type ScreenshotNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (ScreenshotNewParamsAddStyleTag) MarshalJSON ¶ added in v7.8.0
func (r ScreenshotNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsAllowResourceType ¶ added in v7.8.0
type ScreenshotNewParamsAllowResourceType string
const ( ScreenshotNewParamsAllowResourceTypeDocument ScreenshotNewParamsAllowResourceType = "document" ScreenshotNewParamsAllowResourceTypeStylesheet ScreenshotNewParamsAllowResourceType = "stylesheet" ScreenshotNewParamsAllowResourceTypeImage ScreenshotNewParamsAllowResourceType = "image" ScreenshotNewParamsAllowResourceTypeMedia ScreenshotNewParamsAllowResourceType = "media" ScreenshotNewParamsAllowResourceTypeFont ScreenshotNewParamsAllowResourceType = "font" ScreenshotNewParamsAllowResourceTypeScript ScreenshotNewParamsAllowResourceType = "script" ScreenshotNewParamsAllowResourceTypeTexttrack ScreenshotNewParamsAllowResourceType = "texttrack" ScreenshotNewParamsAllowResourceTypeXHR ScreenshotNewParamsAllowResourceType = "xhr" ScreenshotNewParamsAllowResourceTypeFetch ScreenshotNewParamsAllowResourceType = "fetch" ScreenshotNewParamsAllowResourceTypePrefetch ScreenshotNewParamsAllowResourceType = "prefetch" ScreenshotNewParamsAllowResourceTypeEventsource ScreenshotNewParamsAllowResourceType = "eventsource" ScreenshotNewParamsAllowResourceTypeWebsocket ScreenshotNewParamsAllowResourceType = "websocket" ScreenshotNewParamsAllowResourceTypeManifest ScreenshotNewParamsAllowResourceType = "manifest" ScreenshotNewParamsAllowResourceTypeSignedexchange ScreenshotNewParamsAllowResourceType = "signedexchange" ScreenshotNewParamsAllowResourceTypePing ScreenshotNewParamsAllowResourceType = "ping" ScreenshotNewParamsAllowResourceTypeCspviolationreport ScreenshotNewParamsAllowResourceType = "cspviolationreport" ScreenshotNewParamsAllowResourceTypePreflight ScreenshotNewParamsAllowResourceType = "preflight" ScreenshotNewParamsAllowResourceTypeOther ScreenshotNewParamsAllowResourceType = "other" )
func (ScreenshotNewParamsAllowResourceType) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsAllowResourceType) IsKnown() bool
type ScreenshotNewParamsAuthenticate ¶ added in v7.8.0
type ScreenshotNewParamsAuthenticate struct {
Password param.Field[string] `json:"password" api:"required"`
Username param.Field[string] `json:"username" api:"required"`
}
Provide credentials for HTTP authentication.
func (ScreenshotNewParamsAuthenticate) MarshalJSON ¶ added in v7.8.0
func (r ScreenshotNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsCookie ¶ added in v7.8.0
type ScreenshotNewParamsCookie struct {
// Cookie name.
Name param.Field[string] `json:"name" api:"required"`
Value param.Field[string] `json:"value" api:"required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[ScreenshotNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[ScreenshotNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[ScreenshotNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (ScreenshotNewParamsCookie) MarshalJSON ¶ added in v7.8.0
func (r ScreenshotNewParamsCookie) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsCookiesPriority ¶ added in v7.8.0
type ScreenshotNewParamsCookiesPriority string
const ( ScreenshotNewParamsCookiesPriorityLow ScreenshotNewParamsCookiesPriority = "Low" ScreenshotNewParamsCookiesPriorityMedium ScreenshotNewParamsCookiesPriority = "Medium" ScreenshotNewParamsCookiesPriorityHigh ScreenshotNewParamsCookiesPriority = "High" )
func (ScreenshotNewParamsCookiesPriority) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsCookiesPriority) IsKnown() bool
type ScreenshotNewParamsCookiesSameSite ¶ added in v7.8.0
type ScreenshotNewParamsCookiesSameSite string
const ( ScreenshotNewParamsCookiesSameSiteStrict ScreenshotNewParamsCookiesSameSite = "Strict" ScreenshotNewParamsCookiesSameSiteLax ScreenshotNewParamsCookiesSameSite = "Lax" ScreenshotNewParamsCookiesSameSiteNone ScreenshotNewParamsCookiesSameSite = "None" )
func (ScreenshotNewParamsCookiesSameSite) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsCookiesSameSite) IsKnown() bool
type ScreenshotNewParamsCookiesSourceScheme ¶ added in v7.8.0
type ScreenshotNewParamsCookiesSourceScheme string
const ( ScreenshotNewParamsCookiesSourceSchemeUnset ScreenshotNewParamsCookiesSourceScheme = "Unset" ScreenshotNewParamsCookiesSourceSchemeNonSecure ScreenshotNewParamsCookiesSourceScheme = "NonSecure" ScreenshotNewParamsCookiesSourceSchemeSecure ScreenshotNewParamsCookiesSourceScheme = "Secure" )
func (ScreenshotNewParamsCookiesSourceScheme) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsCookiesSourceScheme) IsKnown() bool
type ScreenshotNewParamsGotoOptions ¶ added in v7.8.0
type ScreenshotNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[ScreenshotNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (ScreenshotNewParamsGotoOptions) MarshalJSON ¶ added in v7.8.0
func (r ScreenshotNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsGotoOptionsWaitUntilArray ¶ added in v7.8.0
type ScreenshotNewParamsGotoOptionsWaitUntilArray []ScreenshotNewParamsGotoOptionsWaitUntilArrayItem
type ScreenshotNewParamsGotoOptionsWaitUntilArrayItem ¶ added in v7.8.0
type ScreenshotNewParamsGotoOptionsWaitUntilArrayItem string
const ( ScreenshotNewParamsGotoOptionsWaitUntilArrayItemLoad ScreenshotNewParamsGotoOptionsWaitUntilArrayItem = "load" ScreenshotNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded ScreenshotNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" ScreenshotNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 ScreenshotNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" ScreenshotNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 ScreenshotNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (ScreenshotNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type ScreenshotNewParamsGotoOptionsWaitUntilString ¶ added in v7.8.0
type ScreenshotNewParamsGotoOptionsWaitUntilString string
const ( ScreenshotNewParamsGotoOptionsWaitUntilStringLoad ScreenshotNewParamsGotoOptionsWaitUntilString = "load" ScreenshotNewParamsGotoOptionsWaitUntilStringDomcontentloaded ScreenshotNewParamsGotoOptionsWaitUntilString = "domcontentloaded" ScreenshotNewParamsGotoOptionsWaitUntilStringNetworkidle0 ScreenshotNewParamsGotoOptionsWaitUntilString = "networkidle0" ScreenshotNewParamsGotoOptionsWaitUntilStringNetworkidle2 ScreenshotNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (ScreenshotNewParamsGotoOptionsWaitUntilString) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type ScreenshotNewParamsGotoOptionsWaitUntilUnion ¶ added in v7.8.0
type ScreenshotNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.ScreenshotNewParamsGotoOptionsWaitUntilString, browser_rendering.ScreenshotNewParamsGotoOptionsWaitUntilArray.
type ScreenshotNewParamsRejectResourceType ¶ added in v7.8.0
type ScreenshotNewParamsRejectResourceType string
const ( ScreenshotNewParamsRejectResourceTypeDocument ScreenshotNewParamsRejectResourceType = "document" ScreenshotNewParamsRejectResourceTypeStylesheet ScreenshotNewParamsRejectResourceType = "stylesheet" ScreenshotNewParamsRejectResourceTypeImage ScreenshotNewParamsRejectResourceType = "image" ScreenshotNewParamsRejectResourceTypeMedia ScreenshotNewParamsRejectResourceType = "media" ScreenshotNewParamsRejectResourceTypeFont ScreenshotNewParamsRejectResourceType = "font" ScreenshotNewParamsRejectResourceTypeScript ScreenshotNewParamsRejectResourceType = "script" ScreenshotNewParamsRejectResourceTypeTexttrack ScreenshotNewParamsRejectResourceType = "texttrack" ScreenshotNewParamsRejectResourceTypeXHR ScreenshotNewParamsRejectResourceType = "xhr" ScreenshotNewParamsRejectResourceTypeFetch ScreenshotNewParamsRejectResourceType = "fetch" ScreenshotNewParamsRejectResourceTypePrefetch ScreenshotNewParamsRejectResourceType = "prefetch" ScreenshotNewParamsRejectResourceTypeEventsource ScreenshotNewParamsRejectResourceType = "eventsource" ScreenshotNewParamsRejectResourceTypeWebsocket ScreenshotNewParamsRejectResourceType = "websocket" ScreenshotNewParamsRejectResourceTypeManifest ScreenshotNewParamsRejectResourceType = "manifest" ScreenshotNewParamsRejectResourceTypeSignedexchange ScreenshotNewParamsRejectResourceType = "signedexchange" ScreenshotNewParamsRejectResourceTypePing ScreenshotNewParamsRejectResourceType = "ping" ScreenshotNewParamsRejectResourceTypeCspviolationreport ScreenshotNewParamsRejectResourceType = "cspviolationreport" ScreenshotNewParamsRejectResourceTypePreflight ScreenshotNewParamsRejectResourceType = "preflight" ScreenshotNewParamsRejectResourceTypeOther ScreenshotNewParamsRejectResourceType = "other" )
func (ScreenshotNewParamsRejectResourceType) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsRejectResourceType) IsKnown() bool
type ScreenshotNewParamsScreenshotOptions ¶ added in v7.8.0
type ScreenshotNewParamsScreenshotOptions struct {
CaptureBeyondViewport param.Field[bool] `json:"captureBeyondViewport"`
Clip param.Field[ScreenshotNewParamsScreenshotOptionsClip] `json:"clip"`
Encoding param.Field[ScreenshotNewParamsScreenshotOptionsEncoding] `json:"encoding"`
FromSurface param.Field[bool] `json:"fromSurface"`
FullPage param.Field[bool] `json:"fullPage"`
OmitBackground param.Field[bool] `json:"omitBackground"`
OptimizeForSpeed param.Field[bool] `json:"optimizeForSpeed"`
Quality param.Field[float64] `json:"quality"`
Type param.Field[ScreenshotNewParamsScreenshotOptionsType] `json:"type"`
}
Check [options](https://pptr.dev/api/puppeteer.screenshotoptions).
func (ScreenshotNewParamsScreenshotOptions) MarshalJSON ¶ added in v7.8.0
func (r ScreenshotNewParamsScreenshotOptions) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsScreenshotOptionsClip ¶ added in v7.8.0
type ScreenshotNewParamsScreenshotOptionsClip struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
X param.Field[float64] `json:"x" api:"required"`
Y param.Field[float64] `json:"y" api:"required"`
Scale param.Field[float64] `json:"scale"`
}
func (ScreenshotNewParamsScreenshotOptionsClip) MarshalJSON ¶ added in v7.8.0
func (r ScreenshotNewParamsScreenshotOptionsClip) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsScreenshotOptionsEncoding ¶ added in v7.8.0
type ScreenshotNewParamsScreenshotOptionsEncoding string
const ( ScreenshotNewParamsScreenshotOptionsEncodingBinary ScreenshotNewParamsScreenshotOptionsEncoding = "binary" ScreenshotNewParamsScreenshotOptionsEncodingBase64 ScreenshotNewParamsScreenshotOptionsEncoding = "base64" )
func (ScreenshotNewParamsScreenshotOptionsEncoding) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsScreenshotOptionsEncoding) IsKnown() bool
type ScreenshotNewParamsScreenshotOptionsType ¶ added in v7.8.0
type ScreenshotNewParamsScreenshotOptionsType string
const ( ScreenshotNewParamsScreenshotOptionsTypePNG ScreenshotNewParamsScreenshotOptionsType = "png" ScreenshotNewParamsScreenshotOptionsTypeJPEG ScreenshotNewParamsScreenshotOptionsType = "jpeg" ScreenshotNewParamsScreenshotOptionsTypeWebP ScreenshotNewParamsScreenshotOptionsType = "webp" )
func (ScreenshotNewParamsScreenshotOptionsType) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsScreenshotOptionsType) IsKnown() bool
type ScreenshotNewParamsViewport ¶ added in v7.8.0
type ScreenshotNewParamsViewport struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (ScreenshotNewParamsViewport) MarshalJSON ¶ added in v7.8.0
func (r ScreenshotNewParamsViewport) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsWaitForSelector ¶ added in v7.8.0
type ScreenshotNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector" api:"required"`
Hidden param.Field[ScreenshotNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[ScreenshotNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (ScreenshotNewParamsWaitForSelector) MarshalJSON ¶ added in v7.8.0
func (r ScreenshotNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type ScreenshotNewParamsWaitForSelectorHidden ¶ added in v7.8.0
type ScreenshotNewParamsWaitForSelectorHidden bool
const (
ScreenshotNewParamsWaitForSelectorHiddenTrue ScreenshotNewParamsWaitForSelectorHidden = true
)
func (ScreenshotNewParamsWaitForSelectorHidden) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsWaitForSelectorHidden) IsKnown() bool
type ScreenshotNewParamsWaitForSelectorVisible ¶ added in v7.8.0
type ScreenshotNewParamsWaitForSelectorVisible bool
const (
ScreenshotNewParamsWaitForSelectorVisibleTrue ScreenshotNewParamsWaitForSelectorVisible = true
)
func (ScreenshotNewParamsWaitForSelectorVisible) IsKnown ¶ added in v7.8.0
func (r ScreenshotNewParamsWaitForSelectorVisible) IsKnown() bool
type ScreenshotNewResponse ¶
type ScreenshotNewResponse struct {
// Response status.
Success bool `json:"success" api:"required"`
Errors []ScreenshotNewResponseError `json:"errors"`
JSON screenshotNewResponseJSON `json:"-"`
}
func (*ScreenshotNewResponse) UnmarshalJSON ¶
func (r *ScreenshotNewResponse) UnmarshalJSON(data []byte) (err error)
type ScreenshotNewResponseError ¶
type ScreenshotNewResponseError struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON screenshotNewResponseErrorJSON `json:"-"`
}
func (*ScreenshotNewResponseError) UnmarshalJSON ¶
func (r *ScreenshotNewResponseError) UnmarshalJSON(data []byte) (err error)
type ScreenshotService ¶
type ScreenshotService struct {
Options []option.RequestOption
}
ScreenshotService 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 NewScreenshotService method instead.
func NewScreenshotService ¶
func NewScreenshotService(opts ...option.RequestOption) (r *ScreenshotService)
NewScreenshotService 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 (*ScreenshotService) New ¶
func (r *ScreenshotService) New(ctx context.Context, params ScreenshotNewParams, opts ...option.RequestOption) (res *ScreenshotNewResponse, err error)
Takes a screenshot of a webpage from provided URL or HTML. Control page loading with `gotoOptions` and `waitFor*` options. Customize screenshots with `viewport`, `fullPage`, `clip` and others.
type SnapshotNewParams ¶
type SnapshotNewParams struct {
// Account ID.
AccountID param.Field[string] `path:"account_id" api:"required"`
// Cache TTL default is 5s. Set to 0 to disable.
CacheTTL param.Field[float64] `query:"cacheTTL"`
// The maximum duration allowed for the browser action to complete after the page
// has loaded (such as taking screenshots, extracting content, or generating PDFs).
// If this time limit is exceeded, the action stops and returns a timeout error.
ActionTimeout param.Field[float64] `json:"actionTimeout"`
// Adds a `<script>` tag into the page with the desired URL or content.
AddScriptTag param.Field[[]SnapshotNewParamsAddScriptTag] `json:"addScriptTag"`
// Adds a `<link rel="stylesheet">` tag into the page with the desired URL or a
// `<style type="text/css">` tag with the content.
AddStyleTag param.Field[[]SnapshotNewParamsAddStyleTag] `json:"addStyleTag"`
// Only allow requests that match the provided regex patterns, eg. '/^.\*\.(css)'.
AllowRequestPattern param.Field[[]string] `json:"allowRequestPattern"`
// Only allow requests that match the provided resource types, eg. 'image' or
// 'script'.
AllowResourceTypes param.Field[[]SnapshotNewParamsAllowResourceType] `json:"allowResourceTypes"`
// Provide credentials for HTTP authentication.
Authenticate param.Field[SnapshotNewParamsAuthenticate] `json:"authenticate"`
// Attempt to proceed when 'awaited' events fail or timeout.
BestAttempt param.Field[bool] `json:"bestAttempt"`
// Check [options](https://pptr.dev/api/puppeteer.page.setcookie).
Cookies param.Field[[]SnapshotNewParamsCookie] `json:"cookies"`
EmulateMediaType param.Field[string] `json:"emulateMediaType"`
Formats param.Field[[]SnapshotNewParamsFormat] `json:"formats"`
// Check [options](https://pptr.dev/api/puppeteer.gotooptions).
GotoOptions param.Field[SnapshotNewParamsGotoOptions] `json:"gotoOptions"`
// Set the content of the page, eg: `<h1>Hello World!!</h1>`. Either `html` or
// `url` must be set.
HTML param.Field[string] `json:"html"`
// Block undesired requests that match the provided regex patterns, eg.
// '/^.\*\.(css)'.
RejectRequestPattern param.Field[[]string] `json:"rejectRequestPattern"`
// Block undesired requests that match the provided resource types, eg. 'image' or
// 'script'.
RejectResourceTypes param.Field[[]SnapshotNewParamsRejectResourceType] `json:"rejectResourceTypes"`
ScreenshotOptions param.Field[SnapshotNewParamsScreenshotOptions] `json:"screenshotOptions"`
SetExtraHTTPHeaders param.Field[map[string]string] `json:"setExtraHTTPHeaders"`
SetJavaScriptEnabled param.Field[bool] `json:"setJavaScriptEnabled"`
// URL to navigate to, eg. `https://example.com`.
URL param.Field[string] `json:"url" format:"uri"`
UserAgent param.Field[string] `json:"userAgent"`
// Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
Viewport param.Field[SnapshotNewParamsViewport] `json:"viewport"`
// Wait for the selector to appear in page. Check
// [options](https://pptr.dev/api/puppeteer.page.waitforselector).
WaitForSelector param.Field[SnapshotNewParamsWaitForSelector] `json:"waitForSelector"`
// Waits for a specified timeout before continuing.
WaitForTimeout param.Field[float64] `json:"waitForTimeout"`
}
func (SnapshotNewParams) MarshalJSON ¶
func (r SnapshotNewParams) MarshalJSON() (data []byte, err error)
func (SnapshotNewParams) URLQuery ¶
func (r SnapshotNewParams) URLQuery() (v url.Values)
URLQuery serializes SnapshotNewParams's query parameters as `url.Values`.
type SnapshotNewParamsAddScriptTag ¶ added in v7.8.0
type SnapshotNewParamsAddScriptTag struct {
ID param.Field[string] `json:"id"`
Content param.Field[string] `json:"content"`
Type param.Field[string] `json:"type"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (SnapshotNewParamsAddScriptTag) MarshalJSON ¶ added in v7.8.0
func (r SnapshotNewParamsAddScriptTag) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsAddStyleTag ¶ added in v7.8.0
type SnapshotNewParamsAddStyleTag struct {
Content param.Field[string] `json:"content"`
URL param.Field[string] `json:"url" format:"uri"`
}
func (SnapshotNewParamsAddStyleTag) MarshalJSON ¶ added in v7.8.0
func (r SnapshotNewParamsAddStyleTag) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsAllowResourceType ¶ added in v7.8.0
type SnapshotNewParamsAllowResourceType string
const ( SnapshotNewParamsAllowResourceTypeDocument SnapshotNewParamsAllowResourceType = "document" SnapshotNewParamsAllowResourceTypeStylesheet SnapshotNewParamsAllowResourceType = "stylesheet" SnapshotNewParamsAllowResourceTypeImage SnapshotNewParamsAllowResourceType = "image" SnapshotNewParamsAllowResourceTypeMedia SnapshotNewParamsAllowResourceType = "media" SnapshotNewParamsAllowResourceTypeFont SnapshotNewParamsAllowResourceType = "font" SnapshotNewParamsAllowResourceTypeScript SnapshotNewParamsAllowResourceType = "script" SnapshotNewParamsAllowResourceTypeTexttrack SnapshotNewParamsAllowResourceType = "texttrack" SnapshotNewParamsAllowResourceTypeXHR SnapshotNewParamsAllowResourceType = "xhr" SnapshotNewParamsAllowResourceTypeFetch SnapshotNewParamsAllowResourceType = "fetch" SnapshotNewParamsAllowResourceTypePrefetch SnapshotNewParamsAllowResourceType = "prefetch" SnapshotNewParamsAllowResourceTypeEventsource SnapshotNewParamsAllowResourceType = "eventsource" SnapshotNewParamsAllowResourceTypeWebsocket SnapshotNewParamsAllowResourceType = "websocket" SnapshotNewParamsAllowResourceTypeManifest SnapshotNewParamsAllowResourceType = "manifest" SnapshotNewParamsAllowResourceTypeSignedexchange SnapshotNewParamsAllowResourceType = "signedexchange" SnapshotNewParamsAllowResourceTypePing SnapshotNewParamsAllowResourceType = "ping" SnapshotNewParamsAllowResourceTypeCspviolationreport SnapshotNewParamsAllowResourceType = "cspviolationreport" SnapshotNewParamsAllowResourceTypePreflight SnapshotNewParamsAllowResourceType = "preflight" SnapshotNewParamsAllowResourceTypeOther SnapshotNewParamsAllowResourceType = "other" )
func (SnapshotNewParamsAllowResourceType) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsAllowResourceType) IsKnown() bool
type SnapshotNewParamsAuthenticate ¶ added in v7.8.0
type SnapshotNewParamsAuthenticate struct {
Password param.Field[string] `json:"password" api:"required"`
Username param.Field[string] `json:"username" api:"required"`
}
Provide credentials for HTTP authentication.
func (SnapshotNewParamsAuthenticate) MarshalJSON ¶ added in v7.8.0
func (r SnapshotNewParamsAuthenticate) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsCookie ¶ added in v7.8.0
type SnapshotNewParamsCookie struct {
// Cookie name.
Name param.Field[string] `json:"name" api:"required"`
Value param.Field[string] `json:"value" api:"required"`
Domain param.Field[string] `json:"domain"`
Expires param.Field[float64] `json:"expires"`
HTTPOnly param.Field[bool] `json:"httpOnly"`
PartitionKey param.Field[string] `json:"partitionKey"`
Path param.Field[string] `json:"path"`
Priority param.Field[SnapshotNewParamsCookiesPriority] `json:"priority"`
SameParty param.Field[bool] `json:"sameParty"`
SameSite param.Field[SnapshotNewParamsCookiesSameSite] `json:"sameSite"`
Secure param.Field[bool] `json:"secure"`
SourcePort param.Field[float64] `json:"sourcePort"`
SourceScheme param.Field[SnapshotNewParamsCookiesSourceScheme] `json:"sourceScheme"`
URL param.Field[string] `json:"url"`
}
func (SnapshotNewParamsCookie) MarshalJSON ¶ added in v7.8.0
func (r SnapshotNewParamsCookie) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsCookiesPriority ¶ added in v7.8.0
type SnapshotNewParamsCookiesPriority string
const ( SnapshotNewParamsCookiesPriorityLow SnapshotNewParamsCookiesPriority = "Low" SnapshotNewParamsCookiesPriorityMedium SnapshotNewParamsCookiesPriority = "Medium" SnapshotNewParamsCookiesPriorityHigh SnapshotNewParamsCookiesPriority = "High" )
func (SnapshotNewParamsCookiesPriority) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsCookiesPriority) IsKnown() bool
type SnapshotNewParamsCookiesSameSite ¶ added in v7.8.0
type SnapshotNewParamsCookiesSameSite string
const ( SnapshotNewParamsCookiesSameSiteStrict SnapshotNewParamsCookiesSameSite = "Strict" SnapshotNewParamsCookiesSameSiteLax SnapshotNewParamsCookiesSameSite = "Lax" SnapshotNewParamsCookiesSameSiteNone SnapshotNewParamsCookiesSameSite = "None" )
func (SnapshotNewParamsCookiesSameSite) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsCookiesSameSite) IsKnown() bool
type SnapshotNewParamsCookiesSourceScheme ¶ added in v7.8.0
type SnapshotNewParamsCookiesSourceScheme string
const ( SnapshotNewParamsCookiesSourceSchemeUnset SnapshotNewParamsCookiesSourceScheme = "Unset" SnapshotNewParamsCookiesSourceSchemeNonSecure SnapshotNewParamsCookiesSourceScheme = "NonSecure" SnapshotNewParamsCookiesSourceSchemeSecure SnapshotNewParamsCookiesSourceScheme = "Secure" )
func (SnapshotNewParamsCookiesSourceScheme) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsCookiesSourceScheme) IsKnown() bool
type SnapshotNewParamsFormat ¶ added in v7.8.0
type SnapshotNewParamsFormat string
const ( SnapshotNewParamsFormatContent SnapshotNewParamsFormat = "content" SnapshotNewParamsFormatScreenshot SnapshotNewParamsFormat = "screenshot" SnapshotNewParamsFormatMarkdown SnapshotNewParamsFormat = "markdown" SnapshotNewParamsFormatAccessibilityTree SnapshotNewParamsFormat = "accessibilityTree" )
func (SnapshotNewParamsFormat) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsFormat) IsKnown() bool
type SnapshotNewParamsGotoOptions ¶ added in v7.8.0
type SnapshotNewParamsGotoOptions struct {
Referer param.Field[string] `json:"referer"`
ReferrerPolicy param.Field[string] `json:"referrerPolicy"`
Timeout param.Field[float64] `json:"timeout"`
WaitUntil param.Field[SnapshotNewParamsGotoOptionsWaitUntilUnion] `json:"waitUntil"`
}
Check [options](https://pptr.dev/api/puppeteer.gotooptions).
func (SnapshotNewParamsGotoOptions) MarshalJSON ¶ added in v7.8.0
func (r SnapshotNewParamsGotoOptions) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsGotoOptionsWaitUntilArray ¶ added in v7.8.0
type SnapshotNewParamsGotoOptionsWaitUntilArray []SnapshotNewParamsGotoOptionsWaitUntilArrayItem
type SnapshotNewParamsGotoOptionsWaitUntilArrayItem ¶ added in v7.8.0
type SnapshotNewParamsGotoOptionsWaitUntilArrayItem string
const ( SnapshotNewParamsGotoOptionsWaitUntilArrayItemLoad SnapshotNewParamsGotoOptionsWaitUntilArrayItem = "load" SnapshotNewParamsGotoOptionsWaitUntilArrayItemDomcontentloaded SnapshotNewParamsGotoOptionsWaitUntilArrayItem = "domcontentloaded" SnapshotNewParamsGotoOptionsWaitUntilArrayItemNetworkidle0 SnapshotNewParamsGotoOptionsWaitUntilArrayItem = "networkidle0" SnapshotNewParamsGotoOptionsWaitUntilArrayItemNetworkidle2 SnapshotNewParamsGotoOptionsWaitUntilArrayItem = "networkidle2" )
func (SnapshotNewParamsGotoOptionsWaitUntilArrayItem) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsGotoOptionsWaitUntilArrayItem) IsKnown() bool
type SnapshotNewParamsGotoOptionsWaitUntilString ¶ added in v7.8.0
type SnapshotNewParamsGotoOptionsWaitUntilString string
const ( SnapshotNewParamsGotoOptionsWaitUntilStringLoad SnapshotNewParamsGotoOptionsWaitUntilString = "load" SnapshotNewParamsGotoOptionsWaitUntilStringDomcontentloaded SnapshotNewParamsGotoOptionsWaitUntilString = "domcontentloaded" SnapshotNewParamsGotoOptionsWaitUntilStringNetworkidle0 SnapshotNewParamsGotoOptionsWaitUntilString = "networkidle0" SnapshotNewParamsGotoOptionsWaitUntilStringNetworkidle2 SnapshotNewParamsGotoOptionsWaitUntilString = "networkidle2" )
func (SnapshotNewParamsGotoOptionsWaitUntilString) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsGotoOptionsWaitUntilString) IsKnown() bool
type SnapshotNewParamsGotoOptionsWaitUntilUnion ¶ added in v7.8.0
type SnapshotNewParamsGotoOptionsWaitUntilUnion interface {
// contains filtered or unexported methods
}
Satisfied by browser_rendering.SnapshotNewParamsGotoOptionsWaitUntilString, browser_rendering.SnapshotNewParamsGotoOptionsWaitUntilArray.
type SnapshotNewParamsRejectResourceType ¶ added in v7.8.0
type SnapshotNewParamsRejectResourceType string
const ( SnapshotNewParamsRejectResourceTypeDocument SnapshotNewParamsRejectResourceType = "document" SnapshotNewParamsRejectResourceTypeStylesheet SnapshotNewParamsRejectResourceType = "stylesheet" SnapshotNewParamsRejectResourceTypeImage SnapshotNewParamsRejectResourceType = "image" SnapshotNewParamsRejectResourceTypeMedia SnapshotNewParamsRejectResourceType = "media" SnapshotNewParamsRejectResourceTypeFont SnapshotNewParamsRejectResourceType = "font" SnapshotNewParamsRejectResourceTypeScript SnapshotNewParamsRejectResourceType = "script" SnapshotNewParamsRejectResourceTypeTexttrack SnapshotNewParamsRejectResourceType = "texttrack" SnapshotNewParamsRejectResourceTypeXHR SnapshotNewParamsRejectResourceType = "xhr" SnapshotNewParamsRejectResourceTypeFetch SnapshotNewParamsRejectResourceType = "fetch" SnapshotNewParamsRejectResourceTypePrefetch SnapshotNewParamsRejectResourceType = "prefetch" SnapshotNewParamsRejectResourceTypeEventsource SnapshotNewParamsRejectResourceType = "eventsource" SnapshotNewParamsRejectResourceTypeWebsocket SnapshotNewParamsRejectResourceType = "websocket" SnapshotNewParamsRejectResourceTypeManifest SnapshotNewParamsRejectResourceType = "manifest" SnapshotNewParamsRejectResourceTypeSignedexchange SnapshotNewParamsRejectResourceType = "signedexchange" SnapshotNewParamsRejectResourceTypePing SnapshotNewParamsRejectResourceType = "ping" SnapshotNewParamsRejectResourceTypeCspviolationreport SnapshotNewParamsRejectResourceType = "cspviolationreport" SnapshotNewParamsRejectResourceTypePreflight SnapshotNewParamsRejectResourceType = "preflight" SnapshotNewParamsRejectResourceTypeOther SnapshotNewParamsRejectResourceType = "other" )
func (SnapshotNewParamsRejectResourceType) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsRejectResourceType) IsKnown() bool
type SnapshotNewParamsScreenshotOptions ¶ added in v7.8.0
type SnapshotNewParamsScreenshotOptions struct {
CaptureBeyondViewport param.Field[bool] `json:"captureBeyondViewport"`
Clip param.Field[SnapshotNewParamsScreenshotOptionsClip] `json:"clip"`
FromSurface param.Field[bool] `json:"fromSurface"`
FullPage param.Field[bool] `json:"fullPage"`
OmitBackground param.Field[bool] `json:"omitBackground"`
OptimizeForSpeed param.Field[bool] `json:"optimizeForSpeed"`
Quality param.Field[float64] `json:"quality"`
Type param.Field[SnapshotNewParamsScreenshotOptionsType] `json:"type"`
}
func (SnapshotNewParamsScreenshotOptions) MarshalJSON ¶ added in v7.8.0
func (r SnapshotNewParamsScreenshotOptions) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsScreenshotOptionsClip ¶ added in v7.8.0
type SnapshotNewParamsScreenshotOptionsClip struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
X param.Field[float64] `json:"x" api:"required"`
Y param.Field[float64] `json:"y" api:"required"`
Scale param.Field[float64] `json:"scale"`
}
func (SnapshotNewParamsScreenshotOptionsClip) MarshalJSON ¶ added in v7.8.0
func (r SnapshotNewParamsScreenshotOptionsClip) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsScreenshotOptionsType ¶ added in v7.8.0
type SnapshotNewParamsScreenshotOptionsType string
const ( SnapshotNewParamsScreenshotOptionsTypePNG SnapshotNewParamsScreenshotOptionsType = "png" SnapshotNewParamsScreenshotOptionsTypeJPEG SnapshotNewParamsScreenshotOptionsType = "jpeg" SnapshotNewParamsScreenshotOptionsTypeWebP SnapshotNewParamsScreenshotOptionsType = "webp" )
func (SnapshotNewParamsScreenshotOptionsType) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsScreenshotOptionsType) IsKnown() bool
type SnapshotNewParamsViewport ¶ added in v7.8.0
type SnapshotNewParamsViewport struct {
Height param.Field[float64] `json:"height" api:"required"`
Width param.Field[float64] `json:"width" api:"required"`
DeviceScaleFactor param.Field[float64] `json:"deviceScaleFactor"`
HasTouch param.Field[bool] `json:"hasTouch"`
IsLandscape param.Field[bool] `json:"isLandscape"`
IsMobile param.Field[bool] `json:"isMobile"`
}
Check [options](https://pptr.dev/api/puppeteer.page.setviewport).
func (SnapshotNewParamsViewport) MarshalJSON ¶ added in v7.8.0
func (r SnapshotNewParamsViewport) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsWaitForSelector ¶ added in v7.8.0
type SnapshotNewParamsWaitForSelector struct {
Selector param.Field[string] `json:"selector" api:"required"`
Hidden param.Field[SnapshotNewParamsWaitForSelectorHidden] `json:"hidden"`
Timeout param.Field[float64] `json:"timeout"`
Visible param.Field[SnapshotNewParamsWaitForSelectorVisible] `json:"visible"`
}
Wait for the selector to appear in page. Check [options](https://pptr.dev/api/puppeteer.page.waitforselector).
func (SnapshotNewParamsWaitForSelector) MarshalJSON ¶ added in v7.8.0
func (r SnapshotNewParamsWaitForSelector) MarshalJSON() (data []byte, err error)
type SnapshotNewParamsWaitForSelectorHidden ¶ added in v7.8.0
type SnapshotNewParamsWaitForSelectorHidden bool
const (
SnapshotNewParamsWaitForSelectorHiddenTrue SnapshotNewParamsWaitForSelectorHidden = true
)
func (SnapshotNewParamsWaitForSelectorHidden) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsWaitForSelectorHidden) IsKnown() bool
type SnapshotNewParamsWaitForSelectorVisible ¶ added in v7.8.0
type SnapshotNewParamsWaitForSelectorVisible bool
const (
SnapshotNewParamsWaitForSelectorVisibleTrue SnapshotNewParamsWaitForSelectorVisible = true
)
func (SnapshotNewParamsWaitForSelectorVisible) IsKnown ¶ added in v7.8.0
func (r SnapshotNewParamsWaitForSelectorVisible) IsKnown() bool
type SnapshotNewResponse ¶
type SnapshotNewResponse struct {
// Accessibility tree node
AccessibilityTree SnapshotNewResponseAccessibilityTree `json:"accessibilityTree"`
// HTML content.
Content string `json:"content"`
// Markdown content.
Markdown string `json:"markdown"`
// Base64 encoded image.
Screenshot string `json:"screenshot"`
JSON snapshotNewResponseJSON `json:"-"`
}
func (*SnapshotNewResponse) UnmarshalJSON ¶
func (r *SnapshotNewResponse) UnmarshalJSON(data []byte) (err error)
type SnapshotNewResponseAccessibilityTree ¶ added in v7.5.0
type SnapshotNewResponseAccessibilityTree struct {
Role string `json:"role" api:"required"`
Autocomplete string `json:"autocomplete"`
Checked SnapshotNewResponseAccessibilityTreeCheckedUnion `json:"checked"`
Children []interface{} `json:"children"`
Description string `json:"description"`
Disabled bool `json:"disabled"`
Expanded bool `json:"expanded"`
Focused bool `json:"focused"`
Haspopup string `json:"haspopup"`
Invalid string `json:"invalid"`
Keyshortcuts string `json:"keyshortcuts"`
Level float64 `json:"level"`
Modal bool `json:"modal"`
Multiline bool `json:"multiline"`
Multiselectable bool `json:"multiselectable"`
Name string `json:"name"`
Orientation string `json:"orientation"`
Pressed SnapshotNewResponseAccessibilityTreePressedUnion `json:"pressed"`
Readonly bool `json:"readonly"`
Required bool `json:"required"`
Roledescription string `json:"roledescription"`
Selected bool `json:"selected"`
Value SnapshotNewResponseAccessibilityTreeValueUnion `json:"value"`
Valuemax float64 `json:"valuemax"`
Valuemin float64 `json:"valuemin"`
Valuetext string `json:"valuetext"`
JSON snapshotNewResponseAccessibilityTreeJSON `json:"-"`
}
Accessibility tree node
func (*SnapshotNewResponseAccessibilityTree) UnmarshalJSON ¶ added in v7.5.0
func (r *SnapshotNewResponseAccessibilityTree) UnmarshalJSON(data []byte) (err error)
type SnapshotNewResponseAccessibilityTreeCheckedString ¶ added in v7.5.0
type SnapshotNewResponseAccessibilityTreeCheckedString string
const (
SnapshotNewResponseAccessibilityTreeCheckedStringMixed SnapshotNewResponseAccessibilityTreeCheckedString = "mixed"
)
func (SnapshotNewResponseAccessibilityTreeCheckedString) ImplementsSnapshotNewResponseAccessibilityTreeCheckedUnion ¶ added in v7.5.0
func (r SnapshotNewResponseAccessibilityTreeCheckedString) ImplementsSnapshotNewResponseAccessibilityTreeCheckedUnion()
func (SnapshotNewResponseAccessibilityTreeCheckedString) IsKnown ¶ added in v7.5.0
func (r SnapshotNewResponseAccessibilityTreeCheckedString) IsKnown() bool
type SnapshotNewResponseAccessibilityTreeCheckedUnion ¶ added in v7.5.0
type SnapshotNewResponseAccessibilityTreeCheckedUnion interface {
ImplementsSnapshotNewResponseAccessibilityTreeCheckedUnion()
}
Union satisfied by shared.UnionBool or SnapshotNewResponseAccessibilityTreeCheckedString.
type SnapshotNewResponseAccessibilityTreePressedString ¶ added in v7.5.0
type SnapshotNewResponseAccessibilityTreePressedString string
const (
SnapshotNewResponseAccessibilityTreePressedStringMixed SnapshotNewResponseAccessibilityTreePressedString = "mixed"
)
func (SnapshotNewResponseAccessibilityTreePressedString) ImplementsSnapshotNewResponseAccessibilityTreePressedUnion ¶ added in v7.5.0
func (r SnapshotNewResponseAccessibilityTreePressedString) ImplementsSnapshotNewResponseAccessibilityTreePressedUnion()
func (SnapshotNewResponseAccessibilityTreePressedString) IsKnown ¶ added in v7.5.0
func (r SnapshotNewResponseAccessibilityTreePressedString) IsKnown() bool
type SnapshotNewResponseAccessibilityTreePressedUnion ¶ added in v7.5.0
type SnapshotNewResponseAccessibilityTreePressedUnion interface {
ImplementsSnapshotNewResponseAccessibilityTreePressedUnion()
}
Union satisfied by shared.UnionBool or SnapshotNewResponseAccessibilityTreePressedString.
type SnapshotNewResponseAccessibilityTreeValueUnion ¶ added in v7.5.0
type SnapshotNewResponseAccessibilityTreeValueUnion interface {
ImplementsSnapshotNewResponseAccessibilityTreeValueUnion()
}
Union satisfied by shared.UnionString or shared.UnionFloat.
type SnapshotNewResponseEnvelope ¶
type SnapshotNewResponseEnvelope struct {
Meta SnapshotNewResponseEnvelopeMeta `json:"meta" api:"required"`
// Response status.
Success bool `json:"success" api:"required"`
Errors []SnapshotNewResponseEnvelopeErrors `json:"errors"`
Result SnapshotNewResponse `json:"result"`
JSON snapshotNewResponseEnvelopeJSON `json:"-"`
}
func (*SnapshotNewResponseEnvelope) UnmarshalJSON ¶
func (r *SnapshotNewResponseEnvelope) UnmarshalJSON(data []byte) (err error)
type SnapshotNewResponseEnvelopeErrors ¶
type SnapshotNewResponseEnvelopeErrors struct {
// Error code.
Code float64 `json:"code" api:"required"`
// Error message.
Message string `json:"message" api:"required"`
JSON snapshotNewResponseEnvelopeErrorsJSON `json:"-"`
}
func (*SnapshotNewResponseEnvelopeErrors) UnmarshalJSON ¶
func (r *SnapshotNewResponseEnvelopeErrors) UnmarshalJSON(data []byte) (err error)
type SnapshotNewResponseEnvelopeMeta ¶
type SnapshotNewResponseEnvelopeMeta struct {
Status float64 `json:"status"`
Title string `json:"title"`
JSON snapshotNewResponseEnvelopeMetaJSON `json:"-"`
}
func (*SnapshotNewResponseEnvelopeMeta) UnmarshalJSON ¶
func (r *SnapshotNewResponseEnvelopeMeta) UnmarshalJSON(data []byte) (err error)
type SnapshotService ¶
type SnapshotService struct {
Options []option.RequestOption
}
SnapshotService 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 NewSnapshotService method instead.
func NewSnapshotService ¶
func NewSnapshotService(opts ...option.RequestOption) (r *SnapshotService)
NewSnapshotService 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 (*SnapshotService) New ¶
func (r *SnapshotService) New(ctx context.Context, params SnapshotNewParams, opts ...option.RequestOption) (res *SnapshotNewResponse, err error)
Returns the page's HTML content and screenshot. Control page loading with `gotoOptions` and `waitFor*` options. Customize screenshots with `viewport`, `fullPage`, `clip` and others.
type SortDirection ¶
type SortDirection = shared.SortDirection
Direction to order DNS records in.
This is an alias to an internal type.
type SubscriptionFrequency ¶
type SubscriptionFrequency = shared.SubscriptionFrequency
How often the subscription is renewed automatically.
This is an alias to an internal type.
type SubscriptionParam ¶
type SubscriptionParam = shared.SubscriptionParam
This is an alias to an internal type.
type SubscriptionState ¶
type SubscriptionState = shared.SubscriptionState
The state that the subscription is in.
This is an alias to an internal type.
type TokenCondition ¶
type TokenCondition = shared.TokenCondition
This is an alias to an internal type.
type TokenConditionCIDRList ¶
type TokenConditionCIDRList = shared.TokenConditionCIDRList
IPv4/IPv6 CIDR.
This is an alias to an internal type.
type TokenConditionCIDRListParam ¶
type TokenConditionCIDRListParam = shared.TokenConditionCIDRListParam
IPv4/IPv6 CIDR.
This is an alias to an internal type.
type TokenConditionParam ¶
type TokenConditionParam = shared.TokenConditionParam
This is an alias to an internal type.
type TokenConditionRequestIP ¶
type TokenConditionRequestIP = shared.TokenConditionRequestIP
Client IP restrictions.
This is an alias to an internal type.
type TokenConditionRequestIPParam ¶
type TokenConditionRequestIPParam = shared.TokenConditionRequestIPParam
Client IP restrictions.
This is an alias to an internal type.
type TokenPolicyEffect ¶
type TokenPolicyEffect = shared.TokenPolicyEffect
Allow or deny operations against the resources.
This is an alias to an internal type.
type TokenPolicyParam ¶
type TokenPolicyParam = shared.TokenPolicyParam
This is an alias to an internal type.
type TokenPolicyPermissionGroup ¶
type TokenPolicyPermissionGroup = shared.TokenPolicyPermissionGroup
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type TokenPolicyPermissionGroupParam ¶
type TokenPolicyPermissionGroupParam = shared.TokenPolicyPermissionGroupParam
A named group of permissions that map to a group of operations against resources.
This is an alias to an internal type.
type TokenPolicyPermissionGroupsMeta ¶
type TokenPolicyPermissionGroupsMeta = shared.TokenPolicyPermissionGroupsMeta
Attributes associated to the permission group.
This is an alias to an internal type.
type TokenPolicyPermissionGroupsMetaParam ¶
type TokenPolicyPermissionGroupsMetaParam = shared.TokenPolicyPermissionGroupsMetaParam
Attributes associated to the permission group.
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectNested ¶
type TokenPolicyResourcesIAMResourcesTypeObjectNested = shared.TokenPolicyResourcesIAMResourcesTypeObjectNested
Map of nested resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam ¶
type TokenPolicyResourcesIAMResourcesTypeObjectNestedParam = shared.TokenPolicyResourcesIAMResourcesTypeObjectNestedParam
Map of nested resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectString ¶
type TokenPolicyResourcesIAMResourcesTypeObjectString = shared.TokenPolicyResourcesIAMResourcesTypeObjectString
Map of simple string resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesIAMResourcesTypeObjectStringParam ¶
type TokenPolicyResourcesIAMResourcesTypeObjectStringParam = shared.TokenPolicyResourcesIAMResourcesTypeObjectStringParam
Map of simple string resource permissions
This is an alias to an internal type.
type TokenPolicyResourcesUnion ¶
type TokenPolicyResourcesUnion = shared.TokenPolicyResourcesUnion
A list of resource names that the policy applies to.
This is an alias to an internal type.
type TokenPolicyResourcesUnionParam ¶
type TokenPolicyResourcesUnionParam = shared.TokenPolicyResourcesUnionParam
A list of resource names that the policy applies to.
This is an alias to an internal type.
type TokenStatus ¶
type TokenStatus = shared.TokenStatus
Status of the token.
This is an alias to an internal type.
type TokenValue ¶
type TokenValue = shared.TokenValue
The token value.
This is an alias to an internal type.