contextdev

package module
v2.24.0 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: Apache-2.0 Imports: 22 Imported by: 0

README

Context Dev Go API Library

Go Reference

The Context Dev Go library provides convenient access to the Context Dev REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/context-dot-dev/context-go-sdk/v2" // imported as contextdev
)

Or to pin the version:

go get -u 'github.com/context-dot-dev/context-go-sdk/v2@v2.24.0'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/context-dot-dev/context-go-sdk/v2"
	"github.com/context-dot-dev/context-go-sdk/v2/option"
)

func main() {
	client := contextdev.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("CONTEXT_DEV_API_KEY")
	)
	brand, err := client.Brand.Get(context.TODO(), contextdev.BrandGetParams{
		OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
			Domain: "stripe.com",
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", brand.RequestID)
}

Request fields

The contextdev library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `api:"required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, contextdev.String(string), contextdev.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := contextdev.ExampleParams{
	ID:   "id_xxx",                 // required property
	Name: contextdev.String("..."), // optional property

	Point: contextdev.Point{
		X: 0,                 // required field will serialize as 0
		Y: contextdev.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: contextdev.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[contextdev.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := contextdev.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Brand.Get(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *contextdev.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Brand.Get(context.TODO(), contextdev.BrandGetParams{
	OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
		Domain: "stripe.com",
	},
})
if err != nil {
	var apierr *contextdev.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/brand/retrieve": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Brand.Get(
	ctx,
	contextdev.BrandGetParams{
		OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
			Domain: "stripe.com",
		},
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper contextdev.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := contextdev.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Brand.Get(
	context.TODO(),
	contextdev.BrandGetParams{
		OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
			Domain: "stripe.com",
		},
	},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
brand, err := client.Brand.Get(
	context.TODO(),
	contextdev.BrandGetParams{
		OfByDomain: &contextdev.BrandGetParamsBodyByDomain{
			Domain: "stripe.com",
		},
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", brand)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: contextdev.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := contextdev.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (CONTEXT_DEV_API_KEY, CONTEXT_DEV_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type Attempt added in v2.15.0

type Attempt struct {
	// Attempt number, starting at 1.
	Attempt int64 `json:"attempt" api:"required"`
	// Completion time, or null while in progress.
	CompletedAt time.Time `json:"completed_at" api:"required" format:"date-time"`
	// Attempt error, or null if none.
	Error AttemptError `json:"error" api:"required"`
	// HTTP response status, or null if no response was received.
	HTTPStatus int64 `json:"http_status" api:"required"`
	// Attempt start time.
	StartedAt time.Time `json:"started_at" api:"required" format:"date-time"`
	// `initial`, `automatic` (scheduled retry), or `manual` (Retry endpoint).
	//
	// Any of "initial", "automatic", "manual".
	Trigger AttemptTrigger `json:"trigger" api:"required"`
	// URL used for this attempt.
	URL string `json:"url" api:"required" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Attempt     respjson.Field
		CompletedAt respjson.Field
		Error       respjson.Field
		HTTPStatus  respjson.Field
		StartedAt   respjson.Field
		Trigger     respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Attempt) RawJSON added in v2.15.0

func (r Attempt) RawJSON() string

Returns the unmodified JSON received from the API

func (*Attempt) UnmarshalJSON added in v2.15.0

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

type AttemptError added in v2.15.0

type AttemptError struct {
	// Error code.
	Code string `json:"code" api:"required"`
	// Error details.
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Attempt error, or null if none.

func (AttemptError) RawJSON added in v2.15.0

func (r AttemptError) RawJSON() string

Returns the unmodified JSON received from the API

func (*AttemptError) UnmarshalJSON added in v2.15.0

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

type AttemptTrigger added in v2.15.0

type AttemptTrigger string

`initial`, `automatic` (scheduled retry), or `manual` (Retry endpoint).

const (
	AttemptTriggerInitial   AttemptTrigger = "initial"
	AttemptTriggerAutomatic AttemptTrigger = "automatic"
	AttemptTriggerManual    AttemptTrigger = "manual"
)

type BatchCancelResponse added in v2.6.0

type BatchCancelResponse struct {
	// Batch ID.
	ID string `json:"id" api:"required"`
	// Crawl settings as submitted.
	Crawl CrawlControls `json:"crawl" api:"required"`
	// What this batch cost so far.
	Credits BatchCancelResponseCredits `json:"credits" api:"required"`
	// What each page is returned as.
	//
	// Any of "markdown", "html".
	Format BatchCancelResponseFormat `json:"format" api:"required"`
	// What the submission accepted.
	Input Intake `json:"input" api:"required"`
	// How pages were selected.
	//
	// Any of "scrape", "crawl".
	Mode BatchCancelResponseMode `json:"mode" api:"required"`
	// Page failures so far, grouped by error code and sorted by count.
	PageErrors []PageErrorCount `json:"page_errors" api:"required"`
	// How far the batch got before cancellation.
	Progress BatchCancelResponseProgress `json:"progress" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Always `cancelling`. Work already in flight finishes; the batch reaches
	// `cancelled` shortly after.
	//
	// Any of "cancelling".
	Status BatchCancelResponseStatus `json:"status" api:"required"`
	// Tags stored on the batch at submission.
	Tags []string `json:"tags" api:"required"`
	// Batch timestamps.
	Timing BatchCancelResponseTiming `json:"timing" api:"required"`
	// API key usage for this request.
	KeyMetadata BatchCancelResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Crawl       respjson.Field
		Credits     respjson.Field
		Format      respjson.Field
		Input       respjson.Field
		Mode        respjson.Field
		PageErrors  respjson.Field
		Progress    respjson.Field
		RequestID   respjson.Field
		Status      respjson.Field
		Tags        respjson.Field
		Timing      respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchCancelResponse) RawJSON added in v2.6.0

func (r BatchCancelResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelResponse) UnmarshalJSON added in v2.6.0

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

type BatchCancelResponseCredits added in v2.6.0

type BatchCancelResponseCredits struct {
	// Credits held at submission; unused credits are refunded when the batch settles.
	Reserved int64 `json:"reserved" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Reserved    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

What this batch cost so far.

func (BatchCancelResponseCredits) RawJSON added in v2.6.0

func (r BatchCancelResponseCredits) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelResponseCredits) UnmarshalJSON added in v2.6.0

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

type BatchCancelResponseFormat added in v2.7.0

type BatchCancelResponseFormat string

What each page is returned as.

const (
	BatchCancelResponseFormatMarkdown BatchCancelResponseFormat = "markdown"
	BatchCancelResponseFormatHTML     BatchCancelResponseFormat = "html"
)

type BatchCancelResponseKeyMetadata added in v2.6.0

type BatchCancelResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API key usage for this request.

func (BatchCancelResponseKeyMetadata) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchCancelResponseKeyMetadata) UnmarshalJSON added in v2.6.0

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

type BatchCancelResponseMode added in v2.6.0

type BatchCancelResponseMode string

How pages were selected.

const (
	BatchCancelResponseModeScrape BatchCancelResponseMode = "scrape"
	BatchCancelResponseModeCrawl  BatchCancelResponseMode = "crawl"
)

type BatchCancelResponseProgress added in v2.6.0

type BatchCancelResponseProgress struct {
	// Pages that could not be scraped before the request landed.
	Failed int64 `json:"failed" api:"required"`
	// Pages that will be skipped.
	Pending int64 `json:"pending" api:"required"`
	// Pages scraped successfully before the request landed.
	Succeeded int64 `json:"succeeded" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Failed      respjson.Field
		Pending     respjson.Field
		Succeeded   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

How far the batch got before cancellation.

func (BatchCancelResponseProgress) RawJSON added in v2.6.0

func (r BatchCancelResponseProgress) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelResponseProgress) UnmarshalJSON added in v2.6.0

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

type BatchCancelResponseStatus added in v2.6.0

type BatchCancelResponseStatus string

Always `cancelling`. Work already in flight finishes; the batch reaches `cancelled` shortly after.

const (
	BatchCancelResponseStatusCancelling BatchCancelResponseStatus = "cancelling"
)

type BatchCancelResponseTiming added in v2.6.0

type BatchCancelResponseTiming struct {
	// When the batch was created.
	CreatedAt string `json:"created_at" api:"required"`
	// When processing started. Null if it was cancelled while still queued.
	StartedAt string `json:"started_at" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreatedAt   respjson.Field
		StartedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Batch timestamps.

func (BatchCancelResponseTiming) RawJSON added in v2.6.0

func (r BatchCancelResponseTiming) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchCancelResponseTiming) UnmarshalJSON added in v2.6.0

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

type BatchDeleteResponse added in v2.9.0

type BatchDeleteResponse struct {
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// ID of the deleted batch.
	ID string `json:"id"`
	// Always true on success.
	Deleted bool `json:"deleted"`
	// Credits this request used and your remaining balance.
	KeyMetadata BatchDeleteResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		ID          respjson.Field
		Deleted     respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchDeleteResponse) RawJSON added in v2.9.0

func (r BatchDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchDeleteResponse) UnmarshalJSON added in v2.9.0

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

type BatchDeleteResponseKeyMetadata added in v2.9.0

type BatchDeleteResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (BatchDeleteResponseKeyMetadata) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*BatchDeleteResponseKeyMetadata) UnmarshalJSON added in v2.9.0

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

type BatchGetResponse added in v2.6.0

type BatchGetResponse struct {
	// Batch ID.
	ID string `json:"id" api:"required"`
	// Crawl settings as submitted.
	Crawl CrawlControls `json:"crawl" api:"required"`
	// Batch credit usage and settlement.
	Credits BatchGetResponseCredits `json:"credits" api:"required"`
	// A failure of the batch as a whole, distinct from the per-page failures in
	// `page_errors`.
	Failure Failure `json:"failure" api:"required"`
	// What each page is returned as. Matches `input.data.format` on the submit
	// request.
	//
	// Any of "markdown", "html".
	Format BatchGetResponseFormat `json:"format" api:"required"`
	// What the submission accepted.
	Input Intake `json:"input" api:"required"`
	// Rejected URLs (first 100).
	InvalidURLs []BatchGetResponseInvalidURL `json:"invalid_urls" api:"required"`
	// `scrape` (URL list) or `crawl`.
	//
	// Any of "scrape", "crawl".
	Mode BatchGetResponseMode `json:"mode" api:"required"`
	// Individual page failures grouped by error code, sorted by count. Unrelated to
	// `failure`, which is the batch itself failing.
	PageErrors []PageErrorCount `json:"page_errors" api:"required"`
	// Pages attempted so far. Use `status` to check completion.
	Progress BatchGetResponseProgress `json:"progress" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Result download links; null until the batch finishes. Files are deleted 180 days
	// after the batch finishes.
	Results BatchGetResponseResults `json:"results" api:"required"`
	// Current state. `completed`, `cancelled`, and `failed` are final.
	//
	// Any of "queued", "running", "cancelling", "completed", "cancelled", "failed".
	Status BatchGetResponseStatus `json:"status" api:"required"`
	// Tags stored on the batch at submission.
	Tags   []string               `json:"tags" api:"required"`
	Timing BatchGetResponseTiming `json:"timing" api:"required"`
	// API key usage for this request.
	KeyMetadata BatchGetResponseKeyMetadata `json:"key_metadata"`
	// Batch completion delivery ID, when available.
	WebhookDeliveryID string `json:"webhook_delivery_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                respjson.Field
		Crawl             respjson.Field
		Credits           respjson.Field
		Failure           respjson.Field
		Format            respjson.Field
		Input             respjson.Field
		InvalidURLs       respjson.Field
		Mode              respjson.Field
		PageErrors        respjson.Field
		Progress          respjson.Field
		RequestID         respjson.Field
		Results           respjson.Field
		Status            respjson.Field
		Tags              respjson.Field
		Timing            respjson.Field
		KeyMetadata       respjson.Field
		WebhookDeliveryID respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResponse) RawJSON added in v2.6.0

func (r BatchGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponse) UnmarshalJSON added in v2.6.0

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

type BatchGetResponseCredits added in v2.6.0

type BatchGetResponseCredits struct {
	// `reserved` minus `refunded` plus `ocr_charged`.
	Net int64 `json:"net" api:"required"`
	// OCR usage charged when the batch settles.
	OcrCharged int64 `json:"ocr_charged" api:"required"`
	// Credits returned for unsuccessful pages when the batch settles.
	Refunded int64 `json:"refunded" api:"required"`
	// Credits held when the batch was accepted.
	Reserved int64 `json:"reserved" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Net         respjson.Field
		OcrCharged  respjson.Field
		Refunded    respjson.Field
		Reserved    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Batch credit usage and settlement.

func (BatchGetResponseCredits) RawJSON added in v2.6.0

func (r BatchGetResponseCredits) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseCredits) UnmarshalJSON added in v2.6.0

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

type BatchGetResponseFormat added in v2.7.0

type BatchGetResponseFormat string

What each page is returned as. Matches `input.data.format` on the submit request.

const (
	BatchGetResponseFormatMarkdown BatchGetResponseFormat = "markdown"
	BatchGetResponseFormatHTML     BatchGetResponseFormat = "html"
)

type BatchGetResponseInvalidURL added in v2.6.0

type BatchGetResponseInvalidURL struct {
	// Why it was rejected.
	Reason string `json:"reason" api:"required"`
	// Rejected URL.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Reason      respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResponseInvalidURL) RawJSON added in v2.6.0

func (r BatchGetResponseInvalidURL) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseInvalidURL) UnmarshalJSON added in v2.6.0

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

type BatchGetResponseKeyMetadata added in v2.6.0

type BatchGetResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API key usage for this request.

func (BatchGetResponseKeyMetadata) RawJSON added in v2.6.0

func (r BatchGetResponseKeyMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseKeyMetadata) UnmarshalJSON added in v2.6.0

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

type BatchGetResponseMode added in v2.6.0

type BatchGetResponseMode string

`scrape` (URL list) or `crawl`.

const (
	BatchGetResponseModeScrape BatchGetResponseMode = "scrape"
	BatchGetResponseModeCrawl  BatchGetResponseMode = "crawl"
)

type BatchGetResponseProgress added in v2.6.0

type BatchGetResponseProgress struct {
	// Pages that could not be scraped.
	Failed int64 `json:"failed" api:"required"`
	// Accepted pages not yet attempted. Unused crawl capacity is excluded after
	// completion.
	Pending int64 `json:"pending" api:"required"`
	// Pages scraped successfully.
	Succeeded int64 `json:"succeeded" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Failed      respjson.Field
		Pending     respjson.Field
		Succeeded   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pages attempted so far. Use `status` to check completion.

func (BatchGetResponseProgress) RawJSON added in v2.6.0

func (r BatchGetResponseProgress) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseProgress) UnmarshalJSON added in v2.6.0

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

type BatchGetResponseResults added in v2.6.0

type BatchGetResponseResults struct {
	// When these links expire (24 hours after this response).
	ExpiresAt string `json:"expires_at" api:"required"`
	// Result files. Order is not guaranteed.
	Files []BatchGetResponseResultsFile `json:"files" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExpiresAt   respjson.Field
		Files       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Result download links; null until the batch finishes. Files are deleted 180 days after the batch finishes.

func (BatchGetResponseResults) RawJSON added in v2.6.0

func (r BatchGetResponseResults) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseResults) UnmarshalJSON added in v2.6.0

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

type BatchGetResponseResultsFile added in v2.6.0

type BatchGetResponseResultsFile struct {
	// Compressed file size in bytes.
	Bytes int64 `json:"bytes" api:"required"`
	// Results in this file.
	Items int64 `json:"items" api:"required"`
	// Temporary URL for a gzipped NDJSON file.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bytes       respjson.Field
		Items       respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResponseResultsFile) RawJSON added in v2.6.0

func (r BatchGetResponseResultsFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseResultsFile) UnmarshalJSON added in v2.6.0

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

type BatchGetResponseStatus added in v2.6.0

type BatchGetResponseStatus string

Current state. `completed`, `cancelled`, and `failed` are final.

const (
	BatchGetResponseStatusQueued     BatchGetResponseStatus = "queued"
	BatchGetResponseStatusRunning    BatchGetResponseStatus = "running"
	BatchGetResponseStatusCancelling BatchGetResponseStatus = "cancelling"
	BatchGetResponseStatusCompleted  BatchGetResponseStatus = "completed"
	BatchGetResponseStatusCancelled  BatchGetResponseStatus = "cancelled"
	BatchGetResponseStatusFailed     BatchGetResponseStatus = "failed"
)

type BatchGetResponseTiming added in v2.6.0

type BatchGetResponseTiming struct {
	// When processing finished. Null while active.
	CompletedAt string `json:"completed_at" api:"required"`
	// When the batch was created.
	CreatedAt string `json:"created_at" api:"required"`
	// When processing started. Null while queued.
	StartedAt string `json:"started_at" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletedAt respjson.Field
		CreatedAt   respjson.Field
		StartedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResponseTiming) RawJSON added in v2.6.0

func (r BatchGetResponseTiming) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResponseTiming) UnmarshalJSON added in v2.6.0

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

type BatchGetResultsParams added in v2.6.0

type BatchGetResultsParams struct {
	// next_cursor from the previous page.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Records per page. Defaults to 25. A page can close early so its payload stays
	// under ~8 MB; rely on next_cursor rather than counting records.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BatchGetResultsParams) URLQuery added in v2.6.0

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

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

type BatchGetResultsResponse added in v2.6.0

type BatchGetResultsResponse struct {
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Result records on this page.
	Data []BatchGetResultsResponseDataUnion `json:"data"`
	// Whether another page is available.
	HasMore bool `json:"has_more"`
	// Credits this request used and your remaining balance.
	KeyMetadata BatchGetResultsResponseKeyMetadata `json:"key_metadata"`
	// Cursor for the next page.
	NextCursor string `json:"next_cursor" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Data        respjson.Field
		HasMore     respjson.Field
		KeyMetadata respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResultsResponse) RawJSON added in v2.6.0

func (r BatchGetResultsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponse) UnmarshalJSON added in v2.6.0

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

type BatchGetResultsResponseDataError added in v2.6.0

type BatchGetResultsResponseDataError struct {
	// Why the page failed.
	ErrorCode string `json:"error_code" api:"required"`
	// Human-readable failure detail.
	Message string `json:"message" api:"required"`
	// The page could not be scraped.
	Status constant.Error `json:"status" default:"error"`
	// URL as submitted, or as discovered by the crawl.
	URL string `json:"url" api:"required"`
	// Your `itemId` from submission.
	ItemID string `json:"itemId"`
	// Caller-supplied metadata echoed from submission.
	Meta map[string]any `json:"meta"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ErrorCode   respjson.Field
		Message     respjson.Field
		Status      respjson.Field
		URL         respjson.Field
		ItemID      respjson.Field
		Meta        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A page the batch could not fetch.

func (BatchGetResultsResponseDataError) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataError) UnmarshalJSON added in v2.6.0

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

type BatchGetResultsResponseDataOk added in v2.6.0

type BatchGetResultsResponseDataOk struct {
	// Whether this response came from cache.
	CacheMetadata BatchGetResultsResponseDataOkCacheMetadata `json:"cache_metadata" api:"required"`
	// URL the content was read from, after redirects.
	FinalURL string `json:"final_url" api:"required"`
	// HTTP status of the final response, when known.
	HTTPStatus int64 `json:"http_status" api:"required"`
	// Metadata extracted from the scraped page HTML.
	Metadata BatchGetResultsResponseDataOkMetadata `json:"metadata" api:"required"`
	// The page was scraped.
	Status constant.Ok `json:"status" default:"ok"`
	// URL as submitted, or as discovered by the crawl.
	URL string `json:"url" api:"required"`
	// Page HTML. Present on html batches, and on markdown batches submitted with
	// `options.includeHTML`.
	HTML string `json:"html"`
	// Your `itemId` from submission.
	ItemID string `json:"itemId"`
	// Page content as Markdown. Present on markdown batches.
	Markdown string `json:"markdown"`
	// Caller-supplied metadata echoed from submission.
	Meta map[string]any `json:"meta"`
	// Number of PDF pages recovered by OCR. Omitted when OCR did not run.
	OcrPages int64 `json:"ocr_pages"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheMetadata respjson.Field
		FinalURL      respjson.Field
		HTTPStatus    respjson.Field
		Metadata      respjson.Field
		Status        respjson.Field
		URL           respjson.Field
		HTML          respjson.Field
		ItemID        respjson.Field
		Markdown      respjson.Field
		Meta          respjson.Field
		OcrPages      respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A page the batch fetched successfully.

func (BatchGetResultsResponseDataOk) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOk) UnmarshalJSON added in v2.6.0

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

type BatchGetResultsResponseDataOkCacheMetadata added in v2.13.0

type BatchGetResultsResponseDataOkCacheMetadata struct {
	// Age of the cached data in milliseconds. Zero for miss and zdr responses.
	AgeMs int64 `json:"age_ms" api:"required"`
	// Whether the response was served from cache, required fresh work, or honored
	// zero-data-retention cache bypass.
	//
	// Any of "hit", "miss", "zdr".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AgeMs       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Whether this response came from cache.

func (BatchGetResultsResponseDataOkCacheMetadata) RawJSON added in v2.13.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkCacheMetadata) UnmarshalJSON added in v2.13.0

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

type BatchGetResultsResponseDataOkMetadata added in v2.6.0

type BatchGetResultsResponseDataOkMetadata struct {
	// Final URL scraped after redirects or scraper fallback, when known. Falls back to
	// sourceUrl when unavailable.
	FinalURL string `json:"finalUrl" api:"required"`
	// Original URL requested by the caller.
	SourceURL string `json:"sourceUrl" api:"required"`
	// Additional non-social meta tags not promoted to top-level metadata fields.
	AdditionalMeta map[string]BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion `json:"additionalMeta"`
	// Resolved alternate links from link rel=alternate tags.
	Alternates []BatchGetResultsResponseDataOkMetadataAlternate `json:"alternates"`
	// Author metadata, when present.
	Author string `json:"author"`
	// Resolved canonical URL, when present.
	CanonicalURL string `json:"canonicalUrl"`
	// Best description extracted from standard, Open Graph, or Twitter metadata.
	Description string `json:"description"`
	// Resolved favicon URL, when present.
	Favicon string `json:"favicon"`
	// Page headings (h1–h6) in document order, extracted from the unfiltered document.
	// Capped at the first 500 headings. Omitted when the page has none.
	Headings []BatchGetResultsResponseDataOkMetadataHeading `json:"headings"`
	// Primary resolved preview image from Open Graph, Twitter, or image metadata.
	Image string `json:"image"`
	// JSON-LD structured data blocks parsed from the page.
	JsonLd []map[string]any `json:"jsonLd"`
	// Keywords extracted from the page's keywords meta tag.
	Keywords []string `json:"keywords"`
	// Language extracted from html lang or language meta tags.
	Language string `json:"language"`
	// Modified timestamp/date from page metadata, when present.
	ModifiedTime string `json:"modifiedTime"`
	// Open Graph metadata with the og: prefix removed and keys camel-cased.
	OpenGraph map[string]BatchGetResultsResponseDataOkMetadataOpenGraphUnion `json:"openGraph"`
	// Published timestamp/date from page metadata, when present.
	PublishedTime string `json:"publishedTime"`
	// Robots meta directive, when present.
	Robots string `json:"robots"`
	// Site or application name from page metadata.
	SiteName string `json:"siteName"`
	// Best title extracted from the page.
	Title string `json:"title"`
	// Twitter card metadata with the twitter: prefix removed and keys camel-cased.
	Twitter map[string]BatchGetResultsResponseDataOkMetadataTwitterUnion `json:"twitter"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FinalURL       respjson.Field
		SourceURL      respjson.Field
		AdditionalMeta respjson.Field
		Alternates     respjson.Field
		Author         respjson.Field
		CanonicalURL   respjson.Field
		Description    respjson.Field
		Favicon        respjson.Field
		Headings       respjson.Field
		Image          respjson.Field
		JsonLd         respjson.Field
		Keywords       respjson.Field
		Language       respjson.Field
		ModifiedTime   respjson.Field
		OpenGraph      respjson.Field
		PublishedTime  respjson.Field
		Robots         respjson.Field
		SiteName       respjson.Field
		Title          respjson.Field
		Twitter        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Metadata extracted from the scraped page HTML.

func (BatchGetResultsResponseDataOkMetadata) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadata) UnmarshalJSON added in v2.6.0

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

type BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion added in v2.6.0

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

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

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

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

func (BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion) AsString added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion) AsStringArray added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadataAdditionalMetaUnion) UnmarshalJSON added in v2.6.0

type BatchGetResultsResponseDataOkMetadataAlternate added in v2.6.0

type BatchGetResultsResponseDataOkMetadataAlternate struct {
	// Resolved alternate URL.
	Href string `json:"href" api:"required"`
	// Language or locale for the alternate URL, when present.
	Hreflang string `json:"hreflang"`
	// Alternate resource title, when present.
	Title string `json:"title"`
	// Alternate resource MIME type, when present.
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Href        respjson.Field
		Hreflang    respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResultsResponseDataOkMetadataAlternate) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadataAlternate) UnmarshalJSON added in v2.6.0

type BatchGetResultsResponseDataOkMetadataHeading added in v2.10.0

type BatchGetResultsResponseDataOkMetadataHeading struct {
	// Heading level, 1–6 (from h1–h6).
	Level int64 `json:"level" api:"required"`
	// Heading text with whitespace collapsed, truncated to 1000 characters.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Level       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchGetResultsResponseDataOkMetadataHeading) RawJSON added in v2.10.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadataHeading) UnmarshalJSON added in v2.10.0

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

type BatchGetResultsResponseDataOkMetadataOpenGraphUnion added in v2.6.0

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

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

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

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

func (BatchGetResultsResponseDataOkMetadataOpenGraphUnion) AsString added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataOpenGraphUnion) AsStringArray added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataOpenGraphUnion) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadataOpenGraphUnion) UnmarshalJSON added in v2.6.0

type BatchGetResultsResponseDataOkMetadataTwitterUnion added in v2.6.0

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

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

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

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

func (BatchGetResultsResponseDataOkMetadataTwitterUnion) AsString added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataTwitterUnion) AsStringArray added in v2.6.0

func (BatchGetResultsResponseDataOkMetadataTwitterUnion) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataOkMetadataTwitterUnion) UnmarshalJSON added in v2.6.0

type BatchGetResultsResponseDataUnion added in v2.6.0

type BatchGetResultsResponseDataUnion struct {
	// This field is from variant [BatchGetResultsResponseDataOk].
	CacheMetadata BatchGetResultsResponseDataOkCacheMetadata `json:"cache_metadata"`
	// This field is from variant [BatchGetResultsResponseDataOk].
	FinalURL string `json:"final_url"`
	// This field is from variant [BatchGetResultsResponseDataOk].
	HTTPStatus int64 `json:"http_status"`
	// This field is from variant [BatchGetResultsResponseDataOk].
	Metadata BatchGetResultsResponseDataOkMetadata `json:"metadata"`
	// Any of "ok", "error".
	Status string `json:"status"`
	URL    string `json:"url"`
	// This field is from variant [BatchGetResultsResponseDataOk].
	HTML   string `json:"html"`
	ItemID string `json:"itemId"`
	// This field is from variant [BatchGetResultsResponseDataOk].
	Markdown string `json:"markdown"`
	Meta     any    `json:"meta"`
	// This field is from variant [BatchGetResultsResponseDataOk].
	OcrPages int64 `json:"ocr_pages"`
	// This field is from variant [BatchGetResultsResponseDataError].
	ErrorCode string `json:"error_code"`
	// This field is from variant [BatchGetResultsResponseDataError].
	Message string `json:"message"`
	JSON    struct {
		CacheMetadata respjson.Field
		FinalURL      respjson.Field
		HTTPStatus    respjson.Field
		Metadata      respjson.Field
		Status        respjson.Field
		URL           respjson.Field
		HTML          respjson.Field
		ItemID        respjson.Field
		Markdown      respjson.Field
		Meta          respjson.Field
		OcrPages      respjson.Field
		ErrorCode     respjson.Field
		Message       respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

BatchGetResultsResponseDataUnion contains all possible properties and values from BatchGetResultsResponseDataOk, BatchGetResultsResponseDataError.

Use the BatchGetResultsResponseDataUnion.AsAny method to switch on the variant.

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

func (BatchGetResultsResponseDataUnion) AsAny added in v2.6.0

func (u BatchGetResultsResponseDataUnion) AsAny() anyBatchGetResultsResponseData

Use the following switch statement to find the correct variant

switch variant := BatchGetResultsResponseDataUnion.AsAny().(type) {
case contextdev.BatchGetResultsResponseDataOk:
case contextdev.BatchGetResultsResponseDataError:
default:
  fmt.Errorf("no variant present")
}

func (BatchGetResultsResponseDataUnion) AsError added in v2.6.0

func (BatchGetResultsResponseDataUnion) AsOk added in v2.6.0

func (BatchGetResultsResponseDataUnion) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseDataUnion) UnmarshalJSON added in v2.6.0

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

type BatchGetResultsResponseKeyMetadata added in v2.6.0

type BatchGetResultsResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (BatchGetResultsResponseKeyMetadata) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchGetResultsResponseKeyMetadata) UnmarshalJSON added in v2.6.0

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

type BatchListParams added in v2.6.0

type BatchListParams struct {
	// Cursor from the previous page.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Batches per page. Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Free-text search term, matched against the batch id, crawl source (start URL or
	// sitemap domain), and tags.
	Q param.Opt[string] `query:"q,omitzero" json:"-"`
	// `prefix` for as-you-type prefix matching (default), `exact` for full-token
	// matching.
	//
	// Any of "exact", "prefix".
	SearchType BatchListParamsSearchType `query:"search_type,omitzero" json:"-"`
	// Filter by status.
	//
	// Any of "queued", "running", "cancelling", "completed", "cancelled", "failed".
	Status BatchListParamsStatus `query:"status,omitzero" json:"-"`
	// Tags to filter by (matches batches having any of them). Pass repeated `tags`
	// params or one comma-separated list, e.g. `tags=docs,competitor`.
	Tags BatchListParamsTagsUnion `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BatchListParams) URLQuery added in v2.6.0

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

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

type BatchListParamsSearchType added in v2.6.0

type BatchListParamsSearchType string

`prefix` for as-you-type prefix matching (default), `exact` for full-token matching.

const (
	BatchListParamsSearchTypeExact  BatchListParamsSearchType = "exact"
	BatchListParamsSearchTypePrefix BatchListParamsSearchType = "prefix"
)

type BatchListParamsStatus added in v2.6.0

type BatchListParamsStatus string

Filter by status.

const (
	BatchListParamsStatusQueued     BatchListParamsStatus = "queued"
	BatchListParamsStatusRunning    BatchListParamsStatus = "running"
	BatchListParamsStatusCancelling BatchListParamsStatus = "cancelling"
	BatchListParamsStatusCompleted  BatchListParamsStatus = "completed"
	BatchListParamsStatusCancelled  BatchListParamsStatus = "cancelled"
	BatchListParamsStatusFailed     BatchListParamsStatus = "failed"
)

type BatchListParamsTagsUnion added in v2.23.0

type BatchListParamsTagsUnion struct {
	OfString      param.Opt[string] `query:",omitzero,inline"`
	OfStringArray []string          `query:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

type BatchListResponse added in v2.6.0

type BatchListResponse struct {
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Batches on this page.
	Data []BatchListResponseData `json:"data"`
	// Whether another page is available.
	HasMore bool `json:"has_more"`
	// Credits this request used and your remaining balance.
	KeyMetadata BatchListResponseKeyMetadata `json:"key_metadata"`
	// Cursor for the next page.
	NextCursor string `json:"next_cursor" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Data        respjson.Field
		HasMore     respjson.Field
		KeyMetadata respjson.Field
		NextCursor  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchListResponse) RawJSON added in v2.6.0

func (r BatchListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchListResponse) UnmarshalJSON added in v2.6.0

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

type BatchListResponseData added in v2.6.0

type BatchListResponseData struct {
	// Batch ID.
	ID string `json:"id" api:"required"`
	// Crawl settings as submitted.
	Crawl CrawlControls `json:"crawl" api:"required"`
	// Batch credit usage and settlement.
	Credits BatchListResponseDataCredits `json:"credits" api:"required"`
	// A failure of the batch as a whole, distinct from the per-page failures in
	// `page_errors`.
	Failure Failure `json:"failure" api:"required"`
	// What each page is returned as. Matches `input.data.format` on the submit
	// request.
	//
	// Any of "markdown", "html".
	Format string `json:"format" api:"required"`
	// What the submission accepted.
	Input Intake `json:"input" api:"required"`
	// `scrape` (URL list) or `crawl`.
	//
	// Any of "scrape", "crawl".
	Mode string `json:"mode" api:"required"`
	// Individual page failures grouped by error code, sorted by count. Unrelated to
	// `failure`, which is the batch itself failing.
	PageErrors []PageErrorCount `json:"page_errors" api:"required"`
	// Pages attempted so far. Use `status` to check completion.
	Progress BatchListResponseDataProgress `json:"progress" api:"required"`
	// Result download links; null until the batch finishes. Files are deleted 180 days
	// after the batch finishes.
	Results BatchListResponseDataResults `json:"results" api:"required"`
	// Current state. `completed`, `cancelled`, and `failed` are final.
	//
	// Any of "queued", "running", "cancelling", "completed", "cancelled", "failed".
	Status string `json:"status" api:"required"`
	// Tags stored on the batch at submission.
	Tags   []string                    `json:"tags" api:"required"`
	Timing BatchListResponseDataTiming `json:"timing" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Crawl       respjson.Field
		Credits     respjson.Field
		Failure     respjson.Field
		Format      respjson.Field
		Input       respjson.Field
		Mode        respjson.Field
		PageErrors  respjson.Field
		Progress    respjson.Field
		Results     respjson.Field
		Status      respjson.Field
		Tags        respjson.Field
		Timing      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An asynchronous web scraping job.

func (BatchListResponseData) RawJSON added in v2.6.0

func (r BatchListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchListResponseData) UnmarshalJSON added in v2.6.0

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

type BatchListResponseDataCredits added in v2.6.0

type BatchListResponseDataCredits struct {
	// `reserved` minus `refunded` plus `ocr_charged`.
	Net int64 `json:"net" api:"required"`
	// OCR usage charged when the batch settles.
	OcrCharged int64 `json:"ocr_charged" api:"required"`
	// Credits returned for unsuccessful pages when the batch settles.
	Refunded int64 `json:"refunded" api:"required"`
	// Credits held when the batch was accepted.
	Reserved int64 `json:"reserved" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Net         respjson.Field
		OcrCharged  respjson.Field
		Refunded    respjson.Field
		Reserved    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Batch credit usage and settlement.

func (BatchListResponseDataCredits) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchListResponseDataCredits) UnmarshalJSON added in v2.6.0

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

type BatchListResponseDataProgress added in v2.6.0

type BatchListResponseDataProgress struct {
	// Pages that could not be scraped.
	Failed int64 `json:"failed" api:"required"`
	// Accepted pages not yet attempted. Unused crawl capacity is excluded after
	// completion.
	Pending int64 `json:"pending" api:"required"`
	// Pages scraped successfully.
	Succeeded int64 `json:"succeeded" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Failed      respjson.Field
		Pending     respjson.Field
		Succeeded   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pages attempted so far. Use `status` to check completion.

func (BatchListResponseDataProgress) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchListResponseDataProgress) UnmarshalJSON added in v2.6.0

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

type BatchListResponseDataResults added in v2.6.0

type BatchListResponseDataResults struct {
	// When these links expire (24 hours after this response).
	ExpiresAt string `json:"expires_at" api:"required"`
	// Result files. Order is not guaranteed.
	Files []BatchListResponseDataResultsFile `json:"files" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExpiresAt   respjson.Field
		Files       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Result download links; null until the batch finishes. Files are deleted 180 days after the batch finishes.

func (BatchListResponseDataResults) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchListResponseDataResults) UnmarshalJSON added in v2.6.0

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

type BatchListResponseDataResultsFile added in v2.6.0

type BatchListResponseDataResultsFile struct {
	// Compressed file size in bytes.
	Bytes int64 `json:"bytes" api:"required"`
	// Results in this file.
	Items int64 `json:"items" api:"required"`
	// Temporary URL for a gzipped NDJSON file.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bytes       respjson.Field
		Items       respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchListResponseDataResultsFile) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchListResponseDataResultsFile) UnmarshalJSON added in v2.6.0

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

type BatchListResponseDataTiming added in v2.6.0

type BatchListResponseDataTiming struct {
	// When processing finished. Null while active.
	CompletedAt string `json:"completed_at" api:"required"`
	// When the batch was created.
	CreatedAt string `json:"created_at" api:"required"`
	// When processing started. Null while queued.
	StartedAt string `json:"started_at" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompletedAt respjson.Field
		CreatedAt   respjson.Field
		StartedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchListResponseDataTiming) RawJSON added in v2.6.0

func (r BatchListResponseDataTiming) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchListResponseDataTiming) UnmarshalJSON added in v2.6.0

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

type BatchListResponseKeyMetadata added in v2.6.0

type BatchListResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (BatchListResponseKeyMetadata) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchListResponseKeyMetadata) UnmarshalJSON added in v2.6.0

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

type BatchService added in v2.6.0

type BatchService struct {
	// contains filtered or unexported fields
}

Scrape many pages or crawl a site asynchronously.

BatchService contains methods and other services that help with interacting with the context.dev 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 NewBatchService method instead.

func NewBatchService added in v2.6.0

func NewBatchService(opts ...option.RequestOption) (r BatchService)

NewBatchService 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 (*BatchService) Cancel added in v2.6.0

func (r *BatchService) Cancel(ctx context.Context, batchID string, opts ...option.RequestOption) (res *BatchCancelResponse, err error)

Stop a batch from starting new pages. Pages already in progress finish before the batch becomes cancelled.

func (*BatchService) Delete added in v2.9.0

func (r *BatchService) Delete(ctx context.Context, batchID string, opts ...option.RequestOption) (res *BatchDeleteResponse, err error)

Permanently delete a finished batch and its results. Its webhook deliveries can no longer be retried.

func (*BatchService) Get added in v2.6.0

func (r *BatchService) Get(ctx context.Context, batchID string, opts ...option.RequestOption) (res *BatchGetResponse, err error)

Get batch progress and result download links. Result files are deleted 180 days after the batch finishes.

func (*BatchService) GetResults added in v2.6.0

func (r *BatchService) GetResults(ctx context.Context, batchID string, query BatchGetResultsParams, opts ...option.RequestOption) (res *BatchGetResultsResponse, err error)

Page through a finished batch’s results as JSON. Results remain available for 180 days.

func (*BatchService) List added in v2.6.0

func (r *BatchService) List(ctx context.Context, query BatchListParams, opts ...option.RequestOption) (res *BatchListResponse, err error)

List your batches, newest first, with optional filters.

func (*BatchService) Submit added in v2.6.0

func (r *BatchService) Submit(ctx context.Context, params BatchSubmitParams, opts ...option.RequestOption) (res *BatchSubmitResponse, err error)

Scrape up to 25,000 URLs, or crawl a site, asynchronously. Poll the batch ID or receive a webhook when it finishes.

type BatchSubmitParams added in v2.6.0

type BatchSubmitParams struct {
	// Choose a URL list or a site crawl.
	Input BatchSubmitParamsInputUnion `json:"input,omitzero" api:"required"`
	// Legacy URL notified when the batch finishes. Preserves one best-effort attempt.
	// Cannot be combined with webhook.
	WebhookURL param.Opt[string] `json:"webhookUrl,omitzero" format:"uri"`
	// Unique key per submission. Retrying with the same key and body returns the
	// original batch; a different body returns `409`.
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	// Tags stored on the batch. Filter the batch list by them later.
	Tags []string `json:"tags,omitzero"`
	// Where to send the batch's final-status event. Omit `retry` for one attempt; `{}`
	// uses the default retry schedule.
	Webhook BatchSubmitParamsWebhook `json:"webhook,omitzero"`
	// contains filtered or unexported fields
}

func (BatchSubmitParams) MarshalJSON added in v2.6.0

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

func (*BatchSubmitParams) UnmarshalJSON added in v2.6.0

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

type BatchSubmitParamsInputCrawl added in v2.9.0

type BatchSubmitParamsInputCrawl struct {
	// Crawl source and output format.
	Data BatchSubmitParamsInputCrawlDataUnion `json:"data,omitzero" api:"required"`
	// Discover and scrape pages from `data.source`.
	//
	// This field can be elided, and will marshal its zero value as "crawl".
	Mode constant.Crawl `json:"mode" default:"crawl"`
	// contains filtered or unexported fields
}

Crawl pages starting from a URL or from a domain's sitemap.

The properties Data, Mode are required.

func (BatchSubmitParamsInputCrawl) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawl) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputCrawlDataHTML added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTML struct {
	// How to find pages to crawl.
	Source BatchSubmitParamsInputCrawlDataHTMLSourceUnion `json:"source,omitzero" api:"required"`
	// Options for HTML output.
	Options BatchSubmitParamsInputCrawlDataHTMLOptions `json:"options,omitzero"`
	// Return page content as HTML.
	//
	// This field can be elided, and will marshal its zero value as "html".
	Format constant.HTML `json:"format" default:"html"`
	// contains filtered or unexported fields
}

Crawl pages and return HTML.

The properties Format, Source are required.

func (BatchSubmitParamsInputCrawlDataHTML) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawlDataHTML) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputCrawlDataHTMLOptions added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLOptions struct {
	// Maximum cache age in milliseconds. Defaults to 3 days (259200000 ms). Maximum: 1
	// year (31536000000 ms). `0` fetches fresh.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Wait for CSS animations to finish before extracting, on browser-rendered pages.
	SettleAnimations param.Opt[bool] `json:"settleAnimations,omitzero"`
	// Return the main content without navigation or footers.
	UseMainContentOnly param.Opt[bool] `json:"useMainContentOnly,omitzero"`
	// How long to wait after initial page load, in milliseconds. `0` waits 500 ms.
	WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"`
	// Remove elements matching these CSS selectors. Applied after `includeSelectors`,
	// so an element matching both is removed.
	ExcludeSelectors []string `json:"excludeSelectors,omitzero"`
	// Keep only elements matching these CSS selectors. Filtered pages ignore
	// `maxAgeMs`.
	IncludeSelectors []string `json:"includeSelectors,omitzero"`
	// Fetch from this country (ISO 3166-1 alpha-2).
	//
	// Any of "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "at", "au", "aw",
	// "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo",
	// "bq", "br", "bs", "bw", "by", "bz", "ca", "cd", "cf", "cg", "ch", "ci", "cl",
	// "cm", "cn", "co", "cr", "cv", "cw", "cy", "cz", "de", "dj", "dk", "dm", "do",
	// "dz", "ec", "ee", "eg", "es", "et", "fi", "fj", "fr", "ga", "gb", "gd", "ge",
	// "gf", "gg", "gh", "gm", "gn", "gp", "gq", "gr", "gt", "gu", "gw", "gy", "hk",
	// "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "iq", "ir", "is", "it",
	// "je", "jm", "jo", "jp", "ke", "kg", "kh", "kn", "kr", "kw", "ky", "kz", "la",
	// "lb", "lc", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
	// "mf", "mg", "mk", "ml", "mm", "mn", "mo", "mq", "mr", "mt", "mu", "mv", "mw",
	// "mx", "my", "mz", "na", "nc", "ne", "ng", "ni", "nl", "no", "np", "nz", "om",
	// "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pr", "ps", "pt", "py", "qa", "re",
	// "ro", "rs", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm",
	// "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tg", "th",
	// "tj", "tl", "tm", "tn", "tr", "tt", "tw", "tz", "ua", "ug", "us", "uy", "uz",
	// "vc", "ve", "vg", "vi", "vn", "ye", "yt", "za", "zm", "zw".
	Country string `json:"country,omitzero"`
	// PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.
	Pdf BatchSubmitParamsInputCrawlDataHTMLOptionsPdf `json:"pdf,omitzero"`
	// contains filtered or unexported fields
}

Options for HTML output.

func (BatchSubmitParamsInputCrawlDataHTMLOptions) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawlDataHTMLOptions) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputCrawlDataHTMLOptionsPdf added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLOptionsPdf struct {
	// Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must
	// be >= start.
	End param.Opt[int64] `json:"end,omitzero"`
	// Read scanned PDF pages with OCR; preserve pages that already have text.
	Ocr param.Opt[bool] `json:"ocr,omitzero"`
	// Parse PDF URLs. When false, PDFs fail with `PDF_SKIPPED`.
	ShouldParse param.Opt[bool] `json:"shouldParse,omitzero"`
	// First 1-based PDF page to parse.
	Start param.Opt[int64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.

func (BatchSubmitParamsInputCrawlDataHTMLOptionsPdf) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawlDataHTMLOptionsPdf) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputCrawlDataHTMLSourceSitemap added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLSourceSitemap struct {
	// Domain whose sitemap lists the pages to scrape. A full URL is reduced to its
	// domain.
	Domain string `json:"domain" api:"required"`
	// Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those
	// URLs and never follows links off them, so there is no crawl depth here.
	Controls BatchSubmitParamsInputCrawlDataHTMLSourceSitemapControls `json:"controls,omitzero"`
	// Scrape the URLs in the domain's sitemap.
	//
	// This field can be elided, and will marshal its zero value as "sitemap".
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// contains filtered or unexported fields
}

Scrape the pages listed in a domain's sitemap. Links on those pages are not followed.

The properties Domain, Type are required.

func (BatchSubmitParamsInputCrawlDataHTMLSourceSitemap) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawlDataHTMLSourceSitemap) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLSourceSitemapControls added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLSourceSitemapControls struct {
	// Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000.
	MaxURLs param.Opt[int64] `json:"maxUrls,omitzero"`
	// RE2 pattern; only sitemap URLs matching it are scraped.
	Regex param.Opt[string] `json:"regex,omitzero"`
	// contains filtered or unexported fields
}

Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those URLs and never follows links off them, so there is no crawl depth here.

func (BatchSubmitParamsInputCrawlDataHTMLSourceSitemapControls) MarshalJSON added in v2.9.0

func (*BatchSubmitParamsInputCrawlDataHTMLSourceSitemapControls) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLSourceStartURL added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLSourceStartURL struct {
	// Page where crawling begins. A URL without a scheme is read as https://.
	URL string `json:"url" api:"required"`
	// Limits and filters for page discovery.
	Controls BatchSubmitParamsInputCrawlDataHTMLSourceStartURLControls `json:"controls,omitzero"`
	// Start from one page.
	//
	// This field can be elided, and will marshal its zero value as "start_url".
	Type constant.StartURL `json:"type" default:"start_url"`
	// contains filtered or unexported fields
}

Discover pages by following links from one URL.

The properties Type, URL are required.

func (BatchSubmitParamsInputCrawlDataHTMLSourceStartURL) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawlDataHTMLSourceStartURL) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLSourceStartURLControls added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLSourceStartURLControls struct {
	// Follow links to subdomains.
	FollowSubdomains param.Opt[bool] `json:"followSubdomains,omitzero"`
	// Maximum link depth. Source pages are depth 0. No limit when omitted.
	MaxDepth param.Opt[int64] `json:"maxDepth,omitzero"`
	// Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000.
	MaxURLs param.Opt[int64] `json:"maxUrls,omitzero"`
	// RE2 pattern for URLs to include. The `start_url` itself is always included.
	Regex param.Opt[string] `json:"regex,omitzero"`
	// contains filtered or unexported fields
}

Limits and filters for page discovery.

func (BatchSubmitParamsInputCrawlDataHTMLSourceStartURLControls) MarshalJSON added in v2.9.0

func (*BatchSubmitParamsInputCrawlDataHTMLSourceStartURLControls) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLSourceUnion added in v2.9.0

type BatchSubmitParamsInputCrawlDataHTMLSourceUnion struct {
	OfStartURL *BatchSubmitParamsInputCrawlDataHTMLSourceStartURL `json:",omitzero,inline"`
	OfSitemap  *BatchSubmitParamsInputCrawlDataHTMLSourceSitemap  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BatchSubmitParamsInputCrawlDataHTMLSourceUnion) MarshalJSON added in v2.9.0

func (*BatchSubmitParamsInputCrawlDataHTMLSourceUnion) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdown added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdown struct {
	// How to find pages to crawl.
	Source BatchSubmitParamsInputCrawlDataMarkdownSourceUnion `json:"source,omitzero" api:"required"`
	// Options for Markdown output.
	Options BatchSubmitParamsInputCrawlDataMarkdownOptions `json:"options,omitzero"`
	// Return page content as Markdown.
	//
	// This field can be elided, and will marshal its zero value as "markdown".
	Format constant.Markdown `json:"format" default:"markdown"`
	// contains filtered or unexported fields
}

Crawl pages and return Markdown.

The properties Format, Source are required.

func (BatchSubmitParamsInputCrawlDataMarkdown) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawlDataMarkdown) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputCrawlDataMarkdownOptions added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownOptions struct {
	// Maximum cache age in milliseconds. Defaults to 3 days (259200000 ms). Maximum: 1
	// year (31536000000 ms). `0` fetches fresh.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Also return each page's HTML in `html`.
	IncludeHTML param.Opt[bool] `json:"includeHTML,omitzero"`
	// Include image references in the Markdown.
	IncludeImages param.Opt[bool] `json:"includeImages,omitzero"`
	// Include links in the Markdown.
	IncludeLinks param.Opt[bool] `json:"includeLinks,omitzero"`
	// Wait for CSS animations to finish before extracting, on browser-rendered pages.
	SettleAnimations param.Opt[bool] `json:"settleAnimations,omitzero"`
	// Shorten inline base64 image data.
	ShortenBase64Images param.Opt[bool] `json:"shortenBase64Images,omitzero"`
	// Return the main content without navigation or footers.
	UseMainContentOnly param.Opt[bool] `json:"useMainContentOnly,omitzero"`
	// How long to wait after initial page load, in milliseconds. `0` waits 500 ms.
	WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"`
	// Remove elements matching these CSS selectors. Applied after `includeSelectors`,
	// so an element matching both is removed.
	ExcludeSelectors []string `json:"excludeSelectors,omitzero"`
	// Keep only elements matching these CSS selectors. Filtered pages ignore
	// `maxAgeMs`.
	IncludeSelectors []string `json:"includeSelectors,omitzero"`
	// Fetch from this country (ISO 3166-1 alpha-2).
	//
	// Any of "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "at", "au", "aw",
	// "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo",
	// "bq", "br", "bs", "bw", "by", "bz", "ca", "cd", "cf", "cg", "ch", "ci", "cl",
	// "cm", "cn", "co", "cr", "cv", "cw", "cy", "cz", "de", "dj", "dk", "dm", "do",
	// "dz", "ec", "ee", "eg", "es", "et", "fi", "fj", "fr", "ga", "gb", "gd", "ge",
	// "gf", "gg", "gh", "gm", "gn", "gp", "gq", "gr", "gt", "gu", "gw", "gy", "hk",
	// "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "iq", "ir", "is", "it",
	// "je", "jm", "jo", "jp", "ke", "kg", "kh", "kn", "kr", "kw", "ky", "kz", "la",
	// "lb", "lc", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
	// "mf", "mg", "mk", "ml", "mm", "mn", "mo", "mq", "mr", "mt", "mu", "mv", "mw",
	// "mx", "my", "mz", "na", "nc", "ne", "ng", "ni", "nl", "no", "np", "nz", "om",
	// "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pr", "ps", "pt", "py", "qa", "re",
	// "ro", "rs", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm",
	// "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tg", "th",
	// "tj", "tl", "tm", "tn", "tr", "tt", "tw", "tz", "ua", "ug", "us", "uy", "uz",
	// "vc", "ve", "vg", "vi", "vn", "ye", "yt", "za", "zm", "zw".
	Country string `json:"country,omitzero"`
	// PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.
	Pdf BatchSubmitParamsInputCrawlDataMarkdownOptionsPdf `json:"pdf,omitzero"`
	// contains filtered or unexported fields
}

Options for Markdown output.

func (BatchSubmitParamsInputCrawlDataMarkdownOptions) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawlDataMarkdownOptions) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownOptionsPdf added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownOptionsPdf struct {
	// Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must
	// be >= start.
	End param.Opt[int64] `json:"end,omitzero"`
	// Read scanned PDF pages with OCR; preserve pages that already have text.
	Ocr param.Opt[bool] `json:"ocr,omitzero"`
	// Parse PDF URLs. When false, PDFs fail with `PDF_SKIPPED`.
	ShouldParse param.Opt[bool] `json:"shouldParse,omitzero"`
	// First 1-based PDF page to parse.
	Start param.Opt[int64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.

func (BatchSubmitParamsInputCrawlDataMarkdownOptionsPdf) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawlDataMarkdownOptionsPdf) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownSourceSitemap added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownSourceSitemap struct {
	// Domain whose sitemap lists the pages to scrape. A full URL is reduced to its
	// domain.
	Domain string `json:"domain" api:"required"`
	// Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those
	// URLs and never follows links off them, so there is no crawl depth here.
	Controls BatchSubmitParamsInputCrawlDataMarkdownSourceSitemapControls `json:"controls,omitzero"`
	// Scrape the URLs in the domain's sitemap.
	//
	// This field can be elided, and will marshal its zero value as "sitemap".
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// contains filtered or unexported fields
}

Scrape the pages listed in a domain's sitemap. Links on those pages are not followed.

The properties Domain, Type are required.

func (BatchSubmitParamsInputCrawlDataMarkdownSourceSitemap) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawlDataMarkdownSourceSitemap) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownSourceSitemapControls added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownSourceSitemapControls struct {
	// Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000.
	MaxURLs param.Opt[int64] `json:"maxUrls,omitzero"`
	// RE2 pattern; only sitemap URLs matching it are scraped.
	Regex param.Opt[string] `json:"regex,omitzero"`
	// contains filtered or unexported fields
}

Limits and filters for the sitemap URLs. A sitemap batch scrapes exactly those URLs and never follows links off them, so there is no crawl depth here.

func (BatchSubmitParamsInputCrawlDataMarkdownSourceSitemapControls) MarshalJSON added in v2.9.0

func (*BatchSubmitParamsInputCrawlDataMarkdownSourceSitemapControls) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownSourceStartURL added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownSourceStartURL struct {
	// Page where crawling begins. A URL without a scheme is read as https://.
	URL string `json:"url" api:"required"`
	// Limits and filters for page discovery.
	Controls BatchSubmitParamsInputCrawlDataMarkdownSourceStartURLControls `json:"controls,omitzero"`
	// Start from one page.
	//
	// This field can be elided, and will marshal its zero value as "start_url".
	Type constant.StartURL `json:"type" default:"start_url"`
	// contains filtered or unexported fields
}

Discover pages by following links from one URL.

The properties Type, URL are required.

func (BatchSubmitParamsInputCrawlDataMarkdownSourceStartURL) MarshalJSON added in v2.9.0

func (*BatchSubmitParamsInputCrawlDataMarkdownSourceStartURL) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownSourceStartURLControls added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownSourceStartURLControls struct {
	// Follow links to subdomains.
	FollowSubdomains param.Opt[bool] `json:"followSubdomains,omitzero"`
	// Maximum link depth. Source pages are depth 0. No limit when omitted.
	MaxDepth param.Opt[int64] `json:"maxDepth,omitzero"`
	// Maximum pages to fetch. Unused reserved credits are refunded. Maximum 25000.
	MaxURLs param.Opt[int64] `json:"maxUrls,omitzero"`
	// RE2 pattern for URLs to include. The `start_url` itself is always included.
	Regex param.Opt[string] `json:"regex,omitzero"`
	// contains filtered or unexported fields
}

Limits and filters for page discovery.

func (BatchSubmitParamsInputCrawlDataMarkdownSourceStartURLControls) MarshalJSON added in v2.9.0

func (*BatchSubmitParamsInputCrawlDataMarkdownSourceStartURLControls) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownSourceUnion added in v2.9.0

type BatchSubmitParamsInputCrawlDataMarkdownSourceUnion struct {
	OfStartURL *BatchSubmitParamsInputCrawlDataMarkdownSourceStartURL `json:",omitzero,inline"`
	OfSitemap  *BatchSubmitParamsInputCrawlDataMarkdownSourceSitemap  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BatchSubmitParamsInputCrawlDataMarkdownSourceUnion) MarshalJSON added in v2.9.0

func (*BatchSubmitParamsInputCrawlDataMarkdownSourceUnion) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputCrawlDataUnion added in v2.9.0

type BatchSubmitParamsInputCrawlDataUnion struct {
	OfMarkdown *BatchSubmitParamsInputCrawlDataMarkdown `json:",omitzero,inline"`
	OfHTML     *BatchSubmitParamsInputCrawlDataHTML     `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BatchSubmitParamsInputCrawlDataUnion) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputCrawlDataUnion) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputScrape added in v2.9.0

type BatchSubmitParamsInputScrape struct {
	// Pages to scrape and their output format.
	Data BatchSubmitParamsInputScrapeDataUnion `json:"data,omitzero" api:"required"`
	// Scrape the pages in `data.urls`.
	//
	// This field can be elided, and will marshal its zero value as "scrape".
	Mode constant.Scrape `json:"mode" default:"scrape"`
	// contains filtered or unexported fields
}

Scrape a list of up to 25,000 URLs.

The properties Data, Mode are required.

func (BatchSubmitParamsInputScrape) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputScrape) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputScrapeDataHTML added in v2.9.0

type BatchSubmitParamsInputScrapeDataHTML struct {
	// Pages to scrape. Maximum 25000.
	URLs []BatchSubmitParamsInputScrapeDataHTMLURL `json:"urls,omitzero" api:"required"`
	// Options for HTML output.
	Options BatchSubmitParamsInputScrapeDataHTMLOptions `json:"options,omitzero"`
	// Return page content as HTML.
	//
	// This field can be elided, and will marshal its zero value as "html".
	Format constant.HTML `json:"format" default:"html"`
	// contains filtered or unexported fields
}

Scrape the listed pages as HTML.

The properties Format, URLs are required.

func (BatchSubmitParamsInputScrapeDataHTML) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputScrapeDataHTML) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputScrapeDataHTMLOptions added in v2.9.0

type BatchSubmitParamsInputScrapeDataHTMLOptions struct {
	// Maximum cache age in milliseconds. Defaults to 3 days (259200000 ms). Maximum: 1
	// year (31536000000 ms). `0` fetches fresh.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Wait for CSS animations to finish before extracting, on browser-rendered pages.
	SettleAnimations param.Opt[bool] `json:"settleAnimations,omitzero"`
	// Return the main content without navigation or footers.
	UseMainContentOnly param.Opt[bool] `json:"useMainContentOnly,omitzero"`
	// How long to wait after initial page load, in milliseconds. `0` waits 500 ms.
	WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"`
	// Remove elements matching these CSS selectors. Applied after `includeSelectors`,
	// so an element matching both is removed.
	ExcludeSelectors []string `json:"excludeSelectors,omitzero"`
	// Keep only elements matching these CSS selectors. Filtered pages ignore
	// `maxAgeMs`.
	IncludeSelectors []string `json:"includeSelectors,omitzero"`
	// Fetch from this country (ISO 3166-1 alpha-2).
	//
	// Any of "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "at", "au", "aw",
	// "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo",
	// "bq", "br", "bs", "bw", "by", "bz", "ca", "cd", "cf", "cg", "ch", "ci", "cl",
	// "cm", "cn", "co", "cr", "cv", "cw", "cy", "cz", "de", "dj", "dk", "dm", "do",
	// "dz", "ec", "ee", "eg", "es", "et", "fi", "fj", "fr", "ga", "gb", "gd", "ge",
	// "gf", "gg", "gh", "gm", "gn", "gp", "gq", "gr", "gt", "gu", "gw", "gy", "hk",
	// "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "iq", "ir", "is", "it",
	// "je", "jm", "jo", "jp", "ke", "kg", "kh", "kn", "kr", "kw", "ky", "kz", "la",
	// "lb", "lc", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
	// "mf", "mg", "mk", "ml", "mm", "mn", "mo", "mq", "mr", "mt", "mu", "mv", "mw",
	// "mx", "my", "mz", "na", "nc", "ne", "ng", "ni", "nl", "no", "np", "nz", "om",
	// "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pr", "ps", "pt", "py", "qa", "re",
	// "ro", "rs", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm",
	// "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tg", "th",
	// "tj", "tl", "tm", "tn", "tr", "tt", "tw", "tz", "ua", "ug", "us", "uy", "uz",
	// "vc", "ve", "vg", "vi", "vn", "ye", "yt", "za", "zm", "zw".
	Country string `json:"country,omitzero"`
	// PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.
	Pdf BatchSubmitParamsInputScrapeDataHTMLOptionsPdf `json:"pdf,omitzero"`
	// contains filtered or unexported fields
}

Options for HTML output.

func (BatchSubmitParamsInputScrapeDataHTMLOptions) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputScrapeDataHTMLOptions) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputScrapeDataHTMLOptionsPdf added in v2.9.0

type BatchSubmitParamsInputScrapeDataHTMLOptionsPdf struct {
	// Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must
	// be >= start.
	End param.Opt[int64] `json:"end,omitzero"`
	// Read scanned PDF pages with OCR; preserve pages that already have text.
	Ocr param.Opt[bool] `json:"ocr,omitzero"`
	// Parse PDF URLs. When false, PDFs fail with `PDF_SKIPPED`.
	ShouldParse param.Opt[bool] `json:"shouldParse,omitzero"`
	// First 1-based PDF page to parse.
	Start param.Opt[int64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.

func (BatchSubmitParamsInputScrapeDataHTMLOptionsPdf) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputScrapeDataHTMLOptionsPdf) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputScrapeDataHTMLURL added in v2.9.0

type BatchSubmitParamsInputScrapeDataHTMLURL struct {
	// Page URL to scrape.
	URL string `json:"url" api:"required"`
	// Your ID for this page, returned with its result. The same URL can use different
	// IDs.
	ItemID param.Opt[string] `json:"itemId,omitzero"`
	// Custom JSON returned unchanged with this page result.
	Meta map[string]any `json:"meta,omitzero"`
	// contains filtered or unexported fields
}

A page to scrape, with optional data for matching results.

The property URL is required.

func (BatchSubmitParamsInputScrapeDataHTMLURL) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputScrapeDataHTMLURL) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputScrapeDataMarkdown added in v2.9.0

type BatchSubmitParamsInputScrapeDataMarkdown struct {
	// Pages to scrape. Maximum 25000.
	URLs []BatchSubmitParamsInputScrapeDataMarkdownURL `json:"urls,omitzero" api:"required"`
	// Options for Markdown output.
	Options BatchSubmitParamsInputScrapeDataMarkdownOptions `json:"options,omitzero"`
	// Return page content as Markdown.
	//
	// This field can be elided, and will marshal its zero value as "markdown".
	Format constant.Markdown `json:"format" default:"markdown"`
	// contains filtered or unexported fields
}

Scrape the listed pages as Markdown.

The properties Format, URLs are required.

func (BatchSubmitParamsInputScrapeDataMarkdown) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputScrapeDataMarkdown) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputScrapeDataMarkdownOptions added in v2.9.0

type BatchSubmitParamsInputScrapeDataMarkdownOptions struct {
	// Maximum cache age in milliseconds. Defaults to 3 days (259200000 ms). Maximum: 1
	// year (31536000000 ms). `0` fetches fresh.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Also return each page's HTML in `html`.
	IncludeHTML param.Opt[bool] `json:"includeHTML,omitzero"`
	// Include image references in the Markdown.
	IncludeImages param.Opt[bool] `json:"includeImages,omitzero"`
	// Include links in the Markdown.
	IncludeLinks param.Opt[bool] `json:"includeLinks,omitzero"`
	// Wait for CSS animations to finish before extracting, on browser-rendered pages.
	SettleAnimations param.Opt[bool] `json:"settleAnimations,omitzero"`
	// Shorten inline base64 image data.
	ShortenBase64Images param.Opt[bool] `json:"shortenBase64Images,omitzero"`
	// Return the main content without navigation or footers.
	UseMainContentOnly param.Opt[bool] `json:"useMainContentOnly,omitzero"`
	// How long to wait after initial page load, in milliseconds. `0` waits 500 ms.
	WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"`
	// Remove elements matching these CSS selectors. Applied after `includeSelectors`,
	// so an element matching both is removed.
	ExcludeSelectors []string `json:"excludeSelectors,omitzero"`
	// Keep only elements matching these CSS selectors. Filtered pages ignore
	// `maxAgeMs`.
	IncludeSelectors []string `json:"includeSelectors,omitzero"`
	// Fetch from this country (ISO 3166-1 alpha-2).
	//
	// Any of "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "at", "au", "aw",
	// "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo",
	// "bq", "br", "bs", "bw", "by", "bz", "ca", "cd", "cf", "cg", "ch", "ci", "cl",
	// "cm", "cn", "co", "cr", "cv", "cw", "cy", "cz", "de", "dj", "dk", "dm", "do",
	// "dz", "ec", "ee", "eg", "es", "et", "fi", "fj", "fr", "ga", "gb", "gd", "ge",
	// "gf", "gg", "gh", "gm", "gn", "gp", "gq", "gr", "gt", "gu", "gw", "gy", "hk",
	// "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "iq", "ir", "is", "it",
	// "je", "jm", "jo", "jp", "ke", "kg", "kh", "kn", "kr", "kw", "ky", "kz", "la",
	// "lb", "lc", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
	// "mf", "mg", "mk", "ml", "mm", "mn", "mo", "mq", "mr", "mt", "mu", "mv", "mw",
	// "mx", "my", "mz", "na", "nc", "ne", "ng", "ni", "nl", "no", "np", "nz", "om",
	// "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pr", "ps", "pt", "py", "qa", "re",
	// "ro", "rs", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm",
	// "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tg", "th",
	// "tj", "tl", "tm", "tn", "tr", "tt", "tw", "tz", "ua", "ug", "us", "uy", "uz",
	// "vc", "ve", "vg", "vi", "vn", "ye", "yt", "za", "zm", "zw".
	Country string `json:"country,omitzero"`
	// PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.
	Pdf BatchSubmitParamsInputScrapeDataMarkdownOptionsPdf `json:"pdf,omitzero"`
	// contains filtered or unexported fields
}

Options for Markdown output.

func (BatchSubmitParamsInputScrapeDataMarkdownOptions) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputScrapeDataMarkdownOptions) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputScrapeDataMarkdownOptionsPdf added in v2.9.0

type BatchSubmitParamsInputScrapeDataMarkdownOptionsPdf struct {
	// Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must
	// be >= start.
	End param.Opt[int64] `json:"end,omitzero"`
	// Read scanned PDF pages with OCR; preserve pages that already have text.
	Ocr param.Opt[bool] `json:"ocr,omitzero"`
	// Parse PDF URLs. When false, PDFs fail with `PDF_SKIPPED`.
	ShouldParse param.Opt[bool] `json:"shouldParse,omitzero"`
	// First 1-based PDF page to parse.
	Start param.Opt[int64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.

func (BatchSubmitParamsInputScrapeDataMarkdownOptionsPdf) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputScrapeDataMarkdownOptionsPdf) UnmarshalJSON added in v2.9.0

type BatchSubmitParamsInputScrapeDataMarkdownURL added in v2.9.0

type BatchSubmitParamsInputScrapeDataMarkdownURL struct {
	// Page URL to scrape.
	URL string `json:"url" api:"required"`
	// Your ID for this page, returned with its result. The same URL can use different
	// IDs.
	ItemID param.Opt[string] `json:"itemId,omitzero"`
	// Custom JSON returned unchanged with this page result.
	Meta map[string]any `json:"meta,omitzero"`
	// contains filtered or unexported fields
}

A page to scrape, with optional data for matching results.

The property URL is required.

func (BatchSubmitParamsInputScrapeDataMarkdownURL) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputScrapeDataMarkdownURL) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputScrapeDataUnion added in v2.9.0

type BatchSubmitParamsInputScrapeDataUnion struct {
	OfMarkdown *BatchSubmitParamsInputScrapeDataMarkdown `json:",omitzero,inline"`
	OfHTML     *BatchSubmitParamsInputScrapeDataHTML     `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BatchSubmitParamsInputScrapeDataUnion) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputScrapeDataUnion) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsInputUnion added in v2.9.0

type BatchSubmitParamsInputUnion struct {
	OfScrape *BatchSubmitParamsInputScrape `json:",omitzero,inline"`
	OfCrawl  *BatchSubmitParamsInputCrawl  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BatchSubmitParamsInputUnion) MarshalJSON added in v2.9.0

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

func (*BatchSubmitParamsInputUnion) UnmarshalJSON added in v2.9.0

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

type BatchSubmitParamsWebhook added in v2.15.0

type BatchSubmitParamsWebhook struct {
	// Public HTTP(S) URL that receives batch completion, failure, or cancellation
	// events.
	URL string `json:"url" api:"required" format:"uri"`
	// Webhook retry settings. Use {} for the default schedule.
	Retry RetryConfigParam `json:"retry,omitzero"`
	// contains filtered or unexported fields
}

Where to send the batch's final-status event. Omit `retry` for one attempt; `{}` uses the default retry schedule.

The property URL is required.

func (BatchSubmitParamsWebhook) MarshalJSON added in v2.15.0

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

func (*BatchSubmitParamsWebhook) UnmarshalJSON added in v2.15.0

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

type BatchSubmitResponse added in v2.6.0

type BatchSubmitResponse struct {
	// Batch ID. Poll GET /batch/{batch_id} with it.
	ID string `json:"id" api:"required"`
	// Whether this response came from cache.
	CacheMetadata BatchSubmitResponseCacheMetadata `json:"cache_metadata" api:"required"`
	// Crawl settings as submitted.
	Crawl CrawlControls `json:"crawl" api:"required"`
	// When the batch was created.
	CreatedAt string `json:"created_at" api:"required"`
	// What accepting this batch cost.
	Credits BatchSubmitResponseCredits `json:"credits" api:"required"`
	// What each page will be returned as.
	//
	// Any of "markdown", "html".
	Format BatchSubmitResponseFormat `json:"format" api:"required"`
	// What the submission accepted.
	Input Intake `json:"input" api:"required"`
	// Rejected URLs (first 100).
	InvalidURLs []BatchSubmitResponseInvalidURL `json:"invalid_urls" api:"required"`
	// How pages will be selected.
	//
	// Any of "scrape", "crawl".
	Mode BatchSubmitResponseMode `json:"mode" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Always `queued`. An accepted batch has not started yet.
	//
	// Any of "queued".
	Status BatchSubmitResponseStatus `json:"status" api:"required"`
	// Tags stored on the batch.
	Tags []string `json:"tags" api:"required"`
	// API key usage for this request.
	KeyMetadata BatchSubmitResponseKeyMetadata `json:"key_metadata"`
	// Secret for verifying `X-Context-Signature`. Only submit returns it, so store it.
	WebhookSecret string `json:"webhook_secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CacheMetadata respjson.Field
		Crawl         respjson.Field
		CreatedAt     respjson.Field
		Credits       respjson.Field
		Format        respjson.Field
		Input         respjson.Field
		InvalidURLs   respjson.Field
		Mode          respjson.Field
		RequestID     respjson.Field
		Status        respjson.Field
		Tags          respjson.Field
		KeyMetadata   respjson.Field
		WebhookSecret respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchSubmitResponse) RawJSON added in v2.6.0

func (r BatchSubmitResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchSubmitResponse) UnmarshalJSON added in v2.6.0

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

type BatchSubmitResponseCacheMetadata added in v2.13.0

type BatchSubmitResponseCacheMetadata struct {
	// Age of the cached data in milliseconds. Zero for miss and zdr responses.
	AgeMs int64 `json:"age_ms" api:"required"`
	// Whether the response was served from cache, required fresh work, or honored
	// zero-data-retention cache bypass.
	//
	// Any of "hit", "miss", "zdr".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AgeMs       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Whether this response came from cache.

func (BatchSubmitResponseCacheMetadata) RawJSON added in v2.13.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponseCacheMetadata) UnmarshalJSON added in v2.13.0

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

type BatchSubmitResponseCredits added in v2.9.0

type BatchSubmitResponseCredits struct {
	// Credits held at submission.
	Reserved int64 `json:"reserved" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Reserved    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

What accepting this batch cost.

func (BatchSubmitResponseCredits) RawJSON added in v2.9.0

func (r BatchSubmitResponseCredits) RawJSON() string

Returns the unmodified JSON received from the API

func (*BatchSubmitResponseCredits) UnmarshalJSON added in v2.9.0

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

type BatchSubmitResponseFormat added in v2.9.0

type BatchSubmitResponseFormat string

What each page will be returned as.

const (
	BatchSubmitResponseFormatMarkdown BatchSubmitResponseFormat = "markdown"
	BatchSubmitResponseFormatHTML     BatchSubmitResponseFormat = "html"
)

type BatchSubmitResponseInvalidURL added in v2.9.0

type BatchSubmitResponseInvalidURL struct {
	// Why it was rejected.
	Reason string `json:"reason" api:"required"`
	// Rejected URL.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Reason      respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BatchSubmitResponseInvalidURL) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponseInvalidURL) UnmarshalJSON added in v2.9.0

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

type BatchSubmitResponseKeyMetadata added in v2.6.0

type BatchSubmitResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API key usage for this request.

func (BatchSubmitResponseKeyMetadata) RawJSON added in v2.6.0

Returns the unmodified JSON received from the API

func (*BatchSubmitResponseKeyMetadata) UnmarshalJSON added in v2.6.0

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

type BatchSubmitResponseMode added in v2.9.0

type BatchSubmitResponseMode string

How pages will be selected.

const (
	BatchSubmitResponseModeScrape BatchSubmitResponseMode = "scrape"
	BatchSubmitResponseModeCrawl  BatchSubmitResponseMode = "crawl"
)

type BatchSubmitResponseStatus added in v2.6.0

type BatchSubmitResponseStatus string

Always `queued`. An accepted batch has not started yet.

const (
	BatchSubmitResponseStatusQueued BatchSubmitResponseStatus = "queued"
)

type BrandGetParams

type BrandGetParams struct {

	// This field is a request body variant, only one variant field can be set.
	// Retrieve brand data by domain. Cannot be combined with name, email, or ticker.
	OfByDomain *BrandGetParamsBodyByDomain `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Retrieve brand data by company name. Cannot be combined with domain, email, or
	// ticker.
	OfByName *BrandGetParamsBodyByName `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Retrieve brand data by email address. The domain is extracted from the email.
	// Free and disposable email providers are rejected with 422. Cannot be combined
	// with domain, name, or ticker.
	OfByEmail *BrandGetParamsBodyByEmail `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Retrieve brand data by stock ticker. Cannot be combined with domain, name, or
	// email.
	OfByTicker *BrandGetParamsBodyByTicker `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Retrieve brand data from this exact URL. Cross-site enrichment and other lookup
	// identifiers are excluded.
	OfByDirectURL *BrandGetParamsBodyByDirectURL `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Identify brand data from a transaction descriptor. Cannot be combined with
	// domain, name, email, or ticker.
	OfByTransaction *BrandGetParamsBodyByTransaction `json:",inline"`
	// contains filtered or unexported fields
}

func (BrandGetParams) MarshalJSON

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

func (*BrandGetParams) UnmarshalJSON

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

type BrandGetParamsBodyByDirectURL added in v2.1.0

type BrandGetParamsBodyByDirectURL struct {
	// Full http(s) URL to fetch brand data from (e.g.,
	// 'https://stripe.com/enterprise'). Only this URL is fetched — not the entire
	// internet.
	DirectURL string `json:"direct_url" api:"required" format:"uri"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts BrandGetParamsBodyByDirectURLTimeoutOpts `json:"timeoutOpts,omitzero"`
	// Discriminator for direct-URL-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_direct_url".
	Type constant.ByDirectURL `json:"type" default:"by_direct_url"`
	// contains filtered or unexported fields
}

Retrieve brand data from this exact URL. Cross-site enrichment and other lookup identifiers are excluded.

The properties DirectURL, Type are required.

func (BrandGetParamsBodyByDirectURL) MarshalJSON added in v2.1.0

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

func (*BrandGetParamsBodyByDirectURL) UnmarshalJSON added in v2.1.0

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

type BrandGetParamsBodyByDirectURLTimeoutOpts added in v2.17.0

type BrandGetParamsBodyByDirectURLTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (BrandGetParamsBodyByDirectURLTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*BrandGetParamsBodyByDirectURLTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type BrandGetParamsBodyByDomain

type BrandGetParamsBodyByDomain struct {
	// Domain name to retrieve brand data for (e.g., 'stripe.com').
	Domain string `json:"domain" api:"required"`
	// Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1
	// year. `0` refreshes.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Optional parameter to optimize the API call for maximum speed. When set to true,
	// the API will skip time-consuming operations for faster response at the cost of
	// less comprehensive data.
	MaxSpeed param.Opt[bool] `json:"maxSpeed,omitzero"`
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	ForceLanguage string `json:"force_language,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts BrandGetParamsBodyByDomainTimeoutOpts `json:"timeoutOpts,omitzero"`
	// Discriminator for domain-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_domain".
	Type constant.ByDomain `json:"type" default:"by_domain"`
	// contains filtered or unexported fields
}

Retrieve brand data by domain. Cannot be combined with name, email, or ticker.

The properties Domain, Type are required.

func (BrandGetParamsBodyByDomain) MarshalJSON

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

func (*BrandGetParamsBodyByDomain) UnmarshalJSON

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

type BrandGetParamsBodyByDomainTimeoutOpts added in v2.17.0

type BrandGetParamsBodyByDomainTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (BrandGetParamsBodyByDomainTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*BrandGetParamsBodyByDomainTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type BrandGetParamsBodyByEmail

type BrandGetParamsBodyByEmail struct {
	// Email address to retrieve brand data for (e.g., 'jane@stripe.com').
	Email string `json:"email" api:"required" format:"email"`
	// Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1
	// year. `0` refreshes.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Optional parameter to optimize the API call for maximum speed. When set to true,
	// the API will skip time-consuming operations for faster response at the cost of
	// less comprehensive data.
	MaxSpeed param.Opt[bool] `json:"maxSpeed,omitzero"`
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	ForceLanguage string `json:"force_language,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts BrandGetParamsBodyByEmailTimeoutOpts `json:"timeoutOpts,omitzero"`
	// Discriminator for email-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_email".
	Type constant.ByEmail `json:"type" default:"by_email"`
	// contains filtered or unexported fields
}

Retrieve brand data by email address. The domain is extracted from the email. Free and disposable email providers are rejected with 422. Cannot be combined with domain, name, or ticker.

The properties Email, Type are required.

func (BrandGetParamsBodyByEmail) MarshalJSON

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

func (*BrandGetParamsBodyByEmail) UnmarshalJSON

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

type BrandGetParamsBodyByEmailTimeoutOpts added in v2.17.0

type BrandGetParamsBodyByEmailTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (BrandGetParamsBodyByEmailTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*BrandGetParamsBodyByEmailTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type BrandGetParamsBodyByName

type BrandGetParamsBodyByName struct {
	// Company name to retrieve brand data for (e.g., 'Apple Inc').
	Name string `json:"name" api:"required"`
	// Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1
	// year. `0` refreshes.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Optional parameter to optimize the API call for maximum speed. When set to true,
	// the API will skip time-consuming operations for faster response at the cost of
	// less comprehensive data.
	MaxSpeed param.Opt[bool] `json:"maxSpeed,omitzero"`
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	ForceLanguage string `json:"force_language,omitzero"`
	// Two-letter ISO 3166-1 alpha-2 country code (GL parameter) used to localize
	// search.
	//
	// Any of "af", "al", "dz", "as", "ad", "ao", "ai", "aq", "ag", "ar", "am", "aw",
	// "au", "at", "az", "bs", "bh", "bd", "bb", "by", "be", "bz", "bj", "bm", "bt",
	// "bo", "ba", "bw", "bv", "br", "io", "bn", "bg", "bf", "bi", "kh", "cm", "ca",
	// "cv", "ky", "cf", "td", "cl", "cn", "cx", "cc", "co", "km", "cg", "cd", "ck",
	// "cr", "ci", "hr", "cu", "cy", "cz", "dk", "dj", "dm", "do", "ec", "eg", "sv",
	// "gq", "er", "ee", "et", "fk", "fo", "fj", "fi", "fr", "gf", "pf", "tf", "ga",
	// "gm", "ge", "de", "gh", "gi", "gr", "gl", "gd", "gp", "gu", "gt", "gn", "gw",
	// "gy", "ht", "hm", "va", "hn", "hk", "hu", "is", "in", "id", "ir", "iq", "ie",
	// "il", "it", "jm", "jp", "jo", "kz", "ke", "ki", "kp", "kr", "kw", "kg", "la",
	// "lv", "lb", "ls", "lr", "ly", "li", "lt", "lu", "mo", "mk", "mg", "mw", "my",
	// "mv", "ml", "mt", "mh", "mq", "mr", "mu", "yt", "mx", "fm", "md", "mc", "mn",
	// "ms", "ma", "mz", "mm", "na", "nr", "np", "nl", "an", "nc", "nz", "ni", "ne",
	// "ng", "nu", "nf", "mp", "no", "om", "pk", "pw", "ps", "pa", "pg", "py", "pe",
	// "ph", "pn", "pl", "pt", "pr", "qa", "re", "ro", "ru", "rw", "sh", "kn", "lc",
	// "pm", "vc", "ws", "sm", "st", "sa", "sn", "rs", "sc", "sl", "sg", "sk", "si",
	// "sb", "so", "za", "gs", "es", "lk", "sd", "sr", "sj", "sz", "se", "ch", "sy",
	// "tw", "tj", "tz", "th", "tl", "tg", "tk", "to", "tt", "tn", "tr", "tm", "tc",
	// "tv", "ug", "ua", "ae", "gb", "us", "um", "uy", "uz", "vu", "ve", "vn", "vg",
	// "vi", "wf", "eh", "ye", "zm", "zw".
	CountryGl string `json:"country_gl,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts BrandGetParamsBodyByNameTimeoutOpts `json:"timeoutOpts,omitzero"`
	// Discriminator for name-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_name".
	Type constant.ByName `json:"type" default:"by_name"`
	// contains filtered or unexported fields
}

Retrieve brand data by company name. Cannot be combined with domain, email, or ticker.

The properties Name, Type are required.

func (BrandGetParamsBodyByName) MarshalJSON

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

func (*BrandGetParamsBodyByName) UnmarshalJSON

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

type BrandGetParamsBodyByNameTimeoutOpts added in v2.17.0

type BrandGetParamsBodyByNameTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (BrandGetParamsBodyByNameTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*BrandGetParamsBodyByNameTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type BrandGetParamsBodyByTicker

type BrandGetParamsBodyByTicker struct {
	// Stock ticker symbol to retrieve brand data for (e.g., 'AAPL').
	Ticker string `json:"ticker" api:"required"`
	// Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1
	// year. `0` refreshes.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Optional parameter to optimize the API call for maximum speed. When set to true,
	// the API will skip time-consuming operations for faster response at the cost of
	// less comprehensive data.
	MaxSpeed param.Opt[bool] `json:"maxSpeed,omitzero"`
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	ForceLanguage string `json:"force_language,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Stock exchange code.
	//
	// Any of "AMEX", "AMS", "AQS", "ASX", "ATH", "BER", "BME", "BRU", "BSE", "BUD",
	// "BUE", "BVC", "CBOE", "CNQ", "CPH", "DFM", "DOH", "DUB", "DUS", "DXE", "EGX",
	// "FSX", "HAM", "HEL", "HKSE", "HOSE", "ICE", "IOB", "IST", "JKT", "JNB", "JPX",
	// "KLS", "KOE", "KSC", "KUW", "LIS", "LSE", "MCX", "MEX", "MIL", "MUN", "NASDAQ",
	// "NEO", "NSE", "NYSE", "NZE", "OSL", "OTC", "PAR", "PNK", "PRA", "RIS", "SAO",
	// "SAU", "SES", "SET", "SGO", "SHH", "SHZ", "SIX", "STO", "STU", "TAI", "TAL",
	// "TLV", "TSX", "TSXV", "TWO", "VIE", "WSE", "XETRA".
	TickerExchange string `json:"ticker_exchange,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts BrandGetParamsBodyByTickerTimeoutOpts `json:"timeoutOpts,omitzero"`
	// Discriminator for ticker-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_ticker".
	Type constant.ByTicker `json:"type" default:"by_ticker"`
	// contains filtered or unexported fields
}

Retrieve brand data by stock ticker. Cannot be combined with domain, name, or email.

The properties Ticker, Type are required.

func (BrandGetParamsBodyByTicker) MarshalJSON

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

func (*BrandGetParamsBodyByTicker) UnmarshalJSON

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

type BrandGetParamsBodyByTickerTimeoutOpts added in v2.17.0

type BrandGetParamsBodyByTickerTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (BrandGetParamsBodyByTickerTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*BrandGetParamsBodyByTickerTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type BrandGetParamsBodyByTransaction

type BrandGetParamsBodyByTransaction struct {
	// Transaction information to identify the brand.
	TransactionInfo string `json:"transaction_info" api:"required"`
	// Optional city name to prioritize when searching for the brand.
	City param.Opt[string] `json:"city,omitzero"`
	// When set to true, the API performs additional verification to ensure the
	// identified brand matches the transaction with high confidence.
	HighConfidenceOnly param.Opt[bool] `json:"high_confidence_only,omitzero"`
	// Optional parameter to optimize the API call for maximum speed. When set to true,
	// the API will skip time-consuming operations for faster response at the cost of
	// less comprehensive data.
	MaxSpeed param.Opt[bool] `json:"maxSpeed,omitzero"`
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	ForceLanguage string `json:"force_language,omitzero"`
	// Two-letter ISO 3166-1 alpha-2 country code (GL parameter) used to localize
	// search.
	//
	// Any of "af", "al", "dz", "as", "ad", "ao", "ai", "aq", "ag", "ar", "am", "aw",
	// "au", "at", "az", "bs", "bh", "bd", "bb", "by", "be", "bz", "bj", "bm", "bt",
	// "bo", "ba", "bw", "bv", "br", "io", "bn", "bg", "bf", "bi", "kh", "cm", "ca",
	// "cv", "ky", "cf", "td", "cl", "cn", "cx", "cc", "co", "km", "cg", "cd", "ck",
	// "cr", "ci", "hr", "cu", "cy", "cz", "dk", "dj", "dm", "do", "ec", "eg", "sv",
	// "gq", "er", "ee", "et", "fk", "fo", "fj", "fi", "fr", "gf", "pf", "tf", "ga",
	// "gm", "ge", "de", "gh", "gi", "gr", "gl", "gd", "gp", "gu", "gt", "gn", "gw",
	// "gy", "ht", "hm", "va", "hn", "hk", "hu", "is", "in", "id", "ir", "iq", "ie",
	// "il", "it", "jm", "jp", "jo", "kz", "ke", "ki", "kp", "kr", "kw", "kg", "la",
	// "lv", "lb", "ls", "lr", "ly", "li", "lt", "lu", "mo", "mk", "mg", "mw", "my",
	// "mv", "ml", "mt", "mh", "mq", "mr", "mu", "yt", "mx", "fm", "md", "mc", "mn",
	// "ms", "ma", "mz", "mm", "na", "nr", "np", "nl", "an", "nc", "nz", "ni", "ne",
	// "ng", "nu", "nf", "mp", "no", "om", "pk", "pw", "ps", "pa", "pg", "py", "pe",
	// "ph", "pn", "pl", "pt", "pr", "qa", "re", "ro", "ru", "rw", "sh", "kn", "lc",
	// "pm", "vc", "ws", "sm", "st", "sa", "sn", "rs", "sc", "sl", "sg", "sk", "si",
	// "sb", "so", "za", "gs", "es", "lk", "sd", "sr", "sj", "sz", "se", "ch", "sy",
	// "tw", "tj", "tz", "th", "tl", "tg", "tk", "to", "tt", "tn", "tr", "tm", "tc",
	// "tv", "ug", "ua", "ae", "gb", "us", "um", "uy", "uz", "vu", "ve", "vn", "vg",
	// "vi", "wf", "eh", "ye", "zm", "zw".
	CountryGl string `json:"country_gl,omitzero"`
	// Optional Merchant Category Code (MCC) to help identify the business category or
	// industry.
	Mcc BrandGetParamsBodyByTransactionMccUnion `json:"mcc,omitzero"`
	// Optional phone number from the transaction to help verify brand match.
	Phone BrandGetParamsBodyByTransactionPhoneUnion `json:"phone,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts BrandGetParamsBodyByTransactionTimeoutOpts `json:"timeoutOpts,omitzero"`
	// Discriminator for transaction-based brand retrieval.
	//
	// This field can be elided, and will marshal its zero value as "by_transaction".
	Type constant.ByTransaction `json:"type" default:"by_transaction"`
	// contains filtered or unexported fields
}

Identify brand data from a transaction descriptor. Cannot be combined with domain, name, email, or ticker.

The properties TransactionInfo, Type are required.

func (BrandGetParamsBodyByTransaction) MarshalJSON

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

func (*BrandGetParamsBodyByTransaction) UnmarshalJSON

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

type BrandGetParamsBodyByTransactionMccUnion added in v2.5.0

type BrandGetParamsBodyByTransactionMccUnion struct {
	OfString param.Opt[string]  `json:",omitzero,inline"`
	OfFloat  param.Opt[float64] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BrandGetParamsBodyByTransactionMccUnion) MarshalJSON added in v2.5.0

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

func (*BrandGetParamsBodyByTransactionMccUnion) UnmarshalJSON added in v2.5.0

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

type BrandGetParamsBodyByTransactionPhoneUnion added in v2.5.0

type BrandGetParamsBodyByTransactionPhoneUnion struct {
	OfString param.Opt[string]  `json:",omitzero,inline"`
	OfFloat  param.Opt[float64] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (BrandGetParamsBodyByTransactionPhoneUnion) MarshalJSON added in v2.5.0

func (*BrandGetParamsBodyByTransactionPhoneUnion) UnmarshalJSON added in v2.5.0

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

type BrandGetParamsBodyByTransactionTimeoutOpts added in v2.17.0

type BrandGetParamsBodyByTransactionTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (BrandGetParamsBodyByTransactionTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*BrandGetParamsBodyByTransactionTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type BrandGetResponse

type BrandGetResponse struct {
	// Detailed brand information
	Brand BrandGetResponseBrand `json:"brand" api:"required"`
	// Whether this response came from cache.
	CacheMetadata BrandGetResponseCacheMetadata `json:"cache_metadata" api:"required"`
	// HTTP status code
	Code int64 `json:"code" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Always `ok` on success.
	Status string `json:"status" api:"required"`
	// Credits this request used and your remaining balance.
	KeyMetadata BrandGetResponseKeyMetadata `json:"key_metadata"`
	// True when the timeout ended processing and this response contains the usable
	// data completed so far. Unfinished fields are omitted.
	Partial bool `json:"partial"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Brand         respjson.Field
		CacheMetadata respjson.Field
		Code          respjson.Field
		RequestID     respjson.Field
		Status        respjson.Field
		KeyMetadata   respjson.Field
		Partial       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponse) RawJSON

func (r BrandGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponse) UnmarshalJSON

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

type BrandGetResponseBrand

type BrandGetResponseBrand struct {
	// Physical address of the brand
	Address BrandGetResponseBrandAddress `json:"address"`
	// An array of backdrop images for the brand
	Backdrops []BrandGetResponseBrandBackdrop `json:"backdrops"`
	// An array of brand colors
	Colors []BrandGetResponseBrandColor `json:"colors"`
	// A brief description of the brand
	Description string `json:"description"`
	// The domain name of the brand
	Domain string `json:"domain"`
	// Company email address
	Email string `json:"email"`
	// Employee headcount information for the brand (will be null if unknown)
	Employees BrandGetResponseBrandEmployees `json:"employees"`
	// Industry classification information for the brand
	Industries BrandGetResponseBrandIndustries `json:"industries"`
	// Indicates whether the brand content is not safe for work (NSFW)
	IsNsfw bool `json:"is_nsfw"`
	// Important website links for the brand
	Links BrandGetResponseBrandLinks `json:"links"`
	// An array of logos associated with the brand. When a similarly shaped SVG variant
	// exists, it is returned ahead of its raster equivalent; otherwise relevance order
	// is preserved
	Logos []BrandGetResponseBrandLogo `json:"logos"`
	// Company phone number
	Phone string `json:"phone"`
	// Language, e.g. `english`.
	//
	// Any of "afrikaans", "albanian", "amharic", "arabic", "armenian", "assamese",
	// "aymara", "azeri", "basque", "belarusian", "bengali", "bosnian", "bulgarian",
	// "burmese", "cantonese", "catalan", "cebuano", "chinese", "corsican", "croatian",
	// "czech", "danish", "dutch", "english", "esperanto", "estonian", "farsi",
	// "fijian", "finnish", "french", "galician", "georgian", "german", "greek",
	// "guarani", "gujarati", "haitian-creole", "hausa", "hawaiian", "hebrew", "hindi",
	// "hmong", "hungarian", "icelandic", "igbo", "indonesian", "irish", "italian",
	// "japanese", "javanese", "kannada", "kazakh", "khmer", "kinyarwanda", "korean",
	// "kurdish", "kyrgyz", "lao", "latin", "latvian", "lingala", "lithuanian",
	// "luxembourgish", "macedonian", "malagasy", "malay", "malayalam", "maltese",
	// "maori", "marathi", "mongolian", "nepali", "norwegian", "odia", "oromo",
	// "pashto", "pidgin", "polish", "portuguese", "punjabi", "quechua", "romanian",
	// "russian", "samoan", "scottish-gaelic", "serbian", "sesotho", "shona", "sindhi",
	// "sinhala", "slovak", "slovene", "somali", "spanish", "sundanese", "swahili",
	// "swedish", "tagalog", "tajik", "tamil", "tatar", "telugu", "thai", "tibetan",
	// "tigrinya", "tongan", "tswana", "turkish", "turkmen", "ukrainian", "urdu",
	// "uyghur", "uzbek", "vietnamese", "welsh", "wolof", "xhosa", "yiddish", "yoruba",
	// "zulu".
	PrimaryLanguage string `json:"primary_language" api:"nullable"`
	// The brand's slogan
	Slogan string `json:"slogan"`
	// An array of social media links for the brand
	Socials []BrandGetResponseBrandSocial `json:"socials"`
	// Stock market information for this brand (will be null if not a publicly traded
	// company)
	Stock BrandGetResponseBrandStock `json:"stock"`
	// The title or name of the brand
	Title string `json:"title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Address         respjson.Field
		Backdrops       respjson.Field
		Colors          respjson.Field
		Description     respjson.Field
		Domain          respjson.Field
		Email           respjson.Field
		Employees       respjson.Field
		Industries      respjson.Field
		IsNsfw          respjson.Field
		Links           respjson.Field
		Logos           respjson.Field
		Phone           respjson.Field
		PrimaryLanguage respjson.Field
		Slogan          respjson.Field
		Socials         respjson.Field
		Stock           respjson.Field
		Title           respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detailed brand information

func (BrandGetResponseBrand) RawJSON

func (r BrandGetResponseBrand) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrand) UnmarshalJSON

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

type BrandGetResponseBrandAddress

type BrandGetResponseBrandAddress struct {
	// City name
	City string `json:"city"`
	// Country name
	Country string `json:"country"`
	// Country code
	CountryCode string `json:"country_code"`
	// Postal or ZIP code
	PostalCode string `json:"postal_code"`
	// State or province code
	StateCode string `json:"state_code"`
	// State or province name
	StateProvince string `json:"state_province"`
	// Street address
	Street string `json:"street"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City          respjson.Field
		Country       respjson.Field
		CountryCode   respjson.Field
		PostalCode    respjson.Field
		StateCode     respjson.Field
		StateProvince respjson.Field
		Street        respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Physical address of the brand

func (BrandGetResponseBrandAddress) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandAddress) UnmarshalJSON

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

type BrandGetResponseBrandBackdrop

type BrandGetResponseBrandBackdrop struct {
	// Array of colors in the backdrop image
	Colors []BrandGetResponseBrandBackdropColor `json:"colors"`
	// Resolution of the backdrop image
	Resolution BrandGetResponseBrandBackdropResolution `json:"resolution"`
	// URL of the backdrop image
	URL string `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Colors      respjson.Field
		Resolution  respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandBackdrop) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandBackdrop) UnmarshalJSON

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

type BrandGetResponseBrandBackdropColor

type BrandGetResponseBrandBackdropColor struct {
	// Color in hexadecimal format
	Hex string `json:"hex"`
	// Name of the color
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hex         respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandBackdropColor) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandBackdropColor) UnmarshalJSON

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

type BrandGetResponseBrandBackdropResolution

type BrandGetResponseBrandBackdropResolution struct {
	// Aspect ratio of the image (width/height)
	AspectRatio float64 `json:"aspect_ratio"`
	// Height of the image in pixels
	Height int64 `json:"height"`
	// Width of the image in pixels
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AspectRatio respjson.Field
		Height      respjson.Field
		Width       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolution of the backdrop image

func (BrandGetResponseBrandBackdropResolution) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandBackdropResolution) UnmarshalJSON

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

type BrandGetResponseBrandColor

type BrandGetResponseBrandColor struct {
	// Color in hexadecimal format
	Hex string `json:"hex"`
	// Name of the color
	Name string `json:"name"`
	// Where the color was observed: 'site' colors come from the website's own theme
	// signals (rendered page colors, manifest, theme-color meta), 'logo' colors from
	// logo image pixels.
	//
	// Any of "site", "logo".
	Source string `json:"source"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hex         respjson.Field
		Name        respjson.Field
		Source      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandColor) RawJSON

func (r BrandGetResponseBrandColor) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandColor) UnmarshalJSON

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

type BrandGetResponseBrandEmployees added in v2.9.0

type BrandGetResponseBrandEmployees struct {
	// Exact employee count when a precise headcount is known
	Exact int64 `json:"exact"`
	// Employee count range for the brand (e.g. '11 to 50')
	//
	// Any of "1 to 10", "11 to 50", "51 to 200", "201 to 500", "501 to 1000", "1001 to
	// 5000", "5001 to 10000", "10001+".
	Range string `json:"range"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Exact       respjson.Field
		Range       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Employee headcount information for the brand (will be null if unknown)

func (BrandGetResponseBrandEmployees) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandEmployees) UnmarshalJSON added in v2.9.0

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

type BrandGetResponseBrandIndustries

type BrandGetResponseBrandIndustries struct {
	// Easy Industry Classification - array of industry and subindustry pairs
	Eic []BrandGetResponseBrandIndustriesEic `json:"eic"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Eic         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Industry classification information for the brand

func (BrandGetResponseBrandIndustries) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandIndustries) UnmarshalJSON

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

type BrandGetResponseBrandIndustriesEic

type BrandGetResponseBrandIndustriesEic struct {
	// Industry classification enum
	//
	// Any of "Aerospace & Defense", "Technology", "Finance", "Healthcare", "Retail &
	// E-commerce", "Entertainment", "Education", "Government & Nonprofit", "Industrial
	// & Energy", "Automotive & Transportation", "Lifestyle & Leisure", "Luxury &
	// Fashion", "News & Media", "Sports", "Real Estate & PropTech", "Legal &
	// Compliance", "Telecommunications", "Agriculture & Food", "Professional Services
	// & Agencies", "Chemicals & Materials", "Logistics & Supply Chain", "Hospitality &
	// Tourism", "Construction & Built Environment", "Consumer Packaged Goods (CPG)".
	Industry string `json:"industry" api:"required"`
	// Subindustry classification enum
	//
	// Any of "Defense Systems & Military Hardware", "Aerospace Manufacturing",
	// "Avionics & Navigation Technology", "Subsea & Naval Defense Systems", "Space &
	// Satellite Technology", "Defense IT & Systems Integration", "Software (B2B)",
	// "Software (B2C)", "Cloud Infrastructure & DevOps", "Cybersecurity", "Artificial
	// Intelligence & Machine Learning", "Data Infrastructure & Analytics", "Hardware &
	// Semiconductors", "Fintech Infrastructure", "eCommerce & Marketplace Platforms",
	// "Developer Tools & APIs", "Web3 & Blockchain", "XR & Spatial Computing",
	// "Banking & Lending", "Investment Management & WealthTech", "Insurance &
	// InsurTech", "Payments & Money Movement", "Accounting, Tax & Financial Planning
	// Tools", "Capital Markets & Trading Platforms", "Financial Infrastructure &
	// APIs", "Credit Scoring & Risk Management", "Cryptocurrency & Digital Assets",
	// "BNPL & Alternative Financing", "Healthcare Providers & Services",
	// "Pharmaceuticals & Drug Development", "Medical Devices & Diagnostics",
	// "Biotechnology & Genomics", "Digital Health & Telemedicine", "Health Insurance &
	// Benefits Tech", "Clinical Trials & Research Platforms", "Mental Health &
	// Wellness", "Healthcare IT & EHR Systems", "Consumer Health & Wellness Products",
	// "Online Marketplaces", "Direct-to-Consumer (DTC) Brands", "Retail Tech &
	// Point-of-Sale Systems", "Omnichannel & In-Store Retail", "E-commerce Enablement
	// & Infrastructure", "Subscription & Membership Commerce", "Social Commerce &
	// Influencer Platforms", "Fashion & Apparel Retail", "Food, Beverage & Grocery
	// E-commerce", "Streaming Platforms (Video, Music, Audio)", "Gaming & Interactive
	// Entertainment", "Creator Economy & Influencer Platforms", "Film, TV & Production
	// Studios", "Events, Venues & Live Entertainment", "Virtual Worlds & Metaverse
	// Experiences", "K-12 Education Platforms & Tools", "Higher Education & University
	// Tech", "Online Learning & MOOCs", "Test Prep & Certification", "Corporate
	// Training & Upskilling", "Tutoring & Supplemental Learning", "Education
	// Management Systems (LMS/SIS)", "Language Learning", "Creator-Led & Cohort-Based
	// Courses", "Special Education & Accessibility Tools", "Government Technology &
	// Digital Services", "Civic Engagement & Policy Platforms", "International
	// Development & Humanitarian Aid", "Philanthropy & Grantmaking", "Nonprofit
	// Operations & Fundraising Tools", "Public Health & Social Services", "Education &
	// Youth Development Programs", "Environmental & Climate Action Organizations",
	// "Legal Aid & Social Justice Advocacy", "Municipal & Infrastructure Services",
	// "Manufacturing & Industrial Automation", "Energy Production (Oil, Gas,
	// Nuclear)", "Renewable Energy & Cleantech", "Utilities & Grid Infrastructure",
	// "Industrial IoT & Monitoring Systems", "Construction & Heavy Equipment", "Mining
	// & Natural Resources", "Environmental Engineering & Sustainability", "Energy
	// Storage & Battery Technology", "Automotive OEMs & Vehicle Manufacturing",
	// "Electric Vehicles (EVs) & Charging Infrastructure", "Mobility-as-a-Service
	// (MaaS)", "Fleet Management", "Public Transit & Urban Mobility", "Autonomous
	// Vehicles & ADAS", "Aftermarket Parts & Services", "Telematics & Vehicle
	// Connectivity", "Aviation & Aerospace Transport", "Maritime Shipping", "Fitness &
	// Wellness", "Beauty & Personal Care", "Home & Living", "Dating & Relationships",
	// "Hobbies, Crafts & DIY", "Outdoor & Recreational Gear", "Events, Experiences &
	// Ticketing Platforms", "Designer & Luxury Apparel", "Accessories, Jewelry &
	// Watches", "Footwear & Leather Goods", "Beauty, Fragrance & Skincare", "Fashion
	// Marketplaces & Retail Platforms", "Sustainable & Ethical Fashion", "Resale,
	// Vintage & Circular Fashion", "Fashion Tech & Virtual Try-Ons", "Streetwear &
	// Emerging Luxury", "Couture & Made-to-Measure", "News Publishing & Journalism",
	// "Advertising, Adtech & Media Buying", "Digital Media & Content Platforms",
	// "Broadcasting (TV & Radio)", "Podcasting & Audio Media", "News Aggregators &
	// Curation Tools", "Independent & Creator-Led Media", "Newsletters &
	// Substack-Style Platforms", "Political & Investigative Media", "Trade & Niche
	// Publications", "Media Monitoring & Analytics", "Professional Teams & Leagues",
	// "Sports Media & Broadcasting", "Sports Betting & Fantasy Sports", "Fitness &
	// Athletic Training Platforms", "Sportswear & Equipment", "Esports & Competitive
	// Gaming", "Sports Venues & Event Management", "Athlete Management & Talent
	// Agencies", "Sports Tech & Performance Analytics", "Youth, Amateur & Collegiate
	// Sports", "Real Estate Marketplaces", "Property Management Software", "Rental
	// Platforms", "Mortgage & Lending Tech", "Real Estate Investment Platforms", "Law
	// Firms & Legal Services", "Legal Tech & Automation", "Regulatory Compliance",
	// "E-Discovery & Litigation Tools", "Contract Management", "Governance, Risk &
	// Compliance (GRC)", "IP & Trademark Management", "Legal Research & Intelligence",
	// "Compliance Training & Certification", "Whistleblower & Ethics Reporting",
	// "Mobile & Wireless Networks (3G/4G/5G)", "Broadband & Fiber Internet",
	// "Satellite & Space-Based Communications", "Network Equipment & Infrastructure",
	// "Telecom Billing & OSS/BSS Systems", "VoIP & Unified Communications", "Internet
	// Service Providers (ISPs)", "Edge Computing & Network Virtualization", "IoT
	// Connectivity Platforms", "Precision Agriculture & AgTech", "Crop & Livestock
	// Production", "Food & Beverage Manufacturing & Processing", "Food Distribution",
	// "Restaurants & Food Service", "Agricultural Inputs & Equipment", "Sustainable &
	// Regenerative Agriculture", "Seafood & Aquaculture", "Management Consulting",
	// "Marketing & Advertising Agencies", "Design, Branding & Creative Studios", "IT
	// Services & Managed Services", "Staffing, Recruiting & Talent", "Accounting & Tax
	// Firms", "Public Relations & Communications", "Business Process Outsourcing
	// (BPO)", "Professional Training & Coaching", "Specialty Chemicals", "Commodity &
	// Petrochemicals", "Polymers, Plastics & Rubber", "Coatings, Adhesives &
	// Sealants", "Industrial Gases", "Advanced Materials & Composites", "Battery
	// Materials & Energy Storage", "Electronic Materials & Semiconductor Chemicals",
	// "Agrochemicals & Fertilizers", "Freight & Transportation Tech", "Last-Mile
	// Delivery", "Warehouse Automation", "Supply Chain Visibility Platforms",
	// "Logistics Marketplaces", "Shipping & Freight Forwarding", "Cold Chain
	// Logistics", "Reverse Logistics & Returns", "Cross-Border Trade Tech",
	// "Transportation Management Systems (TMS)", "Hotels & Accommodation", "Vacation
	// Rentals & Short-Term Stays", "Restaurant Tech & Management", "Travel Booking
	// Platforms", "Tourism Experiences & Activities", "Cruise Lines & Marine Tourism",
	// "Hospitality Management Systems", "Event & Venue Management", "Corporate Travel
	// Management", "Travel Insurance & Protection", "Construction Management
	// Software", "BIM/CAD & Design Tools", "Construction Marketplaces", "Equipment
	// Rental & Management", "Building Materials & Procurement", "Construction
	// Workforce Management", "Project Estimation & Bidding", "Modular & Prefab
	// Construction", "Construction Safety & Compliance", "Smart Building Technology",
	// "Food & Beverage CPG", "Home & Personal Care CPG", "CPG Analytics & Insights",
	// "Direct-to-Consumer CPG Brands", "CPG Supply Chain & Distribution", "Private
	// Label Manufacturing", "CPG Retail Intelligence", "Sustainable CPG & Packaging",
	// "Beauty & Cosmetics CPG", "Health & Wellness CPG".
	Subindustry string `json:"subindustry" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Industry    respjson.Field
		Subindustry respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandIndustriesEic) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandIndustriesEic) UnmarshalJSON

func (r *BrandGetResponseBrandIndustriesEic) UnmarshalJSON(data []byte) error
type BrandGetResponseBrandLinks struct {
	// URL to the brand's blog or news page
	Blog string `json:"blog" api:"nullable"`
	// URL to the brand's careers or job opportunities page
	Careers string `json:"careers" api:"nullable"`
	// URL to the brand's contact or contact us page
	Contact string `json:"contact" api:"nullable"`
	// URL to the brand's pricing or plans page
	Pricing string `json:"pricing" api:"nullable"`
	// URL to the brand's privacy policy page
	Privacy string `json:"privacy" api:"nullable"`
	// URL to the brand's terms of service or terms and conditions page
	Terms string `json:"terms" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Blog        respjson.Field
		Careers     respjson.Field
		Contact     respjson.Field
		Pricing     respjson.Field
		Privacy     respjson.Field
		Terms       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Important website links for the brand

func (BrandGetResponseBrandLinks) RawJSON

func (r BrandGetResponseBrandLinks) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandLinks) UnmarshalJSON

func (r *BrandGetResponseBrandLinks) UnmarshalJSON(data []byte) error
type BrandGetResponseBrandLogo struct {
	// Array of colors in the logo
	Colors []BrandGetResponseBrandLogoColor `json:"colors"`
	// Indicates when this logo is best used: 'light' = best for light mode, 'dark' =
	// best for dark mode, 'has_opaque_background' = can be used for either as image
	// has its own background
	//
	// Any of "light", "dark", "has_opaque_background".
	Mode string `json:"mode"`
	// Resolution of the logo image
	Resolution BrandGetResponseBrandLogoResolution `json:"resolution"`
	// Type of the logo based on resolution (e.g., 'icon', 'logo')
	//
	// Any of "icon", "logo".
	Type string `json:"type"`
	// Hosted logo URL.
	URL string `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Colors      respjson.Field
		Mode        respjson.Field
		Resolution  respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandLogo) RawJSON

func (r BrandGetResponseBrandLogo) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandLogo) UnmarshalJSON

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

type BrandGetResponseBrandLogoColor

type BrandGetResponseBrandLogoColor struct {
	// Color in hexadecimal format
	Hex string `json:"hex"`
	// Name of the color
	Name string `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Hex         respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandLogoColor) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandLogoColor) UnmarshalJSON

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

type BrandGetResponseBrandLogoResolution

type BrandGetResponseBrandLogoResolution struct {
	// Aspect ratio of the image (width/height)
	AspectRatio float64 `json:"aspect_ratio"`
	// Height of the image in pixels
	Height int64 `json:"height"`
	// Width of the image in pixels
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AspectRatio respjson.Field
		Height      respjson.Field
		Width       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolution of the logo image

func (BrandGetResponseBrandLogoResolution) RawJSON

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandLogoResolution) UnmarshalJSON

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

type BrandGetResponseBrandSocial

type BrandGetResponseBrandSocial struct {
	// Type of social media platform
	//
	// Any of "x", "facebook", "instagram", "linkedin", "youtube", "pinterest",
	// "tiktok", "dribbble", "github", "behance", "snapchat", "whatsapp", "telegram",
	// "line", "discord", "twitch", "vimeo", "imdb", "tumblr", "flickr", "giphy",
	// "medium", "spotify", "soundcloud", "tripadvisor", "yelp", "producthunt",
	// "reddit", "crunchbase", "appstore", "playstore".
	Type string `json:"type"`
	// URL of the social media page
	URL string `json:"url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandGetResponseBrandSocial) RawJSON

func (r BrandGetResponseBrandSocial) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandSocial) UnmarshalJSON

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

type BrandGetResponseBrandStock

type BrandGetResponseBrandStock struct {
	// Stock exchange name
	Exchange string `json:"exchange"`
	// Stock ticker symbol
	Ticker string `json:"ticker"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Exchange    respjson.Field
		Ticker      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Stock market information for this brand (will be null if not a publicly traded company)

func (BrandGetResponseBrandStock) RawJSON

func (r BrandGetResponseBrandStock) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseBrandStock) UnmarshalJSON

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

type BrandGetResponseCacheMetadata added in v2.13.0

type BrandGetResponseCacheMetadata struct {
	// Age of the cached data in milliseconds. Zero for miss and zdr responses.
	AgeMs int64 `json:"age_ms" api:"required"`
	// Whether the response was served from cache, required fresh work, or honored
	// zero-data-retention cache bypass.
	//
	// Any of "hit", "miss", "zdr".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AgeMs       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Whether this response came from cache.

func (BrandGetResponseCacheMetadata) RawJSON added in v2.13.0

Returns the unmodified JSON received from the API

func (*BrandGetResponseCacheMetadata) UnmarshalJSON added in v2.13.0

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

type BrandGetResponseKeyMetadata

type BrandGetResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (BrandGetResponseKeyMetadata) RawJSON

func (r BrandGetResponseKeyMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandGetResponseKeyMetadata) UnmarshalJSON

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

type BrandSearchParams added in v2.8.0

type BrandSearchParams struct {
	// Search term, matched against the fields selected by queryBy (e.g. 'nike',
	// 'nike.com', 'nik').
	Query string `query:"query" api:"required" json:"-"`
	// Whether the search term matches by prefix, so partial words match as they are
	// typed (e.g. 'nik' matches Nike). Set to false to match whole words only.
	Autocomplete param.Opt[bool] `query:"autocomplete,omitzero" json:"-"`
	// Maximum number of typos tolerated when matching, from 0 to 2. Defaults to 0 (no
	// typo tolerance).
	TypoTolerance param.Opt[int64] `query:"typoTolerance,omitzero" json:"-"`
	// Fields to match the search term against, as a comma-separated list or repeated
	// parameter: 'name', 'domain', or both. Defaults to both.
	//
	// Any of "name", "domain".
	QueryBy []string `query:"queryBy,omitzero" json:"-"`
	// Comma-separated labels for filtering usage, e.g. `production,team-alpha`.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (BrandSearchParams) URLQuery added in v2.8.0

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

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

type BrandSearchResponse added in v2.8.0

type BrandSearchResponse struct {
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Up to 10 matching brands, name matches first, then domain matches, most popular
	// first within each group. Empty when nothing matches.
	Results []BrandSearchResponseResult `json:"results" api:"required"`
	// Credits this request used and your remaining balance.
	KeyMetadata BrandSearchResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Results     respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandSearchResponse) RawJSON added in v2.8.0

func (r BrandSearchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandSearchResponse) UnmarshalJSON added in v2.8.0

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

type BrandSearchResponseKeyMetadata added in v2.8.0

type BrandSearchResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (BrandSearchResponseKeyMetadata) RawJSON added in v2.8.0

Returns the unmodified JSON received from the API

func (*BrandSearchResponseKeyMetadata) UnmarshalJSON added in v2.8.0

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

type BrandSearchResponseResult added in v2.8.0

type BrandSearchResponseResult struct {
	// The brand's domain.
	Domain string `json:"domain" api:"required"`
	// calling organization.
	Logo string `json:"logo" api:"required"`
	// The brand's name. Empty string when unknown.
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Domain      respjson.Field
		Logo        respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (BrandSearchResponseResult) RawJSON added in v2.8.0

func (r BrandSearchResponseResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*BrandSearchResponseResult) UnmarshalJSON added in v2.8.0

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

type BrandService

type BrandService struct {
	// contains filtered or unexported fields
}

BrandService contains methods and other services that help with interacting with the context.dev 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 NewBrandService method instead.

func NewBrandService

func NewBrandService(opts ...option.RequestOption) (r BrandService)

NewBrandService 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 (*BrandService) Get

func (r *BrandService) Get(ctx context.Context, body BrandGetParams, opts ...option.RequestOption) (res *BrandGetResponse, err error)

Retrieve logos, colors, company details, and social links using one lookup identifier. A direct URL limits extraction to that page.

func (*BrandService) Search added in v2.8.0

func (r *BrandService) Search(ctx context.Context, query BrandSearchParams, opts ...option.RequestOption) (res *BrandSearchResponse, err error)

Find up to 10 brands by name or domain, ordered by popularity. Use the returned domain to retrieve a full brand profile.

type Client

type Client struct {
	Parse    ParseService
	Web      WebService
	Brand    BrandService
	Industry IndustryService
	Utility  UtilityService
	// Watch websites for exact or meaningful changes.
	Monitors MonitorService
	// Scrape many pages or crawl a site asynchronously.
	Batch    BatchService
	Webhooks WebhookService
	People   PersonService
	// Search live and historical news about a company.
	News NewsService
	// Read your organization's API request logs.
	Logs LogService
	// Report API issues and documentation mismatches.
	Feedback FeedbackService
	// contains filtered or unexported fields
}

Client creates a struct with services and top level methods that help with interacting with the context.dev API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (CONTEXT_DEV_API_KEY, CONTEXT_DEV_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type CrawlControls added in v2.7.0

type CrawlControls struct {
	// Whether links to subdomains were followed. Always false for a sitemap crawl.
	FollowSubdomains bool `json:"follow_subdomains" api:"required"`
	// Link depth limit. Always 0 for a sitemap crawl, which never follows links off
	// its URLs; null when a `start_url` crawl set no limit.
	MaxDepth int64 `json:"max_depth" api:"required"`
	// The `maxUrls` submitted with the crawl. A sitemap crawl scrapes only the URLs
	// its sitemap actually lists, up to this many, so `input.reserved` is often lower.
	MaxPages int64 `json:"max_pages" api:"required"`
	// Where the crawl started.
	Source CrawlControlsSourceUnion `json:"source" api:"required"`
	// RE2 pattern URLs had to match to be crawled. Null when the crawl set none.
	URLPattern string `json:"url_pattern" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FollowSubdomains respjson.Field
		MaxDepth         respjson.Field
		MaxPages         respjson.Field
		Source           respjson.Field
		URLPattern       respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Crawl settings as submitted.

func (CrawlControls) RawJSON added in v2.7.0

func (r CrawlControls) RawJSON() string

Returns the unmodified JSON received from the API

func (*CrawlControls) UnmarshalJSON added in v2.7.0

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

type CrawlControlsSourceSitemap added in v2.9.0

type CrawlControlsSourceSitemap struct {
	// Domain whose sitemap supplied the pages.
	Domain string `json:"domain" api:"required"`
	// Any of "sitemap".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Domain      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The crawl scraped the pages listed in the domain's sitemap.

func (CrawlControlsSourceSitemap) RawJSON added in v2.9.0

func (r CrawlControlsSourceSitemap) RawJSON() string

Returns the unmodified JSON received from the API

func (*CrawlControlsSourceSitemap) UnmarshalJSON added in v2.9.0

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

type CrawlControlsSourceStartURL added in v2.9.0

type CrawlControlsSourceStartURL struct {
	// Any of "start_url".
	Type string `json:"type" api:"required"`
	// Page the crawl started from.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The crawl discovered pages by following links from one URL.

func (CrawlControlsSourceStartURL) RawJSON added in v2.9.0

func (r CrawlControlsSourceStartURL) RawJSON() string

Returns the unmodified JSON received from the API

func (*CrawlControlsSourceStartURL) UnmarshalJSON added in v2.9.0

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

type CrawlControlsSourceUnion added in v2.7.0

type CrawlControlsSourceUnion struct {
	Type string `json:"type"`
	// This field is from variant [CrawlControlsSourceStartURL].
	URL string `json:"url"`
	// This field is from variant [CrawlControlsSourceSitemap].
	Domain string `json:"domain"`
	JSON   struct {
		Type   respjson.Field
		URL    respjson.Field
		Domain respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

CrawlControlsSourceUnion contains all possible properties and values from CrawlControlsSourceStartURL, CrawlControlsSourceSitemap.

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

func (CrawlControlsSourceUnion) AsSitemap added in v2.9.0

func (CrawlControlsSourceUnion) AsStartURL added in v2.9.0

func (CrawlControlsSourceUnion) RawJSON added in v2.7.0

func (u CrawlControlsSourceUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*CrawlControlsSourceUnion) UnmarshalJSON added in v2.7.0

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

type Delivery added in v2.15.0

type Delivery struct {
	// Delivery ID.
	ID string `json:"id" api:"required"`
	// Event creation time.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Last successful delivery time, or null if never delivered.
	DeliveredAt time.Time `json:"delivered_at" api:"required" format:"date-time"`
	// Webhook event type.
	//
	// Any of "batch.completed", "batch.failed", "batch.cancelled", "change.detected",
	// "run.completed".
	Event DeliveryEvent `json:"event" api:"required"`
	// Stable event ID for deduplicating received webhooks.
	EventID string `json:"event_id" api:"required"`
	// Latest attempt, or null if none.
	LastAttempt Attempt `json:"last_attempt" api:"required"`
	// Latest delivery error, or null if none.
	LastError DeliveryLastError `json:"last_error" api:"required"`
	// Next scheduled attempt, or null if none.
	NextAttemptAt time.Time `json:"next_attempt_at" api:"required" format:"date-time"`
	// Webhook retry settings. Use {} for the default schedule.
	Retry RetryConfig `json:"retry" api:"required"`
	// Last time you can retry manually (7 days after the event).
	RetryExpiresAt time.Time `json:"retry_expires_at" api:"required" format:"date-time"`
	// Batch or monitor run that produced the event.
	Source DeliverySourceUnion `json:"source" api:"required"`
	// `pending`, `delivering`, `retrying`, `delivered`, `failed`, or `cancelled`
	// (source or its webhook was removed).
	//
	// Any of "pending", "delivering", "retrying", "delivered", "failed", "cancelled".
	Status DeliveryStatus `json:"status" api:"required"`
	// Webhook destination URL.
	URL string `json:"url" api:"required" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		CreatedAt      respjson.Field
		DeliveredAt    respjson.Field
		Event          respjson.Field
		EventID        respjson.Field
		LastAttempt    respjson.Field
		LastError      respjson.Field
		NextAttemptAt  respjson.Field
		Retry          respjson.Field
		RetryExpiresAt respjson.Field
		Source         respjson.Field
		Status         respjson.Field
		URL            respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (Delivery) RawJSON added in v2.15.0

func (r Delivery) RawJSON() string

Returns the unmodified JSON received from the API

func (*Delivery) UnmarshalJSON added in v2.15.0

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

type DeliveryEvent added in v2.15.0

type DeliveryEvent string

Webhook event type.

const (
	DeliveryEventBatchCompleted DeliveryEvent = "batch.completed"
	DeliveryEventBatchFailed    DeliveryEvent = "batch.failed"
	DeliveryEventBatchCancelled DeliveryEvent = "batch.cancelled"
	DeliveryEventChangeDetected DeliveryEvent = "change.detected"
	DeliveryEventRunCompleted   DeliveryEvent = "run.completed"
)

type DeliveryLastError added in v2.15.0

type DeliveryLastError struct {
	// Error code.
	Code string `json:"code" api:"required"`
	// Error details.
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Latest delivery error, or null if none.

func (DeliveryLastError) RawJSON added in v2.15.0

func (r DeliveryLastError) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeliveryLastError) UnmarshalJSON added in v2.15.0

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

type DeliverySourceBatch added in v2.15.0

type DeliverySourceBatch struct {
	// Batch ID.
	BatchID string `json:"batch_id" api:"required"`
	// Which deliveries to list: `batch` or `monitor`.
	//
	// Any of "batch".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BatchID     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeliverySourceBatch) RawJSON added in v2.15.0

func (r DeliverySourceBatch) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeliverySourceBatch) UnmarshalJSON added in v2.15.0

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

type DeliverySourceMonitor added in v2.15.0

type DeliverySourceMonitor struct {
	// Monitor ID.
	MonitorID string `json:"monitor_id" api:"required"`
	// Monitor run ID.
	RunID string `json:"run_id" api:"required"`
	// Which deliveries to list: `batch` or `monitor`.
	//
	// Any of "monitor".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonitorID   respjson.Field
		RunID       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeliverySourceMonitor) RawJSON added in v2.15.0

func (r DeliverySourceMonitor) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeliverySourceMonitor) UnmarshalJSON added in v2.15.0

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

type DeliverySourceUnion added in v2.15.0

type DeliverySourceUnion struct {
	// This field is from variant [DeliverySourceBatch].
	BatchID string `json:"batch_id"`
	Type    string `json:"type"`
	// This field is from variant [DeliverySourceMonitor].
	MonitorID string `json:"monitor_id"`
	// This field is from variant [DeliverySourceMonitor].
	RunID string `json:"run_id"`
	JSON  struct {
		BatchID   respjson.Field
		Type      respjson.Field
		MonitorID respjson.Field
		RunID     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

DeliverySourceUnion contains all possible properties and values from DeliverySourceBatch, DeliverySourceMonitor.

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

func (DeliverySourceUnion) AsBatch added in v2.15.0

func (u DeliverySourceUnion) AsBatch() (v DeliverySourceBatch)

func (DeliverySourceUnion) AsMonitor added in v2.15.0

func (u DeliverySourceUnion) AsMonitor() (v DeliverySourceMonitor)

func (DeliverySourceUnion) RawJSON added in v2.15.0

func (u DeliverySourceUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeliverySourceUnion) UnmarshalJSON added in v2.15.0

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

type DeliveryStatus added in v2.15.0

type DeliveryStatus string

`pending`, `delivering`, `retrying`, `delivered`, `failed`, or `cancelled` (source or its webhook was removed).

const (
	DeliveryStatusPending    DeliveryStatus = "pending"
	DeliveryStatusDelivering DeliveryStatus = "delivering"
	DeliveryStatusRetrying   DeliveryStatus = "retrying"
	DeliveryStatusDelivered  DeliveryStatus = "delivered"
	DeliveryStatusFailed     DeliveryStatus = "failed"
	DeliveryStatusCancelled  DeliveryStatus = "cancelled"
)

type DeliverySummary added in v2.15.0

type DeliverySummary struct {
	// Delivery ID.
	ID string `json:"id" api:"required"`
	// Event creation time.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Last successful delivery time, or null if never delivered.
	DeliveredAt time.Time `json:"delivered_at" api:"required" format:"date-time"`
	// Webhook event type.
	//
	// Any of "batch.completed", "batch.failed", "batch.cancelled", "change.detected",
	// "run.completed".
	Event DeliverySummaryEvent `json:"event" api:"required"`
	// Latest delivery error, or null if none.
	LastError DeliverySummaryLastError `json:"last_error" api:"required"`
	// Next scheduled attempt, or null if none.
	NextAttemptAt time.Time `json:"next_attempt_at" api:"required" format:"date-time"`
	// Last time you can retry manually (7 days after the event).
	RetryExpiresAt time.Time `json:"retry_expires_at" api:"required" format:"date-time"`
	// Batch or monitor run that produced the event.
	Source DeliverySummarySourceUnion `json:"source" api:"required"`
	// `pending`, `delivering`, `retrying`, `delivered`, `failed`, or `cancelled`
	// (source or its webhook was removed).
	//
	// Any of "pending", "delivering", "retrying", "delivered", "failed", "cancelled".
	Status DeliverySummaryStatus `json:"status" api:"required"`
	// Webhook destination URL.
	URL string `json:"url" api:"required" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		CreatedAt      respjson.Field
		DeliveredAt    respjson.Field
		Event          respjson.Field
		LastError      respjson.Field
		NextAttemptAt  respjson.Field
		RetryExpiresAt respjson.Field
		Source         respjson.Field
		Status         respjson.Field
		URL            respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeliverySummary) RawJSON added in v2.15.0

func (r DeliverySummary) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeliverySummary) UnmarshalJSON added in v2.15.0

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

type DeliverySummaryEvent added in v2.15.0

type DeliverySummaryEvent string

Webhook event type.

const (
	DeliverySummaryEventBatchCompleted DeliverySummaryEvent = "batch.completed"
	DeliverySummaryEventBatchFailed    DeliverySummaryEvent = "batch.failed"
	DeliverySummaryEventBatchCancelled DeliverySummaryEvent = "batch.cancelled"
	DeliverySummaryEventChangeDetected DeliverySummaryEvent = "change.detected"
	DeliverySummaryEventRunCompleted   DeliverySummaryEvent = "run.completed"
)

type DeliverySummaryLastError added in v2.15.0

type DeliverySummaryLastError struct {
	// Error code.
	Code string `json:"code" api:"required"`
	// Error details.
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Latest delivery error, or null if none.

func (DeliverySummaryLastError) RawJSON added in v2.15.0

func (r DeliverySummaryLastError) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeliverySummaryLastError) UnmarshalJSON added in v2.15.0

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

type DeliverySummarySourceBatch added in v2.15.0

type DeliverySummarySourceBatch struct {
	// Batch ID.
	BatchID string `json:"batch_id" api:"required"`
	// Which deliveries to list: `batch` or `monitor`.
	//
	// Any of "batch".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BatchID     respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeliverySummarySourceBatch) RawJSON added in v2.15.0

func (r DeliverySummarySourceBatch) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeliverySummarySourceBatch) UnmarshalJSON added in v2.15.0

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

type DeliverySummarySourceMonitor added in v2.15.0

type DeliverySummarySourceMonitor struct {
	// Monitor ID.
	MonitorID string `json:"monitor_id" api:"required"`
	// Monitor run ID.
	RunID string `json:"run_id" api:"required"`
	// Which deliveries to list: `batch` or `monitor`.
	//
	// Any of "monitor".
	Type string `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonitorID   respjson.Field
		RunID       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (DeliverySummarySourceMonitor) RawJSON added in v2.15.0

Returns the unmodified JSON received from the API

func (*DeliverySummarySourceMonitor) UnmarshalJSON added in v2.15.0

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

type DeliverySummarySourceUnion added in v2.15.0

type DeliverySummarySourceUnion struct {
	// This field is from variant [DeliverySummarySourceBatch].
	BatchID string `json:"batch_id"`
	Type    string `json:"type"`
	// This field is from variant [DeliverySummarySourceMonitor].
	MonitorID string `json:"monitor_id"`
	// This field is from variant [DeliverySummarySourceMonitor].
	RunID string `json:"run_id"`
	JSON  struct {
		BatchID   respjson.Field
		Type      respjson.Field
		MonitorID respjson.Field
		RunID     respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

DeliverySummarySourceUnion contains all possible properties and values from DeliverySummarySourceBatch, DeliverySummarySourceMonitor.

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

func (DeliverySummarySourceUnion) AsBatch added in v2.15.0

func (DeliverySummarySourceUnion) AsMonitor added in v2.15.0

func (DeliverySummarySourceUnion) RawJSON added in v2.15.0

func (u DeliverySummarySourceUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*DeliverySummarySourceUnion) UnmarshalJSON added in v2.15.0

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

type DeliverySummaryStatus added in v2.15.0

type DeliverySummaryStatus string

`pending`, `delivering`, `retrying`, `delivered`, `failed`, or `cancelled` (source or its webhook was removed).

const (
	DeliverySummaryStatusPending    DeliverySummaryStatus = "pending"
	DeliverySummaryStatusDelivering DeliverySummaryStatus = "delivering"
	DeliverySummaryStatusRetrying   DeliverySummaryStatus = "retrying"
	DeliverySummaryStatusDelivered  DeliverySummaryStatus = "delivered"
	DeliverySummaryStatusFailed     DeliverySummaryStatus = "failed"
	DeliverySummaryStatusCancelled  DeliverySummaryStatus = "cancelled"
)

type Error

type Error = apierror.Error

type Failure added in v2.7.0

type Failure struct {
	// Why the batch itself stopped.
	Code string `json:"code" api:"required"`
	// Human-readable explanation.
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A failure of the batch as a whole, distinct from the per-page failures in `page_errors`.

func (Failure) RawJSON added in v2.7.0

func (r Failure) RawJSON() string

Returns the unmodified JSON received from the API

func (*Failure) UnmarshalJSON added in v2.7.0

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

type FeedbackService added in v2.21.0

type FeedbackService struct {
	// contains filtered or unexported fields
}

Report API issues and documentation mismatches.

FeedbackService contains methods and other services that help with interacting with the context.dev 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 NewFeedbackService method instead.

func NewFeedbackService added in v2.21.0

func NewFeedbackService(opts ...option.RequestOption) (r FeedbackService)

NewFeedbackService 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 (*FeedbackService) Submit added in v2.21.0

Report an API issue or documentation mismatch, including request IDs when available.

type FeedbackSubmitParams added in v2.21.0

type FeedbackSubmitParams struct {
	// Kind of issue.
	//
	// Any of "bug", "docs_mismatch", "friction", "feature_gap", "quality_degradation",
	// "other".
	Category FeedbackSubmitParamsCategory `json:"category,omitzero" api:"required"`
	// What went wrong and what you expected instead.
	Note string `json:"note" api:"required"`
	// The request_id of the API call the feedback is about, from its response body or
	// X-Request-Id header.
	RequestID param.Opt[string] `json:"request_id,omitzero" format:"uuid"`
	// The page the feedback is about, such as one page of a crawl or a docs page.
	URL param.Opt[string] `json:"url,omitzero" format:"uri"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (FeedbackSubmitParams) MarshalJSON added in v2.21.0

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

func (*FeedbackSubmitParams) UnmarshalJSON added in v2.21.0

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

type FeedbackSubmitParamsCategory added in v2.21.0

type FeedbackSubmitParamsCategory string

Kind of issue.

const (
	FeedbackSubmitParamsCategoryBug                FeedbackSubmitParamsCategory = "bug"
	FeedbackSubmitParamsCategoryDocsMismatch       FeedbackSubmitParamsCategory = "docs_mismatch"
	FeedbackSubmitParamsCategoryFriction           FeedbackSubmitParamsCategory = "friction"
	FeedbackSubmitParamsCategoryFeatureGap         FeedbackSubmitParamsCategory = "feature_gap"
	FeedbackSubmitParamsCategoryQualityDegradation FeedbackSubmitParamsCategory = "quality_degradation"
	FeedbackSubmitParamsCategoryOther              FeedbackSubmitParamsCategory = "other"
)

type FeedbackSubmitResponse added in v2.21.0

type FeedbackSubmitResponse struct {
	// True when feedback for this request_id was already recorded; the original
	// feedback_id is returned.
	AlreadySubmitted bool `json:"already_submitted" api:"required"`
	// ID of the stored feedback.
	FeedbackID string `json:"feedback_id" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata FeedbackSubmitResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AlreadySubmitted respjson.Field
		FeedbackID       respjson.Field
		RequestID        respjson.Field
		KeyMetadata      respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FeedbackSubmitResponse) RawJSON added in v2.21.0

func (r FeedbackSubmitResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FeedbackSubmitResponse) UnmarshalJSON added in v2.21.0

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

type FeedbackSubmitResponseKeyMetadata added in v2.21.0

type FeedbackSubmitResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (FeedbackSubmitResponseKeyMetadata) RawJSON added in v2.21.0

Returns the unmodified JSON received from the API

func (*FeedbackSubmitResponseKeyMetadata) UnmarshalJSON added in v2.21.0

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

type IndustryGetNaicsParams

type IndustryGetNaicsParams struct {
	// Brand domain or title to retrieve NAICS code for. If a valid domain is provided,
	// it will be used for classification, otherwise, we will search for the brand
	// using the provided title.
	Input string `query:"input" api:"required" json:"-"`
	// Maximum number of NAICS codes to return. Must be between 1 and 10. Defaults
	// to 5.
	MaxResults param.Opt[int64] `query:"maxResults,omitzero" json:"-"`
	// Minimum number of NAICS codes to return. Must be at least 1. Defaults to 1.
	MinResults param.Opt[int64] `query:"minResults,omitzero" json:"-"`
	// Comma-separated labels for filtering usage, e.g. `production,team-alpha`.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Request deadline and what to return when it passes.
	TimeoutOpts IndustryGetNaicsParamsTimeoutOpts `query:"timeoutOpts,omitzero" json:"-"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr IndustryGetNaicsParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (IndustryGetNaicsParams) URLQuery

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

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

type IndustryGetNaicsParamsTimeoutOpts added in v2.17.0

type IndustryGetNaicsParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `query:"milliseconds" api:"required" json:"-"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `query:"behavior,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (IndustryGetNaicsParamsTimeoutOpts) URLQuery added in v2.17.0

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

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

type IndustryGetNaicsParamsZdr added in v2.18.0

type IndustryGetNaicsParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	IndustryGetNaicsParamsZdrEnabled  IndustryGetNaicsParamsZdr = "enabled"
	IndustryGetNaicsParamsZdrDisabled IndustryGetNaicsParamsZdr = "disabled"
)

type IndustryGetNaicsResponse

type IndustryGetNaicsResponse struct {
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Array of NAICS codes and titles.
	Codes []IndustryGetNaicsResponseCode `json:"codes"`
	// Domain found for the brand
	Domain string `json:"domain"`
	// Credits this request used and your remaining balance.
	KeyMetadata IndustryGetNaicsResponseKeyMetadata `json:"key_metadata"`
	// True when the timeout ended processing and this response contains only usable
	// results completed so far. Unfinished results are omitted.
	Partial bool `json:"partial"`
	// Always `ok` on success.
	Status string `json:"status"`
	// Industry classification type, for naics api it will be `naics`
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Codes       respjson.Field
		Domain      respjson.Field
		KeyMetadata respjson.Field
		Partial     respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IndustryGetNaicsResponse) RawJSON

func (r IndustryGetNaicsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*IndustryGetNaicsResponse) UnmarshalJSON

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

type IndustryGetNaicsResponseCode

type IndustryGetNaicsResponseCode struct {
	// NAICS code
	Code string `json:"code" api:"required"`
	// Confidence level for how well this NAICS code matches the company description
	//
	// Any of "high", "medium", "low".
	Confidence string `json:"confidence" api:"required"`
	// NAICS title
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Confidence  respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IndustryGetNaicsResponseCode) RawJSON

Returns the unmodified JSON received from the API

func (*IndustryGetNaicsResponseCode) UnmarshalJSON

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

type IndustryGetNaicsResponseKeyMetadata

type IndustryGetNaicsResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (IndustryGetNaicsResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*IndustryGetNaicsResponseKeyMetadata) UnmarshalJSON

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

type IndustryGetSicParams

type IndustryGetSicParams struct {
	// Brand domain or title to retrieve SIC code for. If a valid domain is provided,
	// it will be used for classification, otherwise, we will search for the brand
	// using the provided title.
	Input string `query:"input" api:"required" json:"-"`
	// Maximum number of SIC codes to return. Must be between 1 and 10. Defaults to 5.
	MaxResults param.Opt[int64] `query:"maxResults,omitzero" json:"-"`
	// Minimum number of SIC codes to return. Must be at least 1. Defaults to 1.
	MinResults param.Opt[int64] `query:"minResults,omitzero" json:"-"`
	// Comma-separated labels for filtering usage, e.g. `production,team-alpha`.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Request deadline and what to return when it passes.
	TimeoutOpts IndustryGetSicParamsTimeoutOpts `query:"timeoutOpts,omitzero" json:"-"`
	// SIC dataset: `original_sic` (1987) or `latest_sec` (current SEC list).
	//
	// Any of "original_sic", "latest_sec".
	Type IndustryGetSicParamsType `query:"type,omitzero" json:"-"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr IndustryGetSicParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (IndustryGetSicParams) URLQuery

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

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

type IndustryGetSicParamsTimeoutOpts added in v2.17.0

type IndustryGetSicParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `query:"milliseconds" api:"required" json:"-"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `query:"behavior,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (IndustryGetSicParamsTimeoutOpts) URLQuery added in v2.17.0

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

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

type IndustryGetSicParamsType

type IndustryGetSicParamsType string

SIC dataset: `original_sic` (1987) or `latest_sec` (current SEC list).

const (
	IndustryGetSicParamsTypeOriginalSic IndustryGetSicParamsType = "original_sic"
	IndustryGetSicParamsTypeLatestSec   IndustryGetSicParamsType = "latest_sec"
)

type IndustryGetSicParamsZdr added in v2.18.0

type IndustryGetSicParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	IndustryGetSicParamsZdrEnabled  IndustryGetSicParamsZdr = "enabled"
	IndustryGetSicParamsZdrDisabled IndustryGetSicParamsZdr = "disabled"
)

type IndustryGetSicResponse

type IndustryGetSicResponse struct {
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Echoes back which SIC dataset was used to classify the brand.
	//
	// Any of "original_sic", "latest_sec".
	Classification IndustryGetSicResponseClassification `json:"classification"`
	// Array of SIC codes with confidence scores. Extra fields depend on the requested
	// classification: `original_sic` results include `majorGroup` and
	// `majorGroupName`; `latest_sec` results include `office`.
	Codes []IndustryGetSicResponseCode `json:"codes"`
	// Domain found for the brand
	Domain string `json:"domain"`
	// Credits this request used and your remaining balance.
	KeyMetadata IndustryGetSicResponseKeyMetadata `json:"key_metadata"`
	// True when the timeout ended processing and this response contains only usable
	// results completed so far. Unfinished results are omitted.
	Partial bool `json:"partial"`
	// Always `ok` on success.
	Status string `json:"status"`
	// Industry classification type, for sic api it will be `sic`
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID      respjson.Field
		Classification respjson.Field
		Codes          respjson.Field
		Domain         respjson.Field
		KeyMetadata    respjson.Field
		Partial        respjson.Field
		Status         respjson.Field
		Type           respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IndustryGetSicResponse) RawJSON

func (r IndustryGetSicResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*IndustryGetSicResponse) UnmarshalJSON

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

type IndustryGetSicResponseClassification

type IndustryGetSicResponseClassification string

Echoes back which SIC dataset was used to classify the brand.

const (
	IndustryGetSicResponseClassificationOriginalSic IndustryGetSicResponseClassification = "original_sic"
	IndustryGetSicResponseClassificationLatestSec   IndustryGetSicResponseClassification = "latest_sec"
)

type IndustryGetSicResponseCode

type IndustryGetSicResponseCode struct {
	// SIC code (4-digit).
	Code string `json:"code" api:"required"`
	// Confidence level for how well this SIC code matches the company description.
	//
	// Any of "high", "medium", "low".
	Confidence string `json:"confidence" api:"required"`
	// SIC industry title.
	Name string `json:"name" api:"required"`
	// 2-digit major group identifier (the leading two digits of the code). Only
	// present when `classification` is `original_sic`.
	MajorGroup string `json:"majorGroup"`
	// Description of the 2-digit major group. Only present when `classification` is
	// `original_sic`.
	MajorGroupName string `json:"majorGroupName"`
	// SEC review office responsible for filings under this code. Only present when
	// `classification` is `latest_sec`.
	Office string `json:"office"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code           respjson.Field
		Confidence     respjson.Field
		Name           respjson.Field
		MajorGroup     respjson.Field
		MajorGroupName respjson.Field
		Office         respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (IndustryGetSicResponseCode) RawJSON

func (r IndustryGetSicResponseCode) RawJSON() string

Returns the unmodified JSON received from the API

func (*IndustryGetSicResponseCode) UnmarshalJSON

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

type IndustryGetSicResponseKeyMetadata

type IndustryGetSicResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (IndustryGetSicResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*IndustryGetSicResponseKeyMetadata) UnmarshalJSON

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

type IndustryService

type IndustryService struct {
	// contains filtered or unexported fields
}

IndustryService contains methods and other services that help with interacting with the context.dev 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 NewIndustryService method instead.

func NewIndustryService

func NewIndustryService(opts ...option.RequestOption) (r IndustryService)

NewIndustryService 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 (*IndustryService) GetNaics

Classify a company into NAICS industry codes.

func (*IndustryService) GetSic

Classify a company into SIC industry codes.

type Intake added in v2.7.0

type Intake struct {
	// URLs dropped before reserving because another entry resolved to the same page.
	// Non-zero for sitemap crawls too, whose sitemaps routinely list a page more than
	// once.
	Duplicates int64 `json:"duplicates" api:"required"`
	// Rejected input URLs; `null` for a crawl.
	Invalid int64 `json:"invalid" api:"required"`
	// Pages accepted; progress counts toward this total.
	Reserved int64 `json:"reserved" api:"required"`
	// True when `reserved` is a crawl ceiling; false when it is an exact URL count.
	ReservedIsCeiling bool `json:"reserved_is_ceiling" api:"required"`
	// URLs in the list you sent, before validation and de-duplication. Null for a
	// crawl, which is given a source rather than a list.
	Submitted int64 `json:"submitted" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Duplicates        respjson.Field
		Invalid           respjson.Field
		Reserved          respjson.Field
		ReservedIsCeiling respjson.Field
		Submitted         respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

What the submission accepted.

func (Intake) RawJSON added in v2.7.0

func (r Intake) RawJSON() string

Returns the unmodified JSON received from the API

func (*Intake) UnmarshalJSON added in v2.7.0

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

type LogGetResponse added in v2.16.0

type LogGetResponse struct {
	Data LogGetResponseData `json:"data" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata LogGetResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogGetResponse) RawJSON added in v2.16.0

func (r LogGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogGetResponse) UnmarshalJSON added in v2.16.0

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

type LogGetResponseData added in v2.16.0

type LogGetResponseData struct {
	// Credits charged for this request.
	CreditsUsed int64 `json:"credits_used" api:"required"`
	// The `error_code` from the response, or null on success.
	ErrorCode string `json:"error_code" api:"required"`
	// What was sent with the request.
	Input LogGetResponseDataInput `json:"input" api:"required"`
	// ID of the API key that made the request.
	KeyID string `json:"key_id" api:"required"`
	// Server-side processing time in milliseconds.
	LatencyMs float64 `json:"latency_ms" api:"required"`
	// HTTP method, or `MONITOR` / `BATCH` for monitor-run and batch-settlement
	// entries.
	Method string `json:"method" api:"required"`
	// Endpoint path as called.
	Path string `json:"path" api:"required"`
	// Request ID of the logged API call.
	RequestID string `json:"request_id" api:"required"`
	// HTTP status code returned.
	StatusCode int64 `json:"status_code" api:"required"`
	// Request tags supplied by the caller.
	Tags []string `json:"tags" api:"required"`
	// When the request completed.
	Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
	// User-Agent header of the request.
	UserAgent string `json:"user_agent" api:"required"`
	// Whether the request was made under zero data retention.
	Zdr bool `json:"zdr" api:"required"`
	// The retained JSON response with credentials redacted, or null when unavailable.
	Response any `json:"response"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsUsed respjson.Field
		ErrorCode   respjson.Field
		Input       respjson.Field
		KeyID       respjson.Field
		LatencyMs   respjson.Field
		Method      respjson.Field
		Path        respjson.Field
		RequestID   respjson.Field
		StatusCode  respjson.Field
		Tags        respjson.Field
		Timestamp   respjson.Field
		UserAgent   respjson.Field
		Zdr         respjson.Field
		Response    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogGetResponseData) RawJSON added in v2.16.0

func (r LogGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogGetResponseData) UnmarshalJSON added in v2.16.0

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

type LogGetResponseDataInput added in v2.16.0

type LogGetResponseDataInput struct {
	// Query parameters as sent.
	Query map[string]any `json:"query" api:"required"`
	// Request body with credentials and uploaded content redacted.
	Body any `json:"body"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Query       respjson.Field
		Body        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

What was sent with the request.

func (LogGetResponseDataInput) RawJSON added in v2.16.0

func (r LogGetResponseDataInput) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogGetResponseDataInput) UnmarshalJSON added in v2.16.0

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

type LogGetResponseKeyMetadata added in v2.16.0

type LogGetResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (LogGetResponseKeyMetadata) RawJSON added in v2.16.0

func (r LogGetResponseKeyMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogGetResponseKeyMetadata) UnmarshalJSON added in v2.16.0

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

type LogListParams added in v2.16.0

type LogListParams struct {
	// Filter by the `error_code` returned in the response.
	ErrorCode param.Opt[string] `query:"error_code,omitzero" json:"-"`
	// Only include requests that returned a 4xx or 5xx status.
	ErrorsOnly param.Opt[bool] `query:"errors_only,omitzero" json:"-"`
	// Only include requests at or after this ISO 8601 timestamp. Defaults to 24 hours
	// before `to`.
	From param.Opt[time.Time] `query:"from,omitzero" format:"date-time" json:"-"`
	// Filter by the API key that made the request.
	KeyID param.Opt[string] `query:"key_id,omitzero" json:"-"`
	// Number of log entries per page.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Page number, starting at 1.
	Page param.Opt[int64] `query:"page,omitzero" json:"-"`
	// Filter by endpoint path, with or without the /v1 prefix.
	Path param.Opt[string] `query:"path,omitzero" json:"-"`
	// Case-insensitive substring match against the request query and body, e.g. a
	// domain.
	Search param.Opt[string] `query:"search,omitzero" json:"-"`
	// Filter by exact HTTP status code.
	StatusCode param.Opt[int64] `query:"status_code,omitzero" json:"-"`
	// Comma-separated request tags. Matches requests carrying any of them. Up to 20
	// tags, each 1-50 characters.
	Tags param.Opt[string] `query:"tags,omitzero" json:"-"`
	// Only include requests at or before this ISO 8601 timestamp. Defaults to now.
	To param.Opt[time.Time] `query:"to,omitzero" format:"date-time" json:"-"`
	// contains filtered or unexported fields
}

func (LogListParams) URLQuery added in v2.16.0

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

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

type LogListResponse added in v2.16.0

type LogListResponse struct {
	// Log entries, newest first.
	Data []LogListResponseData `json:"data" api:"required"`
	// Whether a next page exists.
	HasMore bool `json:"has_more" api:"required"`
	// Entries per page.
	Limit int64 `json:"limit" api:"required"`
	// Current page number.
	Page int64 `json:"page" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata LogListResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		Limit       respjson.Field
		Page        respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogListResponse) RawJSON added in v2.16.0

func (r LogListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogListResponse) UnmarshalJSON added in v2.16.0

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

type LogListResponseData added in v2.16.0

type LogListResponseData struct {
	// Credits charged for this request.
	CreditsUsed int64 `json:"credits_used" api:"required"`
	// The `error_code` from the response, or null on success.
	ErrorCode string `json:"error_code" api:"required"`
	// ID of the API key that made the request.
	KeyID string `json:"key_id" api:"required"`
	// Server-side processing time in milliseconds.
	LatencyMs float64 `json:"latency_ms" api:"required"`
	// HTTP method, or `MONITOR` / `BATCH` for monitor-run and batch-settlement
	// entries.
	Method string `json:"method" api:"required"`
	// Endpoint path as called.
	Path string `json:"path" api:"required"`
	// Request ID of the logged API call.
	RequestID string `json:"request_id" api:"required"`
	// HTTP status code returned.
	StatusCode int64 `json:"status_code" api:"required"`
	// Request tags supplied by the caller.
	Tags []string `json:"tags" api:"required"`
	// When the request completed.
	Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
	// Whether the request was made under zero data retention.
	Zdr bool `json:"zdr" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsUsed respjson.Field
		ErrorCode   respjson.Field
		KeyID       respjson.Field
		LatencyMs   respjson.Field
		Method      respjson.Field
		Path        respjson.Field
		RequestID   respjson.Field
		StatusCode  respjson.Field
		Tags        respjson.Field
		Timestamp   respjson.Field
		Zdr         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (LogListResponseData) RawJSON added in v2.16.0

func (r LogListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogListResponseData) UnmarshalJSON added in v2.16.0

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

type LogListResponseKeyMetadata added in v2.16.0

type LogListResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (LogListResponseKeyMetadata) RawJSON added in v2.16.0

func (r LogListResponseKeyMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*LogListResponseKeyMetadata) UnmarshalJSON added in v2.16.0

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

type LogService added in v2.16.0

type LogService struct {
	// contains filtered or unexported fields
}

Read your organization's API request logs.

LogService contains methods and other services that help with interacting with the context.dev API.

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

func NewLogService added in v2.16.0

func NewLogService(opts ...option.RequestOption) (r LogService)

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

func (*LogService) Get added in v2.16.0

func (r *LogService) Get(ctx context.Context, requestID string, opts ...option.RequestOption) (res *LogGetResponse, err error)

Retrieve a request’s metadata, retained input, and response.

func (*LogService) List added in v2.16.0

func (r *LogService) List(ctx context.Context, query LogListParams, opts ...option.RequestOption) (res *LogListResponse, err error)

List your organization’s request logs with filters and pagination. Logs also include batch settlements and monitor runs.

type MonitorDeleteResponse

type MonitorDeleteResponse struct {
	ID      string `json:"id" api:"required"`
	Deleted bool   `json:"deleted" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata MonitorDeleteResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Deleted     respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorDeleteResponse) RawJSON

func (r MonitorDeleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorDeleteResponse) UnmarshalJSON

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

type MonitorDeleteResponseKeyMetadata added in v2.22.0

type MonitorDeleteResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorDeleteResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorDeleteResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorGetChangeResponse

type MonitorGetChangeResponse struct {
	ID string `json:"id" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType MonitorGetChangeResponseChangeDetectionType `json:"change_detection_type" api:"required"`
	DetectedAt          time.Time                                   `json:"detected_at" api:"required" format:"date-time"`
	// Always `web`. Optional.
	//
	// Any of "web".
	Mode      MonitorGetChangeResponseMode `json:"mode" api:"required"`
	MonitorID string                       `json:"monitor_id" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// The run that detected this change.
	RunID   string `json:"run_id" api:"required"`
	Summary string `json:"summary" api:"required"`
	// Labels for filtering monitors, their changes, and their usage.
	Tags []string `json:"tags" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType    MonitorGetChangeResponseTargetType `json:"target_type" api:"required"`
	Title         string                             `json:"title" api:"required"`
	URL           string                             `json:"url" api:"required" format:"uri"`
	AddedURLCount int64                              `json:"added_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	AddedURLs         []string `json:"added_urls" format:"uri"`
	AfterTextExcerpt  string   `json:"after_text_excerpt"`
	BeforeTextExcerpt string   `json:"before_text_excerpt"`
	Confidence        float64  `json:"confidence"`
	// Text diff between the previous and current page baseline (page targets).
	Diff     string                             `json:"diff"`
	Evidence []MonitorGetChangeResponseEvidence `json:"evidence"`
	// Any of "low", "medium", "high".
	Importance MonitorGetChangeResponseImportance `json:"importance"`
	// Credits this request used and your remaining balance.
	KeyMetadata     MonitorGetChangeResponseKeyMetadata `json:"key_metadata"`
	MatchedURLCount int64                               `json:"matched_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	MatchedURLs     []string `json:"matched_urls" format:"uri"`
	RemovedURLCount int64    `json:"removed_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	RemovedURLs []string `json:"removed_urls" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		ChangeDetectionType respjson.Field
		DetectedAt          respjson.Field
		Mode                respjson.Field
		MonitorID           respjson.Field
		RequestID           respjson.Field
		RunID               respjson.Field
		Summary             respjson.Field
		Tags                respjson.Field
		TargetType          respjson.Field
		Title               respjson.Field
		URL                 respjson.Field
		AddedURLCount       respjson.Field
		AddedURLs           respjson.Field
		AfterTextExcerpt    respjson.Field
		BeforeTextExcerpt   respjson.Field
		Confidence          respjson.Field
		Diff                respjson.Field
		Evidence            respjson.Field
		Importance          respjson.Field
		KeyMetadata         respjson.Field
		MatchedURLCount     respjson.Field
		MatchedURLs         respjson.Field
		RemovedURLCount     respjson.Field
		RemovedURLs         respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetChangeResponse) RawJSON

func (r MonitorGetChangeResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetChangeResponse) UnmarshalJSON

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

type MonitorGetChangeResponseChangeDetectionType

type MonitorGetChangeResponseChangeDetectionType string
const (
	MonitorGetChangeResponseChangeDetectionTypeExact    MonitorGetChangeResponseChangeDetectionType = "exact"
	MonitorGetChangeResponseChangeDetectionTypeSemantic MonitorGetChangeResponseChangeDetectionType = "semantic"
)

type MonitorGetChangeResponseEvidence

type MonitorGetChangeResponseEvidence struct {
	// Snapshot of the content after the change.
	After string `json:"after" api:"required"`
	// Snapshot of the content before the change.
	Before string `json:"before" api:"required"`
	// Optional URL the evidence relates to. Absent for whole-target diffs.
	URL string `json:"url" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetChangeResponseEvidence) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetChangeResponseEvidence) UnmarshalJSON

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

type MonitorGetChangeResponseImportance

type MonitorGetChangeResponseImportance string
const (
	MonitorGetChangeResponseImportanceLow    MonitorGetChangeResponseImportance = "low"
	MonitorGetChangeResponseImportanceMedium MonitorGetChangeResponseImportance = "medium"
	MonitorGetChangeResponseImportanceHigh   MonitorGetChangeResponseImportance = "high"
)

type MonitorGetChangeResponseKeyMetadata added in v2.22.0

type MonitorGetChangeResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorGetChangeResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorGetChangeResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorGetChangeResponseMode

type MonitorGetChangeResponseMode string

Always `web`. Optional.

const (
	MonitorGetChangeResponseModeWeb MonitorGetChangeResponseMode = "web"
)

type MonitorGetChangeResponseTargetType

type MonitorGetChangeResponseTargetType string
const (
	MonitorGetChangeResponseTargetTypePage    MonitorGetChangeResponseTargetType = "page"
	MonitorGetChangeResponseTargetTypeSitemap MonitorGetChangeResponseTargetType = "sitemap"
	MonitorGetChangeResponseTargetTypeExtract MonitorGetChangeResponseTargetType = "extract"
)

type MonitorGetCreditUsageParams added in v2.5.0

type MonitorGetCreditUsageParams struct {
	// Only include items at or after this ISO 8601 timestamp.
	Since param.Opt[time.Time] `query:"since,omitzero" format:"date-time" json:"-"`
	// Only include items before this ISO 8601 timestamp.
	Until param.Opt[time.Time] `query:"until,omitzero" format:"date-time" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorGetCreditUsageParams) URLQuery added in v2.5.0

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

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

type MonitorGetCreditUsageResponse added in v2.5.0

type MonitorGetCreditUsageResponse struct {
	Data []MonitorGetCreditUsageResponseData `json:"data" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Sum of credits across all monitors in the window.
	TotalCredits int64 `json:"total_credits" api:"required"`
	// Credits this request used and your remaining balance.
	KeyMetadata MonitorGetCreditUsageResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data         respjson.Field
		RequestID    respjson.Field
		TotalCredits respjson.Field
		KeyMetadata  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetCreditUsageResponse) RawJSON added in v2.5.0

Returns the unmodified JSON received from the API

func (*MonitorGetCreditUsageResponse) UnmarshalJSON added in v2.5.0

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

type MonitorGetCreditUsageResponseData added in v2.5.0

type MonitorGetCreditUsageResponseData struct {
	// Credits charged to this monitor over the window.
	Credits   int64  `json:"credits" api:"required"`
	MonitorID string `json:"monitor_id" api:"required"`
	// Monitor name (falls back to the id when the monitor was deleted).
	Name string `json:"name" api:"required"`
	// Number of billed runs over the window.
	Runs int64 `json:"runs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Credits     respjson.Field
		MonitorID   respjson.Field
		Name        respjson.Field
		Runs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetCreditUsageResponseData) RawJSON added in v2.5.0

Returns the unmodified JSON received from the API

func (*MonitorGetCreditUsageResponseData) UnmarshalJSON added in v2.5.0

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

type MonitorGetCreditUsageResponseKeyMetadata added in v2.22.0

type MonitorGetCreditUsageResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorGetCreditUsageResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorGetCreditUsageResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorGetLimitsResponse added in v2.5.0

type MonitorGetLimitsResponse struct {
	// Most monitors you can have: your plan's allowance or a custom limit.
	MonitorsLimit int64 `json:"monitors_limit" api:"required"`
	// Number of monitors the account currently has.
	MonitorsUsed int64 `json:"monitors_used" api:"required"`
	// `starter` means Developer; `pro` means Pro or Growth; `scale` means Scale or
	// Enterprise.
	//
	// Any of "free", "starter", "pro", "scale".
	Plan MonitorGetLimitsResponsePlan `json:"plan" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata MonitorGetLimitsResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonitorsLimit respjson.Field
		MonitorsUsed  respjson.Field
		Plan          respjson.Field
		RequestID     respjson.Field
		KeyMetadata   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetLimitsResponse) RawJSON added in v2.5.0

func (r MonitorGetLimitsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetLimitsResponse) UnmarshalJSON added in v2.5.0

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

type MonitorGetLimitsResponseKeyMetadata added in v2.22.0

type MonitorGetLimitsResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorGetLimitsResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorGetLimitsResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorGetLimitsResponsePlan added in v2.5.0

type MonitorGetLimitsResponsePlan string

`starter` means Developer; `pro` means Pro or Growth; `scale` means Scale or Enterprise.

const (
	MonitorGetLimitsResponsePlanFree    MonitorGetLimitsResponsePlan = "free"
	MonitorGetLimitsResponsePlanStarter MonitorGetLimitsResponsePlan = "starter"
	MonitorGetLimitsResponsePlanPro     MonitorGetLimitsResponsePlan = "pro"
	MonitorGetLimitsResponsePlanScale   MonitorGetLimitsResponsePlan = "scale"
)

type MonitorGetResponse

type MonitorGetResponse struct {
	ID string `json:"id" api:"required"`
	// How changes are judged. Defaults to `semantic` for extract targets and page
	// targets with `instructions`, otherwise `exact`.
	ChangeDetection MonitorGetResponseChangeDetectionUnion `json:"change_detection" api:"required"`
	CreatedAt       time.Time                              `json:"created_at" api:"required" format:"date-time"`
	// Always `web`. Optional.
	//
	// Any of "web".
	Mode MonitorGetResponseMode `json:"mode" api:"required"`
	Name string                 `json:"name" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Current state. Failed monitors keep running; paused monitors must be resumed
	// with `status: "active"`.
	//
	// Any of "active", "paused", "failed".
	Status MonitorGetResponseStatus `json:"status" api:"required"`
	// What to watch: a page, a sitemap, or data extracted from a site.
	Target    MonitorGetResponseTargetUnion `json:"target" api:"required"`
	UpdatedAt time.Time                     `json:"updated_at" api:"required" format:"date-time"`
	// Comparison baseline, included on Retrieve. Null until capture completes or after
	// target changes.
	Baseline MonitorGetResponseBaselineUnion `json:"baseline" api:"nullable"`
	// Credits this request used and your remaining balance.
	KeyMetadata  MonitorGetResponseKeyMetadata `json:"key_metadata"`
	LastChangeAt time.Time                     `json:"last_change_at" api:"nullable" format:"date-time"`
	// Error from the most recent failed run; null when the last run succeeded.
	LastError MonitorGetResponseLastError `json:"last_error" api:"nullable"`
	LastRunAt time.Time                   `json:"last_run_at" api:"nullable" format:"date-time"`
	// When the next scheduled run is due; null while paused.
	NextRunAt time.Time `json:"next_run_at" api:"nullable" format:"date-time"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorGetResponseSchedule `json:"schedule"`
	// Labels for filtering monitors, their changes, and their usage.
	Tags []string `json:"tags"`
	// Webhook destination and delivery settings. Null means no webhook is configured.
	Webhook MonitorGetResponseWebhook `json:"webhook" api:"nullable"`
	// Present while webhook deliveries are failing consecutively; null when deliveries
	// are healthy or no webhook is configured. Cleared on the next successful delivery
	// and when the webhook URL changes.
	WebhookFailure MonitorGetResponseWebhookFailure `json:"webhook_failure" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ChangeDetection respjson.Field
		CreatedAt       respjson.Field
		Mode            respjson.Field
		Name            respjson.Field
		RequestID       respjson.Field
		Status          respjson.Field
		Target          respjson.Field
		UpdatedAt       respjson.Field
		Baseline        respjson.Field
		KeyMetadata     respjson.Field
		LastChangeAt    respjson.Field
		LastError       respjson.Field
		LastRunAt       respjson.Field
		NextRunAt       respjson.Field
		Schedule        respjson.Field
		Tags            respjson.Field
		Webhook         respjson.Field
		WebhookFailure  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetResponse) RawJSON

func (r MonitorGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetResponse) UnmarshalJSON

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

type MonitorGetResponseBaselineExtractBaseline added in v2.1.0

type MonitorGetResponseBaselineExtractBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Latest structured snapshot matching the extraction schema, refreshed at most
	// daily; `null` before capture.
	Data any `json:"data" api:"required"`
	// The page URLs the monitor tracks and analyzes for changes.
	URLsAnalyzed []string `json:"urls_analyzed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt   respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.

func (MonitorGetResponseBaselineExtractBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseBaselineExtractBaseline) UnmarshalJSON added in v2.1.0

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

type MonitorGetResponseBaselinePageBaseline added in v2.1.0

type MonitorGetResponseBaselinePageBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The page's visible text as last observed.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `page` monitor: the visible page text as last observed.

func (MonitorGetResponseBaselinePageBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseBaselinePageBaseline) UnmarshalJSON added in v2.1.0

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

type MonitorGetResponseBaselineSitemapBaseline added in v2.1.0

type MonitorGetResponseBaselineSitemapBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Number of URLs in the baseline.
	URLCount int64 `json:"url_count" api:"required"`
	// The sitemap URLs as last observed (sorted, normalized).
	URLs []string `json:"urls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		URLCount    respjson.Field
		URLs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `sitemap` monitor: the normalized URL set as last observed.

func (MonitorGetResponseBaselineSitemapBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseBaselineSitemapBaseline) UnmarshalJSON added in v2.1.0

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

type MonitorGetResponseBaselineUnion added in v2.1.0

type MonitorGetResponseBaselineUnion struct {
	CapturedAt time.Time `json:"captured_at"`
	// This field is from variant [MonitorGetResponseBaselinePageBaseline].
	Text string `json:"text"`
	// This field is from variant [MonitorGetResponseBaselineSitemapBaseline].
	URLCount int64 `json:"url_count"`
	// This field is from variant [MonitorGetResponseBaselineSitemapBaseline].
	URLs []string `json:"urls"`
	// This field is from variant [MonitorGetResponseBaselineExtractBaseline].
	Data any `json:"data"`
	// This field is from variant [MonitorGetResponseBaselineExtractBaseline].
	URLsAnalyzed []string `json:"urls_analyzed"`
	JSON         struct {
		CapturedAt   respjson.Field
		Text         respjson.Field
		URLCount     respjson.Field
		URLs         respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorGetResponseBaselineUnion contains all possible properties and values from MonitorGetResponseBaselinePageBaseline, MonitorGetResponseBaselineSitemapBaseline, MonitorGetResponseBaselineExtractBaseline.

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

func (MonitorGetResponseBaselineUnion) AsExtractBaseline added in v2.1.0

func (MonitorGetResponseBaselineUnion) AsPageBaseline added in v2.1.0

func (MonitorGetResponseBaselineUnion) AsSitemapBaseline added in v2.1.0

func (MonitorGetResponseBaselineUnion) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseBaselineUnion) UnmarshalJSON added in v2.1.0

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

type MonitorGetResponseChangeDetectionExact

type MonitorGetResponseChangeDetectionExact struct {
	// Use `exact` to compare visible text or sitemap URLs.
	Type constant.Exact `json:"type" default:"exact"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

func (MonitorGetResponseChangeDetectionExact) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseChangeDetectionExact) UnmarshalJSON

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

type MonitorGetResponseChangeDetectionSemantic

type MonitorGetResponseChangeDetectionSemantic struct {
	// Use `semantic` to judge changes against the target instructions.
	Type constant.Semantic `json:"type" default:"semantic"`
	// Minimum confidence required to report a meaningful change, from 0 to 1.
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect meaningful content changes using the target’s instructions and optional schema.

func (MonitorGetResponseChangeDetectionSemantic) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseChangeDetectionSemantic) UnmarshalJSON

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

type MonitorGetResponseChangeDetectionUnion

type MonitorGetResponseChangeDetectionUnion struct {
	// Any of "exact", "semantic".
	Type string `json:"type"`
	// This field is from variant [MonitorGetResponseChangeDetectionSemantic].
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	JSON                struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorGetResponseChangeDetectionUnion contains all possible properties and values from MonitorGetResponseChangeDetectionExact, MonitorGetResponseChangeDetectionSemantic.

Use the MonitorGetResponseChangeDetectionUnion.AsAny method to switch on the variant.

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

func (MonitorGetResponseChangeDetectionUnion) AsAny

func (u MonitorGetResponseChangeDetectionUnion) AsAny() anyMonitorGetResponseChangeDetection

Use the following switch statement to find the correct variant

switch variant := MonitorGetResponseChangeDetectionUnion.AsAny().(type) {
case contextdev.MonitorGetResponseChangeDetectionExact:
case contextdev.MonitorGetResponseChangeDetectionSemantic:
default:
  fmt.Errorf("no variant present")
}

func (MonitorGetResponseChangeDetectionUnion) AsExact

func (MonitorGetResponseChangeDetectionUnion) AsSemantic

func (MonitorGetResponseChangeDetectionUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseChangeDetectionUnion) UnmarshalJSON

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

type MonitorGetResponseKeyMetadata added in v2.22.0

type MonitorGetResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorGetResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorGetResponseLastError

type MonitorGetResponseLastError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error from the most recent failed run; null when the last run succeeded.

func (MonitorGetResponseLastError) RawJSON

func (r MonitorGetResponseLastError) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetResponseLastError) UnmarshalJSON

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

type MonitorGetResponseMode

type MonitorGetResponseMode string

Always `web`. Optional.

const (
	MonitorGetResponseModeWeb MonitorGetResponseMode = "web"
)

type MonitorGetResponseSchedule

type MonitorGetResponseSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Use `interval` to run on a repeating schedule.
	//
	// Any of "interval".
	Type string `json:"type" api:"required"`
	// Time unit used with `frequency` to set the run interval.
	//
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Frequency   respjson.Field
		Type        respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

func (MonitorGetResponseSchedule) RawJSON

func (r MonitorGetResponseSchedule) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetResponseSchedule) UnmarshalJSON

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

type MonitorGetResponseStatus

type MonitorGetResponseStatus string

Current state. Failed monitors keep running; paused monitors must be resumed with `status: "active"`.

const (
	MonitorGetResponseStatusActive MonitorGetResponseStatus = "active"
	MonitorGetResponseStatusPaused MonitorGetResponseStatus = "paused"
	MonitorGetResponseStatusFailed MonitorGetResponseStatus = "failed"
)

type MonitorGetResponseTargetExtract

type MonitorGetResponseTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string `json:"instructions" api:"required"`
	// Use `extract` to watch structured data across selected pages.
	Type constant.Extract `json:"type" default:"extract"`
	// Root URL to extract structured data from.
	URL string `json:"url" api:"required" format:"uri"`
	// Allow page discovery on subdomains of the target site.
	FollowSubdomains bool `json:"follow_subdomains"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth int64 `json:"max_depth"`
	// Maximum number of pages to track.
	MaxPages int64 `json:"max_pages"`
	// JSON Schema for page selection and the baseline snapshot. Changes return diffs
	// and evidence.
	Schema map[string]any `json:"schema"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instructions     respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		FollowSubdomains respjson.Field
		MaxDepth         respjson.Field
		MaxPages         respjson.Field
		Schema           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Track relevant pages selected by `schema` and `instructions`; refresh the page set periodically.

func (MonitorGetResponseTargetExtract) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetExtract) UnmarshalJSON

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

type MonitorGetResponseTargetPage

type MonitorGetResponseTargetPage struct {
	// Use `page` to watch one web page.
	Type constant.Page `json:"type" default:"page"`
	// Public HTTP(S) page URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Optional browser actions executed in array order after the page loads, before
	// content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
	// Changes create a new baseline.
	Actions []MonitorGetResponseTargetPageActionUnion `json:"actions" api:"nullable"`
	// Remove matching regions after inclusions. Changes create a new baseline.
	ExcludeSelectors []string `json:"exclude_selectors"`
	// Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
	// create a new baseline.
	IncludeSelectors []string `json:"include_selectors"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions string `json:"instructions"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		URL                 respjson.Field
		Actions             respjson.Field
		ExcludeSelectors    respjson.Field
		IncludeSelectors    respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

func (MonitorGetResponseTargetPage) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetPage) UnmarshalJSON

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

type MonitorGetResponseTargetPageActionPerform added in v2.22.0

type MonitorGetResponseTargetPageActionPerform struct {
	// One browser instruction, such as clicking a button or entering text.
	Action string `json:"action" api:"required"`
	// Use `perform` for a plain-language browser instruction.
	Do constant.Perform `json:"do" default:"perform"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Action      respjson.Field
		Do          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolve and perform one natural-language browser action.

func (MonitorGetResponseTargetPageActionPerform) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetPageActionPerform) UnmarshalJSON added in v2.22.0

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

type MonitorGetResponseTargetPageActionScroll added in v2.22.0

type MonitorGetResponseTargetPageActionScroll struct {
	// Use `scroll` to move through the page or a container.
	Do constant.Scroll `json:"do" default:"scroll"`
	// Pixels per scroll, one visible viewport, or the current scroll boundary.
	// Defaults to viewport.
	Amount MonitorGetResponseTargetPageActionScrollAmountUnion `json:"amount"`
	// CSS selector for the first matching scroll container. Defaults to the page.
	Container string `json:"container"`
	// Direction to scroll. Defaults to down.
	//
	// Any of "up", "down", "left", "right".
	Direction string `json:"direction"`
	// Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
	// changing. Defaults to 1.
	MaxScrolls int64 `json:"maxScrolls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Do          respjson.Field
		Amount      respjson.Field
		Container   respjson.Field
		Direction   respjson.Field
		MaxScrolls  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.

func (MonitorGetResponseTargetPageActionScroll) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetPageActionScroll) UnmarshalJSON added in v2.22.0

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

type MonitorGetResponseTargetPageActionScrollAmountString added in v2.22.0

type MonitorGetResponseTargetPageActionScrollAmountString string
const (
	MonitorGetResponseTargetPageActionScrollAmountStringViewport MonitorGetResponseTargetPageActionScrollAmountString = "viewport"
	MonitorGetResponseTargetPageActionScrollAmountStringMax      MonitorGetResponseTargetPageActionScrollAmountString = "max"
)

type MonitorGetResponseTargetPageActionScrollAmountUnion added in v2.22.0

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

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

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

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

func (MonitorGetResponseTargetPageActionScrollAmountUnion) AsInt added in v2.22.0

func (MonitorGetResponseTargetPageActionScrollAmountUnion) AsMonitorGetResponseTargetPageActionScrollAmountString added in v2.22.0

func (u MonitorGetResponseTargetPageActionScrollAmountUnion) AsMonitorGetResponseTargetPageActionScrollAmountString() (v string)

func (MonitorGetResponseTargetPageActionScrollAmountUnion) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetPageActionScrollAmountUnion) UnmarshalJSON added in v2.22.0

type MonitorGetResponseTargetPageActionUnion added in v2.22.0

type MonitorGetResponseTargetPageActionUnion struct {
	// Any of "wait", "perform", "scroll".
	Do string `json:"do"`
	// This field is from variant [MonitorGetResponseTargetPageActionWait].
	TimeMs int64 `json:"timeMs"`
	// This field is from variant [MonitorGetResponseTargetPageActionPerform].
	Action string `json:"action"`
	// This field is from variant [MonitorGetResponseTargetPageActionScroll].
	Amount MonitorGetResponseTargetPageActionScrollAmountUnion `json:"amount"`
	// This field is from variant [MonitorGetResponseTargetPageActionScroll].
	Container string `json:"container"`
	// This field is from variant [MonitorGetResponseTargetPageActionScroll].
	Direction string `json:"direction"`
	// This field is from variant [MonitorGetResponseTargetPageActionScroll].
	MaxScrolls int64 `json:"maxScrolls"`
	JSON       struct {
		Do         respjson.Field
		TimeMs     respjson.Field
		Action     respjson.Field
		Amount     respjson.Field
		Container  respjson.Field
		Direction  respjson.Field
		MaxScrolls respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorGetResponseTargetPageActionUnion contains all possible properties and values from MonitorGetResponseTargetPageActionWait, MonitorGetResponseTargetPageActionPerform, MonitorGetResponseTargetPageActionScroll.

Use the MonitorGetResponseTargetPageActionUnion.AsAny method to switch on the variant.

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

func (MonitorGetResponseTargetPageActionUnion) AsAny added in v2.22.0

func (u MonitorGetResponseTargetPageActionUnion) AsAny() anyMonitorGetResponseTargetPageAction

Use the following switch statement to find the correct variant

switch variant := MonitorGetResponseTargetPageActionUnion.AsAny().(type) {
case contextdev.MonitorGetResponseTargetPageActionWait:
case contextdev.MonitorGetResponseTargetPageActionPerform:
case contextdev.MonitorGetResponseTargetPageActionScroll:
default:
  fmt.Errorf("no variant present")
}

func (MonitorGetResponseTargetPageActionUnion) AsPerform added in v2.22.0

func (MonitorGetResponseTargetPageActionUnion) AsScroll added in v2.22.0

func (MonitorGetResponseTargetPageActionUnion) AsWait added in v2.22.0

func (MonitorGetResponseTargetPageActionUnion) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetPageActionUnion) UnmarshalJSON added in v2.22.0

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

type MonitorGetResponseTargetPageActionWait added in v2.22.0

type MonitorGetResponseTargetPageActionWait struct {
	// Use `wait` to pause for a fixed duration.
	Do constant.Wait `json:"do" default:"wait"`
	// Time to pause in milliseconds before the next action.
	TimeMs int64 `json:"timeMs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Do          respjson.Field
		TimeMs      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pause for a fixed number of milliseconds before continuing to the next action.

func (MonitorGetResponseTargetPageActionWait) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetPageActionWait) UnmarshalJSON added in v2.22.0

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

type MonitorGetResponseTargetSitemap

type MonitorGetResponseTargetSitemap struct {
	// Use `sitemap` to watch a site for added or removed URLs.
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude"`
	// URL path patterns to include (max 50).
	Include []string `json:"include"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs int64 `json:"max_urls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		Exclude     respjson.Field
		Include     respjson.Field
		MaxURLs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a site’s URL inventory for confirmed additions and removals.

func (MonitorGetResponseTargetSitemap) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetSitemap) UnmarshalJSON

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

type MonitorGetResponseTargetUnion

type MonitorGetResponseTargetUnion struct {
	// Any of "page", "sitemap", "extract".
	Type string `json:"type"`
	URL  string `json:"url"`
	// This field is from variant [MonitorGetResponseTargetPage].
	Actions []MonitorGetResponseTargetPageActionUnion `json:"actions"`
	// This field is from variant [MonitorGetResponseTargetPage].
	ExcludeSelectors []string `json:"exclude_selectors"`
	// This field is from variant [MonitorGetResponseTargetPage].
	IncludeSelectors []string `json:"include_selectors"`
	Instructions     string   `json:"instructions"`
	// This field is from variant [MonitorGetResponseTargetPage].
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// This field is from variant [MonitorGetResponseTargetSitemap].
	Exclude []string `json:"exclude"`
	// This field is from variant [MonitorGetResponseTargetSitemap].
	Include []string `json:"include"`
	// This field is from variant [MonitorGetResponseTargetSitemap].
	MaxURLs int64 `json:"max_urls"`
	// This field is from variant [MonitorGetResponseTargetExtract].
	FollowSubdomains bool `json:"follow_subdomains"`
	// This field is from variant [MonitorGetResponseTargetExtract].
	MaxDepth int64 `json:"max_depth"`
	// This field is from variant [MonitorGetResponseTargetExtract].
	MaxPages int64 `json:"max_pages"`
	// This field is from variant [MonitorGetResponseTargetExtract].
	Schema map[string]any `json:"schema"`
	JSON   struct {
		Type                respjson.Field
		URL                 respjson.Field
		Actions             respjson.Field
		ExcludeSelectors    respjson.Field
		IncludeSelectors    respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		Exclude             respjson.Field
		Include             respjson.Field
		MaxURLs             respjson.Field
		FollowSubdomains    respjson.Field
		MaxDepth            respjson.Field
		MaxPages            respjson.Field
		Schema              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorGetResponseTargetUnion contains all possible properties and values from MonitorGetResponseTargetPage, MonitorGetResponseTargetSitemap, MonitorGetResponseTargetExtract.

Use the MonitorGetResponseTargetUnion.AsAny method to switch on the variant.

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

func (MonitorGetResponseTargetUnion) AsAny

func (u MonitorGetResponseTargetUnion) AsAny() anyMonitorGetResponseTarget

Use the following switch statement to find the correct variant

switch variant := MonitorGetResponseTargetUnion.AsAny().(type) {
case contextdev.MonitorGetResponseTargetPage:
case contextdev.MonitorGetResponseTargetSitemap:
case contextdev.MonitorGetResponseTargetExtract:
default:
  fmt.Errorf("no variant present")
}

func (MonitorGetResponseTargetUnion) AsExtract

func (MonitorGetResponseTargetUnion) AsPage

func (MonitorGetResponseTargetUnion) AsSitemap

func (MonitorGetResponseTargetUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorGetResponseTargetUnion) UnmarshalJSON

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

type MonitorGetResponseWebhook

type MonitorGetResponseWebhook struct {
	// Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
	// messages.
	URL string `json:"url" api:"required" format:"uri"`
	// Events to deliver. Defaults to `change.detected`; `run.completed` also includes
	// unchanged runs.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events"`
	// Webhook retry settings. Use {} for the default schedule.
	Retry RetryConfig `json:"retry"`
	// API-generated signing secret. Visible only with full access or `monitors:write`
	// permission.
	Secret string `json:"secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Events      respjson.Field
		Retry       respjson.Field
		Secret      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Webhook destination and delivery settings. Null means no webhook is configured.

func (MonitorGetResponseWebhook) RawJSON

func (r MonitorGetResponseWebhook) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetResponseWebhook) UnmarshalJSON

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

type MonitorGetResponseWebhookFailure added in v2.3.0

type MonitorGetResponseWebhookFailure struct {
	// Number of consecutive delivery attempts that did not succeed.
	ConsecutiveFailures int64     `json:"consecutive_failures" api:"required"`
	LastFailedAt        time.Time `json:"last_failed_at" api:"required" format:"date-time"`
	// Human-readable description of the most recent failure.
	LastMessage string `json:"last_message" api:"required"`
	// Outcome of the most recent failed delivery. rejected means a non-2xx response;
	// failed means no HTTP response was received; skipped_unsafe_url means the URL
	// failed the public-endpoint safety check.
	//
	// Any of "rejected", "failed", "skipped_unsafe_url".
	LastStatus string `json:"last_status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsecutiveFailures respjson.Field
		LastFailedAt        respjson.Field
		LastMessage         respjson.Field
		LastStatus          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Present while webhook deliveries are failing consecutively; null when deliveries are healthy or no webhook is configured. Cleared on the next successful delivery and when the webhook URL changes.

func (MonitorGetResponseWebhookFailure) RawJSON added in v2.3.0

Returns the unmodified JSON received from the API

func (*MonitorGetResponseWebhookFailure) UnmarshalJSON added in v2.3.0

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

type MonitorGetRunParams added in v2.20.0

type MonitorGetRunParams struct {
	// ID of the monitor.
	MonitorID string `path:"monitor_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type MonitorGetRunResponse added in v2.20.0

type MonitorGetRunResponse struct {
	ID string `json:"id" api:"required"`
	// True when this run established the monitor's initial baseline; baseline runs
	// perform no change detection.
	BaselineCreated bool `json:"baseline_created" api:"required"`
	ChangeDetected  bool `json:"change_detected" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType MonitorGetRunResponseChangeDetectionType `json:"change_detection_type" api:"required"`
	// Credits charged for this run (0 for skipped/failed runs).
	CreditsCharged int64  `json:"credits_charged" api:"required"`
	MonitorID      string `json:"monitor_id" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// A baseline run follows creation or a target or detection change.
	//
	// Any of "baseline", "scheduled".
	RunType MonitorGetRunResponseRunType `json:"run_type" api:"required"`
	// Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
	// (insufficient credits, monitor paused, or superseded by a concurrent run).
	//
	// Any of "queued", "running", "completed", "failed", "skipped".
	Status MonitorGetRunResponseStatus `json:"status" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType  MonitorGetRunResponseTargetType `json:"target_type" api:"required"`
	ChangeID    string                          `json:"change_id" api:"nullable"`
	CompletedAt time.Time                       `json:"completed_at" api:"nullable" format:"date-time"`
	Error       MonitorGetRunResponseError      `json:"error" api:"nullable"`
	// Credits this request used and your remaining balance.
	KeyMetadata MonitorGetRunResponseKeyMetadata `json:"key_metadata"`
	// Why a skipped run never executed; null unless status is `skipped`.
	//
	// Any of "insufficient_credits", "monitor_paused", "superseded".
	SkipReason MonitorGetRunResponseSkipReason `json:"skip_reason" api:"nullable"`
	StartedAt  time.Time                       `json:"started_at" api:"nullable" format:"date-time"`
	// All webhook deliveries attempted by this run — one per subscribed event that
	// fired. Omitted when no webhook was attempted, including runs created before
	// event selection was added.
	WebhookDeliveries []WebhookDelivery `json:"webhook_deliveries"`
	// Deprecated. Use `webhook_deliveries` for all attempts.
	//
	// Deprecated: deprecated
	WebhookDelivery WebhookDelivery `json:"webhook_delivery"`
	// Webhook delivery IDs for this run.
	WebhookDeliveryIDs []string `json:"webhook_delivery_ids"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		BaselineCreated     respjson.Field
		ChangeDetected      respjson.Field
		ChangeDetectionType respjson.Field
		CreditsCharged      respjson.Field
		MonitorID           respjson.Field
		RequestID           respjson.Field
		RunType             respjson.Field
		Status              respjson.Field
		TargetType          respjson.Field
		ChangeID            respjson.Field
		CompletedAt         respjson.Field
		Error               respjson.Field
		KeyMetadata         respjson.Field
		SkipReason          respjson.Field
		StartedAt           respjson.Field
		WebhookDeliveries   respjson.Field
		WebhookDelivery     respjson.Field
		WebhookDeliveryIDs  respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetRunResponse) RawJSON added in v2.20.0

func (r MonitorGetRunResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetRunResponse) UnmarshalJSON added in v2.20.0

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

type MonitorGetRunResponseChangeDetectionType added in v2.20.0

type MonitorGetRunResponseChangeDetectionType string
const (
	MonitorGetRunResponseChangeDetectionTypeExact    MonitorGetRunResponseChangeDetectionType = "exact"
	MonitorGetRunResponseChangeDetectionTypeSemantic MonitorGetRunResponseChangeDetectionType = "semantic"
)

type MonitorGetRunResponseError added in v2.20.0

type MonitorGetRunResponseError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorGetRunResponseError) RawJSON added in v2.20.0

func (r MonitorGetRunResponseError) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorGetRunResponseError) UnmarshalJSON added in v2.20.0

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

type MonitorGetRunResponseKeyMetadata added in v2.22.0

type MonitorGetRunResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorGetRunResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorGetRunResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorGetRunResponseRunType added in v2.20.0

type MonitorGetRunResponseRunType string

A baseline run follows creation or a target or detection change.

const (
	MonitorGetRunResponseRunTypeBaseline  MonitorGetRunResponseRunType = "baseline"
	MonitorGetRunResponseRunTypeScheduled MonitorGetRunResponseRunType = "scheduled"
)

type MonitorGetRunResponseSkipReason added in v2.20.0

type MonitorGetRunResponseSkipReason string

Why a skipped run never executed; null unless status is `skipped`.

const (
	MonitorGetRunResponseSkipReasonInsufficientCredits MonitorGetRunResponseSkipReason = "insufficient_credits"
	MonitorGetRunResponseSkipReasonMonitorPaused       MonitorGetRunResponseSkipReason = "monitor_paused"
	MonitorGetRunResponseSkipReasonSuperseded          MonitorGetRunResponseSkipReason = "superseded"
)

type MonitorGetRunResponseStatus added in v2.20.0

type MonitorGetRunResponseStatus string

Lifecycle status of a run. `skipped` runs never executed — see `skip_reason` (insufficient credits, monitor paused, or superseded by a concurrent run).

const (
	MonitorGetRunResponseStatusQueued    MonitorGetRunResponseStatus = "queued"
	MonitorGetRunResponseStatusRunning   MonitorGetRunResponseStatus = "running"
	MonitorGetRunResponseStatusCompleted MonitorGetRunResponseStatus = "completed"
	MonitorGetRunResponseStatusFailed    MonitorGetRunResponseStatus = "failed"
	MonitorGetRunResponseStatusSkipped   MonitorGetRunResponseStatus = "skipped"
)

type MonitorGetRunResponseTargetType added in v2.20.0

type MonitorGetRunResponseTargetType string
const (
	MonitorGetRunResponseTargetTypePage    MonitorGetRunResponseTargetType = "page"
	MonitorGetRunResponseTargetTypeSitemap MonitorGetRunResponseTargetType = "sitemap"
	MonitorGetRunResponseTargetTypeExtract MonitorGetRunResponseTargetType = "extract"
)

type MonitorListAccountChangesParams

type MonitorListAccountChangesParams struct {
	// Opaque pagination cursor from a previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return per page (1-100). Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter changes to a single monitor.
	MonitorID param.Opt[string] `query:"monitor_id,omitzero" json:"-"`
	// Only include items at or after this ISO 8601 timestamp.
	Since param.Opt[time.Time] `query:"since,omitzero" format:"date-time" json:"-"`
	// Filter to items that have this tag.
	Tag param.Opt[string] `query:"tag,omitzero" json:"-"`
	// Only include items before this ISO 8601 timestamp.
	Until param.Opt[time.Time] `query:"until,omitzero" format:"date-time" json:"-"`
	// Filter by change detection type.
	//
	// Any of "exact", "semantic".
	ChangeDetectionType MonitorListAccountChangesParamsChangeDetectionType `query:"change_detection_type,omitzero" json:"-"`
	// Filter by target type.
	//
	// Any of "page", "sitemap", "extract".
	TargetType MonitorListAccountChangesParamsTargetType `query:"target_type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorListAccountChangesParams) URLQuery

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

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

type MonitorListAccountChangesParamsChangeDetectionType

type MonitorListAccountChangesParamsChangeDetectionType string

Filter by change detection type.

const (
	MonitorListAccountChangesParamsChangeDetectionTypeExact    MonitorListAccountChangesParamsChangeDetectionType = "exact"
	MonitorListAccountChangesParamsChangeDetectionTypeSemantic MonitorListAccountChangesParamsChangeDetectionType = "semantic"
)

type MonitorListAccountChangesParamsTargetType

type MonitorListAccountChangesParamsTargetType string

Filter by target type.

const (
	MonitorListAccountChangesParamsTargetTypePage    MonitorListAccountChangesParamsTargetType = "page"
	MonitorListAccountChangesParamsTargetTypeSitemap MonitorListAccountChangesParamsTargetType = "sitemap"
	MonitorListAccountChangesParamsTargetTypeExtract MonitorListAccountChangesParamsTargetType = "extract"
)

type MonitorListAccountChangesResponse

type MonitorListAccountChangesResponse struct {
	Data       []MonitorListAccountChangesResponseData `json:"data" api:"required"`
	HasMore    bool                                    `json:"has_more" api:"required"`
	NextCursor string                                  `json:"next_cursor" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata MonitorListAccountChangesResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListAccountChangesResponse) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListAccountChangesResponse) UnmarshalJSON

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

type MonitorListAccountChangesResponseData

type MonitorListAccountChangesResponseData struct {
	ID string `json:"id" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType string    `json:"change_detection_type" api:"required"`
	DetectedAt          time.Time `json:"detected_at" api:"required" format:"date-time"`
	// Always `web`. Optional.
	//
	// Any of "web".
	Mode      string `json:"mode" api:"required"`
	MonitorID string `json:"monitor_id" api:"required"`
	// The run that detected this change.
	RunID   string `json:"run_id" api:"required"`
	Summary string `json:"summary" api:"required"`
	// Labels for filtering monitors, their changes, and their usage.
	Tags []string `json:"tags" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType    string `json:"target_type" api:"required"`
	Title         string `json:"title" api:"required"`
	URL           string `json:"url" api:"required" format:"uri"`
	AddedURLCount int64  `json:"added_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	AddedURLs         []string `json:"added_urls" format:"uri"`
	AfterTextExcerpt  string   `json:"after_text_excerpt"`
	BeforeTextExcerpt string   `json:"before_text_excerpt"`
	Confidence        float64  `json:"confidence"`
	// Text diff between the previous and current page baseline (page targets).
	Diff     string                                          `json:"diff"`
	Evidence []MonitorListAccountChangesResponseDataEvidence `json:"evidence"`
	// Any of "low", "medium", "high".
	Importance      string `json:"importance"`
	MatchedURLCount int64  `json:"matched_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	MatchedURLs     []string `json:"matched_urls" format:"uri"`
	RemovedURLCount int64    `json:"removed_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	RemovedURLs []string `json:"removed_urls" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		ChangeDetectionType respjson.Field
		DetectedAt          respjson.Field
		Mode                respjson.Field
		MonitorID           respjson.Field
		RunID               respjson.Field
		Summary             respjson.Field
		Tags                respjson.Field
		TargetType          respjson.Field
		Title               respjson.Field
		URL                 respjson.Field
		AddedURLCount       respjson.Field
		AddedURLs           respjson.Field
		AfterTextExcerpt    respjson.Field
		BeforeTextExcerpt   respjson.Field
		Confidence          respjson.Field
		Diff                respjson.Field
		Evidence            respjson.Field
		Importance          respjson.Field
		MatchedURLCount     respjson.Field
		MatchedURLs         respjson.Field
		RemovedURLCount     respjson.Field
		RemovedURLs         respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detected change, including applicable diffs, URLs, and supporting evidence.

func (MonitorListAccountChangesResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListAccountChangesResponseData) UnmarshalJSON

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

type MonitorListAccountChangesResponseDataEvidence added in v2.22.0

type MonitorListAccountChangesResponseDataEvidence struct {
	// Snapshot of the content after the change.
	After string `json:"after" api:"required"`
	// Snapshot of the content before the change.
	Before string `json:"before" api:"required"`
	// Optional URL the evidence relates to. Absent for whole-target diffs.
	URL string `json:"url" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListAccountChangesResponseDataEvidence) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListAccountChangesResponseDataEvidence) UnmarshalJSON added in v2.22.0

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

type MonitorListAccountChangesResponseKeyMetadata added in v2.22.0

type MonitorListAccountChangesResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorListAccountChangesResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListAccountChangesResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorListAccountRunsParams

type MonitorListAccountRunsParams struct {
	// Opaque pagination cursor from a previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return per page (1-100). Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter runs by lifecycle status.
	//
	// Any of "queued", "running", "completed", "failed", "skipped".
	Status MonitorListAccountRunsParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorListAccountRunsParams) URLQuery

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

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

type MonitorListAccountRunsParamsStatus

type MonitorListAccountRunsParamsStatus string

Filter runs by lifecycle status.

const (
	MonitorListAccountRunsParamsStatusQueued    MonitorListAccountRunsParamsStatus = "queued"
	MonitorListAccountRunsParamsStatusRunning   MonitorListAccountRunsParamsStatus = "running"
	MonitorListAccountRunsParamsStatusCompleted MonitorListAccountRunsParamsStatus = "completed"
	MonitorListAccountRunsParamsStatusFailed    MonitorListAccountRunsParamsStatus = "failed"
	MonitorListAccountRunsParamsStatusSkipped   MonitorListAccountRunsParamsStatus = "skipped"
)

type MonitorListAccountRunsResponse

type MonitorListAccountRunsResponse struct {
	Data       []MonitorListAccountRunsResponseData `json:"data" api:"required"`
	HasMore    bool                                 `json:"has_more" api:"required"`
	NextCursor string                               `json:"next_cursor" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata MonitorListAccountRunsResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListAccountRunsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListAccountRunsResponse) UnmarshalJSON

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

type MonitorListAccountRunsResponseData

type MonitorListAccountRunsResponseData struct {
	ID string `json:"id" api:"required"`
	// True when this run established the monitor's initial baseline; baseline runs
	// perform no change detection.
	BaselineCreated bool `json:"baseline_created" api:"required"`
	ChangeDetected  bool `json:"change_detected" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType string `json:"change_detection_type" api:"required"`
	// Credits charged for this run (0 for skipped/failed runs).
	CreditsCharged int64  `json:"credits_charged" api:"required"`
	MonitorID      string `json:"monitor_id" api:"required"`
	// A baseline run follows creation or a target or detection change.
	//
	// Any of "baseline", "scheduled".
	RunType string `json:"run_type" api:"required"`
	// Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
	// (insufficient credits, monitor paused, or superseded by a concurrent run).
	//
	// Any of "queued", "running", "completed", "failed", "skipped".
	Status string `json:"status" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType  string                                  `json:"target_type" api:"required"`
	ChangeID    string                                  `json:"change_id" api:"nullable"`
	CompletedAt time.Time                               `json:"completed_at" api:"nullable" format:"date-time"`
	Error       MonitorListAccountRunsResponseDataError `json:"error" api:"nullable"`
	// Why a skipped run never executed; null unless status is `skipped`.
	//
	// Any of "insufficient_credits", "monitor_paused", "superseded".
	SkipReason string    `json:"skip_reason" api:"nullable"`
	StartedAt  time.Time `json:"started_at" api:"nullable" format:"date-time"`
	// All webhook deliveries attempted by this run — one per subscribed event that
	// fired. Omitted when no webhook was attempted, including runs created before
	// event selection was added.
	WebhookDeliveries []WebhookDelivery `json:"webhook_deliveries"`
	// Deprecated. Use `webhook_deliveries` for all attempts.
	//
	// Deprecated: deprecated
	WebhookDelivery WebhookDelivery `json:"webhook_delivery"`
	// Webhook delivery IDs for this run.
	WebhookDeliveryIDs []string `json:"webhook_delivery_ids"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		BaselineCreated     respjson.Field
		ChangeDetected      respjson.Field
		ChangeDetectionType respjson.Field
		CreditsCharged      respjson.Field
		MonitorID           respjson.Field
		RunType             respjson.Field
		Status              respjson.Field
		TargetType          respjson.Field
		ChangeID            respjson.Field
		CompletedAt         respjson.Field
		Error               respjson.Field
		SkipReason          respjson.Field
		StartedAt           respjson.Field
		WebhookDeliveries   respjson.Field
		WebhookDelivery     respjson.Field
		WebhookDeliveryIDs  respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListAccountRunsResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListAccountRunsResponseData) UnmarshalJSON

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

type MonitorListAccountRunsResponseDataError

type MonitorListAccountRunsResponseDataError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListAccountRunsResponseDataError) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListAccountRunsResponseDataError) UnmarshalJSON

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

type MonitorListAccountRunsResponseKeyMetadata added in v2.22.0

type MonitorListAccountRunsResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorListAccountRunsResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListAccountRunsResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorListChangesParams

type MonitorListChangesParams struct {
	// Opaque pagination cursor from a previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return per page (1-100). Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Only include items at or after this ISO 8601 timestamp.
	Since param.Opt[time.Time] `query:"since,omitzero" format:"date-time" json:"-"`
	// Filter to items that have this tag.
	Tag param.Opt[string] `query:"tag,omitzero" json:"-"`
	// Only include items before this ISO 8601 timestamp.
	Until param.Opt[time.Time] `query:"until,omitzero" format:"date-time" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorListChangesParams) URLQuery

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

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

type MonitorListChangesResponse

type MonitorListChangesResponse struct {
	Data       []MonitorListChangesResponseData `json:"data" api:"required"`
	HasMore    bool                             `json:"has_more" api:"required"`
	NextCursor string                           `json:"next_cursor" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata MonitorListChangesResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListChangesResponse) RawJSON

func (r MonitorListChangesResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorListChangesResponse) UnmarshalJSON

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

type MonitorListChangesResponseData

type MonitorListChangesResponseData struct {
	ID string `json:"id" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType string    `json:"change_detection_type" api:"required"`
	DetectedAt          time.Time `json:"detected_at" api:"required" format:"date-time"`
	// Always `web`. Optional.
	//
	// Any of "web".
	Mode      string `json:"mode" api:"required"`
	MonitorID string `json:"monitor_id" api:"required"`
	// The run that detected this change.
	RunID   string `json:"run_id" api:"required"`
	Summary string `json:"summary" api:"required"`
	// Labels for filtering monitors, their changes, and their usage.
	Tags []string `json:"tags" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType    string `json:"target_type" api:"required"`
	Title         string `json:"title" api:"required"`
	URL           string `json:"url" api:"required" format:"uri"`
	AddedURLCount int64  `json:"added_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	AddedURLs         []string `json:"added_urls" format:"uri"`
	AfterTextExcerpt  string   `json:"after_text_excerpt"`
	BeforeTextExcerpt string   `json:"before_text_excerpt"`
	Confidence        float64  `json:"confidence"`
	// Text diff between the previous and current page baseline (page targets).
	Diff     string                                   `json:"diff"`
	Evidence []MonitorListChangesResponseDataEvidence `json:"evidence"`
	// Any of "low", "medium", "high".
	Importance      string `json:"importance"`
	MatchedURLCount int64  `json:"matched_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	MatchedURLs     []string `json:"matched_urls" format:"uri"`
	RemovedURLCount int64    `json:"removed_url_count"`
	// At most 500 URLs are included; the corresponding count field is always exact.
	RemovedURLs []string `json:"removed_urls" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		ChangeDetectionType respjson.Field
		DetectedAt          respjson.Field
		Mode                respjson.Field
		MonitorID           respjson.Field
		RunID               respjson.Field
		Summary             respjson.Field
		Tags                respjson.Field
		TargetType          respjson.Field
		Title               respjson.Field
		URL                 respjson.Field
		AddedURLCount       respjson.Field
		AddedURLs           respjson.Field
		AfterTextExcerpt    respjson.Field
		BeforeTextExcerpt   respjson.Field
		Confidence          respjson.Field
		Diff                respjson.Field
		Evidence            respjson.Field
		Importance          respjson.Field
		MatchedURLCount     respjson.Field
		MatchedURLs         respjson.Field
		RemovedURLCount     respjson.Field
		RemovedURLs         respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detected change, including applicable diffs, URLs, and supporting evidence.

func (MonitorListChangesResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListChangesResponseData) UnmarshalJSON

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

type MonitorListChangesResponseDataEvidence added in v2.22.0

type MonitorListChangesResponseDataEvidence struct {
	// Snapshot of the content after the change.
	After string `json:"after" api:"required"`
	// Snapshot of the content before the change.
	Before string `json:"before" api:"required"`
	// Optional URL the evidence relates to. Absent for whole-target diffs.
	URL string `json:"url" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		After       respjson.Field
		Before      respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListChangesResponseDataEvidence) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListChangesResponseDataEvidence) UnmarshalJSON added in v2.22.0

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

type MonitorListChangesResponseKeyMetadata added in v2.22.0

type MonitorListChangesResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorListChangesResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListChangesResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorListParams

type MonitorListParams struct {
	// Opaque pagination cursor from a previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return per page (1-100). Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Free-text search term, matched against the fields named in `search_by`.
	Q param.Opt[string] `query:"q,omitzero" json:"-"`
	// Filter to items that have this tag.
	Tag param.Opt[string] `query:"tag,omitzero" json:"-"`
	// Fields to search with `q`. Defaults to all fields; page and extract targets can
	// have instructions.
	//
	// Any of "name", "url", "instructions", "tags".
	SearchBy []string `query:"search_by,omitzero" json:"-"`
	// Comma-separated list of tags to filter by (matches monitors having any of them).
	Tags []string `query:"tags,omitzero" json:"-"`
	// Filter by change detection type.
	//
	// Any of "exact", "semantic".
	ChangeDetectionType MonitorListParamsChangeDetectionType `query:"change_detection_type,omitzero" json:"-"`
	// `prefix` for as-you-type prefix matching (default), `exact` for full-token
	// matching.
	//
	// Any of "exact", "prefix".
	SearchType MonitorListParamsSearchType `query:"search_type,omitzero" json:"-"`
	// Filter monitors by lifecycle status.
	//
	// Any of "active", "paused", "failed".
	Status MonitorListParamsStatus `query:"status,omitzero" json:"-"`
	// Filter by target type.
	//
	// Any of "page", "sitemap", "extract".
	TargetType MonitorListParamsTargetType `query:"target_type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorListParams) URLQuery

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

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

type MonitorListParamsChangeDetectionType

type MonitorListParamsChangeDetectionType string

Filter by change detection type.

const (
	MonitorListParamsChangeDetectionTypeExact    MonitorListParamsChangeDetectionType = "exact"
	MonitorListParamsChangeDetectionTypeSemantic MonitorListParamsChangeDetectionType = "semantic"
)

type MonitorListParamsSearchType

type MonitorListParamsSearchType string

`prefix` for as-you-type prefix matching (default), `exact` for full-token matching.

const (
	MonitorListParamsSearchTypeExact  MonitorListParamsSearchType = "exact"
	MonitorListParamsSearchTypePrefix MonitorListParamsSearchType = "prefix"
)

type MonitorListParamsStatus

type MonitorListParamsStatus string

Filter monitors by lifecycle status.

const (
	MonitorListParamsStatusActive MonitorListParamsStatus = "active"
	MonitorListParamsStatusPaused MonitorListParamsStatus = "paused"
	MonitorListParamsStatusFailed MonitorListParamsStatus = "failed"
)

type MonitorListParamsTargetType

type MonitorListParamsTargetType string

Filter by target type.

const (
	MonitorListParamsTargetTypePage    MonitorListParamsTargetType = "page"
	MonitorListParamsTargetTypeSitemap MonitorListParamsTargetType = "sitemap"
	MonitorListParamsTargetTypeExtract MonitorListParamsTargetType = "extract"
)

type MonitorListResponse

type MonitorListResponse struct {
	Data       []MonitorListResponseData `json:"data" api:"required"`
	HasMore    bool                      `json:"has_more" api:"required"`
	NextCursor string                    `json:"next_cursor" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata MonitorListResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListResponse) RawJSON

func (r MonitorListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorListResponse) UnmarshalJSON

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

type MonitorListResponseData

type MonitorListResponseData struct {
	ID string `json:"id" api:"required"`
	// How changes are judged. Defaults to `semantic` for extract targets and page
	// targets with `instructions`, otherwise `exact`.
	ChangeDetection MonitorListResponseDataChangeDetectionUnion `json:"change_detection" api:"required"`
	CreatedAt       time.Time                                   `json:"created_at" api:"required" format:"date-time"`
	// Always `web`. Optional.
	//
	// Any of "web".
	Mode string `json:"mode" api:"required"`
	Name string `json:"name" api:"required"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorListResponseDataSchedule `json:"schedule" api:"required"`
	// Current state. Failed monitors keep running; paused monitors must be resumed
	// with `status: "active"`.
	//
	// Any of "active", "paused", "failed".
	Status string `json:"status" api:"required"`
	// What to watch: a page, a sitemap, or data extracted from a site.
	Target    MonitorListResponseDataTargetUnion `json:"target" api:"required"`
	UpdatedAt time.Time                          `json:"updated_at" api:"required" format:"date-time"`
	// Comparison baseline, included on Retrieve. Null until capture completes or after
	// target changes.
	Baseline     MonitorListResponseDataBaselineUnion `json:"baseline" api:"nullable"`
	LastChangeAt time.Time                            `json:"last_change_at" api:"nullable" format:"date-time"`
	// Error from the most recent failed run; null when the last run succeeded.
	LastError MonitorListResponseDataLastError `json:"last_error" api:"nullable"`
	LastRunAt time.Time                        `json:"last_run_at" api:"nullable" format:"date-time"`
	// When the next scheduled run is due; null while paused.
	NextRunAt time.Time `json:"next_run_at" api:"nullable" format:"date-time"`
	// Labels for filtering monitors, their changes, and their usage.
	Tags []string `json:"tags"`
	// Webhook destination and delivery settings. Null means no webhook is configured.
	Webhook MonitorListResponseDataWebhook `json:"webhook" api:"nullable"`
	// Present while webhook deliveries are failing consecutively; null when deliveries
	// are healthy or no webhook is configured. Cleared on the next successful delivery
	// and when the webhook URL changes.
	WebhookFailure MonitorListResponseDataWebhookFailure `json:"webhook_failure" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ChangeDetection respjson.Field
		CreatedAt       respjson.Field
		Mode            respjson.Field
		Name            respjson.Field
		Schedule        respjson.Field
		Status          respjson.Field
		Target          respjson.Field
		UpdatedAt       respjson.Field
		Baseline        respjson.Field
		LastChangeAt    respjson.Field
		LastError       respjson.Field
		LastRunAt       respjson.Field
		NextRunAt       respjson.Field
		Tags            respjson.Field
		Webhook         respjson.Field
		WebhookFailure  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A web monitor. `mode` is the constant `web`; behavior is described by `target` (page/sitemap/extract) and `change_detection` (exact/semantic).

func (MonitorListResponseData) RawJSON

func (r MonitorListResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorListResponseData) UnmarshalJSON

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

type MonitorListResponseDataBaselineExtractBaseline added in v2.1.0

type MonitorListResponseDataBaselineExtractBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Latest structured snapshot matching the extraction schema, refreshed at most
	// daily; `null` before capture.
	Data any `json:"data" api:"required"`
	// The page URLs the monitor tracks and analyzes for changes.
	URLsAnalyzed []string `json:"urls_analyzed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt   respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.

func (MonitorListResponseDataBaselineExtractBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataBaselineExtractBaseline) UnmarshalJSON added in v2.1.0

type MonitorListResponseDataBaselinePageBaseline added in v2.1.0

type MonitorListResponseDataBaselinePageBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The page's visible text as last observed.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `page` monitor: the visible page text as last observed.

func (MonitorListResponseDataBaselinePageBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataBaselinePageBaseline) UnmarshalJSON added in v2.1.0

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

type MonitorListResponseDataBaselineSitemapBaseline added in v2.1.0

type MonitorListResponseDataBaselineSitemapBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Number of URLs in the baseline.
	URLCount int64 `json:"url_count" api:"required"`
	// The sitemap URLs as last observed (sorted, normalized).
	URLs []string `json:"urls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		URLCount    respjson.Field
		URLs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `sitemap` monitor: the normalized URL set as last observed.

func (MonitorListResponseDataBaselineSitemapBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataBaselineSitemapBaseline) UnmarshalJSON added in v2.1.0

type MonitorListResponseDataBaselineUnion added in v2.1.0

type MonitorListResponseDataBaselineUnion struct {
	CapturedAt time.Time `json:"captured_at"`
	// This field is from variant [MonitorListResponseDataBaselinePageBaseline].
	Text string `json:"text"`
	// This field is from variant [MonitorListResponseDataBaselineSitemapBaseline].
	URLCount int64 `json:"url_count"`
	// This field is from variant [MonitorListResponseDataBaselineSitemapBaseline].
	URLs []string `json:"urls"`
	// This field is from variant [MonitorListResponseDataBaselineExtractBaseline].
	Data any `json:"data"`
	// This field is from variant [MonitorListResponseDataBaselineExtractBaseline].
	URLsAnalyzed []string `json:"urls_analyzed"`
	JSON         struct {
		CapturedAt   respjson.Field
		Text         respjson.Field
		URLCount     respjson.Field
		URLs         respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorListResponseDataBaselineUnion contains all possible properties and values from MonitorListResponseDataBaselinePageBaseline, MonitorListResponseDataBaselineSitemapBaseline, MonitorListResponseDataBaselineExtractBaseline.

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

func (MonitorListResponseDataBaselineUnion) AsExtractBaseline added in v2.1.0

func (MonitorListResponseDataBaselineUnion) AsPageBaseline added in v2.1.0

func (MonitorListResponseDataBaselineUnion) AsSitemapBaseline added in v2.1.0

func (MonitorListResponseDataBaselineUnion) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataBaselineUnion) UnmarshalJSON added in v2.1.0

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

type MonitorListResponseDataChangeDetectionExact

type MonitorListResponseDataChangeDetectionExact struct {
	// Use `exact` to compare visible text or sitemap URLs.
	Type constant.Exact `json:"type" default:"exact"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

func (MonitorListResponseDataChangeDetectionExact) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataChangeDetectionExact) UnmarshalJSON

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

type MonitorListResponseDataChangeDetectionSemantic

type MonitorListResponseDataChangeDetectionSemantic struct {
	// Use `semantic` to judge changes against the target instructions.
	Type constant.Semantic `json:"type" default:"semantic"`
	// Minimum confidence required to report a meaningful change, from 0 to 1.
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect meaningful content changes using the target’s instructions and optional schema.

func (MonitorListResponseDataChangeDetectionSemantic) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataChangeDetectionSemantic) UnmarshalJSON

type MonitorListResponseDataChangeDetectionUnion

type MonitorListResponseDataChangeDetectionUnion struct {
	// Any of "exact", "semantic".
	Type string `json:"type"`
	// This field is from variant [MonitorListResponseDataChangeDetectionSemantic].
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	JSON                struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorListResponseDataChangeDetectionUnion contains all possible properties and values from MonitorListResponseDataChangeDetectionExact, MonitorListResponseDataChangeDetectionSemantic.

Use the MonitorListResponseDataChangeDetectionUnion.AsAny method to switch on the variant.

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

func (MonitorListResponseDataChangeDetectionUnion) AsAny

func (u MonitorListResponseDataChangeDetectionUnion) AsAny() anyMonitorListResponseDataChangeDetection

Use the following switch statement to find the correct variant

switch variant := MonitorListResponseDataChangeDetectionUnion.AsAny().(type) {
case contextdev.MonitorListResponseDataChangeDetectionExact:
case contextdev.MonitorListResponseDataChangeDetectionSemantic:
default:
  fmt.Errorf("no variant present")
}

func (MonitorListResponseDataChangeDetectionUnion) AsExact

func (MonitorListResponseDataChangeDetectionUnion) AsSemantic

func (MonitorListResponseDataChangeDetectionUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataChangeDetectionUnion) UnmarshalJSON

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

type MonitorListResponseDataLastError

type MonitorListResponseDataLastError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error from the most recent failed run; null when the last run succeeded.

func (MonitorListResponseDataLastError) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataLastError) UnmarshalJSON

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

type MonitorListResponseDataSchedule

type MonitorListResponseDataSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Use `interval` to run on a repeating schedule.
	//
	// Any of "interval".
	Type string `json:"type" api:"required"`
	// Time unit used with `frequency` to set the run interval.
	//
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Frequency   respjson.Field
		Type        respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

func (MonitorListResponseDataSchedule) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataSchedule) UnmarshalJSON

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

type MonitorListResponseDataTargetExtract

type MonitorListResponseDataTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string `json:"instructions" api:"required"`
	// Use `extract` to watch structured data across selected pages.
	Type constant.Extract `json:"type" default:"extract"`
	// Root URL to extract structured data from.
	URL string `json:"url" api:"required" format:"uri"`
	// Allow page discovery on subdomains of the target site.
	FollowSubdomains bool `json:"follow_subdomains"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth int64 `json:"max_depth"`
	// Maximum number of pages to track.
	MaxPages int64 `json:"max_pages"`
	// JSON Schema for page selection and the baseline snapshot. Changes return diffs
	// and evidence.
	Schema map[string]any `json:"schema"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instructions     respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		FollowSubdomains respjson.Field
		MaxDepth         respjson.Field
		MaxPages         respjson.Field
		Schema           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Track relevant pages selected by `schema` and `instructions`; refresh the page set periodically.

func (MonitorListResponseDataTargetExtract) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetExtract) UnmarshalJSON

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

type MonitorListResponseDataTargetPage

type MonitorListResponseDataTargetPage struct {
	// Use `page` to watch one web page.
	Type constant.Page `json:"type" default:"page"`
	// Public HTTP(S) page URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Optional browser actions executed in array order after the page loads, before
	// content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
	// Changes create a new baseline.
	Actions []MonitorListResponseDataTargetPageActionUnion `json:"actions" api:"nullable"`
	// Remove matching regions after inclusions. Changes create a new baseline.
	ExcludeSelectors []string `json:"exclude_selectors"`
	// Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
	// create a new baseline.
	IncludeSelectors []string `json:"include_selectors"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions string `json:"instructions"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		URL                 respjson.Field
		Actions             respjson.Field
		ExcludeSelectors    respjson.Field
		IncludeSelectors    respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

func (MonitorListResponseDataTargetPage) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetPage) UnmarshalJSON

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

type MonitorListResponseDataTargetPageActionPerform added in v2.22.0

type MonitorListResponseDataTargetPageActionPerform struct {
	// One browser instruction, such as clicking a button or entering text.
	Action string `json:"action" api:"required"`
	// Use `perform` for a plain-language browser instruction.
	Do constant.Perform `json:"do" default:"perform"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Action      respjson.Field
		Do          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolve and perform one natural-language browser action.

func (MonitorListResponseDataTargetPageActionPerform) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetPageActionPerform) UnmarshalJSON added in v2.22.0

type MonitorListResponseDataTargetPageActionScroll added in v2.22.0

type MonitorListResponseDataTargetPageActionScroll struct {
	// Use `scroll` to move through the page or a container.
	Do constant.Scroll `json:"do" default:"scroll"`
	// Pixels per scroll, one visible viewport, or the current scroll boundary.
	// Defaults to viewport.
	Amount MonitorListResponseDataTargetPageActionScrollAmountUnion `json:"amount"`
	// CSS selector for the first matching scroll container. Defaults to the page.
	Container string `json:"container"`
	// Direction to scroll. Defaults to down.
	//
	// Any of "up", "down", "left", "right".
	Direction string `json:"direction"`
	// Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
	// changing. Defaults to 1.
	MaxScrolls int64 `json:"maxScrolls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Do          respjson.Field
		Amount      respjson.Field
		Container   respjson.Field
		Direction   respjson.Field
		MaxScrolls  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.

func (MonitorListResponseDataTargetPageActionScroll) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetPageActionScroll) UnmarshalJSON added in v2.22.0

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

type MonitorListResponseDataTargetPageActionScrollAmountString added in v2.22.0

type MonitorListResponseDataTargetPageActionScrollAmountString string
const (
	MonitorListResponseDataTargetPageActionScrollAmountStringViewport MonitorListResponseDataTargetPageActionScrollAmountString = "viewport"
	MonitorListResponseDataTargetPageActionScrollAmountStringMax      MonitorListResponseDataTargetPageActionScrollAmountString = "max"
)

type MonitorListResponseDataTargetPageActionScrollAmountUnion added in v2.22.0

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

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

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

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

func (MonitorListResponseDataTargetPageActionScrollAmountUnion) AsInt added in v2.22.0

func (MonitorListResponseDataTargetPageActionScrollAmountUnion) AsMonitorListResponseDataTargetPageActionScrollAmountString added in v2.22.0

func (u MonitorListResponseDataTargetPageActionScrollAmountUnion) AsMonitorListResponseDataTargetPageActionScrollAmountString() (v string)

func (MonitorListResponseDataTargetPageActionScrollAmountUnion) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetPageActionScrollAmountUnion) UnmarshalJSON added in v2.22.0

type MonitorListResponseDataTargetPageActionUnion added in v2.22.0

type MonitorListResponseDataTargetPageActionUnion struct {
	// Any of "wait", "perform", "scroll".
	Do string `json:"do"`
	// This field is from variant [MonitorListResponseDataTargetPageActionWait].
	TimeMs int64 `json:"timeMs"`
	// This field is from variant [MonitorListResponseDataTargetPageActionPerform].
	Action string `json:"action"`
	// This field is from variant [MonitorListResponseDataTargetPageActionScroll].
	Amount MonitorListResponseDataTargetPageActionScrollAmountUnion `json:"amount"`
	// This field is from variant [MonitorListResponseDataTargetPageActionScroll].
	Container string `json:"container"`
	// This field is from variant [MonitorListResponseDataTargetPageActionScroll].
	Direction string `json:"direction"`
	// This field is from variant [MonitorListResponseDataTargetPageActionScroll].
	MaxScrolls int64 `json:"maxScrolls"`
	JSON       struct {
		Do         respjson.Field
		TimeMs     respjson.Field
		Action     respjson.Field
		Amount     respjson.Field
		Container  respjson.Field
		Direction  respjson.Field
		MaxScrolls respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorListResponseDataTargetPageActionUnion contains all possible properties and values from MonitorListResponseDataTargetPageActionWait, MonitorListResponseDataTargetPageActionPerform, MonitorListResponseDataTargetPageActionScroll.

Use the MonitorListResponseDataTargetPageActionUnion.AsAny method to switch on the variant.

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

func (MonitorListResponseDataTargetPageActionUnion) AsAny added in v2.22.0

func (u MonitorListResponseDataTargetPageActionUnion) AsAny() anyMonitorListResponseDataTargetPageAction

Use the following switch statement to find the correct variant

switch variant := MonitorListResponseDataTargetPageActionUnion.AsAny().(type) {
case contextdev.MonitorListResponseDataTargetPageActionWait:
case contextdev.MonitorListResponseDataTargetPageActionPerform:
case contextdev.MonitorListResponseDataTargetPageActionScroll:
default:
  fmt.Errorf("no variant present")
}

func (MonitorListResponseDataTargetPageActionUnion) AsPerform added in v2.22.0

func (MonitorListResponseDataTargetPageActionUnion) AsScroll added in v2.22.0

func (MonitorListResponseDataTargetPageActionUnion) AsWait added in v2.22.0

func (MonitorListResponseDataTargetPageActionUnion) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetPageActionUnion) UnmarshalJSON added in v2.22.0

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

type MonitorListResponseDataTargetPageActionWait added in v2.22.0

type MonitorListResponseDataTargetPageActionWait struct {
	// Use `wait` to pause for a fixed duration.
	Do constant.Wait `json:"do" default:"wait"`
	// Time to pause in milliseconds before the next action.
	TimeMs int64 `json:"timeMs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Do          respjson.Field
		TimeMs      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pause for a fixed number of milliseconds before continuing to the next action.

func (MonitorListResponseDataTargetPageActionWait) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetPageActionWait) UnmarshalJSON added in v2.22.0

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

type MonitorListResponseDataTargetSitemap

type MonitorListResponseDataTargetSitemap struct {
	// Use `sitemap` to watch a site for added or removed URLs.
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude"`
	// URL path patterns to include (max 50).
	Include []string `json:"include"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs int64 `json:"max_urls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		Exclude     respjson.Field
		Include     respjson.Field
		MaxURLs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a site’s URL inventory for confirmed additions and removals.

func (MonitorListResponseDataTargetSitemap) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetSitemap) UnmarshalJSON

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

type MonitorListResponseDataTargetUnion

type MonitorListResponseDataTargetUnion struct {
	// Any of "page", "sitemap", "extract".
	Type string `json:"type"`
	URL  string `json:"url"`
	// This field is from variant [MonitorListResponseDataTargetPage].
	Actions []MonitorListResponseDataTargetPageActionUnion `json:"actions"`
	// This field is from variant [MonitorListResponseDataTargetPage].
	ExcludeSelectors []string `json:"exclude_selectors"`
	// This field is from variant [MonitorListResponseDataTargetPage].
	IncludeSelectors []string `json:"include_selectors"`
	Instructions     string   `json:"instructions"`
	// This field is from variant [MonitorListResponseDataTargetPage].
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// This field is from variant [MonitorListResponseDataTargetSitemap].
	Exclude []string `json:"exclude"`
	// This field is from variant [MonitorListResponseDataTargetSitemap].
	Include []string `json:"include"`
	// This field is from variant [MonitorListResponseDataTargetSitemap].
	MaxURLs int64 `json:"max_urls"`
	// This field is from variant [MonitorListResponseDataTargetExtract].
	FollowSubdomains bool `json:"follow_subdomains"`
	// This field is from variant [MonitorListResponseDataTargetExtract].
	MaxDepth int64 `json:"max_depth"`
	// This field is from variant [MonitorListResponseDataTargetExtract].
	MaxPages int64 `json:"max_pages"`
	// This field is from variant [MonitorListResponseDataTargetExtract].
	Schema map[string]any `json:"schema"`
	JSON   struct {
		Type                respjson.Field
		URL                 respjson.Field
		Actions             respjson.Field
		ExcludeSelectors    respjson.Field
		IncludeSelectors    respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		Exclude             respjson.Field
		Include             respjson.Field
		MaxURLs             respjson.Field
		FollowSubdomains    respjson.Field
		MaxDepth            respjson.Field
		MaxPages            respjson.Field
		Schema              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorListResponseDataTargetUnion contains all possible properties and values from MonitorListResponseDataTargetPage, MonitorListResponseDataTargetSitemap, MonitorListResponseDataTargetExtract.

Use the MonitorListResponseDataTargetUnion.AsAny method to switch on the variant.

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

func (MonitorListResponseDataTargetUnion) AsAny

func (u MonitorListResponseDataTargetUnion) AsAny() anyMonitorListResponseDataTarget

Use the following switch statement to find the correct variant

switch variant := MonitorListResponseDataTargetUnion.AsAny().(type) {
case contextdev.MonitorListResponseDataTargetPage:
case contextdev.MonitorListResponseDataTargetSitemap:
case contextdev.MonitorListResponseDataTargetExtract:
default:
  fmt.Errorf("no variant present")
}

func (MonitorListResponseDataTargetUnion) AsExtract

func (MonitorListResponseDataTargetUnion) AsPage

func (MonitorListResponseDataTargetUnion) AsSitemap

func (MonitorListResponseDataTargetUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataTargetUnion) UnmarshalJSON

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

type MonitorListResponseDataWebhook

type MonitorListResponseDataWebhook struct {
	// Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
	// messages.
	URL string `json:"url" api:"required" format:"uri"`
	// Events to deliver. Defaults to `change.detected`; `run.completed` also includes
	// unchanged runs.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events"`
	// Webhook retry settings. Use {} for the default schedule.
	Retry RetryConfig `json:"retry"`
	// API-generated signing secret. Visible only with full access or `monitors:write`
	// permission.
	Secret string `json:"secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Events      respjson.Field
		Retry       respjson.Field
		Secret      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Webhook destination and delivery settings. Null means no webhook is configured.

func (MonitorListResponseDataWebhook) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataWebhook) UnmarshalJSON

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

type MonitorListResponseDataWebhookFailure added in v2.3.0

type MonitorListResponseDataWebhookFailure struct {
	// Number of consecutive delivery attempts that did not succeed.
	ConsecutiveFailures int64     `json:"consecutive_failures" api:"required"`
	LastFailedAt        time.Time `json:"last_failed_at" api:"required" format:"date-time"`
	// Human-readable description of the most recent failure.
	LastMessage string `json:"last_message" api:"required"`
	// Outcome of the most recent failed delivery. rejected means a non-2xx response;
	// failed means no HTTP response was received; skipped_unsafe_url means the URL
	// failed the public-endpoint safety check.
	//
	// Any of "rejected", "failed", "skipped_unsafe_url".
	LastStatus string `json:"last_status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsecutiveFailures respjson.Field
		LastFailedAt        respjson.Field
		LastMessage         respjson.Field
		LastStatus          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Present while webhook deliveries are failing consecutively; null when deliveries are healthy or no webhook is configured. Cleared on the next successful delivery and when the webhook URL changes.

func (MonitorListResponseDataWebhookFailure) RawJSON added in v2.3.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseDataWebhookFailure) UnmarshalJSON added in v2.3.0

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

type MonitorListResponseKeyMetadata added in v2.22.0

type MonitorListResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorListResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorListRunsParams

type MonitorListRunsParams struct {
	// Opaque pagination cursor from a previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum number of items to return per page (1-100). Defaults to 25.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter runs by lifecycle status.
	//
	// Any of "queued", "running", "completed", "failed", "skipped".
	Status MonitorListRunsParamsStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MonitorListRunsParams) URLQuery

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

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

type MonitorListRunsParamsStatus

type MonitorListRunsParamsStatus string

Filter runs by lifecycle status.

const (
	MonitorListRunsParamsStatusQueued    MonitorListRunsParamsStatus = "queued"
	MonitorListRunsParamsStatusRunning   MonitorListRunsParamsStatus = "running"
	MonitorListRunsParamsStatusCompleted MonitorListRunsParamsStatus = "completed"
	MonitorListRunsParamsStatusFailed    MonitorListRunsParamsStatus = "failed"
	MonitorListRunsParamsStatusSkipped   MonitorListRunsParamsStatus = "skipped"
)

type MonitorListRunsResponse

type MonitorListRunsResponse struct {
	Data       []MonitorListRunsResponseData `json:"data" api:"required"`
	HasMore    bool                          `json:"has_more" api:"required"`
	NextCursor string                        `json:"next_cursor" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata MonitorListRunsResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListRunsResponse) RawJSON

func (r MonitorListRunsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorListRunsResponse) UnmarshalJSON

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

type MonitorListRunsResponseData

type MonitorListRunsResponseData struct {
	ID string `json:"id" api:"required"`
	// True when this run established the monitor's initial baseline; baseline runs
	// perform no change detection.
	BaselineCreated bool `json:"baseline_created" api:"required"`
	ChangeDetected  bool `json:"change_detected" api:"required"`
	// Any of "exact", "semantic".
	ChangeDetectionType string `json:"change_detection_type" api:"required"`
	// Credits charged for this run (0 for skipped/failed runs).
	CreditsCharged int64  `json:"credits_charged" api:"required"`
	MonitorID      string `json:"monitor_id" api:"required"`
	// A baseline run follows creation or a target or detection change.
	//
	// Any of "baseline", "scheduled".
	RunType string `json:"run_type" api:"required"`
	// Lifecycle status of a run. `skipped` runs never executed — see `skip_reason`
	// (insufficient credits, monitor paused, or superseded by a concurrent run).
	//
	// Any of "queued", "running", "completed", "failed", "skipped".
	Status string `json:"status" api:"required"`
	// Any of "page", "sitemap", "extract".
	TargetType  string                           `json:"target_type" api:"required"`
	ChangeID    string                           `json:"change_id" api:"nullable"`
	CompletedAt time.Time                        `json:"completed_at" api:"nullable" format:"date-time"`
	Error       MonitorListRunsResponseDataError `json:"error" api:"nullable"`
	// Why a skipped run never executed; null unless status is `skipped`.
	//
	// Any of "insufficient_credits", "monitor_paused", "superseded".
	SkipReason string    `json:"skip_reason" api:"nullable"`
	StartedAt  time.Time `json:"started_at" api:"nullable" format:"date-time"`
	// All webhook deliveries attempted by this run — one per subscribed event that
	// fired. Omitted when no webhook was attempted, including runs created before
	// event selection was added.
	WebhookDeliveries []WebhookDelivery `json:"webhook_deliveries"`
	// Deprecated. Use `webhook_deliveries` for all attempts.
	//
	// Deprecated: deprecated
	WebhookDelivery WebhookDelivery `json:"webhook_delivery"`
	// Webhook delivery IDs for this run.
	WebhookDeliveryIDs []string `json:"webhook_delivery_ids"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                  respjson.Field
		BaselineCreated     respjson.Field
		ChangeDetected      respjson.Field
		ChangeDetectionType respjson.Field
		CreditsCharged      respjson.Field
		MonitorID           respjson.Field
		RunType             respjson.Field
		Status              respjson.Field
		TargetType          respjson.Field
		ChangeID            respjson.Field
		CompletedAt         respjson.Field
		Error               respjson.Field
		SkipReason          respjson.Field
		StartedAt           respjson.Field
		WebhookDeliveries   respjson.Field
		WebhookDelivery     respjson.Field
		WebhookDeliveryIDs  respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListRunsResponseData) RawJSON

func (r MonitorListRunsResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorListRunsResponseData) UnmarshalJSON

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

type MonitorListRunsResponseDataError

type MonitorListRunsResponseDataError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorListRunsResponseDataError) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorListRunsResponseDataError) UnmarshalJSON

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

type MonitorListRunsResponseKeyMetadata added in v2.22.0

type MonitorListRunsResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorListRunsResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorListRunsResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorNewParams

type MonitorNewParams struct {
	// Display name for the monitor.
	Name string `json:"name" api:"required"`
	// What to watch: a page, a sitemap, or data extracted from a site.
	Target MonitorNewParamsTargetUnion `json:"target,omitzero" api:"required"`
	// Webhook destination and delivery settings. Null means no webhook is configured.
	Webhook MonitorNewParamsWebhook `json:"webhook,omitzero"`
	// How changes are judged. Defaults to `semantic` for extract targets and page
	// targets with `instructions`, otherwise `exact`.
	ChangeDetection MonitorNewParamsChangeDetectionUnion `json:"change_detection,omitzero"`
	// Always `web`. Optional.
	//
	// Any of "web".
	Mode MonitorNewParamsMode `json:"mode,omitzero"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorNewParamsSchedule `json:"schedule,omitzero"`
	// Labels for filtering monitors, their changes, and their usage.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (MonitorNewParams) MarshalJSON

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

func (*MonitorNewParams) UnmarshalJSON

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

type MonitorNewParamsChangeDetectionExact

type MonitorNewParamsChangeDetectionExact struct {
	// Use `exact` to compare visible text or sitemap URLs.
	Type constant.Exact `json:"type" default:"exact"`
	// contains filtered or unexported fields
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

This struct has a constant value, construct it with NewMonitorNewParamsChangeDetectionExact.

func NewMonitorNewParamsChangeDetectionExact

func NewMonitorNewParamsChangeDetectionExact() MonitorNewParamsChangeDetectionExact

func (MonitorNewParamsChangeDetectionExact) MarshalJSON

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

func (*MonitorNewParamsChangeDetectionExact) UnmarshalJSON

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

type MonitorNewParamsChangeDetectionSemantic

type MonitorNewParamsChangeDetectionSemantic struct {
	// Minimum confidence required to report a meaningful change, from 0 to 1.
	ConfidenceThreshold param.Opt[float64] `json:"confidence_threshold,omitzero"`
	// Use `semantic` to judge changes against the target instructions.
	//
	// This field can be elided, and will marshal its zero value as "semantic".
	Type constant.Semantic `json:"type" default:"semantic"`
	// contains filtered or unexported fields
}

Detect meaningful content changes using the target’s instructions and optional schema.

The property Type is required.

func (MonitorNewParamsChangeDetectionSemantic) MarshalJSON

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

func (*MonitorNewParamsChangeDetectionSemantic) UnmarshalJSON

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

type MonitorNewParamsChangeDetectionUnion

type MonitorNewParamsChangeDetectionUnion struct {
	OfExact    *MonitorNewParamsChangeDetectionExact    `json:",omitzero,inline"`
	OfSemantic *MonitorNewParamsChangeDetectionSemantic `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorNewParamsChangeDetectionUnion) MarshalJSON

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

func (*MonitorNewParamsChangeDetectionUnion) UnmarshalJSON

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

type MonitorNewParamsMode

type MonitorNewParamsMode string

Always `web`. Optional.

const (
	MonitorNewParamsModeWeb MonitorNewParamsMode = "web"
)

type MonitorNewParamsSchedule

type MonitorNewParamsSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Use `interval` to run on a repeating schedule.
	//
	// Any of "interval".
	Type string `json:"type,omitzero" api:"required"`
	// Time unit used with `frequency` to set the run interval.
	//
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

The properties Frequency, Type, Unit are required.

func (MonitorNewParamsSchedule) MarshalJSON

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

func (*MonitorNewParamsSchedule) UnmarshalJSON

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

type MonitorNewParamsTargetExtract

type MonitorNewParamsTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string `json:"instructions" api:"required"`
	// Root URL to extract structured data from.
	URL string `json:"url" api:"required" format:"uri"`
	// Allow page discovery on subdomains of the target site.
	FollowSubdomains param.Opt[bool] `json:"follow_subdomains,omitzero"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth param.Opt[int64] `json:"max_depth,omitzero"`
	// Maximum number of pages to track.
	MaxPages param.Opt[int64] `json:"max_pages,omitzero"`
	// JSON Schema for page selection and the baseline snapshot. Changes return diffs
	// and evidence.
	Schema map[string]any `json:"schema,omitzero"`
	// Use `extract` to watch structured data across selected pages.
	//
	// This field can be elided, and will marshal its zero value as "extract".
	Type constant.Extract `json:"type" default:"extract"`
	// contains filtered or unexported fields
}

Track relevant pages selected by `schema` and `instructions`; refresh the page set periodically.

The properties Instructions, Type, URL are required.

func (MonitorNewParamsTargetExtract) MarshalJSON

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

func (*MonitorNewParamsTargetExtract) UnmarshalJSON

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

type MonitorNewParamsTargetPage

type MonitorNewParamsTargetPage struct {
	// Public HTTP(S) page URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions param.Opt[string] `json:"instructions,omitzero"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace param.Opt[bool] `json:"normalize_whitespace,omitzero"`
	// Optional browser actions executed in array order after the page loads, before
	// content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
	// Changes create a new baseline.
	Actions []MonitorNewParamsTargetPageActionUnion `json:"actions,omitzero"`
	// Remove matching regions after inclusions. Changes create a new baseline.
	ExcludeSelectors []string `json:"exclude_selectors,omitzero"`
	// Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
	// create a new baseline.
	IncludeSelectors []string `json:"include_selectors,omitzero"`
	// Use `page` to watch one web page.
	//
	// This field can be elided, and will marshal its zero value as "page".
	Type constant.Page `json:"type" default:"page"`
	// contains filtered or unexported fields
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

The properties Type, URL are required.

func (MonitorNewParamsTargetPage) MarshalJSON

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

func (*MonitorNewParamsTargetPage) UnmarshalJSON

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

type MonitorNewParamsTargetPageActionPerform added in v2.22.0

type MonitorNewParamsTargetPageActionPerform struct {
	// One browser instruction, such as clicking a button or entering text.
	Action string `json:"action" api:"required"`
	// Use `perform` for a plain-language browser instruction.
	//
	// This field can be elided, and will marshal its zero value as "perform".
	Do constant.Perform `json:"do" default:"perform"`
	// contains filtered or unexported fields
}

Resolve and perform one natural-language browser action.

The properties Action, Do are required.

func (MonitorNewParamsTargetPageActionPerform) MarshalJSON added in v2.22.0

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

func (*MonitorNewParamsTargetPageActionPerform) UnmarshalJSON added in v2.22.0

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

type MonitorNewParamsTargetPageActionScroll added in v2.22.0

type MonitorNewParamsTargetPageActionScroll struct {
	// CSS selector for the first matching scroll container. Defaults to the page.
	Container param.Opt[string] `json:"container,omitzero"`
	// Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
	// changing. Defaults to 1.
	MaxScrolls param.Opt[int64] `json:"maxScrolls,omitzero"`
	// Pixels per scroll, one visible viewport, or the current scroll boundary.
	// Defaults to viewport.
	Amount MonitorNewParamsTargetPageActionScrollAmountUnion `json:"amount,omitzero"`
	// Direction to scroll. Defaults to down.
	//
	// Any of "up", "down", "left", "right".
	Direction string `json:"direction,omitzero"`
	// Use `scroll` to move through the page or a container.
	//
	// This field can be elided, and will marshal its zero value as "scroll".
	Do constant.Scroll `json:"do" default:"scroll"`
	// contains filtered or unexported fields
}

Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.

The property Do is required.

func (MonitorNewParamsTargetPageActionScroll) MarshalJSON added in v2.22.0

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

func (*MonitorNewParamsTargetPageActionScroll) UnmarshalJSON added in v2.22.0

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

type MonitorNewParamsTargetPageActionScrollAmountString added in v2.22.0

type MonitorNewParamsTargetPageActionScrollAmountString string
const (
	MonitorNewParamsTargetPageActionScrollAmountStringViewport MonitorNewParamsTargetPageActionScrollAmountString = "viewport"
	MonitorNewParamsTargetPageActionScrollAmountStringMax      MonitorNewParamsTargetPageActionScrollAmountString = "max"
)

type MonitorNewParamsTargetPageActionScrollAmountUnion added in v2.22.0

type MonitorNewParamsTargetPageActionScrollAmountUnion struct {
	OfInt param.Opt[int64] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfMonitorNewsTargetPageActionScrollAmountString)
	OfMonitorNewsTargetPageActionScrollAmountString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorNewParamsTargetPageActionScrollAmountUnion) MarshalJSON added in v2.22.0

func (*MonitorNewParamsTargetPageActionScrollAmountUnion) UnmarshalJSON added in v2.22.0

type MonitorNewParamsTargetPageActionUnion added in v2.22.0

type MonitorNewParamsTargetPageActionUnion struct {
	OfWait    *MonitorNewParamsTargetPageActionWait    `json:",omitzero,inline"`
	OfPerform *MonitorNewParamsTargetPageActionPerform `json:",omitzero,inline"`
	OfScroll  *MonitorNewParamsTargetPageActionScroll  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorNewParamsTargetPageActionUnion) MarshalJSON added in v2.22.0

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

func (*MonitorNewParamsTargetPageActionUnion) UnmarshalJSON added in v2.22.0

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

type MonitorNewParamsTargetPageActionWait added in v2.22.0

type MonitorNewParamsTargetPageActionWait struct {
	// Time to pause in milliseconds before the next action.
	TimeMs int64 `json:"timeMs" api:"required"`
	// Use `wait` to pause for a fixed duration.
	//
	// This field can be elided, and will marshal its zero value as "wait".
	Do constant.Wait `json:"do" default:"wait"`
	// contains filtered or unexported fields
}

Pause for a fixed number of milliseconds before continuing to the next action.

The properties Do, TimeMs are required.

func (MonitorNewParamsTargetPageActionWait) MarshalJSON added in v2.22.0

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

func (*MonitorNewParamsTargetPageActionWait) UnmarshalJSON added in v2.22.0

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

type MonitorNewParamsTargetSitemap

type MonitorNewParamsTargetSitemap struct {
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs param.Opt[int64] `json:"max_urls,omitzero"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude,omitzero"`
	// URL path patterns to include (max 50).
	Include []string `json:"include,omitzero"`
	// Use `sitemap` to watch a site for added or removed URLs.
	//
	// This field can be elided, and will marshal its zero value as "sitemap".
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// contains filtered or unexported fields
}

Watch a site’s URL inventory for confirmed additions and removals.

The properties Type, URL are required.

func (MonitorNewParamsTargetSitemap) MarshalJSON

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

func (*MonitorNewParamsTargetSitemap) UnmarshalJSON

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

type MonitorNewParamsTargetUnion

type MonitorNewParamsTargetUnion struct {
	OfPage    *MonitorNewParamsTargetPage    `json:",omitzero,inline"`
	OfSitemap *MonitorNewParamsTargetSitemap `json:",omitzero,inline"`
	OfExtract *MonitorNewParamsTargetExtract `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorNewParamsTargetUnion) MarshalJSON

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

func (*MonitorNewParamsTargetUnion) UnmarshalJSON

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

type MonitorNewParamsWebhook

type MonitorNewParamsWebhook struct {
	// Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
	// messages.
	URL string `json:"url" api:"required" format:"uri"`
	// Events to deliver. Defaults to `change.detected`; `run.completed` also includes
	// unchanged runs.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events,omitzero"`
	// Webhook retry settings. Use {} for the default schedule.
	Retry RetryConfigParam `json:"retry,omitzero"`
	// contains filtered or unexported fields
}

Webhook destination and delivery settings. Null means no webhook is configured.

The property URL is required.

func (MonitorNewParamsWebhook) MarshalJSON

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

func (*MonitorNewParamsWebhook) UnmarshalJSON

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

type MonitorNewResponse

type MonitorNewResponse struct {
	ID string `json:"id" api:"required"`
	// How changes are judged. Defaults to `semantic` for extract targets and page
	// targets with `instructions`, otherwise `exact`.
	ChangeDetection MonitorNewResponseChangeDetectionUnion `json:"change_detection" api:"required"`
	CreatedAt       time.Time                              `json:"created_at" api:"required" format:"date-time"`
	// ID of the baseline run queued at creation; null if it will start on the next
	// scheduled tick.
	InitialRunID string `json:"initial_run_id" api:"required"`
	// Always `web`. Optional.
	//
	// Any of "web".
	Mode MonitorNewResponseMode `json:"mode" api:"required"`
	Name string                 `json:"name" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Current state. Failed monitors keep running; paused monitors must be resumed
	// with `status: "active"`.
	//
	// Any of "active", "paused", "failed".
	Status MonitorNewResponseStatus `json:"status" api:"required"`
	// What to watch: a page, a sitemap, or data extracted from a site.
	Target    MonitorNewResponseTargetUnion `json:"target" api:"required"`
	UpdatedAt time.Time                     `json:"updated_at" api:"required" format:"date-time"`
	// Comparison baseline, included on Retrieve. Null until capture completes or after
	// target changes.
	Baseline MonitorNewResponseBaselineUnion `json:"baseline" api:"nullable"`
	// Credits this request used and your remaining balance.
	KeyMetadata  MonitorNewResponseKeyMetadata `json:"key_metadata"`
	LastChangeAt time.Time                     `json:"last_change_at" api:"nullable" format:"date-time"`
	// Error from the most recent failed run; null when the last run succeeded.
	LastError MonitorNewResponseLastError `json:"last_error" api:"nullable"`
	LastRunAt time.Time                   `json:"last_run_at" api:"nullable" format:"date-time"`
	// When the next scheduled run is due; null while paused.
	NextRunAt time.Time `json:"next_run_at" api:"nullable" format:"date-time"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorNewResponseSchedule `json:"schedule"`
	// Labels for filtering monitors, their changes, and their usage.
	Tags []string `json:"tags"`
	// Webhook destination and delivery settings. Null means no webhook is configured.
	Webhook MonitorNewResponseWebhook `json:"webhook" api:"nullable"`
	// Present while webhook deliveries are failing consecutively; null when deliveries
	// are healthy or no webhook is configured. Cleared on the next successful delivery
	// and when the webhook URL changes.
	WebhookFailure MonitorNewResponseWebhookFailure `json:"webhook_failure" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ChangeDetection respjson.Field
		CreatedAt       respjson.Field
		InitialRunID    respjson.Field
		Mode            respjson.Field
		Name            respjson.Field
		RequestID       respjson.Field
		Status          respjson.Field
		Target          respjson.Field
		UpdatedAt       respjson.Field
		Baseline        respjson.Field
		KeyMetadata     respjson.Field
		LastChangeAt    respjson.Field
		LastError       respjson.Field
		LastRunAt       respjson.Field
		NextRunAt       respjson.Field
		Schedule        respjson.Field
		Tags            respjson.Field
		Webhook         respjson.Field
		WebhookFailure  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorNewResponse) RawJSON

func (r MonitorNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorNewResponse) UnmarshalJSON

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

type MonitorNewResponseBaselineExtractBaseline added in v2.1.0

type MonitorNewResponseBaselineExtractBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Latest structured snapshot matching the extraction schema, refreshed at most
	// daily; `null` before capture.
	Data any `json:"data" api:"required"`
	// The page URLs the monitor tracks and analyzes for changes.
	URLsAnalyzed []string `json:"urls_analyzed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt   respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.

func (MonitorNewResponseBaselineExtractBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseBaselineExtractBaseline) UnmarshalJSON added in v2.1.0

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

type MonitorNewResponseBaselinePageBaseline added in v2.1.0

type MonitorNewResponseBaselinePageBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The page's visible text as last observed.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `page` monitor: the visible page text as last observed.

func (MonitorNewResponseBaselinePageBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseBaselinePageBaseline) UnmarshalJSON added in v2.1.0

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

type MonitorNewResponseBaselineSitemapBaseline added in v2.1.0

type MonitorNewResponseBaselineSitemapBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Number of URLs in the baseline.
	URLCount int64 `json:"url_count" api:"required"`
	// The sitemap URLs as last observed (sorted, normalized).
	URLs []string `json:"urls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		URLCount    respjson.Field
		URLs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `sitemap` monitor: the normalized URL set as last observed.

func (MonitorNewResponseBaselineSitemapBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseBaselineSitemapBaseline) UnmarshalJSON added in v2.1.0

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

type MonitorNewResponseBaselineUnion added in v2.1.0

type MonitorNewResponseBaselineUnion struct {
	CapturedAt time.Time `json:"captured_at"`
	// This field is from variant [MonitorNewResponseBaselinePageBaseline].
	Text string `json:"text"`
	// This field is from variant [MonitorNewResponseBaselineSitemapBaseline].
	URLCount int64 `json:"url_count"`
	// This field is from variant [MonitorNewResponseBaselineSitemapBaseline].
	URLs []string `json:"urls"`
	// This field is from variant [MonitorNewResponseBaselineExtractBaseline].
	Data any `json:"data"`
	// This field is from variant [MonitorNewResponseBaselineExtractBaseline].
	URLsAnalyzed []string `json:"urls_analyzed"`
	JSON         struct {
		CapturedAt   respjson.Field
		Text         respjson.Field
		URLCount     respjson.Field
		URLs         respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorNewResponseBaselineUnion contains all possible properties and values from MonitorNewResponseBaselinePageBaseline, MonitorNewResponseBaselineSitemapBaseline, MonitorNewResponseBaselineExtractBaseline.

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

func (MonitorNewResponseBaselineUnion) AsExtractBaseline added in v2.1.0

func (MonitorNewResponseBaselineUnion) AsPageBaseline added in v2.1.0

func (MonitorNewResponseBaselineUnion) AsSitemapBaseline added in v2.1.0

func (MonitorNewResponseBaselineUnion) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseBaselineUnion) UnmarshalJSON added in v2.1.0

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

type MonitorNewResponseChangeDetectionExact

type MonitorNewResponseChangeDetectionExact struct {
	// Use `exact` to compare visible text or sitemap URLs.
	Type constant.Exact `json:"type" default:"exact"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

func (MonitorNewResponseChangeDetectionExact) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseChangeDetectionExact) UnmarshalJSON

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

type MonitorNewResponseChangeDetectionSemantic

type MonitorNewResponseChangeDetectionSemantic struct {
	// Use `semantic` to judge changes against the target instructions.
	Type constant.Semantic `json:"type" default:"semantic"`
	// Minimum confidence required to report a meaningful change, from 0 to 1.
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect meaningful content changes using the target’s instructions and optional schema.

func (MonitorNewResponseChangeDetectionSemantic) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseChangeDetectionSemantic) UnmarshalJSON

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

type MonitorNewResponseChangeDetectionUnion

type MonitorNewResponseChangeDetectionUnion struct {
	// Any of "exact", "semantic".
	Type string `json:"type"`
	// This field is from variant [MonitorNewResponseChangeDetectionSemantic].
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	JSON                struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorNewResponseChangeDetectionUnion contains all possible properties and values from MonitorNewResponseChangeDetectionExact, MonitorNewResponseChangeDetectionSemantic.

Use the MonitorNewResponseChangeDetectionUnion.AsAny method to switch on the variant.

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

func (MonitorNewResponseChangeDetectionUnion) AsAny

func (u MonitorNewResponseChangeDetectionUnion) AsAny() anyMonitorNewResponseChangeDetection

Use the following switch statement to find the correct variant

switch variant := MonitorNewResponseChangeDetectionUnion.AsAny().(type) {
case contextdev.MonitorNewResponseChangeDetectionExact:
case contextdev.MonitorNewResponseChangeDetectionSemantic:
default:
  fmt.Errorf("no variant present")
}

func (MonitorNewResponseChangeDetectionUnion) AsExact

func (MonitorNewResponseChangeDetectionUnion) AsSemantic

func (MonitorNewResponseChangeDetectionUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseChangeDetectionUnion) UnmarshalJSON

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

type MonitorNewResponseKeyMetadata added in v2.22.0

type MonitorNewResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorNewResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorNewResponseLastError

type MonitorNewResponseLastError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error from the most recent failed run; null when the last run succeeded.

func (MonitorNewResponseLastError) RawJSON

func (r MonitorNewResponseLastError) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorNewResponseLastError) UnmarshalJSON

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

type MonitorNewResponseMode

type MonitorNewResponseMode string

Always `web`. Optional.

const (
	MonitorNewResponseModeWeb MonitorNewResponseMode = "web"
)

type MonitorNewResponseSchedule

type MonitorNewResponseSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Use `interval` to run on a repeating schedule.
	//
	// Any of "interval".
	Type string `json:"type" api:"required"`
	// Time unit used with `frequency` to set the run interval.
	//
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Frequency   respjson.Field
		Type        respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

func (MonitorNewResponseSchedule) RawJSON

func (r MonitorNewResponseSchedule) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorNewResponseSchedule) UnmarshalJSON

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

type MonitorNewResponseStatus

type MonitorNewResponseStatus string

Current state. Failed monitors keep running; paused monitors must be resumed with `status: "active"`.

const (
	MonitorNewResponseStatusActive MonitorNewResponseStatus = "active"
	MonitorNewResponseStatusPaused MonitorNewResponseStatus = "paused"
	MonitorNewResponseStatusFailed MonitorNewResponseStatus = "failed"
)

type MonitorNewResponseTargetExtract

type MonitorNewResponseTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string `json:"instructions" api:"required"`
	// Use `extract` to watch structured data across selected pages.
	Type constant.Extract `json:"type" default:"extract"`
	// Root URL to extract structured data from.
	URL string `json:"url" api:"required" format:"uri"`
	// Allow page discovery on subdomains of the target site.
	FollowSubdomains bool `json:"follow_subdomains"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth int64 `json:"max_depth"`
	// Maximum number of pages to track.
	MaxPages int64 `json:"max_pages"`
	// JSON Schema for page selection and the baseline snapshot. Changes return diffs
	// and evidence.
	Schema map[string]any `json:"schema"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instructions     respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		FollowSubdomains respjson.Field
		MaxDepth         respjson.Field
		MaxPages         respjson.Field
		Schema           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Track relevant pages selected by `schema` and `instructions`; refresh the page set periodically.

func (MonitorNewResponseTargetExtract) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetExtract) UnmarshalJSON

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

type MonitorNewResponseTargetPage

type MonitorNewResponseTargetPage struct {
	// Use `page` to watch one web page.
	Type constant.Page `json:"type" default:"page"`
	// Public HTTP(S) page URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Optional browser actions executed in array order after the page loads, before
	// content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
	// Changes create a new baseline.
	Actions []MonitorNewResponseTargetPageActionUnion `json:"actions" api:"nullable"`
	// Remove matching regions after inclusions. Changes create a new baseline.
	ExcludeSelectors []string `json:"exclude_selectors"`
	// Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
	// create a new baseline.
	IncludeSelectors []string `json:"include_selectors"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions string `json:"instructions"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		URL                 respjson.Field
		Actions             respjson.Field
		ExcludeSelectors    respjson.Field
		IncludeSelectors    respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

func (MonitorNewResponseTargetPage) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetPage) UnmarshalJSON

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

type MonitorNewResponseTargetPageActionPerform added in v2.22.0

type MonitorNewResponseTargetPageActionPerform struct {
	// One browser instruction, such as clicking a button or entering text.
	Action string `json:"action" api:"required"`
	// Use `perform` for a plain-language browser instruction.
	Do constant.Perform `json:"do" default:"perform"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Action      respjson.Field
		Do          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolve and perform one natural-language browser action.

func (MonitorNewResponseTargetPageActionPerform) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetPageActionPerform) UnmarshalJSON added in v2.22.0

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

type MonitorNewResponseTargetPageActionScroll added in v2.22.0

type MonitorNewResponseTargetPageActionScroll struct {
	// Use `scroll` to move through the page or a container.
	Do constant.Scroll `json:"do" default:"scroll"`
	// Pixels per scroll, one visible viewport, or the current scroll boundary.
	// Defaults to viewport.
	Amount MonitorNewResponseTargetPageActionScrollAmountUnion `json:"amount"`
	// CSS selector for the first matching scroll container. Defaults to the page.
	Container string `json:"container"`
	// Direction to scroll. Defaults to down.
	//
	// Any of "up", "down", "left", "right".
	Direction string `json:"direction"`
	// Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
	// changing. Defaults to 1.
	MaxScrolls int64 `json:"maxScrolls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Do          respjson.Field
		Amount      respjson.Field
		Container   respjson.Field
		Direction   respjson.Field
		MaxScrolls  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.

func (MonitorNewResponseTargetPageActionScroll) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetPageActionScroll) UnmarshalJSON added in v2.22.0

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

type MonitorNewResponseTargetPageActionScrollAmountString added in v2.22.0

type MonitorNewResponseTargetPageActionScrollAmountString string
const (
	MonitorNewResponseTargetPageActionScrollAmountStringViewport MonitorNewResponseTargetPageActionScrollAmountString = "viewport"
	MonitorNewResponseTargetPageActionScrollAmountStringMax      MonitorNewResponseTargetPageActionScrollAmountString = "max"
)

type MonitorNewResponseTargetPageActionScrollAmountUnion added in v2.22.0

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

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

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

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

func (MonitorNewResponseTargetPageActionScrollAmountUnion) AsInt added in v2.22.0

func (MonitorNewResponseTargetPageActionScrollAmountUnion) AsMonitorNewResponseTargetPageActionScrollAmountString added in v2.22.0

func (u MonitorNewResponseTargetPageActionScrollAmountUnion) AsMonitorNewResponseTargetPageActionScrollAmountString() (v string)

func (MonitorNewResponseTargetPageActionScrollAmountUnion) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetPageActionScrollAmountUnion) UnmarshalJSON added in v2.22.0

type MonitorNewResponseTargetPageActionUnion added in v2.22.0

type MonitorNewResponseTargetPageActionUnion struct {
	// Any of "wait", "perform", "scroll".
	Do string `json:"do"`
	// This field is from variant [MonitorNewResponseTargetPageActionWait].
	TimeMs int64 `json:"timeMs"`
	// This field is from variant [MonitorNewResponseTargetPageActionPerform].
	Action string `json:"action"`
	// This field is from variant [MonitorNewResponseTargetPageActionScroll].
	Amount MonitorNewResponseTargetPageActionScrollAmountUnion `json:"amount"`
	// This field is from variant [MonitorNewResponseTargetPageActionScroll].
	Container string `json:"container"`
	// This field is from variant [MonitorNewResponseTargetPageActionScroll].
	Direction string `json:"direction"`
	// This field is from variant [MonitorNewResponseTargetPageActionScroll].
	MaxScrolls int64 `json:"maxScrolls"`
	JSON       struct {
		Do         respjson.Field
		TimeMs     respjson.Field
		Action     respjson.Field
		Amount     respjson.Field
		Container  respjson.Field
		Direction  respjson.Field
		MaxScrolls respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorNewResponseTargetPageActionUnion contains all possible properties and values from MonitorNewResponseTargetPageActionWait, MonitorNewResponseTargetPageActionPerform, MonitorNewResponseTargetPageActionScroll.

Use the MonitorNewResponseTargetPageActionUnion.AsAny method to switch on the variant.

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

func (MonitorNewResponseTargetPageActionUnion) AsAny added in v2.22.0

func (u MonitorNewResponseTargetPageActionUnion) AsAny() anyMonitorNewResponseTargetPageAction

Use the following switch statement to find the correct variant

switch variant := MonitorNewResponseTargetPageActionUnion.AsAny().(type) {
case contextdev.MonitorNewResponseTargetPageActionWait:
case contextdev.MonitorNewResponseTargetPageActionPerform:
case contextdev.MonitorNewResponseTargetPageActionScroll:
default:
  fmt.Errorf("no variant present")
}

func (MonitorNewResponseTargetPageActionUnion) AsPerform added in v2.22.0

func (MonitorNewResponseTargetPageActionUnion) AsScroll added in v2.22.0

func (MonitorNewResponseTargetPageActionUnion) AsWait added in v2.22.0

func (MonitorNewResponseTargetPageActionUnion) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetPageActionUnion) UnmarshalJSON added in v2.22.0

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

type MonitorNewResponseTargetPageActionWait added in v2.22.0

type MonitorNewResponseTargetPageActionWait struct {
	// Use `wait` to pause for a fixed duration.
	Do constant.Wait `json:"do" default:"wait"`
	// Time to pause in milliseconds before the next action.
	TimeMs int64 `json:"timeMs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Do          respjson.Field
		TimeMs      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pause for a fixed number of milliseconds before continuing to the next action.

func (MonitorNewResponseTargetPageActionWait) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetPageActionWait) UnmarshalJSON added in v2.22.0

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

type MonitorNewResponseTargetSitemap

type MonitorNewResponseTargetSitemap struct {
	// Use `sitemap` to watch a site for added or removed URLs.
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude"`
	// URL path patterns to include (max 50).
	Include []string `json:"include"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs int64 `json:"max_urls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		Exclude     respjson.Field
		Include     respjson.Field
		MaxURLs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a site’s URL inventory for confirmed additions and removals.

func (MonitorNewResponseTargetSitemap) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetSitemap) UnmarshalJSON

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

type MonitorNewResponseTargetUnion

type MonitorNewResponseTargetUnion struct {
	// Any of "page", "sitemap", "extract".
	Type string `json:"type"`
	URL  string `json:"url"`
	// This field is from variant [MonitorNewResponseTargetPage].
	Actions []MonitorNewResponseTargetPageActionUnion `json:"actions"`
	// This field is from variant [MonitorNewResponseTargetPage].
	ExcludeSelectors []string `json:"exclude_selectors"`
	// This field is from variant [MonitorNewResponseTargetPage].
	IncludeSelectors []string `json:"include_selectors"`
	Instructions     string   `json:"instructions"`
	// This field is from variant [MonitorNewResponseTargetPage].
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// This field is from variant [MonitorNewResponseTargetSitemap].
	Exclude []string `json:"exclude"`
	// This field is from variant [MonitorNewResponseTargetSitemap].
	Include []string `json:"include"`
	// This field is from variant [MonitorNewResponseTargetSitemap].
	MaxURLs int64 `json:"max_urls"`
	// This field is from variant [MonitorNewResponseTargetExtract].
	FollowSubdomains bool `json:"follow_subdomains"`
	// This field is from variant [MonitorNewResponseTargetExtract].
	MaxDepth int64 `json:"max_depth"`
	// This field is from variant [MonitorNewResponseTargetExtract].
	MaxPages int64 `json:"max_pages"`
	// This field is from variant [MonitorNewResponseTargetExtract].
	Schema map[string]any `json:"schema"`
	JSON   struct {
		Type                respjson.Field
		URL                 respjson.Field
		Actions             respjson.Field
		ExcludeSelectors    respjson.Field
		IncludeSelectors    respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		Exclude             respjson.Field
		Include             respjson.Field
		MaxURLs             respjson.Field
		FollowSubdomains    respjson.Field
		MaxDepth            respjson.Field
		MaxPages            respjson.Field
		Schema              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorNewResponseTargetUnion contains all possible properties and values from MonitorNewResponseTargetPage, MonitorNewResponseTargetSitemap, MonitorNewResponseTargetExtract.

Use the MonitorNewResponseTargetUnion.AsAny method to switch on the variant.

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

func (MonitorNewResponseTargetUnion) AsAny

func (u MonitorNewResponseTargetUnion) AsAny() anyMonitorNewResponseTarget

Use the following switch statement to find the correct variant

switch variant := MonitorNewResponseTargetUnion.AsAny().(type) {
case contextdev.MonitorNewResponseTargetPage:
case contextdev.MonitorNewResponseTargetSitemap:
case contextdev.MonitorNewResponseTargetExtract:
default:
  fmt.Errorf("no variant present")
}

func (MonitorNewResponseTargetUnion) AsExtract

func (MonitorNewResponseTargetUnion) AsPage

func (MonitorNewResponseTargetUnion) AsSitemap

func (MonitorNewResponseTargetUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorNewResponseTargetUnion) UnmarshalJSON

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

type MonitorNewResponseWebhook

type MonitorNewResponseWebhook struct {
	// Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
	// messages.
	URL string `json:"url" api:"required" format:"uri"`
	// Events to deliver. Defaults to `change.detected`; `run.completed` also includes
	// unchanged runs.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events"`
	// Webhook retry settings. Use {} for the default schedule.
	Retry RetryConfig `json:"retry"`
	// API-generated signing secret. Visible only with full access or `monitors:write`
	// permission.
	Secret string `json:"secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Events      respjson.Field
		Retry       respjson.Field
		Secret      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Webhook destination and delivery settings. Null means no webhook is configured.

func (MonitorNewResponseWebhook) RawJSON

func (r MonitorNewResponseWebhook) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorNewResponseWebhook) UnmarshalJSON

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

type MonitorNewResponseWebhookFailure added in v2.3.0

type MonitorNewResponseWebhookFailure struct {
	// Number of consecutive delivery attempts that did not succeed.
	ConsecutiveFailures int64     `json:"consecutive_failures" api:"required"`
	LastFailedAt        time.Time `json:"last_failed_at" api:"required" format:"date-time"`
	// Human-readable description of the most recent failure.
	LastMessage string `json:"last_message" api:"required"`
	// Outcome of the most recent failed delivery. rejected means a non-2xx response;
	// failed means no HTTP response was received; skipped_unsafe_url means the URL
	// failed the public-endpoint safety check.
	//
	// Any of "rejected", "failed", "skipped_unsafe_url".
	LastStatus string `json:"last_status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsecutiveFailures respjson.Field
		LastFailedAt        respjson.Field
		LastMessage         respjson.Field
		LastStatus          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Present while webhook deliveries are failing consecutively; null when deliveries are healthy or no webhook is configured. Cleared on the next successful delivery and when the webhook URL changes.

func (MonitorNewResponseWebhookFailure) RawJSON added in v2.3.0

Returns the unmodified JSON received from the API

func (*MonitorNewResponseWebhookFailure) UnmarshalJSON added in v2.3.0

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

type MonitorRotateWebhookSecretResponse added in v2.20.0

type MonitorRotateWebhookSecretResponse struct {
	ID string `json:"id" api:"required"`
	// How changes are judged. Defaults to `semantic` for extract targets and page
	// targets with `instructions`, otherwise `exact`.
	ChangeDetection MonitorRotateWebhookSecretResponseChangeDetectionUnion `json:"change_detection" api:"required"`
	CreatedAt       time.Time                                              `json:"created_at" api:"required" format:"date-time"`
	// Always `web`. Optional.
	//
	// Any of "web".
	Mode MonitorRotateWebhookSecretResponseMode `json:"mode" api:"required"`
	Name string                                 `json:"name" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Current state. Failed monitors keep running; paused monitors must be resumed
	// with `status: "active"`.
	//
	// Any of "active", "paused", "failed".
	Status MonitorRotateWebhookSecretResponseStatus `json:"status" api:"required"`
	// What to watch: a page, a sitemap, or data extracted from a site.
	Target    MonitorRotateWebhookSecretResponseTargetUnion `json:"target" api:"required"`
	UpdatedAt time.Time                                     `json:"updated_at" api:"required" format:"date-time"`
	// Comparison baseline, included on Retrieve. Null until capture completes or after
	// target changes.
	Baseline MonitorRotateWebhookSecretResponseBaselineUnion `json:"baseline" api:"nullable"`
	// Credits this request used and your remaining balance.
	KeyMetadata  MonitorRotateWebhookSecretResponseKeyMetadata `json:"key_metadata"`
	LastChangeAt time.Time                                     `json:"last_change_at" api:"nullable" format:"date-time"`
	// Error from the most recent failed run; null when the last run succeeded.
	LastError MonitorRotateWebhookSecretResponseLastError `json:"last_error" api:"nullable"`
	LastRunAt time.Time                                   `json:"last_run_at" api:"nullable" format:"date-time"`
	// When the next scheduled run is due; null while paused.
	NextRunAt time.Time `json:"next_run_at" api:"nullable" format:"date-time"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorRotateWebhookSecretResponseSchedule `json:"schedule"`
	// Labels for filtering monitors, their changes, and their usage.
	Tags []string `json:"tags"`
	// Webhook destination and delivery settings. Null means no webhook is configured.
	Webhook MonitorRotateWebhookSecretResponseWebhook `json:"webhook" api:"nullable"`
	// Present while webhook deliveries are failing consecutively; null when deliveries
	// are healthy or no webhook is configured. Cleared on the next successful delivery
	// and when the webhook URL changes.
	WebhookFailure MonitorRotateWebhookSecretResponseWebhookFailure `json:"webhook_failure" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ChangeDetection respjson.Field
		CreatedAt       respjson.Field
		Mode            respjson.Field
		Name            respjson.Field
		RequestID       respjson.Field
		Status          respjson.Field
		Target          respjson.Field
		UpdatedAt       respjson.Field
		Baseline        respjson.Field
		KeyMetadata     respjson.Field
		LastChangeAt    respjson.Field
		LastError       respjson.Field
		LastRunAt       respjson.Field
		NextRunAt       respjson.Field
		Schedule        respjson.Field
		Tags            respjson.Field
		Webhook         respjson.Field
		WebhookFailure  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorRotateWebhookSecretResponse) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponse) UnmarshalJSON added in v2.20.0

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

type MonitorRotateWebhookSecretResponseBaselineExtractBaseline added in v2.20.0

type MonitorRotateWebhookSecretResponseBaselineExtractBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Latest structured snapshot matching the extraction schema, refreshed at most
	// daily; `null` before capture.
	Data any `json:"data" api:"required"`
	// The page URLs the monitor tracks and analyzes for changes.
	URLsAnalyzed []string `json:"urls_analyzed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt   respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.

func (MonitorRotateWebhookSecretResponseBaselineExtractBaseline) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseBaselineExtractBaseline) UnmarshalJSON added in v2.20.0

type MonitorRotateWebhookSecretResponseBaselinePageBaseline added in v2.20.0

type MonitorRotateWebhookSecretResponseBaselinePageBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The page's visible text as last observed.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `page` monitor: the visible page text as last observed.

func (MonitorRotateWebhookSecretResponseBaselinePageBaseline) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseBaselinePageBaseline) UnmarshalJSON added in v2.20.0

type MonitorRotateWebhookSecretResponseBaselineSitemapBaseline added in v2.20.0

type MonitorRotateWebhookSecretResponseBaselineSitemapBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Number of URLs in the baseline.
	URLCount int64 `json:"url_count" api:"required"`
	// The sitemap URLs as last observed (sorted, normalized).
	URLs []string `json:"urls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		URLCount    respjson.Field
		URLs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `sitemap` monitor: the normalized URL set as last observed.

func (MonitorRotateWebhookSecretResponseBaselineSitemapBaseline) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseBaselineSitemapBaseline) UnmarshalJSON added in v2.20.0

type MonitorRotateWebhookSecretResponseBaselineUnion added in v2.20.0

type MonitorRotateWebhookSecretResponseBaselineUnion struct {
	CapturedAt time.Time `json:"captured_at"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseBaselinePageBaseline].
	Text string `json:"text"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseBaselineSitemapBaseline].
	URLCount int64 `json:"url_count"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseBaselineSitemapBaseline].
	URLs []string `json:"urls"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseBaselineExtractBaseline].
	Data any `json:"data"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseBaselineExtractBaseline].
	URLsAnalyzed []string `json:"urls_analyzed"`
	JSON         struct {
		CapturedAt   respjson.Field
		Text         respjson.Field
		URLCount     respjson.Field
		URLs         respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorRotateWebhookSecretResponseBaselineUnion contains all possible properties and values from MonitorRotateWebhookSecretResponseBaselinePageBaseline, MonitorRotateWebhookSecretResponseBaselineSitemapBaseline, MonitorRotateWebhookSecretResponseBaselineExtractBaseline.

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

func (MonitorRotateWebhookSecretResponseBaselineUnion) AsExtractBaseline added in v2.20.0

func (MonitorRotateWebhookSecretResponseBaselineUnion) AsPageBaseline added in v2.20.0

func (MonitorRotateWebhookSecretResponseBaselineUnion) AsSitemapBaseline added in v2.20.0

func (MonitorRotateWebhookSecretResponseBaselineUnion) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseBaselineUnion) UnmarshalJSON added in v2.20.0

type MonitorRotateWebhookSecretResponseChangeDetectionExact added in v2.20.0

type MonitorRotateWebhookSecretResponseChangeDetectionExact struct {
	// Use `exact` to compare visible text or sitemap URLs.
	Type constant.Exact `json:"type" default:"exact"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

func (MonitorRotateWebhookSecretResponseChangeDetectionExact) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseChangeDetectionExact) UnmarshalJSON added in v2.20.0

type MonitorRotateWebhookSecretResponseChangeDetectionSemantic added in v2.20.0

type MonitorRotateWebhookSecretResponseChangeDetectionSemantic struct {
	// Use `semantic` to judge changes against the target instructions.
	Type constant.Semantic `json:"type" default:"semantic"`
	// Minimum confidence required to report a meaningful change, from 0 to 1.
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect meaningful content changes using the target’s instructions and optional schema.

func (MonitorRotateWebhookSecretResponseChangeDetectionSemantic) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseChangeDetectionSemantic) UnmarshalJSON added in v2.20.0

type MonitorRotateWebhookSecretResponseChangeDetectionUnion added in v2.20.0

type MonitorRotateWebhookSecretResponseChangeDetectionUnion struct {
	// Any of "exact", "semantic".
	Type string `json:"type"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseChangeDetectionSemantic].
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	JSON                struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorRotateWebhookSecretResponseChangeDetectionUnion contains all possible properties and values from MonitorRotateWebhookSecretResponseChangeDetectionExact, MonitorRotateWebhookSecretResponseChangeDetectionSemantic.

Use the MonitorRotateWebhookSecretResponseChangeDetectionUnion.AsAny method to switch on the variant.

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

func (MonitorRotateWebhookSecretResponseChangeDetectionUnion) AsAny added in v2.20.0

func (u MonitorRotateWebhookSecretResponseChangeDetectionUnion) AsAny() anyMonitorRotateWebhookSecretResponseChangeDetection

Use the following switch statement to find the correct variant

switch variant := MonitorRotateWebhookSecretResponseChangeDetectionUnion.AsAny().(type) {
case contextdev.MonitorRotateWebhookSecretResponseChangeDetectionExact:
case contextdev.MonitorRotateWebhookSecretResponseChangeDetectionSemantic:
default:
  fmt.Errorf("no variant present")
}

func (MonitorRotateWebhookSecretResponseChangeDetectionUnion) AsExact added in v2.20.0

func (MonitorRotateWebhookSecretResponseChangeDetectionUnion) AsSemantic added in v2.20.0

func (MonitorRotateWebhookSecretResponseChangeDetectionUnion) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseChangeDetectionUnion) UnmarshalJSON added in v2.20.0

type MonitorRotateWebhookSecretResponseKeyMetadata added in v2.22.0

type MonitorRotateWebhookSecretResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorRotateWebhookSecretResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorRotateWebhookSecretResponseLastError added in v2.20.0

type MonitorRotateWebhookSecretResponseLastError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error from the most recent failed run; null when the last run succeeded.

func (MonitorRotateWebhookSecretResponseLastError) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseLastError) UnmarshalJSON added in v2.20.0

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

type MonitorRotateWebhookSecretResponseMode added in v2.20.0

type MonitorRotateWebhookSecretResponseMode string

Always `web`. Optional.

const (
	MonitorRotateWebhookSecretResponseModeWeb MonitorRotateWebhookSecretResponseMode = "web"
)

type MonitorRotateWebhookSecretResponseSchedule added in v2.20.0

type MonitorRotateWebhookSecretResponseSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Use `interval` to run on a repeating schedule.
	//
	// Any of "interval".
	Type string `json:"type" api:"required"`
	// Time unit used with `frequency` to set the run interval.
	//
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Frequency   respjson.Field
		Type        respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

func (MonitorRotateWebhookSecretResponseSchedule) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseSchedule) UnmarshalJSON added in v2.20.0

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

type MonitorRotateWebhookSecretResponseStatus added in v2.20.0

type MonitorRotateWebhookSecretResponseStatus string

Current state. Failed monitors keep running; paused monitors must be resumed with `status: "active"`.

const (
	MonitorRotateWebhookSecretResponseStatusActive MonitorRotateWebhookSecretResponseStatus = "active"
	MonitorRotateWebhookSecretResponseStatusPaused MonitorRotateWebhookSecretResponseStatus = "paused"
	MonitorRotateWebhookSecretResponseStatusFailed MonitorRotateWebhookSecretResponseStatus = "failed"
)

type MonitorRotateWebhookSecretResponseTargetExtract added in v2.20.0

type MonitorRotateWebhookSecretResponseTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string `json:"instructions" api:"required"`
	// Use `extract` to watch structured data across selected pages.
	Type constant.Extract `json:"type" default:"extract"`
	// Root URL to extract structured data from.
	URL string `json:"url" api:"required" format:"uri"`
	// Allow page discovery on subdomains of the target site.
	FollowSubdomains bool `json:"follow_subdomains"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth int64 `json:"max_depth"`
	// Maximum number of pages to track.
	MaxPages int64 `json:"max_pages"`
	// JSON Schema for page selection and the baseline snapshot. Changes return diffs
	// and evidence.
	Schema map[string]any `json:"schema"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instructions     respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		FollowSubdomains respjson.Field
		MaxDepth         respjson.Field
		MaxPages         respjson.Field
		Schema           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Track relevant pages selected by `schema` and `instructions`; refresh the page set periodically.

func (MonitorRotateWebhookSecretResponseTargetExtract) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseTargetExtract) UnmarshalJSON added in v2.20.0

type MonitorRotateWebhookSecretResponseTargetPage added in v2.20.0

type MonitorRotateWebhookSecretResponseTargetPage struct {
	// Use `page` to watch one web page.
	Type constant.Page `json:"type" default:"page"`
	// Public HTTP(S) page URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Optional browser actions executed in array order after the page loads, before
	// content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
	// Changes create a new baseline.
	Actions []MonitorRotateWebhookSecretResponseTargetPageActionUnion `json:"actions" api:"nullable"`
	// Remove matching regions after inclusions. Changes create a new baseline.
	ExcludeSelectors []string `json:"exclude_selectors"`
	// Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
	// create a new baseline.
	IncludeSelectors []string `json:"include_selectors"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions string `json:"instructions"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		URL                 respjson.Field
		Actions             respjson.Field
		ExcludeSelectors    respjson.Field
		IncludeSelectors    respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

func (MonitorRotateWebhookSecretResponseTargetPage) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseTargetPage) UnmarshalJSON added in v2.20.0

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

type MonitorRotateWebhookSecretResponseTargetPageActionPerform added in v2.22.0

type MonitorRotateWebhookSecretResponseTargetPageActionPerform struct {
	// One browser instruction, such as clicking a button or entering text.
	Action string `json:"action" api:"required"`
	// Use `perform` for a plain-language browser instruction.
	Do constant.Perform `json:"do" default:"perform"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Action      respjson.Field
		Do          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolve and perform one natural-language browser action.

func (MonitorRotateWebhookSecretResponseTargetPageActionPerform) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseTargetPageActionPerform) UnmarshalJSON added in v2.22.0

type MonitorRotateWebhookSecretResponseTargetPageActionScroll added in v2.22.0

type MonitorRotateWebhookSecretResponseTargetPageActionScroll struct {
	// Use `scroll` to move through the page or a container.
	Do constant.Scroll `json:"do" default:"scroll"`
	// Pixels per scroll, one visible viewport, or the current scroll boundary.
	// Defaults to viewport.
	Amount MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountUnion `json:"amount"`
	// CSS selector for the first matching scroll container. Defaults to the page.
	Container string `json:"container"`
	// Direction to scroll. Defaults to down.
	//
	// Any of "up", "down", "left", "right".
	Direction string `json:"direction"`
	// Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
	// changing. Defaults to 1.
	MaxScrolls int64 `json:"maxScrolls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Do          respjson.Field
		Amount      respjson.Field
		Container   respjson.Field
		Direction   respjson.Field
		MaxScrolls  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.

func (MonitorRotateWebhookSecretResponseTargetPageActionScroll) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseTargetPageActionScroll) UnmarshalJSON added in v2.22.0

type MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountString added in v2.22.0

type MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountString string
const (
	MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountStringViewport MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountString = "viewport"
	MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountStringMax      MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountString = "max"
)

type MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountUnion added in v2.22.0

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

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

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

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

func (MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountUnion) AsInt added in v2.22.0

func (MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountUnion) AsMonitorRotateWebhookSecretResponseTargetPageActionScrollAmountString added in v2.22.0

func (u MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountUnion) AsMonitorRotateWebhookSecretResponseTargetPageActionScrollAmountString() (v string)

func (MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountUnion) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountUnion) UnmarshalJSON added in v2.22.0

type MonitorRotateWebhookSecretResponseTargetPageActionUnion added in v2.22.0

type MonitorRotateWebhookSecretResponseTargetPageActionUnion struct {
	// Any of "wait", "perform", "scroll".
	Do string `json:"do"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseTargetPageActionWait].
	TimeMs int64 `json:"timeMs"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseTargetPageActionPerform].
	Action string `json:"action"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseTargetPageActionScroll].
	Amount MonitorRotateWebhookSecretResponseTargetPageActionScrollAmountUnion `json:"amount"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseTargetPageActionScroll].
	Container string `json:"container"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseTargetPageActionScroll].
	Direction string `json:"direction"`
	// This field is from variant
	// [MonitorRotateWebhookSecretResponseTargetPageActionScroll].
	MaxScrolls int64 `json:"maxScrolls"`
	JSON       struct {
		Do         respjson.Field
		TimeMs     respjson.Field
		Action     respjson.Field
		Amount     respjson.Field
		Container  respjson.Field
		Direction  respjson.Field
		MaxScrolls respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorRotateWebhookSecretResponseTargetPageActionUnion contains all possible properties and values from MonitorRotateWebhookSecretResponseTargetPageActionWait, MonitorRotateWebhookSecretResponseTargetPageActionPerform, MonitorRotateWebhookSecretResponseTargetPageActionScroll.

Use the MonitorRotateWebhookSecretResponseTargetPageActionUnion.AsAny method to switch on the variant.

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

func (MonitorRotateWebhookSecretResponseTargetPageActionUnion) AsAny added in v2.22.0

func (u MonitorRotateWebhookSecretResponseTargetPageActionUnion) AsAny() anyMonitorRotateWebhookSecretResponseTargetPageAction

Use the following switch statement to find the correct variant

switch variant := MonitorRotateWebhookSecretResponseTargetPageActionUnion.AsAny().(type) {
case contextdev.MonitorRotateWebhookSecretResponseTargetPageActionWait:
case contextdev.MonitorRotateWebhookSecretResponseTargetPageActionPerform:
case contextdev.MonitorRotateWebhookSecretResponseTargetPageActionScroll:
default:
  fmt.Errorf("no variant present")
}

func (MonitorRotateWebhookSecretResponseTargetPageActionUnion) AsPerform added in v2.22.0

func (MonitorRotateWebhookSecretResponseTargetPageActionUnion) AsScroll added in v2.22.0

func (MonitorRotateWebhookSecretResponseTargetPageActionUnion) AsWait added in v2.22.0

func (MonitorRotateWebhookSecretResponseTargetPageActionUnion) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseTargetPageActionUnion) UnmarshalJSON added in v2.22.0

type MonitorRotateWebhookSecretResponseTargetPageActionWait added in v2.22.0

type MonitorRotateWebhookSecretResponseTargetPageActionWait struct {
	// Use `wait` to pause for a fixed duration.
	Do constant.Wait `json:"do" default:"wait"`
	// Time to pause in milliseconds before the next action.
	TimeMs int64 `json:"timeMs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Do          respjson.Field
		TimeMs      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pause for a fixed number of milliseconds before continuing to the next action.

func (MonitorRotateWebhookSecretResponseTargetPageActionWait) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseTargetPageActionWait) UnmarshalJSON added in v2.22.0

type MonitorRotateWebhookSecretResponseTargetSitemap added in v2.20.0

type MonitorRotateWebhookSecretResponseTargetSitemap struct {
	// Use `sitemap` to watch a site for added or removed URLs.
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude"`
	// URL path patterns to include (max 50).
	Include []string `json:"include"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs int64 `json:"max_urls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		Exclude     respjson.Field
		Include     respjson.Field
		MaxURLs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a site’s URL inventory for confirmed additions and removals.

func (MonitorRotateWebhookSecretResponseTargetSitemap) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseTargetSitemap) UnmarshalJSON added in v2.20.0

type MonitorRotateWebhookSecretResponseTargetUnion added in v2.20.0

type MonitorRotateWebhookSecretResponseTargetUnion struct {
	// Any of "page", "sitemap", "extract".
	Type string `json:"type"`
	URL  string `json:"url"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetPage].
	Actions []MonitorRotateWebhookSecretResponseTargetPageActionUnion `json:"actions"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetPage].
	ExcludeSelectors []string `json:"exclude_selectors"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetPage].
	IncludeSelectors []string `json:"include_selectors"`
	Instructions     string   `json:"instructions"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetPage].
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetSitemap].
	Exclude []string `json:"exclude"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetSitemap].
	Include []string `json:"include"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetSitemap].
	MaxURLs int64 `json:"max_urls"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetExtract].
	FollowSubdomains bool `json:"follow_subdomains"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetExtract].
	MaxDepth int64 `json:"max_depth"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetExtract].
	MaxPages int64 `json:"max_pages"`
	// This field is from variant [MonitorRotateWebhookSecretResponseTargetExtract].
	Schema map[string]any `json:"schema"`
	JSON   struct {
		Type                respjson.Field
		URL                 respjson.Field
		Actions             respjson.Field
		ExcludeSelectors    respjson.Field
		IncludeSelectors    respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		Exclude             respjson.Field
		Include             respjson.Field
		MaxURLs             respjson.Field
		FollowSubdomains    respjson.Field
		MaxDepth            respjson.Field
		MaxPages            respjson.Field
		Schema              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorRotateWebhookSecretResponseTargetUnion contains all possible properties and values from MonitorRotateWebhookSecretResponseTargetPage, MonitorRotateWebhookSecretResponseTargetSitemap, MonitorRotateWebhookSecretResponseTargetExtract.

Use the MonitorRotateWebhookSecretResponseTargetUnion.AsAny method to switch on the variant.

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

func (MonitorRotateWebhookSecretResponseTargetUnion) AsAny added in v2.20.0

func (u MonitorRotateWebhookSecretResponseTargetUnion) AsAny() anyMonitorRotateWebhookSecretResponseTarget

Use the following switch statement to find the correct variant

switch variant := MonitorRotateWebhookSecretResponseTargetUnion.AsAny().(type) {
case contextdev.MonitorRotateWebhookSecretResponseTargetPage:
case contextdev.MonitorRotateWebhookSecretResponseTargetSitemap:
case contextdev.MonitorRotateWebhookSecretResponseTargetExtract:
default:
  fmt.Errorf("no variant present")
}

func (MonitorRotateWebhookSecretResponseTargetUnion) AsExtract added in v2.20.0

func (MonitorRotateWebhookSecretResponseTargetUnion) AsPage added in v2.20.0

func (MonitorRotateWebhookSecretResponseTargetUnion) AsSitemap added in v2.20.0

func (MonitorRotateWebhookSecretResponseTargetUnion) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseTargetUnion) UnmarshalJSON added in v2.20.0

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

type MonitorRotateWebhookSecretResponseWebhook added in v2.20.0

type MonitorRotateWebhookSecretResponseWebhook struct {
	// Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
	// messages.
	URL string `json:"url" api:"required" format:"uri"`
	// Events to deliver. Defaults to `change.detected`; `run.completed` also includes
	// unchanged runs.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events"`
	// Webhook retry settings. Use {} for the default schedule.
	Retry RetryConfig `json:"retry"`
	// API-generated signing secret. Visible only with full access or `monitors:write`
	// permission.
	Secret string `json:"secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Events      respjson.Field
		Retry       respjson.Field
		Secret      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Webhook destination and delivery settings. Null means no webhook is configured.

func (MonitorRotateWebhookSecretResponseWebhook) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseWebhook) UnmarshalJSON added in v2.20.0

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

type MonitorRotateWebhookSecretResponseWebhookFailure added in v2.20.0

type MonitorRotateWebhookSecretResponseWebhookFailure struct {
	// Number of consecutive delivery attempts that did not succeed.
	ConsecutiveFailures int64     `json:"consecutive_failures" api:"required"`
	LastFailedAt        time.Time `json:"last_failed_at" api:"required" format:"date-time"`
	// Human-readable description of the most recent failure.
	LastMessage string `json:"last_message" api:"required"`
	// Outcome of the most recent failed delivery. rejected means a non-2xx response;
	// failed means no HTTP response was received; skipped_unsafe_url means the URL
	// failed the public-endpoint safety check.
	//
	// Any of "rejected", "failed", "skipped_unsafe_url".
	LastStatus string `json:"last_status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsecutiveFailures respjson.Field
		LastFailedAt        respjson.Field
		LastMessage         respjson.Field
		LastStatus          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Present while webhook deliveries are failing consecutively; null when deliveries are healthy or no webhook is configured. Cleared on the next successful delivery and when the webhook URL changes.

func (MonitorRotateWebhookSecretResponseWebhookFailure) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*MonitorRotateWebhookSecretResponseWebhookFailure) UnmarshalJSON added in v2.20.0

type MonitorRunResponse

type MonitorRunResponse struct {
	MonitorID string `json:"monitor_id" api:"required"`
	Queued    bool   `json:"queued" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// ID of the queued run; pass it to Retrieve a monitor run.
	RunID string `json:"run_id" api:"required"`
	// Credits this request used and your remaining balance.
	KeyMetadata MonitorRunResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MonitorID   respjson.Field
		Queued      respjson.Field
		RequestID   respjson.Field
		RunID       respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorRunResponse) RawJSON

func (r MonitorRunResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorRunResponse) UnmarshalJSON

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

type MonitorRunResponseKeyMetadata added in v2.22.0

type MonitorRunResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorRunResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorRunResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorService

type MonitorService struct {
	// contains filtered or unexported fields
}

Watch websites for exact or meaningful changes.

MonitorService contains methods and other services that help with interacting with the context.dev 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 NewMonitorService method instead.

func NewMonitorService

func NewMonitorService(opts ...option.RequestOption) (r MonitorService)

NewMonitorService 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 (*MonitorService) Delete

func (r *MonitorService) Delete(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *MonitorDeleteResponse, err error)

Delete a monitor and stop future runs and webhook retries.

func (*MonitorService) Get

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

Retrieve a monitor’s configuration and current state.

func (*MonitorService) GetChange

func (r *MonitorService) GetChange(ctx context.Context, changeID string, opts ...option.RequestOption) (res *MonitorGetChangeResponse, err error)

Retrieve a detected change, including its diff and available evidence.

func (*MonitorService) GetCreditUsage added in v2.5.0

Return usage per monitor, highest first, for up to the 10,000 most recent runs in the requested window.

func (*MonitorService) GetLimits added in v2.5.0

func (r *MonitorService) GetLimits(ctx context.Context, opts ...option.RequestOption) (res *MonitorGetLimitsResponse, err error)

Retrieve your organization’s monitor allowance and usage.

func (*MonitorService) GetRun added in v2.20.0

func (r *MonitorService) GetRun(ctx context.Context, runID string, query MonitorGetRunParams, opts ...option.RequestOption) (res *MonitorGetRunResponse, err error)

Retrieve the status, timing, and results of one monitor run.

func (*MonitorService) List

List your monitors with optional search and filters.

func (*MonitorService) ListAccountChanges

List full change records across your monitors, newest first.

func (*MonitorService) ListAccountRuns

List runs across your monitors, newest first.

func (*MonitorService) ListChanges

func (r *MonitorService) ListChanges(ctx context.Context, monitorID string, query MonitorListChangesParams, opts ...option.RequestOption) (res *MonitorListChangesResponse, err error)

List full change records for a monitor, newest first.

func (*MonitorService) ListRuns

func (r *MonitorService) ListRuns(ctx context.Context, monitorID string, query MonitorListRunsParams, opts ...option.RequestOption) (res *MonitorListRunsResponse, err error)

List a monitor’s runs, newest first.

func (*MonitorService) New

Watch a page, URL inventory, or extracted website data on a schedule. A run starts immediately to capture the baseline.

func (*MonitorService) RotateWebhookSecret added in v2.20.0

func (r *MonitorService) RotateWebhookSecret(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *MonitorRotateWebhookSecretResponse, err error)

Generate and return a new signing secret. It takes effect immediately for all subsequent delivery attempts.

func (*MonitorService) Run

func (r *MonitorService) Run(ctx context.Context, monitorID string, opts ...option.RequestOption) (res *MonitorRunResponse, err error)

Queue a run without changing the regular schedule. Paused monitors return 409.

func (*MonitorService) Update

func (r *MonitorService) Update(ctx context.Context, monitorID string, body MonitorUpdateParams, opts ...option.RequestOption) (res *MonitorUpdateResponse, err error)

Update a monitor. Changing its target or change detection replaces the baseline and queues a new baseline run.

type MonitorUpdateParams

type MonitorUpdateParams struct {
	// Display name for the monitor.
	Name param.Opt[string] `json:"name,omitzero"`
	// Set to null to remove the webhook. Changing `url` issues a new secret.
	Webhook MonitorUpdateParamsWebhook `json:"webhook,omitzero"`
	// How changes are judged. Defaults to `semantic` for extract targets and page
	// targets with `instructions`, otherwise `exact`.
	ChangeDetection MonitorUpdateParamsChangeDetectionUnion `json:"change_detection,omitzero"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorUpdateParamsSchedule `json:"schedule,omitzero"`
	// Set `paused` to stop scheduled runs or `active` to resume them.
	//
	// Any of "active", "paused".
	Status MonitorUpdateParamsStatus `json:"status,omitzero"`
	// Labels for filtering monitors, their changes, and their usage.
	Tags []string `json:"tags,omitzero"`
	// What to watch: a page, a sitemap, or data extracted from a site.
	Target MonitorUpdateParamsTargetUnion `json:"target,omitzero"`
	// contains filtered or unexported fields
}

func (MonitorUpdateParams) MarshalJSON

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

func (*MonitorUpdateParams) UnmarshalJSON

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

type MonitorUpdateParamsChangeDetectionExact

type MonitorUpdateParamsChangeDetectionExact struct {
	// Use `exact` to compare visible text or sitemap URLs.
	Type constant.Exact `json:"type" default:"exact"`
	// contains filtered or unexported fields
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

This struct has a constant value, construct it with NewMonitorUpdateParamsChangeDetectionExact.

func NewMonitorUpdateParamsChangeDetectionExact

func NewMonitorUpdateParamsChangeDetectionExact() MonitorUpdateParamsChangeDetectionExact

func (MonitorUpdateParamsChangeDetectionExact) MarshalJSON

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

func (*MonitorUpdateParamsChangeDetectionExact) UnmarshalJSON

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

type MonitorUpdateParamsChangeDetectionSemantic

type MonitorUpdateParamsChangeDetectionSemantic struct {
	// Minimum confidence required to report a meaningful change, from 0 to 1.
	ConfidenceThreshold param.Opt[float64] `json:"confidence_threshold,omitzero"`
	// Use `semantic` to judge changes against the target instructions.
	//
	// This field can be elided, and will marshal its zero value as "semantic".
	Type constant.Semantic `json:"type" default:"semantic"`
	// contains filtered or unexported fields
}

Detect meaningful content changes using the target’s instructions and optional schema.

The property Type is required.

func (MonitorUpdateParamsChangeDetectionSemantic) MarshalJSON

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

func (*MonitorUpdateParamsChangeDetectionSemantic) UnmarshalJSON

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

type MonitorUpdateParamsChangeDetectionUnion

type MonitorUpdateParamsChangeDetectionUnion struct {
	OfExact    *MonitorUpdateParamsChangeDetectionExact    `json:",omitzero,inline"`
	OfSemantic *MonitorUpdateParamsChangeDetectionSemantic `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorUpdateParamsChangeDetectionUnion) MarshalJSON

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

func (*MonitorUpdateParamsChangeDetectionUnion) UnmarshalJSON

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

type MonitorUpdateParamsSchedule

type MonitorUpdateParamsSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Use `interval` to run on a repeating schedule.
	//
	// Any of "interval".
	Type string `json:"type,omitzero" api:"required"`
	// Time unit used with `frequency` to set the run interval.
	//
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

The properties Frequency, Type, Unit are required.

func (MonitorUpdateParamsSchedule) MarshalJSON

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

func (*MonitorUpdateParamsSchedule) UnmarshalJSON

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

type MonitorUpdateParamsStatus

type MonitorUpdateParamsStatus string

Set `paused` to stop scheduled runs or `active` to resume them.

const (
	MonitorUpdateParamsStatusActive MonitorUpdateParamsStatus = "active"
	MonitorUpdateParamsStatusPaused MonitorUpdateParamsStatus = "paused"
)

type MonitorUpdateParamsTargetExtract

type MonitorUpdateParamsTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string `json:"instructions" api:"required"`
	// Root URL to extract structured data from.
	URL string `json:"url" api:"required" format:"uri"`
	// Allow page discovery on subdomains of the target site.
	FollowSubdomains param.Opt[bool] `json:"follow_subdomains,omitzero"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth param.Opt[int64] `json:"max_depth,omitzero"`
	// Maximum number of pages to track.
	MaxPages param.Opt[int64] `json:"max_pages,omitzero"`
	// JSON Schema for page selection and the baseline snapshot. Changes return diffs
	// and evidence.
	Schema map[string]any `json:"schema,omitzero"`
	// Use `extract` to watch structured data across selected pages.
	//
	// This field can be elided, and will marshal its zero value as "extract".
	Type constant.Extract `json:"type" default:"extract"`
	// contains filtered or unexported fields
}

Track relevant pages selected by `schema` and `instructions`; refresh the page set periodically.

The properties Instructions, Type, URL are required.

func (MonitorUpdateParamsTargetExtract) MarshalJSON

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

func (*MonitorUpdateParamsTargetExtract) UnmarshalJSON

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

type MonitorUpdateParamsTargetPage

type MonitorUpdateParamsTargetPage struct {
	// Public HTTP(S) page URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions param.Opt[string] `json:"instructions,omitzero"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace param.Opt[bool] `json:"normalize_whitespace,omitzero"`
	// Optional browser actions executed in array order after the page loads, before
	// content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
	// Changes create a new baseline.
	Actions []MonitorUpdateParamsTargetPageActionUnion `json:"actions,omitzero"`
	// Remove matching regions after inclusions. Changes create a new baseline.
	ExcludeSelectors []string `json:"exclude_selectors,omitzero"`
	// Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
	// create a new baseline.
	IncludeSelectors []string `json:"include_selectors,omitzero"`
	// Use `page` to watch one web page.
	//
	// This field can be elided, and will marshal its zero value as "page".
	Type constant.Page `json:"type" default:"page"`
	// contains filtered or unexported fields
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

The properties Type, URL are required.

func (MonitorUpdateParamsTargetPage) MarshalJSON

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

func (*MonitorUpdateParamsTargetPage) UnmarshalJSON

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

type MonitorUpdateParamsTargetPageActionPerform added in v2.22.0

type MonitorUpdateParamsTargetPageActionPerform struct {
	// One browser instruction, such as clicking a button or entering text.
	Action string `json:"action" api:"required"`
	// Use `perform` for a plain-language browser instruction.
	//
	// This field can be elided, and will marshal its zero value as "perform".
	Do constant.Perform `json:"do" default:"perform"`
	// contains filtered or unexported fields
}

Resolve and perform one natural-language browser action.

The properties Action, Do are required.

func (MonitorUpdateParamsTargetPageActionPerform) MarshalJSON added in v2.22.0

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

func (*MonitorUpdateParamsTargetPageActionPerform) UnmarshalJSON added in v2.22.0

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

type MonitorUpdateParamsTargetPageActionScroll added in v2.22.0

type MonitorUpdateParamsTargetPageActionScroll struct {
	// CSS selector for the first matching scroll container. Defaults to the page.
	Container param.Opt[string] `json:"container,omitzero"`
	// Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
	// changing. Defaults to 1.
	MaxScrolls param.Opt[int64] `json:"maxScrolls,omitzero"`
	// Pixels per scroll, one visible viewport, or the current scroll boundary.
	// Defaults to viewport.
	Amount MonitorUpdateParamsTargetPageActionScrollAmountUnion `json:"amount,omitzero"`
	// Direction to scroll. Defaults to down.
	//
	// Any of "up", "down", "left", "right".
	Direction string `json:"direction,omitzero"`
	// Use `scroll` to move through the page or a container.
	//
	// This field can be elided, and will marshal its zero value as "scroll".
	Do constant.Scroll `json:"do" default:"scroll"`
	// contains filtered or unexported fields
}

Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.

The property Do is required.

func (MonitorUpdateParamsTargetPageActionScroll) MarshalJSON added in v2.22.0

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

func (*MonitorUpdateParamsTargetPageActionScroll) UnmarshalJSON added in v2.22.0

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

type MonitorUpdateParamsTargetPageActionScrollAmountString added in v2.22.0

type MonitorUpdateParamsTargetPageActionScrollAmountString string
const (
	MonitorUpdateParamsTargetPageActionScrollAmountStringViewport MonitorUpdateParamsTargetPageActionScrollAmountString = "viewport"
	MonitorUpdateParamsTargetPageActionScrollAmountStringMax      MonitorUpdateParamsTargetPageActionScrollAmountString = "max"
)

type MonitorUpdateParamsTargetPageActionScrollAmountUnion added in v2.22.0

type MonitorUpdateParamsTargetPageActionScrollAmountUnion struct {
	OfInt param.Opt[int64] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfMonitorUpdatesTargetPageActionScrollAmountString)
	OfMonitorUpdatesTargetPageActionScrollAmountString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorUpdateParamsTargetPageActionScrollAmountUnion) MarshalJSON added in v2.22.0

func (*MonitorUpdateParamsTargetPageActionScrollAmountUnion) UnmarshalJSON added in v2.22.0

type MonitorUpdateParamsTargetPageActionUnion added in v2.22.0

type MonitorUpdateParamsTargetPageActionUnion struct {
	OfWait    *MonitorUpdateParamsTargetPageActionWait    `json:",omitzero,inline"`
	OfPerform *MonitorUpdateParamsTargetPageActionPerform `json:",omitzero,inline"`
	OfScroll  *MonitorUpdateParamsTargetPageActionScroll  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorUpdateParamsTargetPageActionUnion) MarshalJSON added in v2.22.0

func (*MonitorUpdateParamsTargetPageActionUnion) UnmarshalJSON added in v2.22.0

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

type MonitorUpdateParamsTargetPageActionWait added in v2.22.0

type MonitorUpdateParamsTargetPageActionWait struct {
	// Time to pause in milliseconds before the next action.
	TimeMs int64 `json:"timeMs" api:"required"`
	// Use `wait` to pause for a fixed duration.
	//
	// This field can be elided, and will marshal its zero value as "wait".
	Do constant.Wait `json:"do" default:"wait"`
	// contains filtered or unexported fields
}

Pause for a fixed number of milliseconds before continuing to the next action.

The properties Do, TimeMs are required.

func (MonitorUpdateParamsTargetPageActionWait) MarshalJSON added in v2.22.0

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

func (*MonitorUpdateParamsTargetPageActionWait) UnmarshalJSON added in v2.22.0

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

type MonitorUpdateParamsTargetSitemap

type MonitorUpdateParamsTargetSitemap struct {
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs param.Opt[int64] `json:"max_urls,omitzero"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude,omitzero"`
	// URL path patterns to include (max 50).
	Include []string `json:"include,omitzero"`
	// Use `sitemap` to watch a site for added or removed URLs.
	//
	// This field can be elided, and will marshal its zero value as "sitemap".
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// contains filtered or unexported fields
}

Watch a site’s URL inventory for confirmed additions and removals.

The properties Type, URL are required.

func (MonitorUpdateParamsTargetSitemap) MarshalJSON

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

func (*MonitorUpdateParamsTargetSitemap) UnmarshalJSON

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

type MonitorUpdateParamsTargetUnion

type MonitorUpdateParamsTargetUnion struct {
	OfPage    *MonitorUpdateParamsTargetPage    `json:",omitzero,inline"`
	OfSitemap *MonitorUpdateParamsTargetSitemap `json:",omitzero,inline"`
	OfExtract *MonitorUpdateParamsTargetExtract `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (MonitorUpdateParamsTargetUnion) MarshalJSON

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

func (*MonitorUpdateParamsTargetUnion) UnmarshalJSON

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

type MonitorUpdateParamsWebhook

type MonitorUpdateParamsWebhook struct {
	// Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
	// messages.
	URL string `json:"url" api:"required" format:"uri"`
	// Events to deliver. Defaults to `change.detected`; `run.completed` also includes
	// unchanged runs.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events,omitzero"`
	// Webhook retry settings. Use {} for the default schedule.
	Retry RetryConfigParam `json:"retry,omitzero"`
	// contains filtered or unexported fields
}

Set to null to remove the webhook. Changing `url` issues a new secret.

The property URL is required.

func (MonitorUpdateParamsWebhook) MarshalJSON

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

func (*MonitorUpdateParamsWebhook) UnmarshalJSON

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

type MonitorUpdateResponse

type MonitorUpdateResponse struct {
	ID string `json:"id" api:"required"`
	// How changes are judged. Defaults to `semantic` for extract targets and page
	// targets with `instructions`, otherwise `exact`.
	ChangeDetection MonitorUpdateResponseChangeDetectionUnion `json:"change_detection" api:"required"`
	CreatedAt       time.Time                                 `json:"created_at" api:"required" format:"date-time"`
	// Always `web`. Optional.
	//
	// Any of "web".
	Mode MonitorUpdateResponseMode `json:"mode" api:"required"`
	Name string                    `json:"name" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Current state. Failed monitors keep running; paused monitors must be resumed
	// with `status: "active"`.
	//
	// Any of "active", "paused", "failed".
	Status MonitorUpdateResponseStatus `json:"status" api:"required"`
	// What to watch: a page, a sitemap, or data extracted from a site.
	Target    MonitorUpdateResponseTargetUnion `json:"target" api:"required"`
	UpdatedAt time.Time                        `json:"updated_at" api:"required" format:"date-time"`
	// Comparison baseline, included on Retrieve. Null until capture completes or after
	// target changes.
	Baseline MonitorUpdateResponseBaselineUnion `json:"baseline" api:"nullable"`
	// Credits this request used and your remaining balance.
	KeyMetadata  MonitorUpdateResponseKeyMetadata `json:"key_metadata"`
	LastChangeAt time.Time                        `json:"last_change_at" api:"nullable" format:"date-time"`
	// Error from the most recent failed run; null when the last run succeeded.
	LastError MonitorUpdateResponseLastError `json:"last_error" api:"nullable"`
	LastRunAt time.Time                      `json:"last_run_at" api:"nullable" format:"date-time"`
	// When the next scheduled run is due; null while paused.
	NextRunAt time.Time `json:"next_run_at" api:"nullable" format:"date-time"`
	// Run the monitor on a fixed interval defined by a frequency and a unit, e.g.
	// every 6 hours or every 2 days. The total interval (frequency × unit) must be
	// between 10 minutes and 1 year.
	Schedule MonitorUpdateResponseSchedule `json:"schedule"`
	// Labels for filtering monitors, their changes, and their usage.
	Tags []string `json:"tags"`
	// Webhook destination and delivery settings. Null means no webhook is configured.
	Webhook MonitorUpdateResponseWebhook `json:"webhook" api:"nullable"`
	// Present while webhook deliveries are failing consecutively; null when deliveries
	// are healthy or no webhook is configured. Cleared on the next successful delivery
	// and when the webhook URL changes.
	WebhookFailure MonitorUpdateResponseWebhookFailure `json:"webhook_failure" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		ChangeDetection respjson.Field
		CreatedAt       respjson.Field
		Mode            respjson.Field
		Name            respjson.Field
		RequestID       respjson.Field
		Status          respjson.Field
		Target          respjson.Field
		UpdatedAt       respjson.Field
		Baseline        respjson.Field
		KeyMetadata     respjson.Field
		LastChangeAt    respjson.Field
		LastError       respjson.Field
		LastRunAt       respjson.Field
		NextRunAt       respjson.Field
		Schedule        respjson.Field
		Tags            respjson.Field
		Webhook         respjson.Field
		WebhookFailure  respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MonitorUpdateResponse) RawJSON

func (r MonitorUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponse) UnmarshalJSON

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

type MonitorUpdateResponseBaselineExtractBaseline added in v2.1.0

type MonitorUpdateResponseBaselineExtractBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Latest structured snapshot matching the extraction schema, refreshed at most
	// daily; `null` before capture.
	Data any `json:"data" api:"required"`
	// The page URLs the monitor tracks and analyzes for changes.
	URLsAnalyzed []string `json:"urls_analyzed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt   respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of an `extract` monitor: the pages it tracks and the structured data as last extracted.

func (MonitorUpdateResponseBaselineExtractBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseBaselineExtractBaseline) UnmarshalJSON added in v2.1.0

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

type MonitorUpdateResponseBaselinePageBaseline added in v2.1.0

type MonitorUpdateResponseBaselinePageBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// The page's visible text as last observed.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `page` monitor: the visible page text as last observed.

func (MonitorUpdateResponseBaselinePageBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseBaselinePageBaseline) UnmarshalJSON added in v2.1.0

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

type MonitorUpdateResponseBaselineSitemapBaseline added in v2.1.0

type MonitorUpdateResponseBaselineSitemapBaseline struct {
	// When this baseline was last captured or replaced.
	CapturedAt time.Time `json:"captured_at" api:"required" format:"date-time"`
	// Number of URLs in the baseline.
	URLCount int64 `json:"url_count" api:"required"`
	// The sitemap URLs as last observed (sorted, normalized).
	URLs []string `json:"urls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CapturedAt  respjson.Field
		URLCount    respjson.Field
		URLs        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Current baseline of a `sitemap` monitor: the normalized URL set as last observed.

func (MonitorUpdateResponseBaselineSitemapBaseline) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseBaselineSitemapBaseline) UnmarshalJSON added in v2.1.0

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

type MonitorUpdateResponseBaselineUnion added in v2.1.0

type MonitorUpdateResponseBaselineUnion struct {
	CapturedAt time.Time `json:"captured_at"`
	// This field is from variant [MonitorUpdateResponseBaselinePageBaseline].
	Text string `json:"text"`
	// This field is from variant [MonitorUpdateResponseBaselineSitemapBaseline].
	URLCount int64 `json:"url_count"`
	// This field is from variant [MonitorUpdateResponseBaselineSitemapBaseline].
	URLs []string `json:"urls"`
	// This field is from variant [MonitorUpdateResponseBaselineExtractBaseline].
	Data any `json:"data"`
	// This field is from variant [MonitorUpdateResponseBaselineExtractBaseline].
	URLsAnalyzed []string `json:"urls_analyzed"`
	JSON         struct {
		CapturedAt   respjson.Field
		Text         respjson.Field
		URLCount     respjson.Field
		URLs         respjson.Field
		Data         respjson.Field
		URLsAnalyzed respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorUpdateResponseBaselineUnion contains all possible properties and values from MonitorUpdateResponseBaselinePageBaseline, MonitorUpdateResponseBaselineSitemapBaseline, MonitorUpdateResponseBaselineExtractBaseline.

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

func (MonitorUpdateResponseBaselineUnion) AsExtractBaseline added in v2.1.0

func (MonitorUpdateResponseBaselineUnion) AsPageBaseline added in v2.1.0

func (MonitorUpdateResponseBaselineUnion) AsSitemapBaseline added in v2.1.0

func (MonitorUpdateResponseBaselineUnion) RawJSON added in v2.1.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseBaselineUnion) UnmarshalJSON added in v2.1.0

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

type MonitorUpdateResponseChangeDetectionExact

type MonitorUpdateResponseChangeDetectionExact struct {
	// Use `exact` to compare visible text or sitemap URLs.
	Type constant.Exact `json:"type" default:"exact"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect exact changes. For page targets, this means visible text diffs. For sitemap targets, this means URL additions and removals.

func (MonitorUpdateResponseChangeDetectionExact) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseChangeDetectionExact) UnmarshalJSON

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

type MonitorUpdateResponseChangeDetectionSemantic

type MonitorUpdateResponseChangeDetectionSemantic struct {
	// Use `semantic` to judge changes against the target instructions.
	Type constant.Semantic `json:"type" default:"semantic"`
	// Minimum confidence required to report a meaningful change, from 0 to 1.
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Detect meaningful content changes using the target’s instructions and optional schema.

func (MonitorUpdateResponseChangeDetectionSemantic) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseChangeDetectionSemantic) UnmarshalJSON

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

type MonitorUpdateResponseChangeDetectionUnion

type MonitorUpdateResponseChangeDetectionUnion struct {
	// Any of "exact", "semantic".
	Type string `json:"type"`
	// This field is from variant [MonitorUpdateResponseChangeDetectionSemantic].
	ConfidenceThreshold float64 `json:"confidence_threshold"`
	JSON                struct {
		Type                respjson.Field
		ConfidenceThreshold respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorUpdateResponseChangeDetectionUnion contains all possible properties and values from MonitorUpdateResponseChangeDetectionExact, MonitorUpdateResponseChangeDetectionSemantic.

Use the MonitorUpdateResponseChangeDetectionUnion.AsAny method to switch on the variant.

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

func (MonitorUpdateResponseChangeDetectionUnion) AsAny

func (u MonitorUpdateResponseChangeDetectionUnion) AsAny() anyMonitorUpdateResponseChangeDetection

Use the following switch statement to find the correct variant

switch variant := MonitorUpdateResponseChangeDetectionUnion.AsAny().(type) {
case contextdev.MonitorUpdateResponseChangeDetectionExact:
case contextdev.MonitorUpdateResponseChangeDetectionSemantic:
default:
  fmt.Errorf("no variant present")
}

func (MonitorUpdateResponseChangeDetectionUnion) AsExact

func (MonitorUpdateResponseChangeDetectionUnion) AsSemantic

func (MonitorUpdateResponseChangeDetectionUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseChangeDetectionUnion) UnmarshalJSON

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

type MonitorUpdateResponseKeyMetadata added in v2.22.0

type MonitorUpdateResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (MonitorUpdateResponseKeyMetadata) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseKeyMetadata) UnmarshalJSON added in v2.22.0

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

type MonitorUpdateResponseLastError

type MonitorUpdateResponseLastError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Error from the most recent failed run; null when the last run succeeded.

func (MonitorUpdateResponseLastError) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseLastError) UnmarshalJSON

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

type MonitorUpdateResponseMode

type MonitorUpdateResponseMode string

Always `web`. Optional.

const (
	MonitorUpdateResponseModeWeb MonitorUpdateResponseMode = "web"
)

type MonitorUpdateResponseSchedule

type MonitorUpdateResponseSchedule struct {
	// Number of units between runs. The resulting interval (frequency × unit) must be
	// at least 10 minutes and at most 1 year (e.g. minimum 10 when unit is minutes;
	// maximum 365 when unit is days).
	Frequency int64 `json:"frequency" api:"required"`
	// Use `interval` to run on a repeating schedule.
	//
	// Any of "interval".
	Type string `json:"type" api:"required"`
	// Time unit used with `frequency` to set the run interval.
	//
	// Any of "minutes", "hours", "days".
	Unit string `json:"unit" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Frequency   respjson.Field
		Type        respjson.Field
		Unit        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Run the monitor on a fixed interval defined by a frequency and a unit, e.g. every 6 hours or every 2 days. The total interval (frequency × unit) must be between 10 minutes and 1 year.

func (MonitorUpdateResponseSchedule) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseSchedule) UnmarshalJSON

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

type MonitorUpdateResponseStatus

type MonitorUpdateResponseStatus string

Current state. Failed monitors keep running; paused monitors must be resumed with `status: "active"`.

const (
	MonitorUpdateResponseStatusActive MonitorUpdateResponseStatus = "active"
	MonitorUpdateResponseStatusPaused MonitorUpdateResponseStatus = "paused"
	MonitorUpdateResponseStatusFailed MonitorUpdateResponseStatus = "failed"
)

type MonitorUpdateResponseTargetExtract

type MonitorUpdateResponseTargetExtract struct {
	// Natural-language instructions guiding which pages and facts to track and which
	// changes to report.
	Instructions string `json:"instructions" api:"required"`
	// Use `extract` to watch structured data across selected pages.
	Type constant.Extract `json:"type" default:"extract"`
	// Root URL to extract structured data from.
	URL string `json:"url" api:"required" format:"uri"`
	// Allow page discovery on subdomains of the target site.
	FollowSubdomains bool `json:"follow_subdomains"`
	// Optional maximum link depth from the starting URL (0 = only the starting page).
	MaxDepth int64 `json:"max_depth"`
	// Maximum number of pages to track.
	MaxPages int64 `json:"max_pages"`
	// JSON Schema for page selection and the baseline snapshot. Changes return diffs
	// and evidence.
	Schema map[string]any `json:"schema"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Instructions     respjson.Field
		Type             respjson.Field
		URL              respjson.Field
		FollowSubdomains respjson.Field
		MaxDepth         respjson.Field
		MaxPages         respjson.Field
		Schema           respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Track relevant pages selected by `schema` and `instructions`; refresh the page set periodically.

func (MonitorUpdateResponseTargetExtract) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetExtract) UnmarshalJSON

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

type MonitorUpdateResponseTargetPage

type MonitorUpdateResponseTargetPage struct {
	// Use `page` to watch one web page.
	Type constant.Page `json:"type" default:"page"`
	// Public HTTP(S) page URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// Optional browser actions executed in array order after the page loads, before
	// content is captured, on every run. Requires a paid plan. Maximum: 5 actions.
	// Changes create a new baseline.
	Actions []MonitorUpdateResponseTargetPageActionUnion `json:"actions" api:"nullable"`
	// Remove matching regions after inclusions. Changes create a new baseline.
	ExcludeSelectors []string `json:"exclude_selectors"`
	// Monitor these CSS-selected regions. Empty or omitted uses main content. Changes
	// create a new baseline.
	IncludeSelectors []string `json:"include_selectors"`
	// Plain-language goal describing which page changes matter. When provided without
	// change_detection, semantic detection is inferred.
	Instructions string `json:"instructions"`
	// Normalize whitespace before comparing or analyzing text.
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type                respjson.Field
		URL                 respjson.Field
		Actions             respjson.Field
		ExcludeSelectors    respjson.Field
		IncludeSelectors    respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a single web page. Exact detection reports visible-text diffs; semantic detection judges confirmed stable diffs against `instructions`.

func (MonitorUpdateResponseTargetPage) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetPage) UnmarshalJSON

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

type MonitorUpdateResponseTargetPageActionPerform added in v2.22.0

type MonitorUpdateResponseTargetPageActionPerform struct {
	// One browser instruction, such as clicking a button or entering text.
	Action string `json:"action" api:"required"`
	// Use `perform` for a plain-language browser instruction.
	Do constant.Perform `json:"do" default:"perform"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Action      respjson.Field
		Do          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolve and perform one natural-language browser action.

func (MonitorUpdateResponseTargetPageActionPerform) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetPageActionPerform) UnmarshalJSON added in v2.22.0

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

type MonitorUpdateResponseTargetPageActionScroll added in v2.22.0

type MonitorUpdateResponseTargetPageActionScroll struct {
	// Use `scroll` to move through the page or a container.
	Do constant.Scroll `json:"do" default:"scroll"`
	// Pixels per scroll, one visible viewport, or the current scroll boundary.
	// Defaults to viewport.
	Amount MonitorUpdateResponseTargetPageActionScrollAmountUnion `json:"amount"`
	// CSS selector for the first matching scroll container. Defaults to the page.
	Container string `json:"container"`
	// Direction to scroll. Defaults to down.
	//
	// Any of "up", "down", "left", "right".
	Direction string `json:"direction"`
	// Maximum scroll iterations. Stops early when scrolling and scrollable extent stop
	// changing. Defaults to 1.
	MaxScrolls int64 `json:"maxScrolls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Do          respjson.Field
		Amount      respjson.Field
		Container   respjson.Field
		Direction   respjson.Field
		MaxScrolls  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Scroll the page or a selected scrollable container, waiting adaptively for content and dimensions to settle after each iteration.

func (MonitorUpdateResponseTargetPageActionScroll) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetPageActionScroll) UnmarshalJSON added in v2.22.0

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

type MonitorUpdateResponseTargetPageActionScrollAmountString added in v2.22.0

type MonitorUpdateResponseTargetPageActionScrollAmountString string
const (
	MonitorUpdateResponseTargetPageActionScrollAmountStringViewport MonitorUpdateResponseTargetPageActionScrollAmountString = "viewport"
	MonitorUpdateResponseTargetPageActionScrollAmountStringMax      MonitorUpdateResponseTargetPageActionScrollAmountString = "max"
)

type MonitorUpdateResponseTargetPageActionScrollAmountUnion added in v2.22.0

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

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

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

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

func (MonitorUpdateResponseTargetPageActionScrollAmountUnion) AsInt added in v2.22.0

func (MonitorUpdateResponseTargetPageActionScrollAmountUnion) AsMonitorUpdateResponseTargetPageActionScrollAmountString added in v2.22.0

func (u MonitorUpdateResponseTargetPageActionScrollAmountUnion) AsMonitorUpdateResponseTargetPageActionScrollAmountString() (v string)

func (MonitorUpdateResponseTargetPageActionScrollAmountUnion) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetPageActionScrollAmountUnion) UnmarshalJSON added in v2.22.0

type MonitorUpdateResponseTargetPageActionUnion added in v2.22.0

type MonitorUpdateResponseTargetPageActionUnion struct {
	// Any of "wait", "perform", "scroll".
	Do string `json:"do"`
	// This field is from variant [MonitorUpdateResponseTargetPageActionWait].
	TimeMs int64 `json:"timeMs"`
	// This field is from variant [MonitorUpdateResponseTargetPageActionPerform].
	Action string `json:"action"`
	// This field is from variant [MonitorUpdateResponseTargetPageActionScroll].
	Amount MonitorUpdateResponseTargetPageActionScrollAmountUnion `json:"amount"`
	// This field is from variant [MonitorUpdateResponseTargetPageActionScroll].
	Container string `json:"container"`
	// This field is from variant [MonitorUpdateResponseTargetPageActionScroll].
	Direction string `json:"direction"`
	// This field is from variant [MonitorUpdateResponseTargetPageActionScroll].
	MaxScrolls int64 `json:"maxScrolls"`
	JSON       struct {
		Do         respjson.Field
		TimeMs     respjson.Field
		Action     respjson.Field
		Amount     respjson.Field
		Container  respjson.Field
		Direction  respjson.Field
		MaxScrolls respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorUpdateResponseTargetPageActionUnion contains all possible properties and values from MonitorUpdateResponseTargetPageActionWait, MonitorUpdateResponseTargetPageActionPerform, MonitorUpdateResponseTargetPageActionScroll.

Use the MonitorUpdateResponseTargetPageActionUnion.AsAny method to switch on the variant.

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

func (MonitorUpdateResponseTargetPageActionUnion) AsAny added in v2.22.0

func (u MonitorUpdateResponseTargetPageActionUnion) AsAny() anyMonitorUpdateResponseTargetPageAction

Use the following switch statement to find the correct variant

switch variant := MonitorUpdateResponseTargetPageActionUnion.AsAny().(type) {
case contextdev.MonitorUpdateResponseTargetPageActionWait:
case contextdev.MonitorUpdateResponseTargetPageActionPerform:
case contextdev.MonitorUpdateResponseTargetPageActionScroll:
default:
  fmt.Errorf("no variant present")
}

func (MonitorUpdateResponseTargetPageActionUnion) AsPerform added in v2.22.0

func (MonitorUpdateResponseTargetPageActionUnion) AsScroll added in v2.22.0

func (MonitorUpdateResponseTargetPageActionUnion) AsWait added in v2.22.0

func (MonitorUpdateResponseTargetPageActionUnion) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetPageActionUnion) UnmarshalJSON added in v2.22.0

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

type MonitorUpdateResponseTargetPageActionWait added in v2.22.0

type MonitorUpdateResponseTargetPageActionWait struct {
	// Use `wait` to pause for a fixed duration.
	Do constant.Wait `json:"do" default:"wait"`
	// Time to pause in milliseconds before the next action.
	TimeMs int64 `json:"timeMs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Do          respjson.Field
		TimeMs      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Pause for a fixed number of milliseconds before continuing to the next action.

func (MonitorUpdateResponseTargetPageActionWait) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetPageActionWait) UnmarshalJSON added in v2.22.0

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

type MonitorUpdateResponseTargetSitemap

type MonitorUpdateResponseTargetSitemap struct {
	// Use `sitemap` to watch a site for added or removed URLs.
	Type constant.Sitemap `json:"type" default:"sitemap"`
	// Sitemap URL to monitor.
	URL string `json:"url" api:"required" format:"uri"`
	// URL path patterns to exclude (max 50).
	Exclude []string `json:"exclude"`
	// URL path patterns to include (max 50).
	Include []string `json:"include"`
	// Maximum number of sitemap URLs to track (capped at 10,000).
	MaxURLs int64 `json:"max_urls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		URL         respjson.Field
		Exclude     respjson.Field
		Include     respjson.Field
		MaxURLs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Watch a site’s URL inventory for confirmed additions and removals.

func (MonitorUpdateResponseTargetSitemap) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetSitemap) UnmarshalJSON

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

type MonitorUpdateResponseTargetUnion

type MonitorUpdateResponseTargetUnion struct {
	// Any of "page", "sitemap", "extract".
	Type string `json:"type"`
	URL  string `json:"url"`
	// This field is from variant [MonitorUpdateResponseTargetPage].
	Actions []MonitorUpdateResponseTargetPageActionUnion `json:"actions"`
	// This field is from variant [MonitorUpdateResponseTargetPage].
	ExcludeSelectors []string `json:"exclude_selectors"`
	// This field is from variant [MonitorUpdateResponseTargetPage].
	IncludeSelectors []string `json:"include_selectors"`
	Instructions     string   `json:"instructions"`
	// This field is from variant [MonitorUpdateResponseTargetPage].
	NormalizeWhitespace bool `json:"normalize_whitespace"`
	// This field is from variant [MonitorUpdateResponseTargetSitemap].
	Exclude []string `json:"exclude"`
	// This field is from variant [MonitorUpdateResponseTargetSitemap].
	Include []string `json:"include"`
	// This field is from variant [MonitorUpdateResponseTargetSitemap].
	MaxURLs int64 `json:"max_urls"`
	// This field is from variant [MonitorUpdateResponseTargetExtract].
	FollowSubdomains bool `json:"follow_subdomains"`
	// This field is from variant [MonitorUpdateResponseTargetExtract].
	MaxDepth int64 `json:"max_depth"`
	// This field is from variant [MonitorUpdateResponseTargetExtract].
	MaxPages int64 `json:"max_pages"`
	// This field is from variant [MonitorUpdateResponseTargetExtract].
	Schema map[string]any `json:"schema"`
	JSON   struct {
		Type                respjson.Field
		URL                 respjson.Field
		Actions             respjson.Field
		ExcludeSelectors    respjson.Field
		IncludeSelectors    respjson.Field
		Instructions        respjson.Field
		NormalizeWhitespace respjson.Field
		Exclude             respjson.Field
		Include             respjson.Field
		MaxURLs             respjson.Field
		FollowSubdomains    respjson.Field
		MaxDepth            respjson.Field
		MaxPages            respjson.Field
		Schema              respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

MonitorUpdateResponseTargetUnion contains all possible properties and values from MonitorUpdateResponseTargetPage, MonitorUpdateResponseTargetSitemap, MonitorUpdateResponseTargetExtract.

Use the MonitorUpdateResponseTargetUnion.AsAny method to switch on the variant.

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

func (MonitorUpdateResponseTargetUnion) AsAny

func (u MonitorUpdateResponseTargetUnion) AsAny() anyMonitorUpdateResponseTarget

Use the following switch statement to find the correct variant

switch variant := MonitorUpdateResponseTargetUnion.AsAny().(type) {
case contextdev.MonitorUpdateResponseTargetPage:
case contextdev.MonitorUpdateResponseTargetSitemap:
case contextdev.MonitorUpdateResponseTargetExtract:
default:
  fmt.Errorf("no variant present")
}

func (MonitorUpdateResponseTargetUnion) AsExtract

func (MonitorUpdateResponseTargetUnion) AsPage

func (MonitorUpdateResponseTargetUnion) AsSitemap

func (MonitorUpdateResponseTargetUnion) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseTargetUnion) UnmarshalJSON

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

type MonitorUpdateResponseWebhook

type MonitorUpdateResponseWebhook struct {
	// Public HTTP(S) URL that receives events. Slack and GovSlack URLs get formatted
	// messages.
	URL string `json:"url" api:"required" format:"uri"`
	// Events to deliver. Defaults to `change.detected`; `run.completed` also includes
	// unchanged runs.
	//
	// Any of "change.detected", "run.completed".
	Events []string `json:"events"`
	// Webhook retry settings. Use {} for the default schedule.
	Retry RetryConfig `json:"retry"`
	// API-generated signing secret. Visible only with full access or `monitors:write`
	// permission.
	Secret string `json:"secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Events      respjson.Field
		Retry       respjson.Field
		Secret      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Webhook destination and delivery settings. Null means no webhook is configured.

func (MonitorUpdateResponseWebhook) RawJSON

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseWebhook) UnmarshalJSON

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

type MonitorUpdateResponseWebhookFailure added in v2.3.0

type MonitorUpdateResponseWebhookFailure struct {
	// Number of consecutive delivery attempts that did not succeed.
	ConsecutiveFailures int64     `json:"consecutive_failures" api:"required"`
	LastFailedAt        time.Time `json:"last_failed_at" api:"required" format:"date-time"`
	// Human-readable description of the most recent failure.
	LastMessage string `json:"last_message" api:"required"`
	// Outcome of the most recent failed delivery. rejected means a non-2xx response;
	// failed means no HTTP response was received; skipped_unsafe_url means the URL
	// failed the public-endpoint safety check.
	//
	// Any of "rejected", "failed", "skipped_unsafe_url".
	LastStatus string `json:"last_status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ConsecutiveFailures respjson.Field
		LastFailedAt        respjson.Field
		LastMessage         respjson.Field
		LastStatus          respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Present while webhook deliveries are failing consecutively; null when deliveries are healthy or no webhook is configured. Cleared on the next successful delivery and when the webhook URL changes.

func (MonitorUpdateResponseWebhookFailure) RawJSON added in v2.3.0

Returns the unmodified JSON received from the API

func (*MonitorUpdateResponseWebhookFailure) UnmarshalJSON added in v2.3.0

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

type NewsSearchParams added in v2.10.0

type NewsSearchParams struct {
	// What to search for.
	SearchBy NewsSearchParamsSearchBy `json:"searchBy,omitzero" api:"required"`
	// Opaque next_cursor from the previous response, or null for the first page.
	Cursor param.Opt[string] `json:"cursor,omitzero"`
	// Maximum results to return. Defaults to 10.
	Limit param.Opt[int64] `json:"limit,omitzero"`
	// Optional result filters. Use at most one of sourceDomain, sourceCountry,
	// articleLanguage, or articleType. A date range may accompany that category;
	// date.from must not exceed date.to.
	FilterBy NewsSearchParamsFilterBy `json:"filterBy,omitzero"`
	// Result ordering. Defaults to newest.
	SortBy NewsSearchParamsSortBy `json:"sortBy,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (NewsSearchParams) MarshalJSON added in v2.10.0

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

func (*NewsSearchParams) UnmarshalJSON added in v2.10.0

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

type NewsSearchParamsFilterBy added in v2.10.0

type NewsSearchParamsFilterBy struct {
	// Article languages to include. Up to 3.
	//
	// Any of "ar", "de", "en", "es", "fr", "hi", "it", "ja", "ko", "nl", "pt", "ru",
	// "zh".
	ArticleLanguage []string `json:"articleLanguage,omitzero"`
	// Article types to include. Up to 3.
	//
	// Any of "editorial", "press_release", "regulatory_filing", "advisory".
	ArticleType []string `json:"articleType,omitzero"`
	// Published-at window in epoch milliseconds. from must be before or equal to to.
	Date NewsSearchParamsFilterByDate `json:"date,omitzero"`
	// Publisher countries to include, as lowercase ISO 3166-1 alpha-2 codes. Up to 3.
	//
	// Any of "ae", "ar", "au", "ca", "cg", "ch", "cl", "cz", "de", "fi", "fr", "gb",
	// "hk", "il", "in", "jp", "kr", "mx", "ng", "nl", "pk", "qa", "sa", "se", "sg",
	// "us", "za".
	SourceCountry []string `json:"sourceCountry,omitzero"`
	// Publisher domains to include. Up to 3.
	SourceDomain []string `json:"sourceDomain,omitzero"`
	// contains filtered or unexported fields
}

Optional result filters. Use at most one of sourceDomain, sourceCountry, articleLanguage, or articleType. A date range may accompany that category; date.from must not exceed date.to.

func (NewsSearchParamsFilterBy) MarshalJSON added in v2.10.0

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

func (*NewsSearchParamsFilterBy) UnmarshalJSON added in v2.10.0

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

type NewsSearchParamsFilterByDate added in v2.10.0

type NewsSearchParamsFilterByDate struct {
	// Inclusive start of the published-at window, in epoch milliseconds.
	From param.Opt[int64] `json:"from,omitzero"`
	// Inclusive end of the published-at window, in epoch milliseconds.
	To param.Opt[int64] `json:"to,omitzero"`
	// contains filtered or unexported fields
}

Published-at window in epoch milliseconds. from must be before or equal to to.

func (NewsSearchParamsFilterByDate) MarshalJSON added in v2.10.0

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

func (*NewsSearchParamsFilterByDate) UnmarshalJSON added in v2.10.0

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

type NewsSearchParamsSearchBy added in v2.10.0

type NewsSearchParamsSearchBy struct {
	// The company to search news for, identified by name, domain, ticker, or ISIN.
	Entity NewsSearchParamsSearchByEntityUnion `json:"entity,omitzero" api:"required"`
	// How to search. Only entity search is supported.
	//
	// Any of "entity".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

What to search for.

The properties Entity, Type are required.

func (NewsSearchParamsSearchBy) MarshalJSON added in v2.10.0

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

func (*NewsSearchParamsSearchBy) UnmarshalJSON added in v2.10.0

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

type NewsSearchParamsSearchByEntityDomain added in v2.10.0

type NewsSearchParamsSearchByEntityDomain struct {
	// Company website domain, such as apple.com.
	Domain string `json:"domain" api:"required"`
	// Use `domain` to identify the company by website domain.
	//
	// This field can be elided, and will marshal its zero value as "domain".
	Type constant.Domain `json:"type" default:"domain"`
	// contains filtered or unexported fields
}

Identify the company by website domain.

The properties Domain, Type are required.

func (NewsSearchParamsSearchByEntityDomain) MarshalJSON added in v2.10.0

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

func (*NewsSearchParamsSearchByEntityDomain) UnmarshalJSON added in v2.10.0

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

type NewsSearchParamsSearchByEntityIsin added in v2.10.0

type NewsSearchParamsSearchByEntityIsin struct {
	// International Securities Identification Number.
	Isin string `json:"isin" api:"required"`
	// Use `isin` to identify the company by its securities identifier.
	//
	// This field can be elided, and will marshal its zero value as "isin".
	Type constant.Isin `json:"type" default:"isin"`
	// contains filtered or unexported fields
}

Identify the company by International Securities Identification Number.

The properties Isin, Type are required.

func (NewsSearchParamsSearchByEntityIsin) MarshalJSON added in v2.10.0

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

func (*NewsSearchParamsSearchByEntityIsin) UnmarshalJSON added in v2.10.0

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

type NewsSearchParamsSearchByEntityName added in v2.10.0

type NewsSearchParamsSearchByEntityName struct {
	// Company name.
	Name string `json:"name" api:"required"`
	// Use `name` to identify the company by name.
	//
	// This field can be elided, and will marshal its zero value as "name".
	Type constant.Name `json:"type" default:"name"`
	// contains filtered or unexported fields
}

Identify the company by name.

The properties Name, Type are required.

func (NewsSearchParamsSearchByEntityName) MarshalJSON added in v2.10.0

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

func (*NewsSearchParamsSearchByEntityName) UnmarshalJSON added in v2.10.0

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

type NewsSearchParamsSearchByEntityTicker added in v2.10.0

type NewsSearchParamsSearchByEntityTicker struct {
	// Public-company ticker.
	Ticker string `json:"ticker" api:"required"`
	// Stock exchange the ticker trades on, used to disambiguate tickers listed on
	// multiple exchanges.
	//
	// Any of "AMEX", "AMS", "AQS", "ASX", "ATH", "BER", "BME", "BRU", "BSE", "BUD",
	// "BUE", "BVC", "CBOE", "CNQ", "CPH", "DFM", "DOH", "DUB", "DUS", "DXE", "EGX",
	// "FSX", "HAM", "HEL", "HKSE", "HOSE", "ICE", "IOB", "IST", "JKT", "JNB", "JPX",
	// "KLS", "KOE", "KSC", "KUW", "LIS", "LSE", "MCX", "MEX", "MIL", "MUN", "NASDAQ",
	// "NEO", "NSE", "NYSE", "NZE", "OSL", "OTC", "PAR", "PNK", "PRA", "RIS", "SAO",
	// "SAU", "SES", "SET", "SGO", "SHH", "SHZ", "SIX", "STO", "STU", "TAI", "TAL",
	// "TLV", "TSX", "TSXV", "TWO", "VIE", "WSE", "XETRA".
	Exchange string `json:"exchange,omitzero"`
	// Use `ticker` to identify a publicly traded company.
	//
	// This field can be elided, and will marshal its zero value as "ticker".
	Type constant.Ticker `json:"type" default:"ticker"`
	// contains filtered or unexported fields
}

Identify the company by stock ticker, optionally scoped to an exchange.

The properties Ticker, Type are required.

func (NewsSearchParamsSearchByEntityTicker) MarshalJSON added in v2.10.0

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

func (*NewsSearchParamsSearchByEntityTicker) UnmarshalJSON added in v2.10.0

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

type NewsSearchParamsSearchByEntityUnion added in v2.10.0

type NewsSearchParamsSearchByEntityUnion struct {
	OfName   *NewsSearchParamsSearchByEntityName   `json:",omitzero,inline"`
	OfDomain *NewsSearchParamsSearchByEntityDomain `json:",omitzero,inline"`
	OfTicker *NewsSearchParamsSearchByEntityTicker `json:",omitzero,inline"`
	OfIsin   *NewsSearchParamsSearchByEntityIsin   `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (NewsSearchParamsSearchByEntityUnion) MarshalJSON added in v2.10.0

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

func (*NewsSearchParamsSearchByEntityUnion) UnmarshalJSON added in v2.10.0

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

type NewsSearchParamsSortBy added in v2.10.0

type NewsSearchParamsSortBy struct {
	// Result ordering.
	//
	// Any of "relevance", "newest".
	Type string `json:"type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Result ordering. Defaults to newest.

The property Type is required.

func (NewsSearchParamsSortBy) MarshalJSON added in v2.10.0

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

func (*NewsSearchParamsSortBy) UnmarshalJSON added in v2.10.0

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

type NewsSearchResponse added in v2.10.0

type NewsSearchResponse struct {
	// Articles matching the search, in the requested order.
	Data []NewsSearchResponseData `json:"data" api:"required"`
	// True when more results are available beyond this page.
	HasMore bool `json:"has_more" api:"required"`
	// Summary information about this response.
	Meta NewsSearchResponseMeta `json:"meta" api:"required"`
	// Pass as cursor in the next request to fetch the following page. Null when there
	// are no more results.
	NextCursor string `json:"next_cursor" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata NewsSearchResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		Meta        respjson.Field
		NextCursor  respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewsSearchResponse) RawJSON added in v2.10.0

func (r NewsSearchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsSearchResponse) UnmarshalJSON added in v2.10.0

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

type NewsSearchResponseData added in v2.10.0

type NewsSearchResponseData struct {
	// Stable unique identifier for this article. Use it to deduplicate or reference an
	// article across requests.
	ID string `json:"id" api:"required"`
	// Bylined authors. Empty when no byline is available.
	Authors []string `json:"authors" api:"required"`
	// Short summary or excerpt of the article, when the publisher provides one.
	Description string `json:"description" api:"required"`
	// Lead image for the article, when one is available.
	ImageURL string `json:"image_url" api:"required"`
	// Language the article is written in, as a lowercase ISO 639-1 code such as en.
	// Null when unknown.
	Language string `json:"language" api:"required"`
	// How the article relates to the company you searched for.
	Match NewsSearchResponseDataMatch `json:"match" api:"required"`
	// When the article was published, as an ISO 8601 timestamp. Null when the
	// publisher does not state a reliable date.
	PublishedAt time.Time `json:"published_at" api:"required" format:"date-time"`
	// The publication that published the article.
	Source NewsSearchResponseDataSource `json:"source" api:"required"`
	// Shared by articles covering the same story on the same day. Use it to group or
	// collapse syndicated copies of one announcement across outlets.
	StoryID string `json:"story_id" api:"required"`
	// Article headline.
	Title string `json:"title" api:"required"`
	// Kind of coverage. Use it to separate independent reporting (editorial) from
	// company-issued content (press_release, regulatory_filing, advisory).
	//
	// Any of "editorial", "press_release", "regulatory_filing", "advisory".
	Type string `json:"type" api:"required"`
	// Link to the article on the publisher site.
	URL string `json:"url" api:"required" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Authors     respjson.Field
		Description respjson.Field
		ImageURL    respjson.Field
		Language    respjson.Field
		Match       respjson.Field
		PublishedAt respjson.Field
		Source      respjson.Field
		StoryID     respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NewsSearchResponseData) RawJSON added in v2.10.0

func (r NewsSearchResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsSearchResponseData) UnmarshalJSON added in v2.10.0

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

type NewsSearchResponseDataMatch added in v2.10.0

type NewsSearchResponseDataMatch struct {
	// How confident the match is, from 0 to 1. Null when a score is unavailable.
	Confidence float64 `json:"confidence" api:"required"`
	// primary when the article is mainly about the company, secondary when the company
	// is mentioned but is not the main subject.
	//
	// Any of "primary", "secondary".
	Level string `json:"level" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Confidence  respjson.Field
		Level       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

How the article relates to the company you searched for.

func (NewsSearchResponseDataMatch) RawJSON added in v2.10.0

func (r NewsSearchResponseDataMatch) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsSearchResponseDataMatch) UnmarshalJSON added in v2.10.0

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

type NewsSearchResponseDataSource added in v2.10.0

type NewsSearchResponseDataSource struct {
	// True when Context observed this article in the publisher-owned feed.
	Direct bool `json:"direct" api:"required"`
	// Website domain of the publication.
	Domain string `json:"domain" api:"required"`
	// Name of the publication, such as Reuters.
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Direct      respjson.Field
		Domain      respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The publication that published the article.

func (NewsSearchResponseDataSource) RawJSON added in v2.10.0

Returns the unmodified JSON received from the API

func (*NewsSearchResponseDataSource) UnmarshalJSON added in v2.10.0

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

type NewsSearchResponseKeyMetadata added in v2.10.0

type NewsSearchResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (NewsSearchResponseKeyMetadata) RawJSON added in v2.10.0

Returns the unmodified JSON received from the API

func (*NewsSearchResponseKeyMetadata) UnmarshalJSON added in v2.10.0

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

type NewsSearchResponseMeta added in v2.10.0

type NewsSearchResponseMeta struct {
	// Number of articles in this page.
	Count int64 `json:"count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Count       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Summary information about this response.

func (NewsSearchResponseMeta) RawJSON added in v2.10.0

func (r NewsSearchResponseMeta) RawJSON() string

Returns the unmodified JSON received from the API

func (*NewsSearchResponseMeta) UnmarshalJSON added in v2.10.0

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

type NewsService added in v2.10.0

type NewsService struct {
	// contains filtered or unexported fields
}

Search live and historical news about a company.

NewsService contains methods and other services that help with interacting with the context.dev 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 NewNewsService method instead.

func NewNewsService added in v2.10.0

func NewNewsService(opts ...option.RequestOption) (r NewsService)

NewNewsService 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 (*NewsService) Search added in v2.10.0

func (r *NewsService) Search(ctx context.Context, body NewsSearchParams, opts ...option.RequestOption) (res *NewsSearchResponse, err error)

Find company news by name, domain, ticker, or ISIN. Filter articles and continue through results with a cursor.

type PageErrorCount added in v2.7.0

type PageErrorCount struct {
	// Error code for these failures.
	Code string `json:"code" api:"required"`
	// Pages that failed with this code.
	Count int64 `json:"count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Count       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Page failures sharing one error code.

func (PageErrorCount) RawJSON added in v2.7.0

func (r PageErrorCount) RawJSON() string

Returns the unmodified JSON received from the API

func (*PageErrorCount) UnmarshalJSON added in v2.7.0

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

type ParseHandleParams added in v2.3.0

type ParseHandleParams struct {
	// Optional client identifier used for usage attribution.
	Client param.Opt[string] `query:"client,omitzero" json:"-"`
	// Include image references in Markdown output
	IncludeImages param.Opt[bool] `query:"includeImages,omitzero" json:"-"`
	// Preserve hyperlinks in Markdown output
	IncludeLinks param.Opt[bool] `query:"includeLinks,omitzero" json:"-"`
	// Read text from images and scanned PDF pages. PDF page ranges still apply.
	Ocr param.Opt[bool] `query:"ocr,omitzero" json:"-"`
	// Shorten base64-encoded image data in the Markdown output
	ShortenBase64Images param.Opt[bool] `query:"shortenBase64Images,omitzero" json:"-"`
	// Extract only the main content from HTML-like inputs
	UseMainContentOnly param.Opt[bool] `query:"useMainContentOnly,omitzero" json:"-"`
	// Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv,
	// md, py, rtf, jpg, png, or txt.
	//
	// Any of "txt", "text", "md", "markdown", "html", "htm", "xhtml", "xml", "rss",
	// "atom", "csv", "tsv", "yaml", "yml", "py", "java", "js", "jsx", "mjs", "cjs",
	// "json", "jsonl", "ndjson", "php", "sh", "bash", "zsh", "fish", "rb", "ts",
	// "tsx", "rtf", "srt", "css", "scss", "less", "styl", "sass", "svg", "pdf",
	// "docx", "doc", "xlsx", "xlsm", "xlsb", "xltx", "xltm", "xls", "pptx", "pptm",
	// "ppsx", "ppsm", "potx", "potm", "ppt", "pps", "pot", "jpg", "jpeg", "jpe",
	// "png", "gif", "bmp", "tiff", "tif", "webp", "ppm", "pbm", "pgm", "pnm".
	Extension ParseHandleParamsExtension `query:"extension,omitzero" json:"-"`
	// PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.
	Pdf ParseHandleParamsPdf `query:"pdf,omitzero" json:"-"`
	// Comma-separated labels for filtering usage, e.g. `production,team-alpha`.
	Tags []string `query:"tags,omitzero" json:"-"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr ParseHandleParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ParseHandleParams) MarshalMultipart added in v2.3.0

func (r ParseHandleParams) MarshalMultipart() (data []byte, contentType string, err error)

func (ParseHandleParams) URLQuery added in v2.3.0

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

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

type ParseHandleParamsExtension added in v2.4.0

type ParseHandleParamsExtension string

Optional file extension hint, such as pdf, docx, xlsx, pptx, html, json, csv, md, py, rtf, jpg, png, or txt.

const (
	ParseHandleParamsExtensionTxt      ParseHandleParamsExtension = "txt"
	ParseHandleParamsExtensionText     ParseHandleParamsExtension = "text"
	ParseHandleParamsExtensionMd       ParseHandleParamsExtension = "md"
	ParseHandleParamsExtensionMarkdown ParseHandleParamsExtension = "markdown"
	ParseHandleParamsExtensionHTML     ParseHandleParamsExtension = "html"
	ParseHandleParamsExtensionHtm      ParseHandleParamsExtension = "htm"
	ParseHandleParamsExtensionXhtml    ParseHandleParamsExtension = "xhtml"
	ParseHandleParamsExtensionXml      ParseHandleParamsExtension = "xml"
	ParseHandleParamsExtensionRss      ParseHandleParamsExtension = "rss"
	ParseHandleParamsExtensionAtom     ParseHandleParamsExtension = "atom"
	ParseHandleParamsExtensionCsv      ParseHandleParamsExtension = "csv"
	ParseHandleParamsExtensionTsv      ParseHandleParamsExtension = "tsv"
	ParseHandleParamsExtensionYaml     ParseHandleParamsExtension = "yaml"
	ParseHandleParamsExtensionYml      ParseHandleParamsExtension = "yml"
	ParseHandleParamsExtensionPy       ParseHandleParamsExtension = "py"
	ParseHandleParamsExtensionJava     ParseHandleParamsExtension = "java"
	ParseHandleParamsExtensionJs       ParseHandleParamsExtension = "js"
	ParseHandleParamsExtensionJsx      ParseHandleParamsExtension = "jsx"
	ParseHandleParamsExtensionMjs      ParseHandleParamsExtension = "mjs"
	ParseHandleParamsExtensionCjs      ParseHandleParamsExtension = "cjs"
	ParseHandleParamsExtensionJson     ParseHandleParamsExtension = "json"
	ParseHandleParamsExtensionJSONL    ParseHandleParamsExtension = "jsonl"
	ParseHandleParamsExtensionNdjson   ParseHandleParamsExtension = "ndjson"
	ParseHandleParamsExtensionPhp      ParseHandleParamsExtension = "php"
	ParseHandleParamsExtensionSh       ParseHandleParamsExtension = "sh"
	ParseHandleParamsExtensionBash     ParseHandleParamsExtension = "bash"
	ParseHandleParamsExtensionZsh      ParseHandleParamsExtension = "zsh"
	ParseHandleParamsExtensionFish     ParseHandleParamsExtension = "fish"
	ParseHandleParamsExtensionRb       ParseHandleParamsExtension = "rb"
	ParseHandleParamsExtensionTs       ParseHandleParamsExtension = "ts"
	ParseHandleParamsExtensionTsx      ParseHandleParamsExtension = "tsx"
	ParseHandleParamsExtensionRtf      ParseHandleParamsExtension = "rtf"
	ParseHandleParamsExtensionSrt      ParseHandleParamsExtension = "srt"
	ParseHandleParamsExtensionCss      ParseHandleParamsExtension = "css"
	ParseHandleParamsExtensionScss     ParseHandleParamsExtension = "scss"
	ParseHandleParamsExtensionLess     ParseHandleParamsExtension = "less"
	ParseHandleParamsExtensionStyl     ParseHandleParamsExtension = "styl"
	ParseHandleParamsExtensionSass     ParseHandleParamsExtension = "sass"
	ParseHandleParamsExtensionSvg      ParseHandleParamsExtension = "svg"
	ParseHandleParamsExtensionPdf      ParseHandleParamsExtension = "pdf"
	ParseHandleParamsExtensionDocx     ParseHandleParamsExtension = "docx"
	ParseHandleParamsExtensionDoc      ParseHandleParamsExtension = "doc"
	ParseHandleParamsExtensionXlsx     ParseHandleParamsExtension = "xlsx"
	ParseHandleParamsExtensionXlsm     ParseHandleParamsExtension = "xlsm"
	ParseHandleParamsExtensionXlsb     ParseHandleParamsExtension = "xlsb"
	ParseHandleParamsExtensionXltx     ParseHandleParamsExtension = "xltx"
	ParseHandleParamsExtensionXltm     ParseHandleParamsExtension = "xltm"
	ParseHandleParamsExtensionXls      ParseHandleParamsExtension = "xls"
	ParseHandleParamsExtensionPptx     ParseHandleParamsExtension = "pptx"
	ParseHandleParamsExtensionPptm     ParseHandleParamsExtension = "pptm"
	ParseHandleParamsExtensionPpsx     ParseHandleParamsExtension = "ppsx"
	ParseHandleParamsExtensionPpsm     ParseHandleParamsExtension = "ppsm"
	ParseHandleParamsExtensionPotx     ParseHandleParamsExtension = "potx"
	ParseHandleParamsExtensionPotm     ParseHandleParamsExtension = "potm"
	ParseHandleParamsExtensionPpt      ParseHandleParamsExtension = "ppt"
	ParseHandleParamsExtensionPps      ParseHandleParamsExtension = "pps"
	ParseHandleParamsExtensionPot      ParseHandleParamsExtension = "pot"
	ParseHandleParamsExtensionJpg      ParseHandleParamsExtension = "jpg"
	ParseHandleParamsExtensionJpeg     ParseHandleParamsExtension = "jpeg"
	ParseHandleParamsExtensionJpe      ParseHandleParamsExtension = "jpe"
	ParseHandleParamsExtensionPng      ParseHandleParamsExtension = "png"
	ParseHandleParamsExtensionGif      ParseHandleParamsExtension = "gif"
	ParseHandleParamsExtensionBmp      ParseHandleParamsExtension = "bmp"
	ParseHandleParamsExtensionTiff     ParseHandleParamsExtension = "tiff"
	ParseHandleParamsExtensionTif      ParseHandleParamsExtension = "tif"
	ParseHandleParamsExtensionWebp     ParseHandleParamsExtension = "webp"
	ParseHandleParamsExtensionPpm      ParseHandleParamsExtension = "ppm"
	ParseHandleParamsExtensionPbm      ParseHandleParamsExtension = "pbm"
	ParseHandleParamsExtensionPgm      ParseHandleParamsExtension = "pgm"
	ParseHandleParamsExtensionPnm      ParseHandleParamsExtension = "pnm"
)

type ParseHandleParamsPdf added in v2.4.0

type ParseHandleParamsPdf struct {
	// Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must
	// be >= start.
	End param.Opt[int64] `query:"end,omitzero" json:"-"`
	// First 1-based PDF page to parse.
	Start param.Opt[int64] `query:"start,omitzero" json:"-"`
	// contains filtered or unexported fields
}

PDF page-range options as a JSON object, e.g. {"start": 2, "end": 5}.

func (ParseHandleParamsPdf) URLQuery added in v2.4.0

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

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

type ParseHandleParamsZdr added in v2.5.0

type ParseHandleParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	ParseHandleParamsZdrEnabled  ParseHandleParamsZdr = "enabled"
	ParseHandleParamsZdrDisabled ParseHandleParamsZdr = "disabled"
)

type ParseHandleResponse added in v2.3.0

type ParseHandleResponse struct {
	// Input bytes converted to GitHub Flavored Markdown
	Markdown string `json:"markdown" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Indicates success
	//
	// Any of true.
	Success bool `json:"success" api:"required"`
	// Detected content type used for parsing
	//
	// Any of "html", "xml", "json", "jsonl", "text", "csv", "tsv", "markdown", "yaml",
	// "python", "java", "javascript", "php", "shell", "ruby", "typescript", "rtf",
	// "srt", "css", "scss", "less", "stylus", "sass", "svg", "pdf", "docx", "doc",
	// "xlsx", "xls", "pptx", "ppt", "jpg", "png", "gif", "bmp", "tiff", "webp", "ppm",
	// "pbm", "pgm", "pnm".
	Type ParseHandleResponseType `json:"type" api:"required"`
	// Credits this request used and your remaining balance.
	KeyMetadata ParseHandleResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Markdown    respjson.Field
		RequestID   respjson.Field
		Success     respjson.Field
		Type        respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ParseHandleResponse) RawJSON added in v2.3.0

func (r ParseHandleResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ParseHandleResponse) UnmarshalJSON added in v2.3.0

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

type ParseHandleResponseKeyMetadata added in v2.3.0

type ParseHandleResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (ParseHandleResponseKeyMetadata) RawJSON added in v2.3.0

Returns the unmodified JSON received from the API

func (*ParseHandleResponseKeyMetadata) UnmarshalJSON added in v2.3.0

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

type ParseHandleResponseType added in v2.3.0

type ParseHandleResponseType string

Detected content type used for parsing

const (
	ParseHandleResponseTypeHTML       ParseHandleResponseType = "html"
	ParseHandleResponseTypeXml        ParseHandleResponseType = "xml"
	ParseHandleResponseTypeJson       ParseHandleResponseType = "json"
	ParseHandleResponseTypeJSONL      ParseHandleResponseType = "jsonl"
	ParseHandleResponseTypeText       ParseHandleResponseType = "text"
	ParseHandleResponseTypeCsv        ParseHandleResponseType = "csv"
	ParseHandleResponseTypeTsv        ParseHandleResponseType = "tsv"
	ParseHandleResponseTypeMarkdown   ParseHandleResponseType = "markdown"
	ParseHandleResponseTypeYaml       ParseHandleResponseType = "yaml"
	ParseHandleResponseTypePython     ParseHandleResponseType = "python"
	ParseHandleResponseTypeJava       ParseHandleResponseType = "java"
	ParseHandleResponseTypeJavascript ParseHandleResponseType = "javascript"
	ParseHandleResponseTypePhp        ParseHandleResponseType = "php"
	ParseHandleResponseTypeShell      ParseHandleResponseType = "shell"
	ParseHandleResponseTypeRuby       ParseHandleResponseType = "ruby"
	ParseHandleResponseTypeTypescript ParseHandleResponseType = "typescript"
	ParseHandleResponseTypeRtf        ParseHandleResponseType = "rtf"
	ParseHandleResponseTypeSrt        ParseHandleResponseType = "srt"
	ParseHandleResponseTypeCss        ParseHandleResponseType = "css"
	ParseHandleResponseTypeScss       ParseHandleResponseType = "scss"
	ParseHandleResponseTypeLess       ParseHandleResponseType = "less"
	ParseHandleResponseTypeStylus     ParseHandleResponseType = "stylus"
	ParseHandleResponseTypeSass       ParseHandleResponseType = "sass"
	ParseHandleResponseTypeSvg        ParseHandleResponseType = "svg"
	ParseHandleResponseTypePdf        ParseHandleResponseType = "pdf"
	ParseHandleResponseTypeDocx       ParseHandleResponseType = "docx"
	ParseHandleResponseTypeDoc        ParseHandleResponseType = "doc"
	ParseHandleResponseTypeXlsx       ParseHandleResponseType = "xlsx"
	ParseHandleResponseTypeXls        ParseHandleResponseType = "xls"
	ParseHandleResponseTypePptx       ParseHandleResponseType = "pptx"
	ParseHandleResponseTypePpt        ParseHandleResponseType = "ppt"
	ParseHandleResponseTypeJpg        ParseHandleResponseType = "jpg"
	ParseHandleResponseTypePng        ParseHandleResponseType = "png"
	ParseHandleResponseTypeGif        ParseHandleResponseType = "gif"
	ParseHandleResponseTypeBmp        ParseHandleResponseType = "bmp"
	ParseHandleResponseTypeTiff       ParseHandleResponseType = "tiff"
	ParseHandleResponseTypeWebp       ParseHandleResponseType = "webp"
	ParseHandleResponseTypePpm        ParseHandleResponseType = "ppm"
	ParseHandleResponseTypePbm        ParseHandleResponseType = "pbm"
	ParseHandleResponseTypePgm        ParseHandleResponseType = "pgm"
	ParseHandleResponseTypePnm        ParseHandleResponseType = "pnm"
)

type ParseService added in v2.3.0

type ParseService struct {
	// contains filtered or unexported fields
}

ParseService contains methods and other services that help with interacting with the context.dev 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 NewParseService method instead.

func NewParseService added in v2.3.0

func NewParseService(opts ...option.RequestOption) (r ParseService)

NewParseService 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 (*ParseService) Handle added in v2.3.0

func (r *ParseService) Handle(ctx context.Context, body io.Reader, params ParseHandleParams, opts ...option.RequestOption) (res *ParseHandleResponse, err error)

Convert uploaded file bytes into Markdown and optional HTML.

type PersonEnrichParams added in v2.9.0

type PersonEnrichParams struct {
	// Email address of the person to find.
	Email param.Opt[string] `json:"email,omitzero" format:"email"`
	// Company context to help identify the person. Provide a name or domain.
	Company PersonEnrichParamsCompany `json:"company,omitzero"`
	// Education history to help distinguish people with similar names.
	Education []PersonEnrichParamsEducation `json:"education,omitzero"`
	// Location context to help identify the person. Provide a city, region, or
	// country.
	Location PersonEnrichParamsLocation `json:"location,omitzero"`
	// Person name. Without an email or person-profile URL, provide both first and last
	// name plus company, education, or location.
	Name PersonEnrichParamsName `json:"name,omitzero"`
	// Public profile URLs for the person. A person-profile URL can identify the person
	// without a name.
	SocialURLs []string `json:"social_urls,omitzero" format:"uri"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts PersonEnrichParamsTimeoutOpts `json:"timeoutOpts,omitzero"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr PersonEnrichParamsZdr `json:"zdr,omitzero"`
	// contains filtered or unexported fields
}

func (PersonEnrichParams) MarshalJSON added in v2.9.0

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

func (*PersonEnrichParams) UnmarshalJSON added in v2.9.0

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

type PersonEnrichParamsCompany added in v2.9.0

type PersonEnrichParamsCompany struct {
	// Website domain of a company associated with the person.
	Domain param.Opt[string] `json:"domain,omitzero"`
	// Name of a company associated with the person.
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

Company context to help identify the person. Provide a name or domain.

func (PersonEnrichParamsCompany) MarshalJSON added in v2.9.0

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

func (*PersonEnrichParamsCompany) UnmarshalJSON added in v2.9.0

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

type PersonEnrichParamsEducation added in v2.9.0

type PersonEnrichParamsEducation struct {
	// Degree or qualification earned.
	Degree param.Opt[string] `json:"degree,omitzero"`
	// Subject or major studied.
	FieldOfStudy param.Opt[string] `json:"field_of_study,omitzero"`
	// Four-digit graduation year.
	GraduationYear param.Opt[int64] `json:"graduation_year,omitzero"`
	// School or university, identified by name or domain.
	Institution PersonEnrichParamsEducationInstitution `json:"institution,omitzero"`
	// contains filtered or unexported fields
}

func (PersonEnrichParamsEducation) MarshalJSON added in v2.9.0

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

func (*PersonEnrichParamsEducation) UnmarshalJSON added in v2.9.0

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

type PersonEnrichParamsEducationInstitution added in v2.9.0

type PersonEnrichParamsEducationInstitution struct {
	// Website domain of the school or university.
	Domain param.Opt[string] `json:"domain,omitzero"`
	// Name of the school or university.
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

School or university, identified by name or domain.

func (PersonEnrichParamsEducationInstitution) MarshalJSON added in v2.9.0

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

func (*PersonEnrichParamsEducationInstitution) UnmarshalJSON added in v2.9.0

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

type PersonEnrichParamsLocation added in v2.9.0

type PersonEnrichParamsLocation struct {
	// City associated with the person.
	City param.Opt[string] `json:"city,omitzero"`
	// Country associated with the person.
	Country param.Opt[string] `json:"country,omitzero"`
	// State, province, or region associated with the person.
	Region param.Opt[string] `json:"region,omitzero"`
	// contains filtered or unexported fields
}

Location context to help identify the person. Provide a city, region, or country.

func (PersonEnrichParamsLocation) MarshalJSON added in v2.9.0

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

func (*PersonEnrichParamsLocation) UnmarshalJSON added in v2.9.0

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

type PersonEnrichParamsName added in v2.9.0

type PersonEnrichParamsName struct {
	// First or given name.
	First param.Opt[string] `json:"first,omitzero"`
	// Last or family name.
	Last param.Opt[string] `json:"last,omitzero"`
	// contains filtered or unexported fields
}

Person name. Without an email or person-profile URL, provide both first and last name plus company, education, or location.

func (PersonEnrichParamsName) MarshalJSON added in v2.9.0

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

func (*PersonEnrichParamsName) UnmarshalJSON added in v2.9.0

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

type PersonEnrichParamsTimeoutOpts added in v2.17.0

type PersonEnrichParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (PersonEnrichParamsTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*PersonEnrichParamsTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type PersonEnrichParamsZdr added in v2.18.0

type PersonEnrichParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	PersonEnrichParamsZdrEnabled  PersonEnrichParamsZdr = "enabled"
	PersonEnrichParamsZdrDisabled PersonEnrichParamsZdr = "disabled"
)

type PersonEnrichResponse added in v2.9.0

type PersonEnrichResponse struct {
	// The highest-scoring person candidate.
	Match PersonEnrichResponseMatchUnion `json:"match" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata PersonEnrichResponseKeyMetadata `json:"key_metadata"`
	// True when the timeout ended processing and this response contains the usable
	// data completed so far. Unfinished fields are omitted.
	Partial bool `json:"partial"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Match       respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		Partial     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponse) RawJSON added in v2.9.0

func (r PersonEnrichResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*PersonEnrichResponse) UnmarshalJSON added in v2.9.0

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

type PersonEnrichResponseKeyMetadata added in v2.9.0

type PersonEnrichResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (PersonEnrichResponseKeyMetadata) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseKeyMetadata) UnmarshalJSON added in v2.9.0

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

type PersonEnrichResponseMatchCandidate added in v2.9.0

type PersonEnrichResponseMatchCandidate struct {
	Person PersonEnrichResponseMatchCandidatePerson `json:"person" api:"required"`
	Score  int64                                    `json:"score" api:"required"`
	Status constant.Candidate                       `json:"status" default:"candidate"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Person      respjson.Field
		Score       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The highest-scoring person candidate.

func (PersonEnrichResponseMatchCandidate) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidate) UnmarshalJSON added in v2.9.0

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

type PersonEnrichResponseMatchCandidatePerson added in v2.9.0

type PersonEnrichResponseMatchCandidatePerson struct {
	// Whether the person's current role is known. `present` — current_role is
	// populated. `none` — the work history explicitly shows every role has ended.
	// `unknown` — our data sources could not confirm either way; treat a missing
	// current_role as unverified rather than vacant.
	//
	// Any of "present", "none", "unknown".
	CurrentRoleStatus string                                               `json:"current_role_status" api:"required"`
	Education         []PersonEnrichResponseMatchCandidatePersonEducation  `json:"education" api:"required"`
	Experience        []PersonEnrichResponseMatchCandidatePersonExperience `json:"experience" api:"required"`
	Skills            []string                                             `json:"skills" api:"required"`
	SocialURLs        []string                                             `json:"social_urls" api:"required" format:"uri"`
	WebsiteURLs       []string                                             `json:"website_urls" api:"required" format:"uri"`
	AvatarURL         string                                               `json:"avatar_url"`
	Bio               string                                               `json:"bio"`
	// When we last refreshed this profile from our data sources (ISO 8601).
	CheckedAt   string                                              `json:"checked_at"`
	CurrentRole PersonEnrichResponseMatchCandidatePersonCurrentRole `json:"current_role"`
	Email       string                                              `json:"email" format:"email"`
	// When the underlying profile data last changed in our data sources (ISO 8601).
	// Omitted when unknown.
	LastUpdated string                                           `json:"last_updated"`
	Location    PersonEnrichResponseMatchCandidatePersonLocation `json:"location"`
	Name        PersonEnrichResponseMatchCandidatePersonName     `json:"name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CurrentRoleStatus respjson.Field
		Education         respjson.Field
		Experience        respjson.Field
		Skills            respjson.Field
		SocialURLs        respjson.Field
		WebsiteURLs       respjson.Field
		AvatarURL         respjson.Field
		Bio               respjson.Field
		CheckedAt         respjson.Field
		CurrentRole       respjson.Field
		Email             respjson.Field
		LastUpdated       respjson.Field
		Location          respjson.Field
		Name              respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePerson) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePerson) UnmarshalJSON added in v2.9.0

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

type PersonEnrichResponseMatchCandidatePersonCurrentRole added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonCurrentRole struct {
	Organization PersonEnrichResponseMatchCandidatePersonCurrentRoleOrganization `json:"organization" api:"required"`
	Title        string                                                          `json:"title" api:"required"`
	Description  string                                                          `json:"description"`
	EndDate      PersonEnrichResponseMatchCandidatePersonCurrentRoleEndDate      `json:"end_date"`
	IsCurrent    bool                                                            `json:"is_current"`
	Location     string                                                          `json:"location"`
	StartDate    PersonEnrichResponseMatchCandidatePersonCurrentRoleStartDate    `json:"start_date"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Organization respjson.Field
		Title        respjson.Field
		Description  respjson.Field
		EndDate      respjson.Field
		IsCurrent    respjson.Field
		Location     respjson.Field
		StartDate    respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonCurrentRole) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonCurrentRole) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonCurrentRoleEndDate added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonCurrentRoleEndDate struct {
	Year  int64 `json:"year" api:"required"`
	Day   int64 `json:"day"`
	Month int64 `json:"month"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Year        respjson.Field
		Day         respjson.Field
		Month       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonCurrentRoleEndDate) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonCurrentRoleEndDate) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonCurrentRoleOrganization added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonCurrentRoleOrganization struct {
	Name   string `json:"name" api:"required"`
	Domain string `json:"domain"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Domain      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonCurrentRoleOrganization) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonCurrentRoleOrganization) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonCurrentRoleStartDate added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonCurrentRoleStartDate struct {
	Year  int64 `json:"year" api:"required"`
	Day   int64 `json:"day"`
	Month int64 `json:"month"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Year        respjson.Field
		Day         respjson.Field
		Month       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonCurrentRoleStartDate) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonCurrentRoleStartDate) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonEducation added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonEducation struct {
	Institution  PersonEnrichResponseMatchCandidatePersonEducationInstitution `json:"institution" api:"required"`
	Degree       string                                                       `json:"degree"`
	Description  string                                                       `json:"description"`
	EndDate      PersonEnrichResponseMatchCandidatePersonEducationEndDate     `json:"end_date"`
	FieldOfStudy string                                                       `json:"field_of_study"`
	StartDate    PersonEnrichResponseMatchCandidatePersonEducationStartDate   `json:"start_date"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Institution  respjson.Field
		Degree       respjson.Field
		Description  respjson.Field
		EndDate      respjson.Field
		FieldOfStudy respjson.Field
		StartDate    respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonEducation) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonEducation) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonEducationEndDate added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonEducationEndDate struct {
	Year  int64 `json:"year" api:"required"`
	Day   int64 `json:"day"`
	Month int64 `json:"month"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Year        respjson.Field
		Day         respjson.Field
		Month       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonEducationEndDate) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonEducationEndDate) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonEducationInstitution added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonEducationInstitution struct {
	Name   string `json:"name" api:"required"`
	Domain string `json:"domain"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Domain      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonEducationInstitution) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonEducationInstitution) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonEducationStartDate added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonEducationStartDate struct {
	Year  int64 `json:"year" api:"required"`
	Day   int64 `json:"day"`
	Month int64 `json:"month"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Year        respjson.Field
		Day         respjson.Field
		Month       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonEducationStartDate) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonEducationStartDate) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonExperience added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonExperience struct {
	Organization PersonEnrichResponseMatchCandidatePersonExperienceOrganization `json:"organization" api:"required"`
	Title        string                                                         `json:"title" api:"required"`
	Description  string                                                         `json:"description"`
	EndDate      PersonEnrichResponseMatchCandidatePersonExperienceEndDate      `json:"end_date"`
	IsCurrent    bool                                                           `json:"is_current"`
	Location     string                                                         `json:"location"`
	StartDate    PersonEnrichResponseMatchCandidatePersonExperienceStartDate    `json:"start_date"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Organization respjson.Field
		Title        respjson.Field
		Description  respjson.Field
		EndDate      respjson.Field
		IsCurrent    respjson.Field
		Location     respjson.Field
		StartDate    respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonExperience) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonExperience) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonExperienceEndDate added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonExperienceEndDate struct {
	Year  int64 `json:"year" api:"required"`
	Day   int64 `json:"day"`
	Month int64 `json:"month"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Year        respjson.Field
		Day         respjson.Field
		Month       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonExperienceEndDate) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonExperienceEndDate) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonExperienceOrganization added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonExperienceOrganization struct {
	Name   string `json:"name" api:"required"`
	Domain string `json:"domain"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		Domain      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonExperienceOrganization) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonExperienceOrganization) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonExperienceStartDate added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonExperienceStartDate struct {
	Year  int64 `json:"year" api:"required"`
	Day   int64 `json:"day"`
	Month int64 `json:"month"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Year        respjson.Field
		Day         respjson.Field
		Month       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonExperienceStartDate) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonExperienceStartDate) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonLocation added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonLocation struct {
	City        string `json:"city"`
	Country     string `json:"country"`
	CountryCode string `json:"country_code"`
	Display     string `json:"display"`
	Region      string `json:"region"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		City        respjson.Field
		Country     respjson.Field
		CountryCode respjson.Field
		Display     respjson.Field
		Region      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonLocation) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonLocation) UnmarshalJSON added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonName added in v2.9.0

type PersonEnrichResponseMatchCandidatePersonName struct {
	First string `json:"first"`
	Full  string `json:"full"`
	Last  string `json:"last"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		First       respjson.Field
		Full        respjson.Field
		Last        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (PersonEnrichResponseMatchCandidatePersonName) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchCandidatePersonName) UnmarshalJSON added in v2.9.0

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

type PersonEnrichResponseMatchNotFound added in v2.9.0

type PersonEnrichResponseMatchNotFound struct {
	Person any               `json:"person" api:"required"`
	Score  any               `json:"score" api:"required"`
	Status constant.NotFound `json:"status" default:"not_found"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Person      respjson.Field
		Score       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

No usable person candidate was found.

func (PersonEnrichResponseMatchNotFound) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchNotFound) UnmarshalJSON added in v2.9.0

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

type PersonEnrichResponseMatchUnion added in v2.9.0

type PersonEnrichResponseMatchUnion struct {
	// This field is a union of [PersonEnrichResponseMatchCandidatePerson], [any]
	Person PersonEnrichResponseMatchUnionPerson `json:"person"`
	// This field is a union of [int64], [any]
	Score PersonEnrichResponseMatchUnionScore `json:"score"`
	// Any of "candidate", "not_found".
	Status string `json:"status"`
	JSON   struct {
		Person respjson.Field
		Score  respjson.Field
		Status respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

PersonEnrichResponseMatchUnion contains all possible properties and values from PersonEnrichResponseMatchCandidate, PersonEnrichResponseMatchNotFound.

Use the PersonEnrichResponseMatchUnion.AsAny method to switch on the variant.

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

func (PersonEnrichResponseMatchUnion) AsAny added in v2.9.0

func (u PersonEnrichResponseMatchUnion) AsAny() anyPersonEnrichResponseMatch

Use the following switch statement to find the correct variant

switch variant := PersonEnrichResponseMatchUnion.AsAny().(type) {
case contextdev.PersonEnrichResponseMatchCandidate:
case contextdev.PersonEnrichResponseMatchNotFound:
default:
  fmt.Errorf("no variant present")
}

func (PersonEnrichResponseMatchUnion) AsCandidate added in v2.9.0

func (PersonEnrichResponseMatchUnion) AsNotFound added in v2.9.0

func (PersonEnrichResponseMatchUnion) RawJSON added in v2.9.0

Returns the unmodified JSON received from the API

func (*PersonEnrichResponseMatchUnion) UnmarshalJSON added in v2.9.0

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

type PersonEnrichResponseMatchUnionPerson added in v2.9.0

type PersonEnrichResponseMatchUnionPerson struct {
	// This field will be present if the value is a [any] instead of an object.
	OfPersonEnrichResponseMatchNotFoundPerson any `json:",inline"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	CurrentRoleStatus string `json:"current_role_status"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	Education []PersonEnrichResponseMatchCandidatePersonEducation `json:"education"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	Experience []PersonEnrichResponseMatchCandidatePersonExperience `json:"experience"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	Skills []string `json:"skills"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	SocialURLs []string `json:"social_urls"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	WebsiteURLs []string `json:"website_urls"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	AvatarURL string `json:"avatar_url"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	Bio string `json:"bio"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	CheckedAt string `json:"checked_at"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	CurrentRole PersonEnrichResponseMatchCandidatePersonCurrentRole `json:"current_role"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	Email string `json:"email"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	LastUpdated string `json:"last_updated"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	Location PersonEnrichResponseMatchCandidatePersonLocation `json:"location"`
	// This field is from variant [PersonEnrichResponseMatchCandidatePerson].
	Name PersonEnrichResponseMatchCandidatePersonName `json:"name"`
	JSON struct {
		OfPersonEnrichResponseMatchNotFoundPerson respjson.Field
		CurrentRoleStatus                         respjson.Field
		Education                                 respjson.Field
		Experience                                respjson.Field
		Skills                                    respjson.Field
		SocialURLs                                respjson.Field
		WebsiteURLs                               respjson.Field
		AvatarURL                                 respjson.Field
		Bio                                       respjson.Field
		CheckedAt                                 respjson.Field
		CurrentRole                               respjson.Field
		Email                                     respjson.Field
		LastUpdated                               respjson.Field
		Location                                  respjson.Field
		Name                                      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

PersonEnrichResponseMatchUnionPerson is an implicit subunion of PersonEnrichResponseMatchUnion. PersonEnrichResponseMatchUnionPerson provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the PersonEnrichResponseMatchUnion.

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

func (*PersonEnrichResponseMatchUnionPerson) UnmarshalJSON added in v2.9.0

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

type PersonEnrichResponseMatchUnionScore added in v2.9.0

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

PersonEnrichResponseMatchUnionScore is an implicit subunion of PersonEnrichResponseMatchUnion. PersonEnrichResponseMatchUnionScore provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the PersonEnrichResponseMatchUnion.

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

func (*PersonEnrichResponseMatchUnionScore) UnmarshalJSON added in v2.9.0

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

type PersonService added in v2.9.0

type PersonService struct {
	// contains filtered or unexported fields
}

PersonService contains methods and other services that help with interacting with the context.dev 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 NewPersonService method instead.

func NewPersonService added in v2.9.0

func NewPersonService(opts ...option.RequestOption) (r PersonService)

NewPersonService 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 (*PersonService) Enrich added in v2.9.0

Find a person from identity clues and return their profile with a match score. Requires a paid plan; free or disposable email addresses return 422.

type RetryConfig added in v2.15.0

type RetryConfig struct {
	// Retry delays in seconds, totaling at most 72 hours. Use [] to disable automatic
	// retries.
	DelaysSeconds []int64 `json:"delays_seconds"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DelaysSeconds respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Webhook retry settings. Use {} for the default schedule.

func (RetryConfig) RawJSON added in v2.15.0

func (r RetryConfig) RawJSON() string

Returns the unmodified JSON received from the API

func (RetryConfig) ToParam added in v2.15.0

func (r RetryConfig) ToParam() RetryConfigParam

ToParam converts this RetryConfig to a RetryConfigParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with RetryConfigParam.Overrides()

func (*RetryConfig) UnmarshalJSON added in v2.15.0

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

type RetryConfigParam added in v2.15.0

type RetryConfigParam struct {
	// Retry delays in seconds, totaling at most 72 hours. Use [] to disable automatic
	// retries.
	DelaysSeconds []int64 `json:"delays_seconds,omitzero"`
	// contains filtered or unexported fields
}

Webhook retry settings. Use {} for the default schedule.

func (RetryConfigParam) MarshalJSON added in v2.15.0

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

func (*RetryConfigParam) UnmarshalJSON added in v2.15.0

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

type UtilityPrefetchParams

type UtilityPrefetchParams struct {
	// Identifier of the target to prefetch. Provide exactly one of domain or email.
	Identifier UtilityPrefetchParamsIdentifierUnion `json:"identifier,omitzero" api:"required"`
	// Data to prefetch.
	//
	// Any of "brand", "styleguide".
	Type UtilityPrefetchParamsType `json:"type,omitzero" api:"required"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts UtilityPrefetchParamsTimeoutOpts `json:"timeoutOpts,omitzero"`
	// contains filtered or unexported fields
}

func (UtilityPrefetchParams) MarshalJSON

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

func (*UtilityPrefetchParams) UnmarshalJSON

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

type UtilityPrefetchParamsIdentifierByDomain

type UtilityPrefetchParamsIdentifierByDomain struct {
	// Domain, e.g. `stripe.com`.
	Domain string `json:"domain" api:"required"`
	// contains filtered or unexported fields
}

Prefetch by domain.

The property Domain is required.

func (UtilityPrefetchParamsIdentifierByDomain) MarshalJSON

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

func (*UtilityPrefetchParamsIdentifierByDomain) UnmarshalJSON

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

type UtilityPrefetchParamsIdentifierByEmail

type UtilityPrefetchParamsIdentifierByEmail struct {
	// Email address to prefetch data for. The domain will be extracted from the email.
	// Free email providers (gmail.com, yahoo.com, etc.) and disposable email addresses
	// are not allowed.
	Email string `json:"email" api:"required" format:"email"`
	// contains filtered or unexported fields
}

Prefetch by email. The domain will be extracted and validated.

The property Email is required.

func (UtilityPrefetchParamsIdentifierByEmail) MarshalJSON

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

func (*UtilityPrefetchParamsIdentifierByEmail) UnmarshalJSON

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

type UtilityPrefetchParamsIdentifierUnion

type UtilityPrefetchParamsIdentifierUnion struct {
	OfByDomain *UtilityPrefetchParamsIdentifierByDomain `json:",omitzero,inline"`
	OfByEmail  *UtilityPrefetchParamsIdentifierByEmail  `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (UtilityPrefetchParamsIdentifierUnion) MarshalJSON

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

func (*UtilityPrefetchParamsIdentifierUnion) UnmarshalJSON

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

type UtilityPrefetchParamsTimeoutOpts added in v2.17.0

type UtilityPrefetchParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// Only "fail" is supported: return 408 at the deadline.
	//
	// Any of "fail".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (UtilityPrefetchParamsTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*UtilityPrefetchParamsTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type UtilityPrefetchParamsType

type UtilityPrefetchParamsType string

Data to prefetch.

const (
	UtilityPrefetchParamsTypeBrand      UtilityPrefetchParamsType = "brand"
	UtilityPrefetchParamsTypeStyleguide UtilityPrefetchParamsType = "styleguide"
)

type UtilityPrefetchResponse

type UtilityPrefetchResponse struct {
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// The domain that was queued for prefetching
	Domain string `json:"domain"`
	// Credits this request used and your remaining balance.
	KeyMetadata UtilityPrefetchResponseKeyMetadata `json:"key_metadata"`
	// Success message
	Message string `json:"message"`
	// Always `ok` on success.
	Status string `json:"status"`
	// The type of prefetch that was queued, echoed from the request
	//
	// Any of "brand", "styleguide".
	Type UtilityPrefetchResponseType `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		Domain      respjson.Field
		KeyMetadata respjson.Field
		Message     respjson.Field
		Status      respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UtilityPrefetchResponse) RawJSON

func (r UtilityPrefetchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*UtilityPrefetchResponse) UnmarshalJSON

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

type UtilityPrefetchResponseKeyMetadata

type UtilityPrefetchResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (UtilityPrefetchResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*UtilityPrefetchResponseKeyMetadata) UnmarshalJSON

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

type UtilityPrefetchResponseType

type UtilityPrefetchResponseType string

The type of prefetch that was queued, echoed from the request

const (
	UtilityPrefetchResponseTypeBrand      UtilityPrefetchResponseType = "brand"
	UtilityPrefetchResponseTypeStyleguide UtilityPrefetchResponseType = "styleguide"
)

type UtilityService

type UtilityService struct {
	// contains filtered or unexported fields
}

UtilityService contains methods and other services that help with interacting with the context.dev 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 NewUtilityService method instead.

func NewUtilityService

func NewUtilityService(opts ...option.RequestOption) (r UtilityService)

NewUtilityService 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 (*UtilityService) Prefetch

Queue brand or styleguide data so a later lookup can return sooner.

type WebAnswersParams added in v2.17.0

type WebAnswersParams struct {
	// Research task. The agent selects company/profile lookups, web searches, or page
	// reads. Include domains or URLs to focus the research.
	Task string `json:"task" api:"required"`
	// Example answer object, not JSON Schema. Up to 8 levels, 500 values, and 16000
	// characters; unknowns may be null.
	JsonFormat map[string]any `json:"json_format,omitzero"`
	// `fast` prioritizes speed, with extra verification for people and companies;
	// `ultra` supports deeper research (default).
	//
	// Any of "fast", "ultra".
	Mode WebAnswersParamsMode `json:"mode,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts WebAnswersParamsTimeoutOpts `json:"timeoutOpts,omitzero"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr WebAnswersParamsZdr `json:"zdr,omitzero"`
	// contains filtered or unexported fields
}

func (WebAnswersParams) MarshalJSON added in v2.17.0

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

func (*WebAnswersParams) UnmarshalJSON added in v2.17.0

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

type WebAnswersParamsMode added in v2.17.0

type WebAnswersParamsMode string

`fast` prioritizes speed, with extra verification for people and companies; `ultra` supports deeper research (default).

const (
	WebAnswersParamsModeFast  WebAnswersParamsMode = "fast"
	WebAnswersParamsModeUltra WebAnswersParamsMode = "ultra"
)

type WebAnswersParamsTimeoutOpts added in v2.17.0

type WebAnswersParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (WebAnswersParamsTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*WebAnswersParamsTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type WebAnswersParamsZdr added in v2.18.0

type WebAnswersParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	WebAnswersParamsZdrEnabled  WebAnswersParamsZdr = "enabled"
	WebAnswersParamsZdrDisabled WebAnswersParamsZdr = "disabled"
)

type WebAnswersResponse added in v2.17.0

type WebAnswersResponse struct {
	// The answer, in the shape requested by json_format.
	JsonContent map[string]any `json:"json_content" api:"required"`
	// URLs of the pages and company/profile records read for the answer, followed by
	// URLs cited in json_content.
	Sources []string `json:"sources" api:"required"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebAnswersResponseKeyMetadata `json:"key_metadata"`
	// True when the request deadline ended research and the answer uses the evidence
	// collected so far.
	Partial bool `json:"partial"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		JsonContent respjson.Field
		Sources     respjson.Field
		KeyMetadata respjson.Field
		Partial     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebAnswersResponse) RawJSON added in v2.17.0

func (r WebAnswersResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebAnswersResponse) UnmarshalJSON added in v2.17.0

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

type WebAnswersResponseKeyMetadata added in v2.17.0

type WebAnswersResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebAnswersResponseKeyMetadata) RawJSON added in v2.17.0

Returns the unmodified JSON received from the API

func (*WebAnswersResponseKeyMetadata) UnmarshalJSON added in v2.17.0

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

type WebExtractCompetitorsParams

type WebExtractCompetitorsParams struct {
	// Company domain to analyze, such as `stripe.com`. Full http(s) URLs are accepted
	// and normalized to their domain.
	Domain string `query:"domain" api:"required" json:"-"`
	// Exact number of direct competitors to return. Defaults to 5.
	NumCompetitors param.Opt[int64] `query:"numCompetitors,omitzero" json:"-"`
	// Comma-separated labels for filtering usage, e.g. `production,team-alpha`.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Request deadline and what to return when it passes.
	TimeoutOpts WebExtractCompetitorsParamsTimeoutOpts `query:"timeoutOpts,omitzero" json:"-"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr WebExtractCompetitorsParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebExtractCompetitorsParams) URLQuery

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

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

type WebExtractCompetitorsParamsTimeoutOpts added in v2.17.0

type WebExtractCompetitorsParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `query:"milliseconds" api:"required" json:"-"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `query:"behavior,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (WebExtractCompetitorsParamsTimeoutOpts) URLQuery added in v2.17.0

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

type WebExtractCompetitorsParamsZdr added in v2.18.0

type WebExtractCompetitorsParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	WebExtractCompetitorsParamsZdrEnabled  WebExtractCompetitorsParamsZdr = "enabled"
	WebExtractCompetitorsParamsZdrDisabled WebExtractCompetitorsParamsZdr = "disabled"
)

type WebExtractCompetitorsResponse

type WebExtractCompetitorsResponse struct {
	// Direct competitors ordered by relevance and confidence.
	Competitors []WebExtractCompetitorsResponseCompetitor `json:"competitors" api:"required"`
	// Normalized input domain.
	Domain string `json:"domain" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Status of the response.
	//
	// Any of "ok".
	Status WebExtractCompetitorsResponseStatus `json:"status" api:"required"`
	// Target company profile inferred from the landing page.
	Target WebExtractCompetitorsResponseTarget `json:"target" api:"required"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebExtractCompetitorsResponseKeyMetadata `json:"key_metadata"`
	// True when the timeout ended processing and this response contains only usable
	// results completed so far. Unfinished results are omitted.
	Partial bool `json:"partial"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Competitors respjson.Field
		Domain      respjson.Field
		RequestID   respjson.Field
		Status      respjson.Field
		Target      respjson.Field
		KeyMetadata respjson.Field
		Partial     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractCompetitorsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractCompetitorsResponse) UnmarshalJSON

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

type WebExtractCompetitorsResponseCompetitor

type WebExtractCompetitorsResponseCompetitor struct {
	// Confidence that this company is a direct competitor.
	//
	// Any of "high", "medium".
	Confidence string `json:"confidence" api:"required"`
	// Short description of the competitor.
	Description string `json:"description" api:"required"`
	// Competitor's normalized official domain.
	Domain string `json:"domain" api:"required"`
	// Competitor company or product name.
	Name string `json:"name" api:"required"`
	// Search result URLs used as evidence for this competitor.
	SourceURLs []string `json:"sourceUrls" api:"required"`
	// Competitor website URL.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Confidence  respjson.Field
		Description respjson.Field
		Domain      respjson.Field
		Name        respjson.Field
		SourceURLs  respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractCompetitorsResponseCompetitor) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractCompetitorsResponseCompetitor) UnmarshalJSON

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

type WebExtractCompetitorsResponseKeyMetadata

type WebExtractCompetitorsResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebExtractCompetitorsResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractCompetitorsResponseKeyMetadata) UnmarshalJSON

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

type WebExtractCompetitorsResponseStatus

type WebExtractCompetitorsResponseStatus string

Status of the response.

const (
	WebExtractCompetitorsResponseStatusOk WebExtractCompetitorsResponseStatus = "ok"
)

type WebExtractCompetitorsResponseTarget

type WebExtractCompetitorsResponseTarget struct {
	// Company or product name inferred from the landing page.
	CompanyName string `json:"companyName" api:"required"`
	// Specific operating field, product category, or market.
	Field string `json:"field" api:"required"`
	// One-sentence description of what the target company sells and who it serves.
	FieldDescription string `json:"fieldDescription" api:"required"`
	// Resolved URL used for the landing page analysis.
	WebsiteURL string `json:"websiteUrl" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CompanyName      respjson.Field
		Field            respjson.Field
		FieldDescription respjson.Field
		WebsiteURL       respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Target company profile inferred from the landing page.

func (WebExtractCompetitorsResponseTarget) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractCompetitorsResponseTarget) UnmarshalJSON

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

type WebExtractStyleguideParams

type WebExtractStyleguideParams struct {
	// Maximum age of cached brand data in ms. Defaults to 3 months; clamped to 0–1
	// year. `0` refreshes.
	MaxAgeMs param.Opt[int64] `query:"maxAgeMs,omitzero" json:"-"`
	// Exact URL to inspect. Provide either `domain` or `directUrl`, not both.
	DirectURL param.Opt[string] `query:"directUrl,omitzero" format:"uri" json:"-"`
	// Domain name to extract styleguide from (e.g., 'example.com', 'google.com'). The
	// domain will be automatically normalized and validated. You must provide either
	// 'domain' or 'directUrl', but not both.
	Domain param.Opt[string] `query:"domain,omitzero" json:"-"`
	// Optional browser color scheme to emulate for websites that respond to
	// prefers-color-scheme. This value is part of the styleguide cache key.
	//
	// Any of "light", "dark".
	ColorScheme WebExtractStyleguideParamsColorScheme `query:"colorScheme,omitzero" json:"-"`
	// Comma-separated labels for filtering usage, e.g. `production,team-alpha`.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Request deadline and what to return when it passes.
	TimeoutOpts WebExtractStyleguideParamsTimeoutOpts `query:"timeoutOpts,omitzero" json:"-"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr WebExtractStyleguideParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebExtractStyleguideParams) URLQuery

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

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

type WebExtractStyleguideParamsColorScheme

type WebExtractStyleguideParamsColorScheme string

Optional browser color scheme to emulate for websites that respond to prefers-color-scheme. This value is part of the styleguide cache key.

const (
	WebExtractStyleguideParamsColorSchemeLight WebExtractStyleguideParamsColorScheme = "light"
	WebExtractStyleguideParamsColorSchemeDark  WebExtractStyleguideParamsColorScheme = "dark"
)

type WebExtractStyleguideParamsTimeoutOpts added in v2.17.0

type WebExtractStyleguideParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `query:"milliseconds" api:"required" json:"-"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag. "return-partial" requires at least 5000 ms.
	//
	// Any of "fail", "return-partial".
	Behavior string `query:"behavior,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (WebExtractStyleguideParamsTimeoutOpts) URLQuery added in v2.17.0

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

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

type WebExtractStyleguideParamsZdr added in v2.18.0

type WebExtractStyleguideParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	WebExtractStyleguideParamsZdrEnabled  WebExtractStyleguideParamsZdr = "enabled"
	WebExtractStyleguideParamsZdrDisabled WebExtractStyleguideParamsZdr = "disabled"
)

type WebExtractStyleguideResponse

type WebExtractStyleguideResponse struct {
	// Whether this response came from cache.
	CacheMetadata WebExtractStyleguideResponseCacheMetadata `json:"cache_metadata" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// HTTP status code
	Code int64 `json:"code"`
	// The normalized domain that was processed
	Domain string `json:"domain"`
	// `loaded`, or `still-loading` when capture ended before the page finished
	// loading.
	//
	// Any of "loaded", "still-loading".
	FinalDomState WebExtractStyleguideResponseFinalDomState `json:"finalDOMState"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebExtractStyleguideResponseKeyMetadata `json:"key_metadata"`
	// Always `ok` on success.
	Status string `json:"status"`
	// Comprehensive styleguide data extracted from the website
	Styleguide WebExtractStyleguideResponseStyleguide `json:"styleguide"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheMetadata respjson.Field
		RequestID     respjson.Field
		Code          respjson.Field
		Domain        respjson.Field
		FinalDomState respjson.Field
		KeyMetadata   respjson.Field
		Status        respjson.Field
		Styleguide    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponse) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponse) UnmarshalJSON

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

type WebExtractStyleguideResponseCacheMetadata added in v2.13.0

type WebExtractStyleguideResponseCacheMetadata struct {
	// Age of the cached data in milliseconds. Zero for miss and zdr responses.
	AgeMs int64 `json:"age_ms" api:"required"`
	// Whether the response was served from cache, required fresh work, or honored
	// zero-data-retention cache bypass.
	//
	// Any of "hit", "miss", "zdr".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AgeMs       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Whether this response came from cache.

func (WebExtractStyleguideResponseCacheMetadata) RawJSON added in v2.13.0

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseCacheMetadata) UnmarshalJSON added in v2.13.0

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

type WebExtractStyleguideResponseFinalDomState added in v2.17.0

type WebExtractStyleguideResponseFinalDomState string

`loaded`, or `still-loading` when capture ended before the page finished loading.

const (
	WebExtractStyleguideResponseFinalDomStateLoaded       WebExtractStyleguideResponseFinalDomState = "loaded"
	WebExtractStyleguideResponseFinalDomStateStillLoading WebExtractStyleguideResponseFinalDomState = "still-loading"
)

type WebExtractStyleguideResponseKeyMetadata

type WebExtractStyleguideResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebExtractStyleguideResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseKeyMetadata) UnmarshalJSON

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

type WebExtractStyleguideResponseStyleguide

type WebExtractStyleguideResponseStyleguide struct {
	// Primary colors used on the website
	Colors WebExtractStyleguideResponseStyleguideColors `json:"colors" api:"required"`
	// UI component styles
	Components WebExtractStyleguideResponseStyleguideComponents `json:"components" api:"required"`
	// Spacing system used on the website
	ElementSpacing WebExtractStyleguideResponseStyleguideElementSpacing `json:"elementSpacing" api:"required"`
	// Font assets keyed by family name as it appears in fontFamily/fontFallbacks
	// (non-generic names only). Clients match typography.fontFamily / fontWeight or
	// button styles to pick a file URL from files.
	FontLinks map[string]WebExtractStyleguideResponseStyleguideFontLink `json:"fontLinks" api:"required"`
	// The primary color mode of the website design
	//
	// Any of "light", "dark".
	Mode string `json:"mode" api:"required"`
	// Shadow styles used on the website
	Shadows WebExtractStyleguideResponseStyleguideShadows `json:"shadows" api:"required"`
	// Typography styles used on the website
	Typography WebExtractStyleguideResponseStyleguideTypography `json:"typography" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Colors         respjson.Field
		Components     respjson.Field
		ElementSpacing respjson.Field
		FontLinks      respjson.Field
		Mode           respjson.Field
		Shadows        respjson.Field
		Typography     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Comprehensive styleguide data extracted from the website

func (WebExtractStyleguideResponseStyleguide) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguide) UnmarshalJSON

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

type WebExtractStyleguideResponseStyleguideColors

type WebExtractStyleguideResponseStyleguideColors struct {
	// Accent color (hex format)
	Accent string `json:"accent" api:"required"`
	// Background color (hex format)
	Background string `json:"background" api:"required"`
	// Text color (hex format)
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Accent      respjson.Field
		Background  respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Primary colors used on the website

func (WebExtractStyleguideResponseStyleguideColors) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideColors) UnmarshalJSON

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

type WebExtractStyleguideResponseStyleguideComponents

type WebExtractStyleguideResponseStyleguideComponents struct {
	// Button component styles
	Button WebExtractStyleguideResponseStyleguideComponentsButton `json:"button" api:"required"`
	// Card component style
	Card WebExtractStyleguideResponseStyleguideComponentsCard `json:"card"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Button      respjson.Field
		Card        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

UI component styles

func (WebExtractStyleguideResponseStyleguideComponents) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponents) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideComponentsButton

type WebExtractStyleguideResponseStyleguideComponentsButton struct {
	Link      WebExtractStyleguideResponseStyleguideComponentsButtonLink      `json:"link"`
	Primary   WebExtractStyleguideResponseStyleguideComponentsButtonPrimary   `json:"primary"`
	Secondary WebExtractStyleguideResponseStyleguideComponentsButtonSecondary `json:"secondary"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Link        respjson.Field
		Primary     respjson.Field
		Secondary   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Button component styles

func (WebExtractStyleguideResponseStyleguideComponentsButton) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponentsButton) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideComponentsButtonLink struct {
	BackgroundColor string `json:"backgroundColor" api:"required"`
	// Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has
	// alpha)
	BorderColor  string `json:"borderColor" api:"required"`
	BorderRadius string `json:"borderRadius" api:"required"`
	BorderStyle  string `json:"borderStyle" api:"required"`
	BorderWidth  string `json:"borderWidth" api:"required"`
	// Computed box-shadow (comma-separated layers when present)
	BoxShadow string `json:"boxShadow" api:"required"`
	Color     string `json:"color" api:"required"`
	// Ready-to-use CSS declaration block for this component style
	Css        string  `json:"css" api:"required"`
	FontSize   string  `json:"fontSize" api:"required"`
	FontWeight float64 `json:"fontWeight" api:"required"`
	// Sampled minimum height of the button box (typically px)
	MinHeight string `json:"minHeight" api:"required"`
	// Minimum width (usually px).
	MinWidth       string `json:"minWidth" api:"required"`
	Padding        string `json:"padding" api:"required"`
	TextDecoration string `json:"textDecoration" api:"required"`
	// Full ordered font list from computed font-family
	FontFallbacks []string `json:"fontFallbacks"`
	// Primary button typeface (first in fontFallbacks)
	FontFamily string `json:"fontFamily"`
	// Hex color of the underline when it differs from the text color
	TextDecorationColor string `json:"textDecorationColor"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BackgroundColor     respjson.Field
		BorderColor         respjson.Field
		BorderRadius        respjson.Field
		BorderStyle         respjson.Field
		BorderWidth         respjson.Field
		BoxShadow           respjson.Field
		Color               respjson.Field
		Css                 respjson.Field
		FontSize            respjson.Field
		FontWeight          respjson.Field
		MinHeight           respjson.Field
		MinWidth            respjson.Field
		Padding             respjson.Field
		TextDecoration      respjson.Field
		FontFallbacks       respjson.Field
		FontFamily          respjson.Field
		TextDecorationColor respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideComponentsButtonLink) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponentsButtonLink) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideComponentsButtonPrimary

type WebExtractStyleguideResponseStyleguideComponentsButtonPrimary struct {
	BackgroundColor string `json:"backgroundColor" api:"required"`
	// Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has
	// alpha)
	BorderColor  string `json:"borderColor" api:"required"`
	BorderRadius string `json:"borderRadius" api:"required"`
	BorderStyle  string `json:"borderStyle" api:"required"`
	BorderWidth  string `json:"borderWidth" api:"required"`
	// Computed box-shadow (comma-separated layers when present)
	BoxShadow string `json:"boxShadow" api:"required"`
	Color     string `json:"color" api:"required"`
	// Ready-to-use CSS declaration block for this component style
	Css        string  `json:"css" api:"required"`
	FontSize   string  `json:"fontSize" api:"required"`
	FontWeight float64 `json:"fontWeight" api:"required"`
	// Sampled minimum height of the button box (typically px)
	MinHeight string `json:"minHeight" api:"required"`
	// Minimum width (usually px).
	MinWidth       string `json:"minWidth" api:"required"`
	Padding        string `json:"padding" api:"required"`
	TextDecoration string `json:"textDecoration" api:"required"`
	// Full ordered font list from computed font-family
	FontFallbacks []string `json:"fontFallbacks"`
	// Primary button typeface (first in fontFallbacks)
	FontFamily string `json:"fontFamily"`
	// Hex color of the underline when it differs from the text color
	TextDecorationColor string `json:"textDecorationColor"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BackgroundColor     respjson.Field
		BorderColor         respjson.Field
		BorderRadius        respjson.Field
		BorderStyle         respjson.Field
		BorderWidth         respjson.Field
		BoxShadow           respjson.Field
		Color               respjson.Field
		Css                 respjson.Field
		FontSize            respjson.Field
		FontWeight          respjson.Field
		MinHeight           respjson.Field
		MinWidth            respjson.Field
		Padding             respjson.Field
		TextDecoration      respjson.Field
		FontFallbacks       respjson.Field
		FontFamily          respjson.Field
		TextDecorationColor respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideComponentsButtonPrimary) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponentsButtonPrimary) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideComponentsButtonSecondary

type WebExtractStyleguideResponseStyleguideComponentsButtonSecondary struct {
	BackgroundColor string `json:"backgroundColor" api:"required"`
	// Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has
	// alpha)
	BorderColor  string `json:"borderColor" api:"required"`
	BorderRadius string `json:"borderRadius" api:"required"`
	BorderStyle  string `json:"borderStyle" api:"required"`
	BorderWidth  string `json:"borderWidth" api:"required"`
	// Computed box-shadow (comma-separated layers when present)
	BoxShadow string `json:"boxShadow" api:"required"`
	Color     string `json:"color" api:"required"`
	// Ready-to-use CSS declaration block for this component style
	Css        string  `json:"css" api:"required"`
	FontSize   string  `json:"fontSize" api:"required"`
	FontWeight float64 `json:"fontWeight" api:"required"`
	// Sampled minimum height of the button box (typically px)
	MinHeight string `json:"minHeight" api:"required"`
	// Minimum width (usually px).
	MinWidth       string `json:"minWidth" api:"required"`
	Padding        string `json:"padding" api:"required"`
	TextDecoration string `json:"textDecoration" api:"required"`
	// Full ordered font list from computed font-family
	FontFallbacks []string `json:"fontFallbacks"`
	// Primary button typeface (first in fontFallbacks)
	FontFamily string `json:"fontFamily"`
	// Hex color of the underline when it differs from the text color
	TextDecorationColor string `json:"textDecorationColor"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BackgroundColor     respjson.Field
		BorderColor         respjson.Field
		BorderRadius        respjson.Field
		BorderStyle         respjson.Field
		BorderWidth         respjson.Field
		BoxShadow           respjson.Field
		Color               respjson.Field
		Css                 respjson.Field
		FontSize            respjson.Field
		FontWeight          respjson.Field
		MinHeight           respjson.Field
		MinWidth            respjson.Field
		Padding             respjson.Field
		TextDecoration      respjson.Field
		FontFallbacks       respjson.Field
		FontFamily          respjson.Field
		TextDecorationColor respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideComponentsButtonSecondary) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponentsButtonSecondary) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideComponentsCard

type WebExtractStyleguideResponseStyleguideComponentsCard struct {
	BackgroundColor string `json:"backgroundColor" api:"required"`
	// Border color as CSS hex (#RRGGBB or #RRGGBBAA when computed border-color has
	// alpha)
	BorderColor  string `json:"borderColor" api:"required"`
	BorderRadius string `json:"borderRadius" api:"required"`
	BorderStyle  string `json:"borderStyle" api:"required"`
	BorderWidth  string `json:"borderWidth" api:"required"`
	BoxShadow    string `json:"boxShadow" api:"required"`
	// Ready-to-use CSS declaration block for this component style
	Css       string `json:"css" api:"required"`
	Padding   string `json:"padding" api:"required"`
	TextColor string `json:"textColor" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BackgroundColor respjson.Field
		BorderColor     respjson.Field
		BorderRadius    respjson.Field
		BorderStyle     respjson.Field
		BorderWidth     respjson.Field
		BoxShadow       respjson.Field
		Css             respjson.Field
		Padding         respjson.Field
		TextColor       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Card component style

func (WebExtractStyleguideResponseStyleguideComponentsCard) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideComponentsCard) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideElementSpacing

type WebExtractStyleguideResponseStyleguideElementSpacing struct {
	Lg string `json:"lg" api:"required"`
	Md string `json:"md" api:"required"`
	Sm string `json:"sm" api:"required"`
	Xl string `json:"xl" api:"required"`
	Xs string `json:"xs" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Lg          respjson.Field
		Md          respjson.Field
		Sm          respjson.Field
		Xl          respjson.Field
		Xs          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Spacing system used on the website

func (WebExtractStyleguideResponseStyleguideElementSpacing) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideElementSpacing) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideFontLink struct {
	// Upright font files keyed by weight string (e.g. "400" for regular, "500",
	// "700"). Values are absolute URLs.
	Files map[string]string `json:"files" api:"required"`
	// Any of "google", "custom".
	Type string `json:"type" api:"required"`
	// Google Fonts category when type is google (e.g. sans-serif, serif, monospace,
	// display, handwriting). Omitted for custom fonts when unknown.
	Category string `json:"category"`
	// Present when type is custom: human-readable name derived from the fontLinks key
	// (strip build/hash suffixes, split camelCase / PascalCase, normalize separators).
	// Google entries omit this.
	DisplayName string `json:"displayName"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Files       respjson.Field
		Type        respjson.Field
		Category    respjson.Field
		DisplayName respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideFontLink) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideFontLink) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideShadows

type WebExtractStyleguideResponseStyleguideShadows struct {
	Inner string `json:"inner" api:"required"`
	Lg    string `json:"lg" api:"required"`
	Md    string `json:"md" api:"required"`
	Sm    string `json:"sm" api:"required"`
	Xl    string `json:"xl" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Inner       respjson.Field
		Lg          respjson.Field
		Md          respjson.Field
		Sm          respjson.Field
		Xl          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Shadow styles used on the website

func (WebExtractStyleguideResponseStyleguideShadows) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideShadows) UnmarshalJSON

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

type WebExtractStyleguideResponseStyleguideTypography

type WebExtractStyleguideResponseStyleguideTypography struct {
	// Heading styles
	Headings WebExtractStyleguideResponseStyleguideTypographyHeadings `json:"headings" api:"required"`
	P        WebExtractStyleguideResponseStyleguideTypographyP        `json:"p"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Headings    respjson.Field
		P           respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Typography styles used on the website

func (WebExtractStyleguideResponseStyleguideTypography) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypography) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyHeadings

type WebExtractStyleguideResponseStyleguideTypographyHeadings struct {
	H1 WebExtractStyleguideResponseStyleguideTypographyHeadingsH1 `json:"h1"`
	H2 WebExtractStyleguideResponseStyleguideTypographyHeadingsH2 `json:"h2"`
	H3 WebExtractStyleguideResponseStyleguideTypographyHeadingsH3 `json:"h3"`
	H4 WebExtractStyleguideResponseStyleguideTypographyHeadingsH4 `json:"h4"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		H1          respjson.Field
		H2          respjson.Field
		H3          respjson.Field
		H4          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Heading styles

func (WebExtractStyleguideResponseStyleguideTypographyHeadings) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyHeadings) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH1

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH1 struct {
	// Full ordered font list from resolved computed font-family
	FontFallbacks []string `json:"fontFallbacks" api:"required"`
	// First font in the stack.
	FontFamily    string  `json:"fontFamily" api:"required"`
	FontSize      string  `json:"fontSize" api:"required"`
	FontWeight    float64 `json:"fontWeight" api:"required"`
	LetterSpacing string  `json:"letterSpacing" api:"required"`
	LineHeight    string  `json:"lineHeight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FontFallbacks respjson.Field
		FontFamily    respjson.Field
		FontSize      respjson.Field
		FontWeight    respjson.Field
		LetterSpacing respjson.Field
		LineHeight    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideTypographyHeadingsH1) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH1) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH2

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH2 struct {
	// Full ordered font list from resolved computed font-family
	FontFallbacks []string `json:"fontFallbacks" api:"required"`
	// First font in the stack.
	FontFamily    string  `json:"fontFamily" api:"required"`
	FontSize      string  `json:"fontSize" api:"required"`
	FontWeight    float64 `json:"fontWeight" api:"required"`
	LetterSpacing string  `json:"letterSpacing" api:"required"`
	LineHeight    string  `json:"lineHeight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FontFallbacks respjson.Field
		FontFamily    respjson.Field
		FontSize      respjson.Field
		FontWeight    respjson.Field
		LetterSpacing respjson.Field
		LineHeight    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideTypographyHeadingsH2) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH2) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH3

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH3 struct {
	// Full ordered font list from resolved computed font-family
	FontFallbacks []string `json:"fontFallbacks" api:"required"`
	// First font in the stack.
	FontFamily    string  `json:"fontFamily" api:"required"`
	FontSize      string  `json:"fontSize" api:"required"`
	FontWeight    float64 `json:"fontWeight" api:"required"`
	LetterSpacing string  `json:"letterSpacing" api:"required"`
	LineHeight    string  `json:"lineHeight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FontFallbacks respjson.Field
		FontFamily    respjson.Field
		FontSize      respjson.Field
		FontWeight    respjson.Field
		LetterSpacing respjson.Field
		LineHeight    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideTypographyHeadingsH3) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH3) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH4

type WebExtractStyleguideResponseStyleguideTypographyHeadingsH4 struct {
	// Full ordered font list from resolved computed font-family
	FontFallbacks []string `json:"fontFallbacks" api:"required"`
	// First font in the stack.
	FontFamily    string  `json:"fontFamily" api:"required"`
	FontSize      string  `json:"fontSize" api:"required"`
	FontWeight    float64 `json:"fontWeight" api:"required"`
	LetterSpacing string  `json:"letterSpacing" api:"required"`
	LineHeight    string  `json:"lineHeight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FontFallbacks respjson.Field
		FontFamily    respjson.Field
		FontSize      respjson.Field
		FontWeight    respjson.Field
		LetterSpacing respjson.Field
		LineHeight    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideTypographyHeadingsH4) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyHeadingsH4) UnmarshalJSON

type WebExtractStyleguideResponseStyleguideTypographyP

type WebExtractStyleguideResponseStyleguideTypographyP struct {
	// Full ordered font list from resolved computed font-family
	FontFallbacks []string `json:"fontFallbacks" api:"required"`
	// First font in the stack.
	FontFamily    string  `json:"fontFamily" api:"required"`
	FontSize      string  `json:"fontSize" api:"required"`
	FontWeight    float64 `json:"fontWeight" api:"required"`
	LetterSpacing string  `json:"letterSpacing" api:"required"`
	LineHeight    string  `json:"lineHeight" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		FontFallbacks respjson.Field
		FontFamily    respjson.Field
		FontSize      respjson.Field
		FontWeight    respjson.Field
		LetterSpacing respjson.Field
		LineHeight    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebExtractStyleguideResponseStyleguideTypographyP) RawJSON

Returns the unmodified JSON received from the API

func (*WebExtractStyleguideResponseStyleguideTypographyP) UnmarshalJSON

type WebMapURLsParams added in v2.20.0

type WebMapURLsParams struct {
	// Domain to map, e.g. `stripe.com`.
	Domain string `query:"domain" api:"required" json:"-"`
	// Include URLs on subdomains.
	IncludeSubdomains param.Opt[bool] `query:"includeSubdomains,omitzero" json:"-"`
	// Maximum number of URLs to return.
	MaxLinks param.Opt[int64] `query:"maxLinks,omitzero" json:"-"`
	// Filter URLs by a topic or phrase, most relevant first.
	Search param.Opt[string] `query:"search,omitzero" json:"-"`
	// Fetch this sitemap instead of discovering sitemaps. Must belong to the domain or
	// a subdomain.
	SitemapURL param.Opt[string] `query:"sitemapUrl,omitzero" format:"uri" json:"-"`
	// Optional RE2-compatible regex pattern. Only URLs matching this pattern are
	// returned and counted against maxLinks.
	URLRegex param.Opt[string] `query:"urlRegex,omitzero" json:"-"`
	// HTTP headers for the target origin. Non-empty headers bypass caching.
	Headers map[string]string `query:"headers,omitzero" json:"-"`
	// Comma-separated labels for filtering usage, e.g. `production,team-alpha`.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Request deadline and what to return when it passes.
	TimeoutOpts WebMapURLsParamsTimeoutOpts `query:"timeoutOpts,omitzero" json:"-"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr WebMapURLsParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebMapURLsParams) URLQuery added in v2.20.0

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

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

type WebMapURLsParamsTimeoutOpts added in v2.20.0

type WebMapURLsParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `query:"milliseconds" api:"required" json:"-"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `query:"behavior,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (WebMapURLsParamsTimeoutOpts) URLQuery added in v2.20.0

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

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

type WebMapURLsParamsZdr added in v2.20.0

type WebMapURLsParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	WebMapURLsParamsZdrEnabled  WebMapURLsParamsZdr = "enabled"
	WebMapURLsParamsZdrDisabled WebMapURLsParamsZdr = "disabled"
)

type WebMapURLsResponse added in v2.20.0

type WebMapURLsResponse struct {
	Domain string `json:"domain" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Any of true.
	Success bool                    `json:"success" api:"required"`
	URLs    []WebMapURLsResponseURL `json:"urls" api:"required"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebMapURLsResponseKeyMetadata `json:"key_metadata"`
	Partial     bool                          `json:"partial"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Domain      respjson.Field
		RequestID   respjson.Field
		Success     respjson.Field
		URLs        respjson.Field
		KeyMetadata respjson.Field
		Partial     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebMapURLsResponse) RawJSON added in v2.20.0

func (r WebMapURLsResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebMapURLsResponse) UnmarshalJSON added in v2.20.0

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

type WebMapURLsResponseKeyMetadata added in v2.20.0

type WebMapURLsResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebMapURLsResponseKeyMetadata) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*WebMapURLsResponseKeyMetadata) UnmarshalJSON added in v2.20.0

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

type WebMapURLsResponseURL added in v2.20.0

type WebMapURLsResponseURL struct {
	URL         string   `json:"url" api:"required"`
	Description string   `json:"description"`
	Keywords    []string `json:"keywords"`
	Language    string   `json:"language"`
	Title       string   `json:"title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Description respjson.Field
		Keywords    respjson.Field
		Language    respjson.Field
		Title       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebMapURLsResponseURL) RawJSON added in v2.20.0

func (r WebMapURLsResponseURL) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebMapURLsResponseURL) UnmarshalJSON added in v2.20.0

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

type WebScrapeParams added in v2.20.0

type WebScrapeParams struct {
	// Outputs to return. Set at least one to `true`.
	Formats WebScrapeParamsFormats `json:"formats,omitzero" api:"required"`
	// Public HTTP or HTTPS URL to scrape.
	URL string `json:"url" api:"required" format:"uri"`
	// Maximum age of a cached output, in milliseconds. `0` fetches fresh. Defaults to
	// 3 days (259200000 ms). Maximum: 1 year (31536000000 ms).
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Requires `formats.highlights: true`; required when it is set.
	HighlightsParams WebScrapeParamsHighlightsParams `json:"highlightsParams,omitzero"`
	// Image options. Requires formats.images: true.
	ImageParams WebScrapeParamsImageParams `json:"imageParams,omitzero"`
	// Requires `formats.json: true`; required when it is set.
	JsonParams WebScrapeParamsJsonParams `json:"jsonParams,omitzero"`
	// Markdown options. Requires `formats.markdown`.
	MarkdownParams WebScrapeParamsMarkdownParams `json:"markdownParams,omitzero"`
	// Requires `formats.parse: true`; required when it is set.
	ParseParams WebScrapeParamsParseParams `json:"parseParams,omitzero"`
	// Product options. Requires formats.product: true.
	ProductParams WebScrapeParamsProductParams `json:"productParams,omitzero"`
	// Screenshot options. Requires formats.screenshot: true.
	ScreenshotParams WebScrapeParamsScreenshotParams `json:"screenshotParams,omitzero"`
	// Browser and content settings shared by all outputs.
	SharedParams WebScrapeParamsSharedParams `json:"sharedParams,omitzero"`
	// Labels for tracking request usage. Not retained when zdr is enabled.
	Tags []string `json:"tags,omitzero"`
	// Deadline for the whole request. Defaults to 90000 ms with `fail`. Fixed waits
	// must end before it.
	TimeoutOpts WebScrapeParamsTimeoutOpts `json:"timeoutOpts,omitzero"`
	// `enabled` turns on zero data retention. Your organization must have ZDR enabled.
	//
	// Any of "enabled", "disabled".
	Zdr WebScrapeParamsZdr `json:"zdr,omitzero"`
	// contains filtered or unexported fields
}

func (WebScrapeParams) MarshalJSON added in v2.20.0

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

func (*WebScrapeParams) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsFormats added in v2.20.0

type WebScrapeParamsFormats struct {
	// The original HTTP response body.
	Bytes param.Opt[bool] `json:"bytes,omitzero"`
	// Markdown excerpts relevant to `highlightsParams.query`.
	Highlights param.Opt[bool] `json:"highlights,omitzero"`
	// Rendered HTML.
	HTML param.Opt[bool] `json:"html,omitzero"`
	// Images found on the page.
	Images param.Opt[bool] `json:"images,omitzero"`
	// An object matching `jsonParams.schema`, extracted from the page.
	Json param.Opt[bool] `json:"json,omitzero"`
	// Page content as Markdown.
	Markdown param.Opt[bool] `json:"markdown,omitzero"`
	// Fields extracted with `parseParams.rules`, returned as `parsed`.
	Parse param.Opt[bool] `json:"parse,omitzero"`
	// Product details such as name, price, and availability.
	Product param.Opt[bool] `json:"product,omitzero"`
	// A screenshot of the page.
	Screenshot param.Opt[bool] `json:"screenshot,omitzero"`
	// contains filtered or unexported fields
}

Outputs to return. Set at least one to `true`.

func (WebScrapeParamsFormats) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsFormats) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsHighlightsParams added in v2.21.0

type WebScrapeParamsHighlightsParams struct {
	// The question or topic to find passages for.
	Query string `json:"query" api:"required"`
	// Maximum combined length of returned passages.
	MaxCharacters param.Opt[int64] `json:"maxCharacters,omitzero"`
	// contains filtered or unexported fields
}

Requires `formats.highlights: true`; required when it is set.

The property Query is required.

func (WebScrapeParamsHighlightsParams) MarshalJSON added in v2.21.0

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

func (*WebScrapeParamsHighlightsParams) UnmarshalJSON added in v2.21.0

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

type WebScrapeParamsImageParams added in v2.20.0

type WebScrapeParamsImageParams struct {
	// Set `visual` to drop visual duplicates, keeping the largest copy.
	//
	// Any of "none", "visual".
	Dedupe string `json:"dedupe,omitzero"`
	// Extra data per image: `dimensions`, `classification`, or a hosted `file` URL.
	//
	// Any of "dimensions", "classification", "file".
	Enrich []string `json:"enrich,omitzero"`
	// contains filtered or unexported fields
}

Image options. Requires formats.images: true.

func (WebScrapeParamsImageParams) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsImageParams) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsJsonParams added in v2.21.0

type WebScrapeParamsJsonParams struct {
	// JSON Schema (not an example object) for a top-level object, up to 50 KB. Use
	// optional or nullable fields for missing facts.
	Schema map[string]any `json:"schema,omitzero" api:"required"`
	// Extra guidance, such as which facts to prefer or how to read a field.
	Instructions param.Opt[string] `json:"instructions,omitzero"`
	// contains filtered or unexported fields
}

Requires `formats.json: true`; required when it is set.

The property Schema is required.

func (WebScrapeParamsJsonParams) MarshalJSON added in v2.21.0

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

func (*WebScrapeParamsJsonParams) UnmarshalJSON added in v2.21.0

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

type WebScrapeParamsMarkdownParams added in v2.20.0

type WebScrapeParamsMarkdownParams struct {
	// Include images in the Markdown using image syntax with URLs and alt text.
	IncludeImages param.Opt[bool] `json:"includeImages,omitzero"`
	// Keep link URLs in the Markdown. Set false to return link text without URLs.
	IncludeLinks param.Opt[bool] `json:"includeLinks,omitzero"`
	// How base64 images appear: `placeholder` (default) or `preserve`. Requires
	// `includeImages`.
	//
	// Any of "placeholder", "preserve".
	InlineImages string `json:"inlineImages,omitzero"`
	// contains filtered or unexported fields
}

Markdown options. Requires `formats.markdown`.

func (WebScrapeParamsMarkdownParams) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsMarkdownParams) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsParseParams added in v2.20.0

type WebScrapeParamsParseParams struct {
	// Field names mapped to CSS selectors (`h1`, `a@href`) or rule objects. Max 100
	// fields, 5 levels.
	Rules map[string]WebScrapeParamsParseParamsRuleUnion `json:"rules,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Requires `formats.parse: true`; required when it is set.

The property Rules is required.

func (WebScrapeParamsParseParams) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsParseParams) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsParseParamsRuleObject added in v2.20.0

type WebScrapeParamsParseParamsRuleObject struct {
	// CSS selector to match within the current page or parent rule.
	Selector string `json:"selector" api:"required"`
	// Return text, HTML, an attribute such as `@href`, or nested field rules. Defaults
	// to text.
	Output string `json:"output,omitzero"`
	// Return the first match with `item` or all matches with `list`.
	//
	// Any of "item", "list".
	Type string `json:"type,omitzero"`
	// contains filtered or unexported fields
}

The property Selector is required.

func (WebScrapeParamsParseParamsRuleObject) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsParseParamsRuleObject) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsParseParamsRuleUnion added in v2.20.0

type WebScrapeParamsParseParamsRuleUnion struct {
	OfString                          param.Opt[string]                     `json:",omitzero,inline"`
	OfWebScrapesParseParamsRuleObject *WebScrapeParamsParseParamsRuleObject `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (WebScrapeParamsParseParamsRuleUnion) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsParseParamsRuleUnion) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsProductParams added in v2.21.0

type WebScrapeParamsProductParams struct {
	// Drop visually duplicate product images, keeping the largest copy.
	DedupeImages param.Opt[bool] `json:"dedupeImages,omitzero"`
	// contains filtered or unexported fields
}

Product options. Requires formats.product: true.

func (WebScrapeParamsProductParams) MarshalJSON added in v2.21.0

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

func (*WebScrapeParamsProductParams) UnmarshalJSON added in v2.21.0

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

type WebScrapeParamsScreenshotParams added in v2.20.0

type WebScrapeParamsScreenshotParams struct {
	// What to capture: `viewport`, `fullPage`, one element, or a rectangle. Max 40
	// megapixels.
	Area WebScrapeParamsScreenshotParamsAreaUnion `json:"area,omitzero"`
	// Image format for the screenshot.
	//
	// Any of "png", "jpeg", "webp".
	Format string `json:"format,omitzero"`
	// contains filtered or unexported fields
}

Screenshot options. Requires formats.screenshot: true.

func (WebScrapeParamsScreenshotParams) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsScreenshotParams) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsScreenshotParamsAreaElement added in v2.20.0

type WebScrapeParamsScreenshotParamsAreaElement struct {
	// CSS selector matching exactly one visible element.
	Selector string `json:"selector" api:"required"`
	// contains filtered or unexported fields
}

The property Selector is required.

func (WebScrapeParamsScreenshotParamsAreaElement) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsScreenshotParamsAreaElement) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsScreenshotParamsAreaPage added in v2.20.0

type WebScrapeParamsScreenshotParamsAreaPage string
const (
	WebScrapeParamsScreenshotParamsAreaPageViewport WebScrapeParamsScreenshotParamsAreaPage = "viewport"
	WebScrapeParamsScreenshotParamsAreaPageFullPage WebScrapeParamsScreenshotParamsAreaPage = "fullPage"
)

type WebScrapeParamsScreenshotParamsAreaRectangle added in v2.20.0

type WebScrapeParamsScreenshotParamsAreaRectangle struct {
	// Height of the capture in pixels.
	Height int64 `json:"height" api:"required"`
	// Width of the capture in pixels.
	Width int64 `json:"width" api:"required"`
	// Left edge of the capture, in pixels from the document origin.
	X int64 `json:"x" api:"required"`
	// Top edge of the capture, in pixels from the document origin.
	Y int64 `json:"y" api:"required"`
	// contains filtered or unexported fields
}

Pixels from the document origin.

The properties Height, Width, X, Y are required.

func (WebScrapeParamsScreenshotParamsAreaRectangle) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsScreenshotParamsAreaRectangle) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsScreenshotParamsAreaUnion added in v2.20.0

type WebScrapeParamsScreenshotParamsAreaUnion struct {
	// Check if union is this variant with !param.IsOmitted(union.OfPage)
	OfPage      param.Opt[string]                             `json:",omitzero,inline"`
	OfElement   *WebScrapeParamsScreenshotParamsAreaElement   `json:",omitzero,inline"`
	OfRectangle *WebScrapeParamsScreenshotParamsAreaRectangle `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (WebScrapeParamsScreenshotParamsAreaUnion) MarshalJSON added in v2.20.0

func (*WebScrapeParamsScreenshotParamsAreaUnion) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsSharedParams added in v2.20.0

type WebScrapeParamsSharedParams struct {
	// Proxy country as a two-letter code, such as `US`. Case-insensitive.
	Country param.Opt[string] `json:"country,omitzero"`
	// Accept cookie banners before actions and capture.
	DismissCookies param.Opt[bool] `json:"dismissCookies,omitzero"`
	// Close other popups before actions and capture.
	DismissPopups param.Opt[bool] `json:"dismissPopups,omitzero"`
	// Include iframe content in HTML and text outputs. Screenshots always show visible
	// frames.
	IncludeFrames param.Opt[bool] `json:"includeFrames,omitzero"`
	// Keep only the main content. Doesn't affect `screenshot`, `bytes`, or `product`.
	MainContentOnly param.Opt[bool] `json:"mainContentOnly,omitzero"`
	// Wait for CSS animations to finish before capture. Defaults to `true` when
	// `screenshot` is requested.
	SettleAnimations param.Opt[bool] `json:"settleAnimations,omitzero"`
	// Browser steps run in order before capture. Requires a paid plan. Skips the
	// cache.
	Actions []WebScrapeParamsSharedParamsActionUnion `json:"actions,omitzero"`
	// Remove elements matching these CSS selectors. Overrides `includeSelectors`.
	ExcludeSelectors []string `json:"excludeSelectors,omitzero"`
	// HTTP headers to send to the target site. Requests with headers skip the cache.
	Headers map[string]string `json:"headers,omitzero"`
	// Keep only elements matching these CSS selectors.
	IncludeSelectors []string `json:"includeSelectors,omitzero"`
	// Document parsing options.
	Parsers WebScrapeParamsSharedParamsParsers `json:"parsers,omitzero"`
	// Emulate a light or dark color scheme.
	//
	// Any of "light", "dark".
	Theme string `json:"theme,omitzero"`
	// Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions
	// default to 1440 × 900.
	Viewport WebScrapeParamsSharedParamsViewport `json:"viewport,omitzero"`
	// Milliseconds, or a CSS selector to wait for, after actions. Defaults to 500
	// (2000 with frames or XML).
	WaitFor WebScrapeParamsSharedParamsWaitForUnion `json:"waitFor,omitzero"`
	// contains filtered or unexported fields
}

Browser and content settings shared by all outputs.

func (WebScrapeParamsSharedParams) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsSharedParams) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsSharedParamsActionPerform added in v2.20.0

type WebScrapeParamsSharedParamsActionPerform struct {
	// One browser instruction, such as clicking a button or entering text.
	Action string `json:"action" api:"required"`
	// Use `perform` for a plain-language browser instruction.
	//
	// This field can be elided, and will marshal its zero value as "perform".
	Type constant.Perform `json:"type" default:"perform"`
	// contains filtered or unexported fields
}

The properties Action, Type are required.

func (WebScrapeParamsSharedParamsActionPerform) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsSharedParamsActionPerform) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsSharedParamsActionScroll added in v2.20.0

type WebScrapeParamsSharedParamsActionScroll struct {
	// Maximum number of scroll steps for this action.
	MaxScrolls param.Opt[int64] `json:"maxScrolls,omitzero"`
	// Scroll this container. Omit to scroll the page.
	Selector param.Opt[string] `json:"selector,omitzero"`
	// Distance per scroll: pixels, one `viewport`, or `max` to reach the end.
	Amount WebScrapeParamsSharedParamsActionScrollAmountUnion `json:"amount,omitzero"`
	// Direction to scroll.
	//
	// Any of "down", "up", "left", "right".
	Direction string `json:"direction,omitzero"`
	// Use `scroll` to move through the page or a container.
	//
	// This field can be elided, and will marshal its zero value as "scroll".
	Type constant.Scroll `json:"type" default:"scroll"`
	// contains filtered or unexported fields
}

The property Type is required.

func (WebScrapeParamsSharedParamsActionScroll) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsSharedParamsActionScroll) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsSharedParamsActionScrollAmountString added in v2.20.0

type WebScrapeParamsSharedParamsActionScrollAmountString string
const (
	WebScrapeParamsSharedParamsActionScrollAmountStringViewport WebScrapeParamsSharedParamsActionScrollAmountString = "viewport"
	WebScrapeParamsSharedParamsActionScrollAmountStringMax      WebScrapeParamsSharedParamsActionScrollAmountString = "max"
)

type WebScrapeParamsSharedParamsActionScrollAmountUnion added in v2.20.0

type WebScrapeParamsSharedParamsActionScrollAmountUnion struct {
	OfInt param.Opt[int64] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfWebScrapesSharedParamsActionScrollAmountString)
	OfWebScrapesSharedParamsActionScrollAmountString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (WebScrapeParamsSharedParamsActionScrollAmountUnion) MarshalJSON added in v2.20.0

func (*WebScrapeParamsSharedParamsActionScrollAmountUnion) UnmarshalJSON added in v2.20.0

type WebScrapeParamsSharedParamsActionUnion added in v2.20.0

type WebScrapeParamsSharedParamsActionUnion struct {
	OfPerform *WebScrapeParamsSharedParamsActionPerform `json:",omitzero,inline"`
	OfScroll  *WebScrapeParamsSharedParamsActionScroll  `json:",omitzero,inline"`
	OfWait    *WebScrapeParamsSharedParamsActionWait    `json:",omitzero,inline"`
	OfWaitFor *WebScrapeParamsSharedParamsActionWaitFor `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (WebScrapeParamsSharedParamsActionUnion) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsSharedParamsActionUnion) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsSharedParamsActionWait added in v2.20.0

type WebScrapeParamsSharedParamsActionWait struct {
	// Time to pause in milliseconds before the next action.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// Use `wait` to pause for a fixed duration.
	//
	// This field can be elided, and will marshal its zero value as "wait".
	Type constant.Wait `json:"type" default:"wait"`
	// contains filtered or unexported fields
}

The properties Milliseconds, Type are required.

func (WebScrapeParamsSharedParamsActionWait) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsSharedParamsActionWait) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsSharedParamsActionWaitFor added in v2.20.0

type WebScrapeParamsSharedParamsActionWaitFor struct {
	// CSS selector to wait for before continuing.
	Selector string `json:"selector" api:"required"`
	// Use `waitFor` to wait for a matching element.
	//
	// This field can be elided, and will marshal its zero value as "waitFor".
	Type constant.WaitFor `json:"type" default:"waitFor"`
	// contains filtered or unexported fields
}

The properties Selector, Type are required.

func (WebScrapeParamsSharedParamsActionWaitFor) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsSharedParamsActionWaitFor) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsSharedParamsParsers added in v2.20.0

type WebScrapeParamsSharedParamsParsers struct {
	// PDF page range and OCR.
	Pdf WebScrapeParamsSharedParamsParsersPdf `json:"pdf,omitzero"`
	// contains filtered or unexported fields
}

Document parsing options.

func (WebScrapeParamsSharedParamsParsers) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsSharedParamsParsers) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsSharedParamsParsersPdf added in v2.20.0

type WebScrapeParamsSharedParamsParsersPdf struct {
	// Last page to parse. Must be at least `startPage`.
	EndPage param.Opt[int64] `json:"endPage,omitzero"`
	// First page to parse, starting at 1.
	StartPage param.Opt[int64] `json:"startPage,omitzero"`
	// Set `auto` to read scanned pages with OCR.
	//
	// Any of "off", "auto".
	Ocr string `json:"ocr,omitzero"`
	// contains filtered or unexported fields
}

PDF page range and OCR.

func (WebScrapeParamsSharedParamsParsersPdf) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsSharedParamsParsersPdf) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsSharedParamsViewport added in v2.20.0

type WebScrapeParamsSharedParamsViewport struct {
	// Browser viewport height in pixels.
	Height param.Opt[int64] `json:"height,omitzero"`
	// Browser viewport width in pixels.
	Width param.Opt[int64] `json:"width,omitzero"`
	// contains filtered or unexported fields
}

Browser size in pixels. Omit for 1920 × 1080. When provided, missing dimensions default to 1440 × 900.

func (WebScrapeParamsSharedParamsViewport) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsSharedParamsViewport) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsSharedParamsWaitForUnion added in v2.20.0

type WebScrapeParamsSharedParamsWaitForUnion struct {
	OfInt    param.Opt[int64]  `json:",omitzero,inline"`
	OfString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (WebScrapeParamsSharedParamsWaitForUnion) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsSharedParamsWaitForUnion) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsTimeoutOpts added in v2.20.0

type WebScrapeParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag. "return-partial" requires at least 5000 ms.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Deadline for the whole request. Defaults to 90000 ms with `fail`. Fixed waits must end before it.

The property Milliseconds is required.

func (WebScrapeParamsTimeoutOpts) MarshalJSON added in v2.20.0

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

func (*WebScrapeParamsTimeoutOpts) UnmarshalJSON added in v2.20.0

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

type WebScrapeParamsZdr added in v2.20.0

type WebScrapeParamsZdr string

`enabled` turns on zero data retention. Your organization must have ZDR enabled.

const (
	WebScrapeParamsZdrEnabled  WebScrapeParamsZdr = "enabled"
	WebScrapeParamsZdrDisabled WebScrapeParamsZdr = "disabled"
)

type WebScrapeResponse added in v2.20.0

type WebScrapeResponse struct {
	// The original HTTP response body, unchanged by waits, actions, and filters.
	Bytes WebScrapeResponseBytes `json:"bytes" api:"required"`
	// Whether this response came from cache.
	CacheMetadata WebScrapeResponseCacheMetadata `json:"cache_metadata" api:"required"`
	// Relevant Markdown excerpts in page order. `[Heading]` adds context; `…` marks
	// omitted text.
	Highlights WebScrapeResponseHighlights `json:"highlights" api:"required"`
	// Rendered HTML after content filters.
	HTML WebScrapeResponseHTML `json:"html" api:"required"`
	// Images after content filters. `[]` when none are found.
	Images WebScrapeResponseImages `json:"images" api:"required"`
	// Object matching `jsonParams.schema`.
	Json WebScrapeResponseJson `json:"json" api:"required"`
	// Markdown after content filters.
	Markdown WebScrapeResponseMarkdown `json:"markdown" api:"required"`
	// Page metadata. Fields are omitted when not found.
	Metadata WebScrapeResponseMetadata `json:"metadata" api:"required"`
	// Fields from `parseParams.rules`, after content filters. Unmatched fields are
	// `null` (`[]` for lists).
	Parsed WebScrapeResponseParsed `json:"parsed" api:"required"`
	// Product details found on the page.
	Product WebScrapeResponseProduct `json:"product" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Screenshot as a base64 image data URL.
	Screenshot WebScrapeResponseScreenshot `json:"screenshot" api:"required"`
	// Final URL after redirects and browser actions.
	URL string `json:"url" api:"required" format:"uri"`
	// True when at least one requested output succeeds but the response has failed or
	// incomplete outputs. Absent when all requested outputs fail.
	//
	// Any of true.
	IsPartial bool `json:"isPartial"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebScrapeResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bytes         respjson.Field
		CacheMetadata respjson.Field
		Highlights    respjson.Field
		HTML          respjson.Field
		Images        respjson.Field
		Json          respjson.Field
		Markdown      respjson.Field
		Metadata      respjson.Field
		Parsed        respjson.Field
		Product       respjson.Field
		RequestID     respjson.Field
		Screenshot    respjson.Field
		URL           respjson.Field
		IsPartial     respjson.Field
		KeyMetadata   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebScrapeResponse) RawJSON added in v2.20.0

func (r WebScrapeResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponse) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseBytes added in v2.20.0

type WebScrapeResponseBytes struct {
	Data      WebScrapeResponseBytesData `json:"data" api:"required"`
	Requested bool                       `json:"requested" api:"required"`
	// `true` if returned, `false` if it failed, `null` if not requested.
	Success bool `json:"success" api:"required"`
	// Why the output failed. Present only when `success` is `false`.
	ErrorCode string `json:"error_code"`
	// Explanation of the failure and possible next steps.
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Requested   respjson.Field
		Success     respjson.Field
		ErrorCode   respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The original HTTP response body, unchanged by waits, actions, and filters.

func (WebScrapeResponseBytes) RawJSON added in v2.20.0

func (r WebScrapeResponseBytes) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseBytes) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseBytesData added in v2.20.0

type WebScrapeResponseBytesData struct {
	// Body as base64, after HTTP decompression. Up to 50 MiB decoded.
	Base64      string `json:"base64" api:"required"`
	ContentType string `json:"contentType" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Base64      respjson.Field
		ContentType respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebScrapeResponseBytesData) RawJSON added in v2.20.0

func (r WebScrapeResponseBytesData) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseBytesData) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseCacheMetadata added in v2.20.0

type WebScrapeResponseCacheMetadata struct {
	// Age of the cached data in milliseconds. Zero for miss and zdr responses.
	AgeMs int64 `json:"age_ms" api:"required"`
	// Whether the response was served from cache, required fresh work, or honored
	// zero-data-retention cache bypass.
	//
	// Any of "hit", "miss", "zdr".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AgeMs       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Whether this response came from cache.

func (WebScrapeResponseCacheMetadata) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*WebScrapeResponseCacheMetadata) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseHTML added in v2.20.0

type WebScrapeResponseHTML struct {
	Data      string `json:"data" api:"required"`
	Requested bool   `json:"requested" api:"required"`
	// `true` if returned, `false` if it failed, `null` if not requested.
	Success bool `json:"success" api:"required"`
	// Why the output failed. Present only when `success` is `false`.
	ErrorCode string `json:"error_code"`
	// Explanation of the failure and possible next steps.
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Requested   respjson.Field
		Success     respjson.Field
		ErrorCode   respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Rendered HTML after content filters.

func (WebScrapeResponseHTML) RawJSON added in v2.20.0

func (r WebScrapeResponseHTML) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseHTML) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseHighlights added in v2.21.0

type WebScrapeResponseHighlights struct {
	Data      []string `json:"data" api:"required"`
	Requested bool     `json:"requested" api:"required"`
	// `true` if returned, `false` if it failed, `null` if not requested.
	Success bool `json:"success" api:"required"`
	// Why the output failed. Present only when `success` is `false`.
	ErrorCode string `json:"error_code"`
	// Explanation of the failure and possible next steps.
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Requested   respjson.Field
		Success     respjson.Field
		ErrorCode   respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Relevant Markdown excerpts in page order. `[Heading]` adds context; `…` marks omitted text.

func (WebScrapeResponseHighlights) RawJSON added in v2.21.0

func (r WebScrapeResponseHighlights) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseHighlights) UnmarshalJSON added in v2.21.0

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

type WebScrapeResponseImages added in v2.20.0

type WebScrapeResponseImages struct {
	Data      []WebScrapeResponseImagesData `json:"data" api:"required"`
	Requested bool                          `json:"requested" api:"required"`
	// `true` if returned, `false` if it failed, `null` if not requested.
	Success bool `json:"success" api:"required"`
	// Why the output failed. Present only when `success` is `false`.
	ErrorCode string `json:"error_code"`
	// Explanation of the failure and possible next steps.
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Requested   respjson.Field
		Success     respjson.Field
		ErrorCode   respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Images after content filters. `[]` when none are found.

func (WebScrapeResponseImages) RawJSON added in v2.20.0

func (r WebScrapeResponseImages) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseImages) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseImagesData added in v2.20.0

type WebScrapeResponseImagesData struct {
	// Alt text, if present.
	Alt string `json:"alt" api:"required"`
	// Image URL, or a data URI for inline images.
	URL string `json:"url" api:"required" format:"uri"`
	// Any of "photography", "illustration", "logo", "wordmark", "icon", "pattern",
	// "graphic", "other".
	Classification string `json:"classification"`
	// Hosted image URL, valid for 24 hours after capture. Requires `file` enrichment
	// and ZDR disabled.
	FileURL string `json:"fileUrl" format:"uri"`
	Height  int64  `json:"height"`
	Width   int64  `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Alt            respjson.Field
		URL            respjson.Field
		Classification respjson.Field
		FileURL        respjson.Field
		Height         respjson.Field
		Width          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebScrapeResponseImagesData) RawJSON added in v2.20.0

func (r WebScrapeResponseImagesData) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseImagesData) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseJson added in v2.21.0

type WebScrapeResponseJson struct {
	Data      map[string]any `json:"data" api:"required"`
	Requested bool           `json:"requested" api:"required"`
	// `true` if returned, `false` if it failed, `null` if not requested.
	Success bool `json:"success" api:"required"`
	// Why the output failed. Present only when `success` is `false`.
	ErrorCode string `json:"error_code"`
	// True when the page was too long to read in full, so values found only in the
	// unread parts may be missing.
	//
	// Any of true.
	IsTruncated bool `json:"isTruncated"`
	// Explanation of the failure and possible next steps.
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Requested   respjson.Field
		Success     respjson.Field
		ErrorCode   respjson.Field
		IsTruncated respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Object matching `jsonParams.schema`.

func (WebScrapeResponseJson) RawJSON added in v2.21.0

func (r WebScrapeResponseJson) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseJson) UnmarshalJSON added in v2.21.0

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

type WebScrapeResponseKeyMetadata added in v2.20.0

type WebScrapeResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebScrapeResponseKeyMetadata) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*WebScrapeResponseKeyMetadata) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseMarkdown added in v2.20.0

type WebScrapeResponseMarkdown struct {
	Data      string `json:"data" api:"required"`
	Requested bool   `json:"requested" api:"required"`
	// `true` if returned, `false` if it failed, `null` if not requested.
	Success bool `json:"success" api:"required"`
	// Why the output failed. Present only when `success` is `false`.
	ErrorCode string `json:"error_code"`
	// Explanation of the failure and possible next steps.
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Requested   respjson.Field
		Success     respjson.Field
		ErrorCode   respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Markdown after content filters.

func (WebScrapeResponseMarkdown) RawJSON added in v2.20.0

func (r WebScrapeResponseMarkdown) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseMarkdown) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseMetadata added in v2.20.0

type WebScrapeResponseMetadata struct {
	// Additional non-social meta tags not promoted to top-level metadata fields.
	AdditionalMeta map[string]WebScrapeResponseMetadataAdditionalMetaUnion `json:"additionalMeta"`
	// Resolved alternate links from link rel=alternate tags.
	Alternates []WebScrapeResponseMetadataAlternate `json:"alternates"`
	// Author metadata, when present.
	Author string `json:"author"`
	// Resolved canonical URL, when present.
	CanonicalURL string `json:"canonicalUrl"`
	// Best description extracted from standard, Open Graph, or Twitter metadata.
	Description string `json:"description"`
	// Resolved favicon URL, when present.
	Favicon string `json:"favicon"`
	// Up to 500 h1–h6 headings in document order, before content filtering.
	Headings []WebScrapeResponseMetadataHeading `json:"headings"`
	// Primary resolved preview image from Open Graph, Twitter, or image metadata.
	Image string `json:"image"`
	// JSON-LD structured data blocks parsed from the page.
	JsonLd []map[string]any `json:"jsonLd"`
	// Keywords extracted from the page's keywords meta tag.
	Keywords []string `json:"keywords"`
	// Language extracted from html lang or language meta tags.
	Language string `json:"language"`
	// Modified timestamp/date from page metadata, when present.
	ModifiedTime string `json:"modifiedTime"`
	// Open Graph metadata with the og: prefix removed and keys camel-cased.
	OpenGraph map[string]WebScrapeResponseMetadataOpenGraphUnion `json:"openGraph"`
	// Published timestamp/date from page metadata, when present.
	PublishedTime string `json:"publishedTime"`
	// Robots meta directive, when present.
	Robots string `json:"robots"`
	// Site or application name from page metadata.
	SiteName string `json:"siteName"`
	// Best title extracted from the page.
	Title string `json:"title"`
	// Twitter card metadata with the twitter: prefix removed and keys camel-cased.
	Twitter map[string]WebScrapeResponseMetadataTwitterUnion `json:"twitter"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AdditionalMeta respjson.Field
		Alternates     respjson.Field
		Author         respjson.Field
		CanonicalURL   respjson.Field
		Description    respjson.Field
		Favicon        respjson.Field
		Headings       respjson.Field
		Image          respjson.Field
		JsonLd         respjson.Field
		Keywords       respjson.Field
		Language       respjson.Field
		ModifiedTime   respjson.Field
		OpenGraph      respjson.Field
		PublishedTime  respjson.Field
		Robots         respjson.Field
		SiteName       respjson.Field
		Title          respjson.Field
		Twitter        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Page metadata. Fields are omitted when not found.

func (WebScrapeResponseMetadata) RawJSON added in v2.20.0

func (r WebScrapeResponseMetadata) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseMetadata) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseMetadataAdditionalMetaUnion added in v2.20.0

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

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

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

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

func (WebScrapeResponseMetadataAdditionalMetaUnion) AsString added in v2.20.0

func (WebScrapeResponseMetadataAdditionalMetaUnion) AsStringArray added in v2.20.0

func (u WebScrapeResponseMetadataAdditionalMetaUnion) AsStringArray() (v []string)

func (WebScrapeResponseMetadataAdditionalMetaUnion) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*WebScrapeResponseMetadataAdditionalMetaUnion) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseMetadataAlternate added in v2.20.0

type WebScrapeResponseMetadataAlternate struct {
	// Resolved alternate URL.
	Href string `json:"href" api:"required"`
	// Language or locale for the alternate URL, when present.
	Hreflang string `json:"hreflang"`
	// Alternate resource title, when present.
	Title string `json:"title"`
	// Alternate resource MIME type, when present.
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Href        respjson.Field
		Hreflang    respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebScrapeResponseMetadataAlternate) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*WebScrapeResponseMetadataAlternate) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseMetadataHeading added in v2.20.0

type WebScrapeResponseMetadataHeading struct {
	// Heading level, 1–6 (from h1–h6).
	Level int64 `json:"level" api:"required"`
	// Heading text with whitespace collapsed, truncated to 1000 characters.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Level       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebScrapeResponseMetadataHeading) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*WebScrapeResponseMetadataHeading) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseMetadataOpenGraphUnion added in v2.20.0

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

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

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

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

func (WebScrapeResponseMetadataOpenGraphUnion) AsString added in v2.20.0

func (WebScrapeResponseMetadataOpenGraphUnion) AsStringArray added in v2.20.0

func (u WebScrapeResponseMetadataOpenGraphUnion) AsStringArray() (v []string)

func (WebScrapeResponseMetadataOpenGraphUnion) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*WebScrapeResponseMetadataOpenGraphUnion) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseMetadataTwitterUnion added in v2.20.0

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

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

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

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

func (WebScrapeResponseMetadataTwitterUnion) AsString added in v2.20.0

func (WebScrapeResponseMetadataTwitterUnion) AsStringArray added in v2.20.0

func (u WebScrapeResponseMetadataTwitterUnion) AsStringArray() (v []string)

func (WebScrapeResponseMetadataTwitterUnion) RawJSON added in v2.20.0

Returns the unmodified JSON received from the API

func (*WebScrapeResponseMetadataTwitterUnion) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseParsed added in v2.20.0

type WebScrapeResponseParsed struct {
	Data      map[string]any `json:"data" api:"required"`
	Requested bool           `json:"requested" api:"required"`
	// `true` if returned, `false` if it failed, `null` if not requested.
	Success bool `json:"success" api:"required"`
	// Why the output failed. Present only when `success` is `false`.
	ErrorCode string `json:"error_code"`
	// Explanation of the failure and possible next steps.
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Requested   respjson.Field
		Success     respjson.Field
		ErrorCode   respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Fields from `parseParams.rules`, after content filters. Unmatched fields are `null` (`[]` for lists).

func (WebScrapeResponseParsed) RawJSON added in v2.20.0

func (r WebScrapeResponseParsed) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseParsed) UnmarshalJSON added in v2.20.0

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

type WebScrapeResponseProduct added in v2.21.0

type WebScrapeResponseProduct struct {
	Data      WebScrapeResponseProductData `json:"data" api:"required"`
	Requested bool                         `json:"requested" api:"required"`
	// `true` if returned, `false` if it failed, `null` if not requested.
	Success bool `json:"success" api:"required"`
	// Why the output failed. Present only when `success` is `false`.
	ErrorCode string `json:"error_code"`
	// Explanation of the failure and possible next steps.
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Requested   respjson.Field
		Success     respjson.Field
		ErrorCode   respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Product details found on the page.

func (WebScrapeResponseProduct) RawJSON added in v2.21.0

func (r WebScrapeResponseProduct) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseProduct) UnmarshalJSON added in v2.21.0

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

type WebScrapeResponseProductData added in v2.21.0

type WebScrapeResponseProductData struct {
	// Whether the page is a product detail page.
	IsProductPage bool `json:"isProductPage" api:"required"`
	// The extracted product, or null when the page is not a product detail page.
	Product WebScrapeResponseProductDataProduct `json:"product" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		IsProductPage respjson.Field
		Product       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebScrapeResponseProductData) RawJSON added in v2.21.0

Returns the unmodified JSON received from the API

func (*WebScrapeResponseProductData) UnmarshalJSON added in v2.21.0

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

type WebScrapeResponseProductDataProduct added in v2.21.0

type WebScrapeResponseProductDataProduct struct {
	// Stock or ordering availability.
	//
	// Any of "in_stock", "out_of_stock", "limited_availability", "preorder",
	// "backorder", "made_to_order", "discontinued".
	Availability string `json:"availability" api:"required"`
	// Brand or vendor.
	Brand string `json:"brand" api:"required"`
	// Product category.
	Category string `json:"category" api:"required"`
	// ISO 4217 currency code.
	Currency string `json:"currency" api:"required"`
	// Product description.
	Description string `json:"description" api:"required"`
	// Product dimensions as shown on the page.
	Dimensions []string `json:"dimensions" api:"required"`
	// Key features and specifications.
	Features []string `json:"features" api:"required"`
	// Product image URLs, main image first.
	Images []string `json:"images" api:"required" format:"uri"`
	// Main product image URL.
	ImageURL string `json:"imageUrl" api:"required" format:"uri"`
	// Product name.
	Name string `json:"name" api:"required"`
	// Current price.
	Price float64 `json:"price" api:"required"`
	// List price before any discount.
	RegularPrice float64 `json:"regularPrice" api:"required"`
	// Product identifier such as a SKU or model number.
	SKU string `json:"sku" api:"required"`
	// Product tags.
	Tags []string `json:"tags" api:"required"`
	// Intended audience.
	TargetAudience []string `json:"targetAudience" api:"required"`
	// Product variations, such as different colors or sizes, with their attributes and
	// images. Empty if none are found. May not include every variation offered by the
	// store.
	Variants []WebScrapeResponseProductDataProductVariant `json:"variants" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Availability   respjson.Field
		Brand          respjson.Field
		Category       respjson.Field
		Currency       respjson.Field
		Description    respjson.Field
		Dimensions     respjson.Field
		Features       respjson.Field
		Images         respjson.Field
		ImageURL       respjson.Field
		Name           respjson.Field
		Price          respjson.Field
		RegularPrice   respjson.Field
		SKU            respjson.Field
		Tags           respjson.Field
		TargetAudience respjson.Field
		Variants       respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The extracted product, or null when the page is not a product detail page.

func (WebScrapeResponseProductDataProduct) RawJSON added in v2.21.0

Returns the unmodified JSON received from the API

func (*WebScrapeResponseProductDataProduct) UnmarshalJSON added in v2.21.0

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

type WebScrapeResponseProductDataProductVariant added in v2.21.0

type WebScrapeResponseProductDataProductVariant struct {
	// Explicit variant attributes such as color, size, material, pattern and
	// properties declared by page.
	Attributes map[string]string `json:"attributes" api:"required"`
	// Original source image URLs explicitly attached to this variant.
	Images []string `json:"images" api:"required"`
	SKU    string   `json:"sku" api:"required"`
	// Variant or offer URL when provided by the source. May be shared by variants.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Attributes  respjson.Field
		Images      respjson.Field
		SKU         respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebScrapeResponseProductDataProductVariant) RawJSON added in v2.21.0

Returns the unmodified JSON received from the API

func (*WebScrapeResponseProductDataProductVariant) UnmarshalJSON added in v2.21.0

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

type WebScrapeResponseScreenshot added in v2.20.0

type WebScrapeResponseScreenshot struct {
	Data      string `json:"data" api:"required" format:"uri"`
	Requested bool   `json:"requested" api:"required"`
	// `true` if returned, `false` if it failed, `null` if not requested.
	Success bool `json:"success" api:"required"`
	// Why the output failed. Present only when `success` is `false`.
	ErrorCode string `json:"error_code"`
	// Explanation of the failure and possible next steps.
	Message string `json:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Requested   respjson.Field
		Success     respjson.Field
		ErrorCode   respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Screenshot as a base64 image data URL.

func (WebScrapeResponseScreenshot) RawJSON added in v2.20.0

func (r WebScrapeResponseScreenshot) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScrapeResponseScreenshot) UnmarshalJSON added in v2.20.0

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

type WebScreenshotParams

type WebScreenshotParams struct {
	// Return a cached screenshot if a prior screenshot for the same parameters exists
	// and is younger than this many milliseconds. Defaults to 1 day (86400000 ms) when
	// omitted. Max is 30 days (2592000000 ms). Set to 0 to always capture fresh.
	MaxAgeMs param.Opt[int64] `query:"maxAgeMs,omitzero" json:"-"`
	// Optional vertical scroll offset in pixels for capturing a long page in
	// viewport-sized chunks. When provided, the full page is captured once and the
	// returned image is the viewport-sized slice that begins at this Y offset (e.g.
	// request scrollOffset=0, then 1080, then 2160 to walk a 1920x1080 landing page
	// top to bottom). The final slice may be shorter than the viewport height. Takes
	// precedence over fullScreenshot. Max: 100000.
	ScrollOffset param.Opt[int64] `query:"scrollOffset,omitzero" json:"-"`
	// Optional browser wait time in milliseconds after initial page load before taking
	// the screenshot. Min: 0. Max: 30000 (30 seconds). Defaults to 3000 ms when
	// omitted. When combined with timeoutOpts, timeoutOpts.milliseconds must be at
	// least waitForMs + 10000 ms; a shorter deadline is rejected with 400
	// TIMEOUT_TOO_SHORT_FOR_WAIT.
	WaitForMs param.Opt[int64] `query:"waitForMs,omitzero" json:"-"`
	// Optional parameter for comprehensive popup cleanup. If 'true', the browser
	// dismisses detected cookie/consent UI and clears other detected obstructive
	// popups and overlays before capture. If 'false' or not provided, this parameter
	// requests no cleanup; handleCookiePopup can still request cookie/consent handling
	// independently.
	ClearPopups param.Opt[bool] `query:"clearPopups,omitzero" json:"-"`
	// A specific URL to screenshot directly, bypassing domain resolution (e.g.,
	// 'https://example.com/pricing'). When provided, the screenshot is taken of this
	// exact URL. You must provide either 'domain' or 'directUrl', but not both.
	DirectURL param.Opt[string] `query:"directUrl,omitzero" format:"uri" json:"-"`
	// Domain name to take screenshot of (e.g., 'example.com', 'google.com'). The
	// domain will be automatically normalized and validated. You must provide either
	// 'domain' or 'directUrl', but not both.
	Domain param.Opt[string] `query:"domain,omitzero" json:"-"`
	// Optional parameter to control cookie/consent popup handling. If 'true', we
	// dismiss cookie banner before capture. If 'false' or not provided, captures the
	// page without that step.
	HandleCookiePopup param.Opt[bool] `query:"handleCookiePopup,omitzero" json:"-"`
	// Optional parameter to choose the site's visual theme in the screenshot. Use
	// 'light' or 'dark' when the site offers both appearances.
	//
	// Any of "light", "dark".
	ColorScheme WebScreenshotParamsColorScheme `query:"colorScheme,omitzero" json:"-"`
	// Fetch from this country (ISO 3166-1 alpha-2).
	//
	// Any of "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "at", "au", "aw",
	// "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo",
	// "bq", "br", "bs", "bw", "by", "bz", "ca", "cd", "cf", "cg", "ch", "ci", "cl",
	// "cm", "cn", "co", "cr", "cv", "cw", "cy", "cz", "de", "dj", "dk", "dm", "do",
	// "dz", "ec", "ee", "eg", "es", "et", "fi", "fj", "fr", "ga", "gb", "gd", "ge",
	// "gf", "gg", "gh", "gm", "gn", "gp", "gq", "gr", "gt", "gu", "gw", "gy", "hk",
	// "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "iq", "ir", "is", "it",
	// "je", "jm", "jo", "jp", "ke", "kg", "kh", "kn", "kr", "kw", "ky", "kz", "la",
	// "lb", "lc", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
	// "mf", "mg", "mk", "ml", "mm", "mn", "mo", "mq", "mr", "mt", "mu", "mv", "mw",
	// "mx", "my", "mz", "na", "nc", "ne", "ng", "ni", "nl", "no", "np", "nz", "om",
	// "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pr", "ps", "pt", "py", "qa", "re",
	// "ro", "rs", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm",
	// "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tg", "th",
	// "tj", "tl", "tm", "tn", "tr", "tt", "tw", "tz", "ua", "ug", "us", "uy", "uz",
	// "vc", "ve", "vg", "vi", "vn", "ye", "yt", "za", "zm", "zw".
	Country WebScreenshotParamsCountry `query:"country,omitzero" json:"-"`
	// Optional parameter to determine screenshot type. If 'true', takes a full page
	// screenshot capturing all content. If 'false' or not provided, takes a viewport
	// screenshot (standard browser view).
	//
	// Any of "true", "false".
	FullScreenshot WebScreenshotParamsFullScreenshot `query:"fullScreenshot,omitzero" json:"-"`
	// Optional outbound HTTP headers, using the same JSON object or deep-object query
	// format as other scrape endpoints (for example headers[Authorization]=Bearer
	// token). Headers are scoped to the target origin during capture. For domain/page
	// requests, discovery receives no custom headers and only pages on the resolved
	// origin are eligible. Non-empty headers bypass screenshot caching and return an
	// in-memory data URL; no screenshot is uploaded. Empty objects behave like omitted
	// headers.
	Headers map[string]string `query:"headers,omitzero" json:"-"`
	// Optional parameter to specify which page type to screenshot. If provided, the
	// system will scrape the domain's links and use heuristics to find the most
	// appropriate URL for the specified page type (30 supported languages). If not
	// provided, screenshots the main domain landing page. Only applicable when using
	// 'domain', not 'directUrl'.
	//
	// Any of "login", "signup", "blog", "careers", "pricing", "terms", "privacy",
	// "contact".
	Page WebScreenshotParamsPage `query:"page,omitzero" json:"-"`
	// Comma-separated labels for filtering usage, e.g. `production,team-alpha`.
	Tags []string `query:"tags,omitzero" json:"-"`
	// Request deadline and what to return when it passes.
	TimeoutOpts WebScreenshotParamsTimeoutOpts `query:"timeoutOpts,omitzero" json:"-"`
	// Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.
	Viewport WebScreenshotParamsViewport `query:"viewport,omitzero" json:"-"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr WebScreenshotParamsZdr `query:"zdr,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebScreenshotParams) URLQuery

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

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

type WebScreenshotParamsColorScheme

type WebScreenshotParamsColorScheme string

Optional parameter to choose the site's visual theme in the screenshot. Use 'light' or 'dark' when the site offers both appearances.

const (
	WebScreenshotParamsColorSchemeLight WebScreenshotParamsColorScheme = "light"
	WebScreenshotParamsColorSchemeDark  WebScreenshotParamsColorScheme = "dark"
)

type WebScreenshotParamsCountry

type WebScreenshotParamsCountry string

Fetch from this country (ISO 3166-1 alpha-2).

const (
	WebScreenshotParamsCountryAd WebScreenshotParamsCountry = "ad"
	WebScreenshotParamsCountryAe WebScreenshotParamsCountry = "ae"
	WebScreenshotParamsCountryAf WebScreenshotParamsCountry = "af"
	WebScreenshotParamsCountryAg WebScreenshotParamsCountry = "ag"
	WebScreenshotParamsCountryAI WebScreenshotParamsCountry = "ai"
	WebScreenshotParamsCountryAl WebScreenshotParamsCountry = "al"
	WebScreenshotParamsCountryAm WebScreenshotParamsCountry = "am"
	WebScreenshotParamsCountryAo WebScreenshotParamsCountry = "ao"
	WebScreenshotParamsCountryAr WebScreenshotParamsCountry = "ar"
	WebScreenshotParamsCountryAt WebScreenshotParamsCountry = "at"
	WebScreenshotParamsCountryAu WebScreenshotParamsCountry = "au"
	WebScreenshotParamsCountryAw WebScreenshotParamsCountry = "aw"
	WebScreenshotParamsCountryAz WebScreenshotParamsCountry = "az"
	WebScreenshotParamsCountryBa WebScreenshotParamsCountry = "ba"
	WebScreenshotParamsCountryBb WebScreenshotParamsCountry = "bb"
	WebScreenshotParamsCountryBd WebScreenshotParamsCountry = "bd"
	WebScreenshotParamsCountryBe WebScreenshotParamsCountry = "be"
	WebScreenshotParamsCountryBf WebScreenshotParamsCountry = "bf"
	WebScreenshotParamsCountryBg WebScreenshotParamsCountry = "bg"
	WebScreenshotParamsCountryBh WebScreenshotParamsCountry = "bh"
	WebScreenshotParamsCountryBi WebScreenshotParamsCountry = "bi"
	WebScreenshotParamsCountryBj WebScreenshotParamsCountry = "bj"
	WebScreenshotParamsCountryBm WebScreenshotParamsCountry = "bm"
	WebScreenshotParamsCountryBn WebScreenshotParamsCountry = "bn"
	WebScreenshotParamsCountryBo WebScreenshotParamsCountry = "bo"
	WebScreenshotParamsCountryBq WebScreenshotParamsCountry = "bq"
	WebScreenshotParamsCountryBr WebScreenshotParamsCountry = "br"
	WebScreenshotParamsCountryBs WebScreenshotParamsCountry = "bs"
	WebScreenshotParamsCountryBw WebScreenshotParamsCountry = "bw"
	WebScreenshotParamsCountryBy WebScreenshotParamsCountry = "by"
	WebScreenshotParamsCountryBz WebScreenshotParamsCountry = "bz"
	WebScreenshotParamsCountryCa WebScreenshotParamsCountry = "ca"
	WebScreenshotParamsCountryCd WebScreenshotParamsCountry = "cd"
	WebScreenshotParamsCountryCf WebScreenshotParamsCountry = "cf"
	WebScreenshotParamsCountryCg WebScreenshotParamsCountry = "cg"
	WebScreenshotParamsCountryCh WebScreenshotParamsCountry = "ch"
	WebScreenshotParamsCountryCi WebScreenshotParamsCountry = "ci"
	WebScreenshotParamsCountryCl WebScreenshotParamsCountry = "cl"
	WebScreenshotParamsCountryCm WebScreenshotParamsCountry = "cm"
	WebScreenshotParamsCountryCn WebScreenshotParamsCountry = "cn"
	WebScreenshotParamsCountryCo WebScreenshotParamsCountry = "co"
	WebScreenshotParamsCountryCr WebScreenshotParamsCountry = "cr"
	WebScreenshotParamsCountryCv WebScreenshotParamsCountry = "cv"
	WebScreenshotParamsCountryCw WebScreenshotParamsCountry = "cw"
	WebScreenshotParamsCountryCy WebScreenshotParamsCountry = "cy"
	WebScreenshotParamsCountryCz WebScreenshotParamsCountry = "cz"
	WebScreenshotParamsCountryDe WebScreenshotParamsCountry = "de"
	WebScreenshotParamsCountryDj WebScreenshotParamsCountry = "dj"
	WebScreenshotParamsCountryDk WebScreenshotParamsCountry = "dk"
	WebScreenshotParamsCountryDm WebScreenshotParamsCountry = "dm"
	WebScreenshotParamsCountryDo WebScreenshotParamsCountry = "do"
	WebScreenshotParamsCountryDz WebScreenshotParamsCountry = "dz"
	WebScreenshotParamsCountryEc WebScreenshotParamsCountry = "ec"
	WebScreenshotParamsCountryEe WebScreenshotParamsCountry = "ee"
	WebScreenshotParamsCountryEg WebScreenshotParamsCountry = "eg"
	WebScreenshotParamsCountryEs WebScreenshotParamsCountry = "es"
	WebScreenshotParamsCountryEt WebScreenshotParamsCountry = "et"
	WebScreenshotParamsCountryFi WebScreenshotParamsCountry = "fi"
	WebScreenshotParamsCountryFj WebScreenshotParamsCountry = "fj"
	WebScreenshotParamsCountryFr WebScreenshotParamsCountry = "fr"
	WebScreenshotParamsCountryGa WebScreenshotParamsCountry = "ga"
	WebScreenshotParamsCountryGB WebScreenshotParamsCountry = "gb"
	WebScreenshotParamsCountryGd WebScreenshotParamsCountry = "gd"
	WebScreenshotParamsCountryGe WebScreenshotParamsCountry = "ge"
	WebScreenshotParamsCountryGf WebScreenshotParamsCountry = "gf"
	WebScreenshotParamsCountryGg WebScreenshotParamsCountry = "gg"
	WebScreenshotParamsCountryGh WebScreenshotParamsCountry = "gh"
	WebScreenshotParamsCountryGm WebScreenshotParamsCountry = "gm"
	WebScreenshotParamsCountryGn WebScreenshotParamsCountry = "gn"
	WebScreenshotParamsCountryGp WebScreenshotParamsCountry = "gp"
	WebScreenshotParamsCountryGq WebScreenshotParamsCountry = "gq"
	WebScreenshotParamsCountryGr WebScreenshotParamsCountry = "gr"
	WebScreenshotParamsCountryGt WebScreenshotParamsCountry = "gt"
	WebScreenshotParamsCountryGu WebScreenshotParamsCountry = "gu"
	WebScreenshotParamsCountryGw WebScreenshotParamsCountry = "gw"
	WebScreenshotParamsCountryGy WebScreenshotParamsCountry = "gy"
	WebScreenshotParamsCountryHk WebScreenshotParamsCountry = "hk"
	WebScreenshotParamsCountryHn WebScreenshotParamsCountry = "hn"
	WebScreenshotParamsCountryHr WebScreenshotParamsCountry = "hr"
	WebScreenshotParamsCountryHt WebScreenshotParamsCountry = "ht"
	WebScreenshotParamsCountryHu WebScreenshotParamsCountry = "hu"
	WebScreenshotParamsCountryID WebScreenshotParamsCountry = "id"
	WebScreenshotParamsCountryIe WebScreenshotParamsCountry = "ie"
	WebScreenshotParamsCountryIl WebScreenshotParamsCountry = "il"
	WebScreenshotParamsCountryIm WebScreenshotParamsCountry = "im"
	WebScreenshotParamsCountryIn WebScreenshotParamsCountry = "in"
	WebScreenshotParamsCountryIq WebScreenshotParamsCountry = "iq"
	WebScreenshotParamsCountryIr WebScreenshotParamsCountry = "ir"
	WebScreenshotParamsCountryIs WebScreenshotParamsCountry = "is"
	WebScreenshotParamsCountryIt WebScreenshotParamsCountry = "it"
	WebScreenshotParamsCountryJe WebScreenshotParamsCountry = "je"
	WebScreenshotParamsCountryJm WebScreenshotParamsCountry = "jm"
	WebScreenshotParamsCountryJo WebScreenshotParamsCountry = "jo"
	WebScreenshotParamsCountryJp WebScreenshotParamsCountry = "jp"
	WebScreenshotParamsCountryKe WebScreenshotParamsCountry = "ke"
	WebScreenshotParamsCountryKg WebScreenshotParamsCountry = "kg"
	WebScreenshotParamsCountryKh WebScreenshotParamsCountry = "kh"
	WebScreenshotParamsCountryKn WebScreenshotParamsCountry = "kn"
	WebScreenshotParamsCountryKr WebScreenshotParamsCountry = "kr"
	WebScreenshotParamsCountryKw WebScreenshotParamsCountry = "kw"
	WebScreenshotParamsCountryKy WebScreenshotParamsCountry = "ky"
	WebScreenshotParamsCountryKz WebScreenshotParamsCountry = "kz"
	WebScreenshotParamsCountryLa WebScreenshotParamsCountry = "la"
	WebScreenshotParamsCountryLb WebScreenshotParamsCountry = "lb"
	WebScreenshotParamsCountryLc WebScreenshotParamsCountry = "lc"
	WebScreenshotParamsCountryLk WebScreenshotParamsCountry = "lk"
	WebScreenshotParamsCountryLr WebScreenshotParamsCountry = "lr"
	WebScreenshotParamsCountryLs WebScreenshotParamsCountry = "ls"
	WebScreenshotParamsCountryLt WebScreenshotParamsCountry = "lt"
	WebScreenshotParamsCountryLu WebScreenshotParamsCountry = "lu"
	WebScreenshotParamsCountryLv WebScreenshotParamsCountry = "lv"
	WebScreenshotParamsCountryLy WebScreenshotParamsCountry = "ly"
	WebScreenshotParamsCountryMa WebScreenshotParamsCountry = "ma"
	WebScreenshotParamsCountryMc WebScreenshotParamsCountry = "mc"
	WebScreenshotParamsCountryMd WebScreenshotParamsCountry = "md"
	WebScreenshotParamsCountryMe WebScreenshotParamsCountry = "me"
	WebScreenshotParamsCountryMf WebScreenshotParamsCountry = "mf"
	WebScreenshotParamsCountryMg WebScreenshotParamsCountry = "mg"
	WebScreenshotParamsCountryMk WebScreenshotParamsCountry = "mk"
	WebScreenshotParamsCountryMl WebScreenshotParamsCountry = "ml"
	WebScreenshotParamsCountryMm WebScreenshotParamsCountry = "mm"
	WebScreenshotParamsCountryMn WebScreenshotParamsCountry = "mn"
	WebScreenshotParamsCountryMo WebScreenshotParamsCountry = "mo"
	WebScreenshotParamsCountryMq WebScreenshotParamsCountry = "mq"
	WebScreenshotParamsCountryMr WebScreenshotParamsCountry = "mr"
	WebScreenshotParamsCountryMt WebScreenshotParamsCountry = "mt"
	WebScreenshotParamsCountryMu WebScreenshotParamsCountry = "mu"
	WebScreenshotParamsCountryMv WebScreenshotParamsCountry = "mv"
	WebScreenshotParamsCountryMw WebScreenshotParamsCountry = "mw"
	WebScreenshotParamsCountryMx WebScreenshotParamsCountry = "mx"
	WebScreenshotParamsCountryMy WebScreenshotParamsCountry = "my"
	WebScreenshotParamsCountryMz WebScreenshotParamsCountry = "mz"
	WebScreenshotParamsCountryNa WebScreenshotParamsCountry = "na"
	WebScreenshotParamsCountryNc WebScreenshotParamsCountry = "nc"
	WebScreenshotParamsCountryNe WebScreenshotParamsCountry = "ne"
	WebScreenshotParamsCountryNg WebScreenshotParamsCountry = "ng"
	WebScreenshotParamsCountryNi WebScreenshotParamsCountry = "ni"
	WebScreenshotParamsCountryNl WebScreenshotParamsCountry = "nl"
	WebScreenshotParamsCountryNo WebScreenshotParamsCountry = "no"
	WebScreenshotParamsCountryNp WebScreenshotParamsCountry = "np"
	WebScreenshotParamsCountryNz WebScreenshotParamsCountry = "nz"
	WebScreenshotParamsCountryOm WebScreenshotParamsCountry = "om"
	WebScreenshotParamsCountryPa WebScreenshotParamsCountry = "pa"
	WebScreenshotParamsCountryPe WebScreenshotParamsCountry = "pe"
	WebScreenshotParamsCountryPf WebScreenshotParamsCountry = "pf"
	WebScreenshotParamsCountryPg WebScreenshotParamsCountry = "pg"
	WebScreenshotParamsCountryPh WebScreenshotParamsCountry = "ph"
	WebScreenshotParamsCountryPk WebScreenshotParamsCountry = "pk"
	WebScreenshotParamsCountryPl WebScreenshotParamsCountry = "pl"
	WebScreenshotParamsCountryPr WebScreenshotParamsCountry = "pr"
	WebScreenshotParamsCountryPs WebScreenshotParamsCountry = "ps"
	WebScreenshotParamsCountryPt WebScreenshotParamsCountry = "pt"
	WebScreenshotParamsCountryPy WebScreenshotParamsCountry = "py"
	WebScreenshotParamsCountryQa WebScreenshotParamsCountry = "qa"
	WebScreenshotParamsCountryRe WebScreenshotParamsCountry = "re"
	WebScreenshotParamsCountryRo WebScreenshotParamsCountry = "ro"
	WebScreenshotParamsCountryRs WebScreenshotParamsCountry = "rs"
	WebScreenshotParamsCountryRu WebScreenshotParamsCountry = "ru"
	WebScreenshotParamsCountryRw WebScreenshotParamsCountry = "rw"
	WebScreenshotParamsCountrySa WebScreenshotParamsCountry = "sa"
	WebScreenshotParamsCountrySc WebScreenshotParamsCountry = "sc"
	WebScreenshotParamsCountrySd WebScreenshotParamsCountry = "sd"
	WebScreenshotParamsCountrySe WebScreenshotParamsCountry = "se"
	WebScreenshotParamsCountrySg WebScreenshotParamsCountry = "sg"
	WebScreenshotParamsCountrySi WebScreenshotParamsCountry = "si"
	WebScreenshotParamsCountrySk WebScreenshotParamsCountry = "sk"
	WebScreenshotParamsCountrySl WebScreenshotParamsCountry = "sl"
	WebScreenshotParamsCountrySm WebScreenshotParamsCountry = "sm"
	WebScreenshotParamsCountrySn WebScreenshotParamsCountry = "sn"
	WebScreenshotParamsCountrySo WebScreenshotParamsCountry = "so"
	WebScreenshotParamsCountrySr WebScreenshotParamsCountry = "sr"
	WebScreenshotParamsCountrySS WebScreenshotParamsCountry = "ss"
	WebScreenshotParamsCountrySt WebScreenshotParamsCountry = "st"
	WebScreenshotParamsCountrySv WebScreenshotParamsCountry = "sv"
	WebScreenshotParamsCountrySx WebScreenshotParamsCountry = "sx"
	WebScreenshotParamsCountrySy WebScreenshotParamsCountry = "sy"
	WebScreenshotParamsCountrySz WebScreenshotParamsCountry = "sz"
	WebScreenshotParamsCountryTc WebScreenshotParamsCountry = "tc"
	WebScreenshotParamsCountryTd WebScreenshotParamsCountry = "td"
	WebScreenshotParamsCountryTg WebScreenshotParamsCountry = "tg"
	WebScreenshotParamsCountryTh WebScreenshotParamsCountry = "th"
	WebScreenshotParamsCountryTj WebScreenshotParamsCountry = "tj"
	WebScreenshotParamsCountryTl WebScreenshotParamsCountry = "tl"
	WebScreenshotParamsCountryTm WebScreenshotParamsCountry = "tm"
	WebScreenshotParamsCountryTn WebScreenshotParamsCountry = "tn"
	WebScreenshotParamsCountryTr WebScreenshotParamsCountry = "tr"
	WebScreenshotParamsCountryTt WebScreenshotParamsCountry = "tt"
	WebScreenshotParamsCountryTw WebScreenshotParamsCountry = "tw"
	WebScreenshotParamsCountryTz WebScreenshotParamsCountry = "tz"
	WebScreenshotParamsCountryUa WebScreenshotParamsCountry = "ua"
	WebScreenshotParamsCountryUg WebScreenshotParamsCountry = "ug"
	WebScreenshotParamsCountryUs WebScreenshotParamsCountry = "us"
	WebScreenshotParamsCountryUy WebScreenshotParamsCountry = "uy"
	WebScreenshotParamsCountryUz WebScreenshotParamsCountry = "uz"
	WebScreenshotParamsCountryVc WebScreenshotParamsCountry = "vc"
	WebScreenshotParamsCountryVe WebScreenshotParamsCountry = "ve"
	WebScreenshotParamsCountryVg WebScreenshotParamsCountry = "vg"
	WebScreenshotParamsCountryVi WebScreenshotParamsCountry = "vi"
	WebScreenshotParamsCountryVn WebScreenshotParamsCountry = "vn"
	WebScreenshotParamsCountryYe WebScreenshotParamsCountry = "ye"
	WebScreenshotParamsCountryYt WebScreenshotParamsCountry = "yt"
	WebScreenshotParamsCountryZa WebScreenshotParamsCountry = "za"
	WebScreenshotParamsCountryZm WebScreenshotParamsCountry = "zm"
	WebScreenshotParamsCountryZw WebScreenshotParamsCountry = "zw"
)

type WebScreenshotParamsFullScreenshot

type WebScreenshotParamsFullScreenshot string

Optional parameter to determine screenshot type. If 'true', takes a full page screenshot capturing all content. If 'false' or not provided, takes a viewport screenshot (standard browser view).

const (
	WebScreenshotParamsFullScreenshotTrue  WebScreenshotParamsFullScreenshot = "true"
	WebScreenshotParamsFullScreenshotFalse WebScreenshotParamsFullScreenshot = "false"
)

type WebScreenshotParamsPage

type WebScreenshotParamsPage string

Optional parameter to specify which page type to screenshot. If provided, the system will scrape the domain's links and use heuristics to find the most appropriate URL for the specified page type (30 supported languages). If not provided, screenshots the main domain landing page. Only applicable when using 'domain', not 'directUrl'.

const (
	WebScreenshotParamsPageLogin   WebScreenshotParamsPage = "login"
	WebScreenshotParamsPageSignup  WebScreenshotParamsPage = "signup"
	WebScreenshotParamsPageBlog    WebScreenshotParamsPage = "blog"
	WebScreenshotParamsPageCareers WebScreenshotParamsPage = "careers"
	WebScreenshotParamsPagePricing WebScreenshotParamsPage = "pricing"
	WebScreenshotParamsPageTerms   WebScreenshotParamsPage = "terms"
	WebScreenshotParamsPagePrivacy WebScreenshotParamsPage = "privacy"
	WebScreenshotParamsPageContact WebScreenshotParamsPage = "contact"
)

type WebScreenshotParamsTimeoutOpts added in v2.17.0

type WebScreenshotParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `query:"milliseconds" api:"required" json:"-"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag. "return-partial" requires at least 5000 ms.
	//
	// Any of "fail", "return-partial".
	Behavior string `query:"behavior,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (WebScreenshotParamsTimeoutOpts) URLQuery added in v2.17.0

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

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

type WebScreenshotParamsViewport

type WebScreenshotParamsViewport struct {
	// Viewport height in pixels.
	Height param.Opt[int64] `query:"height,omitzero" json:"-"`
	// Viewport width in pixels.
	Width param.Opt[int64] `query:"width,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Optional browser viewport dimensions for the screenshot. Defaults to 1920x1080.

func (WebScreenshotParamsViewport) URLQuery

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

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

type WebScreenshotParamsZdr added in v2.5.0

type WebScreenshotParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	WebScreenshotParamsZdrEnabled  WebScreenshotParamsZdr = "enabled"
	WebScreenshotParamsZdrDisabled WebScreenshotParamsZdr = "disabled"
)

type WebScreenshotResponse

type WebScreenshotResponse struct {
	// Whether this response came from cache.
	CacheMetadata WebScreenshotResponseCacheMetadata `json:"cache_metadata" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// HTTP status code
	Code int64 `json:"code"`
	// The normalized domain that was processed
	Domain string `json:"domain"`
	// `loaded`, or `still-loading` when capture ended before the page finished
	// loading.
	//
	// Any of "loaded", "still-loading".
	FinalDomState WebScreenshotResponseFinalDomState `json:"finalDOMState"`
	// Height in pixels of the returned screenshot image
	Height int64 `json:"height"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebScreenshotResponseKeyMetadata `json:"key_metadata"`
	// Public image URL for standard requests, or an in-memory data URL when ZDR or
	// non-empty custom headers are supplied.
	Screenshot string `json:"screenshot"`
	// Type of screenshot that was captured
	//
	// Any of "viewport", "fullPage".
	ScreenshotType WebScreenshotResponseScreenshotType `json:"screenshotType"`
	// Always `ok` on success.
	Status string `json:"status"`
	// Width in pixels of the returned screenshot image
	Width int64 `json:"width"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheMetadata  respjson.Field
		RequestID      respjson.Field
		Code           respjson.Field
		Domain         respjson.Field
		FinalDomState  respjson.Field
		Height         respjson.Field
		KeyMetadata    respjson.Field
		Screenshot     respjson.Field
		ScreenshotType respjson.Field
		Status         respjson.Field
		Width          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebScreenshotResponse) RawJSON

func (r WebScreenshotResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebScreenshotResponse) UnmarshalJSON

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

type WebScreenshotResponseCacheMetadata added in v2.13.0

type WebScreenshotResponseCacheMetadata struct {
	// Age of the cached data in milliseconds. Zero for miss and zdr responses.
	AgeMs int64 `json:"age_ms" api:"required"`
	// Whether the response was served from cache, required fresh work, or honored
	// zero-data-retention cache bypass.
	//
	// Any of "hit", "miss", "zdr".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AgeMs       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Whether this response came from cache.

func (WebScreenshotResponseCacheMetadata) RawJSON added in v2.13.0

Returns the unmodified JSON received from the API

func (*WebScreenshotResponseCacheMetadata) UnmarshalJSON added in v2.13.0

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

type WebScreenshotResponseFinalDomState added in v2.17.0

type WebScreenshotResponseFinalDomState string

`loaded`, or `still-loading` when capture ended before the page finished loading.

const (
	WebScreenshotResponseFinalDomStateLoaded       WebScreenshotResponseFinalDomState = "loaded"
	WebScreenshotResponseFinalDomStateStillLoading WebScreenshotResponseFinalDomState = "still-loading"
)

type WebScreenshotResponseKeyMetadata

type WebScreenshotResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebScreenshotResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebScreenshotResponseKeyMetadata) UnmarshalJSON

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

type WebScreenshotResponseScreenshotType

type WebScreenshotResponseScreenshotType string

Type of screenshot that was captured

const (
	WebScreenshotResponseScreenshotTypeViewport WebScreenshotResponseScreenshotType = "viewport"
	WebScreenshotResponseScreenshotTypeFullPage WebScreenshotResponseScreenshotType = "fullPage"
)

type WebSearchParams

type WebSearchParams struct {
	// Search query. Accepts natural language as well as Google-style search operators
	// such as `site:`, `-site:`, `inurl:`, `intitle:`, quoted phrases, and `OR`.
	Query string `json:"query" api:"required"`
	// Maximum length of each result's `description`, in characters.
	DescriptionMaxCharacters param.Opt[int64] `json:"descriptionMaxCharacters,omitzero"`
	// Number of results to request and return (10–100). Defaults to 10.
	NumResults param.Opt[int64] `json:"numResults,omitzero"`
	// Currently has no effect.
	QueryFanout param.Opt[bool] `json:"queryFanout,omitzero"`
	// Passages from each result page that are relevant to the query. Pages are read
	// with the `markdownOptions` settings.
	HighlightsOptions WebSearchParamsHighlightsOptions `json:"highlightsOptions,omitzero"`
	// Inline Markdown scraping for each result. Set `enabled: true` to activate.
	MarkdownOptions WebSearchParamsMarkdownOptions `json:"markdownOptions,omitzero"`
	// Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific
	// country (maps to Google's `gl` parameter). Example: "us", "gb", "de".
	//
	// Any of "af", "al", "dz", "as", "ad", "ao", "ai", "aq", "ag", "ar", "am", "aw",
	// "au", "at", "az", "bs", "bh", "bd", "bb", "by", "be", "bz", "bj", "bm", "bt",
	// "bo", "ba", "bw", "bv", "br", "io", "bn", "bg", "bf", "bi", "kh", "cm", "ca",
	// "cv", "ky", "cf", "td", "cl", "cn", "cx", "cc", "co", "km", "cg", "cd", "ck",
	// "cr", "ci", "hr", "cu", "cy", "cz", "dk", "dj", "dm", "do", "ec", "eg", "sv",
	// "gq", "er", "ee", "et", "fk", "fo", "fj", "fi", "fr", "gf", "pf", "tf", "ga",
	// "gm", "ge", "de", "gh", "gi", "gr", "gl", "gd", "gp", "gu", "gt", "gn", "gw",
	// "gy", "ht", "hm", "va", "hn", "hk", "hu", "is", "in", "id", "ir", "iq", "ie",
	// "il", "it", "jm", "jp", "jo", "kz", "ke", "ki", "kp", "kr", "kw", "kg", "la",
	// "lv", "lb", "ls", "lr", "ly", "li", "lt", "lu", "mo", "mk", "mg", "mw", "my",
	// "mv", "ml", "mt", "mh", "mq", "mr", "mu", "yt", "mx", "fm", "md", "mc", "mn",
	// "ms", "ma", "mz", "mm", "na", "nr", "np", "nl", "an", "nc", "nz", "ni", "ne",
	// "ng", "nu", "nf", "mp", "no", "om", "pk", "pw", "ps", "pa", "pg", "py", "pe",
	// "ph", "pn", "pl", "pt", "pr", "qa", "re", "ro", "ru", "rw", "sh", "kn", "lc",
	// "pm", "vc", "ws", "sm", "st", "sa", "sn", "rs", "sc", "sl", "sg", "sk", "si",
	// "sb", "so", "za", "gs", "es", "lk", "sd", "sr", "sj", "sz", "se", "ch", "sy",
	// "tw", "tj", "tz", "th", "tl", "tg", "tk", "to", "tt", "tn", "tr", "tm", "tc",
	// "tv", "ug", "ua", "ae", "gb", "us", "um", "uy", "uz", "vu", "ve", "vn", "vg",
	// "vi", "wf", "eh", "ye", "zm", "zw".
	Country WebSearchParamsCountry `json:"country,omitzero"`
	// Blocklist — drop results from these domains. Up to 100 domains. Example:
	// ["pinterest.com", "reddit.com"].
	ExcludeDomains []string `json:"excludeDomains,omitzero"`
	// Restrict results to content published within this window.
	//
	// Any of "last_24_hours", "last_week", "last_month", "last_year".
	Freshness WebSearchParamsFreshness `json:"freshness,omitzero"`
	// Allowlist — only return results from these domains. Up to 100 domains. Example:
	// ["arxiv.org", "github.com"].
	IncludeDomains []string `json:"includeDomains,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts WebSearchParamsTimeoutOpts `json:"timeoutOpts,omitzero"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr WebSearchParamsZdr `json:"zdr,omitzero"`
	// contains filtered or unexported fields
}

func (WebSearchParams) MarshalJSON

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

func (*WebSearchParams) UnmarshalJSON

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

type WebSearchParamsCountry

type WebSearchParamsCountry string

Two-letter ISO 3166-1 alpha-2 country code to localize results to a specific country (maps to Google's `gl` parameter). Example: "us", "gb", "de".

const (
	WebSearchParamsCountryAf WebSearchParamsCountry = "af"
	WebSearchParamsCountryAl WebSearchParamsCountry = "al"
	WebSearchParamsCountryDz WebSearchParamsCountry = "dz"
	WebSearchParamsCountryAs WebSearchParamsCountry = "as"
	WebSearchParamsCountryAd WebSearchParamsCountry = "ad"
	WebSearchParamsCountryAo WebSearchParamsCountry = "ao"
	WebSearchParamsCountryAI WebSearchParamsCountry = "ai"
	WebSearchParamsCountryAq WebSearchParamsCountry = "aq"
	WebSearchParamsCountryAg WebSearchParamsCountry = "ag"
	WebSearchParamsCountryAr WebSearchParamsCountry = "ar"
	WebSearchParamsCountryAm WebSearchParamsCountry = "am"
	WebSearchParamsCountryAw WebSearchParamsCountry = "aw"
	WebSearchParamsCountryAu WebSearchParamsCountry = "au"
	WebSearchParamsCountryAt WebSearchParamsCountry = "at"
	WebSearchParamsCountryAz WebSearchParamsCountry = "az"
	WebSearchParamsCountryBs WebSearchParamsCountry = "bs"
	WebSearchParamsCountryBh WebSearchParamsCountry = "bh"
	WebSearchParamsCountryBd WebSearchParamsCountry = "bd"
	WebSearchParamsCountryBb WebSearchParamsCountry = "bb"
	WebSearchParamsCountryBy WebSearchParamsCountry = "by"
	WebSearchParamsCountryBe WebSearchParamsCountry = "be"
	WebSearchParamsCountryBz WebSearchParamsCountry = "bz"
	WebSearchParamsCountryBj WebSearchParamsCountry = "bj"
	WebSearchParamsCountryBm WebSearchParamsCountry = "bm"
	WebSearchParamsCountryBt WebSearchParamsCountry = "bt"
	WebSearchParamsCountryBo WebSearchParamsCountry = "bo"
	WebSearchParamsCountryBa WebSearchParamsCountry = "ba"
	WebSearchParamsCountryBw WebSearchParamsCountry = "bw"
	WebSearchParamsCountryBv WebSearchParamsCountry = "bv"
	WebSearchParamsCountryBr WebSearchParamsCountry = "br"
	WebSearchParamsCountryIo WebSearchParamsCountry = "io"
	WebSearchParamsCountryBn WebSearchParamsCountry = "bn"
	WebSearchParamsCountryBg WebSearchParamsCountry = "bg"
	WebSearchParamsCountryBf WebSearchParamsCountry = "bf"
	WebSearchParamsCountryBi WebSearchParamsCountry = "bi"
	WebSearchParamsCountryKh WebSearchParamsCountry = "kh"
	WebSearchParamsCountryCm WebSearchParamsCountry = "cm"
	WebSearchParamsCountryCa WebSearchParamsCountry = "ca"
	WebSearchParamsCountryCv WebSearchParamsCountry = "cv"
	WebSearchParamsCountryKy WebSearchParamsCountry = "ky"
	WebSearchParamsCountryCf WebSearchParamsCountry = "cf"
	WebSearchParamsCountryTd WebSearchParamsCountry = "td"
	WebSearchParamsCountryCl WebSearchParamsCountry = "cl"
	WebSearchParamsCountryCn WebSearchParamsCountry = "cn"
	WebSearchParamsCountryCx WebSearchParamsCountry = "cx"
	WebSearchParamsCountryCc WebSearchParamsCountry = "cc"
	WebSearchParamsCountryCo WebSearchParamsCountry = "co"
	WebSearchParamsCountryKm WebSearchParamsCountry = "km"
	WebSearchParamsCountryCg WebSearchParamsCountry = "cg"
	WebSearchParamsCountryCd WebSearchParamsCountry = "cd"
	WebSearchParamsCountryCk WebSearchParamsCountry = "ck"
	WebSearchParamsCountryCr WebSearchParamsCountry = "cr"
	WebSearchParamsCountryCi WebSearchParamsCountry = "ci"
	WebSearchParamsCountryHr WebSearchParamsCountry = "hr"
	WebSearchParamsCountryCu WebSearchParamsCountry = "cu"
	WebSearchParamsCountryCy WebSearchParamsCountry = "cy"
	WebSearchParamsCountryCz WebSearchParamsCountry = "cz"
	WebSearchParamsCountryDk WebSearchParamsCountry = "dk"
	WebSearchParamsCountryDj WebSearchParamsCountry = "dj"
	WebSearchParamsCountryDm WebSearchParamsCountry = "dm"
	WebSearchParamsCountryDo WebSearchParamsCountry = "do"
	WebSearchParamsCountryEc WebSearchParamsCountry = "ec"
	WebSearchParamsCountryEg WebSearchParamsCountry = "eg"
	WebSearchParamsCountrySv WebSearchParamsCountry = "sv"
	WebSearchParamsCountryGq WebSearchParamsCountry = "gq"
	WebSearchParamsCountryEr WebSearchParamsCountry = "er"
	WebSearchParamsCountryEe WebSearchParamsCountry = "ee"
	WebSearchParamsCountryEt WebSearchParamsCountry = "et"
	WebSearchParamsCountryFk WebSearchParamsCountry = "fk"
	WebSearchParamsCountryFo WebSearchParamsCountry = "fo"
	WebSearchParamsCountryFj WebSearchParamsCountry = "fj"
	WebSearchParamsCountryFi WebSearchParamsCountry = "fi"
	WebSearchParamsCountryFr WebSearchParamsCountry = "fr"
	WebSearchParamsCountryGf WebSearchParamsCountry = "gf"
	WebSearchParamsCountryPf WebSearchParamsCountry = "pf"
	WebSearchParamsCountryTf WebSearchParamsCountry = "tf"
	WebSearchParamsCountryGa WebSearchParamsCountry = "ga"
	WebSearchParamsCountryGm WebSearchParamsCountry = "gm"
	WebSearchParamsCountryGe WebSearchParamsCountry = "ge"
	WebSearchParamsCountryDe WebSearchParamsCountry = "de"
	WebSearchParamsCountryGh WebSearchParamsCountry = "gh"
	WebSearchParamsCountryGi WebSearchParamsCountry = "gi"
	WebSearchParamsCountryGr WebSearchParamsCountry = "gr"
	WebSearchParamsCountryGl WebSearchParamsCountry = "gl"
	WebSearchParamsCountryGd WebSearchParamsCountry = "gd"
	WebSearchParamsCountryGp WebSearchParamsCountry = "gp"
	WebSearchParamsCountryGu WebSearchParamsCountry = "gu"
	WebSearchParamsCountryGt WebSearchParamsCountry = "gt"
	WebSearchParamsCountryGn WebSearchParamsCountry = "gn"
	WebSearchParamsCountryGw WebSearchParamsCountry = "gw"
	WebSearchParamsCountryGy WebSearchParamsCountry = "gy"
	WebSearchParamsCountryHt WebSearchParamsCountry = "ht"
	WebSearchParamsCountryHm WebSearchParamsCountry = "hm"
	WebSearchParamsCountryVa WebSearchParamsCountry = "va"
	WebSearchParamsCountryHn WebSearchParamsCountry = "hn"
	WebSearchParamsCountryHk WebSearchParamsCountry = "hk"
	WebSearchParamsCountryHu WebSearchParamsCountry = "hu"
	WebSearchParamsCountryIs WebSearchParamsCountry = "is"
	WebSearchParamsCountryIn WebSearchParamsCountry = "in"
	WebSearchParamsCountryID WebSearchParamsCountry = "id"
	WebSearchParamsCountryIr WebSearchParamsCountry = "ir"
	WebSearchParamsCountryIq WebSearchParamsCountry = "iq"
	WebSearchParamsCountryIe WebSearchParamsCountry = "ie"
	WebSearchParamsCountryIl WebSearchParamsCountry = "il"
	WebSearchParamsCountryIt WebSearchParamsCountry = "it"
	WebSearchParamsCountryJm WebSearchParamsCountry = "jm"
	WebSearchParamsCountryJp WebSearchParamsCountry = "jp"
	WebSearchParamsCountryJo WebSearchParamsCountry = "jo"
	WebSearchParamsCountryKz WebSearchParamsCountry = "kz"
	WebSearchParamsCountryKe WebSearchParamsCountry = "ke"
	WebSearchParamsCountryKi WebSearchParamsCountry = "ki"
	WebSearchParamsCountryKp WebSearchParamsCountry = "kp"
	WebSearchParamsCountryKr WebSearchParamsCountry = "kr"
	WebSearchParamsCountryKw WebSearchParamsCountry = "kw"
	WebSearchParamsCountryKg WebSearchParamsCountry = "kg"
	WebSearchParamsCountryLa WebSearchParamsCountry = "la"
	WebSearchParamsCountryLv WebSearchParamsCountry = "lv"
	WebSearchParamsCountryLb WebSearchParamsCountry = "lb"
	WebSearchParamsCountryLs WebSearchParamsCountry = "ls"
	WebSearchParamsCountryLr WebSearchParamsCountry = "lr"
	WebSearchParamsCountryLy WebSearchParamsCountry = "ly"
	WebSearchParamsCountryLi WebSearchParamsCountry = "li"
	WebSearchParamsCountryLt WebSearchParamsCountry = "lt"
	WebSearchParamsCountryLu WebSearchParamsCountry = "lu"
	WebSearchParamsCountryMo WebSearchParamsCountry = "mo"
	WebSearchParamsCountryMk WebSearchParamsCountry = "mk"
	WebSearchParamsCountryMg WebSearchParamsCountry = "mg"
	WebSearchParamsCountryMw WebSearchParamsCountry = "mw"
	WebSearchParamsCountryMy WebSearchParamsCountry = "my"
	WebSearchParamsCountryMv WebSearchParamsCountry = "mv"
	WebSearchParamsCountryMl WebSearchParamsCountry = "ml"
	WebSearchParamsCountryMt WebSearchParamsCountry = "mt"
	WebSearchParamsCountryMh WebSearchParamsCountry = "mh"
	WebSearchParamsCountryMq WebSearchParamsCountry = "mq"
	WebSearchParamsCountryMr WebSearchParamsCountry = "mr"
	WebSearchParamsCountryMu WebSearchParamsCountry = "mu"
	WebSearchParamsCountryYt WebSearchParamsCountry = "yt"
	WebSearchParamsCountryMx WebSearchParamsCountry = "mx"
	WebSearchParamsCountryFm WebSearchParamsCountry = "fm"
	WebSearchParamsCountryMd WebSearchParamsCountry = "md"
	WebSearchParamsCountryMc WebSearchParamsCountry = "mc"
	WebSearchParamsCountryMn WebSearchParamsCountry = "mn"
	WebSearchParamsCountryMs WebSearchParamsCountry = "ms"
	WebSearchParamsCountryMa WebSearchParamsCountry = "ma"
	WebSearchParamsCountryMz WebSearchParamsCountry = "mz"
	WebSearchParamsCountryMm WebSearchParamsCountry = "mm"
	WebSearchParamsCountryNa WebSearchParamsCountry = "na"
	WebSearchParamsCountryNr WebSearchParamsCountry = "nr"
	WebSearchParamsCountryNp WebSearchParamsCountry = "np"
	WebSearchParamsCountryNl WebSearchParamsCountry = "nl"
	WebSearchParamsCountryAn WebSearchParamsCountry = "an"
	WebSearchParamsCountryNc WebSearchParamsCountry = "nc"
	WebSearchParamsCountryNz WebSearchParamsCountry = "nz"
	WebSearchParamsCountryNi WebSearchParamsCountry = "ni"
	WebSearchParamsCountryNe WebSearchParamsCountry = "ne"
	WebSearchParamsCountryNg WebSearchParamsCountry = "ng"
	WebSearchParamsCountryNu WebSearchParamsCountry = "nu"
	WebSearchParamsCountryNf WebSearchParamsCountry = "nf"
	WebSearchParamsCountryMp WebSearchParamsCountry = "mp"
	WebSearchParamsCountryNo WebSearchParamsCountry = "no"
	WebSearchParamsCountryOm WebSearchParamsCountry = "om"
	WebSearchParamsCountryPk WebSearchParamsCountry = "pk"
	WebSearchParamsCountryPw WebSearchParamsCountry = "pw"
	WebSearchParamsCountryPs WebSearchParamsCountry = "ps"
	WebSearchParamsCountryPa WebSearchParamsCountry = "pa"
	WebSearchParamsCountryPg WebSearchParamsCountry = "pg"
	WebSearchParamsCountryPy WebSearchParamsCountry = "py"
	WebSearchParamsCountryPe WebSearchParamsCountry = "pe"
	WebSearchParamsCountryPh WebSearchParamsCountry = "ph"
	WebSearchParamsCountryPn WebSearchParamsCountry = "pn"
	WebSearchParamsCountryPl WebSearchParamsCountry = "pl"
	WebSearchParamsCountryPt WebSearchParamsCountry = "pt"
	WebSearchParamsCountryPr WebSearchParamsCountry = "pr"
	WebSearchParamsCountryQa WebSearchParamsCountry = "qa"
	WebSearchParamsCountryRe WebSearchParamsCountry = "re"
	WebSearchParamsCountryRo WebSearchParamsCountry = "ro"
	WebSearchParamsCountryRu WebSearchParamsCountry = "ru"
	WebSearchParamsCountryRw WebSearchParamsCountry = "rw"
	WebSearchParamsCountrySh WebSearchParamsCountry = "sh"
	WebSearchParamsCountryKn WebSearchParamsCountry = "kn"
	WebSearchParamsCountryLc WebSearchParamsCountry = "lc"
	WebSearchParamsCountryPm WebSearchParamsCountry = "pm"
	WebSearchParamsCountryVc WebSearchParamsCountry = "vc"
	WebSearchParamsCountryWs WebSearchParamsCountry = "ws"
	WebSearchParamsCountrySm WebSearchParamsCountry = "sm"
	WebSearchParamsCountrySt WebSearchParamsCountry = "st"
	WebSearchParamsCountrySa WebSearchParamsCountry = "sa"
	WebSearchParamsCountrySn WebSearchParamsCountry = "sn"
	WebSearchParamsCountryRs WebSearchParamsCountry = "rs"
	WebSearchParamsCountrySc WebSearchParamsCountry = "sc"
	WebSearchParamsCountrySl WebSearchParamsCountry = "sl"
	WebSearchParamsCountrySg WebSearchParamsCountry = "sg"
	WebSearchParamsCountrySk WebSearchParamsCountry = "sk"
	WebSearchParamsCountrySi WebSearchParamsCountry = "si"
	WebSearchParamsCountrySb WebSearchParamsCountry = "sb"
	WebSearchParamsCountrySo WebSearchParamsCountry = "so"
	WebSearchParamsCountryZa WebSearchParamsCountry = "za"
	WebSearchParamsCountryGs WebSearchParamsCountry = "gs"
	WebSearchParamsCountryEs WebSearchParamsCountry = "es"
	WebSearchParamsCountryLk WebSearchParamsCountry = "lk"
	WebSearchParamsCountrySd WebSearchParamsCountry = "sd"
	WebSearchParamsCountrySr WebSearchParamsCountry = "sr"
	WebSearchParamsCountrySj WebSearchParamsCountry = "sj"
	WebSearchParamsCountrySz WebSearchParamsCountry = "sz"
	WebSearchParamsCountrySe WebSearchParamsCountry = "se"
	WebSearchParamsCountryCh WebSearchParamsCountry = "ch"
	WebSearchParamsCountrySy WebSearchParamsCountry = "sy"
	WebSearchParamsCountryTw WebSearchParamsCountry = "tw"
	WebSearchParamsCountryTj WebSearchParamsCountry = "tj"
	WebSearchParamsCountryTz WebSearchParamsCountry = "tz"
	WebSearchParamsCountryTh WebSearchParamsCountry = "th"
	WebSearchParamsCountryTl WebSearchParamsCountry = "tl"
	WebSearchParamsCountryTg WebSearchParamsCountry = "tg"
	WebSearchParamsCountryTk WebSearchParamsCountry = "tk"
	WebSearchParamsCountryTo WebSearchParamsCountry = "to"
	WebSearchParamsCountryTt WebSearchParamsCountry = "tt"
	WebSearchParamsCountryTn WebSearchParamsCountry = "tn"
	WebSearchParamsCountryTr WebSearchParamsCountry = "tr"
	WebSearchParamsCountryTm WebSearchParamsCountry = "tm"
	WebSearchParamsCountryTc WebSearchParamsCountry = "tc"
	WebSearchParamsCountryTv WebSearchParamsCountry = "tv"
	WebSearchParamsCountryUg WebSearchParamsCountry = "ug"
	WebSearchParamsCountryUa WebSearchParamsCountry = "ua"
	WebSearchParamsCountryAe WebSearchParamsCountry = "ae"
	WebSearchParamsCountryGB WebSearchParamsCountry = "gb"
	WebSearchParamsCountryUs WebSearchParamsCountry = "us"
	WebSearchParamsCountryUm WebSearchParamsCountry = "um"
	WebSearchParamsCountryUy WebSearchParamsCountry = "uy"
	WebSearchParamsCountryUz WebSearchParamsCountry = "uz"
	WebSearchParamsCountryVu WebSearchParamsCountry = "vu"
	WebSearchParamsCountryVe WebSearchParamsCountry = "ve"
	WebSearchParamsCountryVn WebSearchParamsCountry = "vn"
	WebSearchParamsCountryVg WebSearchParamsCountry = "vg"
	WebSearchParamsCountryVi WebSearchParamsCountry = "vi"
	WebSearchParamsCountryWf WebSearchParamsCountry = "wf"
	WebSearchParamsCountryEh WebSearchParamsCountry = "eh"
	WebSearchParamsCountryYe WebSearchParamsCountry = "ye"
	WebSearchParamsCountryZm WebSearchParamsCountry = "zm"
	WebSearchParamsCountryZw WebSearchParamsCountry = "zw"
)

type WebSearchParamsFreshness

type WebSearchParamsFreshness string

Restrict results to content published within this window.

const (
	WebSearchParamsFreshnessLast24Hours WebSearchParamsFreshness = "last_24_hours"
	WebSearchParamsFreshnessLastWeek    WebSearchParamsFreshness = "last_week"
	WebSearchParamsFreshnessLastMonth   WebSearchParamsFreshness = "last_month"
	WebSearchParamsFreshnessLastYear    WebSearchParamsFreshness = "last_year"
)

type WebSearchParamsHighlightsOptions added in v2.22.0

type WebSearchParamsHighlightsOptions struct {
	// Return relevant passages for each result. Adds 1 credit per 10 results.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Maximum combined length of passages per result.
	MaxCharacters param.Opt[int64] `json:"maxCharacters,omitzero"`
	// contains filtered or unexported fields
}

Passages from each result page that are relevant to the query. Pages are read with the `markdownOptions` settings.

func (WebSearchParamsHighlightsOptions) MarshalJSON added in v2.22.0

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

func (*WebSearchParamsHighlightsOptions) UnmarshalJSON added in v2.22.0

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

type WebSearchParamsMarkdownOptions

type WebSearchParamsMarkdownOptions struct {
	// Maximum cache age in milliseconds for result page content. Defaults to 180 days
	// (15552000000 ms) when Markdown is requested, or 365 days (31536000000 ms) when
	// only highlights are requested. Explicit values override either default. Maximum:
	// 365 days. Set to 0 to force a fresh scrape.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Extra wait after page load before rendering, in ms (0–30000). Useful for
	// JS-heavy pages.
	WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"`
	// Scrape each result to Markdown. Adds 1 credit per 10 results.
	Enabled param.Opt[bool] `json:"enabled,omitzero"`
	// Render iframe contents into the Markdown.
	IncludeFrames param.Opt[bool] `json:"includeFrames,omitzero"`
	// Emit image references in the Markdown.
	IncludeImages param.Opt[bool] `json:"includeImages,omitzero"`
	// Keep hyperlinks in the Markdown.
	IncludeLinks param.Opt[bool] `json:"includeLinks,omitzero"`
	// Truncate inline base64 image payloads to keep responses small.
	ShortenBase64Images param.Opt[bool] `json:"shortenBase64Images,omitzero"`
	// Strip nav, header, footer, and sidebar — keep only the primary article content.
	UseMainContentOnly param.Opt[bool] `json:"useMainContentOnly,omitzero"`
	// PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.
	Pdf WebSearchParamsMarkdownOptionsPdf `json:"pdf,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts WebSearchParamsMarkdownOptionsTimeoutOpts `json:"timeoutOpts,omitzero"`
	// contains filtered or unexported fields
}

Inline Markdown scraping for each result. Set `enabled: true` to activate.

func (WebSearchParamsMarkdownOptions) MarshalJSON

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

func (*WebSearchParamsMarkdownOptions) UnmarshalJSON

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

type WebSearchParamsMarkdownOptionsPdf

type WebSearchParamsMarkdownOptionsPdf struct {
	// Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must
	// be >= start.
	End param.Opt[int64] `json:"end,omitzero"`
	// Parse PDF URLs. When false, PDF results are skipped with WEBSITE_ACCESS_ERROR.
	ShouldParse param.Opt[bool] `json:"shouldParse,omitzero"`
	// First 1-based PDF page to parse.
	Start param.Opt[int64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.

func (WebSearchParamsMarkdownOptionsPdf) MarshalJSON

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

func (*WebSearchParamsMarkdownOptionsPdf) UnmarshalJSON

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

type WebSearchParamsMarkdownOptionsTimeoutOpts added in v2.17.0

type WebSearchParamsMarkdownOptionsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag. "return-partial" requires at least 5000 ms.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (WebSearchParamsMarkdownOptionsTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*WebSearchParamsMarkdownOptionsTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type WebSearchParamsTimeoutOpts added in v2.17.0

type WebSearchParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (WebSearchParamsTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*WebSearchParamsTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type WebSearchParamsZdr added in v2.18.0

type WebSearchParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	WebSearchParamsZdrEnabled  WebSearchParamsZdr = "enabled"
	WebSearchParamsZdrDisabled WebSearchParamsZdr = "disabled"
)

type WebSearchResponse

type WebSearchResponse struct {
	// Whether this response came from cache.
	CacheMetadata WebSearchResponseCacheMetadata `json:"cache_metadata" api:"required"`
	// Echo of the original query (useful when fanout was enabled).
	Query string `json:"query" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string                    `json:"request_id" api:"required" format:"uuid"`
	Results   []WebSearchResponseResult `json:"results" api:"required"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebSearchResponseKeyMetadata `json:"key_metadata"`
	// True when timeoutOpts.behavior=return-partial returned the usable results
	// collected before the deadline. Partial collections are not cached as complete
	// results.
	Partial bool `json:"partial"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheMetadata respjson.Field
		Query         respjson.Field
		RequestID     respjson.Field
		Results       respjson.Field
		KeyMetadata   respjson.Field
		Partial       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebSearchResponse) RawJSON

func (r WebSearchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebSearchResponse) UnmarshalJSON

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

type WebSearchResponseCacheMetadata added in v2.13.0

type WebSearchResponseCacheMetadata struct {
	// Age of the cached data in milliseconds. Zero for miss and zdr responses.
	AgeMs int64 `json:"age_ms" api:"required"`
	// Whether the response was served from cache, required fresh work, or honored
	// zero-data-retention cache bypass.
	//
	// Any of "hit", "miss", "zdr".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AgeMs       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Whether this response came from cache.

func (WebSearchResponseCacheMetadata) RawJSON added in v2.13.0

Returns the unmodified JSON received from the API

func (*WebSearchResponseCacheMetadata) UnmarshalJSON added in v2.13.0

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

type WebSearchResponseKeyMetadata

type WebSearchResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebSearchResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebSearchResponseKeyMetadata) UnmarshalJSON

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

type WebSearchResponseResult

type WebSearchResponseResult struct {
	// Snippet excerpt from the page. Empty string when the search provider does not
	// supply a snippet.
	Description string `json:"description" api:"required"`
	// Highlights status and passages for this result.
	Highlights WebSearchResponseResultHighlights `json:"highlights" api:"required"`
	// Markdown scrape status and content for this result.
	Markdown WebSearchResponseResultMarkdown `json:"markdown" api:"required"`
	// Relevance to the original query.
	//
	// Any of "high", "medium", "low".
	Relevance string `json:"relevance" api:"required"`
	// Page title.
	Title string `json:"title" api:"required"`
	// Canonical result URL.
	URL string `json:"url" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Description respjson.Field
		Highlights  respjson.Field
		Markdown    respjson.Field
		Relevance   respjson.Field
		Title       respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebSearchResponseResult) RawJSON

func (r WebSearchResponseResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebSearchResponseResult) UnmarshalJSON

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

type WebSearchResponseResultHighlights added in v2.22.0

type WebSearchResponseResultHighlights struct {
	// Per-result highlights outcome. Inspect this before reading `highlights`.
	//
	// Any of "SUCCESS", "NOT_REQUESTED", "TIMEOUT", "CONTENT_TOO_LARGE",
	// "WEBSITE_ACCESS_ERROR", "WEBSITE_BLOCKED", "ERROR".
	Code string `json:"code" api:"required"`
	// Passages relevant to the query, in page order. Null unless
	// highlightsOptions.enabled is true and the page was read.
	Highlights []string `json:"highlights" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Highlights  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Highlights status and passages for this result.

func (WebSearchResponseResultHighlights) RawJSON added in v2.22.0

Returns the unmodified JSON received from the API

func (*WebSearchResponseResultHighlights) UnmarshalJSON added in v2.22.0

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

type WebSearchResponseResultMarkdown

type WebSearchResponseResultMarkdown struct {
	// Per-result scrape outcome. Inspect this before reading `markdown`.
	//
	// Any of "SUCCESS", "NOT_REQUESTED", "TIMEOUT", "CONTENT_TOO_LARGE",
	// "WEBSITE_ACCESS_ERROR", "WEBSITE_BLOCKED", "ERROR".
	Code string `json:"code" api:"required"`
	// GFM Markdown of the page. Null unless markdownOptions.enabled is true and
	// scraping succeeded.
	Markdown string `json:"markdown" api:"required"`
	// `loaded`, or `still-loading` when capture ended before the page finished
	// loading.
	//
	// Any of "loaded", "still-loading".
	FinalDomState string `json:"finalDOMState"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code          respjson.Field
		Markdown      respjson.Field
		FinalDomState respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Markdown scrape status and content for this result.

func (WebSearchResponseResultMarkdown) RawJSON

Returns the unmodified JSON received from the API

func (*WebSearchResponseResultMarkdown) UnmarshalJSON

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

type WebService

type WebService struct {
	// contains filtered or unexported fields
}

WebService contains methods and other services that help with interacting with the context.dev 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 NewWebService method instead.

func NewWebService

func NewWebService(opts ...option.RequestOption) (r WebService)

NewWebService 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 (*WebService) Answers added in v2.17.0

func (r *WebService) Answers(ctx context.Context, body WebAnswersParams, opts ...option.RequestOption) (res *WebAnswersResponse, err error)

Research the web and return a sourced answer in your JSON shape. Choose `fast` for a short task or `ultra` for deeper research.

func (*WebService) ExtractCompetitors

func (r *WebService) ExtractCompetitors(ctx context.Context, query WebExtractCompetitorsParams, opts ...option.RequestOption) (res *WebExtractCompetitorsResponse, err error)

Analyze a company's landing page and web search evidence to return direct competitors for the same product or market.

func (*WebService) ExtractStyleguide

func (r *WebService) ExtractStyleguide(ctx context.Context, query WebExtractStyleguideParams, opts ...option.RequestOption) (res *WebExtractStyleguideResponse, err error)

Extract colors, typography, spacing, and component styles from a website.

func (*WebService) MapURLs added in v2.20.0

func (r *WebService) MapURLs(ctx context.Context, query WebMapURLsParams, opts ...option.RequestOption) (res *WebMapURLsResponse, err error)

Discover a site's URLs, with page titles, descriptions, keywords, and language when available. Metadata can be missing on newly discovered URLs.

func (*WebService) Scrape added in v2.20.0

func (r *WebService) Scrape(ctx context.Context, body WebScrapeParams, opts ...option.RequestOption) (res *WebScrapeResponse, err error)

Scrape anything from a URL on the internet. Returns the outputs you enable in formats. Handles PDFs, DOCX, PPT, XLSX, and 40 other file formats.

func (*WebService) Screenshot

func (r *WebService) Screenshot(ctx context.Context, query WebScreenshotParams, opts ...option.RequestOption) (res *WebScreenshotResponse, err error)

Capture a screenshot of a website.

func (*WebService) Search

func (r *WebService) Search(ctx context.Context, body WebSearchParams, opts ...option.RequestOption) (res *WebSearchResponse, err error)

Search the web and optionally return page content or relevant passages with each result.

func (*WebService) WebCrawlMd

func (r *WebService) WebCrawlMd(ctx context.Context, body WebWebCrawlMdParams, opts ...option.RequestOption) (res *WebWebCrawlMdResponse, err error)

Crawl a website and return page content as Markdown. Use a batch for crawls beyond 500 pages.

type WebWebCrawlMdParams

type WebWebCrawlMdParams struct {
	// Start URL, including `http://` or `https://`.
	URL string `json:"url" api:"required" format:"uri"`
	// Maximum cache age in milliseconds. Defaults to 1 day; `0` fetches fresh.
	MaxAgeMs param.Opt[int64] `json:"maxAgeMs,omitzero"`
	// Browser wait time in milliseconds after initial page load for each crawled page.
	// Defaults to 3500 (3.5 seconds). Min: 0. Max: 30000 (30 seconds).
	WaitForMs param.Opt[int64] `json:"waitForMs,omitzero"`
	// When true, follow links on subdomains of the starting URL's domain (e.g.
	// docs.example.com when starting from example.com). www and apex are always
	// treated as equivalent.
	FollowSubdomains param.Opt[bool] `json:"followSubdomains,omitzero"`
	// When true, the contents of iframes are rendered to Markdown for each crawled
	// page.
	IncludeFrames param.Opt[bool] `json:"includeFrames,omitzero"`
	// Include image references in the Markdown output
	IncludeImages param.Opt[bool] `json:"includeImages,omitzero"`
	// Preserve hyperlinks in the Markdown output
	IncludeLinks param.Opt[bool] `json:"includeLinks,omitzero"`
	// Maximum link depth from the starting URL (0 = only the starting page)
	MaxDepth param.Opt[int64] `json:"maxDepth,omitzero"`
	// Maximum pages to crawl.
	MaxPages param.Opt[int64] `json:"maxPages,omitzero"`
	// Wait briefly for CSS animations and transitions to settle before reading each
	// page.
	SettleAnimations param.Opt[bool] `json:"settleAnimations,omitzero"`
	// Truncate base64-encoded image data in the Markdown output
	ShortenBase64Images param.Opt[bool] `json:"shortenBase64Images,omitzero"`
	// Soft crawl deadline in milliseconds. Returns pages collected before the next
	// deadline check.
	StopAfterMs param.Opt[int64] `json:"stopAfterMs,omitzero"`
	// Regex pattern. Only URLs matching this pattern will be followed and scraped. An
	// automatic prefix scope in the form ^<starting URL> follows a redirect of the
	// starting page.
	URLRegex param.Opt[string] `json:"urlRegex,omitzero"`
	// Extract only the main content, stripping headers, footers, sidebars, and
	// navigation
	UseMainContentOnly param.Opt[bool] `json:"useMainContentOnly,omitzero"`
	// Remove matching elements after inclusions. Exclusions take precedence.
	ExcludeSelectors []string `json:"excludeSelectors,omitzero"`
	// Keep matching HTML subtrees before converting each page to Markdown.
	IncludeSelectors []string `json:"includeSelectors,omitzero"`
	// Fetch from this country (ISO 3166-1 alpha-2).
	//
	// Any of "ad", "ae", "af", "ag", "ai", "al", "am", "ao", "ar", "at", "au", "aw",
	// "az", "ba", "bb", "bd", "be", "bf", "bg", "bh", "bi", "bj", "bm", "bn", "bo",
	// "bq", "br", "bs", "bw", "by", "bz", "ca", "cd", "cf", "cg", "ch", "ci", "cl",
	// "cm", "cn", "co", "cr", "cv", "cw", "cy", "cz", "de", "dj", "dk", "dm", "do",
	// "dz", "ec", "ee", "eg", "es", "et", "fi", "fj", "fr", "ga", "gb", "gd", "ge",
	// "gf", "gg", "gh", "gm", "gn", "gp", "gq", "gr", "gt", "gu", "gw", "gy", "hk",
	// "hn", "hr", "ht", "hu", "id", "ie", "il", "im", "in", "iq", "ir", "is", "it",
	// "je", "jm", "jo", "jp", "ke", "kg", "kh", "kn", "kr", "kw", "ky", "kz", "la",
	// "lb", "lc", "lk", "lr", "ls", "lt", "lu", "lv", "ly", "ma", "mc", "md", "me",
	// "mf", "mg", "mk", "ml", "mm", "mn", "mo", "mq", "mr", "mt", "mu", "mv", "mw",
	// "mx", "my", "mz", "na", "nc", "ne", "ng", "ni", "nl", "no", "np", "nz", "om",
	// "pa", "pe", "pf", "pg", "ph", "pk", "pl", "pr", "ps", "pt", "py", "qa", "re",
	// "ro", "rs", "ru", "rw", "sa", "sc", "sd", "se", "sg", "si", "sk", "sl", "sm",
	// "sn", "so", "sr", "ss", "st", "sv", "sx", "sy", "sz", "tc", "td", "tg", "th",
	// "tj", "tl", "tm", "tn", "tr", "tt", "tw", "tz", "ua", "ug", "us", "uy", "uz",
	// "vc", "ve", "vg", "vi", "vn", "ye", "yt", "za", "zm", "zw".
	Country WebWebCrawlMdParamsCountry `json:"country,omitzero"`
	// PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.
	Pdf WebWebCrawlMdParamsPdf `json:"pdf,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Request deadline and what to return when it passes.
	TimeoutOpts WebWebCrawlMdParamsTimeoutOpts `json:"timeoutOpts,omitzero"`
	// `enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless
	// your organization has ZDR.
	//
	// Any of "enabled", "disabled".
	Zdr WebWebCrawlMdParamsZdr `json:"zdr,omitzero"`
	// contains filtered or unexported fields
}

func (WebWebCrawlMdParams) MarshalJSON

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

func (*WebWebCrawlMdParams) UnmarshalJSON

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

type WebWebCrawlMdParamsCountry

type WebWebCrawlMdParamsCountry string

Fetch from this country (ISO 3166-1 alpha-2).

const (
	WebWebCrawlMdParamsCountryAd WebWebCrawlMdParamsCountry = "ad"
	WebWebCrawlMdParamsCountryAe WebWebCrawlMdParamsCountry = "ae"
	WebWebCrawlMdParamsCountryAf WebWebCrawlMdParamsCountry = "af"
	WebWebCrawlMdParamsCountryAg WebWebCrawlMdParamsCountry = "ag"
	WebWebCrawlMdParamsCountryAI WebWebCrawlMdParamsCountry = "ai"
	WebWebCrawlMdParamsCountryAl WebWebCrawlMdParamsCountry = "al"
	WebWebCrawlMdParamsCountryAm WebWebCrawlMdParamsCountry = "am"
	WebWebCrawlMdParamsCountryAo WebWebCrawlMdParamsCountry = "ao"
	WebWebCrawlMdParamsCountryAr WebWebCrawlMdParamsCountry = "ar"
	WebWebCrawlMdParamsCountryAt WebWebCrawlMdParamsCountry = "at"
	WebWebCrawlMdParamsCountryAu WebWebCrawlMdParamsCountry = "au"
	WebWebCrawlMdParamsCountryAw WebWebCrawlMdParamsCountry = "aw"
	WebWebCrawlMdParamsCountryAz WebWebCrawlMdParamsCountry = "az"
	WebWebCrawlMdParamsCountryBa WebWebCrawlMdParamsCountry = "ba"
	WebWebCrawlMdParamsCountryBb WebWebCrawlMdParamsCountry = "bb"
	WebWebCrawlMdParamsCountryBd WebWebCrawlMdParamsCountry = "bd"
	WebWebCrawlMdParamsCountryBe WebWebCrawlMdParamsCountry = "be"
	WebWebCrawlMdParamsCountryBf WebWebCrawlMdParamsCountry = "bf"
	WebWebCrawlMdParamsCountryBg WebWebCrawlMdParamsCountry = "bg"
	WebWebCrawlMdParamsCountryBh WebWebCrawlMdParamsCountry = "bh"
	WebWebCrawlMdParamsCountryBi WebWebCrawlMdParamsCountry = "bi"
	WebWebCrawlMdParamsCountryBj WebWebCrawlMdParamsCountry = "bj"
	WebWebCrawlMdParamsCountryBm WebWebCrawlMdParamsCountry = "bm"
	WebWebCrawlMdParamsCountryBn WebWebCrawlMdParamsCountry = "bn"
	WebWebCrawlMdParamsCountryBo WebWebCrawlMdParamsCountry = "bo"
	WebWebCrawlMdParamsCountryBq WebWebCrawlMdParamsCountry = "bq"
	WebWebCrawlMdParamsCountryBr WebWebCrawlMdParamsCountry = "br"
	WebWebCrawlMdParamsCountryBs WebWebCrawlMdParamsCountry = "bs"
	WebWebCrawlMdParamsCountryBw WebWebCrawlMdParamsCountry = "bw"
	WebWebCrawlMdParamsCountryBy WebWebCrawlMdParamsCountry = "by"
	WebWebCrawlMdParamsCountryBz WebWebCrawlMdParamsCountry = "bz"
	WebWebCrawlMdParamsCountryCa WebWebCrawlMdParamsCountry = "ca"
	WebWebCrawlMdParamsCountryCd WebWebCrawlMdParamsCountry = "cd"
	WebWebCrawlMdParamsCountryCf WebWebCrawlMdParamsCountry = "cf"
	WebWebCrawlMdParamsCountryCg WebWebCrawlMdParamsCountry = "cg"
	WebWebCrawlMdParamsCountryCh WebWebCrawlMdParamsCountry = "ch"
	WebWebCrawlMdParamsCountryCi WebWebCrawlMdParamsCountry = "ci"
	WebWebCrawlMdParamsCountryCl WebWebCrawlMdParamsCountry = "cl"
	WebWebCrawlMdParamsCountryCm WebWebCrawlMdParamsCountry = "cm"
	WebWebCrawlMdParamsCountryCn WebWebCrawlMdParamsCountry = "cn"
	WebWebCrawlMdParamsCountryCo WebWebCrawlMdParamsCountry = "co"
	WebWebCrawlMdParamsCountryCr WebWebCrawlMdParamsCountry = "cr"
	WebWebCrawlMdParamsCountryCv WebWebCrawlMdParamsCountry = "cv"
	WebWebCrawlMdParamsCountryCw WebWebCrawlMdParamsCountry = "cw"
	WebWebCrawlMdParamsCountryCy WebWebCrawlMdParamsCountry = "cy"
	WebWebCrawlMdParamsCountryCz WebWebCrawlMdParamsCountry = "cz"
	WebWebCrawlMdParamsCountryDe WebWebCrawlMdParamsCountry = "de"
	WebWebCrawlMdParamsCountryDj WebWebCrawlMdParamsCountry = "dj"
	WebWebCrawlMdParamsCountryDk WebWebCrawlMdParamsCountry = "dk"
	WebWebCrawlMdParamsCountryDm WebWebCrawlMdParamsCountry = "dm"
	WebWebCrawlMdParamsCountryDo WebWebCrawlMdParamsCountry = "do"
	WebWebCrawlMdParamsCountryDz WebWebCrawlMdParamsCountry = "dz"
	WebWebCrawlMdParamsCountryEc WebWebCrawlMdParamsCountry = "ec"
	WebWebCrawlMdParamsCountryEe WebWebCrawlMdParamsCountry = "ee"
	WebWebCrawlMdParamsCountryEg WebWebCrawlMdParamsCountry = "eg"
	WebWebCrawlMdParamsCountryEs WebWebCrawlMdParamsCountry = "es"
	WebWebCrawlMdParamsCountryEt WebWebCrawlMdParamsCountry = "et"
	WebWebCrawlMdParamsCountryFi WebWebCrawlMdParamsCountry = "fi"
	WebWebCrawlMdParamsCountryFj WebWebCrawlMdParamsCountry = "fj"
	WebWebCrawlMdParamsCountryFr WebWebCrawlMdParamsCountry = "fr"
	WebWebCrawlMdParamsCountryGa WebWebCrawlMdParamsCountry = "ga"
	WebWebCrawlMdParamsCountryGB WebWebCrawlMdParamsCountry = "gb"
	WebWebCrawlMdParamsCountryGd WebWebCrawlMdParamsCountry = "gd"
	WebWebCrawlMdParamsCountryGe WebWebCrawlMdParamsCountry = "ge"
	WebWebCrawlMdParamsCountryGf WebWebCrawlMdParamsCountry = "gf"
	WebWebCrawlMdParamsCountryGg WebWebCrawlMdParamsCountry = "gg"
	WebWebCrawlMdParamsCountryGh WebWebCrawlMdParamsCountry = "gh"
	WebWebCrawlMdParamsCountryGm WebWebCrawlMdParamsCountry = "gm"
	WebWebCrawlMdParamsCountryGn WebWebCrawlMdParamsCountry = "gn"
	WebWebCrawlMdParamsCountryGp WebWebCrawlMdParamsCountry = "gp"
	WebWebCrawlMdParamsCountryGq WebWebCrawlMdParamsCountry = "gq"
	WebWebCrawlMdParamsCountryGr WebWebCrawlMdParamsCountry = "gr"
	WebWebCrawlMdParamsCountryGt WebWebCrawlMdParamsCountry = "gt"
	WebWebCrawlMdParamsCountryGu WebWebCrawlMdParamsCountry = "gu"
	WebWebCrawlMdParamsCountryGw WebWebCrawlMdParamsCountry = "gw"
	WebWebCrawlMdParamsCountryGy WebWebCrawlMdParamsCountry = "gy"
	WebWebCrawlMdParamsCountryHk WebWebCrawlMdParamsCountry = "hk"
	WebWebCrawlMdParamsCountryHn WebWebCrawlMdParamsCountry = "hn"
	WebWebCrawlMdParamsCountryHr WebWebCrawlMdParamsCountry = "hr"
	WebWebCrawlMdParamsCountryHt WebWebCrawlMdParamsCountry = "ht"
	WebWebCrawlMdParamsCountryHu WebWebCrawlMdParamsCountry = "hu"
	WebWebCrawlMdParamsCountryID WebWebCrawlMdParamsCountry = "id"
	WebWebCrawlMdParamsCountryIe WebWebCrawlMdParamsCountry = "ie"
	WebWebCrawlMdParamsCountryIl WebWebCrawlMdParamsCountry = "il"
	WebWebCrawlMdParamsCountryIm WebWebCrawlMdParamsCountry = "im"
	WebWebCrawlMdParamsCountryIn WebWebCrawlMdParamsCountry = "in"
	WebWebCrawlMdParamsCountryIq WebWebCrawlMdParamsCountry = "iq"
	WebWebCrawlMdParamsCountryIr WebWebCrawlMdParamsCountry = "ir"
	WebWebCrawlMdParamsCountryIs WebWebCrawlMdParamsCountry = "is"
	WebWebCrawlMdParamsCountryIt WebWebCrawlMdParamsCountry = "it"
	WebWebCrawlMdParamsCountryJe WebWebCrawlMdParamsCountry = "je"
	WebWebCrawlMdParamsCountryJm WebWebCrawlMdParamsCountry = "jm"
	WebWebCrawlMdParamsCountryJo WebWebCrawlMdParamsCountry = "jo"
	WebWebCrawlMdParamsCountryJp WebWebCrawlMdParamsCountry = "jp"
	WebWebCrawlMdParamsCountryKe WebWebCrawlMdParamsCountry = "ke"
	WebWebCrawlMdParamsCountryKg WebWebCrawlMdParamsCountry = "kg"
	WebWebCrawlMdParamsCountryKh WebWebCrawlMdParamsCountry = "kh"
	WebWebCrawlMdParamsCountryKn WebWebCrawlMdParamsCountry = "kn"
	WebWebCrawlMdParamsCountryKr WebWebCrawlMdParamsCountry = "kr"
	WebWebCrawlMdParamsCountryKw WebWebCrawlMdParamsCountry = "kw"
	WebWebCrawlMdParamsCountryKy WebWebCrawlMdParamsCountry = "ky"
	WebWebCrawlMdParamsCountryKz WebWebCrawlMdParamsCountry = "kz"
	WebWebCrawlMdParamsCountryLa WebWebCrawlMdParamsCountry = "la"
	WebWebCrawlMdParamsCountryLb WebWebCrawlMdParamsCountry = "lb"
	WebWebCrawlMdParamsCountryLc WebWebCrawlMdParamsCountry = "lc"
	WebWebCrawlMdParamsCountryLk WebWebCrawlMdParamsCountry = "lk"
	WebWebCrawlMdParamsCountryLr WebWebCrawlMdParamsCountry = "lr"
	WebWebCrawlMdParamsCountryLs WebWebCrawlMdParamsCountry = "ls"
	WebWebCrawlMdParamsCountryLt WebWebCrawlMdParamsCountry = "lt"
	WebWebCrawlMdParamsCountryLu WebWebCrawlMdParamsCountry = "lu"
	WebWebCrawlMdParamsCountryLv WebWebCrawlMdParamsCountry = "lv"
	WebWebCrawlMdParamsCountryLy WebWebCrawlMdParamsCountry = "ly"
	WebWebCrawlMdParamsCountryMa WebWebCrawlMdParamsCountry = "ma"
	WebWebCrawlMdParamsCountryMc WebWebCrawlMdParamsCountry = "mc"
	WebWebCrawlMdParamsCountryMd WebWebCrawlMdParamsCountry = "md"
	WebWebCrawlMdParamsCountryMe WebWebCrawlMdParamsCountry = "me"
	WebWebCrawlMdParamsCountryMf WebWebCrawlMdParamsCountry = "mf"
	WebWebCrawlMdParamsCountryMg WebWebCrawlMdParamsCountry = "mg"
	WebWebCrawlMdParamsCountryMk WebWebCrawlMdParamsCountry = "mk"
	WebWebCrawlMdParamsCountryMl WebWebCrawlMdParamsCountry = "ml"
	WebWebCrawlMdParamsCountryMm WebWebCrawlMdParamsCountry = "mm"
	WebWebCrawlMdParamsCountryMn WebWebCrawlMdParamsCountry = "mn"
	WebWebCrawlMdParamsCountryMo WebWebCrawlMdParamsCountry = "mo"
	WebWebCrawlMdParamsCountryMq WebWebCrawlMdParamsCountry = "mq"
	WebWebCrawlMdParamsCountryMr WebWebCrawlMdParamsCountry = "mr"
	WebWebCrawlMdParamsCountryMt WebWebCrawlMdParamsCountry = "mt"
	WebWebCrawlMdParamsCountryMu WebWebCrawlMdParamsCountry = "mu"
	WebWebCrawlMdParamsCountryMv WebWebCrawlMdParamsCountry = "mv"
	WebWebCrawlMdParamsCountryMw WebWebCrawlMdParamsCountry = "mw"
	WebWebCrawlMdParamsCountryMx WebWebCrawlMdParamsCountry = "mx"
	WebWebCrawlMdParamsCountryMy WebWebCrawlMdParamsCountry = "my"
	WebWebCrawlMdParamsCountryMz WebWebCrawlMdParamsCountry = "mz"
	WebWebCrawlMdParamsCountryNa WebWebCrawlMdParamsCountry = "na"
	WebWebCrawlMdParamsCountryNc WebWebCrawlMdParamsCountry = "nc"
	WebWebCrawlMdParamsCountryNe WebWebCrawlMdParamsCountry = "ne"
	WebWebCrawlMdParamsCountryNg WebWebCrawlMdParamsCountry = "ng"
	WebWebCrawlMdParamsCountryNi WebWebCrawlMdParamsCountry = "ni"
	WebWebCrawlMdParamsCountryNl WebWebCrawlMdParamsCountry = "nl"
	WebWebCrawlMdParamsCountryNo WebWebCrawlMdParamsCountry = "no"
	WebWebCrawlMdParamsCountryNp WebWebCrawlMdParamsCountry = "np"
	WebWebCrawlMdParamsCountryNz WebWebCrawlMdParamsCountry = "nz"
	WebWebCrawlMdParamsCountryOm WebWebCrawlMdParamsCountry = "om"
	WebWebCrawlMdParamsCountryPa WebWebCrawlMdParamsCountry = "pa"
	WebWebCrawlMdParamsCountryPe WebWebCrawlMdParamsCountry = "pe"
	WebWebCrawlMdParamsCountryPf WebWebCrawlMdParamsCountry = "pf"
	WebWebCrawlMdParamsCountryPg WebWebCrawlMdParamsCountry = "pg"
	WebWebCrawlMdParamsCountryPh WebWebCrawlMdParamsCountry = "ph"
	WebWebCrawlMdParamsCountryPk WebWebCrawlMdParamsCountry = "pk"
	WebWebCrawlMdParamsCountryPl WebWebCrawlMdParamsCountry = "pl"
	WebWebCrawlMdParamsCountryPr WebWebCrawlMdParamsCountry = "pr"
	WebWebCrawlMdParamsCountryPs WebWebCrawlMdParamsCountry = "ps"
	WebWebCrawlMdParamsCountryPt WebWebCrawlMdParamsCountry = "pt"
	WebWebCrawlMdParamsCountryPy WebWebCrawlMdParamsCountry = "py"
	WebWebCrawlMdParamsCountryQa WebWebCrawlMdParamsCountry = "qa"
	WebWebCrawlMdParamsCountryRe WebWebCrawlMdParamsCountry = "re"
	WebWebCrawlMdParamsCountryRo WebWebCrawlMdParamsCountry = "ro"
	WebWebCrawlMdParamsCountryRs WebWebCrawlMdParamsCountry = "rs"
	WebWebCrawlMdParamsCountryRu WebWebCrawlMdParamsCountry = "ru"
	WebWebCrawlMdParamsCountryRw WebWebCrawlMdParamsCountry = "rw"
	WebWebCrawlMdParamsCountrySa WebWebCrawlMdParamsCountry = "sa"
	WebWebCrawlMdParamsCountrySc WebWebCrawlMdParamsCountry = "sc"
	WebWebCrawlMdParamsCountrySd WebWebCrawlMdParamsCountry = "sd"
	WebWebCrawlMdParamsCountrySe WebWebCrawlMdParamsCountry = "se"
	WebWebCrawlMdParamsCountrySg WebWebCrawlMdParamsCountry = "sg"
	WebWebCrawlMdParamsCountrySi WebWebCrawlMdParamsCountry = "si"
	WebWebCrawlMdParamsCountrySk WebWebCrawlMdParamsCountry = "sk"
	WebWebCrawlMdParamsCountrySl WebWebCrawlMdParamsCountry = "sl"
	WebWebCrawlMdParamsCountrySm WebWebCrawlMdParamsCountry = "sm"
	WebWebCrawlMdParamsCountrySn WebWebCrawlMdParamsCountry = "sn"
	WebWebCrawlMdParamsCountrySo WebWebCrawlMdParamsCountry = "so"
	WebWebCrawlMdParamsCountrySr WebWebCrawlMdParamsCountry = "sr"
	WebWebCrawlMdParamsCountrySS WebWebCrawlMdParamsCountry = "ss"
	WebWebCrawlMdParamsCountrySt WebWebCrawlMdParamsCountry = "st"
	WebWebCrawlMdParamsCountrySv WebWebCrawlMdParamsCountry = "sv"
	WebWebCrawlMdParamsCountrySx WebWebCrawlMdParamsCountry = "sx"
	WebWebCrawlMdParamsCountrySy WebWebCrawlMdParamsCountry = "sy"
	WebWebCrawlMdParamsCountrySz WebWebCrawlMdParamsCountry = "sz"
	WebWebCrawlMdParamsCountryTc WebWebCrawlMdParamsCountry = "tc"
	WebWebCrawlMdParamsCountryTd WebWebCrawlMdParamsCountry = "td"
	WebWebCrawlMdParamsCountryTg WebWebCrawlMdParamsCountry = "tg"
	WebWebCrawlMdParamsCountryTh WebWebCrawlMdParamsCountry = "th"
	WebWebCrawlMdParamsCountryTj WebWebCrawlMdParamsCountry = "tj"
	WebWebCrawlMdParamsCountryTl WebWebCrawlMdParamsCountry = "tl"
	WebWebCrawlMdParamsCountryTm WebWebCrawlMdParamsCountry = "tm"
	WebWebCrawlMdParamsCountryTn WebWebCrawlMdParamsCountry = "tn"
	WebWebCrawlMdParamsCountryTr WebWebCrawlMdParamsCountry = "tr"
	WebWebCrawlMdParamsCountryTt WebWebCrawlMdParamsCountry = "tt"
	WebWebCrawlMdParamsCountryTw WebWebCrawlMdParamsCountry = "tw"
	WebWebCrawlMdParamsCountryTz WebWebCrawlMdParamsCountry = "tz"
	WebWebCrawlMdParamsCountryUa WebWebCrawlMdParamsCountry = "ua"
	WebWebCrawlMdParamsCountryUg WebWebCrawlMdParamsCountry = "ug"
	WebWebCrawlMdParamsCountryUs WebWebCrawlMdParamsCountry = "us"
	WebWebCrawlMdParamsCountryUy WebWebCrawlMdParamsCountry = "uy"
	WebWebCrawlMdParamsCountryUz WebWebCrawlMdParamsCountry = "uz"
	WebWebCrawlMdParamsCountryVc WebWebCrawlMdParamsCountry = "vc"
	WebWebCrawlMdParamsCountryVe WebWebCrawlMdParamsCountry = "ve"
	WebWebCrawlMdParamsCountryVg WebWebCrawlMdParamsCountry = "vg"
	WebWebCrawlMdParamsCountryVi WebWebCrawlMdParamsCountry = "vi"
	WebWebCrawlMdParamsCountryVn WebWebCrawlMdParamsCountry = "vn"
	WebWebCrawlMdParamsCountryYe WebWebCrawlMdParamsCountry = "ye"
	WebWebCrawlMdParamsCountryYt WebWebCrawlMdParamsCountry = "yt"
	WebWebCrawlMdParamsCountryZa WebWebCrawlMdParamsCountry = "za"
	WebWebCrawlMdParamsCountryZm WebWebCrawlMdParamsCountry = "zm"
	WebWebCrawlMdParamsCountryZw WebWebCrawlMdParamsCountry = "zw"
)

type WebWebCrawlMdParamsPdf

type WebWebCrawlMdParamsPdf struct {
	// Last PDF page to parse (1-based, inclusive). Defaults to the final page. Must
	// be >= start.
	End param.Opt[int64] `json:"end,omitzero"`
	// Read scanned PDF pages with OCR; preserve pages that already have text.
	Ocr param.Opt[bool] `json:"ocr,omitzero"`
	// When true, PDF pages are fetched and parsed. When false, PDF pages are skipped
	// entirely (not included in results and not counted as failures).
	ShouldParse param.Opt[bool] `json:"shouldParse,omitzero"`
	// First 1-based PDF page to parse.
	Start param.Opt[int64] `json:"start,omitzero"`
	// contains filtered or unexported fields
}

PDF handling. `start`/`end` limit parsing to an inclusive, 1-based page range.

func (WebWebCrawlMdParamsPdf) MarshalJSON

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

func (*WebWebCrawlMdParamsPdf) UnmarshalJSON

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

type WebWebCrawlMdParamsTimeoutOpts added in v2.17.0

type WebWebCrawlMdParamsTimeoutOpts struct {
	// Deadline in milliseconds.
	Milliseconds int64 `json:"milliseconds" api:"required"`
	// "fail" returns 408 at the deadline. "return-partial" returns available results;
	// inspect the response’s partial flag.
	//
	// Any of "fail", "return-partial".
	Behavior string `json:"behavior,omitzero"`
	// contains filtered or unexported fields
}

Request deadline and what to return when it passes.

The property Milliseconds is required.

func (WebWebCrawlMdParamsTimeoutOpts) MarshalJSON added in v2.17.0

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

func (*WebWebCrawlMdParamsTimeoutOpts) UnmarshalJSON added in v2.17.0

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

type WebWebCrawlMdParamsZdr added in v2.5.0

type WebWebCrawlMdParamsZdr string

`enabled` turns on zero data retention. Returns 403 `ZDR_NOT_ENABLED` unless your organization has ZDR.

const (
	WebWebCrawlMdParamsZdrEnabled  WebWebCrawlMdParamsZdr = "enabled"
	WebWebCrawlMdParamsZdrDisabled WebWebCrawlMdParamsZdr = "disabled"
)

type WebWebCrawlMdResponse

type WebWebCrawlMdResponse struct {
	// Whether this response came from cache.
	CacheMetadata WebWebCrawlMdResponseCacheMetadata `json:"cache_metadata" api:"required"`
	Metadata      WebWebCrawlMdResponseMetadata      `json:"metadata" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string                        `json:"request_id" api:"required" format:"uuid"`
	Results   []WebWebCrawlMdResponseResult `json:"results" api:"required"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebWebCrawlMdResponseKeyMetadata `json:"key_metadata"`
	// True when timeoutOpts.behavior=return-partial returned the usable results
	// collected before the deadline. Partial collections are not cached as complete
	// results.
	Partial bool `json:"partial"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CacheMetadata respjson.Field
		Metadata      respjson.Field
		RequestID     respjson.Field
		Results       respjson.Field
		KeyMetadata   respjson.Field
		Partial       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponse) RawJSON

func (r WebWebCrawlMdResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponse) UnmarshalJSON

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

type WebWebCrawlMdResponseCacheMetadata added in v2.13.0

type WebWebCrawlMdResponseCacheMetadata struct {
	// Age of the cached data in milliseconds. Zero for miss and zdr responses.
	AgeMs int64 `json:"age_ms" api:"required"`
	// Whether the response was served from cache, required fresh work, or honored
	// zero-data-retention cache bypass.
	//
	// Any of "hit", "miss", "zdr".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AgeMs       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Whether this response came from cache.

func (WebWebCrawlMdResponseCacheMetadata) RawJSON added in v2.13.0

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseCacheMetadata) UnmarshalJSON added in v2.13.0

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

type WebWebCrawlMdResponseKeyMetadata

type WebWebCrawlMdResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebWebCrawlMdResponseKeyMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseKeyMetadata) UnmarshalJSON

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

type WebWebCrawlMdResponseMetadata

type WebWebCrawlMdResponseMetadata struct {
	// Maximum crawl depth reached during the crawl
	MaxCrawlDepth int64 `json:"maxCrawlDepth" api:"required"`
	// Number of pages that failed to crawl
	NumFailed int64 `json:"numFailed" api:"required"`
	// Number of URLs skipped (PDFs when pdf.shouldParse=false, or URLs not matching
	// urlRegex)
	NumSkipped int64 `json:"numSkipped" api:"required"`
	// Number of pages successfully crawled
	NumSucceeded int64 `json:"numSucceeded" api:"required"`
	// Total number of URLs crawled
	NumURLs int64 `json:"numUrls" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		MaxCrawlDepth respjson.Field
		NumFailed     respjson.Field
		NumSkipped    respjson.Field
		NumSucceeded  respjson.Field
		NumURLs       respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponseMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseMetadata) UnmarshalJSON

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

type WebWebCrawlMdResponseResult

type WebWebCrawlMdResponseResult struct {
	// Extracted page content as Markdown (empty string on failure)
	Markdown string                              `json:"markdown" api:"required"`
	Metadata WebWebCrawlMdResponseResultMetadata `json:"metadata" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Markdown    respjson.Field
		Metadata    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponseResult) RawJSON

func (r WebWebCrawlMdResponseResult) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResult) UnmarshalJSON

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

type WebWebCrawlMdResponseResultMetadata

type WebWebCrawlMdResponseResultMetadata struct {
	// Depth relative to the start URL. 0 = start URL, 1 = one link away.
	CrawlDepth int64 `json:"crawlDepth" api:"required"`
	// Final URL scraped after redirects or scraper fallback, when known. Falls back to
	// sourceUrl when unavailable.
	FinalURL string `json:"finalUrl" api:"required"`
	// Original URL requested by the caller.
	SourceURL string `json:"sourceUrl" api:"required"`
	// HTTP status code of the response
	StatusCode int64 `json:"statusCode" api:"required"`
	// true if the page was fetched and parsed successfully
	Success bool `json:"success" api:"required"`
	// Best page title extracted from the page (empty string if unavailable).
	Title string `json:"title" api:"required"`
	// The crawl URL fetched for this page.
	URL string `json:"url" api:"required"`
	// Additional non-social meta tags not promoted to top-level metadata fields.
	AdditionalMeta map[string]WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion `json:"additionalMeta"`
	// Resolved alternate links from link rel=alternate tags.
	Alternates []WebWebCrawlMdResponseResultMetadataAlternate `json:"alternates"`
	// Author metadata, when present.
	Author string `json:"author"`
	// Resolved canonical URL, when present.
	CanonicalURL string `json:"canonicalUrl"`
	// Best description extracted from standard, Open Graph, or Twitter metadata.
	Description string `json:"description"`
	// Resolved favicon URL, when present.
	Favicon string `json:"favicon"`
	// Page headings (h1–h6) in document order, extracted from the unfiltered document.
	// Capped at the first 500 headings. Omitted when the page has none.
	Headings []WebWebCrawlMdResponseResultMetadataHeading `json:"headings"`
	// Primary resolved preview image from Open Graph, Twitter, or image metadata.
	Image string `json:"image"`
	// JSON-LD structured data blocks parsed from the page.
	JsonLd []map[string]any `json:"jsonLd"`
	// Keywords extracted from the page's keywords meta tag.
	Keywords []string `json:"keywords"`
	// Language extracted from html lang or language meta tags.
	Language string `json:"language"`
	// Modified timestamp/date from page metadata, when present.
	ModifiedTime string `json:"modifiedTime"`
	// Open Graph metadata with the og: prefix removed and keys camel-cased.
	OpenGraph map[string]WebWebCrawlMdResponseResultMetadataOpenGraphUnion `json:"openGraph"`
	// Published timestamp/date from page metadata, when present.
	PublishedTime string `json:"publishedTime"`
	// Robots meta directive, when present.
	Robots string `json:"robots"`
	// Site or application name from page metadata.
	SiteName string `json:"siteName"`
	// Twitter card metadata with the twitter: prefix removed and keys camel-cased.
	Twitter map[string]WebWebCrawlMdResponseResultMetadataTwitterUnion `json:"twitter"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CrawlDepth     respjson.Field
		FinalURL       respjson.Field
		SourceURL      respjson.Field
		StatusCode     respjson.Field
		Success        respjson.Field
		Title          respjson.Field
		URL            respjson.Field
		AdditionalMeta respjson.Field
		Alternates     respjson.Field
		Author         respjson.Field
		CanonicalURL   respjson.Field
		Description    respjson.Field
		Favicon        respjson.Field
		Headings       respjson.Field
		Image          respjson.Field
		JsonLd         respjson.Field
		Keywords       respjson.Field
		Language       respjson.Field
		ModifiedTime   respjson.Field
		OpenGraph      respjson.Field
		PublishedTime  respjson.Field
		Robots         respjson.Field
		SiteName       respjson.Field
		Twitter        respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponseResultMetadata) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadata) UnmarshalJSON

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

type WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion

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

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

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

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

func (WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) AsString

func (WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) AsStringArray

func (WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadataAdditionalMetaUnion) UnmarshalJSON

type WebWebCrawlMdResponseResultMetadataAlternate

type WebWebCrawlMdResponseResultMetadataAlternate struct {
	// Resolved alternate URL.
	Href string `json:"href" api:"required"`
	// Language or locale for the alternate URL, when present.
	Hreflang string `json:"hreflang"`
	// Alternate resource title, when present.
	Title string `json:"title"`
	// Alternate resource MIME type, when present.
	Type string `json:"type"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Href        respjson.Field
		Hreflang    respjson.Field
		Title       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponseResultMetadataAlternate) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadataAlternate) UnmarshalJSON

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

type WebWebCrawlMdResponseResultMetadataHeading added in v2.10.0

type WebWebCrawlMdResponseResultMetadataHeading struct {
	// Heading level, 1–6 (from h1–h6).
	Level int64 `json:"level" api:"required"`
	// Heading text with whitespace collapsed, truncated to 1000 characters.
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Level       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebWebCrawlMdResponseResultMetadataHeading) RawJSON added in v2.10.0

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadataHeading) UnmarshalJSON added in v2.10.0

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

type WebWebCrawlMdResponseResultMetadataOpenGraphUnion

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

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

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

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

func (WebWebCrawlMdResponseResultMetadataOpenGraphUnion) AsString

func (WebWebCrawlMdResponseResultMetadataOpenGraphUnion) AsStringArray

func (WebWebCrawlMdResponseResultMetadataOpenGraphUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadataOpenGraphUnion) UnmarshalJSON

type WebWebCrawlMdResponseResultMetadataTwitterUnion

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

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

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

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

func (WebWebCrawlMdResponseResultMetadataTwitterUnion) AsString

func (WebWebCrawlMdResponseResultMetadataTwitterUnion) AsStringArray

func (WebWebCrawlMdResponseResultMetadataTwitterUnion) RawJSON

Returns the unmodified JSON received from the API

func (*WebWebCrawlMdResponseResultMetadataTwitterUnion) UnmarshalJSON

type WebhookDelivery added in v2.3.0

type WebhookDelivery struct {
	AttemptedAt time.Time            `json:"attempted_at" api:"required" format:"date-time"`
	Error       WebhookDeliveryError `json:"error" api:"required"`
	// The event this delivery carried. Deliveries recorded before event selection
	// existed report change.detected.
	//
	// Any of "change.detected", "run.completed".
	Event WebhookDeliveryEvent `json:"event" api:"required"`
	// Identifier sent in the X-Context-Id header.
	EventID string `json:"event_id" api:"required"`
	// The endpoint's final HTTP response status, or null when no response was
	// received.
	HTTPStatus int64 `json:"http_status" api:"required"`
	// Outcome of the delivery attempt. Any 2xx response counts as delivered.
	//
	// Any of "delivered", "rejected", "failed", "skipped_unsafe_url".
	Status WebhookDeliveryStatus `json:"status" api:"required"`
	// Delivery ID for status checks and retries, when available.
	DeliveryID string `json:"delivery_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AttemptedAt respjson.Field
		Error       respjson.Field
		Event       respjson.Field
		EventID     respjson.Field
		HTTPStatus  respjson.Field
		Status      respjson.Field
		DeliveryID  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookDelivery) RawJSON added in v2.3.0

func (r WebhookDelivery) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookDelivery) UnmarshalJSON added in v2.3.0

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

type WebhookDeliveryError added in v2.3.0

type WebhookDeliveryError struct {
	Code    string `json:"code" api:"required"`
	Message string `json:"message" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Code        respjson.Field
		Message     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookDeliveryError) RawJSON added in v2.3.0

func (r WebhookDeliveryError) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookDeliveryError) UnmarshalJSON added in v2.3.0

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

type WebhookDeliveryEvent added in v2.3.0

type WebhookDeliveryEvent string

The event this delivery carried. Deliveries recorded before event selection existed report change.detected.

const (
	WebhookDeliveryEventChangeDetected WebhookDeliveryEvent = "change.detected"
	WebhookDeliveryEventRunCompleted   WebhookDeliveryEvent = "run.completed"
)

type WebhookDeliveryGetParams added in v2.15.0

type WebhookDeliveryGetParams struct {
	// Comma-separated labels for filtering usage, e.g. `production,team-alpha`.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebhookDeliveryGetParams) URLQuery added in v2.15.0

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

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

type WebhookDeliveryGetResponse added in v2.15.0

type WebhookDeliveryGetResponse struct {
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebhookDeliveryGetResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
	Delivery
}

func (WebhookDeliveryGetResponse) RawJSON added in v2.15.0

func (r WebhookDeliveryGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookDeliveryGetResponse) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryGetResponseKeyMetadata added in v2.15.0

type WebhookDeliveryGetResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebhookDeliveryGetResponseKeyMetadata) RawJSON added in v2.15.0

Returns the unmodified JSON received from the API

func (*WebhookDeliveryGetResponseKeyMetadata) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryListAttemptsParams added in v2.15.0

type WebhookDeliveryListAttemptsParams struct {
	// The next_cursor from the previous response.
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Number of attempts to return.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Comma-separated labels for filtering usage, e.g. `production,team-alpha`.
	Tags []string `query:"tags,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebhookDeliveryListAttemptsParams) URLQuery added in v2.15.0

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

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

type WebhookDeliveryListAttemptsResponse added in v2.15.0

type WebhookDeliveryListAttemptsResponse struct {
	// Delivery attempts.
	Data []Attempt `json:"data" api:"required"`
	// Whether more attempts are available.
	HasMore bool `json:"has_more" api:"required"`
	// Next page cursor, or null on the last page.
	NextCursor string `json:"next_cursor" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebhookDeliveryListAttemptsResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookDeliveryListAttemptsResponse) RawJSON added in v2.15.0

Returns the unmodified JSON received from the API

func (*WebhookDeliveryListAttemptsResponse) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryListAttemptsResponseKeyMetadata added in v2.15.0

type WebhookDeliveryListAttemptsResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebhookDeliveryListAttemptsResponseKeyMetadata) RawJSON added in v2.15.0

Returns the unmodified JSON received from the API

func (*WebhookDeliveryListAttemptsResponseKeyMetadata) UnmarshalJSON added in v2.15.0

type WebhookDeliveryListParams added in v2.15.0

type WebhookDeliveryListParams struct {

	// This field is a request body variant, only one variant field can be set.
	OfBatch *WebhookDeliveryListParamsBodyBatch `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfMonitor *WebhookDeliveryListParamsBodyMonitor `json:",inline"`
	// contains filtered or unexported fields
}

func (WebhookDeliveryListParams) MarshalJSON added in v2.15.0

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

func (*WebhookDeliveryListParams) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryListParamsBodyBatch added in v2.15.0

type WebhookDeliveryListParamsBodyBatch struct {
	// Filter by batch ID.
	BatchID param.Opt[string] `json:"batch_id,omitzero"`
	// Only include events created after this ISO 8601 timestamp.
	CreatedAfter param.Opt[time.Time] `json:"created_after,omitzero" format:"date-time"`
	// The next_cursor from the previous response.
	Cursor param.Opt[string] `json:"cursor,omitzero"`
	// Number of deliveries to return.
	Limit param.Opt[int64] `json:"limit,omitzero"`
	// Filter by delivery status.
	//
	// Any of "pending", "delivering", "retrying", "delivered", "failed", "cancelled".
	Status string `json:"status,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Delivery source.
	//
	// This field can be elided, and will marshal its zero value as "batch".
	Type constant.Batch `json:"type" default:"batch"`
	// contains filtered or unexported fields
}

The property Type is required.

func (WebhookDeliveryListParamsBodyBatch) MarshalJSON added in v2.15.0

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

func (*WebhookDeliveryListParamsBodyBatch) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryListParamsBodyMonitor added in v2.15.0

type WebhookDeliveryListParamsBodyMonitor struct {
	// Only include events created after this ISO 8601 timestamp.
	CreatedAfter param.Opt[time.Time] `json:"created_after,omitzero" format:"date-time"`
	// The next_cursor from the previous response.
	Cursor param.Opt[string] `json:"cursor,omitzero"`
	// Number of deliveries to return.
	Limit param.Opt[int64] `json:"limit,omitzero"`
	// Filter by monitor ID.
	MonitorID param.Opt[string] `json:"monitor_id,omitzero"`
	// Filter by monitor run ID.
	RunID param.Opt[string] `json:"run_id,omitzero"`
	// Filter by delivery status.
	//
	// Any of "pending", "delivering", "retrying", "delivered", "failed", "cancelled".
	Status string `json:"status,omitzero"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// Delivery source.
	//
	// This field can be elided, and will marshal its zero value as "monitor".
	Type constant.Monitor `json:"type" default:"monitor"`
	// contains filtered or unexported fields
}

The property Type is required.

func (WebhookDeliveryListParamsBodyMonitor) MarshalJSON added in v2.15.0

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

func (*WebhookDeliveryListParamsBodyMonitor) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryListResponse added in v2.15.0

type WebhookDeliveryListResponse struct {
	// Webhook deliveries.
	Data []DeliverySummary `json:"data" api:"required"`
	// Whether more deliveries are available.
	HasMore bool `json:"has_more" api:"required"`
	// Next page cursor, or null on the last page.
	NextCursor string `json:"next_cursor" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebhookDeliveryListResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookDeliveryListResponse) RawJSON added in v2.15.0

func (r WebhookDeliveryListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*WebhookDeliveryListResponse) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryListResponseKeyMetadata added in v2.15.0

type WebhookDeliveryListResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebhookDeliveryListResponseKeyMetadata) RawJSON added in v2.15.0

Returns the unmodified JSON received from the API

func (*WebhookDeliveryListResponseKeyMetadata) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryRetryParams added in v2.15.0

type WebhookDeliveryRetryParams struct {
	// Resend even if the delivery already succeeded. Defaults to false.
	Force param.Opt[bool] `json:"force,omitzero"`
	// Unique key to prevent duplicate retry requests.
	IdempotencyKey param.Opt[string] `header:"Idempotency-Key,omitzero" json:"-"`
	// Labels for filtering usage in the dashboard.
	Tags []string `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (WebhookDeliveryRetryParams) MarshalJSON added in v2.15.0

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

func (*WebhookDeliveryRetryParams) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryRetryResponse added in v2.15.0

type WebhookDeliveryRetryResponse struct {
	// Delivery ID.
	ID string `json:"id" api:"required"`
	// Unique ID of this request, also in `X-Request-Id`. Include it when contacting
	// support.
	RequestID string `json:"request_id" api:"required" format:"uuid"`
	// Credits this request used and your remaining balance.
	KeyMetadata WebhookDeliveryRetryResponseKeyMetadata `json:"key_metadata"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		RequestID   respjson.Field
		KeyMetadata respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WebhookDeliveryRetryResponse) RawJSON added in v2.15.0

Returns the unmodified JSON received from the API

func (*WebhookDeliveryRetryResponse) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryRetryResponseKeyMetadata added in v2.15.0

type WebhookDeliveryRetryResponseKeyMetadata struct {
	// Credits charged for this request.
	CreditsConsumed int64 `json:"credits_consumed" api:"required"`
	// Credits remaining for your organization.
	CreditsRemaining int64 `json:"credits_remaining" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditsConsumed  respjson.Field
		CreditsRemaining respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Credits this request used and your remaining balance.

func (WebhookDeliveryRetryResponseKeyMetadata) RawJSON added in v2.15.0

Returns the unmodified JSON received from the API

func (*WebhookDeliveryRetryResponseKeyMetadata) UnmarshalJSON added in v2.15.0

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

type WebhookDeliveryService added in v2.15.0

type WebhookDeliveryService struct {
	// contains filtered or unexported fields
}

Inspect and retry batch and monitor webhook deliveries.

WebhookDeliveryService contains methods and other services that help with interacting with the context.dev 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 NewWebhookDeliveryService method instead.

func NewWebhookDeliveryService added in v2.15.0

func NewWebhookDeliveryService(opts ...option.RequestOption) (r WebhookDeliveryService)

NewWebhookDeliveryService 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 (*WebhookDeliveryService) Get added in v2.15.0

Retrieve a webhook delivery’s status and original payload.

func (*WebhookDeliveryService) List added in v2.15.0

List batch and monitor webhook deliveries from the last 30 days.

func (*WebhookDeliveryService) ListAttempts added in v2.15.0

List a delivery’s attempts, newest first.

func (*WebhookDeliveryService) Retry added in v2.15.0

Resend the original payload using the source’s current URL and secret. Available for 7 days after the event.

type WebhookDeliveryStatus added in v2.3.0

type WebhookDeliveryStatus string

Outcome of the delivery attempt. Any 2xx response counts as delivered.

const (
	WebhookDeliveryStatusDelivered        WebhookDeliveryStatus = "delivered"
	WebhookDeliveryStatusRejected         WebhookDeliveryStatus = "rejected"
	WebhookDeliveryStatusFailed           WebhookDeliveryStatus = "failed"
	WebhookDeliveryStatusSkippedUnsafeURL WebhookDeliveryStatus = "skipped_unsafe_url"
)

type WebhookService added in v2.15.0

type WebhookService struct {

	// Inspect and retry batch and monitor webhook deliveries.
	Deliveries WebhookDeliveryService
	// contains filtered or unexported fields
}

WebhookService contains methods and other services that help with interacting with the context.dev 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 NewWebhookService method instead.

func NewWebhookService added in v2.15.0

func NewWebhookService(opts ...option.RequestOption) (r WebhookService)

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

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages
shared

Jump to

Keyboard shortcuts

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